@logan-jun/cd1-rag-chat 0.5.10 → 0.5.11
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/arc-CFT_xytZ.js +1 -0
- package/dist/assets/architectureDiagram-3BPJPVTR-ByvBsL22.js +36 -0
- package/dist/assets/{blockDiagram-GPEHLZMM-DANRXetr.js → blockDiagram-GPEHLZMM-Btm_Ke5c.js} +1 -1
- package/dist/assets/{c4Diagram-AAUBKEIU-DrgTxnQJ.js → c4Diagram-AAUBKEIU-D1PwXIUY.js} +1 -1
- package/dist/assets/channel-BHjgqmHX.js +1 -0
- package/dist/assets/{chunk-2J33WTMH-UX4vU7XO.js → chunk-2J33WTMH-Dft8iKEQ.js} +1 -1
- package/dist/assets/{chunk-4BX2VUAB-DTbbI5mp.js → chunk-4BX2VUAB-UUL3gYg2.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-DhUd-rwI.js → chunk-55IACEB6-DVQh6VJ8.js} +1 -1
- package/dist/assets/{chunk-727SXJPM-DyxLTtCr.js → chunk-727SXJPM-DNEULieP.js} +3 -3
- package/dist/assets/{chunk-AQP2D5EJ-HvGaACE1.js → chunk-AQP2D5EJ-CxZiOBxr.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-CSDMOu1i.js → chunk-FMBD7UC4-Bo2Qw-qn.js} +1 -1
- package/dist/assets/{chunk-ND2GUHAM-D_Xn9g_E.js → chunk-ND2GUHAM-BWgJWd9U.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-RAexEUDp.js → chunk-QZHKN3VN-BFD90oqZ.js} +1 -1
- package/dist/assets/classDiagram-4FO5ZUOK-SHCvgtoo.js +1 -0
- package/dist/assets/classDiagram-v2-Q7XG4LA2-SHCvgtoo.js +1 -0
- package/dist/assets/cose-bilkent-S5V4N54A-UfgbNpyP.js +1 -0
- package/dist/assets/{dagre-BM42HDAG-Dp_H6uzx.js → dagre-BM42HDAG-CDSRY61_.js} +2 -2
- package/dist/assets/{diagram-2AECGRRQ-kfs4-t_c.js → diagram-2AECGRRQ-DLNRLXN9.js} +2 -2
- package/dist/assets/{diagram-5GNKFQAL-CkApSmXg.js → diagram-5GNKFQAL-ZhVzdz5U.js} +3 -3
- package/dist/assets/{diagram-KO2AKTUF-3UAu0HZx.js → diagram-KO2AKTUF-Dus82Gbx.js} +3 -3
- package/dist/assets/{diagram-LMA3HP47-Bcli4Bs5.js → diagram-LMA3HP47-BjK3snB-.js} +1 -1
- package/dist/assets/{diagram-OG6HWLK6-CqKeYZpr.js → diagram-OG6HWLK6-D1wCJO2t.js} +1 -1
- package/dist/assets/{erDiagram-TEJ5UH35-DMZ4f8DN.js → erDiagram-TEJ5UH35-BumhwA52.js} +2 -2
- package/dist/assets/{flowDiagram-I6XJVG4X-Crnn9T-Q.js → flowDiagram-I6XJVG4X-BUH6NdCy.js} +4 -4
- package/dist/assets/ganttDiagram-6RSMTGT7-xDf4u_mL.js +292 -0
- package/dist/assets/{gitGraphDiagram-PVQCEYII-DwPXrSMh.js → gitGraphDiagram-PVQCEYII-D_z5jNo3.js} +8 -8
- package/dist/assets/index-3mHyxWiR.css +1 -0
- package/dist/assets/index-BESldG3d.js +96 -0
- package/dist/assets/{infoDiagram-5YYISTIA-BufKe_rC.js → infoDiagram-5YYISTIA-thBalF-L.js} +2 -2
- package/dist/assets/{ishikawaDiagram-YF4QCWOH-Cv-ricX4.js → ishikawaDiagram-YF4QCWOH-CXHrFAsk.js} +5 -5
- package/dist/assets/{journeyDiagram-JHISSGLW-D5Y-dyVk.js → journeyDiagram-JHISSGLW-Coy771k2.js} +1 -1
- package/dist/assets/{kanban-definition-UN3LZRKU-DYXPijHD.js → kanban-definition-UN3LZRKU-CvAXBLxG.js} +7 -7
- package/dist/assets/{linear-Bf9iJcKJ.js → linear-15wisJgy.js} +1 -1
- package/dist/assets/{mermaid.core-B2ee-MXg.js → mermaid.core-BkSEtyQI.js} +5 -5
- package/dist/assets/{mindmap-definition-RKZ34NQL-DEK653KN.js → mindmap-definition-RKZ34NQL-zWB47ZHU.js} +4 -4
- package/dist/assets/{pieDiagram-4H26LBE5-CADhwU78.js → pieDiagram-4H26LBE5-CBDh9rAM.js} +3 -3
- package/dist/assets/{quadrantDiagram-W4KKPZXB-Dn-LwICz.js → quadrantDiagram-W4KKPZXB-BcyifALu.js} +3 -3
- package/dist/assets/{requirementDiagram-4Y6WPE33-UV-3sP_1.js → requirementDiagram-4Y6WPE33-DAgylyVN.js} +1 -1
- package/dist/assets/{sankeyDiagram-5OEKKPKP-CmuZaLvG.js → sankeyDiagram-5OEKKPKP-DDnS237t.js} +2 -2
- package/dist/assets/{sequenceDiagram-3UESZ5HK-BYvyLjKa.js → sequenceDiagram-3UESZ5HK-CVt5KVL0.js} +1 -1
- package/dist/assets/{stateDiagram-AJRCARHV-Bqh29P7Q.js → stateDiagram-AJRCARHV-DkwuG171.js} +1 -1
- package/dist/assets/stateDiagram-v2-BHNVJYJU-CJpsOvd5.js +1 -0
- package/dist/assets/{timeline-definition-PNZ67QCA-CT1h2EGV.js → timeline-definition-PNZ67QCA-D8ea6fyo.js} +4 -4
- package/dist/assets/{vennDiagram-CIIHVFJN-BfElMX5W.js → vennDiagram-CIIHVFJN-DVJXPk6o.js} +6 -6
- package/dist/assets/{wardley-L42UT6IY-C0nvb4--.js → wardley-L42UT6IY-BgaM4uIe.js} +1 -1
- package/dist/assets/{wardleyDiagram-YWT4CUSO-BZ0seKSD.js → wardleyDiagram-YWT4CUSO-CK6M6cI_.js} +2 -2
- package/dist/assets/{xychartDiagram-2RQKCTM6-C3xdJwTr.js → xychartDiagram-2RQKCTM6-BJyY96I0.js} +3 -3
- package/dist/index.html +2 -2
- package/package.json +4 -1
- package/dist/assets/arc-MEBDBAxN.js +0 -1
- package/dist/assets/architectureDiagram-3BPJPVTR-Ba9oqyR8.js +0 -36
- package/dist/assets/channel-D1qeoDL4.js +0 -1
- package/dist/assets/classDiagram-4FO5ZUOK-C0Nef2y_.js +0 -1
- package/dist/assets/classDiagram-v2-Q7XG4LA2-C0Nef2y_.js +0 -1
- package/dist/assets/cose-bilkent-S5V4N54A-CsIZ-97_.js +0 -1
- package/dist/assets/ganttDiagram-6RSMTGT7-CYRNJdT6.js +0 -292
- package/dist/assets/index-DE5oTAz2.js +0 -94
- package/dist/assets/index-IR1JlKJJ.css +0 -1
- package/dist/assets/stateDiagram-v2-BHNVJYJU-g8kqIKt4.js +0 -1
package/dist/assets/{sequenceDiagram-3UESZ5HK-BYvyLjKa.js → sequenceDiagram-3UESZ5HK-CVt5KVL0.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as g,b3 as er,a4 as tt,a$ as Bt,aE as st,a_ as Me,F as rr,k as ar,z as P,b2 as De,b1 as sr,b4 as ir,a2 as nr,a1 as or,a6 as cr,aD as lr,J as hr,t as dr,aZ as Vt,bl as Q,aj as j,o as mt,aN as Be,Z as Tr,a3 as Wt,ag as pr,aW as Ve}from"./mermaid.core-B2ee-MXg.js";import{d as Er,h as re,g as dt,e as ur,a as ae,b as se}from"./chunk-ND2GUHAM-D_Xn9g_E.js";import{I as fr}from"./chunk-QZHKN3VN-RAexEUDp.js";import"./index-DE5oTAz2.js";var jt=function(){var r=g(function(ut,N,v,k){for(v=v||{},k=ut.length;k--;v[ut[k]]=N);return v},"o"),t=[1,2],a=[1,3],e=[1,4],i=[2,4],n=[1,9],s=[1,11],o=[1,12],E=[1,14],d=[1,15],c=[1,17],x=[1,18],u=[1,19],O=[1,25],p=[1,26],f=[1,27],_=[1,28],I=[1,29],L=[1,30],b=[1,31],m=[1,32],S=[1,33],w=[1,34],M=[1,35],B=[1,36],q=[1,37],Y=[1,38],W=[1,39],K=[1,40],J=[1,42],F=[1,43],it=[1,44],et=[1,45],nt=[1,46],H=[1,47],C=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],Pt=[1,74],A=[1,80],D=[1,81],rt=[1,82],$=[1,83],z=[1,84],ie=[1,85],ne=[1,86],oe=[1,87],ce=[1,88],le=[1,89],he=[1,90],de=[1,91],Te=[1,92],pe=[1,93],Ee=[1,94],ue=[1,95],fe=[1,96],_e=[1,97],ge=[1,98],xe=[1,99],Ie=[1,100],ye=[1,101],Re=[1,102],Oe=[1,103],Le=[1,104],be=[1,105],Ae=[2,78],St=[4,5,17,51,53,54],kt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],zt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],we=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ut=[5,52],U=[70,71,72,73],ct=[1,151],Gt={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:g(function(N,v,k,y,X,l,wt){var T=l.length-1;switch(X){case 3:return y.apply(l[T]),l[T];case 4:case 10:this.$=[];break;case 5:case 11:l[T-1].push(l[T]),this.$=l[T-1];break;case 6:case 7:case 12:case 13:this.$=l[T];break;case 8:case 9:case 14:this.$=[];break;case 16:l[T].type="createParticipant",this.$=l[T];break;case 17:l[T-1].unshift({type:"boxStart",boxData:y.parseBoxData(l[T-2])}),l[T-1].push({type:"boxEnd",boxText:l[T-2]}),this.$=l[T-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(l[T-2]),sequenceIndexStep:Number(l[T-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(l[T-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:y.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:l[T-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:l[T-1].actor};break;case 30:y.setDiagramTitle(l[T].substring(6)),this.$=l[T].substring(6);break;case 31:y.setDiagramTitle(l[T].substring(7)),this.$=l[T].substring(7);break;case 32:this.$=l[T].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=l[T].trim(),y.setAccDescription(this.$);break;case 35:l[T-1].unshift({type:"loopStart",loopText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.LOOP_START}),l[T-1].push({type:"loopEnd",loopText:l[T-2],signalType:y.LINETYPE.LOOP_END}),this.$=l[T-1];break;case 36:l[T-1].unshift({type:"rectStart",color:y.parseMessage(l[T-2]),signalType:y.LINETYPE.RECT_START}),l[T-1].push({type:"rectEnd",color:y.parseMessage(l[T-2]),signalType:y.LINETYPE.RECT_END}),this.$=l[T-1];break;case 37:l[T-1].unshift({type:"optStart",optText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.OPT_START}),l[T-1].push({type:"optEnd",optText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.OPT_END}),this.$=l[T-1];break;case 38:l[T-1].unshift({type:"altStart",altText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.ALT_START}),l[T-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=l[T-1];break;case 39:l[T-1].unshift({type:"parStart",parText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.PAR_START}),l[T-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=l[T-1];break;case 40:l[T-1].unshift({type:"parStart",parText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.PAR_OVER_START}),l[T-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=l[T-1];break;case 41:l[T-1].unshift({type:"criticalStart",criticalText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.CRITICAL_START}),l[T-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=l[T-1];break;case 42:l[T-1].unshift({type:"breakStart",breakText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.BREAK_START}),l[T-1].push({type:"breakEnd",optText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.BREAK_END}),this.$=l[T-1];break;case 44:this.$=l[T-3].concat([{type:"option",optionText:y.parseMessage(l[T-1]),signalType:y.LINETYPE.CRITICAL_OPTION},l[T]]);break;case 46:this.$=l[T-3].concat([{type:"and",parText:y.parseMessage(l[T-1]),signalType:y.LINETYPE.PAR_AND},l[T]]);break;case 48:this.$=l[T-3].concat([{type:"else",altText:y.parseMessage(l[T-1]),signalType:y.LINETYPE.ALT_ELSE},l[T]]);break;case 49:l[T-3].draw="participant",l[T-3].type="addParticipant",l[T-3].description=y.parseMessage(l[T-1]),this.$=l[T-3];break;case 50:l[T-1].draw="participant",l[T-1].type="addParticipant",this.$=l[T-1];break;case 51:l[T-3].draw="actor",l[T-3].type="addParticipant",l[T-3].description=y.parseMessage(l[T-1]),this.$=l[T-3];break;case 52:case 57:l[T-1].draw="actor",l[T-1].type="addParticipant",this.$=l[T-1];break;case 53:l[T-1].type="destroyParticipant",this.$=l[T-1];break;case 54:l[T-3].draw="participant",l[T-3].type="addParticipant",l[T-3].description=y.parseMessage(l[T-1]),this.$=l[T-3];break;case 55:l[T-1].draw="participant",l[T-1].type="addParticipant",this.$=l[T-1];break;case 56:l[T-3].draw="actor",l[T-3].type="addParticipant",l[T-3].description=y.parseMessage(l[T-1]),this.$=l[T-3];break;case 58:this.$=[l[T-1],{type:"addNote",placement:l[T-2],actor:l[T-1].actor,text:l[T]}];break;case 59:l[T-2]=[].concat(l[T-1],l[T-1]).slice(0,2),l[T-2][0]=l[T-2][0].actor,l[T-2][1]=l[T-2][1].actor,this.$=[l[T-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:l[T-2].slice(0,2),text:l[T]}];break;case 60:this.$=[l[T-1],{type:"addLinks",actor:l[T-1].actor,text:l[T]}];break;case 61:this.$=[l[T-1],{type:"addALink",actor:l[T-1].actor,text:l[T]}];break;case 62:this.$=[l[T-1],{type:"addProperties",actor:l[T-1].actor,text:l[T]}];break;case 63:this.$=[l[T-1],{type:"addDetails",actor:l[T-1].actor,text:l[T]}];break;case 66:this.$=[l[T-2],l[T]];break;case 67:this.$=l[T];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[l[T-4],l[T-1],{type:"addMessage",from:l[T-4].actor,to:l[T-1].actor,signalType:l[T-3],msg:l[T],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:l[T-1].actor}];break;case 71:this.$=[l[T-4],l[T-1],{type:"addMessage",from:l[T-4].actor,to:l[T-1].actor,signalType:l[T-3],msg:l[T]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:l[T-4].actor}];break;case 72:this.$=[l[T-4],l[T-1],{type:"addMessage",from:l[T-4].actor,to:l[T-1].actor,signalType:l[T-3],msg:l[T],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:l[T-1].actor}];break;case 73:this.$=[l[T-4],l[T-1],{type:"addMessage",from:l[T-4].actor,to:l[T-1].actor,signalType:l[T-2],msg:l[T],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:l[T-4].actor}];break;case 74:this.$=[l[T-5],l[T-1],{type:"addMessage",from:l[T-5].actor,to:l[T-1].actor,signalType:l[T-3],msg:l[T],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:l[T-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:l[T-5].actor}];break;case 75:this.$=[l[T-3],l[T-1],{type:"addMessage",from:l[T-3].actor,to:l[T-1].actor,signalType:l[T-2],msg:l[T]}];break;case 76:this.$={type:"addParticipant",actor:l[T-1],config:l[T]};break;case 77:this.$=l[T-1].trim();break;case 78:this.$={type:"addParticipant",actor:l[T]};break;case 79:this.$=y.LINETYPE.SOLID_OPEN;break;case 80:this.$=y.LINETYPE.DOTTED_OPEN;break;case 81:this.$=y.LINETYPE.SOLID;break;case 82:this.$=y.LINETYPE.SOLID_TOP;break;case 83:this.$=y.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=y.LINETYPE.STICK_TOP;break;case 85:this.$=y.LINETYPE.STICK_BOTTOM;break;case 86:this.$=y.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=y.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=y.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=y.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=y.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=y.LINETYPE.DOTTED;break;case 100:this.$=y.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=y.LINETYPE.SOLID_CROSS;break;case 102:this.$=y.LINETYPE.DOTTED_CROSS;break;case 103:this.$=y.LINETYPE.SOLID_POINT;break;case 104:this.$=y.LINETYPE.DOTTED_POINT;break;case 105:this.$=y.parseMessage(l[T].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:e},{1:[3]},{3:5,4:t,5:a,6:e},{3:6,4:t,5:a,6:e},r([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},r(C,[2,5]),{9:48,13:13,14:E,15:d,18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},r(C,[2,7]),r(C,[2,8]),r(C,[2,9]),r(C,[2,15]),{13:49,51:Y,53:W,54:K},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:H},{23:56,73:H},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},r(C,[2,30]),r(C,[2,31]),{33:[1,62]},{35:[1,63]},r(C,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:Pt},{23:75,55:76,73:Pt},{23:77,73:H},{69:78,72:[1,79],78:A,79:D,80:rt,81:$,82:z,83:ie,84:ne,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:H},{23:111,73:H},{23:112,73:H},{23:113,73:H},r([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],Ae),r(C,[2,6]),r(C,[2,16]),r(St,[2,10],{11:114}),r(C,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},r(C,[2,22]),{5:[1,118]},{5:[1,119]},r(C,[2,25]),r(C,[2,26]),r(C,[2,27]),r(C,[2,28]),r(C,[2,29]),r(C,[2,32]),r(C,[2,33]),r(kt,i,{7:120}),r(kt,i,{7:121}),r(kt,i,{7:122}),r(Se,i,{41:123,7:124}),r(zt,i,{43:125,7:126}),r(zt,i,{7:126,43:127}),r(we,i,{46:128,7:129}),r(kt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},r(Ut,Ae,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:H},{69:146,78:A,79:D,80:rt,81:$,82:z,83:ie,84:ne,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},r(U,[2,79]),r(U,[2,80]),r(U,[2,81]),r(U,[2,82]),r(U,[2,83]),r(U,[2,84]),r(U,[2,85]),r(U,[2,86]),r(U,[2,87]),r(U,[2,88]),r(U,[2,89]),r(U,[2,90]),r(U,[2,91]),r(U,[2,92]),r(U,[2,93]),r(U,[2,94]),r(U,[2,95]),r(U,[2,96]),r(U,[2,97]),r(U,[2,98]),r(U,[2,99]),r(U,[2,100]),r(U,[2,101]),r(U,[2,102]),r(U,[2,103]),r(U,[2,104]),{23:147,73:H},{23:149,60:148,73:H},{73:[2,68]},{73:[2,69]},{58:150,104:ct},{58:152,104:ct},{58:153,104:ct},{58:154,104:ct},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:Y,53:W,54:K},{5:[1,160]},r(C,[2,20]),r(C,[2,21]),r(C,[2,23]),r(C,[2,24]),{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[1,161],18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[1,162],18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[1,163],18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},{17:[1,164]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[2,47],18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,50:[1,165],51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},{17:[1,166]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[2,45],18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,49:[1,167],51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},{17:[1,168]},{17:[1,169]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[2,43],18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,48:[1,170],51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[1,171],18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},{16:[1,172]},r(C,[2,50]),{16:[1,173]},r(C,[2,55]),r(Ut,[2,76]),{76:[1,174]},{16:[1,175]},r(C,[2,52]),{16:[1,176]},r(C,[2,57]),r(C,[2,53]),{23:177,73:H},{23:178,73:H},{23:179,73:H},{58:180,104:ct},{23:181,72:[1,182],73:H},{58:183,104:ct},{58:184,104:ct},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},r(C,[2,17]),r(St,[2,11]),{13:186,51:Y,53:W,54:K},r(St,[2,13]),r(St,[2,14]),r(C,[2,19]),r(C,[2,35]),r(C,[2,36]),r(C,[2,37]),r(C,[2,38]),{16:[1,187]},r(C,[2,39]),{16:[1,188]},r(C,[2,40]),r(C,[2,41]),{16:[1,189]},r(C,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ct},{58:196,104:ct},{58:197,104:ct},{5:[2,75]},{58:198,104:ct},{23:199,73:H},{5:[2,58]},{5:[2,59]},{23:200,73:H},r(St,[2,12]),r(Se,i,{7:124,41:201}),r(zt,i,{7:126,43:202}),r(we,i,{7:129,46:203}),r(C,[2,49]),r(C,[2,54]),r(Ut,[2,77]),r(C,[2,51]),r(C,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ct},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:g(function(N,v){if(v.recoverable)this.trace(N);else{var k=new Error(N);throw k.hash=v,k}},"parseError"),parse:g(function(N){var v=this,k=[0],y=[],X=[null],l=[],wt=this.table,T="",vt=0,Ne=0,Qe=2,me=1,$e=l.slice.call(arguments,1),Z=Object.create(this.lexer),gt={yy:{}};for(var Xt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Xt)&&(gt.yy[Xt]=this.yy[Xt]);Z.setInput(N,gt.yy),gt.yy.lexer=Z,gt.yy.parser=this,typeof Z.yylloc=="undefined"&&(Z.yylloc={});var Jt=Z.yylloc;l.push(Jt);var je=Z.options&&Z.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tr(ot){k.length=k.length-2*ot,X.length=X.length-ot,l.length=l.length-ot}g(tr,"popStack");function Pe(){var ot;return ot=y.pop()||Z.lex()||me,typeof ot!="number"&&(ot instanceof Array&&(y=ot,ot=y.pop()),ot=v.symbols_[ot]||ot),ot}g(Pe,"lex");for(var at,xt,lt,Zt,Ot={},Ct,Tt,ke,Mt;;){if(xt=k[k.length-1],this.defaultActions[xt]?lt=this.defaultActions[xt]:((at===null||typeof at=="undefined")&&(at=Pe()),lt=wt[xt]&&wt[xt][at]),typeof lt=="undefined"||!lt.length||!lt[0]){var Qt="";Mt=[];for(Ct in wt[xt])this.terminals_[Ct]&&Ct>Qe&&Mt.push("'"+this.terminals_[Ct]+"'");Z.showPosition?Qt="Parse error on line "+(vt+1)+`:
|
|
1
|
+
import{b as g,b1 as er,a3 as tt,aZ as Bt,aC as st,aY as Me,E as rr,k as ar,z as P,b0 as De,a$ as sr,b2 as ir,a1 as nr,a0 as or,a4 as cr,aB as lr,J as hr,t as dr,aX as Vt,bj as Q,ah as j,o as mt,aL as Be,Z as Tr,a2 as Wt,ae as pr,aU as Ve}from"./mermaid.core-BkSEtyQI.js";import{d as Er,h as re,g as dt,e as ur,a as ae,b as se}from"./chunk-ND2GUHAM-BWgJWd9U.js";import{I as fr}from"./chunk-QZHKN3VN-BFD90oqZ.js";import"./index-BESldG3d.js";var jt=function(){var r=g(function(ut,N,v,k){for(v=v||{},k=ut.length;k--;v[ut[k]]=N);return v},"o"),t=[1,2],a=[1,3],e=[1,4],i=[2,4],n=[1,9],s=[1,11],o=[1,12],E=[1,14],d=[1,15],c=[1,17],x=[1,18],u=[1,19],O=[1,25],p=[1,26],f=[1,27],_=[1,28],I=[1,29],L=[1,30],b=[1,31],m=[1,32],S=[1,33],w=[1,34],M=[1,35],B=[1,36],q=[1,37],Y=[1,38],W=[1,39],K=[1,40],J=[1,42],F=[1,43],it=[1,44],et=[1,45],nt=[1,46],H=[1,47],C=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],Pt=[1,74],A=[1,80],D=[1,81],rt=[1,82],$=[1,83],z=[1,84],ie=[1,85],ne=[1,86],oe=[1,87],ce=[1,88],le=[1,89],he=[1,90],de=[1,91],Te=[1,92],pe=[1,93],Ee=[1,94],ue=[1,95],fe=[1,96],_e=[1,97],ge=[1,98],xe=[1,99],Ie=[1,100],ye=[1,101],Re=[1,102],Oe=[1,103],Le=[1,104],be=[1,105],Ae=[2,78],St=[4,5,17,51,53,54],kt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],zt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],we=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ut=[5,52],U=[70,71,72,73],ct=[1,151],Gt={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:g(function(N,v,k,y,X,l,wt){var T=l.length-1;switch(X){case 3:return y.apply(l[T]),l[T];case 4:case 10:this.$=[];break;case 5:case 11:l[T-1].push(l[T]),this.$=l[T-1];break;case 6:case 7:case 12:case 13:this.$=l[T];break;case 8:case 9:case 14:this.$=[];break;case 16:l[T].type="createParticipant",this.$=l[T];break;case 17:l[T-1].unshift({type:"boxStart",boxData:y.parseBoxData(l[T-2])}),l[T-1].push({type:"boxEnd",boxText:l[T-2]}),this.$=l[T-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(l[T-2]),sequenceIndexStep:Number(l[T-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(l[T-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:y.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:l[T-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:l[T-1].actor};break;case 30:y.setDiagramTitle(l[T].substring(6)),this.$=l[T].substring(6);break;case 31:y.setDiagramTitle(l[T].substring(7)),this.$=l[T].substring(7);break;case 32:this.$=l[T].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=l[T].trim(),y.setAccDescription(this.$);break;case 35:l[T-1].unshift({type:"loopStart",loopText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.LOOP_START}),l[T-1].push({type:"loopEnd",loopText:l[T-2],signalType:y.LINETYPE.LOOP_END}),this.$=l[T-1];break;case 36:l[T-1].unshift({type:"rectStart",color:y.parseMessage(l[T-2]),signalType:y.LINETYPE.RECT_START}),l[T-1].push({type:"rectEnd",color:y.parseMessage(l[T-2]),signalType:y.LINETYPE.RECT_END}),this.$=l[T-1];break;case 37:l[T-1].unshift({type:"optStart",optText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.OPT_START}),l[T-1].push({type:"optEnd",optText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.OPT_END}),this.$=l[T-1];break;case 38:l[T-1].unshift({type:"altStart",altText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.ALT_START}),l[T-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=l[T-1];break;case 39:l[T-1].unshift({type:"parStart",parText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.PAR_START}),l[T-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=l[T-1];break;case 40:l[T-1].unshift({type:"parStart",parText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.PAR_OVER_START}),l[T-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=l[T-1];break;case 41:l[T-1].unshift({type:"criticalStart",criticalText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.CRITICAL_START}),l[T-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=l[T-1];break;case 42:l[T-1].unshift({type:"breakStart",breakText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.BREAK_START}),l[T-1].push({type:"breakEnd",optText:y.parseMessage(l[T-2]),signalType:y.LINETYPE.BREAK_END}),this.$=l[T-1];break;case 44:this.$=l[T-3].concat([{type:"option",optionText:y.parseMessage(l[T-1]),signalType:y.LINETYPE.CRITICAL_OPTION},l[T]]);break;case 46:this.$=l[T-3].concat([{type:"and",parText:y.parseMessage(l[T-1]),signalType:y.LINETYPE.PAR_AND},l[T]]);break;case 48:this.$=l[T-3].concat([{type:"else",altText:y.parseMessage(l[T-1]),signalType:y.LINETYPE.ALT_ELSE},l[T]]);break;case 49:l[T-3].draw="participant",l[T-3].type="addParticipant",l[T-3].description=y.parseMessage(l[T-1]),this.$=l[T-3];break;case 50:l[T-1].draw="participant",l[T-1].type="addParticipant",this.$=l[T-1];break;case 51:l[T-3].draw="actor",l[T-3].type="addParticipant",l[T-3].description=y.parseMessage(l[T-1]),this.$=l[T-3];break;case 52:case 57:l[T-1].draw="actor",l[T-1].type="addParticipant",this.$=l[T-1];break;case 53:l[T-1].type="destroyParticipant",this.$=l[T-1];break;case 54:l[T-3].draw="participant",l[T-3].type="addParticipant",l[T-3].description=y.parseMessage(l[T-1]),this.$=l[T-3];break;case 55:l[T-1].draw="participant",l[T-1].type="addParticipant",this.$=l[T-1];break;case 56:l[T-3].draw="actor",l[T-3].type="addParticipant",l[T-3].description=y.parseMessage(l[T-1]),this.$=l[T-3];break;case 58:this.$=[l[T-1],{type:"addNote",placement:l[T-2],actor:l[T-1].actor,text:l[T]}];break;case 59:l[T-2]=[].concat(l[T-1],l[T-1]).slice(0,2),l[T-2][0]=l[T-2][0].actor,l[T-2][1]=l[T-2][1].actor,this.$=[l[T-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:l[T-2].slice(0,2),text:l[T]}];break;case 60:this.$=[l[T-1],{type:"addLinks",actor:l[T-1].actor,text:l[T]}];break;case 61:this.$=[l[T-1],{type:"addALink",actor:l[T-1].actor,text:l[T]}];break;case 62:this.$=[l[T-1],{type:"addProperties",actor:l[T-1].actor,text:l[T]}];break;case 63:this.$=[l[T-1],{type:"addDetails",actor:l[T-1].actor,text:l[T]}];break;case 66:this.$=[l[T-2],l[T]];break;case 67:this.$=l[T];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[l[T-4],l[T-1],{type:"addMessage",from:l[T-4].actor,to:l[T-1].actor,signalType:l[T-3],msg:l[T],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:l[T-1].actor}];break;case 71:this.$=[l[T-4],l[T-1],{type:"addMessage",from:l[T-4].actor,to:l[T-1].actor,signalType:l[T-3],msg:l[T]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:l[T-4].actor}];break;case 72:this.$=[l[T-4],l[T-1],{type:"addMessage",from:l[T-4].actor,to:l[T-1].actor,signalType:l[T-3],msg:l[T],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:l[T-1].actor}];break;case 73:this.$=[l[T-4],l[T-1],{type:"addMessage",from:l[T-4].actor,to:l[T-1].actor,signalType:l[T-2],msg:l[T],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:l[T-4].actor}];break;case 74:this.$=[l[T-5],l[T-1],{type:"addMessage",from:l[T-5].actor,to:l[T-1].actor,signalType:l[T-3],msg:l[T],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:l[T-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:l[T-5].actor}];break;case 75:this.$=[l[T-3],l[T-1],{type:"addMessage",from:l[T-3].actor,to:l[T-1].actor,signalType:l[T-2],msg:l[T]}];break;case 76:this.$={type:"addParticipant",actor:l[T-1],config:l[T]};break;case 77:this.$=l[T-1].trim();break;case 78:this.$={type:"addParticipant",actor:l[T]};break;case 79:this.$=y.LINETYPE.SOLID_OPEN;break;case 80:this.$=y.LINETYPE.DOTTED_OPEN;break;case 81:this.$=y.LINETYPE.SOLID;break;case 82:this.$=y.LINETYPE.SOLID_TOP;break;case 83:this.$=y.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=y.LINETYPE.STICK_TOP;break;case 85:this.$=y.LINETYPE.STICK_BOTTOM;break;case 86:this.$=y.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=y.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=y.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=y.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=y.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=y.LINETYPE.DOTTED;break;case 100:this.$=y.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=y.LINETYPE.SOLID_CROSS;break;case 102:this.$=y.LINETYPE.DOTTED_CROSS;break;case 103:this.$=y.LINETYPE.SOLID_POINT;break;case 104:this.$=y.LINETYPE.DOTTED_POINT;break;case 105:this.$=y.parseMessage(l[T].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:e},{1:[3]},{3:5,4:t,5:a,6:e},{3:6,4:t,5:a,6:e},r([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},r(C,[2,5]),{9:48,13:13,14:E,15:d,18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},r(C,[2,7]),r(C,[2,8]),r(C,[2,9]),r(C,[2,15]),{13:49,51:Y,53:W,54:K},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:H},{23:56,73:H},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},r(C,[2,30]),r(C,[2,31]),{33:[1,62]},{35:[1,63]},r(C,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:Pt},{23:75,55:76,73:Pt},{23:77,73:H},{69:78,72:[1,79],78:A,79:D,80:rt,81:$,82:z,83:ie,84:ne,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:H},{23:111,73:H},{23:112,73:H},{23:113,73:H},r([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],Ae),r(C,[2,6]),r(C,[2,16]),r(St,[2,10],{11:114}),r(C,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},r(C,[2,22]),{5:[1,118]},{5:[1,119]},r(C,[2,25]),r(C,[2,26]),r(C,[2,27]),r(C,[2,28]),r(C,[2,29]),r(C,[2,32]),r(C,[2,33]),r(kt,i,{7:120}),r(kt,i,{7:121}),r(kt,i,{7:122}),r(Se,i,{41:123,7:124}),r(zt,i,{43:125,7:126}),r(zt,i,{7:126,43:127}),r(we,i,{46:128,7:129}),r(kt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},r(Ut,Ae,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:H},{69:146,78:A,79:D,80:rt,81:$,82:z,83:ie,84:ne,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},r(U,[2,79]),r(U,[2,80]),r(U,[2,81]),r(U,[2,82]),r(U,[2,83]),r(U,[2,84]),r(U,[2,85]),r(U,[2,86]),r(U,[2,87]),r(U,[2,88]),r(U,[2,89]),r(U,[2,90]),r(U,[2,91]),r(U,[2,92]),r(U,[2,93]),r(U,[2,94]),r(U,[2,95]),r(U,[2,96]),r(U,[2,97]),r(U,[2,98]),r(U,[2,99]),r(U,[2,100]),r(U,[2,101]),r(U,[2,102]),r(U,[2,103]),r(U,[2,104]),{23:147,73:H},{23:149,60:148,73:H},{73:[2,68]},{73:[2,69]},{58:150,104:ct},{58:152,104:ct},{58:153,104:ct},{58:154,104:ct},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:Y,53:W,54:K},{5:[1,160]},r(C,[2,20]),r(C,[2,21]),r(C,[2,23]),r(C,[2,24]),{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[1,161],18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[1,162],18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[1,163],18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},{17:[1,164]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[2,47],18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,50:[1,165],51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},{17:[1,166]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[2,45],18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,49:[1,167],51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},{17:[1,168]},{17:[1,169]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[2,43],18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,48:[1,170],51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:d,17:[1,171],18:16,19:c,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:m,40:S,42:w,44:M,45:B,47:q,51:Y,53:W,54:K,56:J,61:F,62:it,63:et,64:nt,73:H},{16:[1,172]},r(C,[2,50]),{16:[1,173]},r(C,[2,55]),r(Ut,[2,76]),{76:[1,174]},{16:[1,175]},r(C,[2,52]),{16:[1,176]},r(C,[2,57]),r(C,[2,53]),{23:177,73:H},{23:178,73:H},{23:179,73:H},{58:180,104:ct},{23:181,72:[1,182],73:H},{58:183,104:ct},{58:184,104:ct},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},r(C,[2,17]),r(St,[2,11]),{13:186,51:Y,53:W,54:K},r(St,[2,13]),r(St,[2,14]),r(C,[2,19]),r(C,[2,35]),r(C,[2,36]),r(C,[2,37]),r(C,[2,38]),{16:[1,187]},r(C,[2,39]),{16:[1,188]},r(C,[2,40]),r(C,[2,41]),{16:[1,189]},r(C,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ct},{58:196,104:ct},{58:197,104:ct},{5:[2,75]},{58:198,104:ct},{23:199,73:H},{5:[2,58]},{5:[2,59]},{23:200,73:H},r(St,[2,12]),r(Se,i,{7:124,41:201}),r(zt,i,{7:126,43:202}),r(we,i,{7:129,46:203}),r(C,[2,49]),r(C,[2,54]),r(Ut,[2,77]),r(C,[2,51]),r(C,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ct},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:g(function(N,v){if(v.recoverable)this.trace(N);else{var k=new Error(N);throw k.hash=v,k}},"parseError"),parse:g(function(N){var v=this,k=[0],y=[],X=[null],l=[],wt=this.table,T="",vt=0,Ne=0,Qe=2,me=1,$e=l.slice.call(arguments,1),Z=Object.create(this.lexer),gt={yy:{}};for(var Xt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Xt)&&(gt.yy[Xt]=this.yy[Xt]);Z.setInput(N,gt.yy),gt.yy.lexer=Z,gt.yy.parser=this,typeof Z.yylloc=="undefined"&&(Z.yylloc={});var Jt=Z.yylloc;l.push(Jt);var je=Z.options&&Z.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tr(ot){k.length=k.length-2*ot,X.length=X.length-ot,l.length=l.length-ot}g(tr,"popStack");function Pe(){var ot;return ot=y.pop()||Z.lex()||me,typeof ot!="number"&&(ot instanceof Array&&(y=ot,ot=y.pop()),ot=v.symbols_[ot]||ot),ot}g(Pe,"lex");for(var at,xt,lt,Zt,Ot={},Ct,Tt,ke,Mt;;){if(xt=k[k.length-1],this.defaultActions[xt]?lt=this.defaultActions[xt]:((at===null||typeof at=="undefined")&&(at=Pe()),lt=wt[xt]&&wt[xt][at]),typeof lt=="undefined"||!lt.length||!lt[0]){var Qt="";Mt=[];for(Ct in wt[xt])this.terminals_[Ct]&&Ct>Qe&&Mt.push("'"+this.terminals_[Ct]+"'");Z.showPosition?Qt="Parse error on line "+(vt+1)+`:
|
|
2
2
|
`+Z.showPosition()+`
|
|
3
3
|
Expecting `+Mt.join(", ")+", got '"+(this.terminals_[at]||at)+"'":Qt="Parse error on line "+(vt+1)+": Unexpected "+(at==me?"end of input":"'"+(this.terminals_[at]||at)+"'"),this.parseError(Qt,{text:Z.match,token:this.terminals_[at]||at,line:Z.yylineno,loc:Jt,expected:Mt})}if(lt[0]instanceof Array&<.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xt+", token: "+at);switch(lt[0]){case 1:k.push(at),X.push(Z.yytext),l.push(Z.yylloc),k.push(lt[1]),at=null,Ne=Z.yyleng,T=Z.yytext,vt=Z.yylineno,Jt=Z.yylloc;break;case 2:if(Tt=this.productions_[lt[1]][1],Ot.$=X[X.length-Tt],Ot._$={first_line:l[l.length-(Tt||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(Tt||1)].first_column,last_column:l[l.length-1].last_column},je&&(Ot._$.range=[l[l.length-(Tt||1)].range[0],l[l.length-1].range[1]]),Zt=this.performAction.apply(Ot,[T,Ne,vt,gt.yy,lt[1],X,l].concat($e)),typeof Zt!="undefined")return Zt;Tt&&(k=k.slice(0,-1*Tt*2),X=X.slice(0,-1*Tt),l=l.slice(0,-1*Tt)),k.push(this.productions_[lt[1]][0]),X.push(Ot.$),l.push(Ot._$),ke=wt[k[k.length-2]][k[k.length-1]],k.push(ke);break;case 3:return!0}}return!0},"parse")},Ze=function(){var ut={EOF:1,parseError:g(function(v,k){if(this.yy.parser)this.yy.parser.parseError(v,k);else throw new Error(v)},"parseError"),setInput:g(function(N,v){return this.yy=v||this.yy||{},this._input=N,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:g(function(){var N=this._input[0];this.yytext+=N,this.yyleng++,this.offset++,this.match+=N,this.matched+=N;var v=N.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),N},"input"),unput:g(function(N){var v=N.length,k=N.split(/(?:\r\n?|\n)/g);this._input=N+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var y=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),k.length-1&&(this.yylineno-=k.length-1);var X=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:k?(k.length===y.length?this.yylloc.first_column:0)+y[y.length-k.length].length-k[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[X[0],X[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(N){this.unput(this.match.slice(N))},"less"),pastInput:g(function(){var N=this.matched.substr(0,this.matched.length-this.match.length);return(N.length>20?"...":"")+N.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var N=this.match;return N.length<20&&(N+=this._input.substr(0,20-N.length)),(N.substr(0,20)+(N.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var N=this.pastInput(),v=new Array(N.length+1).join("-");return N+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as R,s as W,S as N}from"./chunk-AQP2D5EJ-HvGaACE1.js";import{b as f,a4 as t,a$ as H,aE as S,F as P,z,aB as U,L as _,ag as C,bl as F}from"./mermaid.core-B2ee-MXg.js";import{G as O}from"./graph-BB0J4w4c.js";import{l as J}from"./layout-X4aHIIHH.js";import"./chunk-55IACEB6-DhUd-rwI.js";import"./chunk-2J33WTMH-UX4vU7XO.js";import"./index-DE5oTAz2.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),$=f((e,i)=>{const d=f(function(o,B,y){const E=o.append("tspan").attr("x",2*t().state.padding).text(B);y||E.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),I=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)<c&&x>p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&$(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=U().x(function(s){return s.x}).y(function(s){return s.y}).curve(_),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=F.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,E=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),E=Math.min(E,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,E=B*1.75;P(s,y,E,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new O({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){m=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:m?1:b.edgeLengthFactor,nodeSep:m?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:m?1:b.edgeLengthFactor,nodeSep:m?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const x=p.db.getStates(),g=p.db.getRelations(),o=Object.keys(x);for(const r of o){const u=x[r];d&&(u.parentId=d);let h;if(u.doc){let w=i.append("g").attr("id",u.id).attr("class","stateGroup");h=A(u.doc,w,u.id,!c,n,l,p);{w=I(w,u,c);let v=w.node().getBBox();h.width=v.width,h.height=v.height+b.padding/2,T[u.id]={y:b.compositTitleSize}}}else h=L(i,u,a);if(u.note){const w={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},v=L(i,w,a);u.note.position==="left of"?(a.setNode(h.id+"-note",v),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",v)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let B=0;g.forEach(function(r){B++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:b.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+B)}),J(a),S.debug("Graph after layout",a.nodes());const y=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+y.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+y.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),l.querySelectorAll("#"+y.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let v=0,M=0;w&&(w.parentElement&&(v=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",v-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let E=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),E=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=E.width+2*b.padding,k.height=E.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},lt={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{lt as diagram};
|
|
1
|
+
import{b as R,s as W,S as N}from"./chunk-AQP2D5EJ-CxZiOBxr.js";import{b as f,a3 as t,aZ as H,aC as S,E as P,z,az as C,K as U,ae as _,bj as F}from"./mermaid.core-BkSEtyQI.js";import{G as O}from"./graph-BB0J4w4c.js";import{l as J}from"./layout-X4aHIIHH.js";import"./chunk-55IACEB6-DVQh6VJ8.js";import"./chunk-2J33WTMH-Dft8iKEQ.js";import"./index-BESldG3d.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const E=o.append("tspan").attr("x",2*t().state.padding).text(B);y||E.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)<c&&x>p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),Z=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),j=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),q=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=q(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&Z(n),(i.type==="fork"||i.type==="join")&&j(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=C().x(function(s){return s.x}).y(function(s){return s.y}).curve(U),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=_(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=F.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,E=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),E=Math.min(E,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,E=B*1.75;P(s,y,E,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new O({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){m=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:m?1:b.edgeLengthFactor,nodeSep:m?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:m?1:b.edgeLengthFactor,nodeSep:m?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const x=p.db.getStates(),g=p.db.getRelations(),o=Object.keys(x);for(const r of o){const u=x[r];d&&(u.parentId=d);let h;if(u.doc){let w=i.append("g").attr("id",u.id).attr("class","stateGroup");h=A(u.doc,w,u.id,!c,n,l,p);{w=$(w,u,c);let v=w.node().getBBox();h.width=v.width,h.height=v.height+b.padding/2,T[u.id]={y:b.compositTitleSize}}}else h=L(i,u,a);if(u.note){const w={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},v=L(i,w,a);u.note.position==="left of"?(a.setNode(h.id+"-note",v),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",v)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let B=0;g.forEach(function(r){B++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:b.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+B)}),J(a),S.debug("Graph after layout",a.nodes());const y=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+y.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+y.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),l.querySelectorAll("#"+y.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let v=0,M=0;w&&(w.parentElement&&(v=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",v-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let E=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),E=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=E.width+2*b.padding,k.height=E.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},lt={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{lt as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e,a as r,s as a,S as s}from"./chunk-AQP2D5EJ-CxZiOBxr.js";import{b as i}from"./mermaid.core-BkSEtyQI.js";import"./chunk-55IACEB6-DVQh6VJ8.js";import"./chunk-2J33WTMH-Dft8iKEQ.js";import"./index-BESldG3d.js";var u={parser:a,get db(){return new s(2)},renderer:r,styles:e,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{u as diagram};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{b as l,
|
|
1
|
+
import{b as l,a2 as yt,at as Vt,ay as Ft,L as Gt,a3 as mt,aC as w,a_ as zt,aL as Ot,b5 as xt,aZ as J,_ as Dt,y as Zt,t as Kt}from"./mermaid.core-BkSEtyQI.js";import{d as ht}from"./arc-CFT_xytZ.js";import"./index-BESldG3d.js";var nt=function(){var n=l(function(g,s,d,h){for(d=d||{},h=g.length;h--;d[g[h]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],r=[1,12],i=[1,13],e=[1,14],a=[1,15],o=[1,16],c=[1,19],f=[1,20],m={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:l(function(s,d,h,p,k,u,_){var v=u.length-1;switch(k){case 1:return u[v-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:p.addTask(u[v],0,""),this.$=u[v];break;case 19:p.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},n(t,[2,5],{5:6}),n(t,[2,2]),n(t,[2,3]),n(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:i,17:e,19:a,20:o,21:17,22:18,23:c,24:f},n(t,[2,10],{1:[2,1]}),n(t,[2,6]),{12:21,14:r,15:i,17:e,19:a,20:o,21:17,22:18,23:c,24:f},n(t,[2,8]),n(t,[2,9]),n(t,[2,11]),{16:[1,22]},{18:[1,23]},n(t,[2,14]),n(t,[2,15]),n(t,[2,16]),n(t,[2,17]),n(t,[2,18]),n(t,[2,19]),n(t,[2,7]),n(t,[2,12]),n(t,[2,13])],defaultActions:{},parseError:l(function(s,d){if(d.recoverable)this.trace(s);else{var h=new Error(s);throw h.hash=d,h}},"parseError"),parse:l(function(s){var d=this,h=[0],p=[],k=[null],u=[],_=this.table,v="",C=0,F=0,W=2,z=1,H=u.slice.call(arguments,1),b=Object.create(this.lexer),$={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&($.yy[P]=this.yy[P]);b.setInput(s,$.yy),$.yy.lexer=b,$.yy.parser=this,typeof b.yylloc=="undefined"&&(b.yylloc={});var G=b.yylloc;u.push(G);var q=b.options&&b.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function K(T){h.length=h.length-2*T,k.length=k.length-T,u.length=u.length-T}l(K,"popStack");function Z(){var T;return T=p.pop()||b.lex()||z,typeof T!="number"&&(T instanceof Array&&(p=T,T=p.pop()),T=d.symbols_[T]||T),T}l(Z,"lex");for(var I,B,M,O,L={},E,S,N,A;;){if(B=h[h.length-1],this.defaultActions[B]?M=this.defaultActions[B]:((I===null||typeof I=="undefined")&&(I=Z()),M=_[B]&&_[B][I]),typeof M=="undefined"||!M.length||!M[0]){var V="";A=[];for(E in _[B])this.terminals_[E]&&E>W&&A.push("'"+this.terminals_[E]+"'");b.showPosition?V="Parse error on line "+(C+1)+`:
|
|
2
2
|
`+b.showPosition()+`
|
|
3
|
-
Expecting `+A.join(", ")+", got '"+(this.terminals_[I]||I)+"'":V="Parse error on line "+(
|
|
3
|
+
Expecting `+A.join(", ")+", got '"+(this.terminals_[I]||I)+"'":V="Parse error on line "+(C+1)+": Unexpected "+(I==z?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(V,{text:b.match,token:this.terminals_[I]||I,line:b.yylineno,loc:G,expected:A})}if(M[0]instanceof Array&&M.length>1)throw new Error("Parse Error: multiple actions possible at state: "+B+", token: "+I);switch(M[0]){case 1:h.push(I),k.push(b.yytext),u.push(b.yylloc),h.push(M[1]),I=null,F=b.yyleng,v=b.yytext,C=b.yylineno,G=b.yylloc;break;case 2:if(S=this.productions_[M[1]][1],L.$=k[k.length-S],L._$={first_line:u[u.length-(S||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(S||1)].first_column,last_column:u[u.length-1].last_column},q&&(L._$.range=[u[u.length-(S||1)].range[0],u[u.length-1].range[1]]),O=this.performAction.apply(L,[v,F,C,$.yy,M[1],k,u].concat(H)),typeof O!="undefined")return O;S&&(h=h.slice(0,-1*S*2),k=k.slice(0,-1*S),u=u.slice(0,-1*S)),h.push(this.productions_[M[1]][0]),k.push(L.$),u.push(L._$),N=_[h[h.length-2]][h[h.length-1]],h.push(N);break;case 3:return!0}}return!0},"parse")},x=function(){var g={EOF:1,parseError:l(function(d,h){if(this.yy.parser)this.yy.parser.parseError(d,h);else throw new Error(d)},"parseError"),setInput:l(function(s,d){return this.yy=d||this.yy||{},this._input=s,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:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var d=s.length,h=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var p=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),h.length-1&&(this.yylineno-=h.length-1);var k=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:h?(h.length===p.length?this.yylloc.first_column:0)+p[p.length-h.length].length-h[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[k[0],k[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
5
5
|
`+d+"^"},"showPosition"),test_match:l(function(s,d){var h,p,k;if(this.options.backtrack_lexer&&(k={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&&(k.yylloc.range=this.yylloc.range.slice(0))),p=s[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],h=this.performAction.call(this,this.yy,this,d,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var u in k)this[u]=k[u];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,d,h,p;this._more||(this.yytext="",this.match="");for(var k=this._currentRules(),u=0;u<k.length;u++)if(h=this._input.match(this.rules[k[u]]),h&&(!d||h[0].length>d[0].length)){if(d=h,p=u,this.options.backtrack_lexer){if(s=this.test_match(h,k[u]),s!==!1)return s;if(this._backtrack){d=!1;continue}else return!1}else if(!this.options.flex)break}return d?(s=this.test_match(d,k[p]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var d=this.next();return d||this.lex()},"lex"),begin:l(function(d){this.conditionStack.push(d)},"begin"),popState:l(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(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:l(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:l(function(d){this.begin(d)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(d,h,p,k){switch(p){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\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,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return g}();m.lexer=x;function y(){this.yy={}}return l(y,"Parser"),y.prototype=m,m.Parser=y,new y}();nt.parser=nt;var Xt=nt,kt={};Dt(kt,{addEvent:()=>It,addSection:()=>Et,addTask:()=>Nt,addTaskOrg:()=>Ht,clear:()=>_t,default:()=>Zt,getCommonDb:()=>bt,getDirection:()=>St,getSections:()=>Tt,getTasks:()=>$t,setDirection:()=>wt});var X="",vt=0,st="LR",it=[],Q=[],Z=[],bt=l(()=>Kt,"getCommonDb"),_t=l(function(){it.length=0,Q.length=0,X="",Z.length=0,st="LR",Ut()},"clear"),wt=l(function(n){st=n},"setDirection"),St=l(function(){return st},"getDirection"),Et=l(function(n){X=n,it.push(n)},"addSection"),Tt=l(function(){return it},"getSections"),$t=l(function(){let n=dt();const t=100;let r=0;for(;!n&&r<t;)n=dt(),r++;return Q.push(...Z),Q},"getTasks"),Nt=l(function(n,t,r){const i={id:vt++,section:X,type:X,task:n,score:t||0,events:r?[r]:[]};Z.push(i)},"addTask"),It=l(function(n){Z.find(r=>r.id===vt-1).events.push(n)},"addEvent"),Ht=l(function(n){const t={section:X,type:X,description:n,task:n,classes:[]};Q.push(t)},"addTaskOrg"),dt=l(function(){const n=l(function(r){return Z[r].processed},"compileTask");let t=!0;for(const[r,i]of Z.entries())n(r),t=t&&i.processed;return t},"compileTasks"),Zt={clear:_t,getCommonDb:bt,getDirection:St,setDirection:wt,addSection:Et,getSections:Tt,getTasks:$t,addTask:Nt,addTaskOrg:Ht,addEvent:It},Lt=0,j=l(function(n,t){const r=n.append("rect");return r.attr("x",t.x),r.attr("y",t.y),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("width",t.width),r.attr("height",t.height),r.attr("rx",t.rx),r.attr("ry",t.ry),t.class!==void 0&&r.attr("class",t.class),r},"drawRect"),qt=l(function(n,t){const i=n.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),e=n.append("g");e.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),e.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(f){const m=ht().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}l(a,"smile");function o(f){const m=ht().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}l(o,"sad");function c(f){f.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return l(c,"ambivalent"),t.score>3?a(e):t.score<3?o(e):c(e),i},"drawFace"),Jt=l(function(n,t){const r=n.append("circle");return r.attr("cx",t.cx),r.attr("cy",t.cy),r.attr("class","actor-"+t.pos),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("r",t.r),r.class!==void 0&&r.attr("class",r.class),t.title!==void 0&&r.append("title").text(t.title),r},"drawCircle"),Mt=l(function(n,t){const r=t.text.replace(/<br\s*\/?>/gi," "),i=n.append("text");i.attr("x",t.x),i.attr("y",t.y),i.attr("class","legend"),i.style("text-anchor",t.anchor),t.class!==void 0&&i.attr("class",t.class);const e=i.append("tspan");return e.attr("x",t.x+t.textMargin*2),e.text(r),i},"drawText"),Qt=l(function(n,t){function r(e,a,o,c,f){return e+","+a+" "+(e+o)+","+a+" "+(e+o)+","+(a+c-f)+" "+(e+o-f*1.2)+","+(a+c)+" "+e+","+(a+c)}l(r,"genPoints");const i=n.append("polygon");i.attr("points",r(t.x,t.y,50,20,7)),i.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,Mt(n,t)},"drawLabel"),jt=l(function(n,t,r){const i=n.append("g"),e=at();e.x=t.x,e.y=t.y,e.fill=t.fill,e.width=r.width,e.height=r.height,e.class="journey-section section-type-"+t.num,e.rx=3,e.ry=3,j(i,e),At(r)(t.text,i,e.x,e.y,e.width,e.height,{class:"journey-section section-type-"+t.num},r,t.colour)},"drawSection"),rt=-1,Yt=l(function(n,t,r,i){const e=t.x+r.width/2,a=n.append("g");rt++;const o=300+5*30;a.append("line").attr("id",i+"-task"+rt).attr("x1",e).attr("y1",t.y).attr("x2",e).attr("y2",o).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),qt(a,{cx:e,cy:300+(5-t.score)*30,score:t.score});const c=at();c.x=t.x,c.y=t.y,c.fill=t.fill,c.width=r.width,c.height=r.height,c.class="task task-type-"+t.num,c.rx=3,c.ry=3,j(a,c),At(r)(t.task,a,c.x,c.y,c.width,c.height,{class:"task"},r,t.colour)},"drawTask"),te=l(function(n,t){j(n,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),ee=l(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),at=l(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),At=function(){function n(e,a,o,c,f,m,x,y){const g=a.append("text").attr("x",o+f/2).attr("y",c+m/2+5).style("font-color",y).style("text-anchor","middle").text(e);i(g,x)}l(n,"byText");function t(e,a,o,c,f,m,x,y,g){const{taskFontSize:s,taskFontFamily:d}=y,h=e.split(/<br\s*\/?>/gi);for(let p=0;p<h.length;p++){const k=p*s-s*(h.length-1)/2,u=a.append("text").attr("x",o+f/2).attr("y",c).attr("fill",g).style("text-anchor","middle").style("font-size",s).style("font-family",d);u.append("tspan").attr("x",o+f/2).attr("dy",k).text(h[p]),u.attr("y",c+m/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(u,x)}}l(t,"byTspan");function r(e,a,o,c,f,m,x,y){const g=a.append("switch"),d=g.append("foreignObject").attr("x",o).attr("y",c).attr("width",f).attr("height",m).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(e),t(e,g,o,c,f,m,x,y),i(d,x)}l(r,"byFo");function i(e,a){for(const o in a)o in a&&e.attr(o,a[o])}return l(i,"_setTextAttrs"),function(e){return e.textPlacement==="fo"?r:e.textPlacement==="old"?n:t}}(),ne=l(function(n,t){Lt=0,rt=-1,n.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function ot(n,t){n.each(function(){var r=J(this),i=r.text().split(/(\s+|<br>)/).reverse(),e,a=[],o=1.1,c=r.attr("y"),f=parseFloat(r.attr("dy")),m=r.text(null).append("tspan").attr("x",0).attr("y",c).attr("dy",f+"em");for(let x=0;x<i.length;x++)e=i[i.length-1-x],a.push(e),m.text(a.join(" ").trim()),(m.node().getComputedTextLength()>t||e==="<br>")&&(a.pop(),m.text(a.join(" ").trim()),e==="<br>"?a=[""]:a=[e],m=r.append("tspan").attr("x",0).attr("y",c).attr("dy",o+"em").text(e))})}l(ot,"wrap");var re=l(function(n,t,r,i,e,a=!1){var k,u,_,v,R,F;const{theme:o,look:c}=i,f=o==null?void 0:o.includes("redux"),m=(u=(k=i==null?void 0:i.themeVariables)==null?void 0:k.THEME_COLOR_LIMIT)!=null?u:12,x=r%m-1,y=n.append("g");t.section=x,y.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+x));const g=y.append("g"),s=y.append("g"),h=s.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(ot,t.width).node().getBBox(),p=(_=i.fontSize)!=null&&_.replace?i.fontSize.replace("px",""):i.fontSize;if(t.height=h.height+p*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,s.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),f&&s.attr("transform",`translate(${t.width/2}, ${a?t.padding/2+3:t.padding})`),ie(g,t,x,e,i),c==="neo"&&(y.attr("data-look","neo"),f)){const W=o.includes("dark"),z=(R=(v=n.node())==null?void 0:v.ownerSVGElement)!=null?R:n.node(),H=J(z),b=(F=H.attr("id"))!=null?F:"",$=b?`${b}-drop-shadow`:"drop-shadow";if(H.select(`#${$}`).empty()){const P=H.select("defs");(P.empty()?H.append("defs"):P).append("filter").attr("id",$).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",W?"0.2":"0.06").attr("flood-color",W?"#FFFFFF":"#000000")}}return t},"drawNode"),se=l(function(n,t,r){var c;const i=n.append("g"),a=i.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(ot,t.width).node().getBBox(),o=(c=r.fontSize)!=null&&c.replace?r.fontSize.replace("px",""):r.fontSize;return i.remove(),a.height+o*1.1*.5+t.padding},"getVirtualNodeHeight"),ie=l(function(n,t,r,i,e){const{theme:a}=e,o=a!=null&&a.includes("redux")?0:5,c=5,f=o>0?`M0 ${t.height-c} v${-t.height+2*c} q0,-${o},${o},-${o} h${t.width-2*c} q${o},0,${o},${o} v${t.height-c} H0 Z`:`M0 ${t.height-c} v${-(t.height-c)} h${t.width} v${t.height} H0 Z`;n.append("path").attr("id",i+"-node-"+Lt++).attr("class","node-bkg node-"+t.type).attr("d",f),a!=null&&a.includes("redux")||n.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),C={drawRect:j,drawCircle:Jt,drawSection:jt,drawText:Mt,drawLabel:Qt,drawTask:Yt,drawBackgroundRect:te,getTextObj:ee,getNoteRect:at,initGraphics:ne,drawNode:re,getVirtualNodeHeight:se},ae=l(function(n,t,r,i){var U,K,I,B,M,O;const e=mt(),{look:a,theme:o,themeVariables:c}=e,{useGradient:f,gradientStart:m,gradientStop:x}=c,y=(K=(U=e.timeline)==null?void 0:U.leftMargin)!=null?K:50;w.debug("timeline",i.db);const g=e.securityLevel;let s;g==="sandbox"&&(s=J("#i"+t));const h=(g==="sandbox"?J(s.nodes()[0].contentDocument.body):J("body")).select("#"+t);h.append("g");const p=i.db.getTasks(),k=i.db.getCommonDb().getDiagramTitle();w.debug("task",p),C.initGraphics(h,t);const u=i.db.getSections();w.debug("sections",u);let _=0,v=0,R=0,F=0,W=50+y,z=50;F=50;let H=0,b=!0;u.forEach(function(L){const E={number:H,descr:L,section:H,width:150,padding:20,maxHeight:_},S=C.getVirtualNodeHeight(h,E,e);w.debug("sectionHeight before draw",S),_=Math.max(_,S+20)});let $=0,P=0;w.debug("tasks.length",p.length);for(const[L,E]of p.entries()){const S={number:L,descr:E,section:E.section,width:150,padding:20,maxHeight:v},N=C.getVirtualNodeHeight(h,S,e);w.debug("taskHeight before draw",N),v=Math.max(v,N+20),$=Math.max($,E.events.length);let A=0;for(const V of E.events){const T={descr:V,section:E.section,number:E.section,width:150,padding:20,maxHeight:50};A+=C.getVirtualNodeHeight(h,T,e)}E.events.length>0&&(A+=(E.events.length-1)*10),P=Math.max(P,A)}w.debug("maxSectionHeight before draw",_),w.debug("maxTaskHeight before draw",v),u&&u.length>0?u.forEach(L=>{const E=p.filter(V=>V.section===L),S={number:H,descr:L,section:H,width:200*Math.max(E.length,1)-50,padding:20,maxHeight:_};w.debug("sectionNode",S);const N=h.append("g"),A=C.drawNode(N,S,H,e,t);w.debug("sectionNode output",A),N.attr("transform",`translate(${W}, ${F})`),z+=_+50,E.length>0&&ut(h,E,H,W,z,v,e,$,P,_,!1,t),W+=200*Math.max(E.length,1),z=F,H++}):(b=!1,ut(h,p,H,W,z,v,e,$,P,_,!0,t));const G=h.node().getBBox();if(w.debug("bounds",G),k&&h.append("text").text(k).attr("x",a==="neo"?G.x*2+y:G.width/2-y).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),R=b?_+v+150:v+100,h.append("g").attr("class","lineWrapper").append("line").attr("x1",y).attr("y1",R).attr("x2",G.width+3*y).attr("y2",R).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${t}-arrowhead)`),a==="neo"&&f&&o!=="neutral"){const L=h.select("defs"),S=(L.empty()?h.append("defs"):L).append("linearGradient").attr("id",h.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");S.append("stop").attr("offset","0%").attr("stop-color",m).attr("stop-opacity",1),S.append("stop").attr("offset","100%").attr("stop-color",x).attr("stop-opacity",1)}xt(void 0,h,(B=(I=e.timeline)==null?void 0:I.padding)!=null?B:50,(O=(M=e.timeline)==null?void 0:M.useMaxWidth)!=null?O:!1)},"draw"),ut=l(function(n,t,r,i,e,a,o,c,f,m,x,y){var g;for(const s of t){const d={descr:s.task,section:r,number:r,width:150,padding:20,maxHeight:a};w.debug("taskNode",d);const h=n.append("g").attr("class","taskWrapper"),k=C.drawNode(h,d,r,o,y).height;if(w.debug("taskHeight after draw",k),h.attr("transform",`translate(${i}, ${e})`),a=Math.max(a,k),s.events){const u=n.append("g").attr("class","lineWrapper");let _=a;e+=100,_=_+oe(n,s.events,r,i,e,o,y),e-=100,u.append("line").attr("x1",i+190/2).attr("y1",e+a).attr("x2",i+190/2).attr("y2",e+a+100+f+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${y}-arrowhead)`).attr("stroke-dasharray","5,5")}i=i+200,x&&!((g=o.timeline)!=null&&g.disableMulticolor)&&r++}e=e-10},"drawTasks"),oe=l(function(n,t,r,i,e,a,o){let c=0;const f=e;e=e+100;for(const m of t){const x={descr:m,section:r,number:r,width:150,padding:20,maxHeight:50};w.debug("eventNode",x);const y=n.append("g").attr("class","eventWrapper"),s=C.drawNode(y,x,r,a,o,!0).height;c=c+s,y.attr("transform",`translate(${i}, ${e})`),e=e+10+s}return e=f,c},"drawEvents"),ce={setConf:l(()=>{},"setConf"),draw:ae},Y=200,D=5,le=Y+D*2,ct=Y+100,he=ct+D*2,Rt=10,de=0,pt=20,Ct=20,gt=30,Wt=50,ue=l(function(n,t,r,i){var U,K,I,B,M,O,L,E;const e=mt(),a=(K=(U=e.timeline)==null?void 0:U.leftMargin)!=null?K:50;w.debug("timeline",i.db);const o=zt(t);o.append("g");const c=i.db.getTasks(),f=i.db.getCommonDb().getDiagramTitle();w.debug("task",c),C.initGraphics(o);const m=i.db.getSections();w.debug("sections",m);let x=0,y=0;const g=50+a;let s=50;const d=s,h=g,p=le+Ct,k=he+Wt,u=h+p;let _=0;const v=m&&m.length>0,R=v?u:g+p,F=Math.max(50,p+k-D*2);m.forEach(function(S){const N={number:_,descr:S,section:_,width:F,padding:D,maxHeight:x},A=C.getVirtualNodeHeight(o,N,e);w.debug("sectionHeight before draw",A),x=Math.max(x,A)});let W=0;w.debug("tasks.length",c.length);for(const[S,N]of c.entries()){const A={number:S,descr:N,section:N.section,width:Y,padding:D,maxHeight:y},V=C.getVirtualNodeHeight(o,A,e);w.debug("taskHeight before draw",V),y=Math.max(y,V);let T=0;for(const tt of N.events){const et={descr:tt,section:N.section,number:N.section,width:ct,padding:D,maxHeight:50};T+=C.getVirtualNodeHeight(o,et,e)}N.events.length>0&&(T+=(N.events.length-1)*Rt),W=Math.max(W,T)+de}w.debug("maxSectionHeight before draw",x),w.debug("maxTaskHeight before draw",y);const H=Math.max(y,W)+gt;v?m.forEach(S=>{const N=c.filter(Bt=>Bt.section===S),A={number:_,descr:S,section:_,width:F,padding:D,maxHeight:x};w.debug("sectionNode",A);const V=o.append("g"),T=C.drawNode(V,A,_,e);w.debug("sectionNode output",T);const tt=R-p;V.attr("transform",`translate(${tt}, ${s})`);const et=s+T.height+pt;N.length>0&&ft(o,N,_,R,et,y,e,H,!1);const lt=N.length,Pt=T.height+pt+H*Math.max(lt,1)-(lt>0?gt*2:0);s+=Pt,_++}):ft(o,c,_,R,s,y,e,H,!0);let b=(I=o.node())==null?void 0:I.getBBox();if(!b)throw new Error("bbox not found");if(w.debug("bounds",b),f){if(o.append("text").text(f).attr("x",b.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),b=(B=o.node())==null?void 0:B.getBBox(),!b)throw new Error("bbox not found");w.debug("bounds after title",b)}const[$]=Ot(e.fontSize),P=($!=null?$:16)*2,G=($!=null?$:16)*.5+20,q=o.append("g").attr("class","lineWrapper");q.append("line").attr("x1",R).attr("y1",d-P).attr("x2",R).attr("y2",b.y+b.height+G).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),q.lower(),xt(void 0,o,(O=(M=e.timeline)==null?void 0:M.padding)!=null?O:50,(E=(L=e.timeline)==null?void 0:L.useMaxWidth)!=null?E:!1)},"draw"),ft=l(function(n,t,r,i,e,a,o,c,f){var m;for(const x of t){const y={descr:x.task,section:r,number:r,width:Y,padding:D,maxHeight:a};w.debug("taskNode",y);const g=n.append("g").attr("class","taskWrapper"),s=C.drawNode(g,y,r,o),d=s.height;w.debug("taskHeight after draw",d);const h=i-Ct-s.width;if(g.attr("transform",`translate(${h}, ${e})`),a=Math.max(a,d),x.events&&x.events.length>0){const p=e,k=i+Wt;pe(n,x.events,r,i,k,p,o)}e=e+c,f&&!((m=o.timeline)!=null&&m.disableMulticolor)&&r++}},"drawTasks"),pe=l(function(n,t,r,i,e,a,o){let c=a;for(const f of t){const m={descr:f,section:r,number:r,width:ct,padding:D,maxHeight:0};w.debug("eventNode",m);const x=n.append("g").attr("class","eventWrapper"),g=C.drawNode(x,m,r,o).height;x.attr("transform",`translate(${e}, ${c})`);const s=n.append("g").attr("class","lineWrapper"),d=c+g/2;s.append("line").attr("x1",i).attr("y1",d).attr("x2",e).attr("y2",d).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),c=c+g+Rt}return c-a},"drawEvents"),ge={setConf:l(()=>{},"setConf"),draw:ue},fe=l(n=>{var c,f,m,x,y;const{theme:t}=yt(),r=t==null?void 0:t.includes("dark"),i=t==null?void 0:t.includes("color"),e=(f=(c=n.svgId)==null?void 0:c.replace(/^#/,""))!=null?f:"",a=e?`url(#${e}-drop-shadow)`:(m=n.dropShadow)!=null?m:"none";let o="";for(let g=0;g<n.THEME_COLOR_LIMIT;g++){const s=`${17-3*g}`,d=i?n.borderColorArray[g]:n.mainBkg,h=i?n.borderColorArray[g]:n.nodeBorder;o+=`
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var d=this.next();return d||this.lex()},"lex"),begin:l(function(d){this.conditionStack.push(d)},"begin"),popState:l(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(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:l(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:l(function(d){this.begin(d)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(d,h,p,k){switch(p){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\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,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return g}();m.lexer=x;function y(){this.yy={}}return l(y,"Parser"),y.prototype=m,m.Parser=y,new y}();nt.parser=nt;var Ut=nt,kt={};Dt(kt,{addEvent:()=>It,addSection:()=>Et,addTask:()=>Nt,addTaskOrg:()=>Ht,clear:()=>_t,default:()=>Xt,getCommonDb:()=>bt,getDirection:()=>St,getSections:()=>Tt,getTasks:()=>$t,setDirection:()=>wt});var U="",vt=0,st="LR",it=[],Q=[],X=[],bt=l(()=>Zt,"getCommonDb"),_t=l(function(){it.length=0,Q.length=0,U="",X.length=0,st="LR",Kt()},"clear"),wt=l(function(n){st=n},"setDirection"),St=l(function(){return st},"getDirection"),Et=l(function(n){U=n,it.push(n)},"addSection"),Tt=l(function(){return it},"getSections"),$t=l(function(){let n=dt();const t=100;let r=0;for(;!n&&r<t;)n=dt(),r++;return Q.push(...X),Q},"getTasks"),Nt=l(function(n,t,r){const i={id:vt++,section:U,type:U,task:n,score:t||0,events:r?[r]:[]};X.push(i)},"addTask"),It=l(function(n){X.find(r=>r.id===vt-1).events.push(n)},"addEvent"),Ht=l(function(n){const t={section:U,type:U,description:n,task:n,classes:[]};Q.push(t)},"addTaskOrg"),dt=l(function(){const n=l(function(r){return X[r].processed},"compileTask");let t=!0;for(const[r,i]of X.entries())n(r),t=t&&i.processed;return t},"compileTasks"),Xt={clear:_t,getCommonDb:bt,getDirection:St,setDirection:wt,addSection:Et,getSections:Tt,getTasks:$t,addTask:Nt,addTaskOrg:Ht,addEvent:It},Lt=0,j=l(function(n,t){const r=n.append("rect");return r.attr("x",t.x),r.attr("y",t.y),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("width",t.width),r.attr("height",t.height),r.attr("rx",t.rx),r.attr("ry",t.ry),t.class!==void 0&&r.attr("class",t.class),r},"drawRect"),qt=l(function(n,t){const i=n.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),e=n.append("g");e.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),e.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(f){const m=ht().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}l(a,"smile");function o(f){const m=ht().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}l(o,"sad");function c(f){f.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return l(c,"ambivalent"),t.score>3?a(e):t.score<3?o(e):c(e),i},"drawFace"),Jt=l(function(n,t){const r=n.append("circle");return r.attr("cx",t.cx),r.attr("cy",t.cy),r.attr("class","actor-"+t.pos),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("r",t.r),r.class!==void 0&&r.attr("class",r.class),t.title!==void 0&&r.append("title").text(t.title),r},"drawCircle"),Mt=l(function(n,t){const r=t.text.replace(/<br\s*\/?>/gi," "),i=n.append("text");i.attr("x",t.x),i.attr("y",t.y),i.attr("class","legend"),i.style("text-anchor",t.anchor),t.class!==void 0&&i.attr("class",t.class);const e=i.append("tspan");return e.attr("x",t.x+t.textMargin*2),e.text(r),i},"drawText"),Qt=l(function(n,t){function r(e,a,o,c,f){return e+","+a+" "+(e+o)+","+a+" "+(e+o)+","+(a+c-f)+" "+(e+o-f*1.2)+","+(a+c)+" "+e+","+(a+c)}l(r,"genPoints");const i=n.append("polygon");i.attr("points",r(t.x,t.y,50,20,7)),i.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,Mt(n,t)},"drawLabel"),jt=l(function(n,t,r){const i=n.append("g"),e=at();e.x=t.x,e.y=t.y,e.fill=t.fill,e.width=r.width,e.height=r.height,e.class="journey-section section-type-"+t.num,e.rx=3,e.ry=3,j(i,e),At(r)(t.text,i,e.x,e.y,e.width,e.height,{class:"journey-section section-type-"+t.num},r,t.colour)},"drawSection"),rt=-1,Yt=l(function(n,t,r,i){const e=t.x+r.width/2,a=n.append("g");rt++;const o=300+5*30;a.append("line").attr("id",i+"-task"+rt).attr("x1",e).attr("y1",t.y).attr("x2",e).attr("y2",o).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),qt(a,{cx:e,cy:300+(5-t.score)*30,score:t.score});const c=at();c.x=t.x,c.y=t.y,c.fill=t.fill,c.width=r.width,c.height=r.height,c.class="task task-type-"+t.num,c.rx=3,c.ry=3,j(a,c),At(r)(t.task,a,c.x,c.y,c.width,c.height,{class:"task"},r,t.colour)},"drawTask"),te=l(function(n,t){j(n,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),ee=l(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),at=l(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),At=function(){function n(e,a,o,c,f,m,x,y){const g=a.append("text").attr("x",o+f/2).attr("y",c+m/2+5).style("font-color",y).style("text-anchor","middle").text(e);i(g,x)}l(n,"byText");function t(e,a,o,c,f,m,x,y,g){const{taskFontSize:s,taskFontFamily:d}=y,h=e.split(/<br\s*\/?>/gi);for(let p=0;p<h.length;p++){const k=p*s-s*(h.length-1)/2,u=a.append("text").attr("x",o+f/2).attr("y",c).attr("fill",g).style("text-anchor","middle").style("font-size",s).style("font-family",d);u.append("tspan").attr("x",o+f/2).attr("dy",k).text(h[p]),u.attr("y",c+m/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(u,x)}}l(t,"byTspan");function r(e,a,o,c,f,m,x,y){const g=a.append("switch"),d=g.append("foreignObject").attr("x",o).attr("y",c).attr("width",f).attr("height",m).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(e),t(e,g,o,c,f,m,x,y),i(d,x)}l(r,"byFo");function i(e,a){for(const o in a)o in a&&e.attr(o,a[o])}return l(i,"_setTextAttrs"),function(e){return e.textPlacement==="fo"?r:e.textPlacement==="old"?n:t}}(),ne=l(function(n,t){Lt=0,rt=-1,n.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function ot(n,t){n.each(function(){var r=J(this),i=r.text().split(/(\s+|<br>)/).reverse(),e,a=[],o=1.1,c=r.attr("y"),f=parseFloat(r.attr("dy")),m=r.text(null).append("tspan").attr("x",0).attr("y",c).attr("dy",f+"em");for(let x=0;x<i.length;x++)e=i[i.length-1-x],a.push(e),m.text(a.join(" ").trim()),(m.node().getComputedTextLength()>t||e==="<br>")&&(a.pop(),m.text(a.join(" ").trim()),e==="<br>"?a=[""]:a=[e],m=r.append("tspan").attr("x",0).attr("y",c).attr("dy",o+"em").text(e))})}l(ot,"wrap");var re=l(function(n,t,r,i,e,a=!1){var k,u,_,v,C,F;const{theme:o,look:c}=i,f=o==null?void 0:o.includes("redux"),m=(u=(k=i==null?void 0:i.themeVariables)==null?void 0:k.THEME_COLOR_LIMIT)!=null?u:12,x=r%m-1,y=n.append("g");t.section=x,y.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+x));const g=y.append("g"),s=y.append("g"),h=s.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(ot,t.width).node().getBBox(),p=(_=i.fontSize)!=null&&_.replace?i.fontSize.replace("px",""):i.fontSize;if(t.height=h.height+p*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,s.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),f&&s.attr("transform",`translate(${t.width/2}, ${a?t.padding/2+3:t.padding})`),ie(g,t,x,e,i),c==="neo"&&(y.attr("data-look","neo"),f)){const W=o.includes("dark"),z=(C=(v=n.node())==null?void 0:v.ownerSVGElement)!=null?C:n.node(),H=J(z),b=(F=H.attr("id"))!=null?F:"",$=b?`${b}-drop-shadow`:"drop-shadow";if(H.select(`#${$}`).empty()){const P=H.select("defs");(P.empty()?H.append("defs"):P).append("filter").attr("id",$).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",W?"0.2":"0.06").attr("flood-color",W?"#FFFFFF":"#000000")}}return t},"drawNode"),se=l(function(n,t,r){var c;const i=n.append("g"),a=i.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(ot,t.width).node().getBBox(),o=(c=r.fontSize)!=null&&c.replace?r.fontSize.replace("px",""):r.fontSize;return i.remove(),a.height+o*1.1*.5+t.padding},"getVirtualNodeHeight"),ie=l(function(n,t,r,i,e){const{theme:a}=e,o=a!=null&&a.includes("redux")?0:5,c=5,f=o>0?`M0 ${t.height-c} v${-t.height+2*c} q0,-${o},${o},-${o} h${t.width-2*c} q${o},0,${o},${o} v${t.height-c} H0 Z`:`M0 ${t.height-c} v${-(t.height-c)} h${t.width} v${t.height} H0 Z`;n.append("path").attr("id",i+"-node-"+Lt++).attr("class","node-bkg node-"+t.type).attr("d",f),a!=null&&a.includes("redux")||n.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),R={drawRect:j,drawCircle:Jt,drawSection:jt,drawText:Mt,drawLabel:Qt,drawTask:Yt,drawBackgroundRect:te,getTextObj:ee,getNoteRect:at,initGraphics:ne,drawNode:re,getVirtualNodeHeight:se},ae=l(function(n,t,r,i){var K,Z,I,B,M,O;const e=mt(),{look:a,theme:o,themeVariables:c}=e,{useGradient:f,gradientStart:m,gradientStop:x}=c,y=(Z=(K=e.timeline)==null?void 0:K.leftMargin)!=null?Z:50;w.debug("timeline",i.db);const g=e.securityLevel;let s;g==="sandbox"&&(s=J("#i"+t));const h=(g==="sandbox"?J(s.nodes()[0].contentDocument.body):J("body")).select("#"+t);h.append("g");const p=i.db.getTasks(),k=i.db.getCommonDb().getDiagramTitle();w.debug("task",p),R.initGraphics(h,t);const u=i.db.getSections();w.debug("sections",u);let _=0,v=0,C=0,F=0,W=50+y,z=50;F=50;let H=0,b=!0;u.forEach(function(L){const E={number:H,descr:L,section:H,width:150,padding:20,maxHeight:_},S=R.getVirtualNodeHeight(h,E,e);w.debug("sectionHeight before draw",S),_=Math.max(_,S+20)});let $=0,P=0;w.debug("tasks.length",p.length);for(const[L,E]of p.entries()){const S={number:L,descr:E,section:E.section,width:150,padding:20,maxHeight:v},N=R.getVirtualNodeHeight(h,S,e);w.debug("taskHeight before draw",N),v=Math.max(v,N+20),$=Math.max($,E.events.length);let A=0;for(const V of E.events){const T={descr:V,section:E.section,number:E.section,width:150,padding:20,maxHeight:50};A+=R.getVirtualNodeHeight(h,T,e)}E.events.length>0&&(A+=(E.events.length-1)*10),P=Math.max(P,A)}w.debug("maxSectionHeight before draw",_),w.debug("maxTaskHeight before draw",v),u&&u.length>0?u.forEach(L=>{const E=p.filter(V=>V.section===L),S={number:H,descr:L,section:H,width:200*Math.max(E.length,1)-50,padding:20,maxHeight:_};w.debug("sectionNode",S);const N=h.append("g"),A=R.drawNode(N,S,H,e,t);w.debug("sectionNode output",A),N.attr("transform",`translate(${W}, ${F})`),z+=_+50,E.length>0&&ut(h,E,H,W,z,v,e,$,P,_,!1,t),W+=200*Math.max(E.length,1),z=F,H++}):(b=!1,ut(h,p,H,W,z,v,e,$,P,_,!0,t));const G=h.node().getBBox();if(w.debug("bounds",G),k&&h.append("text").text(k).attr("x",a==="neo"?G.x*2+y:G.width/2-y).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),C=b?_+v+150:v+100,h.append("g").attr("class","lineWrapper").append("line").attr("x1",y).attr("y1",C).attr("x2",G.width+3*y).attr("y2",C).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${t}-arrowhead)`),a==="neo"&&f&&o!=="neutral"){const L=h.select("defs"),S=(L.empty()?h.append("defs"):L).append("linearGradient").attr("id",h.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");S.append("stop").attr("offset","0%").attr("stop-color",m).attr("stop-opacity",1),S.append("stop").attr("offset","100%").attr("stop-color",x).attr("stop-opacity",1)}xt(void 0,h,(B=(I=e.timeline)==null?void 0:I.padding)!=null?B:50,(O=(M=e.timeline)==null?void 0:M.useMaxWidth)!=null?O:!1)},"draw"),ut=l(function(n,t,r,i,e,a,o,c,f,m,x,y){var g;for(const s of t){const d={descr:s.task,section:r,number:r,width:150,padding:20,maxHeight:a};w.debug("taskNode",d);const h=n.append("g").attr("class","taskWrapper"),k=R.drawNode(h,d,r,o,y).height;if(w.debug("taskHeight after draw",k),h.attr("transform",`translate(${i}, ${e})`),a=Math.max(a,k),s.events){const u=n.append("g").attr("class","lineWrapper");let _=a;e+=100,_=_+oe(n,s.events,r,i,e,o,y),e-=100,u.append("line").attr("x1",i+190/2).attr("y1",e+a).attr("x2",i+190/2).attr("y2",e+a+100+f+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${y}-arrowhead)`).attr("stroke-dasharray","5,5")}i=i+200,x&&!((g=o.timeline)!=null&&g.disableMulticolor)&&r++}e=e-10},"drawTasks"),oe=l(function(n,t,r,i,e,a,o){let c=0;const f=e;e=e+100;for(const m of t){const x={descr:m,section:r,number:r,width:150,padding:20,maxHeight:50};w.debug("eventNode",x);const y=n.append("g").attr("class","eventWrapper"),s=R.drawNode(y,x,r,a,o,!0).height;c=c+s,y.attr("transform",`translate(${i}, ${e})`),e=e+10+s}return e=f,c},"drawEvents"),ce={setConf:l(()=>{},"setConf"),draw:ae},Y=200,D=5,le=Y+D*2,ct=Y+100,he=ct+D*2,Ct=10,de=0,pt=20,Rt=20,gt=30,Wt=50,ue=l(function(n,t,r,i){var K,Z,I,B,M,O,L,E;const e=mt(),a=(Z=(K=e.timeline)==null?void 0:K.leftMargin)!=null?Z:50;w.debug("timeline",i.db);const o=zt(t);o.append("g");const c=i.db.getTasks(),f=i.db.getCommonDb().getDiagramTitle();w.debug("task",c),R.initGraphics(o);const m=i.db.getSections();w.debug("sections",m);let x=0,y=0;const g=50+a;let s=50;const d=s,h=g,p=le+Rt,k=he+Wt,u=h+p;let _=0;const v=m&&m.length>0,C=v?u:g+p,F=Math.max(50,p+k-D*2);m.forEach(function(S){const N={number:_,descr:S,section:_,width:F,padding:D,maxHeight:x},A=R.getVirtualNodeHeight(o,N,e);w.debug("sectionHeight before draw",A),x=Math.max(x,A)});let W=0;w.debug("tasks.length",c.length);for(const[S,N]of c.entries()){const A={number:S,descr:N,section:N.section,width:Y,padding:D,maxHeight:y},V=R.getVirtualNodeHeight(o,A,e);w.debug("taskHeight before draw",V),y=Math.max(y,V);let T=0;for(const tt of N.events){const et={descr:tt,section:N.section,number:N.section,width:ct,padding:D,maxHeight:50};T+=R.getVirtualNodeHeight(o,et,e)}N.events.length>0&&(T+=(N.events.length-1)*Ct),W=Math.max(W,T)+de}w.debug("maxSectionHeight before draw",x),w.debug("maxTaskHeight before draw",y);const H=Math.max(y,W)+gt;v?m.forEach(S=>{const N=c.filter(Bt=>Bt.section===S),A={number:_,descr:S,section:_,width:F,padding:D,maxHeight:x};w.debug("sectionNode",A);const V=o.append("g"),T=R.drawNode(V,A,_,e);w.debug("sectionNode output",T);const tt=C-p;V.attr("transform",`translate(${tt}, ${s})`);const et=s+T.height+pt;N.length>0&&ft(o,N,_,C,et,y,e,H,!1);const lt=N.length,Pt=T.height+pt+H*Math.max(lt,1)-(lt>0?gt*2:0);s+=Pt,_++}):ft(o,c,_,C,s,y,e,H,!0);let b=(I=o.node())==null?void 0:I.getBBox();if(!b)throw new Error("bbox not found");if(w.debug("bounds",b),f){if(o.append("text").text(f).attr("x",b.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),b=(B=o.node())==null?void 0:B.getBBox(),!b)throw new Error("bbox not found");w.debug("bounds after title",b)}const[$]=Ot(e.fontSize),P=($!=null?$:16)*2,G=($!=null?$:16)*.5+20,q=o.append("g").attr("class","lineWrapper");q.append("line").attr("x1",C).attr("y1",d-P).attr("x2",C).attr("y2",b.y+b.height+G).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),q.lower(),xt(void 0,o,(O=(M=e.timeline)==null?void 0:M.padding)!=null?O:50,(E=(L=e.timeline)==null?void 0:L.useMaxWidth)!=null?E:!1)},"draw"),ft=l(function(n,t,r,i,e,a,o,c,f){var m;for(const x of t){const y={descr:x.task,section:r,number:r,width:Y,padding:D,maxHeight:a};w.debug("taskNode",y);const g=n.append("g").attr("class","taskWrapper"),s=R.drawNode(g,y,r,o),d=s.height;w.debug("taskHeight after draw",d);const h=i-Rt-s.width;if(g.attr("transform",`translate(${h}, ${e})`),a=Math.max(a,d),x.events&&x.events.length>0){const p=e,k=i+Wt;pe(n,x.events,r,i,k,p,o)}e=e+c,f&&!((m=o.timeline)!=null&&m.disableMulticolor)&&r++}},"drawTasks"),pe=l(function(n,t,r,i,e,a,o){let c=a;for(const f of t){const m={descr:f,section:r,number:r,width:ct,padding:D,maxHeight:0};w.debug("eventNode",m);const x=n.append("g").attr("class","eventWrapper"),g=R.drawNode(x,m,r,o).height;x.attr("transform",`translate(${e}, ${c})`);const s=n.append("g").attr("class","lineWrapper"),d=c+g/2;s.append("line").attr("x1",i).attr("y1",d).attr("x2",e).attr("y2",d).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),c=c+g+Ct}return c-a},"drawEvents"),ge={setConf:l(()=>{},"setConf"),draw:ue},fe=l(n=>{var c,f,m,x,y;const{theme:t}=yt(),r=t==null?void 0:t.includes("dark"),i=t==null?void 0:t.includes("color"),e=(f=(c=n.svgId)==null?void 0:c.replace(/^#/,""))!=null?f:"",a=e?`url(#${e}-drop-shadow)`:(m=n.dropShadow)!=null?m:"none";let o="";for(let g=0;g<n.THEME_COLOR_LIMIT;g++){const s=`${17-3*g}`,d=i?n.borderColorArray[g]:n.mainBkg,h=i?n.borderColorArray[g]:n.nodeBorder;o+=`
|
|
7
7
|
.section-${g-1} rect,
|
|
8
8
|
.section-${g-1} path,
|
|
9
9
|
.section-${g-1} circle {
|
|
@@ -117,4 +117,4 @@ Expecting `+A.join(", ")+", got '"+(this.terminals_[I]||I)+"'":V="Parse error on
|
|
|
117
117
|
.eventWrapper {
|
|
118
118
|
filter: brightness(120%);
|
|
119
119
|
}
|
|
120
|
-
`},"getStyles"),xe=me,ke={setConf:l(()=>{},"setConf"),draw:l((n,t,r,i)=>{var a,o,c;return((c=(o=(a=i==null?void 0:i.db)==null?void 0:a.getDirection)==null?void 0:o.call(a))!=null?c:"LR")==="TD"?ge.draw(n,t,r,i):ce.draw(n,t,r,i)},"draw")},we={db:kt,renderer:ke,parser:
|
|
120
|
+
`},"getStyles"),xe=me,ke={setConf:l(()=>{},"setConf"),draw:l((n,t,r,i)=>{var a,o,c;return((c=(o=(a=i==null?void 0:i.db)==null?void 0:a.getDirection)==null?void 0:o.call(a))!=null?c:"LR")==="TD"?ge.draw(n,t,r,i):ce.draw(n,t,r,i)},"draw")},we={db:kt,renderer:ke,parser:Ut,styles:xe};export{we as diagram};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{e as Yt,b1 as Xt,a1 as Zt,a6 as Jt,b4 as Qt,a2 as $t,b2 as te,b as S,a3 as Et,b0 as ee,a$ as lt,l as ne,av as se,aA as ie,M as re,F as oe,t as ae,s as le,T as ce}from"./mermaid.core-B2ee-MXg.js";import"./index-DE5oTAz2.js";const St=(t,n)=>Yt(t,"a",-n),At=1e-10;function it(t,n){const s=he(t),e=s.filter(c=>ue(c,t));let i=0,r=0;const o=[];if(e.length>1){const c=Rt(e);for(let u=0;u<e.length;++u){const l=e[u];l.angle=Math.atan2(l.x-c.x,l.y-c.y)}e.sort((u,l)=>l.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const l=e[u];r+=(f.x+l.x)*(l.y-f.y);const m={x:(l.x+f.x)/2,y:(l.y+f.y)/2};let g=null;for(let b=0;b<l.parentIndex.length;++b)if(f.parentIndex.includes(l.parentIndex[b])){const d=t[l.parentIndex[b]],k=Math.atan2(l.x-d.x,l.y-d.y),E=Math.atan2(f.x-d.x,f.y-d.y);let T=E-k;T<0&&(T+=2*Math.PI);const w=E-T/2;let x=G(m,{x:d.x+d.radius*Math.sin(w),y:d.y+d.radius*Math.cos(w)});x>d.radius*2&&(x=d.radius*2),(g==null||g.width>x)&&(g={circle:d,width:x,p1:l,p2:f,large:x>d.radius,sweep:!0})}g!=null&&(o.push(g),i+=ht(g.circle.radius,g.width),f=l)}}else{let c=t[0];for(let u=1;u<t.length;++u)t[u].radius<c.radius&&(c=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(G(t[u],c)>Math.abs(c.radius-t[u].radius)){f=!0;break}f?i=r=0:(i=c.radius*c.radius*Math.PI,o.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-At,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ue(t,n){return n.every(s=>G(t,s)<s.radius+At)}function he(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=zt(t[s],t[e]);for(const r of i)r.parentIndex=[s,e],n.push(r)}return n}function ht(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function G(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function mt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return ht(t,e)+ht(n,i)}function zt(t,n){const s=G(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),c=t.x+r*(n.x-t.x)/s,f=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),l=-(n.x-t.x)*(o/s);return[{x:c+u,y:f-l},{x:c-u,y:f+l}]}function Rt(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function fe(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),c=t(s);let f=s-n;if(o*c>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(c===0)return s;for(let u=0;u<i;++u){f/=2;const l=n+f,m=t(l);if(m*o>=0&&(n=l),Math.abs(f)<r||m===0)return l}return n+f}function ft(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function _t(t,n){return ft(t).map(()=>ft(n))}function et(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function dt(t){return Math.sqrt(et(t,t))}function gt(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function Q(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}function Ct(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,o=s.minErrorDelta||1e-6,c=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,l=s.psi!==void 0?s.psi:-.5,m=s.sigma!==void 0?s.sigma:.5;let g;const b=n.length,d=new Array(b+1);d[0]=n,d[0].fx=t(n),d[0].id=0;for(let v=0;v<b;++v){const a=n.slice();a[v]=a[v]?a[v]*i:r,d[v+1]=a,d[v+1].fx=t(a),d[v+1].id=v+1}function k(v){for(let a=0;a<v.length;a++)d[b][a]=v[a];d[b].fx=v.fx}const E=(v,a)=>v.fx-a.fx,T=n.slice(),w=n.slice(),x=n.slice(),p=n.slice();for(let v=0;v<e;++v){if(d.sort(E),s.history){const y=d.map(h=>{const j=h.slice();return j.fx=h.fx,j.id=h.id,j});y.sort((h,j)=>h.id-j.id),s.history.push({x:d[0].slice(),fx:d[0].fx,simplex:y})}g=0;for(let y=0;y<b;++y)g=Math.max(g,Math.abs(d[0][y]-d[1][y]));if(Math.abs(d[0].fx-d[b].fx)<o&&g<c)break;for(let y=0;y<b;++y){T[y]=0;for(let h=0;h<b;++h)T[y]+=d[h][y];T[y]/=b}const a=d[b];if(Q(w,1+f,T,-f,a),w.fx=t(w),w.fx<d[0].fx)Q(p,1+u,T,-u,a),p.fx=t(p),p.fx<w.fx?k(p):k(w);else if(w.fx>=d[b-1].fx){let y=!1;if(w.fx>a.fx?(Q(x,1+l,T,-l,a),x.fx=t(x),x.fx<a.fx?k(x):y=!0):(Q(x,1-l*f,T,l*f,a),x.fx=t(x),x.fx<w.fx?k(x):y=!0),y){if(m>=1)break;for(let h=1;h<d.length;++h)Q(d[h],1-m,d[0],m,d[h]),d[h].fx=t(d[h])}}else k(w)}return d.sort(E),{fx:d[0].fx,x:d[0]}}function de(t,n,s,e,i,r,o){const c=s.fx,f=et(s.fxprime,n);let u=c,l=c,m=f,g=0;i=i||1,r=r||1e-6,o=o||.1;function b(d,k,E){for(let T=0;T<16;++T)if(i=(d+k)/2,Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),m=et(e.fxprime,n),u>c+r*i*f||u>=E)k=i;else{if(Math.abs(m)<=-o*f)return i;m*(k-d)>=0&&(k=d),d=i,E=u}return 0}for(let d=0;d<10;++d){if(Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),m=et(e.fxprime,n),u>c+r*i*f||d&&u>=l)return b(g,i,l);if(Math.abs(m)<=-o*f)return i;if(m>=0)return b(i,g,u);l=u,g=i,i*=2}return i}function ge(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,c,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),gt(o,e.fxprime,-1);for(let l=0;l<u;++l){if(f=de(t,o,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)gt(o,e.fxprime,-1);else{Q(r,1,i.fxprime,-1,e.fxprime);const m=et(e.fxprime,e.fxprime),g=Math.max(0,et(r,i.fxprime)/m);Q(o,g,o,-1,i.fxprime),c=e,e=i,i=c}if(dt(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function Dt(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||me,e=n.lossFunction||nt,i=xe(t,n),r=s(i,n),o=Object.keys(r),c=[];for(const l of o)c.push(r[l].x),c.push(r[l].y);const u=Ct(l=>{const m={};for(let g=0;g<o.length;++g){const b=o[g];m[b]={x:l[2*g],y:l[2*g+1],radius:r[b].radius}}return e(m,i)},c,n).x;for(let l=0;l<o.length;++l){const m=o[l];r[m].x=u[2*l],r[m].y=u[2*l+1]}return r}const Nt=1e-10;function xt(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Nt?Math.abs(t-n):fe(e=>mt(t,n,e)-s,0,t+n)}function xe(t,n={}){const s=n.distinct,e=t.map(c=>Object.assign({},c));function i(c){return c.join(";")}if(s){const c=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const l=String(f.sets[u]);c.set(l,f.size+(c.get(l)||0));for(let m=u+1;m<f.sets.length;m++){const g=String(f.sets[m]),b=`${l};${g}`,d=`${g};${l}`;c.set(b,f.size+(c.get(b)||0)),c.set(d,f.size+(c.get(d)||0))}}for(const f of e)f.sets.length<3&&(f.size=c.get(i(f.sets)))}const r=[],o=new Set;for(const c of e)if(c.sets.length===1)r.push(c.sets[0]);else if(c.sets.length===2){const f=c.sets[0],u=c.sets[1];o.add(i(c.sets)),o.add(i([u,f]))}r.sort((c,f)=>c===f?0:c<f?-1:1);for(let c=0;c<r.length;++c){const f=r[c];for(let u=c+1;u<r.length;++u){const l=r[u];o.has(i([f,l]))||e.push({sets:[f,l],size:0})}}return e}function ye(t,n,s){const e=_t(n.length,n.length),i=_t(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{const o=s[r.sets[0]],c=s[r.sets[1]],f=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[c].size/Math.PI),l=xt(f,u,r.size);e[o][c]=e[c][o]=l;let m=0;r.size+1e-10>=Math.min(n[o].size,n[c].size)?m=1:r.size<=1e-10&&(m=-1),i[o][c]=i[c][o]=m}),{distances:e,constraints:i}}function pe(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){const o=t[2*r],c=t[2*r+1];for(let f=r+1;f<s.length;++f){const u=t[2*f],l=t[2*f+1],m=s[r][f],g=e[r][f],b=(u-o)*(u-o)+(l-c)*(l-c),d=Math.sqrt(b),k=b-m*m;g>0&&d<=m||g<0&&d>=m||(i+=2*k*k,n[2*r]+=4*k*(o-u),n[2*r+1]+=4*k*(c-l),n[2*f]+=4*k*(u-o),n[2*f+1]+=4*k*(l-c))}}return i}function me(t,n={}){let s=ve(t,n);const e=n.lossFunction||nt;if(t.length>=8){const i=be(t,n),r=e(i,t),o=e(s,t);r+1e-8<o&&(s=i)}return s}function be(t,n={}){const s=n.restarts||10,e=[],i={};for(const g of t)g.sets.length===1&&(i[g.sets[0]]=e.length,e.push(g));let{distances:r,constraints:o}=ye(t,e,i);const c=dt(r.map(dt))/r.length;r=r.map(g=>g.map(b=>b/c));const f=(g,b)=>pe(g,b,r,o);let u=null;for(let g=0;g<s;++g){const b=ft(r.length*2).map(Math.random),d=ge(f,b,n);(!u||d.fx<u.fx)&&(u=d)}const l=u.x,m={};for(let g=0;g<e.length;++g){const b=e[g];m[b.sets[0]]={x:l[2*g]*c,y:l[2*g+1]*c,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const g of n.history)gt(g.x,c);return m}function ve(t,n){const s=n&&n.lossFunction?n.lossFunction:nt,e={},i={};for(const m of t)if(m.sets.length===1){const g=m.sets[0];e[g]={x:1e10,y:1e10,rowid:e.length,size:m.size,radius:Math.sqrt(m.size/Math.PI)},i[g]=[]}t=t.filter(m=>m.sets.length===2);for(const m of t){let g=m.weight!=null?m.weight:1;const b=m.sets[0],d=m.sets[1];m.size+Nt>=Math.min(e[b].size,e[d].size)&&(g=0),i[b].push({set:d,size:m.size,weight:g}),i[d].push({set:b,size:m.size,weight:g})}const r=[];Object.keys(i).forEach(m=>{let g=0;for(let b=0;b<i[m].length;++b)g+=i[m][b].size*i[m][b].weight;r.push({set:m,size:g})});function o(m,g){return g.size-m.size}r.sort(o);const c={};function f(m){return m.set in c}function u(m,g){e[g].x=m.x,e[g].y=m.y,c[g]=!0}u({x:0,y:0},r[0].set);for(let m=1;m<r.length;++m){const g=r[m].set,b=i[g].filter(f),d=e[g];if(b.sort(o),b.length===0)throw"ERROR: missing pairwise overlap information";const k=[];for(var l=0;l<b.length;++l){const w=e[b[l].set],x=xt(d.radius,w.radius,b[l].size);k.push({x:w.x+x,y:w.y}),k.push({x:w.x-x,y:w.y}),k.push({y:w.y+x,x:w.x}),k.push({y:w.y-x,x:w.x});for(let p=l+1;p<b.length;++p){const v=e[b[p].set],a=xt(d.radius,v.radius,b[p].size),y=zt({x:w.x,y:w.y,radius:x},{x:v.x,y:v.y,radius:a});k.push(...y)}}let E=1e50,T=k[0];for(const w of k){e[g].x=w.x,e[g].y=w.y;const x=s(e,t);x<E&&(E=x,T=w)}u(T,g)}return e}function nt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const o=t[e.sets[0]],c=t[e.sets[1]];i=mt(o.radius,c.radius,G(o,c))}else i=it(e.sets.map(o=>t[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Ot(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const c=t[e.sets[0]],f=t[e.sets[1]];i=mt(c.radius,f.radius,G(c,f))}else i=it(e.sets.map(c=>t[c]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function Ie(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&G(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const c of t){const f=c.x,u=c.y;c.x=r*f-o*u,c.y=o*f+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function ke(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){const o=n(i),c=n(r);o.parent=c}for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){const o=t[i].radius+t[r].radius;G(t[i],t[r])+1e-10<o&&s(t[r],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function yt(t){const n=s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ft(t,n,s){n==null&&(n=Math.PI/2);let e=Pt(t).map(u=>Object.assign({},u));const i=ke(e);for(const u of i){Ie(u,n,s);const l=yt(u);u.size=(l.xRange.max-l.xRange.min)*(l.yRange.max-l.yRange.min),u.bounds=l}i.sort((u,l)=>l.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function c(u,l,m){if(!u)return;const g=u.bounds;let b,d;if(l)b=r.xRange.max-g.xRange.min+o;else{b=r.xRange.max-g.xRange.max;const k=(g.xRange.max-g.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;k<0&&(b+=k)}if(m)d=r.yRange.max-g.yRange.min+o;else{d=r.yRange.max-g.yRange.max;const k=(g.yRange.max-g.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;k<0&&(d+=k)}for(const k of u)k.x+=b,k.y+=d,e.push(k)}let f=1;for(;f<i.length;)c(i[f],!0,!1),c(i[f+1],!1,!0),c(i[f+2],!0,!0),f+=3,r=yt(e);return jt(e)}function Lt(t,n,s,e,i){const r=Pt(t);n-=2*e,s-=2*e;const{xRange:o,yRange:c}=yt(r);if(o.max===o.min||c.max===c.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(o.max-o.min),u=s/(c.max-c.min);const l=Math.min(u,f),m=(n-(o.max-o.min)*l)/2,g=(s-(c.max-c.min)*l)/2;return jt(r.map(b=>({radius:l*b.radius,x:e+m+(b.x-o.min)*l,y:e+g+(b.y-c.min)*l,setid:b.setid})))}function jt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Pt(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function Me(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,c=!0,f=null,u=!0,l=!0,m=null,g=null,b=!1,d=null,k=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,x=function(y){if(y in E)return E[y];var h=E[y]=T[w];return w+=1,w>=T.length&&(w=0),h},p=Dt,v=nt;function a(y){let h=y.datum();const j=new Set;h.forEach(I=>{I.size==0&&I.sets.length==1&&j.add(I.sets[0])}),h=h.filter(I=>!I.sets.some(C=>j.has(C)));let M={},F={};if(h.length>0){let I=p(h,{lossFunction:v,distinct:b});c&&(I=Ft(I,o,g)),M=Lt(I,s,e,i,f),F=Bt(M,h,k)}const Y={};h.forEach(I=>{I.label&&(Y[I.sets]=I.label)});function V(I){if(I.sets in Y)return Y[I.sets];if(I.sets.length==1)return""+I.sets[0]}y.selectAll("svg").data([M]).enter().append("svg");const K=y.select("svg");n?K.attr("viewBox",`0 0 ${s} ${e}`):K.attr("width",s).attr("height",e);const H={};let A=!1;K.selectAll(".venn-area path").each(function(I){const C=this.getAttribute("d");I.sets.length==1&&C&&!b&&(A=!0,H[I.sets[0]]=_e(C))});function N(I){return C=>{const B=I.sets.map(X=>{let P=H[X],U=M[X];return P||(P={x:s/2,y:e/2,radius:1}),U||(U={x:s/2,y:e/2,radius:1}),{x:P.x*(1-C)+U.x*C,y:P.y*(1-C)+U.y*C,radius:P.radius*(1-C)+U.radius*C}});return Tt(B,d)}}const q=K.selectAll(".venn-area").data(h,I=>I.sets),W=q.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),Z=W.append("path"),J=W.append("text").attr("class","label").text(I=>V(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);l&&(Z.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:x(I.sets)).style("fill-opacity",".25"),J.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?x(I.sets):"#444"));function O(I){return typeof I.transition=="function"?I.transition("venn").duration(r):I}let _=y;A&&typeof _.transition=="function"?(_=O(y),_.selectAll("path").attrTween("d",N)):_.selectAll("path").attr("d",I=>Tt(I.sets.map(C=>M[C])),d);const z=_.selectAll("text").filter(I=>I.sets in F).text(I=>V(I)).attr("x",I=>Math.floor(F[I.sets].x)).attr("y",I=>Math.floor(F[I.sets].y));u&&(A?"on"in z?z.on("end",ct(M,V)):z.each("end",ct(M,V)):z.each(ct(M,V)));const R=O(q.exit()).remove();typeof q.transition=="function"&&R.selectAll("path").attrTween("d",N);const D=R.selectAll("text").attr("x",s/2).attr("y",e/2);return m!==null&&(J.style("font-size","0px"),z.style("font-size",m),D.style("font-size","0px")),{circles:M,textCentres:F,nodes:q,enter:W,update:_,exit:R}}return a.wrap=function(y){return arguments.length?(u=y,a):u},a.useViewBox=function(){return n=!0,a},a.width=function(y){return arguments.length?(s=y,a):s},a.height=function(y){return arguments.length?(e=y,a):e},a.padding=function(y){return arguments.length?(i=y,a):i},a.distinct=function(y){return arguments.length?(b=y,a):b},a.colours=function(y){return arguments.length?(x=y,a):x},a.colors=function(y){return arguments.length?(x=y,a):x},a.fontSize=function(y){return arguments.length?(m=y,a):m},a.round=function(y){return arguments.length?(d=y,a):d},a.duration=function(y){return arguments.length?(r=y,a):r},a.layoutFunction=function(y){return arguments.length?(p=y,a):p},a.normalize=function(y){return arguments.length?(c=y,a):c},a.scaleToFit=function(y){return arguments.length?(f=y,a):f},a.styled=function(y){return arguments.length?(l=y,a):l},a.orientation=function(y){return arguments.length?(o=y,a):o},a.orientationOrder=function(y){return arguments.length?(g=y,a):g},a.lossFunction=function(y){return arguments.length?(v=y==="default"?nt:y==="logRatio"?Ot:y,a):v},a}function ct(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),f=(r.length+o.length)/3;let u=o.pop(),l=[u],m=0;const g=1.1;e.textContent=null;const b=[];function d(x){const p=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return p.textContent=x,b.push(p),e.append(p),p}let k=d(u);for(;u=o.pop(),!!u;){l.push(u);const x=l.join(" ");k.textContent=x,x.length>f&&k.getComputedTextLength()>i&&(l.pop(),k.textContent=l.join(" "),l=[u],k=d(u),m++)}const E=.35-m*g/2,T=e.getAttribute("x"),w=e.getAttribute("y");b.forEach((x,p)=>{x.setAttribute("x",T),x.setAttribute("y",w),x.setAttribute("dy",`${E+p*g}em`)})}}function ut(t,n,s){let e=n[0].radius-G(n[0],t);for(let i=1;i<n.length;++i){const r=n[i].radius-G(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){const r=G(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}function Vt(t,n,s){const e=[];for(const l of t)e.push({x:l.x,y:l.y}),e.push({x:l.x+l.radius/2,y:l.y}),e.push({x:l.x-l.radius/2,y:l.y}),e.push({x:l.x,y:l.y+l.radius/2}),e.push({x:l.x,y:l.y-l.radius/2});let i=e[0],r=ut(e[0],t,n);for(let l=1;l<e.length;++l){const m=ut(e[l],t,n);m>=r&&(i=e[l],r=m)}const o=Ct(l=>-1*ut({x:l[0],y:l[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,c={x:s?0:o[0],y:o[1]};let f=!0;for(const l of t)if(G(c,l)>l.radius){f=!1;break}for(const l of n)if(G(c,l)<l.radius){f=!1;break}if(f)return c;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return it(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Vt(t,[]):Rt(u.arcs.map(l=>l.p1))}function we(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],r=t[i];for(let o=e+1;o<s.length;++o){const c=s[o],f=t[c],u=G(r,f);u+f.radius<=r.radius+1e-10?n[c].push(i):u+r.radius<=f.radius+1e-10&&n[i].push(c)}}return n}function Bt(t,n,s){const e={},i=we(t);for(let r=0;r<n.length;++r){const o=n[r].sets,c={},f={};for(let g=0;g<o.length;++g){c[o[g]]=!0;const b=i[o[g]];for(let d=0;d<b.length;++d)f[b[d]]=!0}const u=[],l=[];for(let g in t)g in c?u.push(t[g]):g in f||l.push(t[g]);const m=Vt(u,l,s);e[o]=m,m.disjoint&&n[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function Se(t,n,s){const e=[];return e.push(`
|
|
1
|
+
import{e as Yt,a$ as Xt,a0 as Zt,a4 as Jt,b2 as Qt,a1 as $t,b0 as te,b as S,a2 as Tt,a_ as ee,aZ as lt,l as ne,at as se,ay as ie,L as re,E as oe,t as ae,s as le,S as ce}from"./mermaid.core-BkSEtyQI.js";import"./index-BESldG3d.js";const St=(t,n)=>Yt(t,"a",-n),zt=1e-10;function it(t,n){const s=he(t),e=s.filter(c=>ue(c,t));let i=0,r=0;const o=[];if(e.length>1){const c=Rt(e);for(let u=0;u<e.length;++u){const l=e[u];l.angle=Math.atan2(l.x-c.x,l.y-c.y)}e.sort((u,l)=>l.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const l=e[u];r+=(f.x+l.x)*(l.y-f.y);const m={x:(l.x+f.x)/2,y:(l.y+f.y)/2};let g=null;for(let b=0;b<l.parentIndex.length;++b)if(f.parentIndex.includes(l.parentIndex[b])){const d=t[l.parentIndex[b]],k=Math.atan2(l.x-d.x,l.y-d.y),T=Math.atan2(f.x-d.x,f.y-d.y);let E=T-k;E<0&&(E+=2*Math.PI);const w=T-E/2;let x=G(m,{x:d.x+d.radius*Math.sin(w),y:d.y+d.radius*Math.cos(w)});x>d.radius*2&&(x=d.radius*2),(g==null||g.width>x)&&(g={circle:d,width:x,p1:l,p2:f,large:x>d.radius,sweep:!0})}g!=null&&(o.push(g),i+=ht(g.circle.radius,g.width),f=l)}}else{let c=t[0];for(let u=1;u<t.length;++u)t[u].radius<c.radius&&(c=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(G(t[u],c)>Math.abs(c.radius-t[u].radius)){f=!0;break}f?i=r=0:(i=c.radius*c.radius*Math.PI,o.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-zt,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ue(t,n){return n.every(s=>G(t,s)<s.radius+zt)}function he(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=At(t[s],t[e]);for(const r of i)r.parentIndex=[s,e],n.push(r)}return n}function ht(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function G(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function mt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return ht(t,e)+ht(n,i)}function At(t,n){const s=G(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),c=t.x+r*(n.x-t.x)/s,f=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),l=-(n.x-t.x)*(o/s);return[{x:c+u,y:f-l},{x:c-u,y:f+l}]}function Rt(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function fe(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),c=t(s);let f=s-n;if(o*c>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(c===0)return s;for(let u=0;u<i;++u){f/=2;const l=n+f,m=t(l);if(m*o>=0&&(n=l),Math.abs(f)<r||m===0)return l}return n+f}function ft(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function _t(t,n){return ft(t).map(()=>ft(n))}function et(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function dt(t){return Math.sqrt(et(t,t))}function gt(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function Q(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}function Ct(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,o=s.minErrorDelta||1e-6,c=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,l=s.psi!==void 0?s.psi:-.5,m=s.sigma!==void 0?s.sigma:.5;let g;const b=n.length,d=new Array(b+1);d[0]=n,d[0].fx=t(n),d[0].id=0;for(let v=0;v<b;++v){const a=n.slice();a[v]=a[v]?a[v]*i:r,d[v+1]=a,d[v+1].fx=t(a),d[v+1].id=v+1}function k(v){for(let a=0;a<v.length;a++)d[b][a]=v[a];d[b].fx=v.fx}const T=(v,a)=>v.fx-a.fx,E=n.slice(),w=n.slice(),x=n.slice(),p=n.slice();for(let v=0;v<e;++v){if(d.sort(T),s.history){const y=d.map(h=>{const j=h.slice();return j.fx=h.fx,j.id=h.id,j});y.sort((h,j)=>h.id-j.id),s.history.push({x:d[0].slice(),fx:d[0].fx,simplex:y})}g=0;for(let y=0;y<b;++y)g=Math.max(g,Math.abs(d[0][y]-d[1][y]));if(Math.abs(d[0].fx-d[b].fx)<o&&g<c)break;for(let y=0;y<b;++y){E[y]=0;for(let h=0;h<b;++h)E[y]+=d[h][y];E[y]/=b}const a=d[b];if(Q(w,1+f,E,-f,a),w.fx=t(w),w.fx<d[0].fx)Q(p,1+u,E,-u,a),p.fx=t(p),p.fx<w.fx?k(p):k(w);else if(w.fx>=d[b-1].fx){let y=!1;if(w.fx>a.fx?(Q(x,1+l,E,-l,a),x.fx=t(x),x.fx<a.fx?k(x):y=!0):(Q(x,1-l*f,E,l*f,a),x.fx=t(x),x.fx<w.fx?k(x):y=!0),y){if(m>=1)break;for(let h=1;h<d.length;++h)Q(d[h],1-m,d[0],m,d[h]),d[h].fx=t(d[h])}}else k(w)}return d.sort(T),{fx:d[0].fx,x:d[0]}}function de(t,n,s,e,i,r,o){const c=s.fx,f=et(s.fxprime,n);let u=c,l=c,m=f,g=0;i=i||1,r=r||1e-6,o=o||.1;function b(d,k,T){for(let E=0;E<16;++E)if(i=(d+k)/2,Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),m=et(e.fxprime,n),u>c+r*i*f||u>=T)k=i;else{if(Math.abs(m)<=-o*f)return i;m*(k-d)>=0&&(k=d),d=i,T=u}return 0}for(let d=0;d<10;++d){if(Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),m=et(e.fxprime,n),u>c+r*i*f||d&&u>=l)return b(g,i,l);if(Math.abs(m)<=-o*f)return i;if(m>=0)return b(i,g,u);l=u,g=i,i*=2}return i}function ge(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,c,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),gt(o,e.fxprime,-1);for(let l=0;l<u;++l){if(f=de(t,o,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)gt(o,e.fxprime,-1);else{Q(r,1,i.fxprime,-1,e.fxprime);const m=et(e.fxprime,e.fxprime),g=Math.max(0,et(r,i.fxprime)/m);Q(o,g,o,-1,i.fxprime),c=e,e=i,i=c}if(dt(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function Dt(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||me,e=n.lossFunction||nt,i=xe(t,n),r=s(i,n),o=Object.keys(r),c=[];for(const l of o)c.push(r[l].x),c.push(r[l].y);const u=Ct(l=>{const m={};for(let g=0;g<o.length;++g){const b=o[g];m[b]={x:l[2*g],y:l[2*g+1],radius:r[b].radius}}return e(m,i)},c,n).x;for(let l=0;l<o.length;++l){const m=o[l];r[m].x=u[2*l],r[m].y=u[2*l+1]}return r}const Nt=1e-10;function xt(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Nt?Math.abs(t-n):fe(e=>mt(t,n,e)-s,0,t+n)}function xe(t,n={}){const s=n.distinct,e=t.map(c=>Object.assign({},c));function i(c){return c.join(";")}if(s){const c=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const l=String(f.sets[u]);c.set(l,f.size+(c.get(l)||0));for(let m=u+1;m<f.sets.length;m++){const g=String(f.sets[m]),b=`${l};${g}`,d=`${g};${l}`;c.set(b,f.size+(c.get(b)||0)),c.set(d,f.size+(c.get(d)||0))}}for(const f of e)f.sets.length<3&&(f.size=c.get(i(f.sets)))}const r=[],o=new Set;for(const c of e)if(c.sets.length===1)r.push(c.sets[0]);else if(c.sets.length===2){const f=c.sets[0],u=c.sets[1];o.add(i(c.sets)),o.add(i([u,f]))}r.sort((c,f)=>c===f?0:c<f?-1:1);for(let c=0;c<r.length;++c){const f=r[c];for(let u=c+1;u<r.length;++u){const l=r[u];o.has(i([f,l]))||e.push({sets:[f,l],size:0})}}return e}function ye(t,n,s){const e=_t(n.length,n.length),i=_t(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{const o=s[r.sets[0]],c=s[r.sets[1]],f=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[c].size/Math.PI),l=xt(f,u,r.size);e[o][c]=e[c][o]=l;let m=0;r.size+1e-10>=Math.min(n[o].size,n[c].size)?m=1:r.size<=1e-10&&(m=-1),i[o][c]=i[c][o]=m}),{distances:e,constraints:i}}function pe(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){const o=t[2*r],c=t[2*r+1];for(let f=r+1;f<s.length;++f){const u=t[2*f],l=t[2*f+1],m=s[r][f],g=e[r][f],b=(u-o)*(u-o)+(l-c)*(l-c),d=Math.sqrt(b),k=b-m*m;g>0&&d<=m||g<0&&d>=m||(i+=2*k*k,n[2*r]+=4*k*(o-u),n[2*r+1]+=4*k*(c-l),n[2*f]+=4*k*(u-o),n[2*f+1]+=4*k*(l-c))}}return i}function me(t,n={}){let s=ve(t,n);const e=n.lossFunction||nt;if(t.length>=8){const i=be(t,n),r=e(i,t),o=e(s,t);r+1e-8<o&&(s=i)}return s}function be(t,n={}){const s=n.restarts||10,e=[],i={};for(const g of t)g.sets.length===1&&(i[g.sets[0]]=e.length,e.push(g));let{distances:r,constraints:o}=ye(t,e,i);const c=dt(r.map(dt))/r.length;r=r.map(g=>g.map(b=>b/c));const f=(g,b)=>pe(g,b,r,o);let u=null;for(let g=0;g<s;++g){const b=ft(r.length*2).map(Math.random),d=ge(f,b,n);(!u||d.fx<u.fx)&&(u=d)}const l=u.x,m={};for(let g=0;g<e.length;++g){const b=e[g];m[b.sets[0]]={x:l[2*g]*c,y:l[2*g+1]*c,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const g of n.history)gt(g.x,c);return m}function ve(t,n){const s=n&&n.lossFunction?n.lossFunction:nt,e={},i={};for(const m of t)if(m.sets.length===1){const g=m.sets[0];e[g]={x:1e10,y:1e10,rowid:e.length,size:m.size,radius:Math.sqrt(m.size/Math.PI)},i[g]=[]}t=t.filter(m=>m.sets.length===2);for(const m of t){let g=m.weight!=null?m.weight:1;const b=m.sets[0],d=m.sets[1];m.size+Nt>=Math.min(e[b].size,e[d].size)&&(g=0),i[b].push({set:d,size:m.size,weight:g}),i[d].push({set:b,size:m.size,weight:g})}const r=[];Object.keys(i).forEach(m=>{let g=0;for(let b=0;b<i[m].length;++b)g+=i[m][b].size*i[m][b].weight;r.push({set:m,size:g})});function o(m,g){return g.size-m.size}r.sort(o);const c={};function f(m){return m.set in c}function u(m,g){e[g].x=m.x,e[g].y=m.y,c[g]=!0}u({x:0,y:0},r[0].set);for(let m=1;m<r.length;++m){const g=r[m].set,b=i[g].filter(f),d=e[g];if(b.sort(o),b.length===0)throw"ERROR: missing pairwise overlap information";const k=[];for(var l=0;l<b.length;++l){const w=e[b[l].set],x=xt(d.radius,w.radius,b[l].size);k.push({x:w.x+x,y:w.y}),k.push({x:w.x-x,y:w.y}),k.push({y:w.y+x,x:w.x}),k.push({y:w.y-x,x:w.x});for(let p=l+1;p<b.length;++p){const v=e[b[p].set],a=xt(d.radius,v.radius,b[p].size),y=At({x:w.x,y:w.y,radius:x},{x:v.x,y:v.y,radius:a});k.push(...y)}}let T=1e50,E=k[0];for(const w of k){e[g].x=w.x,e[g].y=w.y;const x=s(e,t);x<T&&(T=x,E=w)}u(E,g)}return e}function nt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const o=t[e.sets[0]],c=t[e.sets[1]];i=mt(o.radius,c.radius,G(o,c))}else i=it(e.sets.map(o=>t[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Ot(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const c=t[e.sets[0]],f=t[e.sets[1]];i=mt(c.radius,f.radius,G(c,f))}else i=it(e.sets.map(c=>t[c]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function Ie(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&G(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const c of t){const f=c.x,u=c.y;c.x=r*f-o*u,c.y=o*f+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function ke(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){const o=n(i),c=n(r);o.parent=c}for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){const o=t[i].radius+t[r].radius;G(t[i],t[r])+1e-10<o&&s(t[r],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function yt(t){const n=s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ft(t,n,s){n==null&&(n=Math.PI/2);let e=Pt(t).map(u=>Object.assign({},u));const i=ke(e);for(const u of i){Ie(u,n,s);const l=yt(u);u.size=(l.xRange.max-l.xRange.min)*(l.yRange.max-l.yRange.min),u.bounds=l}i.sort((u,l)=>l.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function c(u,l,m){if(!u)return;const g=u.bounds;let b,d;if(l)b=r.xRange.max-g.xRange.min+o;else{b=r.xRange.max-g.xRange.max;const k=(g.xRange.max-g.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;k<0&&(b+=k)}if(m)d=r.yRange.max-g.yRange.min+o;else{d=r.yRange.max-g.yRange.max;const k=(g.yRange.max-g.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;k<0&&(d+=k)}for(const k of u)k.x+=b,k.y+=d,e.push(k)}let f=1;for(;f<i.length;)c(i[f],!0,!1),c(i[f+1],!1,!0),c(i[f+2],!0,!0),f+=3,r=yt(e);return jt(e)}function Lt(t,n,s,e,i){const r=Pt(t);n-=2*e,s-=2*e;const{xRange:o,yRange:c}=yt(r);if(o.max===o.min||c.max===c.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(o.max-o.min),u=s/(c.max-c.min);const l=Math.min(u,f),m=(n-(o.max-o.min)*l)/2,g=(s-(c.max-c.min)*l)/2;return jt(r.map(b=>({radius:l*b.radius,x:e+m+(b.x-o.min)*l,y:e+g+(b.y-c.min)*l,setid:b.setid})))}function jt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Pt(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function Me(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,c=!0,f=null,u=!0,l=!0,m=null,g=null,b=!1,d=null,k=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,T={},E=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,x=function(y){if(y in T)return T[y];var h=T[y]=E[w];return w+=1,w>=E.length&&(w=0),h},p=Dt,v=nt;function a(y){let h=y.datum();const j=new Set;h.forEach(I=>{I.size==0&&I.sets.length==1&&j.add(I.sets[0])}),h=h.filter(I=>!I.sets.some(C=>j.has(C)));let M={},F={};if(h.length>0){let I=p(h,{lossFunction:v,distinct:b});c&&(I=Ft(I,o,g)),M=Lt(I,s,e,i,f),F=Bt(M,h,k)}const Y={};h.forEach(I=>{I.label&&(Y[I.sets]=I.label)});function V(I){if(I.sets in Y)return Y[I.sets];if(I.sets.length==1)return""+I.sets[0]}y.selectAll("svg").data([M]).enter().append("svg");const K=y.select("svg");n?K.attr("viewBox",`0 0 ${s} ${e}`):K.attr("width",s).attr("height",e);const H={};let z=!1;K.selectAll(".venn-area path").each(function(I){const C=this.getAttribute("d");I.sets.length==1&&C&&!b&&(z=!0,H[I.sets[0]]=_e(C))});function N(I){return C=>{const B=I.sets.map(X=>{let P=H[X],U=M[X];return P||(P={x:s/2,y:e/2,radius:1}),U||(U={x:s/2,y:e/2,radius:1}),{x:P.x*(1-C)+U.x*C,y:P.y*(1-C)+U.y*C,radius:P.radius*(1-C)+U.radius*C}});return Et(B,d)}}const q=K.selectAll(".venn-area").data(h,I=>I.sets),W=q.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),Z=W.append("path"),J=W.append("text").attr("class","label").text(I=>V(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);l&&(Z.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:x(I.sets)).style("fill-opacity",".25"),J.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?x(I.sets):"#444"));function O(I){return typeof I.transition=="function"?I.transition("venn").duration(r):I}let _=y;z&&typeof _.transition=="function"?(_=O(y),_.selectAll("path").attrTween("d",N)):_.selectAll("path").attr("d",I=>Et(I.sets.map(C=>M[C])),d);const A=_.selectAll("text").filter(I=>I.sets in F).text(I=>V(I)).attr("x",I=>Math.floor(F[I.sets].x)).attr("y",I=>Math.floor(F[I.sets].y));u&&(z?"on"in A?A.on("end",ct(M,V)):A.each("end",ct(M,V)):A.each(ct(M,V)));const R=O(q.exit()).remove();typeof q.transition=="function"&&R.selectAll("path").attrTween("d",N);const D=R.selectAll("text").attr("x",s/2).attr("y",e/2);return m!==null&&(J.style("font-size","0px"),A.style("font-size",m),D.style("font-size","0px")),{circles:M,textCentres:F,nodes:q,enter:W,update:_,exit:R}}return a.wrap=function(y){return arguments.length?(u=y,a):u},a.useViewBox=function(){return n=!0,a},a.width=function(y){return arguments.length?(s=y,a):s},a.height=function(y){return arguments.length?(e=y,a):e},a.padding=function(y){return arguments.length?(i=y,a):i},a.distinct=function(y){return arguments.length?(b=y,a):b},a.colours=function(y){return arguments.length?(x=y,a):x},a.colors=function(y){return arguments.length?(x=y,a):x},a.fontSize=function(y){return arguments.length?(m=y,a):m},a.round=function(y){return arguments.length?(d=y,a):d},a.duration=function(y){return arguments.length?(r=y,a):r},a.layoutFunction=function(y){return arguments.length?(p=y,a):p},a.normalize=function(y){return arguments.length?(c=y,a):c},a.scaleToFit=function(y){return arguments.length?(f=y,a):f},a.styled=function(y){return arguments.length?(l=y,a):l},a.orientation=function(y){return arguments.length?(o=y,a):o},a.orientationOrder=function(y){return arguments.length?(g=y,a):g},a.lossFunction=function(y){return arguments.length?(v=y==="default"?nt:y==="logRatio"?Ot:y,a):v},a}function ct(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),f=(r.length+o.length)/3;let u=o.pop(),l=[u],m=0;const g=1.1;e.textContent=null;const b=[];function d(x){const p=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return p.textContent=x,b.push(p),e.append(p),p}let k=d(u);for(;u=o.pop(),!!u;){l.push(u);const x=l.join(" ");k.textContent=x,x.length>f&&k.getComputedTextLength()>i&&(l.pop(),k.textContent=l.join(" "),l=[u],k=d(u),m++)}const T=.35-m*g/2,E=e.getAttribute("x"),w=e.getAttribute("y");b.forEach((x,p)=>{x.setAttribute("x",E),x.setAttribute("y",w),x.setAttribute("dy",`${T+p*g}em`)})}}function ut(t,n,s){let e=n[0].radius-G(n[0],t);for(let i=1;i<n.length;++i){const r=n[i].radius-G(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){const r=G(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}function Vt(t,n,s){const e=[];for(const l of t)e.push({x:l.x,y:l.y}),e.push({x:l.x+l.radius/2,y:l.y}),e.push({x:l.x-l.radius/2,y:l.y}),e.push({x:l.x,y:l.y+l.radius/2}),e.push({x:l.x,y:l.y-l.radius/2});let i=e[0],r=ut(e[0],t,n);for(let l=1;l<e.length;++l){const m=ut(e[l],t,n);m>=r&&(i=e[l],r=m)}const o=Ct(l=>-1*ut({x:l[0],y:l[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,c={x:s?0:o[0],y:o[1]};let f=!0;for(const l of t)if(G(c,l)>l.radius){f=!1;break}for(const l of n)if(G(c,l)<l.radius){f=!1;break}if(f)return c;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return it(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Vt(t,[]):Rt(u.arcs.map(l=>l.p1))}function we(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],r=t[i];for(let o=e+1;o<s.length;++o){const c=s[o],f=t[c],u=G(r,f);u+f.radius<=r.radius+1e-10?n[c].push(i):u+r.radius<=f.radius+1e-10&&n[i].push(c)}}return n}function Bt(t,n,s){const e={},i=we(t);for(let r=0;r<n.length;++r){const o=n[r].sets,c={},f={};for(let g=0;g<o.length;++g){c[o[g]]=!0;const b=i[o[g]];for(let d=0;d<b.length;++d)f[b[d]]=!0}const u=[],l=[];for(let g in t)g in c?u.push(t[g]):g in f||l.push(t[g]);const m=Vt(u,l,s);e[o]=m,m.disjoint&&n[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function Se(t,n,s){const e=[];return e.push(`
|
|
2
2
|
M`,t,n),e.push(`
|
|
3
3
|
m`,-s,0),e.push(`
|
|
4
4
|
a`,s,s,0,1,0,s*2,0),e.push(`
|
|
5
5
|
a`,s,s,0,1,0,-s*2,0),e.join(" ")}function _e(t){const n=t.split(" ");return{x:Number.parseFloat(n[1]),y:Number.parseFloat(n[2]),radius:-Number.parseFloat(n[4])}}function qt(t){if(t.length===0)return[];const n={};return it(t,n),n.arcs}function Ut(t,n){if(t.length===0)return"M 0 0";const s=Math.pow(10,n||0),e=n!=null?r=>Math.round(r*s)/s:r=>r;if(t.length==1){const r=t[0].circle;return Se(e(r.x),e(r.y),e(r.radius))}const i=[`
|
|
6
6
|
M`,e(t[0].p2.x),e(t[0].p2.y)];for(const r of t){const o=e(r.circle.radius);i.push(`
|
|
7
|
-
A`,o,o,0,r.large?1:0,r.sweep?1:0,e(r.p1.x),e(r.p1.y))}return i.join(" ")}function
|
|
8
|
-
`+
|
|
9
|
-
Expecting `+P.join(", ")+", got '"+(this.terminals_[_]||_)+"'":U="Parse error on line "+(F+1)+": Unexpected "+(_==K?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(U,{text:
|
|
7
|
+
A`,o,o,0,r.large?1:0,r.sweep?1:0,e(r.p1.x),e(r.p1.y))}return i.join(" ")}function Et(t,n){return Ut(qt(t),n)}function Ee(t,n={}){const{lossFunction:s,layoutFunction:e=Dt,normalize:i=!0,orientation:r=Math.PI/2,orientationOrder:o,width:c=600,height:f=350,padding:u=15,scaleToFit:l=!1,symmetricalTextCentre:m=!1,distinct:g,round:b=2}=n;let d=e(t,{lossFunction:s==="default"||!s?nt:s==="logRatio"?Ot:s,distinct:g});i&&(d=Ft(d,r,o));const k=Lt(d,c,f,u,l),T=Bt(k,t,m),E=new Map(Object.keys(k).map(p=>[p,{set:p,x:k[p].x,y:k[p].y,radius:k[p].radius}])),w=t.map(p=>{const v=p.sets.map(h=>E.get(h)),a=qt(v),y=Ut(a,b);return{circles:v,arcs:a,path:y,area:p,has:new Set(p.sets)}});function x(p){let v="";for(const a of w)a.has.size>p.length&&p.every(y=>a.has.has(y))&&(v+=" "+a.path);return v}return w.map(({circles:p,arcs:v,path:a,area:y})=>({data:y,text:T[y.sets],circles:p,arcs:v,path:a,distinctPath:a+x(y.sets)}))}var pt=function(){var t=S(function(w,x,p,v){for(p=p||{},v=w.length;v--;p[w[v]]=x);return p},"o"),n=[5,8],s=[7,8,11,12,17,19,22,24],e=[1,17],i=[1,18],r=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],o=[1,31],c=[1,39],f=[7,8,11,12,17,19,22,24,27],u=[1,57],l=[1,56],m=[1,58],g=[1,59],b=[1,60],d=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],k={trace:S(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:S(function(x,p,v,a,y,h,j){var M=h.length-1;switch(y){case 1:return h[M-1];case 2:case 3:case 4:this.$=[];break;case 5:h[M-1].push(h[M]),this.$=h[M-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=h[M];break;case 8:a.setDiagramTitle(h[M].substr(6)),this.$=h[M].substr(6);break;case 9:a.addSubsetData([h[M]],void 0,void 0),a.setIndentMode&&a.setIndentMode(!0);break;case 10:a.addSubsetData([h[M-1]],h[M],void 0),a.setIndentMode&&a.setIndentMode(!0);break;case 11:a.addSubsetData([h[M-2]],void 0,parseFloat(h[M])),a.setIndentMode&&a.setIndentMode(!0);break;case 12:a.addSubsetData([h[M-3]],h[M-2],parseFloat(h[M])),a.setIndentMode&&a.setIndentMode(!0);break;case 13:if(h[M].length<2)throw new Error("union requires multiple identifiers");a.validateUnionIdentifiers&&a.validateUnionIdentifiers(h[M]),a.addSubsetData(h[M],void 0,void 0),a.setIndentMode&&a.setIndentMode(!0);break;case 14:if(h[M-1].length<2)throw new Error("union requires multiple identifiers");a.validateUnionIdentifiers&&a.validateUnionIdentifiers(h[M-1]),a.addSubsetData(h[M-1],h[M],void 0),a.setIndentMode&&a.setIndentMode(!0);break;case 15:if(h[M-2].length<2)throw new Error("union requires multiple identifiers");a.validateUnionIdentifiers&&a.validateUnionIdentifiers(h[M-2]),a.addSubsetData(h[M-2],void 0,parseFloat(h[M])),a.setIndentMode&&a.setIndentMode(!0);break;case 16:if(h[M-3].length<2)throw new Error("union requires multiple identifiers");a.validateUnionIdentifiers&&a.validateUnionIdentifiers(h[M-3]),a.addSubsetData(h[M-3],h[M-2],parseFloat(h[M])),a.setIndentMode&&a.setIndentMode(!0);break;case 17:case 18:case 19:a.addTextData(h[M-1],h[M],void 0);break;case 20:case 21:a.addTextData(h[M-2],h[M-1],h[M]);break;case 23:a.addStyleData(h[M-1],h[M]);break;case 24:case 25:case 26:var F=a.getCurrentSets();if(!F)throw new Error("text requires set");a.addTextData(F,h[M],void 0);break;case 27:case 28:var F=a.getCurrentSets();if(!F)throw new Error("text requires set");a.addTextData(F,h[M-1],h[M]);break;case 29:case 41:this.$=[h[M]];break;case 30:case 42:this.$=[...h[M-2],h[M]];break;case 31:this.$=[h[M-2],h[M]];break;case 33:this.$=h[M].join(" ");break;case 34:this.$=[h[M]];break;case 35:h[M-1].push(h[M]),this.$=h[M-1];break;case 43:case 44:this.$=h[M];break}},"anonymous"),table:[t(n,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(s,[2,4],{6:5}),t(n,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(s,[2,5]),t(s,[2,6]),t(s,[2,7]),t(s,[2,8]),{13:16,20:e,21:i},{13:20,18:19,20:e,21:i},{13:20,18:21,20:e,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:e,21:i},t(s,[2,9],{14:[1,27],15:[1,28]}),t(r,[2,43]),t(r,[2,44]),t(s,[2,13],{14:[1,29],15:[1,30],27:o}),t(r,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:o},t(s,[2,22]),t(s,[2,24],{14:[1,35]}),t(s,[2,25],{14:[1,36]}),t(s,[2,26]),{20:c,25:37,26:38,27:o},t(s,[2,10],{15:[1,40]}),{16:[1,41]},t(s,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:e,21:i},t(s,[2,17],{14:[1,45]}),t(s,[2,18],{14:[1,46]}),t(s,[2,19]),t(s,[2,27]),t(s,[2,28]),t(s,[2,23],{27:[1,47]}),t(f,[2,29]),{15:[1,48]},{16:[1,49]},t(s,[2,11]),{16:[1,50]},t(s,[2,15]),t(r,[2,42]),t(s,[2,20]),t(s,[2,21]),{20:c,26:51},{16:u,20:l,21:[1,53],28:52,29:54,30:55,31:m,32:g,33:b},t(s,[2,12]),t(s,[2,16]),t(f,[2,30]),t(f,[2,31]),t(f,[2,32]),t(f,[2,33],{30:61,16:u,20:l,31:m,32:g,33:b}),t(d,[2,34]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),t(d,[2,39]),t(d,[2,40]),t(d,[2,35])],defaultActions:{6:[2,1]},parseError:S(function(x,p){if(p.recoverable)this.trace(x);else{var v=new Error(x);throw v.hash=p,v}},"parseError"),parse:S(function(x){var p=this,v=[0],a=[],y=[null],h=[],j=this.table,M="",F=0,Y=0,V=2,K=1,H=h.slice.call(arguments,1),z=Object.create(this.lexer),N={yy:{}};for(var q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,q)&&(N.yy[q]=this.yy[q]);z.setInput(x,N.yy),N.yy.lexer=z,N.yy.parser=this,typeof z.yylloc=="undefined"&&(z.yylloc={});var W=z.yylloc;h.push(W);var Z=z.options&&z.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function J(L){v.length=v.length-2*L,y.length=y.length-L,h.length=h.length-L}S(J,"popStack");function O(){var L;return L=a.pop()||z.lex()||K,typeof L!="number"&&(L instanceof Array&&(a=L,L=a.pop()),L=p.symbols_[L]||L),L}S(O,"lex");for(var _,A,R,D,I={},C,B,X,P;;){if(A=v[v.length-1],this.defaultActions[A]?R=this.defaultActions[A]:((_===null||typeof _=="undefined")&&(_=O()),R=j[A]&&j[A][_]),typeof R=="undefined"||!R.length||!R[0]){var U="";P=[];for(C in j[A])this.terminals_[C]&&C>V&&P.push("'"+this.terminals_[C]+"'");z.showPosition?U="Parse error on line "+(F+1)+`:
|
|
8
|
+
`+z.showPosition()+`
|
|
9
|
+
Expecting `+P.join(", ")+", got '"+(this.terminals_[_]||_)+"'":U="Parse error on line "+(F+1)+": Unexpected "+(_==K?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(U,{text:z.match,token:this.terminals_[_]||_,line:z.yylineno,loc:W,expected:P})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+_);switch(R[0]){case 1:v.push(_),y.push(z.yytext),h.push(z.yylloc),v.push(R[1]),_=null,Y=z.yyleng,M=z.yytext,F=z.yylineno,W=z.yylloc;break;case 2:if(B=this.productions_[R[1]][1],I.$=y[y.length-B],I._$={first_line:h[h.length-(B||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(B||1)].first_column,last_column:h[h.length-1].last_column},Z&&(I._$.range=[h[h.length-(B||1)].range[0],h[h.length-1].range[1]]),D=this.performAction.apply(I,[M,Y,F,N.yy,R[1],y,h].concat(H)),typeof D!="undefined")return D;B&&(v=v.slice(0,-1*B*2),y=y.slice(0,-1*B),h=h.slice(0,-1*B)),v.push(this.productions_[R[1]][0]),y.push(I.$),h.push(I._$),X=j[v[v.length-2]][v[v.length-1]],v.push(X);break;case 3:return!0}}return!0},"parse")},T=function(){var w={EOF:1,parseError:S(function(p,v){if(this.yy.parser)this.yy.parser.parseError(p,v);else throw new Error(p)},"parseError"),setInput:S(function(x,p){return this.yy=p||this.yy||{},this._input=x,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 x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var p=x.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:S(function(x){var p=x.length,v=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var a=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),v.length-1&&(this.yylineno-=v.length-1);var y=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:v?(v.length===a.length?this.yylloc.first_column:0)+a[a.length-v.length].length-v[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:S(function(){return this._more=!0,this},"more"),reject:S(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
10
10
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:S(function(x){this.unput(this.match.slice(x))},"less"),pastInput:S(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:S(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:S(function(){var x=this.pastInput(),p=new Array(x.length+1).join("-");return x+this.upcomingInput()+`
|
|
11
11
|
`+p+"^"},"showPosition"),test_match:S(function(x,p){var v,a,y;if(this.options.backtrack_lexer&&(y={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&&(y.yylloc.range=this.yylloc.range.slice(0))),a=x[0].match(/(?:\r\n?|\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,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(x[0].length),this.matched+=x[0],v=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),v)return v;if(this._backtrack){for(var h in y)this[h]=y[h];return!1}return!1},"test_match"),next:S(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,p,v,a;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),h=0;h<y.length;h++)if(v=this._input.match(this.rules[y[h]]),v&&(!p||v[0].length>p[0].length)){if(p=v,a=h,this.options.backtrack_lexer){if(x=this.test_match(v,y[h]),x!==!1)return x;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(x=this.test_match(p,y[a]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
12
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:S(function(){var p=this.next();return p||this.lex()},"lex"),begin:S(function(p){this.conditionStack.push(p)},"begin"),popState:S(function(){var p=this.conditionStack.length-1;return p>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(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:S(function(p){this.begin(p)},"pushState"),stateStackSize:S(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:S(function(p,v,a,y){switch(a){case 0:break;case 1:break;case 2:break;case 3:if(p.getIndentMode&&p.getIndentMode())return p.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:p.setIndentMode&&p.setIndentMode(!1),this.begin("INITIAL"),this.unput(v.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(p.consumeIndentText)p.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return v.yytext=v.yytext.slice(2,-2),14;case 17:return v.yytext=v.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return w}();k.lexer=
|
|
12
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:S(function(){var p=this.next();return p||this.lex()},"lex"),begin:S(function(p){this.conditionStack.push(p)},"begin"),popState:S(function(){var p=this.conditionStack.length-1;return p>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(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:S(function(p){this.begin(p)},"pushState"),stateStackSize:S(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:S(function(p,v,a,y){switch(a){case 0:break;case 1:break;case 2:break;case 3:if(p.getIndentMode&&p.getIndentMode())return p.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:p.setIndentMode&&p.setIndentMode(!1),this.begin("INITIAL"),this.unput(v.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(p.consumeIndentText)p.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return v.yytext=v.yytext.slice(2,-2),14;case 17:return v.yytext=v.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return w}();k.lexer=T;function E(){this.yy={}}return S(E,"Parser"),E.prototype=k,k.Parser=E,new E}();pt.parser=pt;var Te=pt,bt=[],vt=[],It=[],kt=new Set,Mt,wt=!1,ze=S((t,n,s)=>{const e=rt(t).sort(),i=s!=null?s:10/Math.pow(t.length,2);Mt=e,e.length===1&&kt.add(e[0]),bt.push({sets:e,size:i,label:n?st(n):void 0})},"addSubsetData"),Ae=S(()=>bt,"getSubsetData"),st=S(t=>{const n=t.trim();return n.length>=2&&n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):n},"normalizeText"),Re=S(t=>t&&st(t),"normalizeStyleValue"),Ce=S((t,n,s)=>{const e=st(n);vt.push({sets:rt(t).sort(),id:e,label:s?st(s):void 0})},"addTextData"),De=S((t,n)=>{var i;const s=rt(t).sort(),e={};for(const[r,o]of n)e[r]=(i=Re(o))!=null?i:o;It.push({targets:s,styles:e})},"addStyleData"),Ne=S(()=>It,"getStyleData"),rt=S(t=>t.map(n=>st(n)),"normalizeIdentifierList"),Oe=S(t=>{const s=rt(t).filter(e=>!kt.has(e));if(s.length>0)throw new Error(`unknown set identifier: ${s.join(", ")}`)},"validateUnionIdentifiers"),Fe=S(()=>vt,"getTextData"),Le=S(()=>Mt,"getCurrentSets"),je=S(()=>wt,"getIndentMode"),Pe=S(t=>{wt=t},"setIndentMode"),Ve=ce.venn;function Gt(){return le(Ve,Tt().venn)}S(Gt,"getConfig");var Be=S(()=>{ae(),bt.length=0,vt.length=0,It.length=0,kt.clear(),Mt=void 0,wt=!1},"customClear"),qe={getConfig:Gt,clear:Be,setAccTitle:te,getAccTitle:$t,setDiagramTitle:Qt,getDiagramTitle:Jt,getAccDescription:Zt,setAccDescription:Xt,addSubsetData:ze,getSubsetData:Ae,addTextData:Ce,addStyleData:De,validateUnionIdentifiers:Oe,getTextData:Fe,getStyleData:Ne,getCurrentSets:Le,getIndentMode:je,setIndentMode:Pe},Ue=S(t=>`
|
|
13
13
|
.venn-title {
|
|
14
14
|
font-size: 32px;
|
|
15
15
|
fill: ${t.vennTitleTextColor};
|
|
@@ -31,4 +31,4 @@ Expecting `+P.join(", ")+", got '"+(this.terminals_[_]||_)+"'":U="Parse error on
|
|
|
31
31
|
font-family: ${t.fontFamily};
|
|
32
32
|
color: ${t.vennSetTextColor};
|
|
33
33
|
}
|
|
34
|
-
`,"getStyles"),Ge=Ue;function Wt(t){const n=new Map;for(const s of t){const e=s.targets.join("|"),i=n.get(e);i?Object.assign(i,s.styles):n.set(e,{...s.styles})}return n}S(Wt,"buildStyleByKey");var We=S((t,n,s,e)=>{var K,H,
|
|
34
|
+
`,"getStyles"),Ge=Ue;function Wt(t){const n=new Map;for(const s of t){const e=s.targets.join("|"),i=n.get(e);i?Object.assign(i,s.styles):n.set(e,{...s.styles})}return n}S(Wt,"buildStyleByKey");var We=S((t,n,s,e)=>{var K,H,z,N,q,W,Z,J;const i=e.db,r=(K=i.getConfig)==null?void 0:K.call(i),{themeVariables:o,look:c,handDrawnSeed:f}=Tt(),u=c==="handDrawn",l=[o.venn1,o.venn2,o.venn3,o.venn4,o.venn5,o.venn6,o.venn7,o.venn8].filter(Boolean),m=(H=i.getDiagramTitle)==null?void 0:H.call(i),g=i.getSubsetData(),b=i.getTextData(),d=Wt(i.getStyleData()),k=(z=r==null?void 0:r.width)!=null?z:800,T=(N=r==null?void 0:r.height)!=null?N:450,w=k/1600,x=m?48*w:0,p=(q=o.primaryTextColor)!=null?q:o.textColor,v=ee(n);v.attr("viewBox",`0 0 ${k} ${T}`),m&&v.append("text").text(m).attr("class","venn-title").attr("font-size",`${32*w}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*w).style("fill",o.vennTitleTextColor||o.titleColor);const a=lt(document.createElement("div")),y=Me().width(k).height(T-x);a.datum(g).call(y);const h=u?ne.svg(a.select("svg").node()):void 0,j=Ee(g,{width:k,height:T-x,padding:(W=r==null?void 0:r.padding)!=null?W:15}),M=new Map;for(const O of j){const _=$([...O.data.sets].sort());M.set(_,O)}b.length>0&&Kt(r,M,a,b,w,d);const F=se(o.background||"#f4f4f4");a.selectAll(".venn-circle").each(function(O,_){var L,tt;const A=lt(this),D=$([...O.sets].sort()),I=d.get(D),C=(I==null?void 0:I.fill)||l[_%l.length]||o.primaryColor;A.classed(`venn-set-${_%8}`,!0);const B=(L=I==null?void 0:I["fill-opacity"])!=null?L:.1,X=(I==null?void 0:I.stroke)||C,P=(I==null?void 0:I["stroke-width"])||`${5*w}`;if(u&&h){const ot=M.get(D);if(ot&&ot.circles.length>0){const at=ot.circles[0],Ht=h.circle(at.x,at.y,at.radius*2,{roughness:.7,seed:f,fill:St(C,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+_*60,stroke:X,strokeWidth:parseFloat(String(P))});A.select("path").remove(),(tt=A.node())==null||tt.insertBefore(Ht,A.select("text").node())}}else A.select("path").style("fill",C).style("fill-opacity",B).style("stroke",X).style("stroke-width",P).style("stroke-opacity",.95);const U=(I==null?void 0:I.color)||(F?ie(C,30):re(C,30));A.select("text").style("font-size",`${48*w}px`).style("fill",U)}),u&&h?a.selectAll(".venn-intersection").each(function(O){var C,B,X;const _=lt(this),R=$([...O.sets].sort()),D=d.get(R),I=D==null?void 0:D.fill;if(I){const P=_.select("path"),U=P.attr("d");if(U){const L=h.path(U,{roughness:.7,seed:f,fill:St(I,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),tt=P.node();(C=tt==null?void 0:tt.parentNode)==null||C.insertBefore(L,tt),P.remove()}}else _.select("path").style("fill-opacity",0);_.select("text").style("font-size",`${48*w}px`).style("fill",(X=(B=D==null?void 0:D.color)!=null?B:o.vennSetTextColor)!=null?X:p)}):(a.selectAll(".venn-intersection text").style("font-size",`${48*w}px`).style("fill",O=>{var R,D,I;const A=$([...O.sets].sort());return(I=(D=(R=d.get(A))==null?void 0:R.color)!=null?D:o.vennSetTextColor)!=null?I:p}),a.selectAll(".venn-intersection path").style("fill-opacity",O=>{var R;const A=$([...O.sets].sort());return(R=d.get(A))!=null&&R.fill?1:0}).style("fill",O=>{var R,D;const A=$([...O.sets].sort());return(D=(R=d.get(A))==null?void 0:R.fill)!=null?D:"transparent"}));const Y=v.append("g").attr("transform",`translate(0, ${x})`),V=a.select("svg").node();if(V&&"childNodes"in V)for(const O of[...V.childNodes])(Z=Y.node())==null||Z.appendChild(O);oe(v,T,k,(J=r==null?void 0:r.useMaxWidth)!=null?J:!0)},"draw");function $(t){return t.join("|")}S($,"stableSetsKey");function Kt(t,n,s,e,i,r){var l,m,g;const o=(l=t==null?void 0:t.useDebugLayout)!=null?l:!1,f=s.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const b of e){const d=$(b.sets),k=u.get(d);k?k.push(b):u.set(d,[b])}for(const[b,d]of u.entries()){const k=n.get(b);if(!(k!=null&&k.text))continue;const T=k.text.x,E=k.text.y,w=Math.min(...k.circles.map(N=>N.radius)),x=Math.min(...k.circles.map(N=>N.radius-Math.hypot(T-N.x,E-N.y)));let p=Number.isFinite(x)?Math.max(0,x):0;p===0&&Number.isFinite(w)&&(p=w*.6);const v=f.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);o&&v.append("circle").attr("class","venn-text-debug-circle").attr("cx",T).attr("cy",E).attr("r",p).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const a=Math.max(80*i,p*2*.95),y=Math.max(60*i,p*2*.95),M=(k.data.label&&k.data.label.length>0?Math.min(32*i,p*.25):0)+(d.length<=2?30*i:0),F=T-a/2,Y=E-y/2+M,V=Math.max(1,Math.ceil(Math.sqrt(d.length))),K=Math.max(1,Math.ceil(d.length/V)),H=a/V,z=y/K;for(const[N,q]of d.entries()){const W=N%V,Z=Math.floor(N/V),J=F+H*(W+.5),O=Y+z*(Z+.5);o&&v.append("rect").attr("class","venn-text-debug-cell").attr("x",F+H*W).attr("y",Y+z*Z).attr("width",H).attr("height",z).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const _=H*.9,A=z*.9,R=v.append("foreignObject").attr("class","venn-text-node-fo").attr("width",_).attr("height",A).attr("x",J-_/2).attr("y",O-A/2).attr("overflow","visible"),D=(m=r.get(q.id))==null?void 0:m.color,I=R.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text((g=q.label)!=null?g:q.id);D&&I.style("color",D)}}}S(Kt,"renderTextNodes");var Ke={draw:We},Xe={parser:Te,db:qe,renderer:Ke,styles:Ge};export{Xe as diagram};
|