@xiaobuyu/nodesign 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server/api/assets/helpers.js +18 -0
- package/server/api/assets/notes.js +50 -0
- package/server/api/assets.js +11 -6
- package/server/api/instruction.js +3 -3
- package/server/engine/agent/events.js +11 -1
- package/server/engine/agent/hooks/failure.js +11 -1
- package/server/engine/agent/hooks/lifecycle.js +10 -39
- package/server/engine/agent/hooks/post-guidance.js +4 -38
- package/server/engine/agent/hooks/user-prompt-submit.js +11 -40
- package/server/engine/agent/hooks.js +4 -8
- package/server/engine/agent/memory-config.js +61 -0
- package/server/engine/agent/prompts/nodesign-prelude.md +14 -12
- package/server/engine/agent/prompts/tools/generate-image-cookbook.md +24 -7
- package/server/engine/agent/prompts/tools/site-reference.md +13 -3
- package/server/engine/agent/session-loop.js +29 -18
- package/server/engine/agents/explorer.md +1 -1
- package/server/engine/agents/index.js +1 -1
- package/server/engine/mcp/index.js +4 -11
- package/server/engine/mcp/tools/arrange-on-board.js +3 -1
- package/server/engine/mcp/tools/browse-computer.js +2 -1
- package/server/engine/mcp/tools/browse-find-batch.js +20 -3
- package/server/engine/mcp/tools/browse.js +24 -2
- package/server/engine/mcp/tools/crystallize-skill.js +1 -1
- package/server/engine/mcp/tools/generate-image.js +50 -70
- package/server/engine/mcp/tools/helpers/codex-imagegen.js +139 -0
- package/server/engine/mcp/tools/helpers/rembg.js +7 -2
- package/server/engine/mcp/tools/helpers/shot-pipeline.js +109 -0
- package/server/engine/mcp/tools/list-pages.js +11 -5
- package/server/engine/mcp/tools/organize-board.js +26 -1
- package/server/engine/mcp/tools/pin-to-board.js +26 -17
- package/server/engine/mcp/tools/read-board.js +19 -5
- package/server/engine/mcp/tools/relate-on-board.js +42 -4
- package/server/engine/mcp/tools/report-issue.js +14 -7
- package/server/engine/mcp/tools/screenshot.js +17 -7
- package/server/engine/mcp/tools/sketch-on-board.js +13 -5
- package/server/engine/mcp/tools/web-search.js +11 -15
- package/server/engine/mcp/tools/write-on-board.js +15 -6
- package/server/engine/plugins/nodesign/skills/deskskill-engine-mini/SKILL.md +3 -4
- package/server/engine/plugins/nodesign/skills/docx-craft/SKILL.md +10 -1
- package/server/engine/plugins/nodesign/skills/docx-craft/references/token-schema.md +16 -0
- package/server/engine/plugins/nodesign/skills/site-craft/SKILL.md +4 -4
- package/server/index.js +0 -2
- package/server/lib/artifact-target.js +31 -14
- package/server/lib/board-kind-sizes.js +2 -3
- package/server/lib/canvas-id.js +29 -4
- package/server/lib/export-collect.js +3 -1
- package/server/lib/issues-store.js +3 -1
- package/server/lib/kinds/docx.js +11 -4
- package/server/lib/kinds/index.js +6 -16
- package/server/lib/kinds/site.js +40 -7
- package/server/lib/rewrite-refs.js +110 -0
- package/server/lib/ssrf-guard.js +9 -0
- package/server/lib/task-scan.js +18 -0
- package/server/projects/board-store.js +42 -1
- package/server/projects/memory-migration.js +85 -0
- package/server/projects/move-entry.js +11 -1
- package/server/projects/ui-config.js +2 -1
- package/server/projects/workspace-templates.js +13 -10
- package/server/projects/workspace.js +15 -15
- package/server/services/rembg-launcher.js +5 -2
- package/web/dist/assets/{BrowserWindow-P_vIdh-G.js → BrowserWindow-BoOBaIyz.js} +1 -1
- package/web/dist/assets/DeckWindow-Bg3rgkvi.js +11 -0
- package/web/dist/assets/{DocxWindow-DSAU1-tD.js → DocxWindow-B_u6aX9o.js} +1 -1
- package/web/dist/assets/{MermaidBlock-DR1GikCv.js → MermaidBlock-BO-46Du5.js} +6 -6
- package/web/dist/assets/{SiteWindow-92uBuRRR.js → SiteWindow-ConPmzdM.js} +1 -1
- package/web/dist/assets/{abnfDiagram-VCTEODGH-uA8Esix4.js → abnfDiagram-VCTEODGH-FCO9yf-n.js} +1 -1
- package/web/dist/assets/{arc-D_khH_xN.js → arc-BLcEOSRX.js} +1 -1
- package/web/dist/assets/{architectureDiagram-5GKGNRK7-DydJHqOt.js → architectureDiagram-5GKGNRK7-kxiX4TeN.js} +1 -1
- package/web/dist/assets/{blockDiagram-NRAW4CY4-B7wBbKiW.js → blockDiagram-NRAW4CY4-CptFksix.js} +1 -1
- package/web/dist/assets/{c4Diagram-UCG6FXSJ-6mrH0x7Y.js → c4Diagram-UCG6FXSJ-Dxmxj34F.js} +1 -1
- package/web/dist/assets/channel-DFyiuGL0.js +1 -0
- package/web/dist/assets/{chunk-2Q5K7J3B-Cuikho5Q.js → chunk-2Q5K7J3B-D9inx5oo.js} +1 -1
- package/web/dist/assets/{chunk-5VM5RSS4-3-KZ5AUz.js → chunk-5VM5RSS4-DydfHlEc.js} +1 -1
- package/web/dist/assets/{chunk-F27PBJKO-Bkwq2gGU.js → chunk-F27PBJKO-BO7GxhSv.js} +1 -1
- package/web/dist/assets/{chunk-G27WJ6UU-BLyQzdGE.js → chunk-G27WJ6UU-BzP6YiQ_.js} +1 -1
- package/web/dist/assets/{chunk-JWPE2WC7-B7HxxQds.js → chunk-JWPE2WC7-CHcgcd0s.js} +1 -1
- package/web/dist/assets/{chunk-LCL6LL3I-CtXrnUwF.js → chunk-LCL6LL3I-D2Wg5JtX.js} +1 -1
- package/web/dist/assets/{chunk-POPQ4Y6H-dxddZlXt.js → chunk-POPQ4Y6H-B2fCRfpM.js} +1 -1
- package/web/dist/assets/{chunk-SVP7TREG-DpkmrgHn.js → chunk-SVP7TREG-JSLcsRlZ.js} +1 -1
- package/web/dist/assets/{chunk-XXDRQBXY-BwZ7RbpQ.js → chunk-XXDRQBXY-BCjvaeHm.js} +1 -1
- package/web/dist/assets/classDiagram-DTDB5LWJ-Aw1f8z-b.js +1 -0
- package/web/dist/assets/classDiagram-v2-JRS7N3AN-Aw1f8z-b.js +1 -0
- package/web/dist/assets/{cose-bilkent-JH36ORCC-DGFOsMUt.js → cose-bilkent-JH36ORCC-0uKv6oJ7.js} +1 -1
- package/web/dist/assets/{cynefin-OW5HDTMX-DUwn3ehS.js → cynefin-OW5HDTMX-Bvt-gEmA.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-5FMLGOSQ-DlLAOZ9x.js → cynefinDiagram-5FMLGOSQ-C9Ht02qC.js} +1 -1
- package/web/dist/assets/{dagre-3AP2YEHR-CyourLfz.js → dagre-3AP2YEHR-BfxZny4s.js} +1 -1
- package/web/dist/assets/{diagram-S7CK7UJ4-BTMbx2np.js → diagram-S7CK7UJ4-CrE0ZETE.js} +1 -1
- package/web/dist/assets/{diagram-UQ7AKVKN-UK94_1-P.js → diagram-UQ7AKVKN-BO8VQ4Fx.js} +1 -1
- package/web/dist/assets/{diagram-VSXAHHWV-C7zS-v9v.js → diagram-VSXAHHWV-CHUZnR9F.js} +1 -1
- package/web/dist/assets/{diagram-VX7I27RA-DKJRa6CK.js → diagram-VX7I27RA-DYQAz1Vu.js} +1 -1
- package/web/dist/assets/{diagram-Z3DM3KII-kUbAfGAp.js → diagram-Z3DM3KII-BDjivgLr.js} +1 -1
- package/web/dist/assets/{ebnfDiagram-PWID7BFC-CVW16_vb.js → ebnfDiagram-PWID7BFC-Bpe_QVbH.js} +1 -1
- package/web/dist/assets/{erDiagram-SSCWMZ5O-BRQMFQ5y.js → erDiagram-SSCWMZ5O-BxhwuAu1.js} +1 -1
- package/web/dist/assets/{flowDiagram-A5DVABFB-S34LpLtK.js → flowDiagram-A5DVABFB-CCw2H08-.js} +1 -1
- package/web/dist/assets/{ganttDiagram-EL5Y4UJY-BFiqk1-G.js → ganttDiagram-EL5Y4UJY-DtTc7MyI.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-WWUBYQGX-LZsrdyyv.js → gitGraphDiagram-WWUBYQGX-BvORxMd2.js} +1 -1
- package/web/dist/assets/index-DGG5wIZs.js +2118 -0
- package/web/dist/assets/{infoDiagram-RXCK75RN-0DvN6KIp.js → infoDiagram-RXCK75RN-DMcrkypD.js} +1 -1
- package/web/dist/assets/{ishikawaDiagram-5VMMS53U-CaY3A-Bx.js → ishikawaDiagram-5VMMS53U-CZkTIbe-.js} +1 -1
- package/web/dist/assets/{journeyDiagram-EYS64GPL-BBeiaCrj.js → journeyDiagram-EYS64GPL-DR0XazdE.js} +1 -1
- package/web/dist/assets/{kanban-definition-3QL26DDD-ux42DRXQ.js → kanban-definition-3QL26DDD-DN8VbwVu.js} +1 -1
- package/web/dist/assets/{layout-CnXiF_NB.js → layout-9_paCbyt.js} +1 -1
- package/web/dist/assets/{linear-BMW0u6G6.js → linear-g6Ct012e.js} +1 -1
- package/web/dist/assets/{mindmap-definition-FBJOCRG2-hUxSpdKn.js → mindmap-definition-FBJOCRG2-BGt4omYC.js} +1 -1
- package/web/dist/assets/{pegDiagram-XKGWAZYB-aCaQPH0w.js → pegDiagram-XKGWAZYB-uSfS-PBE.js} +1 -1
- package/web/dist/assets/{pending-edit-apply-AcdOQ9Ij.js → pending-edit-apply-uP4uvrOD.js} +1 -1
- package/web/dist/assets/{pieDiagram-E7YTZNPT-CmOEZ8zg.js → pieDiagram-E7YTZNPT-DpeI935H.js} +1 -1
- package/web/dist/assets/{quadrantDiagram-AXDQQJYC-VW6fAhsV.js → quadrantDiagram-AXDQQJYC-B7IuNvWa.js} +1 -1
- package/web/dist/assets/{railroadDiagram-O6MQD6OU-CKJ7Ba5K.js → railroadDiagram-O6MQD6OU-ARzYpPQI.js} +1 -1
- package/web/dist/assets/{requirementDiagram-EFPCY7ZU-pNGkq9Vw.js → requirementDiagram-EFPCY7ZU-Cj4upkAo.js} +1 -1
- package/web/dist/assets/{rotate-cw-KAfChbGV.js → rotate-cw-CXJcyHWk.js} +1 -1
- package/web/dist/assets/{sankeyDiagram-P5KCCOFB-BIMmDTfZ.js → sankeyDiagram-P5KCCOFB-OaVwSnLP.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-WJ2MYXX4-BBW7wzKY.js → sequenceDiagram-WJ2MYXX4-1yrUbq4t.js} +1 -1
- package/web/dist/assets/{sizeCapture-X5ZJPWSS-DdkXmLYR.js → sizeCapture-X5ZJPWSS-nYH5p9D6.js} +1 -1
- package/web/dist/assets/{square-dashed-mouse-pointer-CDUlhUP7.js → square-dashed-mouse-pointer-CTtTVKoH.js} +1 -1
- package/web/dist/assets/{stateDiagram-HBIQ2CUA-W313Uz16.js → stateDiagram-HBIQ2CUA-Dj5HvyNq.js} +1 -1
- package/web/dist/assets/stateDiagram-v2-4QOOHH4V-kJ1m_zJT.js +1 -0
- package/web/dist/assets/{swimlanes-XN3QIQJK-C29TL26K.js → swimlanes-XN3QIQJK-umeT0HpB.js} +1 -1
- package/web/dist/assets/swimlanesDiagram-VK2B7HYN-DPSkMbbl.js +8 -0
- package/web/dist/assets/{timeline-definition-24CTP7MA-CF0JMObX.js → timeline-definition-24CTP7MA-MqnQfHKB.js} +1 -1
- package/web/dist/assets/{vennDiagram-4TSXK5OY-DrDFsaH3.js → vennDiagram-4TSXK5OY-b2liyZra.js} +1 -1
- package/web/dist/assets/{wardleyDiagram-VM6X3IG4-CVrnRIS_.js → wardleyDiagram-VM6X3IG4-QMK-zNh1.js} +1 -1
- package/web/dist/assets/{xychartDiagram-S5SC5T6Z-BvkN1zsT.js → xychartDiagram-S5SC5T6Z-D5Mc6tfA.js} +1 -1
- package/web/dist/index.html +1 -1
- package/server/api/memory.js +0 -185
- package/server/engine/agent/prompts/tools/generate-image-cookbook.gemini-gateway.md +0 -583
- package/server/engine/mcp/tools/record-decision.js +0 -140
- package/web/dist/assets/DeckWindow-BpLv5082.js +0 -16
- package/web/dist/assets/channel-DGkccMO1.js +0 -1
- package/web/dist/assets/classDiagram-DTDB5LWJ-BGscw3OD.js +0 -1
- package/web/dist/assets/classDiagram-v2-JRS7N3AN-BGscw3OD.js +0 -1
- package/web/dist/assets/index-GAamh1p4.js +0 -2152
- package/web/dist/assets/stateDiagram-v2-4QOOHH4V-DDhJBZzf.js +0 -1
- package/web/dist/assets/swimlanesDiagram-VK2B7HYN-BfN-Xdmu.js +0 -8
package/web/dist/assets/{cynefinDiagram-5FMLGOSQ-DlLAOZ9x.js → cynefinDiagram-5FMLGOSQ-C9Ht02qC.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as xt}from"./chunk-JWPE2WC7-
|
|
1
|
+
import{p as xt}from"./chunk-JWPE2WC7-CHcgcd0s.js";import{s as gt,g as $t,o as bt,n as wt,a as Ct,b as vt,_ as s,l as O,D as Dt,d as kt,p as At,A as U,y as Q,B as Tt,E as ot}from"./MermaidBlock-BO-46Du5.js";import{p as Bt}from"./cynefin-OW5HDTMX-Bvt-gEmA.js";import"./index-DGG5wIZs.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n<t.length;n++){const a=t.charCodeAt(n);e=(e<<5)-e+a,e|=0}return e}s(st,"hashString");function it(t,e){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:st(e)}s(it,"resolveSeed");function ct(t,e,n,a){const c=t/2,m=a??t*.015,v=7,W=e/v,d=[];for(let o=0;o<=v;o++){const p=V(n+o*17)*m*2-m;d.push({x:c+p,y:o*W})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.y+i.y)/2,b=o%2===0?1:-1,h=m*1.5*b*V(n+o*31+7),R=p.x+h,_=f,E=i.x-h;D+=` C${R},${_} ${E},${f} ${i.x},${i.y}`}return D}s(ct,"generateFoldPath");function lt(t,e,n,a){const c=e/2,m=a??e*.015,v=7,W=t/v,d=[];for(let o=0;o<=v;o++){const p=V(n+o*23)*m*2-m;d.push({x:o*W,y:c+p})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.x+i.x)/2,b=o%2===0?1:-1,h=m*1.5*b*V(n+o*37+11),R=f,_=p.y+h,E=f,z=i.y-h;D+=` C${R},${_} ${E},${z} ${i.x},${i.y}`}return D}s(lt,"generateHorizontalBoundary");function dt(t,e){const n=t/2,a=e*.5,c=e,m=t*.03;return[`M${n},${a}`,`C${n+m},${a+(c-a)*.2}`,`${n-m*1.5},${a+(c-a)*.55}`,`${n+m*.5},${a+(c-a)*.75}`,`C${n-m},${a+(c-a)*.85}`,`${n+m*.3},${a+(c-a)*.95}`,`${n},${c}`].join(" ")}s(dt,"generateCliffPath");function ft(t,e,n,a){return[`M${t-n},${e}`,`A${n},${a} 0 1,1 ${t+n},${e}`,`A${n},${a} 0 1,1 ${t-n},${e}`,"Z"].join(" ")}s(ft,"generateConfusionPath");var at={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},Rt=s((t,e)=>{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Vt();return`
|
|
2
2
|
.cynefinDomain {
|
|
3
3
|
stroke: none;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as m,ao as D,c as A,Q as Y,l as p,ap as _,aq as z,ar as b,as as H,at as J,au as T,av as R,aw as F,ax as q,ay as C,ah as P,af as W,az as j,aA as Q}from"./MermaidBlock-
|
|
1
|
+
import{_ as m,ao as D,c as A,Q as Y,l as p,ap as _,aq as z,ar as b,as as H,at as J,au as T,av as R,aw as F,ax as q,ay as C,ah as P,af as W,az as j,aA as Q}from"./MermaidBlock-BO-46Du5.js";import{l as U}from"./layout-9_paCbyt.js";import"./index-DGG5wIZs.js";var v=m((t,e,d)=>Math.max(e,Math.min(d,t)),"clamp"),B=m((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),K=m(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram"||t==="er"||t==="classDiagram","shouldMergeSelfLoopSegments"),V=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Z=m((t,e,d,g,s)=>{const h=[],L=new Set;if(d.forEach(({start:l,end:r})=>{l!==g&&L.add(l),r!==g&&L.add(r)}),L.forEach(l=>{const r=t.node(l);typeof(r==null?void 0:r.x)=="number"&&typeof(r==null?void 0:r.y)=="number"&&h.push(r)}),h.length===0&&d.forEach(({edge:l})=>{(l.points??[]).forEach(r=>{typeof(r==null?void 0:r.x)=="number"&&typeof(r==null?void 0:r.y)=="number"&&h.push(r)})}),h.length===0)return B(s);const c=h.reduce((l,r)=>({x:l.x+r.x/h.length,y:l.y+r.y/h.length}),{x:0,y:0}),i=c.x-e.x,o=c.y-e.y;return Math.abs(i)>Math.abs(o)?i>0?"right":"left":Math.abs(o)>0?o>0?"bottom":"top":B(s)},"getSelfLoopSide"),$=m((t,e="top",d=0,g=0)=>{const s=t.x,h=t.y-d,L=t.width/2,c=t.height/2,i=Math.max(36,Math.min(100,t.width*.8)),o=v(Math.max(g,t.width*.35),36,i),l=v(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const r=h+c;return[{x:s-o/2,y:r},{x:s-o/2,y:r+l},{x:s+o/2,y:r+l},{x:s+o/2,y:r}]}case"right":{const r=s+L;return[{x:r,y:h-o/2},{x:r+l,y:h-o/2},{x:r+l,y:h+o/2},{x:r,y:h+o/2}]}case"left":{const r=s-L;return[{x:r,y:h-o/2},{x:r-l,y:h-o/2},{x:r-l,y:h+o/2},{x:r,y:h+o/2}]}case"top":default:{const r=h-c;return[{x:s-o/2,y:r},{x:s-o/2,y:r-l},{x:s+o/2,y:r-l},{x:s+o/2,y:r}]}}},"getSelfLoopPoints"),ee=m((t,e,d="top",g=0,s={})=>{const L=t.x,c=t.y-g,i=s.width??0,o=s.height??0;switch(d){case"bottom":return{x:L,y:Math.max(...e.map(l=>l.y))+o/2+4};case"right":return{x:Math.max(...e.map(l=>l.x))+i/2+4,y:c};case"left":return{x:Math.min(...e.map(l=>l.x))-i/2-4,y:c};case"top":default:return{x:L,y:Math.min(...e.map(l=>l.y))-o/2-4}}},"getSelfLoopLabelPosition"),M=m((t,e=0,{mergeSelfLoops:d=!0}={})=>{var L;const g=new Map,s=[],h=(L=t.graph())==null?void 0:L.rankdir;return t.edges().forEach(c=>{const i=t.edge(c);if(d&&i.selfLoop){const o=i.selfLoop.id;g.has(o)||g.set(o,[]),g.get(o).push({edge:i,start:c.v,end:c.w})}else s.push({edge:i,start:c.v,end:c.w})}),g.forEach(c=>{if(c.length!==3){c.forEach(E=>s.push(E));return}c.sort((E,x)=>E.edge.selfLoop.order-x.edge.selfLoop.order);const[i,o,l]=c,r=i.edge.originalEdge??o.edge.originalEdge??l.edge.originalEdge??o.edge,a=t.node(r.start);if(!a){c.forEach(E=>s.push(E));return}const w={width:o.edge.width,height:o.edge.height},y=Z(t,a,c,r.start,h),f=$(a,y,e,w.width??0),n=ee(a,f,y,e,w),u={...o.edge,...r,id:r.id,points:f,start:r.start,end:r.end,x:n.x,y:n.y,width:w.width,height:w.height,labelStyle:o.edge.labelStyle,fromCluster:i.edge.fromCluster??o.edge.fromCluster??l.edge.fromCluster,toCluster:i.edge.toCluster??o.edge.toCluster??l.edge.toCluster};delete u.selfLoop,delete u.originalEdge,s.push({edge:u,start:u.start,end:u.end})}),s},"getEdgesToRender"),G=m(async({element:t,graph:e,diagramType:d,id:g,parentCluster:s,siteConfig:h})=>{const L=e.graph().rankdir;p.trace("Dir in recursive render - dir:",L);const{clusters:c,edgePaths:i,edgeLabels:o,nodes:l,rootGroups:r}=H(t,{edgePathsClass:"edgePaths"});e.nodes()?p.info("Recursive render XXX",e.nodes()):p.info("No nodes found for",e),e.edges().length>0&&p.info("Recursive edges",e.edge(e.edges()[0]));const a=K(d);await Promise.all(e.nodes().map(async function(f){const n=e.node(f);if(s!==void 0){const u=JSON.parse(JSON.stringify(s.clusterData));p.trace(`Setting data for parent cluster XXX
|
|
2
2
|
Node.id = `,f,`
|
|
3
3
|
data=`,u.height,`
|
|
4
4
|
Parent cluster`,s.height),e.setNode(s.id,u),e.parent(f)||(p.trace("Setting parent",f,s.id),e.setParent(f,s.id,u))}if(p.info("(Insert) Node XXX"+f+": "+JSON.stringify(e.node(f))),n!=null&&n.clusterNode){p.info("Cluster identified XBX",f,n.width,e.node(f));const{ranksep:u,nodesep:E}=e.graph();n.graph.setGraph({...n.graph.graph(),ranksep:u+25,nodesep:E});const x=await ne({element:l,graph:n.graph,diagramType:d,id:g,parentCluster:e.node(f),siteConfig:h}),S=x.elem;J(n,S),n.diff=x.diff||0,p.info("New compound node after recursive render XAX",f,"width",n.width,"height",n.height),T(S,n)}else e.children(f).length>0?(p.trace("Cluster - the non recursive path XBX",f,n.id,n,n.width,"Graph:",e),p.trace(R(n.id,e)),b.set(n.id,{id:R(n.id,e),node:n})):(p.trace("Node - the non recursive path XAX",f,l,e.node(f),L),await F(l,e.node(f),{config:h,dir:L}))})),await m(async()=>{const f=e.edges().map(async function(n){var E,x,S,X;const u=e.edge(n.v,n.w,n.name);if(p.info("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),p.info("Edge "+n.v+" -> "+n.w+": ",n," ",JSON.stringify(e.edge(n))),p.info("Fix",b,"ids:",n.v,n.w,"Translating: ",b.get(n.v),b.get(n.w)),a&&u.selfLoop){if(u.selfLoop.order!==1)return;const N={...u.originalEdge,...u,id:u.selfLoop.id,startLabelLeft:((E=u.originalEdge)==null?void 0:E.startLabelLeft)??u.startLabelLeft,startLabelRight:((x=u.originalEdge)==null?void 0:x.startLabelRight)??u.startLabelRight,endLabelLeft:((S=u.originalEdge)==null?void 0:S.endLabelLeft)??u.endLabelLeft,endLabelRight:((X=u.originalEdge)==null?void 0:X.endLabelRight)??u.endLabelRight};await C(o,N),u.width=N.width,u.height=N.height,u.labelStyle=N.labelStyle;return}await C(o,u)});await Promise.all(f)},"processEdges")();const{subGraphTitleTotalMargin:y}=q(h);return{elem:r,graph:e,groups:{clusters:c,edgePaths:i,edgeLabels:o,nodes:l,rootGroups:r},diagramType:d,id:g,mergeSelfLoops:a,subGraphTitleTotalMargin:y}},"measureDagreGraph"),k=m(t=>{p.info("############################################# XXX"),p.info("### Layout ### XXX"),p.info("############################################# XXX"),U(t)},"runDagreGraphLayout"),te=m((t,e,d)=>{const g=t.node(e);if(!g)return;const s={...g};return g!=null&&g.clusterNode?s.y=(g.y??0)+d:t.children(e).length>0?s.height=(g.height??0)+d:s.y=(g.y??0)+d/2,s},"normalizeDagreNode"),I=m((t,e)=>{V.forEach(d=>{e[d]!==void 0&&(t[d]=e[d])})},"applyDagreNodeLayout"),re=m((t,e,d,g)=>({...t,start:t.start??e,end:t.end??d,points:(t.points??[]).map(s=>({...s,y:typeof s.y=="number"?s.y+g:s.y}))}),"normalizeDagreEdge"),ae=m((t,e)=>{const{graph:d,mergeSelfLoops:g,subGraphTitleTotalMargin:s=0}=e,h=new Map(t.nodes.map(c=>[c.id,c]));D(d).forEach(c=>{const i=te(d,c,s);if(!i)return;I(d.node(c),i);const o=h.get(c);o&&I(o,i)});const L=s/2;return t.edges=M(d,L,{mergeSelfLoops:g}).map(({edge:c,start:i,end:o})=>re(c,i,o,L)),t},"applyDagreLayoutResult"),oe=m(async({elem:t,graph:e,groups:{clusters:d,edgePaths:g},diagramType:s,id:h,mergeSelfLoops:L,subGraphTitleTotalMargin:c})=>{let i=0;await Promise.all(D(e).map(async function(r){var w;const a=e.node(r);if(p.info("Position XBX => "+r+": ("+a.x,","+a.y,") width: ",a.width," height: ",a.height),a!=null&&a.clusterNode)a.y+=c,p.info("A tainted cluster node XBX1",r,a.id,a.width,a.height,a.x,a.y,e.parent(r)),b.get(a.id).node=a,P(a);else if(e.children(r).length>0){p.info("A pure cluster node XBX1",r,a.id,a.x,a.y,a.width,a.height,e.parent(r)),a.height+=c,e.node(a.parentId);const y=(a==null?void 0:a.padding)/2||0,f=((w=a==null?void 0:a.labelBBox)==null?void 0:w.height)||0,n=f-y||0;p.debug("OffsetY",n,"labelHeight",f,"halfPadding",y),await W(d,a),b.get(a.id).node=a}else{const y=e.node(a.parentId);a.y+=c/2,p.info("A regular node XBX1 - using the padding",a.id,"parent",a.parentId,a.width,a.height,a.x,a.y,"offsetY",a.offsetY,"parent",y,y==null?void 0:y.offsetY,a),P(a)}}));const o=c/2;return M(e,o,{mergeSelfLoops:L}).forEach(function({edge:r,start:a,end:w}){p.info("Edge "+a+" -> "+w+": "+JSON.stringify(r),r),r.points.forEach(u=>u.y+=o);const y=e.node(a),f=e.node(w),n=j(g,r,b,s,y,f,h);Q(r,n)}),e.nodes().forEach(function(r){const a=e.node(r);p.info(r,a.type,a.diff),a.isGroup&&(i=a.diff)}),p.warn("Returning from recursive render XAX",t,i),{elem:t,diff:i}},"paintDagreLayoutCore"),ne=m(async t=>{const e=await G(t);return k(e.graph),await oe(e)},"renderDagreSubgraph"),O=m(t=>{var d,g,s,h,L,c;const e=new Y({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((d=t.config)==null?void 0:d.nodeSpacing)||t.nodeSpacing||((s=(g=t.config)==null?void 0:g.flowchart)==null?void 0:s.nodeSpacing),ranksep:((h=t.config)==null?void 0:h.rankSpacing)||t.rankSpacing||((c=(L=t.config)==null?void 0:L.flowchart)==null?void 0:c.rankSpacing),marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return t.nodes.forEach(i=>{e.setNode(i.id,{...i}),i.parentId&&e.setParent(i.id,i.parentId)}),p.debug("Edges:",t.edges),t.edges.forEach(i=>{if(i.start===i.end){const o=i.start,l=o+"---"+o+"---1",r=o+"---"+o+"---2",a=e.node(o);e.setNode(l,{domId:l,id:l,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(l,a.parentId),e.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(r,a.parentId);const w=structuredClone(i),y=structuredClone(i),f=structuredClone(i),n=structuredClone(i);y.originalEdge=w,y.selfLoop={id:w.id,order:0},f.originalEdge=w,f.selfLoop={id:w.id,order:1},n.originalEdge=w,n.selfLoop={id:w.id,order:2},y.label="",y.arrowTypeEnd="none",y.endLabelLeft="",y.endLabelRight="",y.startLabelLeft="",y.id=o+"-cyclic-special-1",f.startLabelRight="",f.startLabelLeft="",f.endLabelLeft="",f.endLabelRight="",f.arrowTypeStart="none",f.arrowTypeEnd="none",f.id=o+"-cyclic-special-mid",n.label="",n.startLabelRight="",n.startLabelLeft="",n.arrowTypeStart="none",a.isGroup&&(y.fromCluster=o,n.toCluster=o),n.id=o+"-cyclic-special-2",n.arrowTypeStart="none",e.setEdge(o,l,y,o+"-cyclic-special-0"),e.setEdge(l,r,f,o+"-cyclic-special-1"),e.setEdge(r,o,n,o+"-cyclic-special-2")}else e.setEdge(i.start,i.end,{...i},i.id)}),_(e),{graph:e}},"prepareLayoutForDagre"),se=m(async(t,{element:e,preparedLayout:d})=>{const g=d??O(t),s=A(),h=await G({element:e,graph:g.graph,diagramType:t.type,id:t.diagramId,parentCluster:void 0,siteConfig:s});return g.measuredLayout=h,h},"measureDagreLayout"),ie=m((t,e)=>{var g;const d=(g=e.preparedLayout)==null?void 0:g.measuredLayout;if(!d)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return k(d.graph),ae(t,d),d},"runDagreLayoutCore"),de=m((t,{measure:e})=>D(e.graph).map(d=>e.graph.node(d)).filter(Boolean),"getDagrePaintNodes"),le=m((t,e,{measure:d})=>t?d.graph.node(t):void 0,"getDagreEdgeNode"),he=z({prepareLayout:O,measureLayout:se,runLayoutCore:ie,paintOptions:{clusterDb:b,getNodes:de,getEdgeNode:le,skipNode:m((t,{measure:e})=>!e.graph.hasNode(t.id),"skipNode"),isCluster:m((t,{measure:e})=>e.graph.hasNode(t.id)&&(e.graph.children(t.id)??[]).length>0,"isCluster")}});export{ae as applyDagreLayoutResult,M as getEdgesToRender,se as measureDagreLayout,O as prepareLayoutForDagre,he as render,ie as runDagreLayoutCore};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as X}from"./chunk-2Q5K7J3B-
|
|
1
|
+
import{I as X}from"./chunk-2Q5K7J3B-D9inx5oo.js";import{p as z}from"./chunk-JWPE2WC7-CHcgcd0s.js";import{n as O,b as G,s as Y,o as P,g as F,a as Z,_ as g,A,l as E,D as q,d as U,y as D,p as j,i as J,ak as K,B as Q,al as ee}from"./MermaidBlock-BO-46Du5.js";import{p as te}from"./cynefin-OW5HDTMX-Bvt-gEmA.js";import"./index-DGG5wIZs.js";var L=/[─━│┃└┗├┣]/,_=/[└┗├┣]/,re=/[─━]/,T=/^[\s│┃]+$/,V=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,$=/^\s*%%/,ne=" ";function S(r){return r.some(t=>L.test(t))}g(S,"isBoxDrawingFormat");function M(r){for(const t of r){const e=_.exec(t);if(e!=null&&e.index&&e.index>0)return e.index}return 4}g(M,"inferSegmentWidth");function R(r,t){return r.replace(/\bline\s+(\d+)\b/gi,(e,i)=>{const s=parseInt(i,10),o=t.get(s);return o?`line ${o}`:e})}g(R,"remapErrorLines");function H(r){const t=r.split(`
|
|
2
2
|
`),e=new Map;let i=-1;for(const[d,l]of t.entries())if(l.trim()==="treeView-beta"){i=d;break}if(i===-1)return{text:r,lineMap:e};const s=[];for(let d=i+1;d<t.length;d++){const l=t[d];l.trim()===""||$.test(l)||V.test(l)||T.test(l)||s.push(l.replace(/\t/g," "))}if(!S(s))return{text:r,lineMap:e};const o=M(s),n=[];let c=0;for(let d=0;d<=i;d++)n.push(t[d]),c++,e.set(c,d+1);for(let d=i+1;d<t.length;d++){const l=t[d],u=l.trim(),a=d+1;if(u===""){n.push(l),c++,e.set(c,a);continue}if($.test(l)){n.push(l),c++,e.set(c,a);continue}if(V.test(l)){n.push(l),c++,e.set(c,a);continue}if(T.test(l))continue;const p=l.replace(/\t/g," "),h=_.exec(p);if((h==null?void 0:h.index)!==void 0){const m=h.index,w=Math.round(m/o)+1;let f=m+1;for(;f<p.length&&re.test(p[f]);)f++;for(;f<p.length&&p[f]===" ";)f++;const v=p.slice(f).trimEnd();if(!v)throw new Error(`Line ${a}: Empty node — expected a filename or directory name after the box-drawing prefix`);const b=ne.repeat(w);n.push(b+v),c++,e.set(c,a)}else{if(/^[\s─━│┃└┗├┣]+$/.test(p))continue;if(L.test(p))n.push(l),c++,e.set(c,a);else{if(/^\s+/.test(p))throw new Error(`Line ${a}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);n.push(l),c++,e.set(c,a)}}}return{text:n.join(`
|
|
3
3
|
`),lineMap:e}}g(H,"preprocessBoxDrawing");var x=new X(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),ie=g(()=>{x.reset(),j()},"clear"),oe=g(()=>x.records.stack[0],"getRoot"),se=g(()=>x.records.cnt,"getCount"),ae=Q.treeView,ce=g(()=>A(ae,D().treeView),"getConfig"),le=g((r,t,e,i,s,o)=>{for(;r<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const n={id:x.records.cnt++,level:r,name:t,nodeType:e,icon:s,cssClass:i,description:o,children:[]};x.records.stack[x.records.stack.length-1].children.push(n),x.records.stack.push(n)},"addNode"),de={clear:ie,addNode:le,getRoot:oe,getCount:se,getConfig:ce,getAccTitle:Z,getAccDescription:F,getDiagramTitle:P,setAccDescription:Y,setAccTitle:G,setDiagramTitle:O},I=de,he=g(r=>{z(r,I);for(const t of r.nodes){const e=typeof t.indent=="number"?t.indent:0;let i=t.name;const s=i.endsWith("/");s&&(i=i.slice(0,-1));const o=s?"directory":"file",n=t.classAnnotation||void 0,c=t.iconAnnotation,d=c!==void 0?c||"none":void 0,l=t.descAnnotation||void 0,u=l?J(l,D()):void 0;I.addNode(e,i,o,n,d,u)}},"populate"),pe={parse:g(async r=>{const{text:t,lineMap:e}=H(r);try{const i=await te("treeView",t);E.debug(i),he(i)}catch(i){throw e.size>0&&i instanceof Error&&(i.message=R(i.message,e)),i}},"parse")},C={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function W(r,t){var s;const e=(s=t==null?void 0:t.filenameIcons)==null?void 0:s[r];if(e)return e;const i=r.lastIndexOf(".");if(i>0){const o=r.substring(i).toLowerCase(),n=t==null?void 0:t.extensionIcons;return(n==null?void 0:n[o])??(n==null?void 0:n[o.slice(1)])}}g(W,"detectIcon");function y(r,t){return r.includes(":")?r:r in C.icons||!t?`${C.prefix}:${r}`:`${t}:${r}`}g(y,"qualifyIcon");function k(r,t){if(r.icon!=="none"){if(r.icon)return y(r.icon,t.defaultIconPack);if(t.showIcons){if(r.nodeType==="file"){const e=W(r.name,t);if(e==="none")return;if(e)return y(e,t.defaultIconPack)}return`${C.prefix}:${r.nodeType==="directory"?"folder":"file"}`}}}g(k,"getNodeIcon");ee([{name:C.prefix,icons:C}]);var B=14,ge=4,fe=16,ue=g(async(r,t)=>{const e=[],i=g(o=>{const n=k(o,t);n&&e.push({icon:n,node:o}),o.children.forEach(i)},"collect");i(r);const s=await Promise.all(e.map(async({icon:o,node:n})=>({id:n.id,svg:await K(o,{height:B,width:B})})));return new Map(s.map(({id:o,svg:n})=>[o,n]))},"resolveNodeIcons"),we=g((r,t,e,i,s,o)=>{var b;const n=i.append("g");let c="treeView-node-label";e.nodeType==="directory"&&(c+=" treeView-node-dir"),e.cssClass&&(c+=` ${e.cssClass}`);const d=B+ge,l=k(e,s),u=l!==void 0;l&&n.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${r+s.paddingX}, ${t+s.paddingY})`).html(o.get(e.id)??"");const a=n.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",c),{height:p,width:h}=a.node().getBBox(),m=p+s.paddingY*2,w=r+s.paddingX+(u?d:0);a.attr("x",w),a.attr("y",t+m/2);const f=w+h,v=h+s.paddingX*2+(u?d:0);return e.BBox={x:r,y:t,width:v,height:m},(b=e.cssClass)!=null&&b.split(/\s+/).includes("highlight")&&n.insert("rect",":first-child").attr("x",r).attr("y",t+1).attr("width",0).attr("height",m-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:n,labelRightEdge:f,centerY:t+m/2}},"positionLabel"),N=g((r,t,e,i,s,o)=>r.append("line").attr("x1",t).attr("y1",e).attr("x2",i).attr("y2",s).attr("stroke-width",o).attr("class","treeView-node-line"),"positionLine"),me=g((r,t,e,i)=>{var u;let s=0,o=0;const n=[],c=g((a,p,h,m)=>{const w=m*(h.rowIndent+h.paddingX),f=we(w,s,p,a,h,i);n.push(f);const{height:v,width:b}=p.BBox;N(a,w-h.rowIndent,s+v/2,w,s+v/2,h.lineThickness),o=Math.max(o,w+b),s+=v},"drawNode"),d=g((a,p=0)=>{c(r,a,e,p),a.children.forEach(f=>{d(f,p+1)});const{x:h,y:m,height:w}=a.BBox;if(a.children.length){const{y:f,height:v}=a.children[a.children.length-1].BBox;N(r,h+e.paddingX,m+w,h+e.paddingX,f+v/2+e.lineThickness/2,e.lineThickness)}},"processNode");d(t);const l=n.filter(a=>a.node.description);if(l.length>0){const p=Math.max(...n.map(h=>h.labelRightEdge))+fe;for(const h of l){const w=h.nodeGroup.append("text").text(h.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",p).attr("y",h.centerY).node().getBBox();o=Math.max(o,p+w.width+e.paddingX)}}for(const a of n)if((u=a.node.cssClass)!=null&&u.split(/\s+/).includes("highlight")){const p=a.nodeGroup.select(".treeView-highlight-bg");if(!p.empty()){const h=o-a.node.BBox.x+8;p.attr("width",h),o=Math.max(o,a.node.BBox.x+h+2)}}return{totalHeight:s,totalWidth:o}},"drawTree"),ve=g(async(r,t,e,i)=>{E.debug(`Rendering treeView diagram
|
|
4
4
|
`+r);const s=i.db,o=s.getRoot(),n=s.getConfig(),c=q(t),d=c.append("g");d.attr("class","tree-view");const l=await ue(o,n),{totalHeight:u,totalWidth:a}=me(d,o,n,l);c.attr("viewBox",`-${n.lineThickness/2} 0 ${a} ${u}`),U(c,u,a,n.useMaxWidth)},"draw"),xe={draw:ve},be=xe,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ie=g(({treeView:r})=>{const{labelFontSize:t,labelColor:e,lineColor:i,iconColor:s,descriptionColor:o,highlightBg:n,highlightStroke:c}=A(Ce,r);return`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as I}from"./chunk-JWPE2WC7-
|
|
1
|
+
import{p as I}from"./chunk-JWPE2WC7-CHcgcd0s.js";import{s as _,g as E,o as D,n as F,a as P,b as z,_ as c,D as G,p as B,A as w,y as C,B as W,l as b,E as V,d as H}from"./MermaidBlock-BO-46Du5.js";import{p as j}from"./cynefin-OW5HDTMX-Bvt-gEmA.js";import"./index-DGG5wIZs.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y=32,A={axes:[],curves:[],options:x},m=structuredClone(A),U=W.radar,X=c(()=>w({...U,...C().radar}),"getConfig"),M=c(()=>m.axes,"getAxes"),K=c(()=>m.curves,"getCurves"),N=c(()=>m.options,"getOptions"),Y=c(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>{var n;return((n=s.axis)==null?void 0:n.$refText)===e.name});if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{var e,r,s,n,l;const t=a.reduce((o,i)=>(o[i.name]=i,o),{});m.options={showLegend:((e=t.showLegend)==null?void 0:e.value)??x.showLegend,ticks:((r=t.ticks)==null?void 0:r.value)??x.ticks,max:((s=t.max)==null?void 0:s.value)??x.max,min:((n=t.min)==null?void 0:n.value)??x.min,graticule:((l=t.graticule)==null?void 0:l.value)??x.graticule},m.options.ticks>y&&(b.warn(`Radar diagram ticks (${m.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),m.options.ticks=y)},"setOptions"),Q=c(()=>{B(),m=structuredClone(A)},"clear"),$={getAxes:M,getCurves:K,getOptions:N,setAxes:Y,setCurves:Z,setOptions:J,getConfig:X,clear:Q,setAccTitle:z,getAccTitle:P,setDiagramTitle:F,getDiagramTitle:D,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await j("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,n=s.getAxes(),l=s.getCurves(),o=s.getOptions(),i=s.getConfig(),d=s.getDiagramTitle(),p=G(t),u=rt(p,i),g=o.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=o.min,v=Math.min(i.width,i.height)/2;st(u,n,v,o.ticks,o.graticule),nt(u,n,v,i),L(u,n,l,h,g,o.graticule,i),k(u,l,o.showLegend,i),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-i.height/2-i.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let n=0;n<r;n++){const l=e*(n+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(s==="polygon"){const n=t.length;for(let l=0;l<r;l++){const o=e*(l+1)/r,i=t.map((d,p)=>{const u=2*p*Math.PI/n-Math.PI/2,g=o*Math.cos(u),h=o*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",i).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let n=0;n<s;n++){const l=t[n].label,o=2*n*Math.PI/s-Math.PI/2,i=Math.cos(o),d=Math.sin(o);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*i).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");const p=i>.01?"start":i<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*i+g*i).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,n,l){const o=t.length,i=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==o)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/o-Math.PI/2,f=T(g,r,s,i),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});n==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):n==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const n=a[(s-1+e)%e],l=a[s],o=a[(s+1)%e],i=a[(s+2)%e],d={x:l.x+(o.x-n.x)*t,y:l.y+(o.y-n.y)*t},p={x:o.x-(i.x-l.x)*t,y:o.y-(i.y-l.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${o.x},${o.y}`}return`${r} Z`}c(S,"closedRoundCurve");function k(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,n=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((o,i)=>{const d=a.append("g").attr("transform",`translate(${s}, ${n+i*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${i}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
|
|
2
2
|
.radarCurve-${r} {
|
|
3
3
|
color: ${s};
|
|
4
4
|
fill: ${s};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{p as oe}from"./chunk-JWPE2WC7-
|
|
1
|
+
import{p as oe}from"./chunk-JWPE2WC7-CHcgcd0s.js";import{o as se,n as de,s as le,g as ce,a as me,b as ue,_ as o,l as g,c as T,j as xe,z as fe,p as ge,A as he,y as E,B as pe,i as P,w as S,am as be}from"./MermaidBlock-BO-46Du5.js";import{p as ve,i as we}from"./cynefin-OW5HDTMX-Bvt-gEmA.js";import"./index-DGG5wIZs.js";var D="position frame",N="frame positioned",M="position relation",C="relation positioned",ye=o(function(e){g.debug("options str",e)},"setOptions"),Pe=o(function(){return{}},"getOptions"),Se=o(function(){O(),ge()},"clear");function O(){A={}}o(O,"reset");var ke=pe.eventmodeling,Me=o(()=>he({...ke,...E().eventmodeling}),"getConfig"),A={};function W(){let e=Be;const{ast:n}=A,t=R();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=X(i,n.dataEntities,t);e=w(e,{$kind:D,index:a,frame:i,textProps:r});let d;q(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=w(e,{$kind:M,index:a,frame:i,sourceFrame:l})})):e=w(e,{$kind:M,index:a,frame:i})}),e={...e,sortedSwimlanesArray:$(e.swimlanes)},e}o(W,"getState");function I(e){A.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function R(){return s}o(R,"getDiagramProps");var Be={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function H(e){const n=e.split(".");if(n.length===2)return n[0]}o(H,"extractNamespace");function U(e){const n=e.split(".");return n.length===2?n[1]:e}o(U,"extractName");function _(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(_,"findSwimlaneByNamespace");function v(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&a<t}).map(i=>Number.parseInt(i)))+1}o(v,"findNextAvailableIndex");function V(e,n){const t=H(e.entityIdentifier),i=_(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:v(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:v(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:v(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(V,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=E();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function X(e,n,t){const i=E(),a=P(U(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let c=`<b>${S(a,t.textMaxWidth,d)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(y=>{var b;return y.name===((b=e.dataReference)==null?void 0:b.$refText)});p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{
|
|
2
2
|
`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="<br/>")}const m=r!==void 0;m&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=be(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(X,"calculateTextProps");function j(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:N,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(j,"decidePositionFrame");function G(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(G,"calculateX");function Y(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(Y,"calculateMaxRight");function $(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o($,"sortedSwimlanesArray");function z(e,n){const t=n,i=V(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=G(a,d,r),m=c+l.width+s.boxPadding,x=Y(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=$(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p<f.length;p++){const y=f[p],b=f[p-1];y.y=b.y+b.height+s.swimlaneGap}return h}o(z,"evolveFramePositioned");function K(e,n){return e===0&&n.sourceFrames.length===0}o(K,"isFirstFrame");function q(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}o(q,"hasSourceFrame");function B(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(B,"findBoxByFrame");function J(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(J,"findBoxByLineIndex");function Q(e,n){const t=n;if(we(t.frame)||K(t.index,t.frame))return[];const i=B(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=B(e.boxes,t.sourceFrame):a=J(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:C,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(Q,"decidePositionRelation");function Z(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Z,"evolveRelationPositioned");var Fe={[D]:j,[M]:Q},Ee={[N]:z,[C]:Z};function ee(e,n){const t=Fe[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(ee,"decide");function te(e,n){const t=n.reduce((i,a)=>{const r=Ee[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(te,"evolve");function w(e,n){const t=ee(e,n);return te(e,t)}o(w,"dispatch");var F={getConfig:Me,setOptions:ye,getOptions:Pe,clear:Se,setAccTitle:ue,getAccTitle:me,getAccDescription:ce,setAccDescription:le,setDiagramTitle:de,getDiagramTitle:se,setAst:I,getDiagramProps:R,getState:W},Ae={parse:o(async e=>{const n=await ve("eventmodeling",e);g.debug(n),F.setAst(n),oe(n,F)},"parse")},k=T(),Re=k==null?void 0:k.eventmodeling;function ne(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(ne,"renderD3Box");function ie(e,n){return e>n}o(ie,"dirUpwards");function ae(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ie(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ae,"renderD3Relation");function re(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(re,"renderD3Swimlane");var $e=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+`
|
|
3
3
|
`,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=T(),l=xe(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(re(l,m.maxR,c,r)),m.boxes.forEach(ne(l,c)),m.relations.forEach(ae(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),fe(void 0,l,(d==null?void 0:d.padding)??30,d==null?void 0:d.useMaxWidth)},"draw"),Te={draw:$e},De=o(e=>"","getStyles"),Ne=De,He={parser:Ae,db:F,renderer:Te,styles:Ne};export{He as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as ge}from"./chunk-JWPE2WC7-B7HxxQds.js";import{_ as w,E as ye,y as ae,A as ee,D as Se,d as ve,l as te,bd as B,j as U,b as xe,a as be,n as we,o as Ce,g as Te,s as Le,B as $e,be as Ae,p as Fe}from"./MermaidBlock-DR1GikCv.js";import{s as Ne}from"./chunk-POPQ4Y6H-dxddZlXt.js";import{p as Me}from"./cynefin-OW5HDTMX-DUwn3ehS.js";import{b as O}from"./defaultLocale-DX6XiGOO.js";import{o as Q}from"./ordinal-Cboi1Yqb.js";import"./index-GAamh1p4.js";import"./init-Gi6I4Gst.js";function _e(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ke(){return this.eachAfter(_e)}function ze(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function Ve(t,a){for(var l=this,n=[l],r,s,h=-1;l=n.pop();)if(t.call(a,l,++h,this),r=l.children)for(s=r.length-1;s>=0;--s)n.push(r[s]);return this}function De(t,a){for(var l=this,n=[l],r=[],s,h,d,g=-1;l=n.pop();)if(r.push(l),s=l.children)for(h=0,d=s.length;h<d;++h)n.push(s[h]);for(;l=r.pop();)t.call(a,l,++g,this);return this}function Pe(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function Be(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,r=n&&n.length;--r>=0;)l+=n[r].value;a.value=l})}function Ee(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Re(t){for(var a=this,l=We(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function We(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function He(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Ie(){return Array.from(this)}function Oe(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Ge(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*qe(){var t=this,a,l=[t],n,r,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,s=n.length;r<s;++r)l.push(n[r]);while(l.length)}function ne(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ye)):a===void 0&&(a=je);for(var l=new Z(t),n,r=[l],s,h,d,g;n=r.pop();)if((h=a(n.data))&&(g=(h=Array.from(h)).length))for(n.children=h,d=g-1;d>=0;--d)r.push(s=h[d]=new Z(h[d])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ze)}function Xe(){return ne(this).eachBefore(Ue)}function je(t){return t.children}function Ye(t){return Array.isArray(t)?t[1]:null}function Ue(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ze(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function Z(t){this.data=t,this.depth=this.height=0,this.parent=null}Z.prototype=ne.prototype={constructor:Z,count:ke,each:ze,eachAfter:De,eachBefore:Ve,find:Pe,sum:Be,sort:Ee,path:Re,ancestors:He,descendants:Ie,leaves:Oe,links:Ge,copy:Xe,[Symbol.iterator]:qe};function Je(t){if(typeof t!="function")throw new Error;return t}function G(){return 0}function q(t){return function(){return t}}function Ke(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Qe(t,a,l,n,r){for(var s=t.children,h,d=-1,g=s.length,c=t.value&&(n-a)/t.value;++d<g;)h=s[d],h.y0=l,h.y1=r,h.x0=a,h.x1=a+=h.value*c}function et(t,a,l,n,r){for(var s=t.children,h,d=-1,g=s.length,c=t.value&&(r-l)/t.value;++d<g;)h=s[d],h.x0=a,h.x1=n,h.y0=l,h.y1=l+=h.value*c}var tt=(1+Math.sqrt(5))/2;function at(t,a,l,n,r,s){for(var h=[],d=a.children,g,c,p=0,b=0,i=d.length,x,S,v=a.value,u,y,N,$,V,W,M;p<i;){x=r-l,S=s-n;do u=d[b++].value;while(!u&&b<i);for(y=N=u,W=Math.max(S/x,x/S)/(v*t),M=u*u*W,V=Math.max(N/M,M/y);b<i;++b){if(u+=c=d[b].value,c<y&&(y=c),c>N&&(N=c),M=u*u*W,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x<S,children:d.slice(p,b)}),g.dice?Qe(g,l,n,r,v?n+=S*u/v:s):et(g,l,n,v?l+=x*u/v:r,s),v-=u,p=b}return h}const nt=(function t(a){function l(n,r,s,h,d){at(a,n,r,s,h,d)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(tt);function lt(){var t=nt,a=!1,l=1,n=1,r=[0],s=G,h=G,d=G,g=G,c=G;function p(i){return i.x0=i.y0=0,i.x1=l,i.y1=n,i.eachBefore(b),r=[0],a&&i.eachBefore(Ke),i}function b(i){var x=r[i.depth],S=i.x0+x,v=i.y0+x,u=i.x1-x,y=i.y1-x;u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),i.x0=S,i.y0=v,i.x1=u,i.y1=y,i.children&&(x=r[i.depth+1]=s(i)/2,S+=c(i)-x,v+=h(i)-x,u-=d(i)-x,y-=g(i)-x,u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),t(i,S,v,u,y))}return p.round=function(i){return arguments.length?(a=!!i,p):a},p.size=function(i){return arguments.length?(l=+i[0],n=+i[1],p):[l,n]},p.tile=function(i){return arguments.length?(t=Je(i),p):t},p.padding=function(i){return arguments.length?p.paddingInner(i).paddingOuter(i):p.paddingInner()},p.paddingInner=function(i){return arguments.length?(s=typeof i=="function"?i:q(+i),p):s},p.paddingOuter=function(i){return arguments.length?p.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):p.paddingTop()},p.paddingTop=function(i){return arguments.length?(h=typeof i=="function"?i:q(+i),p):h},p.paddingRight=function(i){return arguments.length?(d=typeof i=="function"?i:q(+i),p):d},p.paddingBottom=function(i){return arguments.length?(g=typeof i=="function"?i:q(+i),p):g},p.paddingLeft=function(i){return arguments.length?(c=typeof i=="function"?i:q(+i),p):c},p}var R,oe=(R=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=xe,this.getAccTitle=be,this.setDiagramTitle=we,this.getDiagramTitle=Ce,this.getAccDescription=Te,this.setAccDescription=Le}getNodes(){return this.nodes}getConfig(){const a=$e,l=ae();return ee({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??(this.root=a))}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},r=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(s=>{Ae(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){var l;return((l=this.classes.get(a))==null?void 0:l.styles)??[]}clear(){Fe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(R,"TreeMapDB"),R);function ce(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const s=l[l.length-1].node;s.children?s.children.push(r):s.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}w(ce,"buildHierarchy");var rt=w((t,a)=>{ge(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const h=s.item;if(!h)continue;const d=s.indent?parseInt(s.indent):0,g=st(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};l.push(b)}const n=ce(l),r=w((s,h)=>{for(const d of s)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(n,0)},"populate"),st=w(t=>t.name?String(t.name):"","getItemName"),he={parser:{yy:void 0},parse:w(async t=>{var a;try{const n=await Me("treemap",t);te.debug("Treemap AST:",n);const r=(a=he.parser)==null?void 0:a.yy;if(!(r instanceof oe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");rt(n,r)}catch(l){throw te.error("Error parsing treemap:",l),l}},"parse")},it=10,E=10,X=25,ot=w((t,a,l,n)=>{const r=n.db,s=r.getConfig(),h=s.padding??it,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=ae();if(!g)return;const p=d?30:0,b=Se(a),i=s.nodeWidth?s.nodeWidth*E:960,x=s.nodeHeight?s.nodeHeight*E:500,S=i,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),ve(b,v,S,s.useMaxWidth);let u;try{const e=s.valueFormat||",";if(e==="$0,0")u=w(o=>"$"+O(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),f=o?o[0]:"";u=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);u=w(f=>"$"+O(o||"")(f),"valueFormat")}else u=O(e)}catch(e){te.error("Error creating format function:",e),u=O(",")}const y=Q().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=Q().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=Q().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),W=ne(g).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),le=lt().size([i,x]).paddingTop(e=>e.children&&e.children.length>0?X+E:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?E:0).paddingRight(e=>e.children&&e.children.length>0?E:0).paddingBottom(e=>e.children&&e.children.length>0?E:0).round(!0)(W),de=le.descendants().filter(e=>e.children&&e.children.length>0),H=V.selectAll(".treemapSection").data(de).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=B({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=U(this),f=e.data.name;o.text(f);const C=e.x1-e.x0,L=6;let T;s.showValues!==!1&&e.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=o.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){o.text("..."),_.getComputedTextLength()>m&&o.text("");break}if(o.text(z+"..."),_.getComputedTextLength()<=m)break}}}),s.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?u(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")});const re=le.leaves(),A=re.length>20,pe=A?16:38,j=A?14:28,D=A?4:8,I=A?4:6,J=A?2:4,se=A?8:10,K=A?1:2,Y=V.selectAll(".treemapLeafGroup").data(re).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);Y.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${pe}px;fill:`+$(e.data.name)+";",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=U(this),f=e.x1-e.x0,C=e.y1-e.y0,L=o.node(),T=f-2*J,P=C-2*J;if(T<se||P<se){o.style("display","none");return}let m=parseInt(o.style("font-size"),10);const _=.6;for(;L.getComputedTextLength()>T&&m>D;)m--,o.style("font-size",`${m}px`);let F=Math.max(I,Math.min(j,Math.round(m*_))),k=m+K+F;for(;k>P&&m>D&&(m--,F=Math.max(I,Math.min(j,Math.round(m*_))),!(F<I&&m===D));)o.style("font-size",`${m}px`),k=m+K+F;o.style("font-size",`${m}px`),A?(m<D||P<D)&&o.style("display","none"):(L.getComputedTextLength()>T||m<D||P<m)&&o.style("display","none")}),s.showValues!==!1&&Y.append("text").attr("class","treemapValue").attr("x",o=>(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${j}px;fill:`+$(o.data.name)+";",C=B({cssCompiledStyles:o.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,f)=>`url(#clip-${a}-${f})`).text(o=>o.value?u(o.value):"").each(function(o){const f=U(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=U(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(I,Math.min(j,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(o.y1-o.y0)/2+T/2+K;f.attr("y",F);const k=o.x1-o.x0,ie=o.y1-o.y0-4,me=k-2*J;f.node().getComputedTextLength()>me||F+m>ie||m<I?f.style("display","none"):f.style("display",null)});const ue=s.diagramPadding??8;Ne(b,ue,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),ct=w(function(t,a){return a.db.getClasses()},"getClasses"),ht={draw:ot,getClasses:ct},dt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},pt=w(({treemap:t}={})=>{const a=ye(),l=ae(),n=ee(a,l.themeVariables),r=ee(dt,t),s=r.titleColor??n.titleColor,h=r.labelColor??n.textColor,d=r.valueColor??n.textColor;return`
|
|
1
|
+
import{p as ge}from"./chunk-JWPE2WC7-CHcgcd0s.js";import{_ as w,E as ye,y as ae,A as ee,D as Se,d as ve,l as te,bd as B,j as U,b as xe,a as be,n as we,o as Ce,g as Te,s as Le,B as $e,be as Ae,p as Fe}from"./MermaidBlock-BO-46Du5.js";import{s as Ne}from"./chunk-POPQ4Y6H-B2fCRfpM.js";import{p as Me}from"./cynefin-OW5HDTMX-Bvt-gEmA.js";import{b as O}from"./defaultLocale-DX6XiGOO.js";import{o as Q}from"./ordinal-Cboi1Yqb.js";import"./index-DGG5wIZs.js";import"./init-Gi6I4Gst.js";function _e(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ke(){return this.eachAfter(_e)}function ze(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function Ve(t,a){for(var l=this,n=[l],r,s,h=-1;l=n.pop();)if(t.call(a,l,++h,this),r=l.children)for(s=r.length-1;s>=0;--s)n.push(r[s]);return this}function De(t,a){for(var l=this,n=[l],r=[],s,h,d,g=-1;l=n.pop();)if(r.push(l),s=l.children)for(h=0,d=s.length;h<d;++h)n.push(s[h]);for(;l=r.pop();)t.call(a,l,++g,this);return this}function Pe(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function Be(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,r=n&&n.length;--r>=0;)l+=n[r].value;a.value=l})}function Ee(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Re(t){for(var a=this,l=We(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function We(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function He(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Ie(){return Array.from(this)}function Oe(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Ge(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*qe(){var t=this,a,l=[t],n,r,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,s=n.length;r<s;++r)l.push(n[r]);while(l.length)}function ne(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ye)):a===void 0&&(a=je);for(var l=new Z(t),n,r=[l],s,h,d,g;n=r.pop();)if((h=a(n.data))&&(g=(h=Array.from(h)).length))for(n.children=h,d=g-1;d>=0;--d)r.push(s=h[d]=new Z(h[d])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ze)}function Xe(){return ne(this).eachBefore(Ue)}function je(t){return t.children}function Ye(t){return Array.isArray(t)?t[1]:null}function Ue(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ze(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function Z(t){this.data=t,this.depth=this.height=0,this.parent=null}Z.prototype=ne.prototype={constructor:Z,count:ke,each:ze,eachAfter:De,eachBefore:Ve,find:Pe,sum:Be,sort:Ee,path:Re,ancestors:He,descendants:Ie,leaves:Oe,links:Ge,copy:Xe,[Symbol.iterator]:qe};function Je(t){if(typeof t!="function")throw new Error;return t}function G(){return 0}function q(t){return function(){return t}}function Ke(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Qe(t,a,l,n,r){for(var s=t.children,h,d=-1,g=s.length,c=t.value&&(n-a)/t.value;++d<g;)h=s[d],h.y0=l,h.y1=r,h.x0=a,h.x1=a+=h.value*c}function et(t,a,l,n,r){for(var s=t.children,h,d=-1,g=s.length,c=t.value&&(r-l)/t.value;++d<g;)h=s[d],h.x0=a,h.x1=n,h.y0=l,h.y1=l+=h.value*c}var tt=(1+Math.sqrt(5))/2;function at(t,a,l,n,r,s){for(var h=[],d=a.children,g,c,p=0,b=0,i=d.length,x,S,v=a.value,u,y,N,$,V,W,M;p<i;){x=r-l,S=s-n;do u=d[b++].value;while(!u&&b<i);for(y=N=u,W=Math.max(S/x,x/S)/(v*t),M=u*u*W,V=Math.max(N/M,M/y);b<i;++b){if(u+=c=d[b].value,c<y&&(y=c),c>N&&(N=c),M=u*u*W,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x<S,children:d.slice(p,b)}),g.dice?Qe(g,l,n,r,v?n+=S*u/v:s):et(g,l,n,v?l+=x*u/v:r,s),v-=u,p=b}return h}const nt=(function t(a){function l(n,r,s,h,d){at(a,n,r,s,h,d)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(tt);function lt(){var t=nt,a=!1,l=1,n=1,r=[0],s=G,h=G,d=G,g=G,c=G;function p(i){return i.x0=i.y0=0,i.x1=l,i.y1=n,i.eachBefore(b),r=[0],a&&i.eachBefore(Ke),i}function b(i){var x=r[i.depth],S=i.x0+x,v=i.y0+x,u=i.x1-x,y=i.y1-x;u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),i.x0=S,i.y0=v,i.x1=u,i.y1=y,i.children&&(x=r[i.depth+1]=s(i)/2,S+=c(i)-x,v+=h(i)-x,u-=d(i)-x,y-=g(i)-x,u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),t(i,S,v,u,y))}return p.round=function(i){return arguments.length?(a=!!i,p):a},p.size=function(i){return arguments.length?(l=+i[0],n=+i[1],p):[l,n]},p.tile=function(i){return arguments.length?(t=Je(i),p):t},p.padding=function(i){return arguments.length?p.paddingInner(i).paddingOuter(i):p.paddingInner()},p.paddingInner=function(i){return arguments.length?(s=typeof i=="function"?i:q(+i),p):s},p.paddingOuter=function(i){return arguments.length?p.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):p.paddingTop()},p.paddingTop=function(i){return arguments.length?(h=typeof i=="function"?i:q(+i),p):h},p.paddingRight=function(i){return arguments.length?(d=typeof i=="function"?i:q(+i),p):d},p.paddingBottom=function(i){return arguments.length?(g=typeof i=="function"?i:q(+i),p):g},p.paddingLeft=function(i){return arguments.length?(c=typeof i=="function"?i:q(+i),p):c},p}var R,oe=(R=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=xe,this.getAccTitle=be,this.setDiagramTitle=we,this.getDiagramTitle=Ce,this.getAccDescription=Te,this.setAccDescription=Le}getNodes(){return this.nodes}getConfig(){const a=$e,l=ae();return ee({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??(this.root=a))}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},r=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(s=>{Ae(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){var l;return((l=this.classes.get(a))==null?void 0:l.styles)??[]}clear(){Fe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(R,"TreeMapDB"),R);function ce(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const s=l[l.length-1].node;s.children?s.children.push(r):s.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}w(ce,"buildHierarchy");var rt=w((t,a)=>{ge(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const h=s.item;if(!h)continue;const d=s.indent?parseInt(s.indent):0,g=st(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};l.push(b)}const n=ce(l),r=w((s,h)=>{for(const d of s)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(n,0)},"populate"),st=w(t=>t.name?String(t.name):"","getItemName"),he={parser:{yy:void 0},parse:w(async t=>{var a;try{const n=await Me("treemap",t);te.debug("Treemap AST:",n);const r=(a=he.parser)==null?void 0:a.yy;if(!(r instanceof oe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");rt(n,r)}catch(l){throw te.error("Error parsing treemap:",l),l}},"parse")},it=10,E=10,X=25,ot=w((t,a,l,n)=>{const r=n.db,s=r.getConfig(),h=s.padding??it,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=ae();if(!g)return;const p=d?30:0,b=Se(a),i=s.nodeWidth?s.nodeWidth*E:960,x=s.nodeHeight?s.nodeHeight*E:500,S=i,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),ve(b,v,S,s.useMaxWidth);let u;try{const e=s.valueFormat||",";if(e==="$0,0")u=w(o=>"$"+O(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),f=o?o[0]:"";u=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);u=w(f=>"$"+O(o||"")(f),"valueFormat")}else u=O(e)}catch(e){te.error("Error creating format function:",e),u=O(",")}const y=Q().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=Q().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=Q().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),W=ne(g).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),le=lt().size([i,x]).paddingTop(e=>e.children&&e.children.length>0?X+E:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?E:0).paddingRight(e=>e.children&&e.children.length>0?E:0).paddingBottom(e=>e.children&&e.children.length>0?E:0).round(!0)(W),de=le.descendants().filter(e=>e.children&&e.children.length>0),H=V.selectAll(".treemapSection").data(de).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=B({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=U(this),f=e.data.name;o.text(f);const C=e.x1-e.x0,L=6;let T;s.showValues!==!1&&e.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=o.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){o.text("..."),_.getComputedTextLength()>m&&o.text("");break}if(o.text(z+"..."),_.getComputedTextLength()<=m)break}}}),s.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?u(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")});const re=le.leaves(),A=re.length>20,pe=A?16:38,j=A?14:28,D=A?4:8,I=A?4:6,J=A?2:4,se=A?8:10,K=A?1:2,Y=V.selectAll(".treemapLeafGroup").data(re).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);Y.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${pe}px;fill:`+$(e.data.name)+";",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=U(this),f=e.x1-e.x0,C=e.y1-e.y0,L=o.node(),T=f-2*J,P=C-2*J;if(T<se||P<se){o.style("display","none");return}let m=parseInt(o.style("font-size"),10);const _=.6;for(;L.getComputedTextLength()>T&&m>D;)m--,o.style("font-size",`${m}px`);let F=Math.max(I,Math.min(j,Math.round(m*_))),k=m+K+F;for(;k>P&&m>D&&(m--,F=Math.max(I,Math.min(j,Math.round(m*_))),!(F<I&&m===D));)o.style("font-size",`${m}px`),k=m+K+F;o.style("font-size",`${m}px`),A?(m<D||P<D)&&o.style("display","none"):(L.getComputedTextLength()>T||m<D||P<m)&&o.style("display","none")}),s.showValues!==!1&&Y.append("text").attr("class","treemapValue").attr("x",o=>(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${j}px;fill:`+$(o.data.name)+";",C=B({cssCompiledStyles:o.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,f)=>`url(#clip-${a}-${f})`).text(o=>o.value?u(o.value):"").each(function(o){const f=U(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=U(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(I,Math.min(j,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(o.y1-o.y0)/2+T/2+K;f.attr("y",F);const k=o.x1-o.x0,ie=o.y1-o.y0-4,me=k-2*J;f.node().getComputedTextLength()>me||F+m>ie||m<I?f.style("display","none"):f.style("display",null)});const ue=s.diagramPadding??8;Ne(b,ue,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),ct=w(function(t,a){return a.db.getClasses()},"getClasses"),ht={draw:ot,getClasses:ct},dt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},pt=w(({treemap:t}={})=>{const a=ye(),l=ae(),n=ee(a,l.themeVariables),r=ee(dt,t),s=r.titleColor??n.titleColor,h=r.labelColor??n.textColor,d=r.valueColor??n.textColor;return`
|
|
2
2
|
.treemapNode.section {
|
|
3
3
|
stroke: ${r.sectionStrokeColor};
|
|
4
4
|
stroke-width: ${r.sectionStrokeWidth};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as $}from"./chunk-JWPE2WC7-
|
|
1
|
+
import{p as $}from"./chunk-JWPE2WC7-CHcgcd0s.js";import{_ as b,A as m,D as C,d as S,l as w,b as D,a as T,n as P,o as z,g as A,s as E,y as F,B as W,p as _}from"./MermaidBlock-BO-46Du5.js";import{p as N}from"./cynefin-OW5HDTMX-Bvt-gEmA.js";import"./index-DGG5wIZs.js";var L=W.packet,u,v=(u=class{constructor(){this.packet=[],this.setAccTitle=D,this.getAccTitle=T,this.setDiagramTitle=P,this.getDiagramTitle=z,this.getAccDescription=A,this.setAccDescription=E}getConfig(){const t=m({...L,...F().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){_(),this.packet=[]}},b(u,"PacketDB"),u),M=1e4,Y=b((e,t)=>{$(e,t);let s=-1,r=[],n=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:i,bits:d,label:c}of e.blocks){if(a!==void 0&&i!==void 0&&i<a)throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);if(a??(a=s+1),a!==s+1)throw new Error(`Packet block ${a} - ${i??a} is not contiguous. It should start from ${s+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(i??(i=a+(d??1)-1),d??(d=i-a+1),s=i,w.debug(`Packet block ${a} - ${s} with label ${c}`);r.length<=l+1&&t.getPacket().length<M;){const[p,o]=I({start:a,end:i,bits:d,label:c},n,l);if(r.push(p),p.end+1===n*l&&(t.pushWord(r),r=[],n++),!o)break;({start:a,end:i,bits:d,label:c}=o)}}t.pushWord(r)},"populate"),I=b((e,t,s)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*s)return[e,void 0];const r=t*s-1,n=t*s;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:n,end:e.end,label:e.label,bits:e.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:b(async e=>{var r;const t=await N("packet",e),s=(r=x.parser)==null?void 0:r.yy;if(!(s instanceof v))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");w.debug(t),Y(t,s)},"parse")},O=b((e,t,s,r)=>{const n=r.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=C(t);f.attr("viewBox",`0 0 ${k} ${g}`),S(f,g,k,l.useMaxWidth);for(const[y,B]of p.entries())j(f,B,y,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),j=b((e,t,s,{rowHeight:r,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=e.append("g"),p=s*(r+l)+l;for(const o of t){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",r).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),G={draw:O},H={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},K=b(({packet:e}={})=>{const t=m(H,e);return`
|
|
2
2
|
.packetByte {
|
|
3
3
|
font-size: ${t.byteFontSize};
|
|
4
4
|
}
|
package/web/dist/assets/{ebnfDiagram-PWID7BFC-CVW16_vb.js → ebnfDiagram-PWID7BFC-Bpe_QVbH.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as l,r as m,d as n}from"./chunk-SVP7TREG-
|
|
1
|
+
import{g as l,r as m,d as n}from"./chunk-SVP7TREG-JSLcsRlZ.js";import{p}from"./chunk-JWPE2WC7-CHcgcd0s.js";import{_ as t,l as o}from"./MermaidBlock-BO-46Du5.js";import{M as u,a as f}from"./cynefin-OW5HDTMX-Bvt-gEmA.js";import"./index-DGG5wIZs.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},R={parser:g,db:n,renderer:m,styles:l};export{R as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Ut}from"./chunk-XXDRQBXY-BwZ7RbpQ.js";import{s as Kt}from"./chunk-POPQ4Y6H-dxddZlXt.js";import{_ as f,b as Zt,a as jt,s as qt,g as Wt,n as Ht,o as Qt,c as tt,l as F,k as Xt,p as Jt,q as $t,r as te,t as ee,u as se,v as ie,j as re,x as ne}from"./MermaidBlock-DR1GikCv.js";import{c as ae}from"./channel-DGkccMO1.js";import"./index-GAamh1p4.js";var Ot=(function(){var s=f(function(G,a,h,d){for(h=h||{},d=G.length;d--;h[G[d]]=a);return h},"o"),n=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],c=[2,2],o=[1,7],r=[1,9],l=[1,10],y=[1,11],b=[1,12],k=[1,30],R=[1,23],p=[1,24],g=[1,25],C=[1,26],v=[1,27],x=[1,19],T=[1,28],I=[1,29],N=[1,20],D=[1,18],L=[1,21],w=[1,22],xt=[2,6],u=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],pt=[1,36],ft=[1,37],bt=[1,38],gt=[1,39],yt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],q=[43,51,53,54,55,74,75],W=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],Nt=[69,70,71,72,73],Ct=[1,91],It=[6,9,45,50],z=[6,9,12,44,45,50,51,52],nt=[1,101],at=[1,100],ot=[1,99],J=[18,61],At=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],_t=[18,61,64,66],kt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(a,h,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttributes(t[e-8],t[e-1]),i.setClass([t[e-8]],t[e-3]),this.$=[t[e-8]];break;case 19:i.addEntity(t[e-5],t[e-3]),this.$=[t[e-5]];break;case 20:i.addEntity(t[e-7],t[e-5]),i.setClass([t[e-7]],t[e-2]),this.$=[t[e-7]];break;case 21:i.addEntity(t[e-3],t[e-1]);break;case 22:i.addEntity(t[e-5],t[e-3]),i.setClass([t[e-5]],t[e]);break;case 23:case 24:this.$=t[e].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[e].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[e]:(i.setDirection(t[e].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[e-2].id},t[e-1],{text:t[e-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-1],text:t[e-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-4],text:t[e-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[e];break;case 35:this.$=t[e-1]+" "+t[e];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[e-3],i.addClass(t[e-2],t[e-1]);break;case 41:case 42:case 63:case 72:this.$=[t[e]];break;case 43:case 44:this.$=t[e-2].concat([t[e]]);break;case 45:this.$=t[e-2],i.setClass(t[e-1],t[e]);break;case 46:this.$=t[e-3],i.addCssStyles(t[e-2],t[e-1]);break;case 47:this.$=[t[e]];break;case 48:t[e-2].push(t[e]),this.$=t[e-2];break;case 50:this.$=t[e-1]+t[e];break;case 58:case 84:case 85:this.$=t[e].replace(/"/g,"");break;case 64:t[e].push(t[e-1]),this.$=t[e];break;case 65:this.$={type:t[e-1],name:t[e]};break;case 66:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 67:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 68:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 69:case 71:case 74:this.$=t[e];break;case 70:this.$=t[e-1]+t[e];break;case 73:t[e-2].push(t[e]),this.$=t[e-2];break;case 75:this.$=t[e].replace(/"/g,"");break;case 76:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(n,c,{5:3}),{6:[1,4],7:5,8:6,9:o,10:8,21:r,23:l,25:y,27:b,28:13,29:14,30:15,31:16,32:17,34:k,37:R,38:p,39:g,40:C,41:v,43:x,46:T,47:I,51:N,53:D,54:L,55:w},s(n,xt,{1:[2,1]}),s(u,[2,3]),s(u,[2,4]),s(u,[2,5]),s(u,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:pt,70:ft,71:bt,72:gt,73:yt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},s(u,[2,26]),s(u,[2,27]),s(u,[2,28]),s(u,[2,29]),s(u,[2,30]),s(u,c,{5:44}),s(Z,[2,58]),s(Z,[2,59]),s(Z,[2,60]),s(Z,[2,61]),s(Z,[2,62]),s(u,[2,36]),s(u,[2,37]),s(u,[2,38]),s(u,[2,39]),{15:45,43:V,44:M},{15:48,43:V,44:M},{15:49,43:V,44:M},{10:50,43:x,51:N,53:D,54:L,55:w},{10:51,43:x,51:N,53:D,54:L,55:w},{15:52,43:V,44:M},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:x,51:N,53:D,54:L,55:w},{68:59,74:[1,60],75:[1,61]},s(q,[2,77]),s(q,[2,78]),s(q,[2,79]),s(q,[2,80]),s(q,[2,81]),s(u,[2,23]),s(u,[2,24]),s(u,[2,25]),{6:[1,63],7:5,8:6,9:o,10:8,21:r,23:l,25:y,27:b,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:k,37:R,38:p,39:g,40:C,41:v,43:x,46:T,47:I,51:N,53:D,54:L,55:w},{12:W,42:64,44:H,45:B,48:66,49:67,51:Q,52:X},s(et,[2,41]),s(et,[2,42]),{15:72,43:V,44:M,45:B},{12:W,42:73,44:H,45:B,48:66,49:67,51:Q,52:X},{6:st,9:it,19:[1,75],35:74,50:rt},{12:[1,79],14:[1,80]},s(u,[2,16],{67:35,11:81,16:[1,82],45:B,69:pt,70:ft,71:bt,72:gt,73:yt}),{18:[1,83]},s(u,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:pt,70:ft,71:bt,72:gt,73:yt},s(Nt,[2,82]),s(Nt,[2,83]),s(u,[2,31]),s(u,xt),{6:st,9:it,35:90,45:Ct,50:rt},{43:[1,92],44:[1,93]},s(It,[2,47],{49:94,12:W,44:H,51:Q,52:X}),s(z,[2,49]),s(z,[2,54]),s(z,[2,55]),s(z,[2,56]),s(z,[2,57]),s(u,[2,45],{45:B}),{6:st,9:it,35:95,45:Ct,50:rt},s(u,[2,32]),{10:97,36:96,43:x,51:N,53:D,54:L,55:w},s(u,[2,51]),s(u,[2,52]),s(u,[2,53]),{13:98,43:nt,53:at,76:ot},{15:102,43:V,44:M},{10:103,43:x,51:N,53:D,54:L,55:w},{17:104,18:[1,105],56:55,57:56,61:j},s(u,[2,11]),{18:[2,64]},s(J,[2,65],{59:106,60:107,63:108,65:At,66:Rt}),s([18,61,65,66],[2,71]),{61:[2,70]},s(u,[2,21],{14:[1,112],16:[1,111]}),s([43,51,53,54,55],[2,76]),s(u,[2,40]),{12:W,44:H,48:113,49:67,51:Q,52:X},s(et,[2,43]),s(et,[2,44]),s(z,[2,50]),s(u,[2,46]),{10:115,20:[1,114],43:x,51:N,53:D,54:L,55:w},s(vt,[2,34]),s(u,[2,7]),s(u,[2,84]),s(u,[2,85]),s(u,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},s(u,[2,14]),s(J,[2,66],{60:120,64:[1,121],66:Rt}),s(J,[2,67]),s(_t,[2,72]),s(J,[2,75]),s(_t,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:V,44:M},s(It,[2,48],{49:94,12:W,44:H,51:Q,52:X}),{6:st,9:it,35:125,50:rt},s(vt,[2,35]),{13:126,43:nt,53:at,76:ot},{15:127,43:V,44:M},{13:128,43:nt,53:at,76:ot},s(u,[2,12]),s(J,[2,68]),{63:129,65:At},{18:[1,130]},s(u,[2,19]),s(u,[2,22],{16:[1,131],45:B}),s(u,[2,33]),s(u,[2,10]),{12:[1,132],45:B},s(u,[2,9]),s(_t,[2,73]),s(u,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:nt,53:at,76:ot},{18:[1,136]},s(u,[2,20]),s(u,[2,8]),s(u,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:f(function(a,h){if(h.recoverable)this.trace(a);else{var d=new Error(a);throw d.hash=h,d}},"parseError"),parse:f(function(a){var h=this,d=[0],i=[],_=[null],t=[],$=this.table,e="",lt=0,Dt=0,Ft=2,Lt=1,Yt=t.slice.call(arguments,1),m=Object.create(this.lexer),Y={yy:{}};for(var mt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,mt)&&(Y.yy[mt]=this.yy[mt]);m.setInput(a,Y.yy),Y.yy.lexer=m,Y.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Et=m.yylloc;t.push(Et);var Pt=m.options&&m.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zt(S){d.length=d.length-2*S,_.length=_.length-S,t.length=t.length-S}f(zt,"popStack");function wt(){var S;return S=i.pop()||m.lex()||Lt,typeof S!="number"&&(S instanceof Array&&(i=S,S=i.pop()),S=h.symbols_[S]||S),S}f(wt,"lex");for(var E,P,O,St,U={},ht,A,Vt,ut;;){if(P=d[d.length-1],this.defaultActions[P]?O=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=wt()),O=$[P]&&$[P][E]),typeof O>"u"||!O.length||!O[0]){var Tt="";ut=[];for(ht in $[P])this.terminals_[ht]&&ht>Ft&&ut.push("'"+this.terminals_[ht]+"'");m.showPosition?Tt="Parse error on line "+(lt+1)+`:
|
|
1
|
+
import{g as Ut}from"./chunk-XXDRQBXY-BCjvaeHm.js";import{s as Kt}from"./chunk-POPQ4Y6H-B2fCRfpM.js";import{_ as f,b as Zt,a as jt,s as qt,g as Wt,n as Ht,o as Qt,c as tt,l as F,k as Xt,p as Jt,q as $t,r as te,t as ee,u as se,v as ie,j as re,x as ne}from"./MermaidBlock-BO-46Du5.js";import{c as ae}from"./channel-DFyiuGL0.js";import"./index-DGG5wIZs.js";var Ot=(function(){var s=f(function(G,a,h,d){for(h=h||{},d=G.length;d--;h[G[d]]=a);return h},"o"),n=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],c=[2,2],o=[1,7],r=[1,9],l=[1,10],y=[1,11],b=[1,12],k=[1,30],R=[1,23],p=[1,24],g=[1,25],C=[1,26],v=[1,27],x=[1,19],T=[1,28],I=[1,29],N=[1,20],D=[1,18],L=[1,21],w=[1,22],xt=[2,6],u=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],pt=[1,36],ft=[1,37],bt=[1,38],gt=[1,39],yt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],q=[43,51,53,54,55,74,75],W=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],Nt=[69,70,71,72,73],Ct=[1,91],It=[6,9,45,50],z=[6,9,12,44,45,50,51,52],nt=[1,101],at=[1,100],ot=[1,99],J=[18,61],At=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],_t=[18,61,64,66],kt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(a,h,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttributes(t[e-8],t[e-1]),i.setClass([t[e-8]],t[e-3]),this.$=[t[e-8]];break;case 19:i.addEntity(t[e-5],t[e-3]),this.$=[t[e-5]];break;case 20:i.addEntity(t[e-7],t[e-5]),i.setClass([t[e-7]],t[e-2]),this.$=[t[e-7]];break;case 21:i.addEntity(t[e-3],t[e-1]);break;case 22:i.addEntity(t[e-5],t[e-3]),i.setClass([t[e-5]],t[e]);break;case 23:case 24:this.$=t[e].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[e].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[e]:(i.setDirection(t[e].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[e-2].id},t[e-1],{text:t[e-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-1],text:t[e-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-4],text:t[e-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[e];break;case 35:this.$=t[e-1]+" "+t[e];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[e-3],i.addClass(t[e-2],t[e-1]);break;case 41:case 42:case 63:case 72:this.$=[t[e]];break;case 43:case 44:this.$=t[e-2].concat([t[e]]);break;case 45:this.$=t[e-2],i.setClass(t[e-1],t[e]);break;case 46:this.$=t[e-3],i.addCssStyles(t[e-2],t[e-1]);break;case 47:this.$=[t[e]];break;case 48:t[e-2].push(t[e]),this.$=t[e-2];break;case 50:this.$=t[e-1]+t[e];break;case 58:case 84:case 85:this.$=t[e].replace(/"/g,"");break;case 64:t[e].push(t[e-1]),this.$=t[e];break;case 65:this.$={type:t[e-1],name:t[e]};break;case 66:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 67:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 68:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 69:case 71:case 74:this.$=t[e];break;case 70:this.$=t[e-1]+t[e];break;case 73:t[e-2].push(t[e]),this.$=t[e-2];break;case 75:this.$=t[e].replace(/"/g,"");break;case 76:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(n,c,{5:3}),{6:[1,4],7:5,8:6,9:o,10:8,21:r,23:l,25:y,27:b,28:13,29:14,30:15,31:16,32:17,34:k,37:R,38:p,39:g,40:C,41:v,43:x,46:T,47:I,51:N,53:D,54:L,55:w},s(n,xt,{1:[2,1]}),s(u,[2,3]),s(u,[2,4]),s(u,[2,5]),s(u,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:pt,70:ft,71:bt,72:gt,73:yt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},s(u,[2,26]),s(u,[2,27]),s(u,[2,28]),s(u,[2,29]),s(u,[2,30]),s(u,c,{5:44}),s(Z,[2,58]),s(Z,[2,59]),s(Z,[2,60]),s(Z,[2,61]),s(Z,[2,62]),s(u,[2,36]),s(u,[2,37]),s(u,[2,38]),s(u,[2,39]),{15:45,43:V,44:M},{15:48,43:V,44:M},{15:49,43:V,44:M},{10:50,43:x,51:N,53:D,54:L,55:w},{10:51,43:x,51:N,53:D,54:L,55:w},{15:52,43:V,44:M},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:x,51:N,53:D,54:L,55:w},{68:59,74:[1,60],75:[1,61]},s(q,[2,77]),s(q,[2,78]),s(q,[2,79]),s(q,[2,80]),s(q,[2,81]),s(u,[2,23]),s(u,[2,24]),s(u,[2,25]),{6:[1,63],7:5,8:6,9:o,10:8,21:r,23:l,25:y,27:b,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:k,37:R,38:p,39:g,40:C,41:v,43:x,46:T,47:I,51:N,53:D,54:L,55:w},{12:W,42:64,44:H,45:B,48:66,49:67,51:Q,52:X},s(et,[2,41]),s(et,[2,42]),{15:72,43:V,44:M,45:B},{12:W,42:73,44:H,45:B,48:66,49:67,51:Q,52:X},{6:st,9:it,19:[1,75],35:74,50:rt},{12:[1,79],14:[1,80]},s(u,[2,16],{67:35,11:81,16:[1,82],45:B,69:pt,70:ft,71:bt,72:gt,73:yt}),{18:[1,83]},s(u,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:pt,70:ft,71:bt,72:gt,73:yt},s(Nt,[2,82]),s(Nt,[2,83]),s(u,[2,31]),s(u,xt),{6:st,9:it,35:90,45:Ct,50:rt},{43:[1,92],44:[1,93]},s(It,[2,47],{49:94,12:W,44:H,51:Q,52:X}),s(z,[2,49]),s(z,[2,54]),s(z,[2,55]),s(z,[2,56]),s(z,[2,57]),s(u,[2,45],{45:B}),{6:st,9:it,35:95,45:Ct,50:rt},s(u,[2,32]),{10:97,36:96,43:x,51:N,53:D,54:L,55:w},s(u,[2,51]),s(u,[2,52]),s(u,[2,53]),{13:98,43:nt,53:at,76:ot},{15:102,43:V,44:M},{10:103,43:x,51:N,53:D,54:L,55:w},{17:104,18:[1,105],56:55,57:56,61:j},s(u,[2,11]),{18:[2,64]},s(J,[2,65],{59:106,60:107,63:108,65:At,66:Rt}),s([18,61,65,66],[2,71]),{61:[2,70]},s(u,[2,21],{14:[1,112],16:[1,111]}),s([43,51,53,54,55],[2,76]),s(u,[2,40]),{12:W,44:H,48:113,49:67,51:Q,52:X},s(et,[2,43]),s(et,[2,44]),s(z,[2,50]),s(u,[2,46]),{10:115,20:[1,114],43:x,51:N,53:D,54:L,55:w},s(vt,[2,34]),s(u,[2,7]),s(u,[2,84]),s(u,[2,85]),s(u,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},s(u,[2,14]),s(J,[2,66],{60:120,64:[1,121],66:Rt}),s(J,[2,67]),s(_t,[2,72]),s(J,[2,75]),s(_t,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:V,44:M},s(It,[2,48],{49:94,12:W,44:H,51:Q,52:X}),{6:st,9:it,35:125,50:rt},s(vt,[2,35]),{13:126,43:nt,53:at,76:ot},{15:127,43:V,44:M},{13:128,43:nt,53:at,76:ot},s(u,[2,12]),s(J,[2,68]),{63:129,65:At},{18:[1,130]},s(u,[2,19]),s(u,[2,22],{16:[1,131],45:B}),s(u,[2,33]),s(u,[2,10]),{12:[1,132],45:B},s(u,[2,9]),s(_t,[2,73]),s(u,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:nt,53:at,76:ot},{18:[1,136]},s(u,[2,20]),s(u,[2,8]),s(u,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:f(function(a,h){if(h.recoverable)this.trace(a);else{var d=new Error(a);throw d.hash=h,d}},"parseError"),parse:f(function(a){var h=this,d=[0],i=[],_=[null],t=[],$=this.table,e="",lt=0,Dt=0,Ft=2,Lt=1,Yt=t.slice.call(arguments,1),m=Object.create(this.lexer),Y={yy:{}};for(var mt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,mt)&&(Y.yy[mt]=this.yy[mt]);m.setInput(a,Y.yy),Y.yy.lexer=m,Y.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Et=m.yylloc;t.push(Et);var Pt=m.options&&m.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zt(S){d.length=d.length-2*S,_.length=_.length-S,t.length=t.length-S}f(zt,"popStack");function wt(){var S;return S=i.pop()||m.lex()||Lt,typeof S!="number"&&(S instanceof Array&&(i=S,S=i.pop()),S=h.symbols_[S]||S),S}f(wt,"lex");for(var E,P,O,St,U={},ht,A,Vt,ut;;){if(P=d[d.length-1],this.defaultActions[P]?O=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=wt()),O=$[P]&&$[P][E]),typeof O>"u"||!O.length||!O[0]){var Tt="";ut=[];for(ht in $[P])this.terminals_[ht]&&ht>Ft&&ut.push("'"+this.terminals_[ht]+"'");m.showPosition?Tt="Parse error on line "+(lt+1)+`:
|
|
2
2
|
`+m.showPosition()+`
|
|
3
3
|
Expecting `+ut.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Tt="Parse error on line "+(lt+1)+": Unexpected "+(E==Lt?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Tt,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:Et,expected:ut})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(O[0]){case 1:d.push(E),_.push(m.yytext),t.push(m.yylloc),d.push(O[1]),E=null,Dt=m.yyleng,e=m.yytext,lt=m.yylineno,Et=m.yylloc;break;case 2:if(A=this.productions_[O[1]][1],U.$=_[_.length-A],U._$={first_line:t[t.length-(A||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(A||1)].first_column,last_column:t[t.length-1].last_column},Pt&&(U._$.range=[t[t.length-(A||1)].range[0],t[t.length-1].range[1]]),St=this.performAction.apply(U,[e,Dt,lt,Y.yy,O[1],_,t].concat(Yt)),typeof St<"u")return St;A&&(d=d.slice(0,-1*A*2),_=_.slice(0,-1*A),t=t.slice(0,-1*A)),d.push(this.productions_[O[1]][0]),_.push(U.$),t.push(U._$),Vt=$[d[d.length-2]][d[d.length-1]],d.push(Vt);break;case 3:return!0}}return!0},"parse")},Gt=(function(){var G={EOF:1,parseError:f(function(h,d){if(this.yy.parser)this.yy.parser.parseError(h,d);else throw new Error(h)},"parseError"),setInput:f(function(a,h){return this.yy=h||this.yy||{},this._input=a,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:f(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var h=a.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:f(function(a){var h=a.length,d=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var i=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),d.length-1&&(this.yylineno-=d.length-1);var _=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:d?(d.length===i.length?this.yylloc.first_column:0)+i[i.length-d.length].length-d[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(a){this.unput(this.match.slice(a))},"less"),pastInput:f(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var a=this.pastInput(),h=new Array(a.length+1).join("-");return a+this.upcomingInput()+`
|
package/web/dist/assets/{flowDiagram-A5DVABFB-S34LpLtK.js → flowDiagram-A5DVABFB-CCw2H08-.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Xt}from"./chunk-5VM5RSS4-
|
|
1
|
+
import{g as Xt}from"./chunk-5VM5RSS4-DydfHlEc.js";import{g as Qt}from"./chunk-XXDRQBXY-BCjvaeHm.js";import{s as Jt}from"./chunk-POPQ4Y6H-B2fCRfpM.js";import{_ as k,b4 as Zt,F as Mt,l as $,c as ke,u as $t,v as e1,x as rt,b as t1,s as s1,n as i1,a as r1,g as a1,o as n1,k as u1,H as o1,J as l1,ca as c1,q as st,j as it,O as h1,p as d1,b7 as p1,r as f1}from"./MermaidBlock-BO-46Du5.js";import{f as g1}from"./chunk-F27PBJKO-BO7GxhSv.js";import{c as b1}from"./channel-DFyiuGL0.js";var A1="flowchart-",Pe,k1=(Pe=class{constructor(){this.vertexCounter=0,this.config=ke(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=t1,this.setAccDescription=s1,this.setDiagramTitle=i1,this.getAccTitle=r1,this.getAccDescription=a1,this.getDiagramTitle=n1,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return u1.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const r of this.vertices.values())if(r.id===i)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,r,a,n,l,g,h={},m){var F,c;if(!i||i.trim().length===0)return;let u;if(m!==void 0){let d;m.includes(`
|
|
2
2
|
`)?d=m+`
|
|
3
3
|
`:d=`{
|
|
4
4
|
`+m+`
|