difit 4.0.1 → 4.0.3
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/README.ja.md +2 -1
- package/README.ko.md +2 -1
- package/README.md +2 -1
- package/README.zh.md +2 -1
- package/dist/cli/index.js +40 -28
- package/dist/cli/index.test.js +187 -116
- package/dist/cli/tuiDeprecation.d.ts +3 -0
- package/dist/cli/tuiDeprecation.js +16 -0
- package/dist/cli/tuiDeprecation.test.d.ts +1 -0
- package/dist/cli/tuiDeprecation.test.js +16 -0
- package/dist/cli/utils.d.ts +1 -0
- package/dist/cli/utils.js +17 -0
- package/dist/client/assets/_basePickBy-hOr-yGsE.js +1 -0
- package/dist/client/assets/_baseUniq-b7bzdUSn.js +1 -0
- package/dist/client/assets/arc-D65wG9gm.js +1 -0
- package/dist/client/assets/architecture-PBZL5I3N-DUNTzy9d.js +1 -0
- package/dist/client/assets/architectureDiagram-2XIMDMQ5-BOmef_aT.js +36 -0
- package/dist/client/assets/array-DOVTz2Mq.js +1 -0
- package/dist/client/assets/blockDiagram-WCTKOSBZ-CuovjbLp.js +132 -0
- package/dist/client/assets/c4Diagram-IC4MRINW-l2hgU0UG.js +10 -0
- package/dist/client/assets/channel-BBMOf_Bn.js +1 -0
- package/dist/client/assets/chunk-4BX2VUAB-Bh2XMPGo.js +1 -0
- package/dist/client/assets/chunk-55IACEB6-r9BRoqNs.js +1 -0
- package/dist/client/assets/chunk-7E7YKBS2-BUy3or4g.js +1 -0
- package/dist/client/assets/chunk-7R4GIKGN-C7ClNgvP.js +80 -0
- package/dist/client/assets/chunk-C72U2L5F-_P9RrDdo.js +1 -0
- package/dist/client/assets/chunk-EGIJ26TM-D-xQ2sZ-.js +1 -0
- package/dist/client/assets/{chunk-FMBD7UC4-BSa8SHgd.js → chunk-FMBD7UC4-OuP8NjEM.js} +2 -2
- package/dist/client/assets/chunk-GEFDOKGD-noJ9o8LM.js +2 -0
- package/dist/client/assets/chunk-GLR3WWYH-DVK9OjRZ.js +2 -0
- package/dist/client/assets/chunk-HHEYEP7N-C1QyKuQs.js +1 -0
- package/dist/client/assets/chunk-JSJVCQXG-2AjhqYcu.js +1 -0
- package/dist/client/assets/chunk-KX2RTZJC-tMPTaDcx.js +1 -0
- package/dist/client/assets/chunk-KYZI473N-CGwu81pT.js +53 -0
- package/dist/client/assets/chunk-L3YUKLVL-DFNfIVVw.js +1 -0
- package/dist/client/assets/chunk-MX3YWQON-BnSlIBhe.js +1 -0
- package/dist/client/assets/chunk-NQ4KR5QH-CpfTlpaZ.js +220 -0
- package/dist/client/assets/chunk-O4XLMI2P-BDGKGscp.js +7 -0
- package/dist/client/assets/chunk-OZEHJAEY-3OAEqm17.js +1 -0
- package/dist/client/assets/chunk-PQ6SQG4A-DfQjNfPX.js +1 -0
- package/dist/client/assets/chunk-PU5JKC2W-DRiL1iN6.js +70 -0
- package/dist/client/assets/chunk-QZHKN3VN-DBD5yPlw.js +1 -0
- package/dist/client/assets/chunk-R5LLSJPH-dkcbq1pR.js +1 -0
- package/dist/client/assets/chunk-WL4C6EOR-BeCB6d6F.js +189 -0
- package/dist/client/assets/chunk-XIRO2GV7-BxmEO1Vi.js +1 -0
- package/dist/client/assets/chunk-XPW4576I-jm7TiixU.js +32 -0
- package/dist/client/assets/chunk-XZSTWKYB-BGKYCy46.js +94 -0
- package/dist/client/assets/chunk-YBOYWFTD-C9faLjdm.js +1 -0
- package/dist/client/assets/classDiagram-VBA2DB6C-Depk8rxx.js +1 -0
- package/dist/client/assets/classDiagram-v2-RAHNMMFH-DHvQPm8y.js +1 -0
- package/dist/client/assets/clone-DuY6BQEm.js +1 -0
- package/dist/client/assets/cose-bilkent-S5V4N54A-BWD5TWFn.js +1 -0
- package/dist/client/assets/cytoscape.esm-B3gzQ1NF.js +321 -0
- package/dist/client/assets/dagre-Dd1VxucU.js +1 -0
- package/dist/client/assets/dagre-KLK3FWXG-BJFTyMud.js +4 -0
- package/dist/client/assets/defaultLocale-Ck2Xxk-C.js +1 -0
- package/dist/client/assets/diagram-E7M64L7V-eWdHIl72.js +24 -0
- package/dist/client/assets/diagram-IFDJBPK2-C1-sqK0o.js +43 -0
- package/dist/client/assets/diagram-P4PSJMXO-DHeUNvSg.js +24 -0
- package/dist/client/assets/dist-FLbYR5UU.js +1 -0
- package/dist/client/assets/erDiagram-INFDFZHY-CX8FAWmU.js +70 -0
- package/dist/client/assets/flowDiagram-PKNHOUZH-DgBnUaHH.js +162 -0
- package/dist/client/assets/ganttDiagram-A5KZAMGK-C331HQ-y.js +292 -0
- package/dist/client/assets/gitGraph-HDMCJU4V-DPGoIMlm.js +1 -0
- package/dist/client/assets/gitGraphDiagram-K3NZZRJ6-zEXLThxN.js +65 -0
- package/dist/client/assets/graphlib-WkJoBgka.js +1 -0
- package/dist/client/assets/index-BGPkswtu.js +79 -0
- package/dist/client/assets/index-Cq_APK7Y.css +2 -0
- package/dist/client/assets/info-3K5VOQVL-CYdIfRwG.js +1 -0
- package/dist/client/assets/infoDiagram-LFFYTUFH-CKx11_2a.js +2 -0
- package/dist/client/assets/init-Bft5Ffpj.js +1 -0
- package/dist/client/assets/isArrayLikeObject-icl0H0jo.js +1 -0
- package/dist/client/assets/isEmpty-Du8sNmkE.js +1 -0
- package/dist/client/assets/ishikawaDiagram-PHBUUO56-BlZMQgOe.js +70 -0
- package/dist/client/assets/journeyDiagram-4ABVD52K-C3p_p4rn.js +139 -0
- package/dist/client/assets/kanban-definition-K7BYSVSG-4XJPQF50.js +89 -0
- package/dist/client/assets/katex-BJrMXEjr.js +261 -0
- package/dist/client/assets/line-Bb6xn3n_.js +1 -0
- package/dist/client/assets/linear-BPttYRJr.js +1 -0
- package/dist/client/assets/math-CNhlSIO3.js +1 -0
- package/dist/client/assets/mermaid-parser.core-CjY9NqXx.js +4 -0
- package/dist/client/assets/mermaid.core-B0ynITdC.js +11 -0
- package/dist/client/assets/mindmap-definition-YRQLILUH-Dya2e4tr.js +68 -0
- package/dist/client/assets/ordinal-DIg8h6NI.js +1 -0
- package/dist/client/assets/packet-RMMSAZCW-D7vTTuAT.js +1 -0
- package/dist/client/assets/path-DfRbCp9y.js +1 -0
- package/dist/client/assets/pie-UPGHQEXC-ptFuye_f.js +1 -0
- package/dist/client/assets/pieDiagram-SKSYHLDU-MZ74L9cN.js +30 -0
- package/dist/client/assets/{prism-bash-DTkDXsAh.js → prism-bash-6uMTC0Q2.js} +1 -1
- package/dist/client/assets/prism-csharp-Dkc2OSmh.js +1 -0
- package/dist/client/assets/prism-dart-iZy_wlz-.js +1 -0
- package/dist/client/assets/prism-elixir-BIzI9WJK.js +1 -0
- package/dist/client/assets/prism-hcl-Bx2FGBKG.js +1 -0
- package/dist/client/assets/prism-java-DBXf7fH0.js +1 -0
- package/dist/client/assets/prism-markup-templating-DS0ksKLt.js +1 -0
- package/dist/client/assets/prism-perl-BlhPiMfT.js +1 -0
- package/dist/client/assets/prism-php-DVtOAJsW.js +1 -0
- package/dist/client/assets/{prism-protobuf-DiQ_z8B5.js → prism-protobuf-BUsrNVvv.js} +1 -1
- package/dist/client/assets/prism-ruby-Saes64I6.js +1 -0
- package/dist/client/assets/{prism-scala-BjNo2HkN.js → prism-scala-ANOINMog.js} +1 -1
- package/dist/client/assets/prism-solidity-C5Mx5y66.js +1 -0
- package/dist/client/assets/{prism-sql-AgAyy5H_.js → prism-sql-D5pwK0Dp.js} +1 -1
- package/dist/client/assets/{prism-vim-uciLQ2PQ.js → prism-vim-BSZSu-gX.js} +1 -1
- package/dist/client/assets/quadrantDiagram-337W2JSQ-Da_T39nG.js +7 -0
- package/dist/client/assets/radar-KQ55EAFF-BR1_ZPLF.js +1 -0
- package/dist/client/assets/requirementDiagram-Z7DCOOCP-DzlKWGt3.js +73 -0
- package/dist/client/assets/rough.esm-KjoEK0it.js +1 -0
- package/dist/client/assets/sankeyDiagram-WA2Y5GQK-BPketwK-.js +10 -0
- package/dist/client/assets/sequenceDiagram-2WXFIKYE-geDrMLZ_.js +145 -0
- package/dist/client/assets/src-BuTVwZtT.js +1 -0
- package/dist/client/assets/stateDiagram-RAJIS63D-DOLTjnid.js +1 -0
- package/dist/client/assets/stateDiagram-v2-FVOUBMTO-BIjVI5d6.js +1 -0
- package/dist/client/assets/timeline-definition-YZTLITO2-Cy6Qm4Pd.js +61 -0
- package/dist/client/assets/treemap-KZPCXAKY-Bw93Vsua.js +1 -0
- package/dist/client/assets/vennDiagram-LZ73GAT5-UUQN9akd.js +34 -0
- package/dist/client/assets/xychartDiagram-JWTSCODW-DiTicxdS.js +7 -0
- package/dist/client/index.html +2 -2
- package/dist/server/git-diff-tui.d.ts +2 -2
- package/dist/server/git-diff-tui.js +12 -7
- package/dist/server/git-diff-tui.test.js +18 -2
- package/dist/server/git-diff.d.ts +3 -2
- package/dist/server/git-diff.js +29 -6
- package/dist/server/git-diff.test.js +52 -3
- package/dist/server/server.d.ts +2 -3
- package/dist/server/server.js +80 -55
- package/dist/server/server.test.js +110 -60
- package/dist/tui/App.d.ts +2 -2
- package/dist/tui/App.js +4 -3
- package/dist/types/diff.d.ts +8 -0
- package/dist/utils/commentImports.js +3 -2
- package/dist/utils/createId.d.ts +1 -0
- package/dist/utils/createId.js +5 -0
- package/dist/utils/createId.test.d.ts +1 -0
- package/dist/utils/createId.test.js +48 -0
- package/dist/utils/diffSelection.d.ts +6 -0
- package/dist/utils/diffSelection.js +30 -0
- package/package.json +5 -5
- package/dist/client/assets/_basePickBy-ChXFkTMC.js +0 -1
- package/dist/client/assets/_baseUniq-Mj_sFFQW.js +0 -1
- package/dist/client/assets/arc-BMA6S9F1.js +0 -1
- package/dist/client/assets/architectureDiagram-2XIMDMQ5-0uiM_v5K.js +0 -36
- package/dist/client/assets/blockDiagram-WCTKOSBZ-CM7ZLL6F.js +0 -132
- package/dist/client/assets/c4Diagram-IC4MRINW-DKtCnVwn.js +0 -10
- package/dist/client/assets/channel-D057yzDp.js +0 -1
- package/dist/client/assets/chunk-4BX2VUAB-Wsl8DxEB.js +0 -1
- package/dist/client/assets/chunk-55IACEB6-CHm9X5i7.js +0 -1
- package/dist/client/assets/chunk-JSJVCQXG-Cpk76oJ3.js +0 -1
- package/dist/client/assets/chunk-KX2RTZJC-D8YvfZVu.js +0 -1
- package/dist/client/assets/chunk-NQ4KR5QH-BogviJOv.js +0 -220
- package/dist/client/assets/chunk-QZHKN3VN-DwLJYu26.js +0 -1
- package/dist/client/assets/chunk-WL4C6EOR-BFDpGxW2.js +0 -189
- package/dist/client/assets/classDiagram-VBA2DB6C---D4iOts.js +0 -1
- package/dist/client/assets/classDiagram-v2-RAHNMMFH---D4iOts.js +0 -1
- package/dist/client/assets/clone-xSR3otEf.js +0 -1
- package/dist/client/assets/cose-bilkent-S5V4N54A-oEosZ_5y.js +0 -1
- package/dist/client/assets/cytoscape.esm-5J0xJHOV.js +0 -321
- package/dist/client/assets/dagre-KLK3FWXG-gFld4u1H.js +0 -4
- package/dist/client/assets/defaultLocale-DX6XiGOO.js +0 -1
- package/dist/client/assets/diagram-E7M64L7V-gJq3kSrf.js +0 -24
- package/dist/client/assets/diagram-IFDJBPK2-BsUm_q22.js +0 -43
- package/dist/client/assets/diagram-P4PSJMXO-juB-sfcR.js +0 -24
- package/dist/client/assets/erDiagram-INFDFZHY-Dn77qXAt.js +0 -70
- package/dist/client/assets/flowDiagram-PKNHOUZH-DtmvDYdN.js +0 -162
- package/dist/client/assets/ganttDiagram-A5KZAMGK-BlDaKLbQ.js +0 -292
- package/dist/client/assets/gitGraphDiagram-K3NZZRJ6-DeAAeuMS.js +0 -65
- package/dist/client/assets/graph-NX9gBP47.js +0 -1
- package/dist/client/assets/index-VxkpzDXr.css +0 -1
- package/dist/client/assets/index-kJdw4DY-.js +0 -98
- package/dist/client/assets/infoDiagram-LFFYTUFH-CAaX023c.js +0 -2
- package/dist/client/assets/init-Gi6I4Gst.js +0 -1
- package/dist/client/assets/ishikawaDiagram-PHBUUO56-CmiTQStv.js +0 -70
- package/dist/client/assets/journeyDiagram-4ABVD52K-B0SHC7mz.js +0 -139
- package/dist/client/assets/kanban-definition-K7BYSVSG-IfRdhzz7.js +0 -89
- package/dist/client/assets/katex-C-M49wc6.js +0 -261
- package/dist/client/assets/layout-l3OdNQhJ.js +0 -1
- package/dist/client/assets/linear-CQ0hx5Qs.js +0 -1
- package/dist/client/assets/mermaid.core-DqlPTabt.js +0 -249
- package/dist/client/assets/mindmap-definition-YRQLILUH-DIgSmG_f.js +0 -68
- package/dist/client/assets/ordinal-Cboi1Yqb.js +0 -1
- package/dist/client/assets/pieDiagram-SKSYHLDU-FzM5qoIB.js +0 -30
- package/dist/client/assets/prism-csharp-DCfUUOUs.js +0 -1
- package/dist/client/assets/prism-dart-MjriiaMt.js +0 -1
- package/dist/client/assets/prism-elixir-riuOL1mm.js +0 -1
- package/dist/client/assets/prism-hcl-CizuX1s4.js +0 -1
- package/dist/client/assets/prism-java-DYCKrDUh.js +0 -1
- package/dist/client/assets/prism-markup-templating-Ct1xsyfA.js +0 -1
- package/dist/client/assets/prism-perl-BJwBYR3Y.js +0 -1
- package/dist/client/assets/prism-php-BMhFuA7y.js +0 -1
- package/dist/client/assets/prism-ruby-Bcu0cDEh.js +0 -1
- package/dist/client/assets/prism-solidity-DDDs3w-w.js +0 -1
- package/dist/client/assets/quadrantDiagram-337W2JSQ-BBrApyD7.js +0 -7
- package/dist/client/assets/requirementDiagram-Z7DCOOCP-CLXiwUaA.js +0 -73
- package/dist/client/assets/sankeyDiagram-WA2Y5GQK-9Y3Ly5qe.js +0 -10
- package/dist/client/assets/sequenceDiagram-2WXFIKYE-DEpX1BA5.js +0 -145
- package/dist/client/assets/stateDiagram-RAJIS63D-Ck3ullwA.js +0 -1
- package/dist/client/assets/stateDiagram-v2-FVOUBMTO-X6UiDsar.js +0 -1
- package/dist/client/assets/timeline-definition-YZTLITO2-CMezf3XV.js +0 -61
- package/dist/client/assets/treemap-KZPCXAKY-DqrcV0gQ.js +0 -162
- package/dist/client/assets/vennDiagram-LZ73GAT5-eQg945Fz.js +0 -34
- package/dist/client/assets/xychartDiagram-JWTSCODW-_hqdXeX1.js +0 -7
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as a,l as o,I as n,e as i}from"./mermaid.core-DqlPTabt.js";import{p}from"./treemap-KZPCXAKY-DqrcV0gQ.js";import"./index-kJdw4DY-.js";import"./_baseUniq-Mj_sFFQW.js";import"./_basePickBy-ChXFkTMC.js";import"./clone-xSR3otEf.js";var g={parse:a(async r=>{const e=await p("info",r);o.debug(e)},"parse")},v={version:"11.13.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,s)=>{o.debug(`rendering info diagram
|
|
2
|
-
`+r);const t=n(e);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${s}`)},"draw"),l={draw:c},S={parser:g,db:m,renderer:l};export{S as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(e,a){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(a).domain(e);break}return this}export{t as i};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import{_ as o,c as ot,N as ut,I as dt,as as yt,z as ft,k as pt,p as it,a as gt,b as kt,g as mt,s as wt,q as _t,e as bt}from"./mermaid.core-DqlPTabt.js";import"./index-kJdw4DY-.js";var J=(function(){var e=o(function(T,t,s,i){for(s=s||{},i=T.length;i--;s[T[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],u=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],D={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,c,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return c;case 15:c.addNode(n[w-1].length,n[w].trim());break;case 16:c.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(u,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],c=[],p=[null],n=[],v=this.table,w="",I=0,$=0,L=2,A=1,C=n.slice.call(arguments,1),b=Object.create(this.lexer),S={yy:{}};for(var N in this.yy)Object.prototype.hasOwnProperty.call(this.yy,N)&&(S.yy[N]=this.yy[N]);b.setInput(t,S.yy),S.yy.lexer=b,S.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var R=b.yylloc;n.push(R);var G=b.options&&b.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Y(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(Y,"popStack");function tt(){var P;return P=c.pop()||b.lex()||A,typeof P!="number"&&(P instanceof Array&&(c=P,P=c.pop()),P=s.symbols_[P]||P),P}o(tt,"lex");for(var M,W,B,q,z={},U,V,et,Z;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((M===null||typeof M>"u")&&(M=tt()),B=v[W]&&v[W][M]),typeof B>"u"||!B.length||!B[0]){var K="";Z=[];for(U in v[W])this.terminals_[U]&&U>L&&Z.push("'"+this.terminals_[U]+"'");b.showPosition?K="Parse error on line "+(I+1)+`:
|
|
2
|
-
`+b.showPosition()+`
|
|
3
|
-
Expecting `+Z.join(", ")+", got '"+(this.terminals_[M]||M)+"'":K="Parse error on line "+(I+1)+": Unexpected "+(M==A?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(K,{text:b.match,token:this.terminals_[M]||M,line:b.yylineno,loc:R,expected:Z})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+M);switch(B[0]){case 1:i.push(M),p.push(b.yytext),n.push(b.yylloc),i.push(B[1]),M=null,$=b.yyleng,w=b.yytext,I=b.yylineno,R=b.yylloc;break;case 2:if(V=this.productions_[B[1]][1],z.$=p[p.length-V],z._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},G&&(z._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),q=this.performAction.apply(z,[w,$,I,S.yy,B[1],p,n].concat(C)),typeof q<"u")return q;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[B[1]][0]),p.push(z.$),n.push(z._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=(function(){var T={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,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:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var c=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),i.length-1&&(this.yylineno-=i.length-1);var p=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:i?(i.length===c.length?this.yylloc.first_column:0)+c[c.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
|
|
5
|
-
`+s+"^"},"showPosition"),test_match:o(function(t,s){var i,c,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),c=t[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var n in p)this[n]=p[n];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,s,i,c;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),n=0;n<p.length;n++)if(i=this._input.match(this.rules[p[n]]),i&&(!s||i[0].length>s[0].length)){if(s=i,c=n,this.options.backtrack_lexer){if(t=this.test_match(i,p[n]),t!==!1)return t;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(t=this.test_match(s,p[c]),t!==!1?t:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var s=this.next();return s||this.lex()},"lex"),begin:o(function(s){this.conditionStack.push(s)},"begin"),popState:o(function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},"topState"),pushState:o(function(s){this.begin(s)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(s,i,c,p){switch(c){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return T})();D.lexer=O;function E(){this.yy={}}return o(E,"Parser"),E.prototype=D,D.Parser=E,new E})();J.parser=J;var xt=J,H,vt=(H=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,ft()}getRoot(){return this.root}addNode(h,r){const a=pt.sanitizeText(r,ot());if(!this.root){this.baseLevel=h,this.root={text:a,children:[]},this.stack=[{level:0,node:this.root}],it(a);return}let l=h-(this.baseLevel??0);for(l<=0&&(l=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=l;)this.stack.pop();const y=this.stack[this.stack.length-1].node,f={text:a,children:[]};y.children.push(f),this.stack.push({level:l,node:f})}getAccTitle(){return gt()}setAccTitle(h){kt(h)}getAccDescription(){return mt()}setAccDescription(h){wt(h)}getDiagramTitle(){return _t()}setDiagramTitle(h){it(h)}},o(H,"IshikawaDB"),H),St=14,F=250,$t=30,Et=60,At=5,ht=82*Math.PI/180,st=Math.cos(ht),nt=Math.sin(ht),at=o((e,h,r)=>{const a=e.node().getBBox(),l=a.width+h*2,y=a.height+h*2;bt(e,y,l,r),e.attr("viewBox",`${a.x-h} ${a.y-h} ${l} ${y}`)},"applyPaddedViewBox"),It=o((e,h,r,a)=>{const y=a.db.getRoot();if(!y)return;const f=ot(),{look:d,handDrawnSeed:m,themeVariables:u}=f,k=ut(f.fontSize)[0]??St,g=d==="handDrawn",_=y.children??[],x=f.ishikawa?.diagramPadding??20,D=f.ishikawa?.useMaxWidth??!1,O=dt(h),E=O.append("g").attr("class","ishikawa"),T=g?yt.svg(O.node()):void 0,t=T?{roughSvg:T,seed:m??0,lineColor:u?.lineColor??"#333",fillColor:u?.mainBkg??"#fff"}:void 0,s=`ishikawa-arrow-${h}`;g||E.append("defs").append("marker").attr("id",s).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let i=0,c=F;const p=g?void 0:j(E,i,c,i,c,"ishikawa-spine");if(Lt(E,i,c,y.text,k,t),!_.length){g&&j(E,i,c,i,c,"ishikawa-spine",t),at(O,x,D);return}i-=20;const n=_.filter((S,N)=>N%2===0),v=_.filter((S,N)=>N%2===1),w=rt(n),I=rt(v),$=w.total+I.total;let L=F,A=F;if($>0){const S=F*2,N=F*.3;L=Math.max(N,S*(w.total/$)),A=Math.max(N,S*(I.total/$))}const C=k*2;L=Math.max(L,w.max*C),A=Math.max(A,I.max*C),c=Math.max(L,F),p&&p.attr("y1",c).attr("y2",c),E.select(".ishikawa-head-group").attr("transform",`translate(0,${c})`);const b=Math.ceil(_.length/2);for(let S=0;S<b;S++){const N=E.append("g").attr("class","ishikawa-pair");for(const[R,G,Y]of[[_[S*2],-1,L],[_[S*2+1],1,A]])R&&Nt(N,R,i,c,G,Y,k,t);i=N.selectAll("text").nodes().reduce((R,G)=>Math.min(R,G.getBBox().x),1/0)}if(g)j(E,i,c,0,c,"ishikawa-spine",t);else{p.attr("x1",i);const S=`url(#${s})`;E.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",S)}at(O,x,D)},"draw"),rt=o(e=>{const h=o(r=>r.children.reduce((a,l)=>a+1+h(l),0),"countDescendants");return e.reduce((r,a)=>{const l=h(a);return r.total+=l,r.max=Math.max(r.max,l),r},{total:0,max:0})},"sideStats"),Lt=o((e,h,r,a,l,y)=>{const f=Math.max(6,Math.floor(110/(l*.6))),d=e.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${h},${r})`),m=X(d,ct(a,f),0,0,"ishikawa-head-label","start",l),u=m.node().getBBox(),k=Math.max(60,u.width+6),g=Math.max(40,u.height*2+40),_=`M 0 ${-g/2} L 0 ${g/2} Q ${k*2.4} 0 0 ${-g/2} Z`;if(y){const x=y.roughSvg.path(_,{roughness:1.5,seed:y.seed,fill:y.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:y.lineColor,strokeWidth:2});d.insert(()=>x,":first-child").attr("class","ishikawa-head")}else d.insert("path",":first-child").attr("class","ishikawa-head").attr("d",_);m.attr("transform",`translate(${(k-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),Tt=o((e,h)=>{const r=[],a=[],l=o((y,f,d)=>{const m=h===-1?[...y].reverse():y;for(const u of m){const k=r.length,g=u.children??[];r.push({depth:d,text:ct(u.text,15),parentIndex:f,childCount:g.length}),d%2===0?(a.push(k),g.length&&l(g,k,d+1)):(g.length&&l(g,k,d+1),a.push(k))}},"walk");return l(e,-1,2),{entries:r,yOrder:a}},"flattenTree"),Mt=o((e,h,r,a,l,y,f)=>{const d=e.append("g").attr("class","ishikawa-label-group"),u=X(d,h,r,a+11*l,"ishikawa-label cause","middle",y).node().getBBox();if(f){const k=f.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:f.seed,fill:f.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:f.lineColor,strokeWidth:2});d.insert(()=>k,":first-child").attr("class","ishikawa-label-box")}else d.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),Q=o((e,h,r,a,l,y)=>{const f=Math.sqrt(a*a+l*l);if(f===0)return;const d=a/f,m=l/f,u=6,k=-m*u,g=d*u,_=h,x=r,D=`M ${_} ${x} L ${_-d*u*2+k} ${x-m*u*2+g} L ${_-d*u*2-k} ${x-m*u*2-g} Z`,O=y.roughSvg.path(D,{roughness:1,seed:y.seed,fill:y.lineColor,fillStyle:"solid",stroke:y.lineColor,strokeWidth:1});e.append(()=>O)},"drawArrowMarker"),Nt=o((e,h,r,a,l,y,f,d)=>{const m=h.children??[],u=y*(m.length?1:.2),k=-st*u,g=nt*u*l,_=r+k,x=a+g;if(j(e,r,a,_,x,"ishikawa-branch",d),d&&Q(e,r,a,r-_,a-x,d),Mt(e,h.text,_,x,l,f,d),!m.length)return;const{entries:D,yOrder:O}=Tt(m,l),E=D.length,T=new Array(E);for(const[p,n]of O.entries())T[n]=a+g*((p+1)/(E+1));const t=new Map;t.set(-1,{x0:r,y0:a,x1:_,y1:x,childCount:m.length,childrenDrawn:0});const s=-st,i=nt*l,c=l<0?"ishikawa-label up":"ishikawa-label down";for(const[p,n]of D.entries()){const v=T[p],w=t.get(n.parentIndex),I=e.append("g").attr("class","ishikawa-sub-group");let $=0,L=0,A=0;if(n.depth%2===0){const C=w.y1-w.y0;$=lt(w.x0,w.x1,C?(v-w.y0)/C:.5),L=v,A=$-(n.childCount>0?Et+n.childCount*At:$t),j(I,$,v,A,v,"ishikawa-sub-branch",d),d&&Q(I,$,v,1,0,d),X(I,n.text,A,v,"ishikawa-label align","end",f)}else{const C=w.childrenDrawn++;$=lt(w.x0,w.x1,(w.childCount-C)/(w.childCount+1)),L=w.y0,A=$+s*((v-L)/i),j(I,$,L,A,v,"ishikawa-sub-branch",d),d&&Q(I,$,L,$-A,L-v,d),X(I,n.text,A,v,c,"end",f)}n.childCount>0&&t.set(p,{x0:$,y0:L,x1:A,y1:v,childCount:n.childCount,childrenDrawn:0})}},"drawBranch"),Pt=o(e=>e.split(/<br\s*\/?>|\n/),"splitLines"),ct=o((e,h)=>{if(e.length<=h)return e;const r=[];for(const a of e.split(/\s+/)){const l=r.length-1;l>=0&&r[l].length+1+a.length<=h?r[l]+=" "+a:r.push(a)}return r.join(`
|
|
7
|
-
`)},"wrapText"),X=o((e,h,r,a,l,y,f)=>{const d=Pt(h),m=f*1.05,u=e.append("text").attr("class",l).attr("text-anchor",y).attr("x",r).attr("y",a-(d.length-1)*m/2);for(const[k,g]of d.entries())u.append("tspan").attr("x",r).attr("dy",k===0?0:m).text(g);return u},"drawMultilineText"),lt=o((e,h,r)=>e+(h-e)*r,"lerp"),j=o((e,h,r,a,l,y,f)=>{if(f){const d=f.roughSvg.line(h,r,a,l,{roughness:1.5,seed:f.seed,stroke:f.lineColor,strokeWidth:2});e.append(()=>d).attr("class",y);return}return e.append("line").attr("class",y).attr("x1",h).attr("y1",r).attr("x2",a).attr("y2",l)},"drawLine"),Bt={draw:It},Dt=o(e=>`
|
|
8
|
-
.ishikawa .ishikawa-spine,
|
|
9
|
-
.ishikawa .ishikawa-branch,
|
|
10
|
-
.ishikawa .ishikawa-sub-branch {
|
|
11
|
-
stroke: ${e.lineColor};
|
|
12
|
-
stroke-width: 2;
|
|
13
|
-
fill: none;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.ishikawa .ishikawa-sub-branch {
|
|
17
|
-
stroke-width: 1;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.ishikawa .ishikawa-arrow {
|
|
21
|
-
fill: ${e.lineColor};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.ishikawa .ishikawa-head {
|
|
25
|
-
fill: ${e.mainBkg};
|
|
26
|
-
stroke: ${e.lineColor};
|
|
27
|
-
stroke-width: 2;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.ishikawa .ishikawa-label-box {
|
|
31
|
-
fill: ${e.mainBkg};
|
|
32
|
-
stroke: ${e.lineColor};
|
|
33
|
-
stroke-width: 2;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.ishikawa text {
|
|
37
|
-
font-family: ${e.fontFamily};
|
|
38
|
-
font-size: ${e.fontSize};
|
|
39
|
-
fill: ${e.textColor};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.ishikawa .ishikawa-head-label {
|
|
43
|
-
font-weight: 600;
|
|
44
|
-
text-anchor: middle;
|
|
45
|
-
dominant-baseline: middle;
|
|
46
|
-
font-size: 14px;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.ishikawa .ishikawa-label {
|
|
50
|
-
text-anchor: end;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.ishikawa .ishikawa-label.cause {
|
|
54
|
-
text-anchor: middle;
|
|
55
|
-
dominant-baseline: middle;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.ishikawa .ishikawa-label.align {
|
|
59
|
-
text-anchor: end;
|
|
60
|
-
dominant-baseline: middle;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.ishikawa .ishikawa-label.up {
|
|
64
|
-
dominant-baseline: baseline;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.ishikawa .ishikawa-label.down {
|
|
68
|
-
dominant-baseline: hanging;
|
|
69
|
-
}
|
|
70
|
-
`,"getStyles"),Ot=Dt,Rt={parser:xt,get db(){return new vt},renderer:Bt,styles:Ot};export{Rt as diagram};
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import{g as gt}from"./chunk-FMBD7UC4-BSa8SHgd.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-JSJVCQXG-Cpk76oJ3.js";import{_ as n,g as _t,s as vt,a as bt,b as wt,q as Tt,p as St,c as R,d as X,e as $t,z as Mt}from"./mermaid.core-DqlPTabt.js";import{d as et}from"./arc-BMA6S9F1.js";import"./index-kJdw4DY-.js";var U=(function(){var t=n(function(h,i,a,l){for(a=a||{},l=h.length;l--;a[h[l]]=i);return a},"o"),e=[6,8,10,11,12,14,16,17,18],s=[1,9],c=[1,10],r=[1,11],f=[1,12],u=[1,13],y=[1,14],g={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:n(function(i,a,l,d,p,o,b){var k=o.length-1;switch(p){case 1:return o[k-1];case 2:this.$=[];break;case 3:o[k-1].push(o[k]),this.$=o[k-1];break;case 4:case 5:this.$=o[k];break;case 6:case 7:this.$=[];break;case 8:d.setDiagramTitle(o[k].substr(6)),this.$=o[k].substr(6);break;case 9:this.$=o[k].trim(),d.setAccTitle(this.$);break;case 10:case 11:this.$=o[k].trim(),d.setAccDescription(this.$);break;case 12:d.addSection(o[k].substr(8)),this.$=o[k].substr(8);break;case 13:d.addTask(o[k-1],o[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:s,12:c,14:r,16:f,17:u,18:y},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:s,12:c,14:r,16:f,17:u,18:y},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:n(function(i,a){if(a.recoverable)this.trace(i);else{var l=new Error(i);throw l.hash=a,l}},"parseError"),parse:n(function(i){var a=this,l=[0],d=[],p=[null],o=[],b=this.table,k="",C=0,K=0,dt=2,Q=1,yt=o.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(i,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;o.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,p.length=p.length-w,o.length=o.length-w}n(pt,"popStack");function D(){var w;return w=d.pop()||_.lex()||Q,typeof w!="number"&&(w instanceof Array&&(d=w,w=d.pop()),w=a.symbols_[w]||w),w}n(D,"lex");for(var v,A,T,q,F={},N,M,tt,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((v===null||typeof v>"u")&&(v=D()),T=b[A]&&b[A][v]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in b[A])this.terminals_[N]&&N>dt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
|
|
2
|
-
`+_.showPosition()+`
|
|
3
|
-
Expecting `+z.join(", ")+", got '"+(this.terminals_[v]||v)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(v==Q?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[v]||v,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+v);switch(T[0]){case 1:l.push(v),p.push(_.yytext),o.push(_.yylloc),l.push(T[1]),v=null,K=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=p[p.length-M],F._$={first_line:o[o.length-(M||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(M||1)].first_column,last_column:o[o.length-1].last_column},ft&&(F._$.range=[o[o.length-(M||1)].range[0],o[o.length-1].range[1]]),q=this.performAction.apply(F,[k,K,C,I.yy,T[1],p,o].concat(yt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),p=p.slice(0,-1*M),o=o.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),p.push(F.$),o.push(F._$),tt=b[l[l.length-2]][l[l.length-1]],l.push(tt);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:n(function(a,l){if(this.yy.parser)this.yy.parser.parseError(a,l);else throw new Error(a)},"parseError"),setInput:n(function(i,a){return this.yy=a||this.yy||{},this._input=i,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:n(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var a=i.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:n(function(i){var a=i.length,l=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var d=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),l.length-1&&(this.yylineno-=l.length-1);var p=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:l?(l.length===d.length?this.yylloc.first_column:0)+d[d.length-l.length].length-l[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n(function(i){this.unput(this.match.slice(i))},"less"),pastInput:n(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var i=this.pastInput(),a=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
5
|
-
`+a+"^"},"showPosition"),test_match:n(function(i,a){var l,d,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),d=i[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],l=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var o in p)this[o]=p[o];return!1}return!1},"test_match"),next:n(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,a,l,d;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),o=0;o<p.length;o++)if(l=this._input.match(this.rules[p[o]]),l&&(!a||l[0].length>a[0].length)){if(a=l,d=o,this.options.backtrack_lexer){if(i=this.test_match(l,p[o]),i!==!1)return i;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(i=this.test_match(a,p[d]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:n(function(){var a=this.next();return a||this.lex()},"lex"),begin:n(function(a){this.conditionStack.push(a)},"begin"),popState:n(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:n(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:n(function(a){this.begin(a)},"pushState"),stateStackSize:n(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n(function(a,l,d,p){switch(d){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return h})();g.lexer=m;function x(){this.yy={}}return n(x,"Parser"),x.prototype=g,g.Parser=x,new x})();U.parser=U;var Et=U,V="",Z=[],L=[],B=[],Ct=n(function(){Z.length=0,L.length=0,V="",B.length=0,Mt()},"clear"),Pt=n(function(t){V=t,Z.push(t)},"addSection"),It=n(function(){return Z},"getSections"),At=n(function(){let t=it();const e=100;let s=0;for(;!t&&s<e;)t=it(),s++;return L.push(...B),L},"getTasks"),Ft=n(function(){const t=[];return L.forEach(s=>{s.people&&t.push(...s.people)}),[...new Set(t)].sort()},"updateActors"),Vt=n(function(t,e){const s=e.substr(1).split(":");let c=0,r=[];s.length===1?(c=Number(s[0]),r=[]):(c=Number(s[0]),r=s[1].split(","));const f=r.map(y=>y.trim()),u={section:V,type:V,people:f,task:t,score:c};B.push(u)},"addTask"),Rt=n(function(t){const e={section:V,type:V,description:t,task:t,classes:[]};L.push(e)},"addTaskOrg"),it=n(function(){const t=n(function(s){return B[s].processed},"compileTask");let e=!0;for(const[s,c]of B.entries())t(s),e=e&&c.processed;return e},"compileTasks"),Lt=n(function(){return Ft()},"getActors"),rt={getConfig:n(()=>R().journey,"getConfig"),clear:Ct,setDiagramTitle:St,getDiagramTitle:Tt,setAccTitle:wt,getAccTitle:bt,setAccDescription:vt,getAccDescription:_t,addSection:Pt,getSections:It,getTasks:At,addTask:Vt,addTaskOrg:Rt,getActors:Lt},Bt=n(t=>`.label {
|
|
7
|
-
font-family: ${t.fontFamily};
|
|
8
|
-
color: ${t.textColor};
|
|
9
|
-
}
|
|
10
|
-
.mouth {
|
|
11
|
-
stroke: #666;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
line {
|
|
15
|
-
stroke: ${t.textColor}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.legend {
|
|
19
|
-
fill: ${t.textColor};
|
|
20
|
-
font-family: ${t.fontFamily};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.label text {
|
|
24
|
-
fill: #333;
|
|
25
|
-
}
|
|
26
|
-
.label {
|
|
27
|
-
color: ${t.textColor}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.face {
|
|
31
|
-
${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};
|
|
32
|
-
stroke: #999;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.node rect,
|
|
36
|
-
.node circle,
|
|
37
|
-
.node ellipse,
|
|
38
|
-
.node polygon,
|
|
39
|
-
.node path {
|
|
40
|
-
fill: ${t.mainBkg};
|
|
41
|
-
stroke: ${t.nodeBorder};
|
|
42
|
-
stroke-width: 1px;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.node .label {
|
|
46
|
-
text-align: center;
|
|
47
|
-
}
|
|
48
|
-
.node.clickable {
|
|
49
|
-
cursor: pointer;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.arrowheadPath {
|
|
53
|
-
fill: ${t.arrowheadColor};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.edgePath .path {
|
|
57
|
-
stroke: ${t.lineColor};
|
|
58
|
-
stroke-width: 1.5px;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.flowchart-link {
|
|
62
|
-
stroke: ${t.lineColor};
|
|
63
|
-
fill: none;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.edgeLabel {
|
|
67
|
-
background-color: ${t.edgeLabelBackground};
|
|
68
|
-
rect {
|
|
69
|
-
opacity: 0.5;
|
|
70
|
-
}
|
|
71
|
-
text-align: center;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.cluster rect {
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.cluster text {
|
|
78
|
-
fill: ${t.titleColor};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
div.mermaidTooltip {
|
|
82
|
-
position: absolute;
|
|
83
|
-
text-align: center;
|
|
84
|
-
max-width: 200px;
|
|
85
|
-
padding: 2px;
|
|
86
|
-
font-family: ${t.fontFamily};
|
|
87
|
-
font-size: 12px;
|
|
88
|
-
background: ${t.tertiaryColor};
|
|
89
|
-
border: 1px solid ${t.border2};
|
|
90
|
-
border-radius: 2px;
|
|
91
|
-
pointer-events: none;
|
|
92
|
-
z-index: 100;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.task-type-0, .section-type-0 {
|
|
96
|
-
${t.fillType0?`fill: ${t.fillType0}`:""};
|
|
97
|
-
}
|
|
98
|
-
.task-type-1, .section-type-1 {
|
|
99
|
-
${t.fillType0?`fill: ${t.fillType1}`:""};
|
|
100
|
-
}
|
|
101
|
-
.task-type-2, .section-type-2 {
|
|
102
|
-
${t.fillType0?`fill: ${t.fillType2}`:""};
|
|
103
|
-
}
|
|
104
|
-
.task-type-3, .section-type-3 {
|
|
105
|
-
${t.fillType0?`fill: ${t.fillType3}`:""};
|
|
106
|
-
}
|
|
107
|
-
.task-type-4, .section-type-4 {
|
|
108
|
-
${t.fillType0?`fill: ${t.fillType4}`:""};
|
|
109
|
-
}
|
|
110
|
-
.task-type-5, .section-type-5 {
|
|
111
|
-
${t.fillType0?`fill: ${t.fillType5}`:""};
|
|
112
|
-
}
|
|
113
|
-
.task-type-6, .section-type-6 {
|
|
114
|
-
${t.fillType0?`fill: ${t.fillType6}`:""};
|
|
115
|
-
}
|
|
116
|
-
.task-type-7, .section-type-7 {
|
|
117
|
-
${t.fillType0?`fill: ${t.fillType7}`:""};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.actor-0 {
|
|
121
|
-
${t.actor0?`fill: ${t.actor0}`:""};
|
|
122
|
-
}
|
|
123
|
-
.actor-1 {
|
|
124
|
-
${t.actor1?`fill: ${t.actor1}`:""};
|
|
125
|
-
}
|
|
126
|
-
.actor-2 {
|
|
127
|
-
${t.actor2?`fill: ${t.actor2}`:""};
|
|
128
|
-
}
|
|
129
|
-
.actor-3 {
|
|
130
|
-
${t.actor3?`fill: ${t.actor3}`:""};
|
|
131
|
-
}
|
|
132
|
-
.actor-4 {
|
|
133
|
-
${t.actor4?`fill: ${t.actor4}`:""};
|
|
134
|
-
}
|
|
135
|
-
.actor-5 {
|
|
136
|
-
${t.actor5?`fill: ${t.actor5}`:""};
|
|
137
|
-
}
|
|
138
|
-
${gt()}
|
|
139
|
-
`,"getStyles"),jt=Bt,J=n(function(t,e){return kt(t,e)},"drawRect"),Nt=n(function(t,e){const c=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),r=t.append("g");r.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function f(g){const m=et().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}n(f,"smile");function u(g){const m=et().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}n(u,"sad");function y(g){g.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return n(y,"ambivalent"),e.score>3?f(r):e.score<3?u(r):y(r),c},"drawFace"),ot=n(function(t,e){const s=t.append("circle");return s.attr("cx",e.cx),s.attr("cy",e.cy),s.attr("class","actor-"+e.pos),s.attr("fill",e.fill),s.attr("stroke",e.stroke),s.attr("r",e.r),s.class!==void 0&&s.attr("class",s.class),e.title!==void 0&&s.append("title").text(e.title),s},"drawCircle"),ct=n(function(t,e){return xt(t,e)},"drawText"),zt=n(function(t,e){function s(r,f,u,y,g){return r+","+f+" "+(r+u)+","+f+" "+(r+u)+","+(f+y-g)+" "+(r+u-g*1.2)+","+(f+y)+" "+r+","+(f+y)}n(s,"genPoints");const c=t.append("polygon");c.attr("points",s(e.x,e.y,50,20,7)),c.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,ct(t,e)},"drawLabel"),Wt=n(function(t,e,s){const c=t.append("g"),r=lt();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=s.width*e.taskCount+s.diagramMarginX*(e.taskCount-1),r.height=s.height,r.class="journey-section section-type-"+e.num,r.rx=3,r.ry=3,J(c,r),ht(s)(e.text,c,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+e.num},s,e.colour)},"drawSection"),nt=-1,Ot=n(function(t,e,s){const c=e.x+s.width/2,r=t.append("g");nt++,r.append("line").attr("id","task"+nt).attr("x1",c).attr("y1",e.y).attr("x2",c).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Nt(r,{cx:c,cy:300+(5-e.score)*30,score:e.score});const u=lt();u.x=e.x,u.y=e.y,u.fill=e.fill,u.width=s.width,u.height=s.height,u.class="task task-type-"+e.num,u.rx=3,u.ry=3,J(r,u);let y=e.x+14;e.people.forEach(g=>{const m=e.actors[g].color,x={cx:y,cy:e.y,r:7,fill:m,stroke:"#000",title:g,pos:e.actors[g].position};ot(r,x),y+=10}),ht(s)(e.task,r,u.x,u.y,u.width,u.height,{class:"task"},s,e.colour)},"drawTask"),Yt=n(function(t,e){mt(t,e)},"drawBackgroundRect"),ht=(function(){function t(r,f,u,y,g,m,x,h){const i=f.append("text").attr("x",u+g/2).attr("y",y+m/2+5).style("font-color",h).style("text-anchor","middle").text(r);c(i,x)}n(t,"byText");function e(r,f,u,y,g,m,x,h,i){const{taskFontSize:a,taskFontFamily:l}=h,d=r.split(/<br\s*\/?>/gi);for(let p=0;p<d.length;p++){const o=p*a-a*(d.length-1)/2,b=f.append("text").attr("x",u+g/2).attr("y",y).attr("fill",i).style("text-anchor","middle").style("font-size",a).style("font-family",l);b.append("tspan").attr("x",u+g/2).attr("dy",o).text(d[p]),b.attr("y",y+m/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),c(b,x)}}n(e,"byTspan");function s(r,f,u,y,g,m,x,h){const i=f.append("switch"),l=i.append("foreignObject").attr("x",u).attr("y",y).attr("width",g).attr("height",m).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");l.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(r),e(r,i,u,y,g,m,x,h),c(l,x)}n(s,"byFo");function c(r,f){for(const u in f)u in f&&r.attr(u,f[u])}return n(c,"_setTextAttrs"),function(r){return r.textPlacement==="fo"?s:r.textPlacement==="old"?t:e}})(),qt=n(function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics"),j={drawRect:J,drawCircle:ot,drawSection:Wt,drawText:ct,drawLabel:zt,drawTask:Ot,drawBackgroundRect:Yt,initGraphics:qt},Ht=n(function(t){Object.keys(t).forEach(function(s){$[s]=t[s]})},"setConf"),E={},W=0;function ut(t){const e=R().journey,s=e.maxLabelWidth;W=0;let c=60;Object.keys(E).forEach(r=>{const f=E[r].color,u={cx:20,cy:c,r:7,fill:f,stroke:"#000",pos:E[r].position};j.drawCircle(t,u);let y=t.append("text").attr("visibility","hidden").text(r);const g=y.node().getBoundingClientRect().width;y.remove();let m=[];if(g<=s)m=[r];else{const x=r.split(" ");let h="";y=t.append("text").attr("visibility","hidden"),x.forEach(i=>{const a=h?`${h} ${i}`:i;if(y.text(a),y.node().getBoundingClientRect().width>s){if(h&&m.push(h),h=i,y.text(i),y.node().getBoundingClientRect().width>s){let d="";for(const p of i)d+=p,y.text(d+"-"),y.node().getBoundingClientRect().width>s&&(m.push(d.slice(0,-1)+"-"),d=p);h=d}}else h=a}),h&&m.push(h),y.remove()}m.forEach((x,h)=>{const i={x:40,y:c+7+h*20,fill:"#666",text:x,textMargin:e.boxTextMargin??5},l=j.drawText(t,i).node().getBoundingClientRect().width;l>W&&l>e.leftMargin-l&&(W=l)}),c+=Math.max(20,m.length*20)})}n(ut,"drawActorLegend");var $=R().journey,P=0,Xt=n(function(t,e,s,c){const r=R(),f=r.journey.titleColor,u=r.journey.titleFontSize,y=r.journey.titleFontFamily,g=r.securityLevel;let m;g==="sandbox"&&(m=X("#i"+e));const x=g==="sandbox"?X(m.nodes()[0].contentDocument.body):X("body");S.init();const h=x.select("#"+e);j.initGraphics(h);const i=c.db.getTasks(),a=c.db.getDiagramTitle(),l=c.db.getActors();for(const C in E)delete E[C];let d=0;l.forEach(C=>{E[C]={color:$.actorColours[d%$.actorColours.length],position:d},d++}),ut(h),P=$.leftMargin+W,S.insert(0,0,P,Object.keys(E).length*50),Gt(h,i,0);const p=S.getBounds();a&&h.append("text").text(a).attr("x",P).attr("font-size",u).attr("font-weight","bold").attr("y",25).attr("fill",f).attr("font-family",y);const o=p.stopy-p.starty+2*$.diagramMarginY,b=P+p.stopx+2*$.diagramMarginX;$t(h,o,b,$.useMaxWidth),h.append("line").attr("x1",P).attr("y1",$.height*4).attr("x2",b-P-4).attr("y2",$.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const k=a?70:0;h.attr("viewBox",`${p.startx} -25 ${b} ${o+k}`),h.attr("preserveAspectRatio","xMinYMin meet"),h.attr("height",o+k+25)},"draw"),S={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:n(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:n(function(t,e,s,c){t[e]===void 0?t[e]=s:t[e]=c(s,t[e])},"updateVal"),updateBounds:n(function(t,e,s,c){const r=R().journey,f=this;let u=0;function y(g){return n(function(x){u++;const h=f.sequenceItems.length-u+1;f.updateVal(x,"starty",e-h*r.boxMargin,Math.min),f.updateVal(x,"stopy",c+h*r.boxMargin,Math.max),f.updateVal(S.data,"startx",t-h*r.boxMargin,Math.min),f.updateVal(S.data,"stopx",s+h*r.boxMargin,Math.max),g!=="activation"&&(f.updateVal(x,"startx",t-h*r.boxMargin,Math.min),f.updateVal(x,"stopx",s+h*r.boxMargin,Math.max),f.updateVal(S.data,"starty",e-h*r.boxMargin,Math.min),f.updateVal(S.data,"stopy",c+h*r.boxMargin,Math.max))},"updateItemBounds")}n(y,"updateFn"),this.sequenceItems.forEach(y())},"updateBounds"),insert:n(function(t,e,s,c){const r=Math.min(t,s),f=Math.max(t,s),u=Math.min(e,c),y=Math.max(e,c);this.updateVal(S.data,"startx",r,Math.min),this.updateVal(S.data,"starty",u,Math.min),this.updateVal(S.data,"stopx",f,Math.max),this.updateVal(S.data,"stopy",y,Math.max),this.updateBounds(r,u,f,y)},"insert"),bumpVerticalPos:n(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:n(function(){return this.verticalPos},"getVerticalPos"),getBounds:n(function(){return this.data},"getBounds")},G=$.sectionFills,st=$.sectionColours,Gt=n(function(t,e,s){const c=R().journey;let r="";const f=c.height*2+c.diagramMarginY,u=s+f;let y=0,g="#CCC",m="black",x=0;for(const[h,i]of e.entries()){if(r!==i.section){g=G[y%G.length],x=y%G.length,m=st[y%st.length];let l=0;const d=i.section;for(let o=h;o<e.length&&e[o].section==d;o++)l=l+1;const p={x:h*c.taskMargin+h*c.width+P,y:50,text:i.section,fill:g,num:x,colour:m,taskCount:l};j.drawSection(t,p,c),r=i.section,y++}const a=i.people.reduce((l,d)=>(E[d]&&(l[d]=E[d]),l),{});i.x=h*c.taskMargin+h*c.width+P,i.y=u,i.width=c.diagramMarginX,i.height=c.diagramMarginY,i.colour=m,i.fill=g,i.num=x,i.actors=a,j.drawTask(t,i,c),S.insert(i.x,i.y,i.x+i.width+c.taskMargin,450)}},"drawTasks"),at={setConf:Ht,draw:Xt},Dt={parser:Et,db:rt,renderer:at,styles:jt,init:n(t=>{at.setConf(t.journey),rt.clear()},"init")};export{Dt as diagram};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import{_ as o,l as te,c as H,I as fe,ah as ye,ai as be,aj as me,ac as _e,G as K,i as G,t as ke,J as Ee,ad as Se,ae as ce,af as le}from"./mermaid.core-DqlPTabt.js";import{g as Ne}from"./chunk-FMBD7UC4-BSa8SHgd.js";import"./index-kJdw4DY-.js";var $=(function(){var e=o(function(O,i,n,r){for(n=n||{},r=O.length;r--;n[O[r]]=i);return n},"o"),u=[1,4],p=[1,13],s=[1,12],d=[1,15],k=[1,16],b=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],_=[6,7,11],F=[1,31],N=[6,7,11,24],V=[1,6,13,16,17,20,23],m=[1,35],A=[1,36],L=[1,6,7,11,13,16,17,20,23],M=[1,38],T={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:o(function(i,n,r,a,h,t,U){var c=t.length-1;switch(h){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[c-1].id),a.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:a.getLogger().info("Node: ",t[c].id),a.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:a.getLogger().trace("Icon: ",t[c]),a.decorateNode({icon:t[c]});break;case 18:case 23:a.decorateNode({class:t[c]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[c-1].id),a.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:a.getLogger().trace("Node: ",t[c].id),a.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:a.decorateNode({icon:t[c]});break;case 27:a.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:a.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:u},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:u},{6:p,7:[1,10],9:9,12:11,13:s,14:14,16:d,17:k,18:17,19:18,20:b,23:l},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:p,12:21,13:s,14:14,16:d,17:k,18:17,19:18,20:b,23:l},{6:p,9:22,12:11,13:s,14:14,16:d,17:k,18:17,19:18,20:b,23:l},{6:I,7:g,10:23,11:w},e(_,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:b,23:l}),e(_,[2,19]),e(_,[2,21],{15:30,24:F}),e(_,[2,22]),e(_,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,28],{20:[1,32]}),{21:[1,33]},{6:I,7:g,10:34,11:w},{1:[2,7],6:p,12:21,13:s,14:14,16:d,17:k,18:17,19:18,20:b,23:l},e(V,[2,14],{7:m,11:A}),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(_,[2,16],{15:37,24:F}),e(_,[2,17]),e(_,[2,18]),e(_,[2,20],{24:M}),e(N,[2,31]),{21:[1,39]},{22:[1,40]},e(V,[2,13],{7:m,11:A}),e(L,[2,11]),e(L,[2,12]),e(_,[2,15],{24:M}),e(N,[2,30]),{22:[1,41]},e(N,[2,27]),e(N,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(i,n){if(n.recoverable)this.trace(i);else{var r=new Error(i);throw r.hash=n,r}},"parseError"),parse:o(function(i){var n=this,r=[0],a=[],h=[null],t=[],U=this.table,c="",W=0,se=0,ue=2,re=1,ge=t.slice.call(arguments,1),y=Object.create(this.lexer),R={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(R.yy[J]=this.yy[J]);y.setInput(i,R.yy),R.yy.lexer=y,R.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var q=y.yylloc;t.push(q);var de=y.options&&y.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){r.length=r.length-2*S,h.length=h.length-S,t.length=t.length-S}o(pe,"popStack");function ae(){var S;return S=a.pop()||y.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}o(ae,"lex");for(var E,P,x,Q,j={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=ae()),x=U[P]&&U[P][E]),typeof x>"u"||!x.length||!x[0]){var Z="";X=[];for(z in U[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");y.showPosition?Z="Parse error on line "+(W+1)+`:
|
|
2
|
-
`+y.showPosition()+`
|
|
3
|
-
Expecting `+X.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(W+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:y.match,token:this.terminals_[E]||E,line:y.yylineno,loc:q,expected:X})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(x[0]){case 1:r.push(E),h.push(y.yytext),t.push(y.yylloc),r.push(x[1]),E=null,se=y.yyleng,c=y.yytext,W=y.yylineno,q=y.yylloc;break;case 2:if(C=this.productions_[x[1]][1],j.$=h[h.length-C],j._$={first_line:t[t.length-(C||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(C||1)].first_column,last_column:t[t.length-1].last_column},de&&(j._$.range=[t[t.length-(C||1)].range[0],t[t.length-1].range[1]]),Q=this.performAction.apply(j,[c,se,W,R.yy,x[1],h,t].concat(ge)),typeof Q<"u")return Q;C&&(r=r.slice(0,-1*C*2),h=h.slice(0,-1*C),t=t.slice(0,-1*C)),r.push(this.productions_[x[1]][0]),h.push(j.$),t.push(j._$),oe=U[r[r.length-2]][r[r.length-1]],r.push(oe);break;case 3:return!0}}return!0},"parse")},Y=(function(){var O={EOF:1,parseError:o(function(n,r){if(this.yy.parser)this.yy.parser.parseError(n,r);else throw new Error(n)},"parseError"),setInput:o(function(i,n){return this.yy=n||this.yy||{},this._input=i,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:o(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:o(function(i){var n=i.length,r=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var a=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),r.length-1&&(this.yylineno-=r.length-1);var h=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:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(i){this.unput(this.match.slice(i))},"less"),pastInput:o(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var i=this.pastInput(),n=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
5
|
-
`+n+"^"},"showPosition"),test_match:o(function(i,n){var r,a,h;if(this.options.backtrack_lexer&&(h={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(h.yylloc.range=this.yylloc.range.slice(0))),a=i[0].match(/(?:\r\n?|\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],r=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var t in h)this[t]=h[t];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,n,r,a;this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),t=0;t<h.length;t++)if(r=this._input.match(this.rules[h[t]]),r&&(!n||r[0].length>n[0].length)){if(n=r,a=t,this.options.backtrack_lexer){if(i=this.test_match(r,h[t]),i!==!1)return i;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(i=this.test_match(n,h[a]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var n=this.next();return n||this.lex()},"lex"),begin:o(function(n){this.conditionStack.push(n)},"begin"),popState:o(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:o(function(n){this.begin(n)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(n,r,a,h){switch(a){case 0:return this.pushState("shapeData"),r.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const t=/\n\s*/g;return r.yytext=r.yytext.replace(t,"<br/>"),24;case 4:return 24;case 5:this.popState();break;case 6:return n.getLogger().trace("Found comment",r.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:n.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return n.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:n.getLogger().trace("end icon"),this.popState();break;case 16:return n.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return n.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return n.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return n.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:n.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return n.getLogger().trace("description:",r.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),n.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),n.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),n.getLogger().trace("node end ...",r.yytext),"NODE_DEND";case 36:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 41:return n.getLogger().trace("Long description:",r.yytext),21;case 42:return n.getLogger().trace("Long description:",r.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return O})();T.lexer=Y;function B(){this.yy={}}return o(B,"Parser"),B.prototype=T,T.Parser=B,new B})();$.parser=$;var xe=$,v=[],ne=[],ee=0,ie={},ve=o(()=>{v=[],ne=[],ee=0,ie={}},"clear"),De=o(e=>{if(v.length===0)return null;const u=v[0].level;let p=null;for(let s=v.length-1;s>=0;s--)if(v[s].level===u&&!p&&(p=v[s]),v[s].level<u)throw new Error('Items without section detected, found section ("'+v[s].label+'")');return e===p?.level?null:p},"getSection"),he=o(function(){return ne},"getSections"),Le=o(function(){const e=[],u=[],p=he(),s=H();for(const d of p){const k={id:d.id,label:G(d.label??"",s),labelType:"markdown",isGroup:!0,ticket:d.ticket,shape:"kanbanSection",level:d.level,look:s.look};u.push(k);const b=v.filter(l=>l.parentId===d.id);for(const l of b){const D={id:l.id,parentId:d.id,label:G(l.label??"",s),labelType:"markdown",isGroup:!1,ticket:l?.ticket,priority:l?.priority,assigned:l?.assigned,icon:l?.icon,shape:"kanbanItem",level:l.level,rx:5,ry:5,cssStyles:["text-align: left"]};u.push(D)}}return{nodes:u,edges:e,other:{},config:H()}},"getData"),Oe=o((e,u,p,s,d)=>{const k=H();let b=k.mindmap?.padding??K.mindmap.padding;switch(s){case f.ROUNDED_RECT:case f.RECT:case f.HEXAGON:b*=2}const l={id:G(u,k)||"kbn"+ee++,level:e,label:G(p,k),width:k.mindmap?.maxNodeWidth??K.mindmap.maxNodeWidth,padding:b,isGroup:!1};if(d!==void 0){let I;d.includes(`
|
|
7
|
-
`)?I=d+`
|
|
8
|
-
`:I=`{
|
|
9
|
-
`+d+`
|
|
10
|
-
}`;const g=ke(I,{schema:Ee});if(g.shape&&(g.shape!==g.shape.toLowerCase()||g.shape.includes("_")))throw new Error(`No such shape: ${g.shape}. Shape names should be lowercase.`);g?.shape&&g.shape==="kanbanItem"&&(l.shape=g?.shape),g?.label&&(l.label=g?.label),g?.icon&&(l.icon=g?.icon.toString()),g?.assigned&&(l.assigned=g?.assigned.toString()),g?.ticket&&(l.ticket=g?.ticket.toString()),g?.priority&&(l.priority=g?.priority)}const D=De(e);D?l.parentId=D.id||"kbn"+ee++:ne.push(l),v.push(l)},"addNode"),f={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Ie=o((e,u)=>{switch(te.debug("In get type",e,u),e){case"[":return f.RECT;case"(":return u===")"?f.ROUNDED_RECT:f.CLOUD;case"((":return f.CIRCLE;case")":return f.CLOUD;case"))":return f.BANG;case"{{":return f.HEXAGON;default:return f.DEFAULT}},"getType"),Ce=o((e,u)=>{ie[e]=u},"setElementForId"),we=o(e=>{if(!e)return;const u=H(),p=v[v.length-1];e.icon&&(p.icon=G(e.icon,u)),e.class&&(p.cssClasses=G(e.class,u))},"decorateNode"),Ae=o(e=>{switch(e){case f.DEFAULT:return"no-border";case f.RECT:return"rect";case f.ROUNDED_RECT:return"rounded-rect";case f.CIRCLE:return"circle";case f.CLOUD:return"cloud";case f.BANG:return"bang";case f.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Te=o(()=>te,"getLogger"),Re=o(e=>ie[e],"getElementById"),Pe={clear:ve,addNode:Oe,getSections:he,getData:Le,nodeType:f,getType:Ie,setElementForId:Ce,decorateNode:we,type2Str:Ae,getLogger:Te,getElementById:Re},Ve=Pe,Be=o(async(e,u,p,s)=>{te.debug(`Rendering kanban diagram
|
|
11
|
-
`+e);const k=s.db.getData(),b=H();b.htmlLabels=!1;const l=fe(u),D=l.append("g");D.attr("class","sections");const I=l.append("g");I.attr("class","items");const g=k.nodes.filter(m=>m.isGroup);let w=0;const _=10,F=[];let N=25;for(const m of g){const A=b?.kanban?.sectionWidth||200;w=w+1,m.x=A*w+(w-1)*_/2,m.width=A,m.y=0,m.height=A*3,m.rx=5,m.ry=5,m.cssClasses=m.cssClasses+" section-"+w;const L=await ye(D,m);N=Math.max(N,L?.labelBBox?.height),F.push(L)}let V=0;for(const m of g){const A=F[V];V=V+1;const L=b?.kanban?.sectionWidth||200,M=-L*3/2+N;let T=M;const Y=k.nodes.filter(i=>i.parentId===m.id);for(const i of Y){if(i.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");i.x=m.x,i.width=L-1.5*_;const r=(await be(I,i,{config:b})).node().getBBox();i.y=T+r.height/2,await me(i),T=i.y+r.height/2+_/2}const B=A.cluster.select("rect"),O=Math.max(T-M+3*_,50)+(N-25);B.attr("height",O)}_e(void 0,l,b.mindmap?.padding??K.kanban.padding,b.mindmap?.useMaxWidth??K.kanban.useMaxWidth)},"draw"),je={draw:Be},Ge=o(e=>{let u="";for(let s=0;s<e.THEME_COLOR_LIMIT;s++)e["lineColor"+s]=e["lineColor"+s]||e["cScaleInv"+s],Se(e["lineColor"+s])?e["lineColor"+s]=ce(e["lineColor"+s],20):e["lineColor"+s]=le(e["lineColor"+s],20);const p=o((s,d)=>e.darkMode?le(s,d):ce(s,d),"adjuster");for(let s=0;s<e.THEME_COLOR_LIMIT;s++){const d=""+(17-3*s);u+=`
|
|
12
|
-
.section-${s-1} rect, .section-${s-1} path, .section-${s-1} circle, .section-${s-1} polygon, .section-${s-1} path {
|
|
13
|
-
fill: ${p(e["cScale"+s],10)};
|
|
14
|
-
stroke: ${p(e["cScale"+s],10)};
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
.section-${s-1} text {
|
|
18
|
-
fill: ${e["cScaleLabel"+s]};
|
|
19
|
-
}
|
|
20
|
-
.node-icon-${s-1} {
|
|
21
|
-
font-size: 40px;
|
|
22
|
-
color: ${e["cScaleLabel"+s]};
|
|
23
|
-
}
|
|
24
|
-
.section-edge-${s-1}{
|
|
25
|
-
stroke: ${e["cScale"+s]};
|
|
26
|
-
}
|
|
27
|
-
.edge-depth-${s-1}{
|
|
28
|
-
stroke-width: ${d};
|
|
29
|
-
}
|
|
30
|
-
.section-${s-1} line {
|
|
31
|
-
stroke: ${e["cScaleInv"+s]} ;
|
|
32
|
-
stroke-width: 3;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.disabled, .disabled circle, .disabled text {
|
|
36
|
-
fill: lightgray;
|
|
37
|
-
}
|
|
38
|
-
.disabled text {
|
|
39
|
-
fill: #efefef;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.node rect,
|
|
43
|
-
.node circle,
|
|
44
|
-
.node ellipse,
|
|
45
|
-
.node polygon,
|
|
46
|
-
.node path {
|
|
47
|
-
fill: ${e.background};
|
|
48
|
-
stroke: ${e.nodeBorder};
|
|
49
|
-
stroke-width: 1px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.kanban-ticket-link {
|
|
53
|
-
fill: ${e.background};
|
|
54
|
-
stroke: ${e.nodeBorder};
|
|
55
|
-
text-decoration: underline;
|
|
56
|
-
}
|
|
57
|
-
`}return u},"genSections"),Fe=o(e=>`
|
|
58
|
-
.edge {
|
|
59
|
-
stroke-width: 3;
|
|
60
|
-
}
|
|
61
|
-
${Ge(e)}
|
|
62
|
-
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
|
|
63
|
-
fill: ${e.git0};
|
|
64
|
-
}
|
|
65
|
-
.section-root text {
|
|
66
|
-
fill: ${e.gitBranchLabel0};
|
|
67
|
-
}
|
|
68
|
-
.icon-container {
|
|
69
|
-
height:100%;
|
|
70
|
-
display: flex;
|
|
71
|
-
justify-content: center;
|
|
72
|
-
align-items: center;
|
|
73
|
-
}
|
|
74
|
-
.edge {
|
|
75
|
-
fill: none;
|
|
76
|
-
}
|
|
77
|
-
.cluster-label, .label {
|
|
78
|
-
color: ${e.textColor};
|
|
79
|
-
fill: ${e.textColor};
|
|
80
|
-
}
|
|
81
|
-
.kanban-label {
|
|
82
|
-
dy: 1em;
|
|
83
|
-
alignment-baseline: middle;
|
|
84
|
-
text-anchor: middle;
|
|
85
|
-
dominant-baseline: middle;
|
|
86
|
-
text-align: center;
|
|
87
|
-
}
|
|
88
|
-
${Ne()}
|
|
89
|
-
`,"getStyles"),Me=Fe,ze={db:Ve,renderer:je,parser:xe,styles:Me};export{ze as diagram};
|