@marimo-team/frontend 0.13.7-dev6 → 0.13.7-dev7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ConnectedDataExplorerComponent-DYO4zMqc.js → ConnectedDataExplorerComponent-CsepDyah.js} +1 -1
- package/dist/assets/{VegaLite-CNKZYR1c.js → VegaLite-C1HXtrMV.js} +1 -1
- package/dist/assets/{_baseEach-BOi1xMzz.js → _baseEach-DD_63bhv.js} +1 -1
- package/dist/assets/_baseMap-B4VCibcY.js +1 -0
- package/dist/assets/{_baseUniq-EQxa8zIF.js → _baseUniq-CYFxhDYw.js} +1 -1
- package/dist/assets/{_createAggregator-Dvx5-qYj.js → _createAggregator-BzziiCHf.js} +1 -1
- package/dist/assets/{any-language-editor-D9fEgqG1.js → any-language-editor-CzgTNb1K.js} +1 -1
- package/dist/assets/{architectureDiagram-IEHRJDOE-v-T5Y1-p.js → architectureDiagram-IEHRJDOE-C-U-iPbK.js} +1 -1
- package/dist/assets/{blockDiagram-JOT3LUYC-gYxXk9dX.js → blockDiagram-JOT3LUYC-wp_uDvyw.js} +1 -1
- package/dist/assets/{c4Diagram-VJAJSXHY-DNHzSaJu.js → c4Diagram-VJAJSXHY-DVvpvjIh.js} +1 -1
- package/dist/assets/channel-nBjz4H-G.js +1 -0
- package/dist/assets/{chunk-4BMEZGHF-CNlj2iKt.js → chunk-4BMEZGHF-DTOzlx-M.js} +1 -1
- package/dist/assets/{chunk-A2AXSNBT-CsfD1o8e.js → chunk-A2AXSNBT-D0aB6LMu.js} +1 -1
- package/dist/assets/{chunk-AEK57VVT-DHti-T9J.js → chunk-AEK57VVT-BXKRbqgm.js} +1 -1
- package/dist/assets/{chunk-D6G4REZN-Ca9tCcNK.js → chunk-D6G4REZN-DJIklw-B.js} +1 -1
- package/dist/assets/{chunk-RZ5BOZE2-S4AIQ3i1.js → chunk-RZ5BOZE2-DbLPmled.js} +1 -1
- package/dist/assets/{chunk-XZIHB7SX-BcCHvDgC.js → chunk-XZIHB7SX-BPf8SbRg.js} +1 -1
- package/dist/assets/{circle-play-Bc0uRvfe.js → circle-play-DJJzVByn.js} +1 -1
- package/dist/assets/classDiagram-GIVACNV2-D62d1n5s.js +1 -0
- package/dist/assets/classDiagram-v2-COTLJTTW-D62d1n5s.js +1 -0
- package/dist/assets/clone-BpRHUGO-.js +1 -0
- package/dist/assets/{compile-DhiD2OIl.js → compile-BrbPA1FV.js} +1 -1
- package/dist/assets/{dagre-OKDRZEBW-D2Qg0Imy.js → dagre-OKDRZEBW-DMUTu875.js} +1 -1
- package/dist/assets/{data-editor-CG3MBzRh.js → data-editor-BAugqar1.js} +1 -1
- package/dist/assets/{diagram-SSKATNLV-DxHLKgNC.js → diagram-SSKATNLV-CgktwEzE.js} +1 -1
- package/dist/assets/{diagram-VNBRO52H-D6KRYowD.js → diagram-VNBRO52H-DM157GSt.js} +1 -1
- package/dist/assets/{edit-page-ByAm3pnm.js → edit-page-D5MazIt2.js} +3 -3
- package/dist/assets/{erDiagram-Q7BY3M3F-CWDap52H.js → erDiagram-Q7BY3M3F-CfYnS787.js} +1 -1
- package/dist/assets/{flowDiagram-4HSFHLVR-BfiYb11e.js → flowDiagram-4HSFHLVR-BE2xZTx5.js} +1 -1
- package/dist/assets/{ganttDiagram-APWFNJXF-CQV1P3oH.js → ganttDiagram-APWFNJXF-LN8qz0YV.js} +1 -1
- package/dist/assets/{gitGraphDiagram-7IBYFJ6S-BkR4L5qA.js → gitGraphDiagram-7IBYFJ6S-BRJVT_zn.js} +1 -1
- package/dist/assets/{graph-DCc8CUpI.js → graph-UIDUJmse.js} +1 -1
- package/dist/assets/{home-page-DBmHL8mR.js → home-page-CRQcruYX.js} +1 -1
- package/dist/assets/{index-CDrhBJh5.js → index-2SONYAJm.js} +1 -1
- package/dist/assets/{index-Cxi84xou.js → index-5ldyqPzW.js} +1 -1
- package/dist/assets/{index-W7aBJ9gy.js → index-BJDDQR-b.js} +1 -1
- package/dist/assets/{index-DXL9W3IU.js → index-BcRkZK42.js} +1 -1
- package/dist/assets/{index-BD18meo4.js → index-BeUu3ch_.js} +1 -1
- package/dist/assets/{index-D25ZVZoz.js → index-Bsc9SEYH.js} +4 -4
- package/dist/assets/{index-BkczaLMR.js → index-Bul_n0Oy.js} +1 -1
- package/dist/assets/{index-vtzfPcuf.js → index-BxZz8_b9.js} +1 -1
- package/dist/assets/{index-c7qrzQb-.js → index-C4iGahsq.js} +1 -1
- package/dist/assets/{index-D-nbCOVY.js → index-C8U61zo_.js} +1 -1
- package/dist/assets/{index-Dvf3vz4o.js → index-CE_UMLrN.js} +1 -1
- package/dist/assets/{index-Cm_Gezq1.js → index-CF6xeTk8.js} +1 -1
- package/dist/assets/{index-D0xs4wpq.js → index-CPXRGKlr.js} +1 -1
- package/dist/assets/{index-CSvNPv2W.js → index-Ce6UaJ0J.js} +1 -1
- package/dist/assets/{index-Cu1YZJKo.js → index-DYy6_SSS.js} +1 -1
- package/dist/assets/{index-DZ4-or1K.js → index-DdDVFm9B.js} +1 -1
- package/dist/assets/{index-B6SjbC50.js → index-b_tRbrpS.js} +1 -1
- package/dist/assets/{index-yYteRT7n.js → index-bkSNWDvj.js} +1 -1
- package/dist/assets/{index-XQJA6HPM.js → index-i7xW5_nS.js} +1 -1
- package/dist/assets/infoDiagram-PH2N3AL5-HPC1FDCJ.js +1 -0
- package/dist/assets/{journeyDiagram-U35MCT3I-B_5-obIw.js → journeyDiagram-U35MCT3I-C2DEy4EI.js} +1 -1
- package/dist/assets/{kanban-definition-NDS4AKOZ-Bc_pNgjQ.js → kanban-definition-NDS4AKOZ-B_EEiPWw.js} +1 -1
- package/dist/assets/{layout-C4Z666Y5.js → layout-D_LRJAfC.js} +1 -1
- package/dist/assets/{linear-WjwPNEQl.js → linear-D5vU7l3E.js} +1 -1
- package/dist/assets/{mermaid-D2SdoFUx.js → mermaid-R60l6R69.js} +2 -2
- package/dist/assets/{min-Dg--LZAL.js → min-C-OQ4NGo.js} +1 -1
- package/dist/assets/{mindmap-definition-ALO5MXBD-DX-U9wBy.js → mindmap-definition-ALO5MXBD-D4QoDDy8.js} +1 -1
- package/dist/assets/{pieDiagram-IB7DONF6-BubIPQJh.js → pieDiagram-IB7DONF6-SF9agpbB.js} +1 -1
- package/dist/assets/{quadrantDiagram-7GDLP6J5-BHeylzWe.js → quadrantDiagram-7GDLP6J5-BLMHLPC_.js} +1 -1
- package/dist/assets/{radar-MK3ICKWK-DRTZUi9y.js → radar-MK3ICKWK-BHuNvtv1.js} +1 -1
- package/dist/assets/{react-plotly-DKU7Ou4l.js → react-plotly-BL5FdwhT.js} +1 -1
- package/dist/assets/{requirementDiagram-KVF5MWMF-BdBi4uFV.js → requirementDiagram-KVF5MWMF-DxjKoyr_.js} +1 -1
- package/dist/assets/{run-page-Shivl0hH.js → run-page-CmD3K-_E.js} +1 -1
- package/dist/assets/{sankeyDiagram-QLVOVGJD-D5qRjQPK.js → sankeyDiagram-QLVOVGJD-CstUhZQp.js} +1 -1
- package/dist/assets/{sequenceDiagram-X6HHIX6F-VDxd_dJn.js → sequenceDiagram-X6HHIX6F-C0DUaj1h.js} +1 -1
- package/dist/assets/{slides-component-C53UoNKL.js → slides-component-ciQA86ZI.js} +1 -1
- package/dist/assets/{sortBy-BWYzlL2q.js → sortBy-DtnQOB1o.js} +1 -1
- package/dist/assets/{stateDiagram-DGXRK772-BPFYFRuA.js → stateDiagram-DGXRK772-DLwZeaFq.js} +1 -1
- package/dist/assets/stateDiagram-v2-YXO3MK2T-B0FkKF8G.js +1 -0
- package/dist/assets/{terminal-BMjRJT_H.js → terminal-th4WQMuZ.js} +1 -1
- package/dist/assets/{time-J7OIP1Ve.js → time-xufRr6_w.js} +1 -1
- package/dist/assets/{timeline-definition-BDJGKUSR-DEPlt-q1.js → timeline-definition-BDJGKUSR-bfHyV-7E.js} +1 -1
- package/dist/assets/{tracing--bLHkrsQ.js → tracing-DVLROVSe.js} +3 -3
- package/dist/assets/tree-Bc56h0bS.js +8 -0
- package/dist/assets/{useMarimoWebSocket-C7Q2pfmw.js → useMarimoWebSocket-C5cupBS4.js} +3 -3
- package/dist/assets/{vega-component-DYEjmga7.js → vega-component-BCCNIpr4.js} +1 -1
- package/dist/assets/{xychartDiagram-VJFVF3MP-D7Uukgqz.js → xychartDiagram-VJFVF3MP-DxMG0q6v.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/_baseMap-D2kyVuny.js +0 -1
- package/dist/assets/channel-B7Urz9Qw.js +0 -1
- package/dist/assets/classDiagram-GIVACNV2-Dw-L5tk0.js +0 -1
- package/dist/assets/classDiagram-v2-COTLJTTW-Dw-L5tk0.js +0 -1
- package/dist/assets/clone-2VLlfYv8.js +0 -1
- package/dist/assets/infoDiagram-PH2N3AL5-D-Eqt5lr.js +0 -1
- package/dist/assets/stateDiagram-v2-YXO3MK2T-CN_rBf9z.js +0 -1
- package/dist/assets/tree-gS-oXpYe.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as O,b as t,m as e,p as r,f as n,v as a,s as o,t as i,w as s}from"./index-
|
|
1
|
+
import{c as O,b as t,m as e,p as r,f as n,v as a,s as o,t as i,w as s}from"./index-Bsc9SEYH.js";const l=n.deserialize({version:14,states:"%pOVOWOOObQPOOOpOSO'#C_OOOO'#Cp'#CpQVOWOOQxQPOOO!TQQOOQ!YQPOOOOOO,58y,58yO!_OSO,58yOOOO-E6n-E6nO!dQQO'#CqQ{QPOOO!iQPOOQ{QPOOO!qQPOOOOOO1G.e1G.eOOQO,59],59]OOQO-E6o-E6oO!yOpO'#CiO#RO`O'#CiQOQPOOO#ZO#tO'#CmO#fO!bO'#CmOOQO,59T,59TO#qOpO,59TO#vO`O,59TOOOO'#Cr'#CrO#{O#tO,59XOOQO,59X,59XOOOO'#Cs'#CsO$WO!bO,59XOOQO1G.o1G.oOOOO-E6p-E6pOOQO1G.s1G.sOOOO-E6q-E6q",stateData:"$g~OjOS~OQROUROkQO~OWTOXUOZUO`VO~OSXOTWO~OXUO[]OlZO~OY^O~O[_O~OT`O~OYaO~OmcOodO~OmfOogO~O^iOnhO~O_jOphO~ObkOqkOrmO~OcnOsnOtmO~OnpO~OppO~ObkOqkOrrO~OcnOsnOtrO~OWX`~",goto:"!^hPPPiPPPPPPPPPmPPPpPPsy!Q!WTROSRe]Re_QSORYSS[T^Rb[QlfRqlQogRso",nodeNames:"⚠ Content Text Interpolation InterpolationContent }} Entity Attribute VueAttributeName : Identifier @ Is ScriptAttributeValue AttributeScript AttributeScript AttributeName AttributeValue Entity Entity",maxTerm:36,skippedNodes:[0],repeatNodeCount:4,tokenData:"'y~RdXY!aYZ!a]^!apq!ars!rwx!w}!O!|!O!P#t!Q![#y![!]$s!_!`%g!b!c%l!c!}#y#R#S#y#T#j#y#j#k%q#k#o#y%W;'S#y;'S;:j$m<%lO#y~!fSj~XY!aYZ!a]^!apq!a~!wOm~~!|Oo~!b#RX`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|!b#qP;=`<%l!|~#yOl~%W$QXY#t`!b}!O!|!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y%W$pP;=`<%l#y~$zXX~`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|~%lO[~~%qOZ~%W%xXY#t`!b}!O&e!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y!b&jX`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|!b'^XW!b`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|",tokenizers:[6,7,new s("b~RP#q#rU~XP#q#r[~aOT~~",17,4),new s("!k~RQvwX#o#p!_~^TU~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOU~~![P;=`<%lm~!bP#o#p!e~!jOk~~",72,2),new s("[~RPwxU~ZOp~~",11,15),new s("[~RPrsU~ZOn~~",11,14),new s("!e~RQvwXwx!_~^Tc~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOc~~![P;=`<%lm~!dOt~~",66,35),new s("!e~RQrsXvw^~^Or~~cTb~Oprq!]r!^;'Sr;'S;=`!^<%lOr~uUOprq!]r!]!^!X!^;'Sr;'S;=`!^<%lOr~!^Ob~~!aP;=`<%lr~",66,33)],topRules:{Content:[0,1],Attribute:[1,7]},tokenPrec:157}),p=a.parser.configure({top:"SingleExpression"}),u=l.configure({props:[o({Text:i.content,Is:i.definitionOperator,AttributeName:i.attributeName,VueAttributeName:i.keyword,Identifier:i.variableName,"AttributeValue ScriptAttributeValue":i.attributeValue,Entity:i.character,"{{ }}":i.brace,"@ :":i.punctuation})]}),m={parser:p},S={parser:u.configure({wrap:r(((O,t)=>"InterpolationContent"==O.name?m:null))})},b={parser:u.configure({wrap:r(((O,t)=>"AttributeScript"==O.name?m:null)),top:"Attribute"})},c=e();function Q(O){return O.configure({dialect:"selfClosing",wrap:r(y)},"vue")}const P=Q(c.language);function y(O,t){switch(O.name){case"Attribute":return/^(@|:|v-)/.test(t.read(O.from,O.from+2))?b:null;case"Text":return S}return null}function g(e={}){let r=c;if(e.base){if("html"!=e.base.language.name||!(e.base.language instanceof O))throw new RangeError("The base option must be the result of calling html(...)");r=e.base}return new t(r.language==c.language?P:Q(r.language),[r.support,r.language.data.of({closeBrackets:{brackets:["{",'"']}})])}export{g as vue,P as vueLanguage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as r,l as e,I as s,d as t,K as a}from"./mermaid-R60l6R69.js";import{p as i}from"./radar-MK3ICKWK-BHuNvtv1.js";import"./index-Bsc9SEYH.js";import"./transform-DjHZbYKP.js";import"./timer-DFzT7np-.js";import"./step-BwsUM5iJ.js";import"./_baseEach-DD_63bhv.js";import"./_baseUniq-CYFxhDYw.js";import"./min-C-OQ4NGo.js";import"./_baseMap-B4VCibcY.js";import"./clone-BpRHUGO-.js";import"./_createAggregator-BzziiCHf.js";var o={parse:r((async r=>{const s=await i("info",r);e.debug(s)}),"parse")},n={version:a.version},p={parser:o,db:{getVersion:r((()=>n.version),"getVersion")},renderer:{draw:r(((r,a,i)=>{e.debug("rendering info diagram\n"+r);const o=s(a);t(o,100,400,!0);o.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${i}`)}),"draw")}};export{p as diagram};
|
package/dist/assets/{journeyDiagram-U35MCT3I-B_5-obIw.js → journeyDiagram-U35MCT3I-C2DEy4EI.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,g as e,f as n,d as i}from"./chunk-D6G4REZN-Ca9tCcNK.js";import{_ as s,g as r,s as a,a as o,b as c,q as l,p as h,c as u,d as p,y}from"./mermaid-D2SdoFUx.js";import{s as d}from"./transform-DjHZbYKP.js";import{d as f}from"./arc-Cuwikxov.js";import"./index-D25ZVZoz.js";import"./step-BwsUM5iJ.js";import"./timer-DFzT7np-.js";var g=function(){var t=s((function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n}),"o"),e=[6,8,10,11,12,14,16,17,18],n=[1,9],i=[1,10],r=[1,11],a=[1,12],o=[1,13],c=[1,14],l={trace:s((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:s((function(t,e,n,i,s,r,a){var o=r.length-1;switch(s){case 1:return r[o-1];case 2:case 6:case 7:this.$=[];break;case 3:r[o-1].push(r[o]),this.$=r[o-1];break;case 4:case 5:this.$=r[o];break;case 8:i.setDiagramTitle(r[o].substr(6)),this.$=r[o].substr(6);break;case 9:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 10:case 11:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 12:i.addSection(r[o].substr(8)),this.$=r[o].substr(8);break;case 13:i.addTask(r[o-1],r[o]),this.$="task"}}),"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:n,12:i,14:r,16:a,17:o,18:c},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:n,12:i,14:r,16:a,17:o,18:c},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:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],i=[],r=[null],a=[],o=this.table,c="",l=0,h=0,u=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(y.yy[d]=this.yy[d]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var f=p.yylloc;a.push(f);var g=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||p.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s((function(t){n.length=n.length-2*t,r.length=r.length-t,a.length=a.length-t}),"popStack"),s(m,"lex");for(var x,k,_,b,w,v,$,T,M={};;){if(k=n[n.length-1],this.defaultActions[k]?_=this.defaultActions[k]:(null==x&&(x=m()),_=o[k]&&o[k][x]),void 0===_||!_.length||!_[0]){var S="";for(w in T=[],o[k])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");S=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(S,{text:p.match,token:this.terminals_[x]||x,line:p.yylineno,loc:f,expected:T})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+x);switch(_[0]){case 1:n.push(x),r.push(p.yytext),a.push(p.yylloc),n.push(_[1]),x=null,h=p.yyleng,c=p.yytext,l=p.yylineno,f=p.yylloc;break;case 2:if(v=this.productions_[_[1]][1],M.$=r[r.length-v],M._$={first_line:a[a.length-(v||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(v||1)].first_column,last_column:a[a.length-1].last_column},g&&(M._$.range=[a[a.length-(v||1)].range[0],a[a.length-1].range[1]]),void 0!==(b=this.performAction.apply(M,[c,h,l,y.yy,_[1],r,a].concat(u))))return b;v&&(n=n.slice(0,-1*v*2),r=r.slice(0,-1*v),a=a.slice(0,-1*v)),n.push(this.productions_[_[1]][0]),r.push(M.$),a.push(M._$),$=o[n[n.length-2]][n[n.length-1]],n.push($);break;case 3:return!0}}return!0}),"parse")},h=function(){return{EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;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),n.length-1&&(this.yylineno-=n.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,i,s;if(this.options.backtrack_lexer&&(s={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&&(s.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((n=this._input.match(this.rules[s[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,i){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}}),"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}}}();function u(){this.yy={}}return l.lexer=h,s(u,"Parser"),u.prototype=l,l.Parser=u,new u}();g.parser=g;var m=g,x="",k=[],_=[],b=[],w=s((function(){k.length=0,_.length=0,x="",b.length=0,y()}),"clear"),v=s((function(t){x=t,k.push(t)}),"addSection"),$=s((function(){return k}),"getSections"),T=s((function(){let t=A();let e=0;for(;!t&&e<100;)t=A(),e++;return _.push(...b),_}),"getTasks"),M=s((function(){const t=[];_.forEach((e=>{e.people&&t.push(...e.people)}));return[...new Set(t)].sort()}),"updateActors"),S=s((function(t,e){const n=e.substr(1).split(":");let i=0,s=[];1===n.length?(i=Number(n[0]),s=[]):(i=Number(n[0]),s=n[1].split(","));const r=s.map((t=>t.trim())),a={section:x,type:x,people:r,task:t,score:i};b.push(a)}),"addTask"),E=s((function(t){const e={section:x,type:x,description:t,task:t,classes:[]};_.push(e)}),"addTaskOrg"),A=s((function(){const t=s((function(t){return b[t].processed}),"compileTask");let e=!0;for(const[n,i]of b.entries())t(n),e=e&&i.processed;return e}),"compileTasks"),I=s((function(){return M()}),"getActors"),P={getConfig:s((()=>u().journey),"getConfig"),clear:w,setDiagramTitle:h,getDiagramTitle:l,setAccTitle:c,getAccTitle:o,setAccDescription:a,getAccDescription:r,addSection:v,getSections:$,getTasks:T,addTask:S,addTaskOrg:E,getActors:I},j=s((t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${t.textColor}\n }\n\n .legend {\n fill: ${t.textColor};\n font-family: ${t.fontFamily};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${t.textColor}\n }\n\n .face {\n ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${t.fillType0?`fill: ${t.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${t.fillType0?`fill: ${t.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${t.fillType0?`fill: ${t.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${t.fillType0?`fill: ${t.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${t.fillType0?`fill: ${t.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${t.fillType0?`fill: ${t.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${t.fillType0?`fill: ${t.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${t.fillType0?`fill: ${t.fillType7}`:""};\n }\n\n .actor-0 {\n ${t.actor0?`fill: ${t.actor0}`:""};\n }\n .actor-1 {\n ${t.actor1?`fill: ${t.actor1}`:""};\n }\n .actor-2 {\n ${t.actor2?`fill: ${t.actor2}`:""};\n }\n .actor-3 {\n ${t.actor3?`fill: ${t.actor3}`:""};\n }\n .actor-4 {\n ${t.actor4?`fill: ${t.actor4}`:""};\n }\n .actor-5 {\n ${t.actor5?`fill: ${t.actor5}`:""};\n }\n`),"getStyles"),C=s((function(t,e){return i(t,e)}),"drawRect"),V=s((function(t,e){const n=15,i=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),r=t.append("g");function a(t){const i=f().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function o(t){const i=f().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function c(t){t.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 r.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s(a,"smile"),s(o,"sad"),s(c,"ambivalent"),e.score>3?a(r):e.score<3?o(r):c(r),i}),"drawFace"),F=s((function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n}),"drawCircle"),L=s((function(t,e){return n(t,e)}),"drawText"),O=s((function(t,e){function n(t,e,n,i,s){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-s)+" "+(t+n-1.2*s)+","+(e+i)+" "+t+","+(e+i)}s(n,"genPoints");const i=t.append("polygon");i.attr("points",n(e.x,e.y,50,20,7)),i.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,L(t,e)}),"drawLabel"),D=s((function(t,n,i){const s=t.append("g"),r=e();r.x=n.x,r.y=n.y,r.fill=n.fill,r.width=i.width*n.taskCount+i.diagramMarginX*(n.taskCount-1),r.height=i.height,r.class="journey-section section-type-"+n.num,r.rx=3,r.ry=3,C(s,r),z(i)(n.text,s,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+n.num},i,n.colour)}),"drawSection"),B=-1,N=s((function(t,n,i){const s=n.x+i.width/2,r=t.append("g");B++;r.append("line").attr("id","task"+B).attr("x1",s).attr("y1",n.y).attr("x2",s).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),V(r,{cx:s,cy:300+30*(5-n.score),score:n.score});const a=e();a.x=n.x,a.y=n.y,a.fill=n.fill,a.width=i.width,a.height=i.height,a.class="task task-type-"+n.num,a.rx=3,a.ry=3,C(r,a);let o=n.x+14;n.people.forEach((t=>{const e=n.actors[t].color,i={cx:o,cy:n.y,r:7,fill:e,stroke:"#000",title:t,pos:n.actors[t].position};F(r,i),o+=10})),z(i)(n.task,r,a.x,a.y,a.width,a.height,{class:"task"},i,n.colour)}),"drawTask"),R=s((function(e,n){t(e,n)}),"drawBackgroundRect"),z=function(){function t(t,e,n,s,r,a,o,c){i(e.append("text").attr("x",n+r/2).attr("y",s+a/2+5).style("font-color",c).style("text-anchor","middle").text(t),o)}function e(t,e,n,s,r,a,o,c,l){const{taskFontSize:h,taskFontFamily:u}=c,p=t.split(/<br\s*\/?>/gi);for(let y=0;y<p.length;y++){const t=y*h-h*(p.length-1)/2,c=e.append("text").attr("x",n+r/2).attr("y",s).attr("fill",l).style("text-anchor","middle").style("font-size",h).style("font-family",u);c.append("tspan").attr("x",n+r/2).attr("dy",t).text(p[y]),c.attr("y",s+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(c,o)}}function n(t,n,s,r,a,o,c,l){const h=n.append("switch"),u=h.append("foreignObject").attr("x",s).attr("y",r).attr("width",a).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,s,r,a,o,c,l),i(u,c)}function i(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return s(t,"byText"),s(e,"byTspan"),s(n,"byFo"),s(i,"_setTextAttrs"),function(i){return"fo"===i.textPlacement?n:"old"===i.textPlacement?t:e}}(),Y={drawRect:C,drawCircle:F,drawSection:D,drawText:L,drawLabel:O,drawTask:N,drawBackgroundRect:R,initGraphics:s((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")},q=s((function(t){Object.keys(t).forEach((function(e){X[e]=t[e]}))}),"setConf"),G={};function W(t){const e=u().journey;let n=60;Object.keys(G).forEach((i=>{const s=G[i].color,r={cx:20,cy:n,r:7,fill:s,stroke:"#000",pos:G[i].position};Y.drawCircle(t,r);const a={x:40,y:n+7,fill:"#666",text:i,textMargin:5|e.boxTextMargin};Y.drawText(t,a),n+=20}))}s(W,"drawActorLegend");var X=u().journey,U=X.leftMargin,Z=s((function(t,e,n,i){const s=u().journey,r=u().securityLevel;let a;"sandbox"===r&&(a=d("#i"+e));const o=d("sandbox"===r?a.nodes()[0].contentDocument.body:"body");H.init();const c=o.select("#"+e);Y.initGraphics(c);const l=i.db.getTasks(),h=i.db.getDiagramTitle(),y=i.db.getActors();for(const u in G)delete G[u];let f=0;y.forEach((t=>{G[t]={color:s.actorColours[f%s.actorColours.length],position:f},f++})),W(c),H.insert(0,0,U,50*Object.keys(G).length),Q(c,l,0);const g=H.getBounds();h&&c.append("text").text(h).attr("x",U).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const m=g.stopy-g.starty+2*s.diagramMarginY,x=U+g.stopx+2*s.diagramMarginX;p(c,m,x,s.useMaxWidth),c.append("line").attr("x1",U).attr("y1",4*s.height).attr("x2",x-U-4).attr("y2",4*s.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const k=h?70:0;c.attr("viewBox",`${g.startx} -25 ${x} ${m+k}`),c.attr("preserveAspectRatio","xMinYMin meet"),c.attr("height",m+k+25)}),"draw"),H={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:s((function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0}),"init"),updateVal:s((function(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])}),"updateVal"),updateBounds:s((function(t,e,n,i){const r=u().journey,a=this;let o=0;function c(c){return s((function(s){o++;const l=a.sequenceItems.length-o+1;a.updateVal(s,"starty",e-l*r.boxMargin,Math.min),a.updateVal(s,"stopy",i+l*r.boxMargin,Math.max),a.updateVal(H.data,"startx",t-l*r.boxMargin,Math.min),a.updateVal(H.data,"stopx",n+l*r.boxMargin,Math.max),"activation"!==c&&(a.updateVal(s,"startx",t-l*r.boxMargin,Math.min),a.updateVal(s,"stopx",n+l*r.boxMargin,Math.max),a.updateVal(H.data,"starty",e-l*r.boxMargin,Math.min),a.updateVal(H.data,"stopy",i+l*r.boxMargin,Math.max))}),"updateItemBounds")}s(c,"updateFn"),this.sequenceItems.forEach(c())}),"updateBounds"),insert:s((function(t,e,n,i){const s=Math.min(t,n),r=Math.max(t,n),a=Math.min(e,i),o=Math.max(e,i);this.updateVal(H.data,"startx",s,Math.min),this.updateVal(H.data,"starty",a,Math.min),this.updateVal(H.data,"stopx",r,Math.max),this.updateVal(H.data,"stopy",o,Math.max),this.updateBounds(s,a,r,o)}),"insert"),bumpVerticalPos:s((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos}),"bumpVerticalPos"),getVerticalPos:s((function(){return this.verticalPos}),"getVerticalPos"),getBounds:s((function(){return this.data}),"getBounds")},J=X.sectionFills,K=X.sectionColours,Q=s((function(t,e,n){const i=u().journey;let s="";const r=n+(2*i.height+i.diagramMarginY);let a=0,o="#CCC",c="black",l=0;for(const[h,u]of e.entries()){if(s!==u.section){o=J[a%J.length],l=a%J.length,c=K[a%K.length];let n=0;const r=u.section;for(let t=h;t<e.length&&e[t].section==r;t++)n+=1;const p={x:h*i.taskMargin+h*i.width+U,y:50,text:u.section,fill:o,num:l,colour:c,taskCount:n};Y.drawSection(t,p,i),s=u.section,a++}const n=u.people.reduce(((t,e)=>(G[e]&&(t[e]=G[e]),t)),{});u.x=h*i.taskMargin+h*i.width+U,u.y=r,u.width=i.diagramMarginX,u.height=i.diagramMarginY,u.colour=c,u.fill=o,u.num=l,u.actors=n,Y.drawTask(t,u,i),H.insert(u.x,u.y,u.x+u.width+i.taskMargin,450)}}),"drawTasks"),tt={setConf:q,draw:Z},et={parser:m,db:P,renderer:tt,styles:j,init:s((t=>{tt.setConf(t.journey),P.clear()}),"init")};export{et as diagram};
|
|
1
|
+
import{a as t,g as e,f as n,d as i}from"./chunk-D6G4REZN-DJIklw-B.js";import{_ as s,g as r,s as a,a as o,b as c,q as l,p as h,c as u,d as p,y}from"./mermaid-R60l6R69.js";import{s as d}from"./transform-DjHZbYKP.js";import{d as f}from"./arc-Cuwikxov.js";import"./index-Bsc9SEYH.js";import"./step-BwsUM5iJ.js";import"./timer-DFzT7np-.js";var g=function(){var t=s((function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n}),"o"),e=[6,8,10,11,12,14,16,17,18],n=[1,9],i=[1,10],r=[1,11],a=[1,12],o=[1,13],c=[1,14],l={trace:s((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:s((function(t,e,n,i,s,r,a){var o=r.length-1;switch(s){case 1:return r[o-1];case 2:case 6:case 7:this.$=[];break;case 3:r[o-1].push(r[o]),this.$=r[o-1];break;case 4:case 5:this.$=r[o];break;case 8:i.setDiagramTitle(r[o].substr(6)),this.$=r[o].substr(6);break;case 9:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 10:case 11:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 12:i.addSection(r[o].substr(8)),this.$=r[o].substr(8);break;case 13:i.addTask(r[o-1],r[o]),this.$="task"}}),"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:n,12:i,14:r,16:a,17:o,18:c},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:n,12:i,14:r,16:a,17:o,18:c},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:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],i=[],r=[null],a=[],o=this.table,c="",l=0,h=0,u=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(y.yy[d]=this.yy[d]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var f=p.yylloc;a.push(f);var g=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||p.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s((function(t){n.length=n.length-2*t,r.length=r.length-t,a.length=a.length-t}),"popStack"),s(m,"lex");for(var x,k,_,b,w,v,$,T,M={};;){if(k=n[n.length-1],this.defaultActions[k]?_=this.defaultActions[k]:(null==x&&(x=m()),_=o[k]&&o[k][x]),void 0===_||!_.length||!_[0]){var S="";for(w in T=[],o[k])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");S=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(S,{text:p.match,token:this.terminals_[x]||x,line:p.yylineno,loc:f,expected:T})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+x);switch(_[0]){case 1:n.push(x),r.push(p.yytext),a.push(p.yylloc),n.push(_[1]),x=null,h=p.yyleng,c=p.yytext,l=p.yylineno,f=p.yylloc;break;case 2:if(v=this.productions_[_[1]][1],M.$=r[r.length-v],M._$={first_line:a[a.length-(v||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(v||1)].first_column,last_column:a[a.length-1].last_column},g&&(M._$.range=[a[a.length-(v||1)].range[0],a[a.length-1].range[1]]),void 0!==(b=this.performAction.apply(M,[c,h,l,y.yy,_[1],r,a].concat(u))))return b;v&&(n=n.slice(0,-1*v*2),r=r.slice(0,-1*v),a=a.slice(0,-1*v)),n.push(this.productions_[_[1]][0]),r.push(M.$),a.push(M._$),$=o[n[n.length-2]][n[n.length-1]],n.push($);break;case 3:return!0}}return!0}),"parse")},h=function(){return{EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:s((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;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),n.length-1&&(this.yylineno-=n.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var n,i,s;if(this.options.backtrack_lexer&&(s={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&&(s.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((n=this._input.match(this.rules[s[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((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:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,i){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}}),"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}}}();function u(){this.yy={}}return l.lexer=h,s(u,"Parser"),u.prototype=l,l.Parser=u,new u}();g.parser=g;var m=g,x="",k=[],_=[],b=[],w=s((function(){k.length=0,_.length=0,x="",b.length=0,y()}),"clear"),v=s((function(t){x=t,k.push(t)}),"addSection"),$=s((function(){return k}),"getSections"),T=s((function(){let t=A();let e=0;for(;!t&&e<100;)t=A(),e++;return _.push(...b),_}),"getTasks"),M=s((function(){const t=[];_.forEach((e=>{e.people&&t.push(...e.people)}));return[...new Set(t)].sort()}),"updateActors"),S=s((function(t,e){const n=e.substr(1).split(":");let i=0,s=[];1===n.length?(i=Number(n[0]),s=[]):(i=Number(n[0]),s=n[1].split(","));const r=s.map((t=>t.trim())),a={section:x,type:x,people:r,task:t,score:i};b.push(a)}),"addTask"),E=s((function(t){const e={section:x,type:x,description:t,task:t,classes:[]};_.push(e)}),"addTaskOrg"),A=s((function(){const t=s((function(t){return b[t].processed}),"compileTask");let e=!0;for(const[n,i]of b.entries())t(n),e=e&&i.processed;return e}),"compileTasks"),I=s((function(){return M()}),"getActors"),P={getConfig:s((()=>u().journey),"getConfig"),clear:w,setDiagramTitle:h,getDiagramTitle:l,setAccTitle:c,getAccTitle:o,setAccDescription:a,getAccDescription:r,addSection:v,getSections:$,getTasks:T,addTask:S,addTaskOrg:E,getActors:I},j=s((t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${t.textColor}\n }\n\n .legend {\n fill: ${t.textColor};\n font-family: ${t.fontFamily};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${t.textColor}\n }\n\n .face {\n ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${t.fillType0?`fill: ${t.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${t.fillType0?`fill: ${t.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${t.fillType0?`fill: ${t.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${t.fillType0?`fill: ${t.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${t.fillType0?`fill: ${t.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${t.fillType0?`fill: ${t.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${t.fillType0?`fill: ${t.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${t.fillType0?`fill: ${t.fillType7}`:""};\n }\n\n .actor-0 {\n ${t.actor0?`fill: ${t.actor0}`:""};\n }\n .actor-1 {\n ${t.actor1?`fill: ${t.actor1}`:""};\n }\n .actor-2 {\n ${t.actor2?`fill: ${t.actor2}`:""};\n }\n .actor-3 {\n ${t.actor3?`fill: ${t.actor3}`:""};\n }\n .actor-4 {\n ${t.actor4?`fill: ${t.actor4}`:""};\n }\n .actor-5 {\n ${t.actor5?`fill: ${t.actor5}`:""};\n }\n`),"getStyles"),C=s((function(t,e){return i(t,e)}),"drawRect"),V=s((function(t,e){const n=15,i=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),r=t.append("g");function a(t){const i=f().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function o(t){const i=f().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function c(t){t.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 r.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s(a,"smile"),s(o,"sad"),s(c,"ambivalent"),e.score>3?a(r):e.score<3?o(r):c(r),i}),"drawFace"),F=s((function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n}),"drawCircle"),L=s((function(t,e){return n(t,e)}),"drawText"),O=s((function(t,e){function n(t,e,n,i,s){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-s)+" "+(t+n-1.2*s)+","+(e+i)+" "+t+","+(e+i)}s(n,"genPoints");const i=t.append("polygon");i.attr("points",n(e.x,e.y,50,20,7)),i.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,L(t,e)}),"drawLabel"),D=s((function(t,n,i){const s=t.append("g"),r=e();r.x=n.x,r.y=n.y,r.fill=n.fill,r.width=i.width*n.taskCount+i.diagramMarginX*(n.taskCount-1),r.height=i.height,r.class="journey-section section-type-"+n.num,r.rx=3,r.ry=3,C(s,r),z(i)(n.text,s,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+n.num},i,n.colour)}),"drawSection"),B=-1,N=s((function(t,n,i){const s=n.x+i.width/2,r=t.append("g");B++;r.append("line").attr("id","task"+B).attr("x1",s).attr("y1",n.y).attr("x2",s).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),V(r,{cx:s,cy:300+30*(5-n.score),score:n.score});const a=e();a.x=n.x,a.y=n.y,a.fill=n.fill,a.width=i.width,a.height=i.height,a.class="task task-type-"+n.num,a.rx=3,a.ry=3,C(r,a);let o=n.x+14;n.people.forEach((t=>{const e=n.actors[t].color,i={cx:o,cy:n.y,r:7,fill:e,stroke:"#000",title:t,pos:n.actors[t].position};F(r,i),o+=10})),z(i)(n.task,r,a.x,a.y,a.width,a.height,{class:"task"},i,n.colour)}),"drawTask"),R=s((function(e,n){t(e,n)}),"drawBackgroundRect"),z=function(){function t(t,e,n,s,r,a,o,c){i(e.append("text").attr("x",n+r/2).attr("y",s+a/2+5).style("font-color",c).style("text-anchor","middle").text(t),o)}function e(t,e,n,s,r,a,o,c,l){const{taskFontSize:h,taskFontFamily:u}=c,p=t.split(/<br\s*\/?>/gi);for(let y=0;y<p.length;y++){const t=y*h-h*(p.length-1)/2,c=e.append("text").attr("x",n+r/2).attr("y",s).attr("fill",l).style("text-anchor","middle").style("font-size",h).style("font-family",u);c.append("tspan").attr("x",n+r/2).attr("dy",t).text(p[y]),c.attr("y",s+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(c,o)}}function n(t,n,s,r,a,o,c,l){const h=n.append("switch"),u=h.append("foreignObject").attr("x",s).attr("y",r).attr("width",a).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,s,r,a,o,c,l),i(u,c)}function i(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return s(t,"byText"),s(e,"byTspan"),s(n,"byFo"),s(i,"_setTextAttrs"),function(i){return"fo"===i.textPlacement?n:"old"===i.textPlacement?t:e}}(),Y={drawRect:C,drawCircle:F,drawSection:D,drawText:L,drawLabel:O,drawTask:N,drawBackgroundRect:R,initGraphics:s((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")},q=s((function(t){Object.keys(t).forEach((function(e){X[e]=t[e]}))}),"setConf"),G={};function W(t){const e=u().journey;let n=60;Object.keys(G).forEach((i=>{const s=G[i].color,r={cx:20,cy:n,r:7,fill:s,stroke:"#000",pos:G[i].position};Y.drawCircle(t,r);const a={x:40,y:n+7,fill:"#666",text:i,textMargin:5|e.boxTextMargin};Y.drawText(t,a),n+=20}))}s(W,"drawActorLegend");var X=u().journey,U=X.leftMargin,Z=s((function(t,e,n,i){const s=u().journey,r=u().securityLevel;let a;"sandbox"===r&&(a=d("#i"+e));const o=d("sandbox"===r?a.nodes()[0].contentDocument.body:"body");H.init();const c=o.select("#"+e);Y.initGraphics(c);const l=i.db.getTasks(),h=i.db.getDiagramTitle(),y=i.db.getActors();for(const u in G)delete G[u];let f=0;y.forEach((t=>{G[t]={color:s.actorColours[f%s.actorColours.length],position:f},f++})),W(c),H.insert(0,0,U,50*Object.keys(G).length),Q(c,l,0);const g=H.getBounds();h&&c.append("text").text(h).attr("x",U).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const m=g.stopy-g.starty+2*s.diagramMarginY,x=U+g.stopx+2*s.diagramMarginX;p(c,m,x,s.useMaxWidth),c.append("line").attr("x1",U).attr("y1",4*s.height).attr("x2",x-U-4).attr("y2",4*s.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const k=h?70:0;c.attr("viewBox",`${g.startx} -25 ${x} ${m+k}`),c.attr("preserveAspectRatio","xMinYMin meet"),c.attr("height",m+k+25)}),"draw"),H={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:s((function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0}),"init"),updateVal:s((function(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])}),"updateVal"),updateBounds:s((function(t,e,n,i){const r=u().journey,a=this;let o=0;function c(c){return s((function(s){o++;const l=a.sequenceItems.length-o+1;a.updateVal(s,"starty",e-l*r.boxMargin,Math.min),a.updateVal(s,"stopy",i+l*r.boxMargin,Math.max),a.updateVal(H.data,"startx",t-l*r.boxMargin,Math.min),a.updateVal(H.data,"stopx",n+l*r.boxMargin,Math.max),"activation"!==c&&(a.updateVal(s,"startx",t-l*r.boxMargin,Math.min),a.updateVal(s,"stopx",n+l*r.boxMargin,Math.max),a.updateVal(H.data,"starty",e-l*r.boxMargin,Math.min),a.updateVal(H.data,"stopy",i+l*r.boxMargin,Math.max))}),"updateItemBounds")}s(c,"updateFn"),this.sequenceItems.forEach(c())}),"updateBounds"),insert:s((function(t,e,n,i){const s=Math.min(t,n),r=Math.max(t,n),a=Math.min(e,i),o=Math.max(e,i);this.updateVal(H.data,"startx",s,Math.min),this.updateVal(H.data,"starty",a,Math.min),this.updateVal(H.data,"stopx",r,Math.max),this.updateVal(H.data,"stopy",o,Math.max),this.updateBounds(s,a,r,o)}),"insert"),bumpVerticalPos:s((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos}),"bumpVerticalPos"),getVerticalPos:s((function(){return this.verticalPos}),"getVerticalPos"),getBounds:s((function(){return this.data}),"getBounds")},J=X.sectionFills,K=X.sectionColours,Q=s((function(t,e,n){const i=u().journey;let s="";const r=n+(2*i.height+i.diagramMarginY);let a=0,o="#CCC",c="black",l=0;for(const[h,u]of e.entries()){if(s!==u.section){o=J[a%J.length],l=a%J.length,c=K[a%K.length];let n=0;const r=u.section;for(let t=h;t<e.length&&e[t].section==r;t++)n+=1;const p={x:h*i.taskMargin+h*i.width+U,y:50,text:u.section,fill:o,num:l,colour:c,taskCount:n};Y.drawSection(t,p,i),s=u.section,a++}const n=u.people.reduce(((t,e)=>(G[e]&&(t[e]=G[e]),t)),{});u.x=h*i.taskMargin+h*i.width+U,u.y=r,u.width=i.diagramMarginX,u.height=i.diagramMarginY,u.colour=c,u.fill=o,u.num=l,u.actors=n,Y.drawTask(t,u,i),H.insert(u.x,u.y,u.x+u.width+i.taskMargin,450)}}),"drawTasks"),tt={setConf:q,draw:Z},et={parser:m,db:P,renderer:tt,styles:j,init:s((t=>{tt.setConf(t.journey),P.clear()}),"init")};export{et as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,l as e,c as n,I as i,Y as s,$ as r,a0 as o,S as a,G as l,h as c,t as h,J as u,T as d,V as g,W as p}from"./mermaid-D2SdoFUx.js";import"./index-D25ZVZoz.js";import"./transform-DjHZbYKP.js";import"./timer-DFzT7np-.js";import"./step-BwsUM5iJ.js";var y=function(){var e=t((function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n}),"o"),n=[1,4],i=[1,13],s=[1,12],r=[1,15],o=[1,16],a=[1,20],l=[1,19],c=[6,7,8],h=[1,26],u=[1,24],d=[1,25],g=[6,7,11],p=[1,31],y=[6,7,11,24],f=[1,6,13,16,17,20,23],m=[1,35],_=[1,36],b=[1,6,7,11,13,16,17,20,23],k=[1,38],E={trace:t((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:t((function(t,e,n,i,s,r,o){var a=r.length-1;switch(s){case 6:case 7:return i;case 8:i.getLogger().trace("Stop NL ");break;case 9:i.getLogger().trace("Stop EOF ");break;case 11:i.getLogger().trace("Stop NL2 ");break;case 12:i.getLogger().trace("Stop EOF2 ");break;case 15:i.getLogger().info("Node: ",r[a-1].id),i.addNode(r[a-2].length,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 16:i.getLogger().info("Node: ",r[a].id),i.addNode(r[a-1].length,r[a].id,r[a].descr,r[a].type);break;case 17:i.getLogger().trace("Icon: ",r[a]),i.decorateNode({icon:r[a]});break;case 18:case 23:i.decorateNode({class:r[a]});break;case 19:i.getLogger().trace("SPACELIST");break;case 20:i.getLogger().trace("Node: ",r[a-1].id),i.addNode(0,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 21:i.getLogger().trace("Node: ",r[a].id),i.addNode(0,r[a].id,r[a].descr,r[a].type);break;case 22:i.decorateNode({icon:r[a]});break;case 27:i.getLogger().trace("node found ..",r[a-2]),this.$={id:r[a-1],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 28:this.$={id:r[a],descr:r[a],type:0};break;case 29:i.getLogger().trace("node found ..",r[a-3]),this.$={id:r[a-3],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 30:this.$=r[a-1]+r[a];break;case 31:this.$=r[a]}}),"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:i,7:[1,10],9:9,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:l},e(c,[2,3]),{1:[2,2]},e(c,[2,4]),e(c,[2,5]),{1:[2,6],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:l},{6:i,9:22,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:l},{6:h,7:u,10:23,11:d},e(g,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:a,23:l}),e(g,[2,19]),e(g,[2,21],{15:30,24:p}),e(g,[2,22]),e(g,[2,23]),e(y,[2,25]),e(y,[2,26]),e(y,[2,28],{20:[1,32]}),{21:[1,33]},{6:h,7:u,10:34,11:d},{1:[2,7],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:l},e(f,[2,14],{7:m,11:_}),e(b,[2,8]),e(b,[2,9]),e(b,[2,10]),e(g,[2,16],{15:37,24:p}),e(g,[2,17]),e(g,[2,18]),e(g,[2,20],{24:k}),e(y,[2,31]),{21:[1,39]},{22:[1,40]},e(f,[2,13],{7:m,11:_}),e(b,[2,11]),e(b,[2,12]),e(g,[2,15],{24:k}),e(y,[2,30]),{22:[1,41]},e(y,[2,27]),e(y,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:t((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:t((function(e){var n=this,i=[0],s=[],r=[null],o=[],a=this.table,l="",c=0,h=0,u=o.slice.call(arguments,1),d=Object.create(this.lexer),g={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(g.yy[p]=this.yy[p]);d.setInput(e,g.yy),g.yy.lexer=d,g.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var y=d.yylloc;o.push(y);var f=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=s.pop()||d.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t((function(t){i.length=i.length-2*t,r.length=r.length-t,o.length=o.length-t}),"popStack"),t(m,"lex");for(var _,b,k,E,S,N,v,x,L={};;){if(b=i[i.length-1],this.defaultActions[b]?k=this.defaultActions[b]:(null==_&&(_=m()),k=a[b]&&a[b][_]),void 0===k||!k.length||!k[0]){var D="";for(S in x=[],a[b])this.terminals_[S]&&S>2&&x.push("'"+this.terminals_[S]+"'");D=d.showPosition?"Parse error on line "+(c+1)+":\n"+d.showPosition()+"\nExpecting "+x.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==_?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(D,{text:d.match,token:this.terminals_[_]||_,line:d.yylineno,loc:y,expected:x})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+_);switch(k[0]){case 1:i.push(_),r.push(d.yytext),o.push(d.yylloc),i.push(k[1]),_=null,h=d.yyleng,l=d.yytext,c=d.yylineno,y=d.yylloc;break;case 2:if(N=this.productions_[k[1]][1],L.$=r[r.length-N],L._$={first_line:o[o.length-(N||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(N||1)].first_column,last_column:o[o.length-1].last_column},f&&(L._$.range=[o[o.length-(N||1)].range[0],o[o.length-1].range[1]]),void 0!==(E=this.performAction.apply(L,[l,h,c,g.yy,k[1],r,o].concat(u))))return E;N&&(i=i.slice(0,-1*N*2),r=r.slice(0,-1*N),o=o.slice(0,-1*N)),i.push(this.productions_[k[1]][0]),r.push(L.$),o.push(L._$),v=a[i[i.length-2]][i[i.length-1]],i.push(v);break;case 3:return!0}}return!0}),"parse")},S=function(){return{EOF:1,parseError:t((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:t((function(t,e){return this.yy=e||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:t((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:t((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;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),n.length-1&&(this.yylineno-=n.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:t((function(){return this._more=!0,this}),"more"),reject:t((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:t((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:t((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:t((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:t((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:t((function(t,e){var n,i,s;if(this.options.backtrack_lexer&&(s={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&&(s.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1}),"test_match"),next:t((function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((n=this._input.match(this.rules[s[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:t((function(){var t=this.next();return t||this.lex()}),"lex"),begin:t((function(t){this.conditionStack.push(t)}),"begin"),popState:t((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:t((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:t((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:t((function(t){this.begin(t)}),"pushState"),stateStackSize:t((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:t((function(t,e,n,i){switch(n){case 0:return this.pushState("shapeData"),e.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const n=/\n\s*/g;return e.yytext=e.yytext.replace(n,"<br/>"),24;case 4:return 24;case 5:case 10:case 29:case 32:this.popState();break;case 6:return t.getLogger().trace("Found comment",e.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 11:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return t.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:t.getLogger().trace("end icon"),this.popState();break;case 16:return t.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return t.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:case 21:case 22: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 30:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 33:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 36:case 39:case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 37:case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 41:case 42:return t.getLogger().trace("Long description:",e.yytext),21}}),"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}}}();function N(){this.yy={}}return E.lexer=S,t(N,"Parser"),N.prototype=E,E.Parser=N,new N}();y.parser=y;var f=y,m=[],_=[],b=0,k={},E=t((()=>{m=[],_=[],b=0,k={}}),"clear"),S=t((t=>{if(0===m.length)return null;const e=m[0].level;let n=null;for(let i=m.length-1;i>=0;i--)if(m[i].level!==e||n||(n=m[i]),m[i].level<e)throw new Error('Items without section detected, found section ("'+m[i].label+'")');return t===(null==n?void 0:n.level)?null:n}),"getSection"),N=t((function(){return _}),"getSections"),v=t((function(){const t=[],e=N(),i=n();for(const n of e){const e={id:n.id,label:c(n.label??"",i),isGroup:!0,ticket:n.ticket,shape:"kanbanSection",level:n.level,look:i.look};t.push(e);const s=m.filter((t=>t.parentId===n.id));for(const r of s){const e={id:r.id,parentId:n.id,label:c(r.label??"",i),isGroup:!1,ticket:null==r?void 0:r.ticket,priority:null==r?void 0:r.priority,assigned:null==r?void 0:r.assigned,icon:null==r?void 0:r.icon,shape:"kanbanItem",level:r.level,rx:5,ry:5,cssStyles:["text-align: left"]};t.push(e)}}return{nodes:t,edges:[],other:{},config:n()}}),"getData"),x=t(((t,e,i,s,r)=>{var o,a;const d=n();let g=(null==(o=d.mindmap)?void 0:o.padding)??l.mindmap.padding;switch(s){case L.ROUNDED_RECT:case L.RECT:case L.HEXAGON:g*=2}const p={id:c(e,d)||"kbn"+b++,level:t,label:c(i,d),width:(null==(a=d.mindmap)?void 0:a.maxNodeWidth)??l.mindmap.maxNodeWidth,padding:g,isGroup:!1};if(void 0!==r){let t;t=r.includes("\n")?r+"\n":"{\n"+r+"\n}";const e=h(t,{schema:u});if(e.shape&&(e.shape!==e.shape.toLowerCase()||e.shape.includes("_")))throw new Error(`No such shape: ${e.shape}. Shape names should be lowercase.`);(null==e?void 0:e.shape)&&"kanbanItem"===e.shape&&(p.shape=null==e?void 0:e.shape),(null==e?void 0:e.label)&&(p.label=null==e?void 0:e.label),(null==e?void 0:e.icon)&&(p.icon=null==e?void 0:e.icon.toString()),(null==e?void 0:e.assigned)&&(p.assigned=null==e?void 0:e.assigned.toString()),(null==e?void 0:e.ticket)&&(p.ticket=null==e?void 0:e.ticket.toString()),(null==e?void 0:e.priority)&&(p.priority=null==e?void 0:e.priority)}const y=S(t);y?p.parentId=y.id||"kbn"+b++:_.push(p),m.push(p)}),"addNode"),L={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},D={clear:E,addNode:x,getSections:N,getData:v,nodeType:L,getType:t(((t,n)=>{switch(e.debug("In get type",t,n),t){case"[":return L.RECT;case"(":return")"===n?L.ROUNDED_RECT:L.CLOUD;case"((":return L.CIRCLE;case")":return L.CLOUD;case"))":return L.BANG;case"{{":return L.HEXAGON;default:return L.DEFAULT}}),"getType"),setElementForId:t(((t,e)=>{k[t]=e}),"setElementForId"),decorateNode:t((t=>{if(!t)return;const e=n(),i=m[m.length-1];t.icon&&(i.icon=c(t.icon,e)),t.class&&(i.cssClasses=c(t.class,e))}),"decorateNode"),type2Str:t((t=>{switch(t){case L.DEFAULT:return"no-border";case L.RECT:return"rect";case L.ROUNDED_RECT:return"rounded-rect";case L.CIRCLE:return"circle";case L.CLOUD:return"cloud";case L.BANG:return"bang";case L.HEXAGON:return"hexgon";default:return"no-border"}}),"type2Str"),getLogger:t((()=>e),"getLogger"),getElementById:t((t=>k[t]),"getElementById")},I={draw:t((async(t,c,h,u)=>{var d,g,p,y,f;e.debug("Rendering kanban diagram\n"+t);const m=u.db.getData(),_=n();_.htmlLabels=!1;const b=i(c),k=b.append("g");k.attr("class","sections");const E=b.append("g");E.attr("class","items");const S=m.nodes.filter((t=>t.isGroup));let N=0;const v=[];let x=25;for(const e of S){const t=(null==(d=null==_?void 0:_.kanban)?void 0:d.sectionWidth)||200;N+=1,e.x=t*N+10*(N-1)/2,e.width=t,e.y=0,e.height=3*t,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+" section-"+N;const n=await s(k,e);x=Math.max(x,null==(g=null==n?void 0:n.labelBBox)?void 0:g.height),v.push(n)}let L=0;for(const e of S){const t=v[L];L+=1;const n=(null==(p=null==_?void 0:_.kanban)?void 0:p.sectionWidth)||200,i=3*-n/2+x;let s=i;const a=m.nodes.filter((t=>t.parentId===e.id));for(const h of a){if(h.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");h.x=e.x,h.width=n-15;const t=(await r(E,h,{config:_})).node().getBBox();h.y=s+t.height/2,await o(h),s=h.y+t.height/2+5}const l=t.cluster.select("rect"),c=Math.max(s-i+30,50)+(x-25);l.attr("height",c)}a(void 0,b,(null==(y=_.mindmap)?void 0:y.padding)??l.kanban.padding,(null==(f=_.mindmap)?void 0:f.useMaxWidth)??l.kanban.useMaxWidth)}),"draw")},O=t((e=>{let n="";for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e["lineColor"+t]=e["lineColor"+t]||e["cScaleInv"+t],d(e["lineColor"+t])?e["lineColor"+t]=g(e["lineColor"+t],20):e["lineColor"+t]=p(e["lineColor"+t],20);const i=t(((t,n)=>e.darkMode?p(t,n):g(t,n)),"adjuster");for(let t=0;t<e.THEME_COLOR_LIMIT;t++){const s=""+(17-3*t);n+=`\n .section-${t-1} rect, .section-${t-1} path, .section-${t-1} circle, .section-${t-1} polygon, .section-${t-1} path {\n fill: ${i(e["cScale"+t],10)};\n stroke: ${i(e["cScale"+t],10)};\n\n }\n .section-${t-1} text {\n fill: ${e["cScaleLabel"+t]};\n }\n .node-icon-${t-1} {\n font-size: 40px;\n color: ${e["cScaleLabel"+t]};\n }\n .section-edge-${t-1}{\n stroke: ${e["cScale"+t]};\n }\n .edge-depth-${t-1}{\n stroke-width: ${s};\n }\n .section-${t-1} line {\n stroke: ${e["cScaleInv"+t]} ;\n stroke-width: 3;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n .kanban-ticket-link {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n text-decoration: underline;\n }\n `}return n}),"genSections"),C={db:D,renderer:I,parser:f,styles:t((t=>`\n .edge {\n stroke-width: 3;\n }\n ${O(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .cluster-label, .label {\n color: ${t.textColor};\n fill: ${t.textColor};\n }\n .kanban-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`),"getStyles")};export{C as diagram};
|
|
1
|
+
import{_ as t,l as e,c as n,I as i,Y as s,$ as r,a0 as o,S as a,G as l,h as c,t as h,J as u,T as d,V as g,W as p}from"./mermaid-R60l6R69.js";import"./index-Bsc9SEYH.js";import"./transform-DjHZbYKP.js";import"./timer-DFzT7np-.js";import"./step-BwsUM5iJ.js";var y=function(){var e=t((function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n}),"o"),n=[1,4],i=[1,13],s=[1,12],r=[1,15],o=[1,16],a=[1,20],l=[1,19],c=[6,7,8],h=[1,26],u=[1,24],d=[1,25],g=[6,7,11],p=[1,31],y=[6,7,11,24],f=[1,6,13,16,17,20,23],m=[1,35],_=[1,36],b=[1,6,7,11,13,16,17,20,23],k=[1,38],E={trace:t((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:t((function(t,e,n,i,s,r,o){var a=r.length-1;switch(s){case 6:case 7:return i;case 8:i.getLogger().trace("Stop NL ");break;case 9:i.getLogger().trace("Stop EOF ");break;case 11:i.getLogger().trace("Stop NL2 ");break;case 12:i.getLogger().trace("Stop EOF2 ");break;case 15:i.getLogger().info("Node: ",r[a-1].id),i.addNode(r[a-2].length,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 16:i.getLogger().info("Node: ",r[a].id),i.addNode(r[a-1].length,r[a].id,r[a].descr,r[a].type);break;case 17:i.getLogger().trace("Icon: ",r[a]),i.decorateNode({icon:r[a]});break;case 18:case 23:i.decorateNode({class:r[a]});break;case 19:i.getLogger().trace("SPACELIST");break;case 20:i.getLogger().trace("Node: ",r[a-1].id),i.addNode(0,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 21:i.getLogger().trace("Node: ",r[a].id),i.addNode(0,r[a].id,r[a].descr,r[a].type);break;case 22:i.decorateNode({icon:r[a]});break;case 27:i.getLogger().trace("node found ..",r[a-2]),this.$={id:r[a-1],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 28:this.$={id:r[a],descr:r[a],type:0};break;case 29:i.getLogger().trace("node found ..",r[a-3]),this.$={id:r[a-3],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 30:this.$=r[a-1]+r[a];break;case 31:this.$=r[a]}}),"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:i,7:[1,10],9:9,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:l},e(c,[2,3]),{1:[2,2]},e(c,[2,4]),e(c,[2,5]),{1:[2,6],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:l},{6:i,9:22,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:l},{6:h,7:u,10:23,11:d},e(g,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:a,23:l}),e(g,[2,19]),e(g,[2,21],{15:30,24:p}),e(g,[2,22]),e(g,[2,23]),e(y,[2,25]),e(y,[2,26]),e(y,[2,28],{20:[1,32]}),{21:[1,33]},{6:h,7:u,10:34,11:d},{1:[2,7],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:l},e(f,[2,14],{7:m,11:_}),e(b,[2,8]),e(b,[2,9]),e(b,[2,10]),e(g,[2,16],{15:37,24:p}),e(g,[2,17]),e(g,[2,18]),e(g,[2,20],{24:k}),e(y,[2,31]),{21:[1,39]},{22:[1,40]},e(f,[2,13],{7:m,11:_}),e(b,[2,11]),e(b,[2,12]),e(g,[2,15],{24:k}),e(y,[2,30]),{22:[1,41]},e(y,[2,27]),e(y,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:t((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:t((function(e){var n=this,i=[0],s=[],r=[null],o=[],a=this.table,l="",c=0,h=0,u=o.slice.call(arguments,1),d=Object.create(this.lexer),g={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(g.yy[p]=this.yy[p]);d.setInput(e,g.yy),g.yy.lexer=d,g.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var y=d.yylloc;o.push(y);var f=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=s.pop()||d.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t((function(t){i.length=i.length-2*t,r.length=r.length-t,o.length=o.length-t}),"popStack"),t(m,"lex");for(var _,b,k,E,S,N,v,x,L={};;){if(b=i[i.length-1],this.defaultActions[b]?k=this.defaultActions[b]:(null==_&&(_=m()),k=a[b]&&a[b][_]),void 0===k||!k.length||!k[0]){var D="";for(S in x=[],a[b])this.terminals_[S]&&S>2&&x.push("'"+this.terminals_[S]+"'");D=d.showPosition?"Parse error on line "+(c+1)+":\n"+d.showPosition()+"\nExpecting "+x.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==_?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(D,{text:d.match,token:this.terminals_[_]||_,line:d.yylineno,loc:y,expected:x})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+_);switch(k[0]){case 1:i.push(_),r.push(d.yytext),o.push(d.yylloc),i.push(k[1]),_=null,h=d.yyleng,l=d.yytext,c=d.yylineno,y=d.yylloc;break;case 2:if(N=this.productions_[k[1]][1],L.$=r[r.length-N],L._$={first_line:o[o.length-(N||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(N||1)].first_column,last_column:o[o.length-1].last_column},f&&(L._$.range=[o[o.length-(N||1)].range[0],o[o.length-1].range[1]]),void 0!==(E=this.performAction.apply(L,[l,h,c,g.yy,k[1],r,o].concat(u))))return E;N&&(i=i.slice(0,-1*N*2),r=r.slice(0,-1*N),o=o.slice(0,-1*N)),i.push(this.productions_[k[1]][0]),r.push(L.$),o.push(L._$),v=a[i[i.length-2]][i[i.length-1]],i.push(v);break;case 3:return!0}}return!0}),"parse")},S=function(){return{EOF:1,parseError:t((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:t((function(t,e){return this.yy=e||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:t((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:t((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;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),n.length-1&&(this.yylineno-=n.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:t((function(){return this._more=!0,this}),"more"),reject:t((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:t((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:t((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:t((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:t((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:t((function(t,e){var n,i,s;if(this.options.backtrack_lexer&&(s={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&&(s.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1}),"test_match"),next:t((function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((n=this._input.match(this.rules[s[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:t((function(){var t=this.next();return t||this.lex()}),"lex"),begin:t((function(t){this.conditionStack.push(t)}),"begin"),popState:t((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:t((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:t((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:t((function(t){this.begin(t)}),"pushState"),stateStackSize:t((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:t((function(t,e,n,i){switch(n){case 0:return this.pushState("shapeData"),e.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const n=/\n\s*/g;return e.yytext=e.yytext.replace(n,"<br/>"),24;case 4:return 24;case 5:case 10:case 29:case 32:this.popState();break;case 6:return t.getLogger().trace("Found comment",e.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 11:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return t.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:t.getLogger().trace("end icon"),this.popState();break;case 16:return t.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return t.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:case 21:case 22: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 30:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 33:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 36:case 39:case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 37:case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 41:case 42:return t.getLogger().trace("Long description:",e.yytext),21}}),"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}}}();function N(){this.yy={}}return E.lexer=S,t(N,"Parser"),N.prototype=E,E.Parser=N,new N}();y.parser=y;var f=y,m=[],_=[],b=0,k={},E=t((()=>{m=[],_=[],b=0,k={}}),"clear"),S=t((t=>{if(0===m.length)return null;const e=m[0].level;let n=null;for(let i=m.length-1;i>=0;i--)if(m[i].level!==e||n||(n=m[i]),m[i].level<e)throw new Error('Items without section detected, found section ("'+m[i].label+'")');return t===(null==n?void 0:n.level)?null:n}),"getSection"),N=t((function(){return _}),"getSections"),v=t((function(){const t=[],e=N(),i=n();for(const n of e){const e={id:n.id,label:c(n.label??"",i),isGroup:!0,ticket:n.ticket,shape:"kanbanSection",level:n.level,look:i.look};t.push(e);const s=m.filter((t=>t.parentId===n.id));for(const r of s){const e={id:r.id,parentId:n.id,label:c(r.label??"",i),isGroup:!1,ticket:null==r?void 0:r.ticket,priority:null==r?void 0:r.priority,assigned:null==r?void 0:r.assigned,icon:null==r?void 0:r.icon,shape:"kanbanItem",level:r.level,rx:5,ry:5,cssStyles:["text-align: left"]};t.push(e)}}return{nodes:t,edges:[],other:{},config:n()}}),"getData"),x=t(((t,e,i,s,r)=>{var o,a;const d=n();let g=(null==(o=d.mindmap)?void 0:o.padding)??l.mindmap.padding;switch(s){case L.ROUNDED_RECT:case L.RECT:case L.HEXAGON:g*=2}const p={id:c(e,d)||"kbn"+b++,level:t,label:c(i,d),width:(null==(a=d.mindmap)?void 0:a.maxNodeWidth)??l.mindmap.maxNodeWidth,padding:g,isGroup:!1};if(void 0!==r){let t;t=r.includes("\n")?r+"\n":"{\n"+r+"\n}";const e=h(t,{schema:u});if(e.shape&&(e.shape!==e.shape.toLowerCase()||e.shape.includes("_")))throw new Error(`No such shape: ${e.shape}. Shape names should be lowercase.`);(null==e?void 0:e.shape)&&"kanbanItem"===e.shape&&(p.shape=null==e?void 0:e.shape),(null==e?void 0:e.label)&&(p.label=null==e?void 0:e.label),(null==e?void 0:e.icon)&&(p.icon=null==e?void 0:e.icon.toString()),(null==e?void 0:e.assigned)&&(p.assigned=null==e?void 0:e.assigned.toString()),(null==e?void 0:e.ticket)&&(p.ticket=null==e?void 0:e.ticket.toString()),(null==e?void 0:e.priority)&&(p.priority=null==e?void 0:e.priority)}const y=S(t);y?p.parentId=y.id||"kbn"+b++:_.push(p),m.push(p)}),"addNode"),L={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},D={clear:E,addNode:x,getSections:N,getData:v,nodeType:L,getType:t(((t,n)=>{switch(e.debug("In get type",t,n),t){case"[":return L.RECT;case"(":return")"===n?L.ROUNDED_RECT:L.CLOUD;case"((":return L.CIRCLE;case")":return L.CLOUD;case"))":return L.BANG;case"{{":return L.HEXAGON;default:return L.DEFAULT}}),"getType"),setElementForId:t(((t,e)=>{k[t]=e}),"setElementForId"),decorateNode:t((t=>{if(!t)return;const e=n(),i=m[m.length-1];t.icon&&(i.icon=c(t.icon,e)),t.class&&(i.cssClasses=c(t.class,e))}),"decorateNode"),type2Str:t((t=>{switch(t){case L.DEFAULT:return"no-border";case L.RECT:return"rect";case L.ROUNDED_RECT:return"rounded-rect";case L.CIRCLE:return"circle";case L.CLOUD:return"cloud";case L.BANG:return"bang";case L.HEXAGON:return"hexgon";default:return"no-border"}}),"type2Str"),getLogger:t((()=>e),"getLogger"),getElementById:t((t=>k[t]),"getElementById")},I={draw:t((async(t,c,h,u)=>{var d,g,p,y,f;e.debug("Rendering kanban diagram\n"+t);const m=u.db.getData(),_=n();_.htmlLabels=!1;const b=i(c),k=b.append("g");k.attr("class","sections");const E=b.append("g");E.attr("class","items");const S=m.nodes.filter((t=>t.isGroup));let N=0;const v=[];let x=25;for(const e of S){const t=(null==(d=null==_?void 0:_.kanban)?void 0:d.sectionWidth)||200;N+=1,e.x=t*N+10*(N-1)/2,e.width=t,e.y=0,e.height=3*t,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+" section-"+N;const n=await s(k,e);x=Math.max(x,null==(g=null==n?void 0:n.labelBBox)?void 0:g.height),v.push(n)}let L=0;for(const e of S){const t=v[L];L+=1;const n=(null==(p=null==_?void 0:_.kanban)?void 0:p.sectionWidth)||200,i=3*-n/2+x;let s=i;const a=m.nodes.filter((t=>t.parentId===e.id));for(const h of a){if(h.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");h.x=e.x,h.width=n-15;const t=(await r(E,h,{config:_})).node().getBBox();h.y=s+t.height/2,await o(h),s=h.y+t.height/2+5}const l=t.cluster.select("rect"),c=Math.max(s-i+30,50)+(x-25);l.attr("height",c)}a(void 0,b,(null==(y=_.mindmap)?void 0:y.padding)??l.kanban.padding,(null==(f=_.mindmap)?void 0:f.useMaxWidth)??l.kanban.useMaxWidth)}),"draw")},O=t((e=>{let n="";for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e["lineColor"+t]=e["lineColor"+t]||e["cScaleInv"+t],d(e["lineColor"+t])?e["lineColor"+t]=g(e["lineColor"+t],20):e["lineColor"+t]=p(e["lineColor"+t],20);const i=t(((t,n)=>e.darkMode?p(t,n):g(t,n)),"adjuster");for(let t=0;t<e.THEME_COLOR_LIMIT;t++){const s=""+(17-3*t);n+=`\n .section-${t-1} rect, .section-${t-1} path, .section-${t-1} circle, .section-${t-1} polygon, .section-${t-1} path {\n fill: ${i(e["cScale"+t],10)};\n stroke: ${i(e["cScale"+t],10)};\n\n }\n .section-${t-1} text {\n fill: ${e["cScaleLabel"+t]};\n }\n .node-icon-${t-1} {\n font-size: 40px;\n color: ${e["cScaleLabel"+t]};\n }\n .section-edge-${t-1}{\n stroke: ${e["cScale"+t]};\n }\n .edge-depth-${t-1}{\n stroke-width: ${s};\n }\n .section-${t-1} line {\n stroke: ${e["cScaleInv"+t]} ;\n stroke-width: 3;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n .kanban-ticket-link {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n text-decoration: underline;\n }\n `}return n}),"genSections"),C={db:D,renderer:I,parser:f,styles:t((t=>`\n .edge {\n stroke-width: 3;\n }\n ${O(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .cluster-label, .label {\n color: ${t.textColor};\n fill: ${t.textColor};\n }\n .kanban-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`),"getStyles")};export{C as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as e}from"./graph-DCc8CUpI.js";import{b as n,e as r,c as t,i as o,f as i,v as a,r as u}from"./_baseUniq-EQxa8zIF.js";import{b as d,a as c,m as s,c as f,h,f as g,l as v,d as l}from"./min-Dg--LZAL.js";import{cg as p,bO as w,d1 as m,aw as b,d2 as y,cW as x,d3 as k,d4 as E,M as N,ai as O,d5 as _,d6 as I}from"./index-D25ZVZoz.js";import{c as P,a as j}from"./_baseEach-BOi1xMzz.js";import{s as R}from"./sortBy-BWYzlL2q.js";function T(e,n){return e>n}function M(e,n){var r={};return n=j(n),P(e,(function(e,t,o){m(r,t,n(e,t,o))})),r}function L(e){return e&&e.length?d(e,b,T):void 0}function C(e,n){return e&&e.length?d(e,j(n),c):void 0}var S=0;function G(e){var n=++S;return y(e)+n}class F{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,n=e._prev;if(n!==e)return V(n),n}enqueue(e){var n=this._sentinel;e._prev&&e._next&&V(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){for(var e=[],n=this._sentinel,r=n._prev;r!==n;)e.push(JSON.stringify(r,B)),r=r._prev;return"["+e.join(", ")+"]"}}function V(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function B(e,n){if("_next"!==e&&"_prev"!==e)return n}var q=N(1);function Y(n,r){if(n.nodeCount()<=1)return[];var o=function(n,r){var o=new e,i=0,a=0;t(n.nodes(),(function(e){o.setNode(e,{v:e,in:0,out:0})})),t(n.edges(),(function(e){var n=o.edge(e.v,e.w)||0,t=r(e),u=n+t;o.setEdge(e.v,e.w,u),a=Math.max(a,o.node(e.v).out+=t),i=Math.max(i,o.node(e.w).in+=t)}));var u=E(a+i+3).map((function(){return new F})),d=i+1;return t(o.nodes(),(function(e){D(u,d,o.node(e))})),{graph:o,buckets:u,zeroIdx:d}}(n,r||q),i=function(e,n,r){var t,o=[],i=n[n.length-1],a=n[0];for(;e.nodeCount();){for(;t=a.dequeue();)z(e,n,r,t);for(;t=i.dequeue();)z(e,n,r,t);if(e.nodeCount())for(var u=n.length-2;u>0;--u)if(t=n[u].dequeue()){o=o.concat(z(e,n,r,t,!0));break}}return o}(o.graph,o.buckets,o.zeroIdx);return k(s(i,(function(e){return n.outEdges(e.v,e.w)})))}function z(e,n,r,o,i){var a=i?[]:void 0;return t(e.inEdges(o.v),(function(t){var o=e.edge(t),u=e.node(t.v);i&&a.push({v:t.v,w:t.w}),u.out-=o,D(n,r,u)})),t(e.outEdges(o.v),(function(t){var o=e.edge(t),i=t.w,a=e.node(i);a.in-=o,D(n,r,a)})),e.removeNode(o.v),a}function D(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function A(e){var n,r="greedy"===e.graph().acyclicer?Y(e,(n=e,function(e){return n.edge(e).weight})):function(e){var n=[],r={},o={};function i(a){Object.prototype.hasOwnProperty.call(o,a)||(o[a]=!0,r[a]=!0,t(e.outEdges(a),(function(e){Object.prototype.hasOwnProperty.call(r,e.w)?n.push(e):i(e.w)})),delete r[a])}return t(e.nodes(),i),n}(e);t(r,(function(n){var r=e.edge(n);e.removeEdge(n),r.forwardName=n.name,r.reversed=!0,e.setEdge(n.w,n.v,r,G("rev"))}))}function U(e,n,r,t){var o;do{o=G(t)}while(e.hasNode(o));return r.dummy=n,e.setNode(o,r),o}function J(n){var r=new e({multigraph:n.isMultigraph()}).setGraph(n.graph());return t(n.nodes(),(function(e){n.children(e).length||r.setNode(e,n.node(e))})),t(n.edges(),(function(e){r.setEdge(e,n.edge(e))})),r}function W(e,n){var r,t,o=e.x,i=e.y,a=n.x-o,u=n.y-i,d=e.width/2,c=e.height/2;if(!a&&!u)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(u)*d>Math.abs(a)*c?(u<0&&(c=-c),r=c*a/u,t=c):(a<0&&(d=-d),r=d,t=d*u/a),{x:o+r,y:i+t}}function H(e){var n=s(E(Q(e)+1),(function(){return[]}));return t(e.nodes(),(function(r){var t=e.node(r),i=t.rank;o(i)||(n[i][t.order]=r)})),n}function K(e,n,r,t){var o={width:0,height:0};return arguments.length>=4&&(o.rank=r,o.order=t),U(e,"border",o,n)}function Q(e){return L(s(e.nodes(),(function(n){var r=e.node(n).rank;if(!o(r))return r})))}function X(e,n){return n()}function Z(e,n,r,t,o,i){var a={width:0,height:0,rank:i,borderType:n},u=o[n][i-1],d=U(e,"border",a,r);o[n][i]=d,e.setParent(d,t),u&&e.setEdge(u,d,{weight:1})}function $(e){var n=e.graph().rankdir.toLowerCase();"bt"!==n&&"rl"!==n||function(e){t(e.nodes(),(function(n){re(e.node(n))})),t(e.edges(),(function(n){var r=e.edge(n);t(r.points,re),Object.prototype.hasOwnProperty.call(r,"y")&&re(r)}))}(e),"lr"!==n&&"rl"!==n||(!function(e){t(e.nodes(),(function(n){te(e.node(n))})),t(e.edges(),(function(n){var r=e.edge(n);t(r.points,te),Object.prototype.hasOwnProperty.call(r,"x")&&te(r)}))}(e),ee(e))}function ee(e){t(e.nodes(),(function(n){ne(e.node(n))})),t(e.edges(),(function(n){ne(e.edge(n))}))}function ne(e){var n=e.width;e.width=e.height,e.height=n}function re(e){e.y=-e.y}function te(e){var n=e.x;e.x=e.y,e.y=n}function oe(e){e.graph().dummyChains=[],t(e.edges(),(function(n){!function(e,n){var r=n.v,t=e.node(r).rank,o=n.w,i=e.node(o).rank,a=n.name,u=e.edge(n),d=u.labelRank;if(i===t+1)return;e.removeEdge(n);var c,s,f=void 0;for(s=0,++t;t<i;++s,++t)u.points=[],c=U(e,"edge",f={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},"_d"),t===d&&(f.width=u.width,f.height=u.height,f.dummy="edge-label",f.labelpos=u.labelpos),e.setEdge(r,c,{weight:u.weight},a),0===s&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,o,{weight:u.weight},a)}(e,n)}))}function ie(e){var n={};t(e.sources(),(function r(t){var o=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return o.rank;n[t]=!0;var i=f(s(e.outEdges(t),(function(n){return r(n.w)-e.edge(n).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))}function ae(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function ue(n){var r,t,o=new e({directed:!1}),i=n.nodes()[0],a=n.nodeCount();for(o.setNode(i,{});de(o,n)<a;)r=ce(o,n),t=o.hasNode(r.v)?ae(n,r):-ae(n,r),se(o,n,t);return o}function de(e,n){return t(e.nodes(),(function r(o){t(n.nodeEdges(o),(function(t){var i=t.v,a=o===i?t.w:i;e.hasNode(a)||ae(n,t)||(e.setNode(a,{}),e.setEdge(o,a,{}),r(a))}))})),e.nodeCount()}function ce(e,n){return C(n.edges(),(function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return ae(n,r)}))}function se(e,n,r){t(e.nodes(),(function(e){n.node(e).rank+=r}))}function fe(e,n,r){O(n)||(n=[n]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return t(n,(function(n){if(!e.hasNode(n))throw new Error("Graph does not have node: "+n);he(e,n,"post"===r,a,o,i)})),i}function he(e,n,r,o,i,a){Object.prototype.hasOwnProperty.call(o,n)||(o[n]=!0,r||a.push(n),t(i(n),(function(n){he(e,n,r,o,i,a)})),r&&a.push(n))}function ge(n){n=function(n){var r=(new e).setGraph(n.graph());return t(n.nodes(),(function(e){r.setNode(e,n.node(e))})),t(n.edges(),(function(e){var t=r.edge(e.v,e.w)||{weight:0,minlen:1},o=n.edge(e);r.setEdge(e.v,e.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})})),r}(n),ie(n);var r,o=ue(n);for(pe(o),ve(o,n);r=me(o);)ye(o,n,r,be(o,n,r))}function ve(e,n){var r=function(e,n){return fe(e,n,"post")}(e,e.nodes());r=r.slice(0,r.length-1),t(r,(function(r){!function(e,n,r){var t=e.node(r),o=t.parent;e.edge(r,o).cutvalue=le(e,n,r)}(e,n,r)}))}function le(e,n,r){var o=e.node(r).parent,i=!0,a=n.edge(r,o),u=0;return a||(i=!1,a=n.edge(o,r)),u=a.weight,t(n.nodeEdges(r),(function(t){var a,d,c=t.v===r,s=c?t.w:t.v;if(s!==o){var f=c===i,h=n.edge(t).weight;if(u+=f?h:-h,a=r,d=s,e.hasEdge(a,d)){var g=e.edge(r,s).cutvalue;u+=f?-g:g}}})),u}function pe(e,n){arguments.length<2&&(n=e.nodes()[0]),we(e,{},1,n)}function we(e,n,r,o,i){var a=r,u=e.node(o);return n[o]=!0,t(e.neighbors(o),(function(t){Object.prototype.hasOwnProperty.call(n,t)||(r=we(e,n,r,t,o))})),u.low=a,u.lim=r++,i?u.parent=i:delete u.parent,r}function me(e){return g(e.edges(),(function(n){return e.edge(n).cutvalue<0}))}function be(e,n,r){var t=r.v,o=r.w;n.hasEdge(t,o)||(t=r.w,o=r.v);var a=e.node(t),u=e.node(o),d=a,c=!1;return a.lim>u.lim&&(d=u,c=!0),C(i(n.edges(),(function(n){return c===xe(e,e.node(n.v),d)&&c!==xe(e,e.node(n.w),d)})),(function(e){return ae(n,e)}))}function ye(e,n,r,o){var i=r.v,a=r.w;e.removeEdge(i,a),e.setEdge(o.v,o.w,{}),pe(e),ve(e,n),function(e,n){var r=g(e.nodes(),(function(e){return!n.node(e).parent})),o=function(e,n){return fe(e,n,"pre")}(e,r);o=o.slice(1),t(o,(function(r){var t=e.node(r).parent,o=n.edge(r,t),i=!1;o||(o=n.edge(t,r),i=!0),n.node(r).rank=n.node(t).rank+(i?o.minlen:-o.minlen)}))}(e,n)}function xe(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function ke(e){switch(e.graph().ranker){case"network-simplex":default:Ne(e);break;case"tight-tree":!function(e){ie(e),ue(e)}(e);break;case"longest-path":Ee(e)}}new Error,ge.initLowLimValues=pe,ge.initCutValues=ve,ge.calcCutValue=le,ge.leaveEdge=me,ge.enterEdge=be,ge.exchangeEdges=ye;var Ee=ie;function Ne(e){ge(e)}function Oe(e){var n=U(e,"root",{},"_root"),r=function(e){var n={};function r(o,i){var a=e.children(o);a&&a.length&&t(a,(function(e){r(e,i+1)})),n[o]=i}return t(e.children(),(function(e){r(e,1)})),n}(e),o=L(a(r))-1,i=2*o+1;e.graph().nestingRoot=n,t(e.edges(),(function(n){e.edge(n).minlen*=i}));var d=function(e){return u(e.edges(),(function(n,r){return n+e.edge(r).weight}),0)}(e)+1;t(e.children(),(function(t){_e(e,n,i,d,o,r,t)})),e.graph().nodeRankFactor=i}function _e(e,n,r,o,i,a,u){var d=e.children(u);if(d.length){var c=K(e,"_bt"),s=K(e,"_bb"),f=e.node(u);e.setParent(c,u),f.borderTop=c,e.setParent(s,u),f.borderBottom=s,t(d,(function(t){_e(e,n,r,o,i,a,t);var d=e.node(t),f=d.borderTop?d.borderTop:t,h=d.borderBottom?d.borderBottom:t,g=d.borderTop?o:2*o,v=f!==h?1:i-a[u]+1;e.setEdge(c,f,{weight:g,minlen:v,nestingEdge:!0}),e.setEdge(h,s,{weight:g,minlen:v,nestingEdge:!0})})),e.parent(u)||e.setEdge(n,c,{weight:0,minlen:i+a[u]})}else u!==n&&e.setEdge(n,u,{weight:0,minlen:r})}function Ie(n,r,i){var a=function(e){var n;for(;e.hasNode(n=G("_root")););return n}(n),u=new e({compound:!0}).setGraph({root:a}).setDefaultNodeLabel((function(e){return n.node(e)}));return t(n.nodes(),(function(e){var d=n.node(e),c=n.parent(e);(d.rank===r||d.minRank<=r&&r<=d.maxRank)&&(u.setNode(e),u.setParent(e,c||a),t(n[i](e),(function(r){var t=r.v===e?r.w:r.v,i=u.edge(t,e),a=o(i)?0:i.weight;u.setEdge(t,e,{weight:n.edge(r).weight+a})})),Object.prototype.hasOwnProperty.call(d,"minRank")&&u.setNode(e,{borderLeft:d.borderLeft[r],borderRight:d.borderRight[r]}))})),u}function Pe(e,n){for(var r=0,t=1;t<n.length;++t)r+=je(e,n[t-1],n[t]);return r}function je(e,n,r){for(var o,i,a=(o=r,i=s(r,(function(e,n){return n})),function(e,n,r){for(var t=-1,o=e.length,i=n.length,a={};++t<o;){var u=t<i?n[t]:void 0;r(a,e[t],u)}return a}(o||[],i||[],x)),u=k(s(n,(function(n){return R(s(e.outEdges(n),(function(n){return{pos:a[n.w],weight:e.edge(n).weight}})),"pos")}))),d=1;d<r.length;)d<<=1;var c=2*d-1;d-=1;var f=s(new Array(c),(function(){return 0})),h=0;return t(u.forEach((function(e){var n=e.pos+d;f[n]+=e.weight;for(var r=0;n>0;)n%2&&(r+=f[n+1]),f[n=n-1>>1]+=e.weight;h+=e.weight*r}))),h}function Re(e,n){var r={};return t(e,(function(e,n){var t=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n};o(e.barycenter)||(t.barycenter=e.barycenter,t.weight=e.weight)})),t(n.edges(),(function(e){var n=r[e.v],t=r[e.w];o(n)||o(t)||(t.indegree++,n.out.push(r[e.w]))})),function(e){var n=[];function r(e){return function(n){n.merged||(o(n.barycenter)||o(e.barycenter)||n.barycenter>=e.barycenter)&&function(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight);n.weight&&(r+=n.barycenter*n.weight,t+=n.weight);e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}(e,n)}}function a(n){return function(r){r.in.push(n),0==--r.indegree&&e.push(r)}}for(;e.length;){var u=e.pop();n.push(u),t(u.in.reverse(),r(u)),t(u.out,a(u))}return s(i(n,(function(e){return!e.merged})),(function(e){return _(e,["vs","i","barycenter","weight"])}))}(i(r,(function(e){return!e.indegree})))}function Te(e,n){var r,o=function(e,n){var r={lhs:[],rhs:[]};return t(e,(function(e){n(e)?r.lhs.push(e):r.rhs.push(e)})),r}(e,(function(e){return Object.prototype.hasOwnProperty.call(e,"barycenter")})),i=o.lhs,a=R(o.rhs,(function(e){return-e.i})),u=[],d=0,c=0,s=0;i.sort((r=!!n,function(e,n){return e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:r?n.i-e.i:e.i-n.i})),s=Me(u,a,s),t(i,(function(e){s+=e.vs.length,u.push(e.vs),d+=e.barycenter*e.weight,c+=e.weight,s=Me(u,a,s)}));var f={vs:k(u)};return c&&(f.barycenter=d/c,f.weight=c),f}function Me(e,n,r){for(var t;n.length&&(t=v(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Le(e,n,r,a){var d=e.children(n),c=e.node(n),f=c?c.borderLeft:void 0,h=c?c.borderRight:void 0,g={};f&&(d=i(d,(function(e){return e!==f&&e!==h})));var v=function(e,n){return s(n,(function(n){var r=e.inEdges(n);if(r.length){var t=u(r,(function(n,r){var t=e.edge(r),o=e.node(r.v);return{sum:n.sum+t.weight*o.order,weight:n.weight+t.weight}}),{sum:0,weight:0});return{v:n,barycenter:t.sum/t.weight,weight:t.weight}}return{v:n}}))}(e,d);t(v,(function(n){if(e.children(n.v).length){var t=Le(e,n.v,r,a);g[n.v]=t,Object.prototype.hasOwnProperty.call(t,"barycenter")&&(u=t,o((i=n).barycenter)?(i.barycenter=u.barycenter,i.weight=u.weight):(i.barycenter=(i.barycenter*i.weight+u.barycenter*u.weight)/(i.weight+u.weight),i.weight+=u.weight))}var i,u}));var l=Re(v,r);!function(e,n){t(e,(function(e){e.vs=k(e.vs.map((function(e){return n[e]?n[e].vs:e})))}))}(l,g);var p=Te(l,a);if(f&&(p.vs=k([f,p.vs,h]),e.predecessors(f).length)){var w=e.node(e.predecessors(f)[0]),m=e.node(e.predecessors(h)[0]);Object.prototype.hasOwnProperty.call(p,"barycenter")||(p.barycenter=0,p.weight=0),p.barycenter=(p.barycenter*p.weight+w.order+m.order)/(p.weight+2),p.weight+=2}return p}function Ce(e){var r=Q(e),o=Se(e,E(1,r+1),"inEdges"),a=Se(e,E(r-1,-1,-1),"outEdges"),u=function(e){var n={},r=i(e.nodes(),(function(n){return!e.children(n).length})),o=L(s(r,(function(n){return e.node(n).rank}))),a=s(E(o+1),(function(){return[]})),u=R(r,(function(n){return e.node(n).rank}));return t(u,(function r(o){if(!h(n,o)){n[o]=!0;var i=e.node(o);a[i.rank].push(o),t(e.successors(o),r)}})),a}(e);Fe(e,u);for(var d,c=Number.POSITIVE_INFINITY,f=0,g=0;g<4;++f,++g){Ge(f%2?o:a,f%4>=2);var v=Pe(e,u=H(e));v<c&&(g=0,d=n(u,5),c=v)}Fe(e,d)}function Se(e,n,r){return s(n,(function(n){return Ie(e,n,r)}))}function Ge(n,r){var o=new e;t(n,(function(e){var n=e.graph().root,i=Le(e,n,o,r);t(i.vs,(function(n,r){e.node(n).order=r})),function(e,n,r){var o,i={};t(r,(function(r){for(var t,a,u=e.parent(r);u;){if((t=e.parent(u))?(a=i[t],i[t]=u):(a=o,o=u),a&&a!==u)return void n.setEdge(a,u);u=t}}))}(e,o,i.vs)}))}function Fe(e,n){t(n,(function(n){t(n,(function(n,r){e.node(n).order=r}))}))}function Ve(e){var n=function(e){var n={},r=0;function o(i){var a=r;t(e.children(i),o),n[i]={low:a,lim:r++}}return t(e.children(),o),n}(e);t(e.graph().dummyChains,(function(r){for(var t=e.node(r),o=t.edgeObj,i=function(e,n,r,t){var o,i,a=[],u=[],d=Math.min(n[r].low,n[t].low),c=Math.max(n[r].lim,n[t].lim);o=r;do{o=e.parent(o),a.push(o)}while(o&&(n[o].low>d||c>n[o].lim));i=o,o=t;for(;(o=e.parent(o))!==i;)u.push(o);return{path:a.concat(u.reverse()),lca:i}}(e,n,o.v,o.w),a=i.path,u=i.lca,d=0,c=a[d],s=!0;r!==o.w;){if(t=e.node(r),s){for(;(c=a[d])!==u&&e.node(c).maxRank<t.rank;)d++;c===u&&(s=!1)}if(!s){for(;d<a.length-1&&e.node(c=a[d+1]).minRank<=t.rank;)d++;c=a[d]}e.setParent(r,c),r=e.successors(r)[0]}}))}function Be(e,n){var r={};return u(n,(function(n,o){var i=0,a=0,u=n.length,d=v(o);return t(o,(function(n,c){var s=function(e,n){if(e.node(n).dummy)return g(e.predecessors(n),(function(n){return e.node(n).dummy}))}(e,n),f=s?e.node(s).order:u;(s||n===d)&&(t(o.slice(a,c+1),(function(n){t(e.predecessors(n),(function(t){var o=e.node(t),a=o.order;!(a<i||f<a)||o.dummy&&e.node(n).dummy||qe(r,t,n)}))})),a=c+1,i=f)})),o})),r}function qe(e,n,r){if(n>r){var t=n;n=r,r=t}var o=e[n];o||(e[n]=o={}),o[r]=!0}function Ye(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function ze(n,r,o,i,a){var u={},d=function(n,r,o,i){var a=new e,u=n.graph(),d=function(e,n,r){return function(t,o,i){var a,u=t.node(o),d=t.node(i),c=0;if(c+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(c+=r?a:-a),a=0,c+=(u.dummy?n:e)/2,c+=(d.dummy?n:e)/2,c+=d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":a=d.width/2;break;case"r":a=-d.width/2}return a&&(c+=r?a:-a),a=0,c}}(u.nodesep,u.edgesep,i);return t(r,(function(e){var r;t(e,(function(e){var t=o[e];if(a.setNode(t),r){var i=o[r],u=a.edge(i,t);a.setEdge(i,t,Math.max(d(n,e,r),u||0))}r=e}))})),a}(n,r,o,a),c=a?"borderLeft":"borderRight";function s(e,n){for(var r=d.nodes(),t=r.pop(),o={};t;)o[t]?e(t):(o[t]=!0,r.push(t),r=r.concat(n(t))),t=r.pop()}return s((function(e){u[e]=d.inEdges(e).reduce((function(e,n){return Math.max(e,u[n.v]+d.edge(n))}),0)}),d.predecessors.bind(d)),s((function(e){var r=d.outEdges(e).reduce((function(e,n){return Math.min(e,u[n.w]-d.edge(n))}),Number.POSITIVE_INFINITY),t=n.node(e);r!==Number.POSITIVE_INFINITY&&t.borderType!==c&&(u[e]=Math.max(u[e],r))}),d.successors.bind(d)),t(i,(function(e){u[e]=u[o[e]]})),u}function De(e,n){return C(a(n),(function(n){var t,o,i=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return o=function(n,r){var t=function(e,n){return e.node(n).width}(e,r)/2;i=Math.max(n+t,i),a=Math.min(n-t,a)},null==(t=n)||p(t,r(o),w),i-a}))}function Ae(e){var n,r=H(e),o=I(Be(e,r),function(e,n){var r={};function o(n,o,i,a,u){var d;t(E(o,i),(function(o){d=n[o],e.node(d).dummy&&t(e.predecessors(d),(function(n){var t=e.node(n);t.dummy&&(t.order<a||t.order>u)&&qe(r,n,d)}))}))}return u(n,(function(n,r){var i,a=-1,u=0;return t(r,(function(t,d){if("border"===e.node(t).dummy){var c=e.predecessors(t);c.length&&(i=e.node(c[0]).order,o(r,u,d,a,i),u=d,a=i)}o(r,u,r.length,i,n.length)})),r})),r}(e,r)),i={};t(["u","d"],(function(u){n="u"===u?r:a(r).reverse(),t(["l","r"],(function(r){"r"===r&&(n=s(n,(function(e){return a(e).reverse()})));var d=("u"===u?e.predecessors:e.successors).bind(e),c=function(e,n,r,o){var i={},a={},u={};return t(n,(function(e){t(e,(function(e,n){i[e]=e,a[e]=e,u[e]=n}))})),t(n,(function(e){var n=-1;t(e,(function(e){var t=o(e);if(t.length)for(var d=((t=R(t,(function(e){return u[e]}))).length-1)/2,c=Math.floor(d),s=Math.ceil(d);c<=s;++c){var f=t[c];a[e]===e&&n<u[f]&&!Ye(r,e,f)&&(a[f]=e,a[e]=i[e]=i[f],n=u[f])}}))})),{root:i,align:a}}(0,n,o,d),f=ze(e,n,c.root,c.align,"r"===r);"r"===r&&(f=M(f,(function(e){return-e}))),i[u+r]=f}))}));var d=De(e,i);return function(e,n){var r=a(n),o=f(r),i=L(r);t(["u","d"],(function(r){t(["l","r"],(function(t){var u,d=r+t,c=e[d];if(c!==n){var s=a(c);(u="l"===t?o-f(s):i-L(s))&&(e[d]=M(c,(function(e){return e+u})))}}))}))}(i,d),function(e,n){return M(e.ul,(function(r,t){if(n)return e[n.toLowerCase()][t];var o=R(s(e,t));return(o[1]+o[2])/2}))}(i,e.graph().align)}function Ue(e){var n,o;(function(e){var n=H(e),r=e.graph().ranksep,o=0;t(n,(function(n){var i=L(s(n,(function(n){return e.node(n).height})));t(n,(function(n){e.node(n).y=o+i/2})),o+=i+r}))})(e=J(e)),n=Ae(e),o=function(n,r){e.node(r).x=n},n&&P(n,r(o))}function Je(n,r){var i=X;i("layout",(()=>{var r=i(" buildLayoutGraph",(()=>function(n){var r=new e({multigraph:!0,compound:!0}),o=rn(n.graph());return r.setGraph(I({},He,nn(o,We),_(o,Ke))),t(n.nodes(),(function(e){var t=rn(n.node(e));r.setNode(e,l(nn(t,Qe),Xe)),r.setParent(e,n.parent(e))})),t(n.edges(),(function(e){var t=rn(n.edge(e));r.setEdge(e,I({},$e,nn(t,Ze),_(t,en)))})),r}(n)));i(" runLayout",(()=>function(e,n){n(" makeSpaceForEdgeLabels",(()=>function(e){var n=e.graph();n.ranksep/=2,t(e.edges(),(function(r){var t=e.edge(r);t.minlen*=2,"c"!==t.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?t.width+=t.labeloffset:t.height+=t.labeloffset)}))}(e))),n(" removeSelfEdges",(()=>function(e){t(e.edges(),(function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}}))}(e))),n(" acyclic",(()=>A(e))),n(" nestingGraph.run",(()=>Oe(e))),n(" rank",(()=>ke(J(e)))),n(" injectEdgeLabelProxies",(()=>function(e){t(e.edges(),(function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),o={rank:(e.node(n.w).rank-t.rank)/2+t.rank,e:n};U(e,"edge-proxy",o,"_ep")}}))}(e))),n(" removeEmptyRanks",(()=>function(e){var n=f(s(e.nodes(),(function(n){return e.node(n).rank}))),r=[];t(e.nodes(),(function(t){var o=e.node(t).rank-n;r[o]||(r[o]=[]),r[o].push(t)}));var i=0,a=e.graph().nodeRankFactor;t(r,(function(n,r){o(n)&&r%a!=0?--i:i&&t(n,(function(n){e.node(n).rank+=i}))}))}(e))),n(" nestingGraph.cleanup",(()=>function(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,t(e.edges(),(function(n){e.edge(n).nestingEdge&&e.removeEdge(n)}))}(e))),n(" normalizeRanks",(()=>function(e){var n=f(s(e.nodes(),(function(n){return e.node(n).rank})));t(e.nodes(),(function(r){var t=e.node(r);h(t,"rank")&&(t.rank-=n)}))}(e))),n(" assignRankMinMax",(()=>function(e){var n=0;t(e.nodes(),(function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=L(n,t.maxRank))})),e.graph().maxRank=n}(e))),n(" removeEdgeLabelProxies",(()=>function(e){t(e.nodes(),(function(n){var r=e.node(n);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))}))}(e))),n(" normalize.run",(()=>oe(e))),n(" parentDummyChains",(()=>Ve(e))),n(" addBorderSegments",(()=>function(e){t(e.children(),(function n(r){var o=e.children(r),i=e.node(r);if(o.length&&t(o,n),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,u=i.maxRank+1;a<u;++a)Z(e,"borderLeft","_bl",r,i,a),Z(e,"borderRight","_br",r,i,a)}}))}(e))),n(" order",(()=>Ce(e))),n(" insertSelfEdges",(()=>function(e){var n=H(e);t(n,(function(n){var r=0;t(n,(function(n,o){var i=e.node(n);i.order=o+r,t(i.selfEdges,(function(n){U(e,"selfedge",{width:n.label.width,height:n.label.height,rank:i.rank,order:o+ ++r,e:n.e,label:n.label},"_se")})),delete i.selfEdges}))}))}(e))),n(" adjustCoordinateSystem",(()=>function(e){var n=e.graph().rankdir.toLowerCase();"lr"!==n&&"rl"!==n||ee(e)}(e))),n(" position",(()=>Ue(e))),n(" positionSelfEdges",(()=>function(e){t(e.nodes(),(function(n){var r=e.node(n);if("selfedge"===r.dummy){var t=e.node(r.e.v),o=t.x+t.width/2,i=t.y,a=r.x-o,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:o+2*a/3,y:i-u},{x:o+5*a/6,y:i-u},{x:o+a,y:i},{x:o+5*a/6,y:i+u},{x:o+2*a/3,y:i+u}],r.label.x=r.x,r.label.y=r.y}}))}(e))),n(" removeBorderNodes",(()=>function(e){t(e.nodes(),(function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),o=e.node(r.borderBottom),i=e.node(v(r.borderLeft)),a=e.node(v(r.borderRight));r.width=Math.abs(a.x-i.x),r.height=Math.abs(o.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}})),t(e.nodes(),(function(n){"border"===e.node(n).dummy&&e.removeNode(n)}))}(e))),n(" normalize.undo",(()=>function(e){t(e.graph().dummyChains,(function(n){var r,t=e.node(n),o=t.edgeLabel;for(e.setEdge(t.edgeObj,o);t.dummy;)r=e.successors(n)[0],e.removeNode(n),o.points.push({x:t.x,y:t.y}),"edge-label"===t.dummy&&(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height),n=r,t=e.node(n)}))}(e))),n(" fixupEdgeLabelCoords",(()=>function(e){t(e.edges(),(function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}}))}(e))),n(" undoCoordinateSystem",(()=>$(e))),n(" translateGraph",(()=>function(e){var n=Number.POSITIVE_INFINITY,r=0,o=Number.POSITIVE_INFINITY,i=0,a=e.graph(),u=a.marginx||0,d=a.marginy||0;function c(e){var t=e.x,a=e.y,u=e.width,d=e.height;n=Math.min(n,t-u/2),r=Math.max(r,t+u/2),o=Math.min(o,a-d/2),i=Math.max(i,a+d/2)}t(e.nodes(),(function(n){c(e.node(n))})),t(e.edges(),(function(n){var r=e.edge(n);Object.prototype.hasOwnProperty.call(r,"x")&&c(r)})),n-=u,o-=d,t(e.nodes(),(function(r){var t=e.node(r);t.x-=n,t.y-=o})),t(e.edges(),(function(r){var i=e.edge(r);t(i.points,(function(e){e.x-=n,e.y-=o})),Object.prototype.hasOwnProperty.call(i,"x")&&(i.x-=n),Object.prototype.hasOwnProperty.call(i,"y")&&(i.y-=o)})),a.width=r-n+u,a.height=i-o+d}(e))),n(" assignNodeIntersects",(()=>function(e){t(e.edges(),(function(n){var r,t,o=e.edge(n),i=e.node(n.v),a=e.node(n.w);o.points?(r=o.points[0],t=o.points[o.points.length-1]):(o.points=[],r=a,t=i),o.points.unshift(W(i,r)),o.points.push(W(a,t))}))}(e))),n(" reversePoints",(()=>function(e){t(e.edges(),(function(n){var r=e.edge(n);r.reversed&&r.points.reverse()}))}(e))),n(" acyclic.undo",(()=>function(e){t(e.edges(),(function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}}))}(e)))}(r,i))),i(" updateInputGraph",(()=>function(e,n){t(e.nodes(),(function(r){var t=e.node(r),o=n.node(r);t&&(t.x=o.x,t.y=o.y,n.children(r).length&&(t.width=o.width,t.height=o.height))})),t(e.edges(),(function(r){var t=e.edge(r),o=n.edge(r);t.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(t.x=o.x,t.y=o.y)})),e.graph().width=n.graph().width,e.graph().height=n.graph().height}(n,r)))}))}var We=["nodesep","edgesep","ranksep","marginx","marginy"],He={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Ke=["acyclicer","ranker","rankdir","align"],Qe=["width","height"],Xe={width:0,height:0},Ze=["minlen","weight","width","height","labeloffset"],$e={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},en=["labelpos"];function nn(e,n){return M(_(e,n),Number)}function rn(e){var n={};return t(e,(function(e,r){n[r.toLowerCase()]=e})),n}export{Je as l};
|
|
1
|
+
import{G as e}from"./graph-UIDUJmse.js";import{b as n,e as r,c as t,i as o,f as i,v as a,r as u}from"./_baseUniq-CYFxhDYw.js";import{b as d,a as c,m as s,c as f,h,f as g,l as v,d as l}from"./min-C-OQ4NGo.js";import{cg as p,bO as w,d1 as m,aw as b,d2 as y,cW as x,d3 as k,d4 as E,M as N,ai as O,d5 as _,d6 as I}from"./index-Bsc9SEYH.js";import{c as P,a as j}from"./_baseEach-DD_63bhv.js";import{s as R}from"./sortBy-DtnQOB1o.js";function T(e,n){return e>n}function M(e,n){var r={};return n=j(n),P(e,(function(e,t,o){m(r,t,n(e,t,o))})),r}function L(e){return e&&e.length?d(e,b,T):void 0}function C(e,n){return e&&e.length?d(e,j(n),c):void 0}var S=0;function G(e){var n=++S;return y(e)+n}class F{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,n=e._prev;if(n!==e)return V(n),n}enqueue(e){var n=this._sentinel;e._prev&&e._next&&V(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){for(var e=[],n=this._sentinel,r=n._prev;r!==n;)e.push(JSON.stringify(r,B)),r=r._prev;return"["+e.join(", ")+"]"}}function V(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function B(e,n){if("_next"!==e&&"_prev"!==e)return n}var q=N(1);function Y(n,r){if(n.nodeCount()<=1)return[];var o=function(n,r){var o=new e,i=0,a=0;t(n.nodes(),(function(e){o.setNode(e,{v:e,in:0,out:0})})),t(n.edges(),(function(e){var n=o.edge(e.v,e.w)||0,t=r(e),u=n+t;o.setEdge(e.v,e.w,u),a=Math.max(a,o.node(e.v).out+=t),i=Math.max(i,o.node(e.w).in+=t)}));var u=E(a+i+3).map((function(){return new F})),d=i+1;return t(o.nodes(),(function(e){D(u,d,o.node(e))})),{graph:o,buckets:u,zeroIdx:d}}(n,r||q),i=function(e,n,r){var t,o=[],i=n[n.length-1],a=n[0];for(;e.nodeCount();){for(;t=a.dequeue();)z(e,n,r,t);for(;t=i.dequeue();)z(e,n,r,t);if(e.nodeCount())for(var u=n.length-2;u>0;--u)if(t=n[u].dequeue()){o=o.concat(z(e,n,r,t,!0));break}}return o}(o.graph,o.buckets,o.zeroIdx);return k(s(i,(function(e){return n.outEdges(e.v,e.w)})))}function z(e,n,r,o,i){var a=i?[]:void 0;return t(e.inEdges(o.v),(function(t){var o=e.edge(t),u=e.node(t.v);i&&a.push({v:t.v,w:t.w}),u.out-=o,D(n,r,u)})),t(e.outEdges(o.v),(function(t){var o=e.edge(t),i=t.w,a=e.node(i);a.in-=o,D(n,r,a)})),e.removeNode(o.v),a}function D(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function A(e){var n,r="greedy"===e.graph().acyclicer?Y(e,(n=e,function(e){return n.edge(e).weight})):function(e){var n=[],r={},o={};function i(a){Object.prototype.hasOwnProperty.call(o,a)||(o[a]=!0,r[a]=!0,t(e.outEdges(a),(function(e){Object.prototype.hasOwnProperty.call(r,e.w)?n.push(e):i(e.w)})),delete r[a])}return t(e.nodes(),i),n}(e);t(r,(function(n){var r=e.edge(n);e.removeEdge(n),r.forwardName=n.name,r.reversed=!0,e.setEdge(n.w,n.v,r,G("rev"))}))}function U(e,n,r,t){var o;do{o=G(t)}while(e.hasNode(o));return r.dummy=n,e.setNode(o,r),o}function J(n){var r=new e({multigraph:n.isMultigraph()}).setGraph(n.graph());return t(n.nodes(),(function(e){n.children(e).length||r.setNode(e,n.node(e))})),t(n.edges(),(function(e){r.setEdge(e,n.edge(e))})),r}function W(e,n){var r,t,o=e.x,i=e.y,a=n.x-o,u=n.y-i,d=e.width/2,c=e.height/2;if(!a&&!u)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(u)*d>Math.abs(a)*c?(u<0&&(c=-c),r=c*a/u,t=c):(a<0&&(d=-d),r=d,t=d*u/a),{x:o+r,y:i+t}}function H(e){var n=s(E(Q(e)+1),(function(){return[]}));return t(e.nodes(),(function(r){var t=e.node(r),i=t.rank;o(i)||(n[i][t.order]=r)})),n}function K(e,n,r,t){var o={width:0,height:0};return arguments.length>=4&&(o.rank=r,o.order=t),U(e,"border",o,n)}function Q(e){return L(s(e.nodes(),(function(n){var r=e.node(n).rank;if(!o(r))return r})))}function X(e,n){return n()}function Z(e,n,r,t,o,i){var a={width:0,height:0,rank:i,borderType:n},u=o[n][i-1],d=U(e,"border",a,r);o[n][i]=d,e.setParent(d,t),u&&e.setEdge(u,d,{weight:1})}function $(e){var n=e.graph().rankdir.toLowerCase();"bt"!==n&&"rl"!==n||function(e){t(e.nodes(),(function(n){re(e.node(n))})),t(e.edges(),(function(n){var r=e.edge(n);t(r.points,re),Object.prototype.hasOwnProperty.call(r,"y")&&re(r)}))}(e),"lr"!==n&&"rl"!==n||(!function(e){t(e.nodes(),(function(n){te(e.node(n))})),t(e.edges(),(function(n){var r=e.edge(n);t(r.points,te),Object.prototype.hasOwnProperty.call(r,"x")&&te(r)}))}(e),ee(e))}function ee(e){t(e.nodes(),(function(n){ne(e.node(n))})),t(e.edges(),(function(n){ne(e.edge(n))}))}function ne(e){var n=e.width;e.width=e.height,e.height=n}function re(e){e.y=-e.y}function te(e){var n=e.x;e.x=e.y,e.y=n}function oe(e){e.graph().dummyChains=[],t(e.edges(),(function(n){!function(e,n){var r=n.v,t=e.node(r).rank,o=n.w,i=e.node(o).rank,a=n.name,u=e.edge(n),d=u.labelRank;if(i===t+1)return;e.removeEdge(n);var c,s,f=void 0;for(s=0,++t;t<i;++s,++t)u.points=[],c=U(e,"edge",f={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},"_d"),t===d&&(f.width=u.width,f.height=u.height,f.dummy="edge-label",f.labelpos=u.labelpos),e.setEdge(r,c,{weight:u.weight},a),0===s&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,o,{weight:u.weight},a)}(e,n)}))}function ie(e){var n={};t(e.sources(),(function r(t){var o=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return o.rank;n[t]=!0;var i=f(s(e.outEdges(t),(function(n){return r(n.w)-e.edge(n).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))}function ae(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function ue(n){var r,t,o=new e({directed:!1}),i=n.nodes()[0],a=n.nodeCount();for(o.setNode(i,{});de(o,n)<a;)r=ce(o,n),t=o.hasNode(r.v)?ae(n,r):-ae(n,r),se(o,n,t);return o}function de(e,n){return t(e.nodes(),(function r(o){t(n.nodeEdges(o),(function(t){var i=t.v,a=o===i?t.w:i;e.hasNode(a)||ae(n,t)||(e.setNode(a,{}),e.setEdge(o,a,{}),r(a))}))})),e.nodeCount()}function ce(e,n){return C(n.edges(),(function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return ae(n,r)}))}function se(e,n,r){t(e.nodes(),(function(e){n.node(e).rank+=r}))}function fe(e,n,r){O(n)||(n=[n]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return t(n,(function(n){if(!e.hasNode(n))throw new Error("Graph does not have node: "+n);he(e,n,"post"===r,a,o,i)})),i}function he(e,n,r,o,i,a){Object.prototype.hasOwnProperty.call(o,n)||(o[n]=!0,r||a.push(n),t(i(n),(function(n){he(e,n,r,o,i,a)})),r&&a.push(n))}function ge(n){n=function(n){var r=(new e).setGraph(n.graph());return t(n.nodes(),(function(e){r.setNode(e,n.node(e))})),t(n.edges(),(function(e){var t=r.edge(e.v,e.w)||{weight:0,minlen:1},o=n.edge(e);r.setEdge(e.v,e.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})})),r}(n),ie(n);var r,o=ue(n);for(pe(o),ve(o,n);r=me(o);)ye(o,n,r,be(o,n,r))}function ve(e,n){var r=function(e,n){return fe(e,n,"post")}(e,e.nodes());r=r.slice(0,r.length-1),t(r,(function(r){!function(e,n,r){var t=e.node(r),o=t.parent;e.edge(r,o).cutvalue=le(e,n,r)}(e,n,r)}))}function le(e,n,r){var o=e.node(r).parent,i=!0,a=n.edge(r,o),u=0;return a||(i=!1,a=n.edge(o,r)),u=a.weight,t(n.nodeEdges(r),(function(t){var a,d,c=t.v===r,s=c?t.w:t.v;if(s!==o){var f=c===i,h=n.edge(t).weight;if(u+=f?h:-h,a=r,d=s,e.hasEdge(a,d)){var g=e.edge(r,s).cutvalue;u+=f?-g:g}}})),u}function pe(e,n){arguments.length<2&&(n=e.nodes()[0]),we(e,{},1,n)}function we(e,n,r,o,i){var a=r,u=e.node(o);return n[o]=!0,t(e.neighbors(o),(function(t){Object.prototype.hasOwnProperty.call(n,t)||(r=we(e,n,r,t,o))})),u.low=a,u.lim=r++,i?u.parent=i:delete u.parent,r}function me(e){return g(e.edges(),(function(n){return e.edge(n).cutvalue<0}))}function be(e,n,r){var t=r.v,o=r.w;n.hasEdge(t,o)||(t=r.w,o=r.v);var a=e.node(t),u=e.node(o),d=a,c=!1;return a.lim>u.lim&&(d=u,c=!0),C(i(n.edges(),(function(n){return c===xe(e,e.node(n.v),d)&&c!==xe(e,e.node(n.w),d)})),(function(e){return ae(n,e)}))}function ye(e,n,r,o){var i=r.v,a=r.w;e.removeEdge(i,a),e.setEdge(o.v,o.w,{}),pe(e),ve(e,n),function(e,n){var r=g(e.nodes(),(function(e){return!n.node(e).parent})),o=function(e,n){return fe(e,n,"pre")}(e,r);o=o.slice(1),t(o,(function(r){var t=e.node(r).parent,o=n.edge(r,t),i=!1;o||(o=n.edge(t,r),i=!0),n.node(r).rank=n.node(t).rank+(i?o.minlen:-o.minlen)}))}(e,n)}function xe(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function ke(e){switch(e.graph().ranker){case"network-simplex":default:Ne(e);break;case"tight-tree":!function(e){ie(e),ue(e)}(e);break;case"longest-path":Ee(e)}}new Error,ge.initLowLimValues=pe,ge.initCutValues=ve,ge.calcCutValue=le,ge.leaveEdge=me,ge.enterEdge=be,ge.exchangeEdges=ye;var Ee=ie;function Ne(e){ge(e)}function Oe(e){var n=U(e,"root",{},"_root"),r=function(e){var n={};function r(o,i){var a=e.children(o);a&&a.length&&t(a,(function(e){r(e,i+1)})),n[o]=i}return t(e.children(),(function(e){r(e,1)})),n}(e),o=L(a(r))-1,i=2*o+1;e.graph().nestingRoot=n,t(e.edges(),(function(n){e.edge(n).minlen*=i}));var d=function(e){return u(e.edges(),(function(n,r){return n+e.edge(r).weight}),0)}(e)+1;t(e.children(),(function(t){_e(e,n,i,d,o,r,t)})),e.graph().nodeRankFactor=i}function _e(e,n,r,o,i,a,u){var d=e.children(u);if(d.length){var c=K(e,"_bt"),s=K(e,"_bb"),f=e.node(u);e.setParent(c,u),f.borderTop=c,e.setParent(s,u),f.borderBottom=s,t(d,(function(t){_e(e,n,r,o,i,a,t);var d=e.node(t),f=d.borderTop?d.borderTop:t,h=d.borderBottom?d.borderBottom:t,g=d.borderTop?o:2*o,v=f!==h?1:i-a[u]+1;e.setEdge(c,f,{weight:g,minlen:v,nestingEdge:!0}),e.setEdge(h,s,{weight:g,minlen:v,nestingEdge:!0})})),e.parent(u)||e.setEdge(n,c,{weight:0,minlen:i+a[u]})}else u!==n&&e.setEdge(n,u,{weight:0,minlen:r})}function Ie(n,r,i){var a=function(e){var n;for(;e.hasNode(n=G("_root")););return n}(n),u=new e({compound:!0}).setGraph({root:a}).setDefaultNodeLabel((function(e){return n.node(e)}));return t(n.nodes(),(function(e){var d=n.node(e),c=n.parent(e);(d.rank===r||d.minRank<=r&&r<=d.maxRank)&&(u.setNode(e),u.setParent(e,c||a),t(n[i](e),(function(r){var t=r.v===e?r.w:r.v,i=u.edge(t,e),a=o(i)?0:i.weight;u.setEdge(t,e,{weight:n.edge(r).weight+a})})),Object.prototype.hasOwnProperty.call(d,"minRank")&&u.setNode(e,{borderLeft:d.borderLeft[r],borderRight:d.borderRight[r]}))})),u}function Pe(e,n){for(var r=0,t=1;t<n.length;++t)r+=je(e,n[t-1],n[t]);return r}function je(e,n,r){for(var o,i,a=(o=r,i=s(r,(function(e,n){return n})),function(e,n,r){for(var t=-1,o=e.length,i=n.length,a={};++t<o;){var u=t<i?n[t]:void 0;r(a,e[t],u)}return a}(o||[],i||[],x)),u=k(s(n,(function(n){return R(s(e.outEdges(n),(function(n){return{pos:a[n.w],weight:e.edge(n).weight}})),"pos")}))),d=1;d<r.length;)d<<=1;var c=2*d-1;d-=1;var f=s(new Array(c),(function(){return 0})),h=0;return t(u.forEach((function(e){var n=e.pos+d;f[n]+=e.weight;for(var r=0;n>0;)n%2&&(r+=f[n+1]),f[n=n-1>>1]+=e.weight;h+=e.weight*r}))),h}function Re(e,n){var r={};return t(e,(function(e,n){var t=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n};o(e.barycenter)||(t.barycenter=e.barycenter,t.weight=e.weight)})),t(n.edges(),(function(e){var n=r[e.v],t=r[e.w];o(n)||o(t)||(t.indegree++,n.out.push(r[e.w]))})),function(e){var n=[];function r(e){return function(n){n.merged||(o(n.barycenter)||o(e.barycenter)||n.barycenter>=e.barycenter)&&function(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight);n.weight&&(r+=n.barycenter*n.weight,t+=n.weight);e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}(e,n)}}function a(n){return function(r){r.in.push(n),0==--r.indegree&&e.push(r)}}for(;e.length;){var u=e.pop();n.push(u),t(u.in.reverse(),r(u)),t(u.out,a(u))}return s(i(n,(function(e){return!e.merged})),(function(e){return _(e,["vs","i","barycenter","weight"])}))}(i(r,(function(e){return!e.indegree})))}function Te(e,n){var r,o=function(e,n){var r={lhs:[],rhs:[]};return t(e,(function(e){n(e)?r.lhs.push(e):r.rhs.push(e)})),r}(e,(function(e){return Object.prototype.hasOwnProperty.call(e,"barycenter")})),i=o.lhs,a=R(o.rhs,(function(e){return-e.i})),u=[],d=0,c=0,s=0;i.sort((r=!!n,function(e,n){return e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:r?n.i-e.i:e.i-n.i})),s=Me(u,a,s),t(i,(function(e){s+=e.vs.length,u.push(e.vs),d+=e.barycenter*e.weight,c+=e.weight,s=Me(u,a,s)}));var f={vs:k(u)};return c&&(f.barycenter=d/c,f.weight=c),f}function Me(e,n,r){for(var t;n.length&&(t=v(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Le(e,n,r,a){var d=e.children(n),c=e.node(n),f=c?c.borderLeft:void 0,h=c?c.borderRight:void 0,g={};f&&(d=i(d,(function(e){return e!==f&&e!==h})));var v=function(e,n){return s(n,(function(n){var r=e.inEdges(n);if(r.length){var t=u(r,(function(n,r){var t=e.edge(r),o=e.node(r.v);return{sum:n.sum+t.weight*o.order,weight:n.weight+t.weight}}),{sum:0,weight:0});return{v:n,barycenter:t.sum/t.weight,weight:t.weight}}return{v:n}}))}(e,d);t(v,(function(n){if(e.children(n.v).length){var t=Le(e,n.v,r,a);g[n.v]=t,Object.prototype.hasOwnProperty.call(t,"barycenter")&&(u=t,o((i=n).barycenter)?(i.barycenter=u.barycenter,i.weight=u.weight):(i.barycenter=(i.barycenter*i.weight+u.barycenter*u.weight)/(i.weight+u.weight),i.weight+=u.weight))}var i,u}));var l=Re(v,r);!function(e,n){t(e,(function(e){e.vs=k(e.vs.map((function(e){return n[e]?n[e].vs:e})))}))}(l,g);var p=Te(l,a);if(f&&(p.vs=k([f,p.vs,h]),e.predecessors(f).length)){var w=e.node(e.predecessors(f)[0]),m=e.node(e.predecessors(h)[0]);Object.prototype.hasOwnProperty.call(p,"barycenter")||(p.barycenter=0,p.weight=0),p.barycenter=(p.barycenter*p.weight+w.order+m.order)/(p.weight+2),p.weight+=2}return p}function Ce(e){var r=Q(e),o=Se(e,E(1,r+1),"inEdges"),a=Se(e,E(r-1,-1,-1),"outEdges"),u=function(e){var n={},r=i(e.nodes(),(function(n){return!e.children(n).length})),o=L(s(r,(function(n){return e.node(n).rank}))),a=s(E(o+1),(function(){return[]})),u=R(r,(function(n){return e.node(n).rank}));return t(u,(function r(o){if(!h(n,o)){n[o]=!0;var i=e.node(o);a[i.rank].push(o),t(e.successors(o),r)}})),a}(e);Fe(e,u);for(var d,c=Number.POSITIVE_INFINITY,f=0,g=0;g<4;++f,++g){Ge(f%2?o:a,f%4>=2);var v=Pe(e,u=H(e));v<c&&(g=0,d=n(u,5),c=v)}Fe(e,d)}function Se(e,n,r){return s(n,(function(n){return Ie(e,n,r)}))}function Ge(n,r){var o=new e;t(n,(function(e){var n=e.graph().root,i=Le(e,n,o,r);t(i.vs,(function(n,r){e.node(n).order=r})),function(e,n,r){var o,i={};t(r,(function(r){for(var t,a,u=e.parent(r);u;){if((t=e.parent(u))?(a=i[t],i[t]=u):(a=o,o=u),a&&a!==u)return void n.setEdge(a,u);u=t}}))}(e,o,i.vs)}))}function Fe(e,n){t(n,(function(n){t(n,(function(n,r){e.node(n).order=r}))}))}function Ve(e){var n=function(e){var n={},r=0;function o(i){var a=r;t(e.children(i),o),n[i]={low:a,lim:r++}}return t(e.children(),o),n}(e);t(e.graph().dummyChains,(function(r){for(var t=e.node(r),o=t.edgeObj,i=function(e,n,r,t){var o,i,a=[],u=[],d=Math.min(n[r].low,n[t].low),c=Math.max(n[r].lim,n[t].lim);o=r;do{o=e.parent(o),a.push(o)}while(o&&(n[o].low>d||c>n[o].lim));i=o,o=t;for(;(o=e.parent(o))!==i;)u.push(o);return{path:a.concat(u.reverse()),lca:i}}(e,n,o.v,o.w),a=i.path,u=i.lca,d=0,c=a[d],s=!0;r!==o.w;){if(t=e.node(r),s){for(;(c=a[d])!==u&&e.node(c).maxRank<t.rank;)d++;c===u&&(s=!1)}if(!s){for(;d<a.length-1&&e.node(c=a[d+1]).minRank<=t.rank;)d++;c=a[d]}e.setParent(r,c),r=e.successors(r)[0]}}))}function Be(e,n){var r={};return u(n,(function(n,o){var i=0,a=0,u=n.length,d=v(o);return t(o,(function(n,c){var s=function(e,n){if(e.node(n).dummy)return g(e.predecessors(n),(function(n){return e.node(n).dummy}))}(e,n),f=s?e.node(s).order:u;(s||n===d)&&(t(o.slice(a,c+1),(function(n){t(e.predecessors(n),(function(t){var o=e.node(t),a=o.order;!(a<i||f<a)||o.dummy&&e.node(n).dummy||qe(r,t,n)}))})),a=c+1,i=f)})),o})),r}function qe(e,n,r){if(n>r){var t=n;n=r,r=t}var o=e[n];o||(e[n]=o={}),o[r]=!0}function Ye(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function ze(n,r,o,i,a){var u={},d=function(n,r,o,i){var a=new e,u=n.graph(),d=function(e,n,r){return function(t,o,i){var a,u=t.node(o),d=t.node(i),c=0;if(c+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(c+=r?a:-a),a=0,c+=(u.dummy?n:e)/2,c+=(d.dummy?n:e)/2,c+=d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":a=d.width/2;break;case"r":a=-d.width/2}return a&&(c+=r?a:-a),a=0,c}}(u.nodesep,u.edgesep,i);return t(r,(function(e){var r;t(e,(function(e){var t=o[e];if(a.setNode(t),r){var i=o[r],u=a.edge(i,t);a.setEdge(i,t,Math.max(d(n,e,r),u||0))}r=e}))})),a}(n,r,o,a),c=a?"borderLeft":"borderRight";function s(e,n){for(var r=d.nodes(),t=r.pop(),o={};t;)o[t]?e(t):(o[t]=!0,r.push(t),r=r.concat(n(t))),t=r.pop()}return s((function(e){u[e]=d.inEdges(e).reduce((function(e,n){return Math.max(e,u[n.v]+d.edge(n))}),0)}),d.predecessors.bind(d)),s((function(e){var r=d.outEdges(e).reduce((function(e,n){return Math.min(e,u[n.w]-d.edge(n))}),Number.POSITIVE_INFINITY),t=n.node(e);r!==Number.POSITIVE_INFINITY&&t.borderType!==c&&(u[e]=Math.max(u[e],r))}),d.successors.bind(d)),t(i,(function(e){u[e]=u[o[e]]})),u}function De(e,n){return C(a(n),(function(n){var t,o,i=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return o=function(n,r){var t=function(e,n){return e.node(n).width}(e,r)/2;i=Math.max(n+t,i),a=Math.min(n-t,a)},null==(t=n)||p(t,r(o),w),i-a}))}function Ae(e){var n,r=H(e),o=I(Be(e,r),function(e,n){var r={};function o(n,o,i,a,u){var d;t(E(o,i),(function(o){d=n[o],e.node(d).dummy&&t(e.predecessors(d),(function(n){var t=e.node(n);t.dummy&&(t.order<a||t.order>u)&&qe(r,n,d)}))}))}return u(n,(function(n,r){var i,a=-1,u=0;return t(r,(function(t,d){if("border"===e.node(t).dummy){var c=e.predecessors(t);c.length&&(i=e.node(c[0]).order,o(r,u,d,a,i),u=d,a=i)}o(r,u,r.length,i,n.length)})),r})),r}(e,r)),i={};t(["u","d"],(function(u){n="u"===u?r:a(r).reverse(),t(["l","r"],(function(r){"r"===r&&(n=s(n,(function(e){return a(e).reverse()})));var d=("u"===u?e.predecessors:e.successors).bind(e),c=function(e,n,r,o){var i={},a={},u={};return t(n,(function(e){t(e,(function(e,n){i[e]=e,a[e]=e,u[e]=n}))})),t(n,(function(e){var n=-1;t(e,(function(e){var t=o(e);if(t.length)for(var d=((t=R(t,(function(e){return u[e]}))).length-1)/2,c=Math.floor(d),s=Math.ceil(d);c<=s;++c){var f=t[c];a[e]===e&&n<u[f]&&!Ye(r,e,f)&&(a[f]=e,a[e]=i[e]=i[f],n=u[f])}}))})),{root:i,align:a}}(0,n,o,d),f=ze(e,n,c.root,c.align,"r"===r);"r"===r&&(f=M(f,(function(e){return-e}))),i[u+r]=f}))}));var d=De(e,i);return function(e,n){var r=a(n),o=f(r),i=L(r);t(["u","d"],(function(r){t(["l","r"],(function(t){var u,d=r+t,c=e[d];if(c!==n){var s=a(c);(u="l"===t?o-f(s):i-L(s))&&(e[d]=M(c,(function(e){return e+u})))}}))}))}(i,d),function(e,n){return M(e.ul,(function(r,t){if(n)return e[n.toLowerCase()][t];var o=R(s(e,t));return(o[1]+o[2])/2}))}(i,e.graph().align)}function Ue(e){var n,o;(function(e){var n=H(e),r=e.graph().ranksep,o=0;t(n,(function(n){var i=L(s(n,(function(n){return e.node(n).height})));t(n,(function(n){e.node(n).y=o+i/2})),o+=i+r}))})(e=J(e)),n=Ae(e),o=function(n,r){e.node(r).x=n},n&&P(n,r(o))}function Je(n,r){var i=X;i("layout",(()=>{var r=i(" buildLayoutGraph",(()=>function(n){var r=new e({multigraph:!0,compound:!0}),o=rn(n.graph());return r.setGraph(I({},He,nn(o,We),_(o,Ke))),t(n.nodes(),(function(e){var t=rn(n.node(e));r.setNode(e,l(nn(t,Qe),Xe)),r.setParent(e,n.parent(e))})),t(n.edges(),(function(e){var t=rn(n.edge(e));r.setEdge(e,I({},$e,nn(t,Ze),_(t,en)))})),r}(n)));i(" runLayout",(()=>function(e,n){n(" makeSpaceForEdgeLabels",(()=>function(e){var n=e.graph();n.ranksep/=2,t(e.edges(),(function(r){var t=e.edge(r);t.minlen*=2,"c"!==t.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?t.width+=t.labeloffset:t.height+=t.labeloffset)}))}(e))),n(" removeSelfEdges",(()=>function(e){t(e.edges(),(function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}}))}(e))),n(" acyclic",(()=>A(e))),n(" nestingGraph.run",(()=>Oe(e))),n(" rank",(()=>ke(J(e)))),n(" injectEdgeLabelProxies",(()=>function(e){t(e.edges(),(function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),o={rank:(e.node(n.w).rank-t.rank)/2+t.rank,e:n};U(e,"edge-proxy",o,"_ep")}}))}(e))),n(" removeEmptyRanks",(()=>function(e){var n=f(s(e.nodes(),(function(n){return e.node(n).rank}))),r=[];t(e.nodes(),(function(t){var o=e.node(t).rank-n;r[o]||(r[o]=[]),r[o].push(t)}));var i=0,a=e.graph().nodeRankFactor;t(r,(function(n,r){o(n)&&r%a!=0?--i:i&&t(n,(function(n){e.node(n).rank+=i}))}))}(e))),n(" nestingGraph.cleanup",(()=>function(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,t(e.edges(),(function(n){e.edge(n).nestingEdge&&e.removeEdge(n)}))}(e))),n(" normalizeRanks",(()=>function(e){var n=f(s(e.nodes(),(function(n){return e.node(n).rank})));t(e.nodes(),(function(r){var t=e.node(r);h(t,"rank")&&(t.rank-=n)}))}(e))),n(" assignRankMinMax",(()=>function(e){var n=0;t(e.nodes(),(function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=L(n,t.maxRank))})),e.graph().maxRank=n}(e))),n(" removeEdgeLabelProxies",(()=>function(e){t(e.nodes(),(function(n){var r=e.node(n);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))}))}(e))),n(" normalize.run",(()=>oe(e))),n(" parentDummyChains",(()=>Ve(e))),n(" addBorderSegments",(()=>function(e){t(e.children(),(function n(r){var o=e.children(r),i=e.node(r);if(o.length&&t(o,n),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,u=i.maxRank+1;a<u;++a)Z(e,"borderLeft","_bl",r,i,a),Z(e,"borderRight","_br",r,i,a)}}))}(e))),n(" order",(()=>Ce(e))),n(" insertSelfEdges",(()=>function(e){var n=H(e);t(n,(function(n){var r=0;t(n,(function(n,o){var i=e.node(n);i.order=o+r,t(i.selfEdges,(function(n){U(e,"selfedge",{width:n.label.width,height:n.label.height,rank:i.rank,order:o+ ++r,e:n.e,label:n.label},"_se")})),delete i.selfEdges}))}))}(e))),n(" adjustCoordinateSystem",(()=>function(e){var n=e.graph().rankdir.toLowerCase();"lr"!==n&&"rl"!==n||ee(e)}(e))),n(" position",(()=>Ue(e))),n(" positionSelfEdges",(()=>function(e){t(e.nodes(),(function(n){var r=e.node(n);if("selfedge"===r.dummy){var t=e.node(r.e.v),o=t.x+t.width/2,i=t.y,a=r.x-o,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:o+2*a/3,y:i-u},{x:o+5*a/6,y:i-u},{x:o+a,y:i},{x:o+5*a/6,y:i+u},{x:o+2*a/3,y:i+u}],r.label.x=r.x,r.label.y=r.y}}))}(e))),n(" removeBorderNodes",(()=>function(e){t(e.nodes(),(function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),o=e.node(r.borderBottom),i=e.node(v(r.borderLeft)),a=e.node(v(r.borderRight));r.width=Math.abs(a.x-i.x),r.height=Math.abs(o.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}})),t(e.nodes(),(function(n){"border"===e.node(n).dummy&&e.removeNode(n)}))}(e))),n(" normalize.undo",(()=>function(e){t(e.graph().dummyChains,(function(n){var r,t=e.node(n),o=t.edgeLabel;for(e.setEdge(t.edgeObj,o);t.dummy;)r=e.successors(n)[0],e.removeNode(n),o.points.push({x:t.x,y:t.y}),"edge-label"===t.dummy&&(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height),n=r,t=e.node(n)}))}(e))),n(" fixupEdgeLabelCoords",(()=>function(e){t(e.edges(),(function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}}))}(e))),n(" undoCoordinateSystem",(()=>$(e))),n(" translateGraph",(()=>function(e){var n=Number.POSITIVE_INFINITY,r=0,o=Number.POSITIVE_INFINITY,i=0,a=e.graph(),u=a.marginx||0,d=a.marginy||0;function c(e){var t=e.x,a=e.y,u=e.width,d=e.height;n=Math.min(n,t-u/2),r=Math.max(r,t+u/2),o=Math.min(o,a-d/2),i=Math.max(i,a+d/2)}t(e.nodes(),(function(n){c(e.node(n))})),t(e.edges(),(function(n){var r=e.edge(n);Object.prototype.hasOwnProperty.call(r,"x")&&c(r)})),n-=u,o-=d,t(e.nodes(),(function(r){var t=e.node(r);t.x-=n,t.y-=o})),t(e.edges(),(function(r){var i=e.edge(r);t(i.points,(function(e){e.x-=n,e.y-=o})),Object.prototype.hasOwnProperty.call(i,"x")&&(i.x-=n),Object.prototype.hasOwnProperty.call(i,"y")&&(i.y-=o)})),a.width=r-n+u,a.height=i-o+d}(e))),n(" assignNodeIntersects",(()=>function(e){t(e.edges(),(function(n){var r,t,o=e.edge(n),i=e.node(n.v),a=e.node(n.w);o.points?(r=o.points[0],t=o.points[o.points.length-1]):(o.points=[],r=a,t=i),o.points.unshift(W(i,r)),o.points.push(W(a,t))}))}(e))),n(" reversePoints",(()=>function(e){t(e.edges(),(function(n){var r=e.edge(n);r.reversed&&r.points.reverse()}))}(e))),n(" acyclic.undo",(()=>function(e){t(e.edges(),(function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}}))}(e)))}(r,i))),i(" updateInputGraph",(()=>function(e,n){t(e.nodes(),(function(r){var t=e.node(r),o=n.node(r);t&&(t.x=o.x,t.y=o.y,n.children(r).length&&(t.width=o.width,t.height=o.height))})),t(e.edges(),(function(r){var t=e.edge(r),o=n.edge(r);t.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(t.x=o.x,t.y=o.y)})),e.graph().width=n.graph().width,e.graph().height=n.graph().height}(n,r)))}))}var We=["nodesep","edgesep","ranksep","marginx","marginy"],He={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Ke=["acyclicer","ranker","rankdir","align"],Qe=["width","height"],Xe={width:0,height:0},Ze=["minlen","weight","width","height","labeloffset"],$e={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},en=["labelpos"];function nn(e,n){return M(_(e,n),Number)}function rn(e){var n={};return t(e,(function(e,r){n[r.toLowerCase()]=e})),n}export{Je as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,i as r,a as t,b as e,f as a}from"./timer-DFzT7np-.js";import{aP as i,co as u,aY as o,cp as c,cq as f,cr as s,cs as l,ct as h,cu as p,cv as m,cw as g}from"./index-
|
|
1
|
+
import{c as n,i as r,a as t,b as e,f as a}from"./timer-DFzT7np-.js";import{aP as i,co as u,aY as o,cp as c,cq as f,cr as s,cs as l,ct as h,cu as p,cv as m,cw as g}from"./index-Bsc9SEYH.js";import{i as v}from"./init-DLRA0X12.js";function y(n){return null===n?NaN:+n}function*M(n,r){if(void 0===r)for(let t of n)null!=t&&(t=+t)>=t&&(yield t);else{let t=-1;for(let e of n)null!=(e=r(e,++t,n))&&(e=+e)>=e&&(yield e)}}const N=i(u),b=N.right,w=N.left;function d(n,r){r||(r=[]);var t,e=n?Math.min(r.length,n.length):0,a=r.slice();return function(i){for(t=0;t<e;++t)a[t]=n[t]*(1-i)+r[t]*i;return a}}function A(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function k(n,r){return(A(r)?d:j)(n,r)}function j(n,r){var t,e=r?r.length:0,a=n?Math.min(e,n.length):0,i=new Array(a),u=new Array(e);for(t=0;t<a;++t)i[t]=q(n[t],r[t]);for(;t<e;++t)u[t]=r[t];return function(n){for(t=0;t<a;++t)u[t]=i[t](n);return u}}function x(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function D(n,r){var t,e={},a={};for(t in null!==n&&"object"==typeof n||(n={}),null!==r&&"object"==typeof r||(r={}),r)t in n?e[t]=q(n[t],r[t]):a[t]=r[t];return function(n){for(t in e)a[t]=e[t](n);return a}}function q(i,u){var o,c=typeof u;return null==u||"boolean"===c?n(u):("number"===c?r:"string"===c?(o=a(u))?(u=o,t):e:u instanceof a?t:u instanceof Date?x:A(u)?d:Array.isArray(u)?j:"function"!=typeof u.valueOf&&"function"!=typeof u.toString||isNaN(u)?D:r)(i,u)}function V(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function B(n){return+n}i(y).center;var F=[0,1];function O(n){return n}function P(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:(t=isNaN(r)?NaN:.5,function(){return t});var t}function R(n,r,t){var e=n[0],a=n[1],i=r[0],u=r[1];return a<e?(e=P(a,e),i=t(u,i)):(e=P(e,a),i=t(i,u)),function(n){return i(e(n))}}function S(n,r,t){var e=Math.min(n.length,r.length)-1,a=new Array(e),i=new Array(e),u=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++u<e;)a[u]=P(n[u],n[u+1]),i[u]=t(r[u],r[u+1]);return function(r){var t=b(n,r,1,e)-1;return i[t](a[t](r))}}function T(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function Y(){var n,t,e,a,i,u,o=F,c=F,f=q,s=O;function l(){var n,r,t,e=Math.min(o.length,c.length);return s!==O&&(n=o[0],r=o[e-1],n>r&&(t=n,n=r,r=t),s=function(t){return Math.max(n,Math.min(r,t))}),a=e>2?S:R,i=u=null,h}function h(r){return null==r||isNaN(r=+r)?e:(i||(i=a(o.map(n),c,f)))(n(s(r)))}return h.invert=function(e){return s(t((u||(u=a(c,o.map(n),r)))(e)))},h.domain=function(n){return arguments.length?(o=Array.from(n,B),l()):o.slice()},h.range=function(n){return arguments.length?(c=Array.from(n),l()):c.slice()},h.rangeRound=function(n){return c=Array.from(n),f=V,l()},h.clamp=function(n){return arguments.length?(s=!!n||O,l()):s!==O},h.interpolate=function(n){return arguments.length?(f=n,l()):f},h.unknown=function(n){return arguments.length?(e=n,h):e},function(r,e){return n=r,t=e,l()}}function z(){return Y()(O,O)}function C(n,r,t,e){var a,i=o(n,r,t);switch((e=c(null==e?",f":e)).type){case"s":var u=Math.max(Math.abs(n),Math.abs(r));return null!=e.precision||isNaN(a=l(i,u))||(e.precision=a),h(e,u);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(a=s(i,Math.max(Math.abs(n),Math.abs(r))))||(e.precision=a-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(a=f(i))||(e.precision=a-2*("%"===e.type))}return p(e)}function E(n){var r=n.domain;return n.ticks=function(n){var t=r();return m(t[0],t[t.length-1],null==n?10:n)},n.tickFormat=function(n,t){var e=r();return C(e[0],e[e.length-1],null==n?10:n,t)},n.nice=function(t){null==t&&(t=10);var e,a,i=r(),u=0,o=i.length-1,c=i[u],f=i[o],s=10;for(f<c&&(a=c,c=f,f=a,a=u,u=o,o=a);s-- >0;){if((a=g(c,f,t))===e)return i[u]=c,i[o]=f,r(i);if(a>0)c=Math.floor(c/a)*a,f=Math.ceil(f/a)*a;else{if(!(a<0))break;c=Math.ceil(c*a)/a,f=Math.floor(f*a)/a}e=a}return n},n}function G(){var n=z();return n.copy=function(){return T(n,G())},v.apply(n,arguments),E(n)}export{T as a,y as b,z as c,k as d,x as e,d as f,V as g,B as h,q as i,E as j,O as k,G as l,b as m,M as n,D as o,C as p,w as q,Y as t};
|