(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["mermaid"] = factory(); else root["mermaid"] = factory(); })(typeof self !== "undefined" ? self : this, () => { return /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./src/diagrams/class/parser/classDiagram.jison": /*!******************************************************!*\ !*** ./src/diagrams/class/parser/classDiagram.jison ***! \******************************************************/ /***/ ((module, exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); /* parser generated by jison 0.4.18 */ /* Returns a Parser object of the following structure: Parser: { yy: {} } Parser.prototype: { yy: {}, trace: function(), symbols_: {associative list: name ==> number}, terminals_: {associative list: number ==> name}, productions_: [...], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), table: [...], defaultActions: {...}, parseError: function(str, hash), parse: function(input), lexer: { EOF: 1, parseError: function(str, hash), setInput: function(input), input: function(), unput: function(str), more: function(), less: function(n), pastInput: function(), upcomingInput: function(), showPosition: function(), test_match: function(regex_match_array, rule_index), next: function(), lex: function(), begin: function(condition), popState: function(), _currentRules: function(), topState: function(), pushState: function(condition), options: { ranges: boolean (optional: true ==> token location info will include a .range[] member) flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) }, performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), rules: [...], conditions: {associative list: name ==> set}, } } token location info (@$, _$, etc.): { first_line: n, last_line: n, first_column: n, last_column: n, range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) } the parseError function receives a 'hash' object with these members for lexer and parser errors: { text: (matched text) token: (the produced terminal token, if any) line: (yylineno) } while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { loc: (yylloc) expected: (string describing the set of expected tokens) recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) } */ var parser = (function(){ var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,7],$V2=[1,8],$V3=[1,9],$V4=[1,10],$V5=[1,13],$V6=[1,12],$V7=[1,16,25],$V8=[1,20],$V9=[1,31],$Va=[1,32],$Vb=[1,34],$Vc=[1,37],$Vd=[1,35],$Ve=[1,36],$Vf=[1,38],$Vg=[1,39],$Vh=[1,40],$Vi=[1,41],$Vj=[1,44],$Vk=[1,45],$Vl=[1,46],$Vm=[1,47],$Vn=[16,25],$Vo=[1,59],$Vp=[1,60],$Vq=[1,61],$Vr=[1,62],$Vs=[1,63],$Vt=[1,64],$Vu=[16,25,32,41,42,50,53,54,55,56,57,58,63,65],$Vv=[16,25,30,32,41,42,46,50,53,54,55,56,57,58,63,65,80,81,82,83],$Vw=[5,8,9,10,11,16,19,23,25],$Vx=[50,80,81,82,83],$Vy=[50,57,58,80,81,82,83],$Vz=[50,53,54,55,56,80,81,82,83],$VA=[16,25,32],$VB=[1,96]; var parser = {trace: function trace () { }, yy: {}, symbols_: {"error":2,"start":3,"mermaidDoc":4,"statments":5,"direction":6,"directive":7,"direction_tb":8,"direction_bt":9,"direction_rl":10,"direction_lr":11,"graphConfig":12,"openDirective":13,"typeDirective":14,"closeDirective":15,"NEWLINE":16,":":17,"argDirective":18,"open_directive":19,"type_directive":20,"arg_directive":21,"close_directive":22,"CLASS_DIAGRAM":23,"statements":24,"EOF":25,"statement":26,"className":27,"alphaNumToken":28,"classLiteralName":29,"GENERICTYPE":30,"relationStatement":31,"LABEL":32,"classStatement":33,"methodStatement":34,"annotationStatement":35,"clickStatement":36,"cssClassStatement":37,"title":38,"accDescription":39,"CLASS":40,"STYLE_SEPARATOR":41,"STRUCT_START":42,"members":43,"STRUCT_STOP":44,"ANNOTATION_START":45,"ANNOTATION_END":46,"MEMBER":47,"SEPARATOR":48,"relation":49,"STR":50,"relationType":51,"lineType":52,"AGGREGATION":53,"EXTENSION":54,"COMPOSITION":55,"DEPENDENCY":56,"LINE":57,"DOTTED_LINE":58,"CALLBACK":59,"LINK":60,"LINK_TARGET":61,"CLICK":62,"CALLBACK_NAME":63,"CALLBACK_ARGS":64,"HREF":65,"CSSCLASS":66,"commentToken":67,"textToken":68,"graphCodeTokens":69,"textNoTagsToken":70,"TAGSTART":71,"TAGEND":72,"==":73,"--":74,"PCT":75,"DEFAULT":76,"SPACE":77,"MINUS":78,"keywords":79,"UNICODE_TEXT":80,"NUM":81,"ALPHA":82,"BQUOTE_STR":83,"$accept":0,"$end":1}, terminals_: {2:"error",5:"statments",8:"direction_tb",9:"direction_bt",10:"direction_rl",11:"direction_lr",16:"NEWLINE",17:":",19:"open_directive",20:"type_directive",21:"arg_directive",22:"close_directive",23:"CLASS_DIAGRAM",25:"EOF",30:"GENERICTYPE",32:"LABEL",38:"title",39:"accDescription",40:"CLASS",41:"STYLE_SEPARATOR",42:"STRUCT_START",44:"STRUCT_STOP",45:"ANNOTATION_START",46:"ANNOTATION_END",47:"MEMBER",48:"SEPARATOR",50:"STR",53:"AGGREGATION",54:"EXTENSION",55:"COMPOSITION",56:"DEPENDENCY",57:"LINE",58:"DOTTED_LINE",59:"CALLBACK",60:"LINK",61:"LINK_TARGET",62:"CLICK",63:"CALLBACK_NAME",64:"CALLBACK_ARGS",65:"HREF",66:"CSSCLASS",69:"graphCodeTokens",71:"TAGSTART",72:"TAGEND",73:"==",74:"--",75:"PCT",76:"DEFAULT",77:"SPACE",78:"MINUS",79:"keywords",80:"UNICODE_TEXT",81:"NUM",82:"ALPHA",83:"BQUOTE_STR"}, productions_: [0,[3,1],[3,1],[3,1],[3,2],[6,1],[6,1],[6,1],[6,1],[4,1],[7,4],[7,6],[13,1],[14,1],[18,1],[15,1],[12,4],[24,1],[24,2],[24,3],[27,1],[27,1],[27,2],[27,2],[27,2],[26,1],[26,2],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[33,2],[33,4],[33,5],[33,7],[35,4],[43,1],[43,2],[34,1],[34,2],[34,1],[34,1],[31,3],[31,4],[31,4],[31,5],[49,3],[49,2],[49,2],[49,1],[51,1],[51,1],[51,1],[51,1],[52,1],[52,1],[36,3],[36,4],[36,3],[36,4],[36,4],[36,5],[36,3],[36,4],[36,4],[36,5],[36,3],[36,4],[36,4],[36,5],[37,3],[67,1],[67,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[70,1],[70,1],[70,1],[70,1],[28,1],[28,1],[28,1],[29,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { case 5: yy.setDirection('TB'); break; case 6: yy.setDirection('BT'); break; case 7: yy.setDirection('RL'); break; case 8: yy.setDirection('LR'); break; case 12: yy.parseDirective('%%{', 'open_directive'); break; case 13: yy.parseDirective($$[$0], 'type_directive'); break; case 14: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); break; case 15: yy.parseDirective('}%%', 'close_directive', 'class'); break; case 20: case 21: this.$=$$[$0]; break; case 22: this.$=$$[$0-1]+$$[$0]; break; case 23: case 24: this.$=$$[$0-1]+'~'+$$[$0]; break; case 25: yy.addRelation($$[$0]); break; case 26: $$[$0-1].title = yy.cleanupLabel($$[$0]); yy.addRelation($$[$0-1]); break; case 34: yy.setTitle($$[$0].substring(6));this.$=$$[$0].substring(6); break; case 35: yy.setAccDescription($$[$0].substring(15));this.$=$$[$0].substring(15); break; case 36: yy.addClass($$[$0]); break; case 37: yy.addClass($$[$0-2]);yy.setCssClass($$[$0-2], $$[$0]); break; case 38: /*console.log($$[$0-3],JSON.stringify($$[$0-1]));*/yy.addClass($$[$0-3]);yy.addMembers($$[$0-3],$$[$0-1]); break; case 39: yy.addClass($$[$0-5]);yy.setCssClass($$[$0-5], $$[$0-3]);yy.addMembers($$[$0-5],$$[$0-1]); break; case 40: yy.addAnnotation($$[$0],$$[$0-2]); break; case 41: this.$ = [$$[$0]]; break; case 42: $$[$0].push($$[$0-1]);this.$=$$[$0]; break; case 43: /*console.log('Rel found',$$[$0]);*/ break; case 44: yy.addMember($$[$0-1],yy.cleanupLabel($$[$0])); break; case 45: /*console.warn('Member',$$[$0]);*/ break; case 46: /*console.log('sep found',$$[$0]);*/ break; case 47: this.$ = {'id1':$$[$0-2],'id2':$$[$0], relation:$$[$0-1], relationTitle1:'none', relationTitle2:'none'}; break; case 48: this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-1], relationTitle1:$$[$0-2], relationTitle2:'none'} break; case 49: this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-2], relationTitle1:'none', relationTitle2:$$[$0-1]}; break; case 50: this.$ = {id1:$$[$0-4], id2:$$[$0], relation:$$[$0-2], relationTitle1:$$[$0-3], relationTitle2:$$[$0-1]} break; case 51: this.$={type1:$$[$0-2],type2:$$[$0],lineType:$$[$0-1]}; break; case 52: this.$={type1:'none',type2:$$[$0],lineType:$$[$0-1]}; break; case 53: this.$={type1:$$[$0-1],type2:'none',lineType:$$[$0]}; break; case 54: this.$={type1:'none',type2:'none',lineType:$$[$0]}; break; case 55: this.$=yy.relationType.AGGREGATION; break; case 56: this.$=yy.relationType.EXTENSION; break; case 57: this.$=yy.relationType.COMPOSITION; break; case 58: this.$=yy.relationType.DEPENDENCY; break; case 59: this.$=yy.lineType.LINE; break; case 60: this.$=yy.lineType.DOTTED_LINE; break; case 61: case 67: this.$ = $$[$0-2];yy.setClickEvent($$[$0-1], $$[$0]); break; case 62: case 68: this.$ = $$[$0-3];yy.setClickEvent($$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-2], $$[$0]); break; case 63: case 71: this.$ = $$[$0-2];yy.setLink($$[$0-1], $$[$0]); break; case 64: this.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1],$$[$0]); break; case 65: case 73: this.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-2], $$[$0]); break; case 66: case 74: this.$ = $$[$0-4];yy.setLink($$[$0-3], $$[$0-2], $$[$0]);yy.setTooltip($$[$0-3], $$[$0-1]); break; case 69: this.$ = $$[$0-3];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]); break; case 70: this.$ = $$[$0-4];yy.setClickEvent($$[$0-3], $$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-3], $$[$0]); break; case 72: this.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1], $$[$0]); break; case 75: yy.setCssClass($$[$0-1], $$[$0]); break; } }, table: [{3:1,4:2,5:$V0,6:4,7:5,8:$V1,9:$V2,10:$V3,11:$V4,12:6,13:11,19:$V5,23:$V6},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{3:14,4:2,5:$V0,6:4,7:5,8:$V1,9:$V2,10:$V3,11:$V4,12:6,13:11,19:$V5,23:$V6},{1:[2,9]},o($V7,[2,5]),o($V7,[2,6]),o($V7,[2,7]),o($V7,[2,8]),{14:15,20:[1,16]},{16:[1,17]},{20:[2,12]},{1:[2,4]},{15:18,17:[1,19],22:$V8},o([17,22],[2,13]),{6:30,7:29,8:$V1,9:$V2,10:$V3,11:$V4,13:11,19:$V5,24:21,26:22,27:33,28:42,29:43,31:23,33:24,34:25,35:26,36:27,37:28,38:$V9,39:$Va,40:$Vb,45:$Vc,47:$Vd,48:$Ve,59:$Vf,60:$Vg,62:$Vh,66:$Vi,80:$Vj,81:$Vk,82:$Vl,83:$Vm},{16:[1,48]},{18:49,21:[1,50]},{16:[2,15]},{25:[1,51]},{16:[1,52],25:[2,17]},o($Vn,[2,25],{32:[1,53]}),o($Vn,[2,27]),o($Vn,[2,28]),o($Vn,[2,29]),o($Vn,[2,30]),o($Vn,[2,31]),o($Vn,[2,32]),o($Vn,[2,33]),o($Vn,[2,34]),o($Vn,[2,35]),o($Vn,[2,43],{49:54,51:57,52:58,32:[1,56],50:[1,55],53:$Vo,54:$Vp,55:$Vq,56:$Vr,57:$Vs,58:$Vt}),{27:65,28:42,29:43,80:$Vj,81:$Vk,82:$Vl,83:$Vm},o($Vn,[2,45]),o($Vn,[2,46]),{28:66,80:$Vj,81:$Vk,82:$Vl},{27:67,28:42,29:43,80:$Vj,81:$Vk,82:$Vl,83:$Vm},{27:68,28:42,29:43,80:$Vj,81:$Vk,82:$Vl,83:$Vm},{27:69,28:42,29:43,80:$Vj,81:$Vk,82:$Vl,83:$Vm},{50:[1,70]},o($Vu,[2,20],{28:42,29:43,27:71,30:[1,72],80:$Vj,81:$Vk,82:$Vl,83:$Vm}),o($Vu,[2,21],{30:[1,73]}),o($Vv,[2,89]),o($Vv,[2,90]),o($Vv,[2,91]),o([16,25,30,32,41,42,50,53,54,55,56,57,58,63,65],[2,92]),o($Vw,[2,10]),{15:74,22:$V8},{22:[2,14]},{1:[2,16]},{6:30,7:29,8:$V1,9:$V2,10:$V3,11:$V4,13:11,19:$V5,24:75,25:[2,18],26:22,27:33,28:42,29:43,31:23,33:24,34:25,35:26,36:27,37:28,38:$V9,39:$Va,40:$Vb,45:$Vc,47:$Vd,48:$Ve,59:$Vf,60:$Vg,62:$Vh,66:$Vi,80:$Vj,81:$Vk,82:$Vl,83:$Vm},o($Vn,[2,26]),{27:76,28:42,29:43,50:[1,77],80:$Vj,81:$Vk,82:$Vl,83:$Vm},{49:78,51:57,52:58,53:$Vo,54:$Vp,55:$Vq,56:$Vr,57:$Vs,58:$Vt},o($Vn,[2,44]),{52:79,57:$Vs,58:$Vt},o($Vx,[2,54],{51:80,53:$Vo,54:$Vp,55:$Vq,56:$Vr}),o($Vy,[2,55]),o($Vy,[2,56]),o($Vy,[2,57]),o($Vy,[2,58]),o($Vz,[2,59]),o($Vz,[2,60]),o($Vn,[2,36],{41:[1,81],42:[1,82]}),{46:[1,83]},{50:[1,84]},{50:[1,85]},{63:[1,86],65:[1,87]},{28:88,80:$Vj,81:$Vk,82:$Vl},o($Vu,[2,22]),o($Vu,[2,23]),o($Vu,[2,24]),{16:[1,89]},{25:[2,19]},o($VA,[2,47]),{27:90,28:42,29:43,80:$Vj,81:$Vk,82:$Vl,83:$Vm},{27:91,28:42,29:43,50:[1,92],80:$Vj,81:$Vk,82:$Vl,83:$Vm},o($Vx,[2,53],{51:93,53:$Vo,54:$Vp,55:$Vq,56:$Vr}),o($Vx,[2,52]),{28:94,80:$Vj,81:$Vk,82:$Vl},{43:95,47:$VB},{27:97,28:42,29:43,80:$Vj,81:$Vk,82:$Vl,83:$Vm},o($Vn,[2,61],{50:[1,98]}),o($Vn,[2,63],{50:[1,100],61:[1,99]}),o($Vn,[2,67],{50:[1,101],64:[1,102]}),o($Vn,[2,71],{50:[1,104],61:[1,103]}),o($Vn,[2,75]),o($Vw,[2,11]),o($VA,[2,49]),o($VA,[2,48]),{27:105,28:42,29:43,80:$Vj,81:$Vk,82:$Vl,83:$Vm},o($Vx,[2,51]),o($Vn,[2,37],{42:[1,106]}),{44:[1,107]},{43:108,44:[2,41],47:$VB},o($Vn,[2,40]),o($Vn,[2,62]),o($Vn,[2,64]),o($Vn,[2,65],{61:[1,109]}),o($Vn,[2,68]),o($Vn,[2,69],{50:[1,110]}),o($Vn,[2,72]),o($Vn,[2,73],{61:[1,111]}),o($VA,[2,50]),{43:112,47:$VB},o($Vn,[2,38]),{44:[2,42]},o($Vn,[2,66]),o($Vn,[2,70]),o($Vn,[2,74]),{44:[1,113]},o($Vn,[2,39])], defaultActions: {2:[2,1],3:[2,2],4:[2,3],6:[2,9],13:[2,12],14:[2,4],20:[2,15],50:[2,14],51:[2,16],75:[2,19],108:[2,42]}, parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse(input) { var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer; sharedState.yy.parser = this; if (typeof lexer.yylloc == 'undefined') { lexer.yylloc = {}; } var yyloc = lexer.yylloc; lstack.push(yyloc); var ranges = lexer.options && lexer.options.ranges; if (typeof sharedState.yy.parseError === 'function') { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function popStack(n) { stack.length = stack.length - 2 * n; vstack.length = vstack.length - n; lstack.length = lstack.length - n; } function lex() { var token; token = tstack.pop() || lexer.lex() || EOF; if (typeof token !== 'number') { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self.symbols_[token] || token; } return token; } var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == 'undefined') { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === 'undefined' || !action.length || !action[0]) { var errStr = ''; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push('\'' + this.terminals_[p] + '\''); } } if (lexer.showPosition) { errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; } else { errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); } this.parseError(errStr, { text: lexer.match, token: this.terminals_[symbol] || symbol, line: lexer.yylineno, loc: yyloc, expected: expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer.yytext); lstack.push(lexer.yylloc); stack.push(action[1]); symbol = null; if (!preErrorSymbol) { yyleng = lexer.yyleng; yytext = lexer.yytext; yylineno = lexer.yylineno; yyloc = lexer.yylloc; if (recovering > 0) { recovering--; } } else { symbol = preErrorSymbol; preErrorSymbol = null; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== 'undefined') { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; }}; /* generated by jison-lex 0.3.4 */ var lexer = (function(){ var lexer = ({ EOF:1, parseError:function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, // resets the lexer, sets new input setInput:function (input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; 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 }; if (this.options.ranges) { this.yylloc.range = [0,0]; } this.offset = 0; return this; }, // consumes and returns one char from the input input:function () { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, // unshifts one char (or a string) into the input unput:function (ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); //this.yyleng -= len; this.offset -= len; var oldLines = 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); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, // When called from action, caches matched text and appends it on next action more:function () { this._more = true; return this; }, // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject:function () { if (this.options.backtrack_lexer) { this._backtrack = true; } 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).\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, // retain first n characters of the match less:function (n) { this.unput(this.match.slice(n)); }, // displays already matched input, i.e. for error messages pastInput:function () { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); }, // displays upcoming input, i.e. for error messages upcomingInput:function () { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20-next.length); } return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); }, // displays the character position where the lexing error occurred, i.e. for error messages showPosition:function () { var pre = this.pastInput(); var c = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c + "^"; }, // test the lexed token: return FALSE when not a match, otherwise return token test_match:function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { // save context backup = { 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 }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { // recover context for (var k in backup) { this[k] = backup[k]; } return false; // rule action called reject() implying the next rule should be tested instead. } return false; }, // return next match in input next:function () { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ''; this.match = ''; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; // rule action called reject() implying a rule MISmatch. } else { // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } if (this._input === "") { return this.EOF; } else { return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, // return next match that has a token lex:function lex () { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin:function begin (condition) { this.conditionStack.push(condition); }, // pop the previously active lexer condition state off the condition stack popState:function popState () { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, // produce the lexer rule set which is active for the currently active lexer condition state _currentRules:function _currentRules () { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState:function topState (n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, // alias for begin(condition) pushState:function pushState (condition) { this.begin(condition); }, // return the number of states currently on the stack stateStackSize:function stateStackSize() { return this.conditionStack.length; }, options: {}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { var YYSTATE=YY_START; switch($avoiding_name_collisions) { case 0: this.begin('open_directive'); return 19; break; case 1:return 8; break; case 2:return 9; break; case 3:return 10; break; case 4:return 11; break; case 5: this.begin('type_directive'); return 20; break; case 6: this.popState(); this.begin('arg_directive'); return 17; break; case 7: this.popState(); this.popState(); return 22; break; case 8:return 21; break; case 9:/* skip comments */ break; case 10:/* skip comments */ break; case 11:return 38; break; case 12:return 39; break; case 13:return 16; break; case 14:/* skip whitespace */ break; case 15:return 23; break; case 16:return 23; break; case 17: this.begin("struct"); /*console.log('Starting struct');*/ return 42; break; case 18:return "EOF_IN_STRUCT"; break; case 19:return "OPEN_IN_STRUCT"; break; case 20: /*console.log('Ending struct');*/this.popState(); return 44; break; case 21:/* nothing */ break; case 22: /*console.log('lex-member: ' + yy_.yytext);*/ return "MEMBER"; break; case 23:return 40; break; case 24:return 66; break; case 25:return 59; break; case 26:return 60; break; case 27:return 62; break; case 28:return 45; break; case 29:return 46; break; case 30:this.begin("generic"); break; case 31:this.popState(); break; case 32:return "GENERICTYPE"; break; case 33:this.begin("string"); break; case 34:this.popState(); break; case 35:return "STR"; break; case 36:this.begin("bqstring"); break; case 37:this.popState(); break; case 38:return "BQUOTE_STR"; break; case 39:this.begin("href"); break; case 40:this.popState(); break; case 41:return 65; break; case 42:this.begin("callback_name"); break; case 43:this.popState(); break; case 44:this.popState(); this.begin("callback_args"); break; case 45:return 63; break; case 46:this.popState(); break; case 47:return 64; break; case 48:return 61; break; case 49:return 61; break; case 50:return 61; break; case 51:return 61; break; case 52:return 54; break; case 53:return 54; break; case 54:return 56; break; case 55:return 56; break; case 56:return 55; break; case 57:return 53; break; case 58:return 57; break; case 59:return 58; break; case 60:return 32; break; case 61:return 41; break; case 62:return 78; break; case 63:return 'DOT'; break; case 64:return 'PLUS'; break; case 65:return 75; break; case 66:return 'EQUALS'; break; case 67:return 'EQUALS'; break; case 68:return 82; break; case 69:return 'PUNCTUATION'; break; case 70:return 81; break; case 71:return 80; break; case 72:return 77; break; case 73:return 25; break; } }, rules: [/^(?:%%\{)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:[{])/,/^(?:$)/,/^(?:[{])/,/^(?:[}])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:class\b)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:[~])/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[`])/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:$)/], conditions: {"arg_directive":{"rules":[7,8],"inclusive":false},"type_directive":{"rules":[6,7],"inclusive":false},"open_directive":{"rules":[5],"inclusive":false},"callback_args":{"rules":[46,47],"inclusive":false},"callback_name":{"rules":[43,44,45],"inclusive":false},"href":{"rules":[40,41],"inclusive":false},"struct":{"rules":[18,19,20,21,22],"inclusive":false},"generic":{"rules":[31,32],"inclusive":false},"bqstring":{"rules":[37,38],"inclusive":false},"string":{"rules":[34,35],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,9,10,11,12,13,14,15,16,17,23,24,25,26,27,28,29,30,33,36,39,42,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73],"inclusive":true}} }); return lexer; })(); parser.lexer = lexer; function Parser () { this.yy = {}; } Parser.prototype = parser;parser.Parser = Parser; return new Parser; })(); if (true) { exports.parser = parser; exports.Parser = parser.Parser; exports.parse = function () { return parser.parse.apply(parser, arguments); }; exports.main = function commonjsMain (args) { if (!args[1]) { console.log('Usage: '+args[0]+' FILE'); process.exit(1); } var source = (__webpack_require__(/*! fs */ "?35ed").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); return exports.parser.parse(source); }; if ( true && __webpack_require__.c[__webpack_require__.s] === module) { exports.main(process.argv.slice(1)); } } /***/ }), /***/ "./src/diagrams/er/parser/erDiagram.jison": /*!************************************************!*\ !*** ./src/diagrams/er/parser/erDiagram.jison ***! \************************************************/ /***/ ((module, exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); /* parser generated by jison 0.4.18 */ /* Returns a Parser object of the following structure: Parser: { yy: {} } Parser.prototype: { yy: {}, trace: function(), symbols_: {associative list: name ==> number}, terminals_: {associative list: number ==> name}, productions_: [...], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), table: [...], defaultActions: {...}, parseError: function(str, hash), parse: function(input), lexer: { EOF: 1, parseError: function(str, hash), setInput: function(input), input: function(), unput: function(str), more: function(), less: function(n), pastInput: function(), upcomingInput: function(), showPosition: function(), test_match: function(regex_match_array, rule_index), next: function(), lex: function(), begin: function(condition), popState: function(), _currentRules: function(), topState: function(), pushState: function(condition), options: { ranges: boolean (optional: true ==> token location info will include a .range[] member) flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) }, performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), rules: [...], conditions: {associative list: name ==> set}, } } token location info (@$, _$, etc.): { first_line: n, last_line: n, first_column: n, last_column: n, range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) } the parseError function receives a 'hash' object with these members for lexer and parser errors: { text: (matched text) token: (the produced terminal token, if any) line: (yylineno) } while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { loc: (yylloc) expected: (string describing the set of expected tokens) recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) } */ var parser = (function(){ var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,5],$V2=[6,9,11,23,25,27,45],$V3=[1,17],$V4=[1,18],$V5=[1,19],$V6=[1,22],$V7=[1,27],$V8=[1,28],$V9=[1,29],$Va=[1,30],$Vb=[1,41],$Vc=[27,42,43],$Vd=[4,6,9,11,23,25,27,45],$Ve=[38,39,40,41],$Vf=[22,33],$Vg=[1,59]; var parser = {trace: function trace () { }, yy: {}, symbols_: {"error":2,"start":3,"ER_DIAGRAM":4,"document":5,"EOF":6,"directive":7,"line":8,"SPACE":9,"statement":10,"NEWLINE":11,"openDirective":12,"typeDirective":13,"closeDirective":14,":":15,"argDirective":16,"entityName":17,"relSpec":18,"role":19,"BLOCK_START":20,"attributes":21,"BLOCK_STOP":22,"title":23,"title_value":24,"accDescription":25,"description_value":26,"ALPHANUM":27,"attribute":28,"attributeType":29,"attributeName":30,"attributeKeyType":31,"attributeComment":32,"ATTRIBUTE_WORD":33,"ATTRIBUTE_KEY":34,"COMMENT":35,"cardinality":36,"relType":37,"ZERO_OR_ONE":38,"ZERO_OR_MORE":39,"ONE_OR_MORE":40,"ONLY_ONE":41,"NON_IDENTIFYING":42,"IDENTIFYING":43,"WORD":44,"open_directive":45,"type_directive":46,"arg_directive":47,"close_directive":48,"$accept":0,"$end":1}, terminals_: {2:"error",4:"ER_DIAGRAM",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",20:"BLOCK_START",22:"BLOCK_STOP",23:"title",24:"title_value",25:"accDescription",26:"description_value",27:"ALPHANUM",33:"ATTRIBUTE_WORD",34:"ATTRIBUTE_KEY",35:"COMMENT",38:"ZERO_OR_ONE",39:"ZERO_OR_MORE",40:"ONE_OR_MORE",41:"ONLY_ONE",42:"NON_IDENTIFYING",43:"IDENTIFYING",44:"WORD",45:"open_directive",46:"type_directive",47:"arg_directive",48:"close_directive"}, productions_: [0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,5],[10,4],[10,3],[10,1],[10,2],[10,2],[17,1],[21,1],[21,2],[28,2],[28,3],[28,3],[28,4],[29,1],[30,1],[31,1],[32,1],[18,3],[36,1],[36,1],[36,1],[36,1],[37,1],[37,1],[19,1],[19,1],[12,1],[13,1],[16,1],[14,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { case 1: /*console.log('finished parsing');*/ break; case 3: this.$ = [] break; case 4: $$[$0-1].push($$[$0]);this.$ = $$[$0-1] break; case 5: case 6: this.$ = $$[$0] break; case 7: case 8: this.$=[]; break; case 12: yy.addEntity($$[$0-4]); yy.addEntity($$[$0-2]); yy.addRelationship($$[$0-4], $$[$0], $$[$0-2], $$[$0-3]); /*console.log($$[$0-4] + $$[$0-3] + $$[$0-2] + ':' + $$[$0]);*/ break; case 13: /* console.log('detected block'); */ yy.addEntity($$[$0-3]); yy.addAttributes($$[$0-3], $$[$0-1]); /* console.log('handled block'); */ break; case 14: yy.addEntity($$[$0-2]); break; case 15: yy.addEntity($$[$0]); break; case 16: this.$=$$[$0].trim();yy.setTitle(this.$); break; case 17: this.$=$$[$0].trim();yy.setAccDescription(this.$); break; case 18: this.$ = $$[$0]; /*console.log('Entity: ' + $$[$0]);*/ break; case 19: this.$ = [$$[$0]]; break; case 20: $$[$0].push($$[$0-1]); this.$=$$[$0]; break; case 21: this.$ = { attributeType: $$[$0-1], attributeName: $$[$0] }; break; case 22: this.$ = { attributeType: $$[$0-2], attributeName: $$[$0-1], attributeKeyType: $$[$0] }; break; case 23: this.$ = { attributeType: $$[$0-2], attributeName: $$[$0-1], attributeComment: $$[$0] }; break; case 24: this.$ = { attributeType: $$[$0-3], attributeName: $$[$0-2], attributeKeyType: $$[$0-1], attributeComment: $$[$0] }; break; case 25: case 26: case 27: this.$=$$[$0]; break; case 28: this.$=$$[$0].replace(/"/g, ''); break; case 29: this.$ = { cardA: $$[$0], relType: $$[$0-1], cardB: $$[$0-2] }; /*console.log('relSpec: ' + $$[$0] + $$[$0-1] + $$[$0-2]);*/ break; case 30: this.$ = yy.Cardinality.ZERO_OR_ONE; break; case 31: this.$ = yy.Cardinality.ZERO_OR_MORE; break; case 32: this.$ = yy.Cardinality.ONE_OR_MORE; break; case 33: this.$ = yy.Cardinality.ONLY_ONE; break; case 34: this.$ = yy.Identification.NON_IDENTIFYING; break; case 35: this.$ = yy.Identification.IDENTIFYING; break; case 36: this.$ = $$[$0].replace(/"/g, ''); break; case 37: this.$ = $$[$0]; break; case 38: yy.parseDirective('%%{', 'open_directive'); break; case 39: yy.parseDirective($$[$0], 'type_directive'); break; case 40: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); break; case 41: yy.parseDirective('}%%', 'close_directive', 'er'); break; } }, table: [{3:1,4:$V0,7:3,12:4,45:$V1},{1:[3]},o($V2,[2,3],{5:6}),{3:7,4:$V0,7:3,12:4,45:$V1},{13:8,46:[1,9]},{46:[2,38]},{6:[1,10],7:15,8:11,9:[1,12],10:13,11:[1,14],12:4,17:16,23:$V3,25:$V4,27:$V5,45:$V1},{1:[2,2]},{14:20,15:[1,21],48:$V6},o([15,48],[2,39]),o($V2,[2,8],{1:[2,1]}),o($V2,[2,4]),{7:15,10:23,12:4,17:16,23:$V3,25:$V4,27:$V5,45:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,11]),o($V2,[2,15],{18:24,36:26,20:[1,25],38:$V7,39:$V8,40:$V9,41:$Va}),{24:[1,31]},{26:[1,32]},o([6,9,11,15,20,23,25,27,38,39,40,41,45],[2,18]),{11:[1,33]},{16:34,47:[1,35]},{11:[2,41]},o($V2,[2,5]),{17:36,27:$V5},{21:37,22:[1,38],28:39,29:40,33:$Vb},{37:42,42:[1,43],43:[1,44]},o($Vc,[2,30]),o($Vc,[2,31]),o($Vc,[2,32]),o($Vc,[2,33]),o($V2,[2,16]),o($V2,[2,17]),o($Vd,[2,9]),{14:45,48:$V6},{48:[2,40]},{15:[1,46]},{22:[1,47]},o($V2,[2,14]),{21:48,22:[2,19],28:39,29:40,33:$Vb},{30:49,33:[1,50]},{33:[2,25]},{36:51,38:$V7,39:$V8,40:$V9,41:$Va},o($Ve,[2,34]),o($Ve,[2,35]),{11:[1,52]},{19:53,27:[1,55],44:[1,54]},o($V2,[2,13]),{22:[2,20]},o($Vf,[2,21],{31:56,32:57,34:[1,58],35:$Vg}),o([22,33,34,35],[2,26]),{27:[2,29]},o($Vd,[2,10]),o($V2,[2,12]),o($V2,[2,36]),o($V2,[2,37]),o($Vf,[2,22],{32:60,35:$Vg}),o($Vf,[2,23]),o([22,33,35],[2,27]),o($Vf,[2,28]),o($Vf,[2,24])], defaultActions: {5:[2,38],7:[2,2],22:[2,41],35:[2,40],41:[2,25],48:[2,20],51:[2,29]}, parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse(input) { var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer; sharedState.yy.parser = this; if (typeof lexer.yylloc == 'undefined') { lexer.yylloc = {}; } var yyloc = lexer.yylloc; lstack.push(yyloc); var ranges = lexer.options && lexer.options.ranges; if (typeof sharedState.yy.parseError === 'function') { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function popStack(n) { stack.length = stack.length - 2 * n; vstack.length = vstack.length - n; lstack.length = lstack.length - n; } function lex() { var token; token = tstack.pop() || lexer.lex() || EOF; if (typeof token !== 'number') { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self.symbols_[token] || token; } return token; } var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == 'undefined') { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === 'undefined' || !action.length || !action[0]) { var errStr = ''; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push('\'' + this.terminals_[p] + '\''); } } if (lexer.showPosition) { errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; } else { errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); } this.parseError(errStr, { text: lexer.match, token: this.terminals_[symbol] || symbol, line: lexer.yylineno, loc: yyloc, expected: expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer.yytext); lstack.push(lexer.yylloc); stack.push(action[1]); symbol = null; if (!preErrorSymbol) { yyleng = lexer.yyleng; yytext = lexer.yytext; yylineno = lexer.yylineno; yyloc = lexer.yylloc; if (recovering > 0) { recovering--; } } else { symbol = preErrorSymbol; preErrorSymbol = null; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== 'undefined') { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; }}; /* generated by jison-lex 0.3.4 */ var lexer = (function(){ var lexer = ({ EOF:1, parseError:function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, // resets the lexer, sets new input setInput:function (input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; 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 }; if (this.options.ranges) { this.yylloc.range = [0,0]; } this.offset = 0; return this; }, // consumes and returns one char from the input input:function () { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, // unshifts one char (or a string) into the input unput:function (ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); //this.yyleng -= len; this.offset -= len; var oldLines = 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); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, // When called from action, caches matched text and appends it on next action more:function () { this._more = true; return this; }, // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject:function () { if (this.options.backtrack_lexer) { this._backtrack = true; } 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).\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, // retain first n characters of the match less:function (n) { this.unput(this.match.slice(n)); }, // displays already matched input, i.e. for error messages pastInput:function () { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); }, // displays upcoming input, i.e. for error messages upcomingInput:function () { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20-next.length); } return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); }, // displays the character position where the lexing error occurred, i.e. for error messages showPosition:function () { var pre = this.pastInput(); var c = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c + "^"; }, // test the lexed token: return FALSE when not a match, otherwise return token test_match:function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { // save context backup = { 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 }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { // recover context for (var k in backup) { this[k] = backup[k]; } return false; // rule action called reject() implying the next rule should be tested instead. } return false; }, // return next match in input next:function () { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ''; this.match = ''; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; // rule action called reject() implying a rule MISmatch. } else { // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } if (this._input === "") { return this.EOF; } else { return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, // return next match that has a token lex:function lex () { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin:function begin (condition) { this.conditionStack.push(condition); }, // pop the previously active lexer condition state off the condition stack popState:function popState () { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, // produce the lexer rule set which is active for the currently active lexer condition state _currentRules:function _currentRules () { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState:function topState (n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, // alias for begin(condition) pushState:function pushState (condition) { this.begin(condition); }, // return the number of states currently on the stack stateStackSize:function stateStackSize() { return this.conditionStack.length; }, options: {"case-insensitive":true}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { var YYSTATE=YY_START; switch($avoiding_name_collisions) { case 0: this.begin("title");return 23; break; case 1: this.popState(); return "title_value"; break; case 2: this.begin("accDescription");return 25; break; case 3: this.popState(); return "description_value"; break; case 4: this.begin('open_directive'); return 45; break; case 5: this.begin('type_directive'); return 46; break; case 6: this.popState(); this.begin('arg_directive'); return 15; break; case 7: this.popState(); this.popState(); return 48; break; case 8:return 47; break; case 9:/* skip comments */ break; case 10:/* skip comments */ break; case 11:return 11; break; case 12:/* skip whitespace */ break; case 13:return 9; break; case 14:return 44; break; case 15:return 4; break; case 16: this.begin("block"); return 20; break; case 17:/* skip whitespace in block */ break; case 18:return 34 break; case 19:return 33 break; case 20:return 35; break; case 21:/* nothing */ break; case 22: this.popState(); return 22; break; case 23:return yy_.yytext[0]; break; case 24:return 38; break; case 25:return 39; break; case 26:return 40; break; case 27:return 41; break; case 28:return 38; break; case 29:return 39; break; case 30:return 40; break; case 31:return 42; break; case 32:return 43; break; case 33:return 42; break; case 34:return 42; break; case 35:return 27; break; case 36:return yy_.yytext[0]; break; case 37:return 6; break; } }, rules: [/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescription\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:\s+)/i,/^(?:(?:PK)|(?:FK))/i,/^(?:[A-Za-z][A-Za-z0-9\-_]*)/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\|o\b)/i,/^(?:\}o\b)/i,/^(?:\}\|)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:[A-Za-z][A-Za-z0-9\-_]*)/i,/^(?:.)/i,/^(?:$)/i], conditions: {"accDescription":{"rules":[3],"inclusive":false},"title":{"rules":[1],"inclusive":false},"open_directive":{"rules":[5],"inclusive":false},"type_directive":{"rules":[6,7],"inclusive":false},"arg_directive":{"rules":[7,8],"inclusive":false},"block":{"rules":[17,18,19,20,21,22,23],"inclusive":false},"INITIAL":{"rules":[0,2,4,9,10,11,12,13,14,15,16,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"inclusive":true}} }); return lexer; })(); parser.lexer = lexer; function Parser () { this.yy = {}; } Parser.prototype = parser;parser.Parser = Parser; return new Parser; })(); if (true) { exports.parser = parser; exports.Parser = parser.Parser; exports.parse = function () { return parser.parse.apply(parser, arguments); }; exports.main = function commonjsMain (args) { if (!args[1]) { console.log('Usage: '+args[0]+' FILE'); process.exit(1); } var source = (__webpack_require__(/*! fs */ "?3c87").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); return exports.parser.parse(source); }; if ( true && __webpack_require__.c[__webpack_require__.s] === module) { exports.main(process.argv.slice(1)); } } /***/ }), /***/ "./src/diagrams/flowchart/parser/flow.jison": /*!**************************************************!*\ !*** ./src/diagrams/flowchart/parser/flow.jison ***! \**************************************************/ /***/ ((module, exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); /* parser generated by jison 0.4.18 */ /* Returns a Parser object of the following structure: Parser: { yy: {} } Parser.prototype: { yy: {}, trace: function(), symbols_: {associative list: name ==> number}, terminals_: {associative list: number ==> name}, productions_: [...], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), table: [...], defaultActions: {...}, parseError: function(str, hash), parse: function(input), lexer: { EOF: 1, parseError: function(str, hash), setInput: function(input), input: function(), unput: function(str), more: function(), less: function(n), pastInput: function(), upcomingInput: function(), showPosition: function(), test_match: function(regex_match_array, rule_index), next: function(), lex: function(), begin: function(condition), popState: function(), _currentRules: function(), topState: function(), pushState: function(condition), options: { ranges: boolean (optional: true ==> token location info will include a .range[] member) flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) }, performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), rules: [...], conditions: {associative list: name ==> set}, } } token location info (@$, _$, etc.): { first_line: n, last_line: n, first_column: n, last_column: n, range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) } the parseError function receives a 'hash' object with these members for lexer and parser errors: { text: (matched text) token: (the produced terminal token, if any) line: (yylineno) } while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { loc: (yylloc) expected: (string describing the set of expected tokens) recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) } */ var parser = (function(){ var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,9],$V1=[1,7],$V2=[1,6],$V3=[1,8],$V4=[1,20,21,22,23,38,44,46,51,65,66,85,86,87,88,89,90,94,104,105,108,110,111,117,118,119,120,121,122,123,124,125,126],$V5=[2,10],$V6=[1,20],$V7=[1,21],$V8=[1,22],$V9=[1,23],$Va=[1,30],$Vb=[1,32],$Vc=[1,33],$Vd=[1,61],$Ve=[1,47],$Vf=[1,51],$Vg=[1,35],$Vh=[1,36],$Vi=[1,37],$Vj=[1,38],$Vk=[1,39],$Vl=[1,55],$Vm=[1,62],$Vn=[1,50],$Vo=[1,52],$Vp=[1,54],$Vq=[1,58],$Vr=[1,59],$Vs=[1,40],$Vt=[1,41],$Vu=[1,42],$Vv=[1,43],$Vw=[1,60],$Vx=[1,49],$Vy=[1,53],$Vz=[1,56],$VA=[1,57],$VB=[1,48],$VC=[1,65],$VD=[1,70],$VE=[1,20,21,22,23,38,42,44,46,51,65,66,85,86,87,88,89,90,94,104,105,108,110,111,117,118,119,120,121,122,123,124,125,126],$VF=[1,74],$VG=[1,73],$VH=[1,75],$VI=[20,21,23,80,81],$VJ=[1,98],$VK=[1,103],$VL=[1,106],$VM=[1,107],$VN=[1,100],$VO=[1,105],$VP=[1,108],$VQ=[1,101],$VR=[1,113],$VS=[1,112],$VT=[1,102],$VU=[1,104],$VV=[1,109],$VW=[1,110],$VX=[1,111],$VY=[1,114],$VZ=[20,21,22,23,80,81],$V_=[20,21,22,23,52,80,81],$V$=[20,21,22,23,40,51,52,54,56,58,60,62,64,65,66,68,70,72,73,75,80,81,90,94,104,105,108,110,111,121,122,123,124,125,126],$V01=[20,21,23],$V11=[20,21,23,51,65,66,80,81,90,94,104,105,108,110,111,121,122,123,124,125,126],$V21=[1,12,20,21,22,23,24,38,42,44,46,51,65,66,85,86,87,88,89,90,94,104,105,108,110,111,117,118,119,120,121,122,123,124,125,126],$V31=[51,65,66,90,94,104,105,108,110,111,121,122,123,124,125,126],$V41=[1,148],$V51=[1,156],$V61=[1,157],$V71=[1,158],$V81=[1,159],$V91=[1,143],$Va1=[1,144],$Vb1=[1,140],$Vc1=[1,151],$Vd1=[1,152],$Ve1=[1,153],$Vf1=[1,154],$Vg1=[1,155],$Vh1=[1,160],$Vi1=[1,161],$Vj1=[1,146],$Vk1=[1,149],$Vl1=[1,145],$Vm1=[1,142],$Vn1=[20,21,22,23,38,42,44,46,51,65,66,85,86,87,88,89,90,94,104,105,108,110,111,117,118,119,120,121,122,123,124,125,126],$Vo1=[1,164],$Vp1=[20,21,22,23,26,51,65,66,90,104,105,108,110,111,121,122,123,124,125,126],$Vq1=[20,21,22,23,24,26,38,40,41,42,51,55,57,59,61,63,65,66,67,69,71,72,74,76,80,81,85,86,87,88,89,90,91,94,104,105,108,110,111,112,113,121,122,123,124,125,126],$Vr1=[12,21,22,24],$Vs1=[22,105],$Vt1=[1,249],$Vu1=[1,244],$Vv1=[1,245],$Vw1=[1,253],$Vx1=[1,250],$Vy1=[1,247],$Vz1=[1,246],$VA1=[1,248],$VB1=[1,251],$VC1=[1,252],$VD1=[1,254],$VE1=[1,272],$VF1=[20,21,23,105],$VG1=[20,21,22,23,65,66,85,101,104,105,108,109,110,111,112]; var parser = {trace: function trace () { }, yy: {}, symbols_: {"error":2,"start":3,"mermaidDoc":4,"directive":5,"openDirective":6,"typeDirective":7,"closeDirective":8,"separator":9,":":10,"argDirective":11,"open_directive":12,"type_directive":13,"arg_directive":14,"close_directive":15,"graphConfig":16,"document":17,"line":18,"statement":19,"SEMI":20,"NEWLINE":21,"SPACE":22,"EOF":23,"GRAPH":24,"NODIR":25,"DIR":26,"FirstStmtSeperator":27,"ending":28,"endToken":29,"spaceList":30,"spaceListNewline":31,"verticeStatement":32,"styleStatement":33,"linkStyleStatement":34,"classDefStatement":35,"classStatement":36,"clickStatement":37,"subgraph":38,"text":39,"SQS":40,"SQE":41,"end":42,"direction":43,"title":44,"title_value":45,"accDescription":46,"description_value":47,"link":48,"node":49,"vertex":50,"AMP":51,"STYLE_SEPARATOR":52,"idString":53,"DOUBLECIRCLESTART":54,"DOUBLECIRCLEEND":55,"PS":56,"PE":57,"(-":58,"-)":59,"STADIUMSTART":60,"STADIUMEND":61,"SUBROUTINESTART":62,"SUBROUTINEEND":63,"VERTEX_WITH_PROPS_START":64,"ALPHA":65,"COLON":66,"PIPE":67,"CYLINDERSTART":68,"CYLINDEREND":69,"DIAMOND_START":70,"DIAMOND_STOP":71,"TAGEND":72,"TRAPSTART":73,"TRAPEND":74,"INVTRAPSTART":75,"INVTRAPEND":76,"linkStatement":77,"arrowText":78,"TESTSTR":79,"START_LINK":80,"LINK":81,"textToken":82,"STR":83,"keywords":84,"STYLE":85,"LINKSTYLE":86,"CLASSDEF":87,"CLASS":88,"CLICK":89,"DOWN":90,"UP":91,"textNoTags":92,"textNoTagsToken":93,"DEFAULT":94,"stylesOpt":95,"alphaNum":96,"CALLBACKNAME":97,"CALLBACKARGS":98,"HREF":99,"LINK_TARGET":100,"HEX":101,"numList":102,"INTERPOLATE":103,"NUM":104,"COMMA":105,"style":106,"styleComponent":107,"MINUS":108,"UNIT":109,"BRKT":110,"DOT":111,"PCT":112,"TAGSTART":113,"alphaNumToken":114,"idStringToken":115,"alphaNumStatement":116,"direction_tb":117,"direction_bt":118,"direction_rl":119,"direction_lr":120,"PUNCTUATION":121,"UNICODE_TEXT":122,"PLUS":123,"EQUALS":124,"MULT":125,"UNDERSCORE":126,"graphCodeTokens":127,"ARROW_CROSS":128,"ARROW_POINT":129,"ARROW_CIRCLE":130,"ARROW_OPEN":131,"QUOTE":132,"$accept":0,"$end":1}, terminals_: {2:"error",10:":",12:"open_directive",13:"type_directive",14:"arg_directive",15:"close_directive",20:"SEMI",21:"NEWLINE",22:"SPACE",23:"EOF",24:"GRAPH",25:"NODIR",26:"DIR",38:"subgraph",40:"SQS",41:"SQE",42:"end",44:"title",45:"title_value",46:"accDescription",47:"description_value",51:"AMP",52:"STYLE_SEPARATOR",54:"DOUBLECIRCLESTART",55:"DOUBLECIRCLEEND",56:"PS",57:"PE",58:"(-",59:"-)",60:"STADIUMSTART",61:"STADIUMEND",62:"SUBROUTINESTART",63:"SUBROUTINEEND",64:"VERTEX_WITH_PROPS_START",65:"ALPHA",66:"COLON",67:"PIPE",68:"CYLINDERSTART",69:"CYLINDEREND",70:"DIAMOND_START",71:"DIAMOND_STOP",72:"TAGEND",73:"TRAPSTART",74:"TRAPEND",75:"INVTRAPSTART",76:"INVTRAPEND",79:"TESTSTR",80:"START_LINK",81:"LINK",83:"STR",85:"STYLE",86:"LINKSTYLE",87:"CLASSDEF",88:"CLASS",89:"CLICK",90:"DOWN",91:"UP",94:"DEFAULT",97:"CALLBACKNAME",98:"CALLBACKARGS",99:"HREF",100:"LINK_TARGET",101:"HEX",103:"INTERPOLATE",104:"NUM",105:"COMMA",108:"MINUS",109:"UNIT",110:"BRKT",111:"DOT",112:"PCT",113:"TAGSTART",117:"direction_tb",118:"direction_bt",119:"direction_rl",120:"direction_lr",121:"PUNCTUATION",122:"UNICODE_TEXT",123:"PLUS",124:"EQUALS",125:"MULT",126:"UNDERSCORE",128:"ARROW_CROSS",129:"ARROW_POINT",130:"ARROW_CIRCLE",131:"ARROW_OPEN",132:"QUOTE"}, productions_: [0,[3,1],[3,2],[5,4],[5,6],[6,1],[7,1],[11,1],[8,1],[4,2],[17,0],[17,2],[18,1],[18,1],[18,1],[18,1],[18,1],[16,2],[16,2],[16,2],[16,3],[28,2],[28,1],[29,1],[29,1],[29,1],[27,1],[27,1],[27,2],[31,2],[31,2],[31,1],[31,1],[30,2],[30,1],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,9],[19,6],[19,4],[19,1],[19,2],[19,2],[9,1],[9,1],[9,1],[32,3],[32,4],[32,2],[32,1],[49,1],[49,5],[49,3],[50,4],[50,4],[50,6],[50,4],[50,4],[50,4],[50,8],[50,4],[50,4],[50,4],[50,6],[50,4],[50,4],[50,4],[50,4],[50,4],[50,1],[48,2],[48,3],[48,3],[48,1],[48,3],[77,1],[78,3],[39,1],[39,2],[39,1],[84,1],[84,1],[84,1],[84,1],[84,1],[84,1],[84,1],[84,1],[84,1],[84,1],[84,1],[92,1],[92,2],[35,5],[35,5],[36,5],[37,2],[37,4],[37,3],[37,5],[37,2],[37,4],[37,4],[37,6],[37,2],[37,4],[37,2],[37,4],[37,4],[37,6],[33,5],[33,5],[34,5],[34,5],[34,9],[34,9],[34,7],[34,7],[102,1],[102,3],[95,1],[95,3],[106,1],[106,2],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[82,1],[82,1],[82,1],[82,1],[82,1],[82,1],[93,1],[93,1],[93,1],[93,1],[53,1],[53,2],[96,1],[96,2],[116,1],[116,1],[116,1],[116,1],[43,1],[43,1],[43,1],[43,1],[114,1],[114,1],[114,1],[114,1],[114,1],[114,1],[114,1],[114,1],[114,1],[114,1],[114,1],[114,1],[114,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1],[127,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { case 5: yy.parseDirective('%%{', 'open_directive'); break; case 6: yy.parseDirective($$[$0], 'type_directive'); break; case 7: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); break; case 8: yy.parseDirective('}%%', 'close_directive', 'flowchart'); break; case 10: this.$ = []; break; case 11: if($$[$0] !== []){ $$[$0-1].push($$[$0]); } this.$=$$[$0-1]; break; case 12: case 81: case 83: case 95: case 151: case 153: case 154: this.$=$$[$0]; break; case 19: yy.setDirection('TB');this.$ = 'TB'; break; case 20: yy.setDirection($$[$0-1]);this.$ = $$[$0-1]; break; case 35: /* console.warn('finat vs', $$[$0-1].nodes); */ this.$=$$[$0-1].nodes break; case 36: case 37: case 38: case 39: case 40: this.$=[]; break; case 41: this.$=yy.addSubGraph($$[$0-6],$$[$0-1],$$[$0-4]); break; case 42: this.$=yy.addSubGraph($$[$0-3],$$[$0-1],$$[$0-3]); break; case 43: this.$=yy.addSubGraph(undefined,$$[$0-1],undefined); break; case 45: this.$=$$[$0].trim();yy.setTitle(this.$); break; case 46: this.$=$$[$0].trim();yy.setAccDescription(this.$); break; case 50: /* console.warn('vs',$$[$0-2].stmt,$$[$0]); */ yy.addLink($$[$0-2].stmt,$$[$0],$$[$0-1]); this.$ = { stmt: $$[$0], nodes: $$[$0].concat($$[$0-2].nodes) } break; case 51: /* console.warn('vs',$$[$0-3].stmt,$$[$0-1]); */ yy.addLink($$[$0-3].stmt,$$[$0-1],$$[$0-2]); this.$ = { stmt: $$[$0-1], nodes: $$[$0-1].concat($$[$0-3].nodes) } break; case 52: /*console.warn('noda', $$[$0-1]);*/ this.$ = {stmt: $$[$0-1], nodes:$$[$0-1] } break; case 53: /*console.warn('noda', $$[$0]);*/ this.$ = {stmt: $$[$0], nodes:$$[$0] } break; case 54: /* console.warn('nod', $$[$0]); */ this.$ = [$$[$0]]; break; case 55: this.$ = $$[$0-4].concat($$[$0]); /* console.warn('pip', $$[$0-4][0], $$[$0], this.$); */ break; case 56: this.$ = [$$[$0-2]];yy.setClass($$[$0-2],$$[$0]) break; case 57: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'square'); break; case 58: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'doublecircle'); break; case 59: this.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'circle'); break; case 60: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'ellipse'); break; case 61: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'stadium'); break; case 62: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'subroutine'); break; case 63: this.$ = $$[$0-7];yy.addVertex($$[$0-7],$$[$0-1],'rect',undefined,undefined,undefined, Object.fromEntries([[$$[$0-5], $$[$0-3]]])); break; case 64: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'cylinder'); break; case 65: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'round'); break; case 66: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'diamond'); break; case 67: this.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'hexagon'); break; case 68: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'odd'); break; case 69: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'trapezoid'); break; case 70: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'inv_trapezoid'); break; case 71: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_right'); break; case 72: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_left'); break; case 73: /*console.warn('h: ', $$[$0]);*/this.$ = $$[$0];yy.addVertex($$[$0]); break; case 74: $$[$0-1].text = $$[$0];this.$ = $$[$0-1]; break; case 75: case 76: $$[$0-2].text = $$[$0-1];this.$ = $$[$0-2]; break; case 77: this.$ = $$[$0]; break; case 78: var inf = yy.destructLink($$[$0], $$[$0-2]); this.$ = {"type":inf.type,"stroke":inf.stroke,"length":inf.length,"text":$$[$0-1]}; break; case 79: var inf = yy.destructLink($$[$0]);this.$ = {"type":inf.type,"stroke":inf.stroke,"length":inf.length}; break; case 80: this.$ = $$[$0-1]; break; case 82: case 96: case 152: this.$=$$[$0-1]+''+$$[$0]; break; case 97: case 98: this.$ = $$[$0-4];yy.addClass($$[$0-2],$$[$0]); break; case 99: this.$ = $$[$0-4];yy.setClass($$[$0-2], $$[$0]); break; case 100: case 108: this.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0]); break; case 101: case 109: this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-3], $$[$0]); break; case 102: this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]); break; case 103: this.$ = $$[$0-4];yy.setClickEvent($$[$0-4], $$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-4], $$[$0]); break; case 104: case 110: this.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]); break; case 105: case 111: this.$ = $$[$0-3];yy.setLink($$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-3], $$[$0]); break; case 106: case 112: this.$ = $$[$0-3];yy.setLink($$[$0-3], $$[$0-2], $$[$0]); break; case 107: case 113: this.$ = $$[$0-5];yy.setLink($$[$0-5], $$[$0-4], $$[$0]);yy.setTooltip($$[$0-5], $$[$0-2]); break; case 114: this.$ = $$[$0-4];yy.addVertex($$[$0-2],undefined,undefined,$$[$0]); break; case 115: case 117: this.$ = $$[$0-4];yy.updateLink($$[$0-2],$$[$0]); break; case 116: this.$ = $$[$0-4];yy.updateLink([$$[$0-2]],$$[$0]); break; case 118: this.$ = $$[$0-8];yy.updateLinkInterpolate([$$[$0-6]],$$[$0-2]);yy.updateLink([$$[$0-6]],$$[$0]); break; case 119: this.$ = $$[$0-8];yy.updateLinkInterpolate($$[$0-6],$$[$0-2]);yy.updateLink($$[$0-6],$$[$0]); break; case 120: this.$ = $$[$0-6];yy.updateLinkInterpolate([$$[$0-4]],$$[$0]); break; case 121: this.$ = $$[$0-6];yy.updateLinkInterpolate($$[$0-4],$$[$0]); break; case 122: case 124: this.$ = [$$[$0]] break; case 123: case 125: $$[$0-2].push($$[$0]);this.$ = $$[$0-2]; break; case 127: this.$ = $$[$0-1] + $$[$0]; break; case 149: this.$=$$[$0] break; case 150: this.$=$$[$0-1]+''+$$[$0] break; case 155: this.$='v'; break; case 156: this.$='-'; break; case 157: this.$={stmt:'dir', value:'TB'}; break; case 158: this.$={stmt:'dir', value:'BT'}; break; case 159: this.$={stmt:'dir', value:'RL'}; break; case 160: this.$={stmt:'dir', value:'LR'}; break; } }, table: [{3:1,4:2,5:3,6:5,12:$V0,16:4,21:$V1,22:$V2,24:$V3},{1:[3]},{1:[2,1]},{3:10,4:2,5:3,6:5,12:$V0,16:4,21:$V1,22:$V2,24:$V3},o($V4,$V5,{17:11}),{7:12,13:[1,13]},{16:14,21:$V1,22:$V2,24:$V3},{16:15,21:$V1,22:$V2,24:$V3},{25:[1,16],26:[1,17]},{13:[2,5]},{1:[2,2]},{1:[2,9],18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,43:31,44:$Vb,46:$Vc,49:34,50:44,51:$Vd,53:45,65:$Ve,66:$Vf,85:$Vg,86:$Vh,87:$Vi,88:$Vj,89:$Vk,90:$Vl,94:$Vm,104:$Vn,105:$Vo,108:$Vp,110:$Vq,111:$Vr,115:46,117:$Vs,118:$Vt,119:$Vu,120:$Vv,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB},{8:63,10:[1,64],15:$VC},o([10,15],[2,6]),o($V4,[2,17]),o($V4,[2,18]),o($V4,[2,19]),{20:[1,67],21:[1,68],22:$VD,27:66,30:69},o($VE,[2,11]),o($VE,[2,12]),o($VE,[2,13]),o($VE,[2,14]),o($VE,[2,15]),o($VE,[2,16]),{9:71,20:$VF,21:$VG,23:$VH,48:72,77:76,80:[1,77],81:[1,78]},{9:79,20:$VF,21:$VG,23:$VH},{9:80,20:$VF,21:$VG,23:$VH},{9:81,20:$VF,21:$VG,23:$VH},{9:82,20:$VF,21:$VG,23:$VH},{9:83,20:$VF,21:$VG,23:$VH},{9:85,20:$VF,21:$VG,22:[1,84],23:$VH},o($VE,[2,44]),{45:[1,86]},{47:[1,87]},o($VI,[2,53],{30:88,22:$VD}),{22:[1,89]},{22:[1,90]},{22:[1,91]},{22:[1,92]},{26:$VJ,51:$VK,65:$VL,66:$VM,83:[1,96],90:$VN,96:95,97:[1,93],99:[1,94],104:$VO,105:$VP,108:$VQ,110:$VR,111:$VS,114:99,116:97,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},o($VE,[2,157]),o($VE,[2,158]),o($VE,[2,159]),o($VE,[2,160]),o($VZ,[2,54],{52:[1,115]}),o($V_,[2,73],{115:128,40:[1,116],51:$Vd,54:[1,117],56:[1,118],58:[1,119],60:[1,120],62:[1,121],64:[1,122],65:$Ve,66:$Vf,68:[1,123],70:[1,124],72:[1,125],73:[1,126],75:[1,127],90:$Vl,94:$Vm,104:$Vn,105:$Vo,108:$Vp,110:$Vq,111:$Vr,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB}),o($V$,[2,149]),o($V$,[2,174]),o($V$,[2,175]),o($V$,[2,176]),o($V$,[2,177]),o($V$,[2,178]),o($V$,[2,179]),o($V$,[2,180]),o($V$,[2,181]),o($V$,[2,182]),o($V$,[2,183]),o($V$,[2,184]),o($V$,[2,185]),o($V$,[2,186]),o($V$,[2,187]),o($V$,[2,188]),o($V$,[2,189]),{9:129,20:$VF,21:$VG,23:$VH},{11:130,14:[1,131]},o($V01,[2,8]),o($V4,[2,20]),o($V4,[2,26]),o($V4,[2,27]),{21:[1,132]},o($V11,[2,34],{30:133,22:$VD}),o($VE,[2,35]),{49:134,50:44,51:$Vd,53:45,65:$Ve,66:$Vf,90:$Vl,94:$Vm,104:$Vn,105:$Vo,108:$Vp,110:$Vq,111:$Vr,115:46,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB},o($V21,[2,47]),o($V21,[2,48]),o($V21,[2,49]),o($V31,[2,77],{78:135,67:[1,137],79:[1,136]}),{22:$V41,24:$V51,26:$V61,38:$V71,39:138,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},o([51,65,66,67,79,90,94,104,105,108,110,111,121,122,123,124,125,126],[2,79]),o($VE,[2,36]),o($VE,[2,37]),o($VE,[2,38]),o($VE,[2,39]),o($VE,[2,40]),{22:$V41,24:$V51,26:$V61,38:$V71,39:162,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},o($Vn1,$V5,{17:163}),o($VE,[2,45]),o($VE,[2,46]),o($VI,[2,52],{51:$Vo1}),{26:$VJ,51:$VK,65:$VL,66:$VM,90:$VN,96:165,101:[1,166],104:$VO,105:$VP,108:$VQ,110:$VR,111:$VS,114:99,116:97,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{94:[1,167],102:168,104:[1,169]},{26:$VJ,51:$VK,65:$VL,66:$VM,90:$VN,94:[1,170],96:171,104:$VO,105:$VP,108:$VQ,110:$VR,111:$VS,114:99,116:97,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{26:$VJ,51:$VK,65:$VL,66:$VM,90:$VN,96:172,104:$VO,105:$VP,108:$VQ,110:$VR,111:$VS,114:99,116:97,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},o($V01,[2,100],{22:[1,173],98:[1,174]}),o($V01,[2,104],{22:[1,175]}),o($V01,[2,108],{114:99,116:177,22:[1,176],26:$VJ,51:$VK,65:$VL,66:$VM,90:$VN,104:$VO,105:$VP,108:$VQ,110:$VR,111:$VS,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY}),o($V01,[2,110],{22:[1,178]}),o($Vp1,[2,151]),o($Vp1,[2,153]),o($Vp1,[2,154]),o($Vp1,[2,155]),o($Vp1,[2,156]),o($Vq1,[2,161]),o($Vq1,[2,162]),o($Vq1,[2,163]),o($Vq1,[2,164]),o($Vq1,[2,165]),o($Vq1,[2,166]),o($Vq1,[2,167]),o($Vq1,[2,168]),o($Vq1,[2,169]),o($Vq1,[2,170]),o($Vq1,[2,171]),o($Vq1,[2,172]),o($Vq1,[2,173]),{51:$Vd,53:179,65:$Ve,66:$Vf,90:$Vl,94:$Vm,104:$Vn,105:$Vo,108:$Vp,110:$Vq,111:$Vr,115:46,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB},{22:$V41,24:$V51,26:$V61,38:$V71,39:180,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,39:181,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,39:183,42:$V81,51:$VK,56:[1,182],65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,39:184,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,39:185,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,39:186,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{65:[1,187]},{22:$V41,24:$V51,26:$V61,38:$V71,39:188,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,39:189,42:$V81,51:$VK,65:$VL,66:$VM,70:[1,190],72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,39:191,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,39:192,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,39:193,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},o($V$,[2,150]),o($Vr1,[2,3]),{8:194,15:$VC},{15:[2,7]},o($V4,[2,28]),o($V11,[2,33]),o($VI,[2,50],{30:195,22:$VD}),o($V31,[2,74],{22:[1,196]}),{22:[1,197]},{22:$V41,24:$V51,26:$V61,38:$V71,39:198,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,81:[1,199],82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},o($Vq1,[2,81]),o($Vq1,[2,83]),o($Vq1,[2,139]),o($Vq1,[2,140]),o($Vq1,[2,141]),o($Vq1,[2,142]),o($Vq1,[2,143]),o($Vq1,[2,144]),o($Vq1,[2,145]),o($Vq1,[2,146]),o($Vq1,[2,147]),o($Vq1,[2,148]),o($Vq1,[2,84]),o($Vq1,[2,85]),o($Vq1,[2,86]),o($Vq1,[2,87]),o($Vq1,[2,88]),o($Vq1,[2,89]),o($Vq1,[2,90]),o($Vq1,[2,91]),o($Vq1,[2,92]),o($Vq1,[2,93]),o($Vq1,[2,94]),{9:202,20:$VF,21:$VG,22:$V41,23:$VH,24:$V51,26:$V61,38:$V71,40:[1,201],42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,203],43:31,44:$Vb,46:$Vc,49:34,50:44,51:$Vd,53:45,65:$Ve,66:$Vf,85:$Vg,86:$Vh,87:$Vi,88:$Vj,89:$Vk,90:$Vl,94:$Vm,104:$Vn,105:$Vo,108:$Vp,110:$Vq,111:$Vr,115:46,117:$Vs,118:$Vt,119:$Vu,120:$Vv,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB},{22:$VD,30:204},{22:[1,205],26:$VJ,51:$VK,65:$VL,66:$VM,90:$VN,104:$VO,105:$VP,108:$VQ,110:$VR,111:$VS,114:99,116:177,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:[1,206]},{22:[1,207]},{22:[1,208],105:[1,209]},o($Vs1,[2,122]),{22:[1,210]},{22:[1,211],26:$VJ,51:$VK,65:$VL,66:$VM,90:$VN,104:$VO,105:$VP,108:$VQ,110:$VR,111:$VS,114:99,116:177,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:[1,212],26:$VJ,51:$VK,65:$VL,66:$VM,90:$VN,104:$VO,105:$VP,108:$VQ,110:$VR,111:$VS,114:99,116:177,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{83:[1,213]},o($V01,[2,102],{22:[1,214]}),{83:[1,215],100:[1,216]},{83:[1,217]},o($Vp1,[2,152]),{83:[1,218],100:[1,219]},o($VZ,[2,56],{115:128,51:$Vd,65:$Ve,66:$Vf,90:$Vl,94:$Vm,104:$Vn,105:$Vo,108:$Vp,110:$Vq,111:$Vr,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB}),{22:$V41,24:$V51,26:$V61,38:$V71,41:[1,220],42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,42:$V81,51:$VK,55:[1,221],65:$VL,66:$VM,72:$V91,80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,39:222,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,42:$V81,51:$VK,57:[1,223],65:$VL,66:$VM,72:$V91,80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,42:$V81,51:$VK,59:[1,224],65:$VL,66:$VM,72:$V91,80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,42:$V81,51:$VK,61:[1,225],65:$VL,66:$VM,72:$V91,80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,42:$V81,51:$VK,63:[1,226],65:$VL,66:$VM,72:$V91,80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{66:[1,227]},{22:$V41,24:$V51,26:$V61,38:$V71,42:$V81,51:$VK,65:$VL,66:$VM,69:[1,228],72:$V91,80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,42:$V81,51:$VK,65:$VL,66:$VM,71:[1,229],72:$V91,80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,39:230,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,41:[1,231],42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,74:[1,232],76:[1,233],80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{22:$V41,24:$V51,26:$V61,38:$V71,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,74:[1,235],76:[1,234],80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{9:236,20:$VF,21:$VG,23:$VH},o($VI,[2,51],{51:$Vo1}),o($V31,[2,76]),o($V31,[2,75]),{22:$V41,24:$V51,26:$V61,38:$V71,42:$V81,51:$VK,65:$VL,66:$VM,67:[1,237],72:$V91,80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},o($V31,[2,78]),o($Vq1,[2,82]),{22:$V41,24:$V51,26:$V61,38:$V71,39:238,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},o($Vn1,$V5,{17:239}),o($VE,[2,43]),{50:240,51:$Vd,53:45,65:$Ve,66:$Vf,90:$Vl,94:$Vm,104:$Vn,105:$Vo,108:$Vp,110:$Vq,111:$Vr,115:46,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB},{22:$Vt1,65:$Vu1,66:$Vv1,85:$Vw1,95:241,101:$Vx1,104:$Vy1,106:242,107:243,108:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1},{22:$Vt1,65:$Vu1,66:$Vv1,85:$Vw1,95:255,101:$Vx1,104:$Vy1,106:242,107:243,108:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1},{22:$Vt1,65:$Vu1,66:$Vv1,85:$Vw1,95:256,101:$Vx1,103:[1,257],104:$Vy1,106:242,107:243,108:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1},{22:$Vt1,65:$Vu1,66:$Vv1,85:$Vw1,95:258,101:$Vx1,103:[1,259],104:$Vy1,106:242,107:243,108:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1},{104:[1,260]},{22:$Vt1,65:$Vu1,66:$Vv1,85:$Vw1,95:261,101:$Vx1,104:$Vy1,106:242,107:243,108:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1},{22:$Vt1,65:$Vu1,66:$Vv1,85:$Vw1,95:262,101:$Vx1,104:$Vy1,106:242,107:243,108:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1},{26:$VJ,51:$VK,65:$VL,66:$VM,90:$VN,96:263,104:$VO,105:$VP,108:$VQ,110:$VR,111:$VS,114:99,116:97,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},o($V01,[2,101]),{83:[1,264]},o($V01,[2,105],{22:[1,265]}),o($V01,[2,106]),o($V01,[2,109]),o($V01,[2,111],{22:[1,266]}),o($V01,[2,112]),o($V_,[2,57]),o($V_,[2,58]),{22:$V41,24:$V51,26:$V61,38:$V71,42:$V81,51:$VK,57:[1,267],65:$VL,66:$VM,72:$V91,80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},o($V_,[2,65]),o($V_,[2,60]),o($V_,[2,61]),o($V_,[2,62]),{65:[1,268]},o($V_,[2,64]),o($V_,[2,66]),{22:$V41,24:$V51,26:$V61,38:$V71,42:$V81,51:$VK,65:$VL,66:$VM,71:[1,269],72:$V91,80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},o($V_,[2,68]),o($V_,[2,69]),o($V_,[2,71]),o($V_,[2,70]),o($V_,[2,72]),o($Vr1,[2,4]),o([22,51,65,66,90,94,104,105,108,110,111,121,122,123,124,125,126],[2,80]),{22:$V41,24:$V51,26:$V61,38:$V71,41:[1,270],42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,271],43:31,44:$Vb,46:$Vc,49:34,50:44,51:$Vd,53:45,65:$Ve,66:$Vf,85:$Vg,86:$Vh,87:$Vi,88:$Vj,89:$Vk,90:$Vl,94:$Vm,104:$Vn,105:$Vo,108:$Vp,110:$Vq,111:$Vr,115:46,117:$Vs,118:$Vt,119:$Vu,120:$Vv,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB},o($VZ,[2,55]),o($V01,[2,114],{105:$VE1}),o($VF1,[2,124],{107:273,22:$Vt1,65:$Vu1,66:$Vv1,85:$Vw1,101:$Vx1,104:$Vy1,108:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1}),o($VG1,[2,126]),o($VG1,[2,128]),o($VG1,[2,129]),o($VG1,[2,130]),o($VG1,[2,131]),o($VG1,[2,132]),o($VG1,[2,133]),o($VG1,[2,134]),o($VG1,[2,135]),o($VG1,[2,136]),o($VG1,[2,137]),o($VG1,[2,138]),o($V01,[2,115],{105:$VE1}),o($V01,[2,116],{105:$VE1}),{22:[1,274]},o($V01,[2,117],{105:$VE1}),{22:[1,275]},o($Vs1,[2,123]),o($V01,[2,97],{105:$VE1}),o($V01,[2,98],{105:$VE1}),o($V01,[2,99],{114:99,116:177,26:$VJ,51:$VK,65:$VL,66:$VM,90:$VN,104:$VO,105:$VP,108:$VQ,110:$VR,111:$VS,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY}),o($V01,[2,103]),{100:[1,276]},{100:[1,277]},{57:[1,278]},{67:[1,279]},{71:[1,280]},{9:281,20:$VF,21:$VG,23:$VH},o($VE,[2,42]),{22:$Vt1,65:$Vu1,66:$Vv1,85:$Vw1,101:$Vx1,104:$Vy1,106:282,107:243,108:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1},o($VG1,[2,127]),{26:$VJ,51:$VK,65:$VL,66:$VM,90:$VN,96:283,104:$VO,105:$VP,108:$VQ,110:$VR,111:$VS,114:99,116:97,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{26:$VJ,51:$VK,65:$VL,66:$VM,90:$VN,96:284,104:$VO,105:$VP,108:$VQ,110:$VR,111:$VS,114:99,116:97,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},o($V01,[2,107]),o($V01,[2,113]),o($V_,[2,59]),{22:$V41,24:$V51,26:$V61,38:$V71,39:285,42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:139,83:$Vb1,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},o($V_,[2,67]),o($Vn1,$V5,{17:286}),o($VF1,[2,125],{107:273,22:$Vt1,65:$Vu1,66:$Vv1,85:$Vw1,101:$Vx1,104:$Vy1,108:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1}),o($V01,[2,120],{114:99,116:177,22:[1,287],26:$VJ,51:$VK,65:$VL,66:$VM,90:$VN,104:$VO,105:$VP,108:$VQ,110:$VR,111:$VS,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY}),o($V01,[2,121],{114:99,116:177,22:[1,288],26:$VJ,51:$VK,65:$VL,66:$VM,90:$VN,104:$VO,105:$VP,108:$VQ,110:$VR,111:$VS,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY}),{22:$V41,24:$V51,26:$V61,38:$V71,41:[1,289],42:$V81,51:$VK,65:$VL,66:$VM,72:$V91,80:$Va1,82:200,84:150,85:$Vc1,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,93:141,94:$Vj1,104:$VO,105:$VP,108:$Vk1,110:$VR,111:$VS,112:$Vl1,113:$Vm1,114:147,121:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,290],43:31,44:$Vb,46:$Vc,49:34,50:44,51:$Vd,53:45,65:$Ve,66:$Vf,85:$Vg,86:$Vh,87:$Vi,88:$Vj,89:$Vk,90:$Vl,94:$Vm,104:$Vn,105:$Vo,108:$Vp,110:$Vq,111:$Vr,115:46,117:$Vs,118:$Vt,119:$Vu,120:$Vv,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB},{22:$Vt1,65:$Vu1,66:$Vv1,85:$Vw1,95:291,101:$Vx1,104:$Vy1,106:242,107:243,108:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1},{22:$Vt1,65:$Vu1,66:$Vv1,85:$Vw1,95:292,101:$Vx1,104:$Vy1,106:242,107:243,108:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1},o($V_,[2,63]),o($VE,[2,41]),o($V01,[2,118],{105:$VE1}),o($V01,[2,119],{105:$VE1})], defaultActions: {2:[2,1],9:[2,5],10:[2,2],131:[2,7]}, parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse(input) { var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer; sharedState.yy.parser = this; if (typeof lexer.yylloc == 'undefined') { lexer.yylloc = {}; } var yyloc = lexer.yylloc; lstack.push(yyloc); var ranges = lexer.options && lexer.options.ranges; if (typeof sharedState.yy.parseError === 'function') { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function popStack(n) { stack.length = stack.length - 2 * n; vstack.length = vstack.length - n; lstack.length = lstack.length - n; } function lex() { var token; token = tstack.pop() || lexer.lex() || EOF; if (typeof token !== 'number') { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self.symbols_[token] || token; } return token; } var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == 'undefined') { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === 'undefined' || !action.length || !action[0]) { var errStr = ''; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push('\'' + this.terminals_[p] + '\''); } } if (lexer.showPosition) { errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; } else { errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); } this.parseError(errStr, { text: lexer.match, token: this.terminals_[symbol] || symbol, line: lexer.yylineno, loc: yyloc, expected: expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer.yytext); lstack.push(lexer.yylloc); stack.push(action[1]); symbol = null; if (!preErrorSymbol) { yyleng = lexer.yyleng; yytext = lexer.yytext; yylineno = lexer.yylineno; yyloc = lexer.yylloc; if (recovering > 0) { recovering--; } } else { symbol = preErrorSymbol; preErrorSymbol = null; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== 'undefined') { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; }}; /* generated by jison-lex 0.3.4 */ var lexer = (function(){ var lexer = ({ EOF:1, parseError:function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, // resets the lexer, sets new input setInput:function (input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; 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 }; if (this.options.ranges) { this.yylloc.range = [0,0]; } this.offset = 0; return this; }, // consumes and returns one char from the input input:function () { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, // unshifts one char (or a string) into the input unput:function (ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); //this.yyleng -= len; this.offset -= len; var oldLines = 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); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, // When called from action, caches matched text and appends it on next action more:function () { this._more = true; return this; }, // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject:function () { if (this.options.backtrack_lexer) { this._backtrack = true; } 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).\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, // retain first n characters of the match less:function (n) { this.unput(this.match.slice(n)); }, // displays already matched input, i.e. for error messages pastInput:function () { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); }, // displays upcoming input, i.e. for error messages upcomingInput:function () { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20-next.length); } return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); }, // displays the character position where the lexing error occurred, i.e. for error messages showPosition:function () { var pre = this.pastInput(); var c = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c + "^"; }, // test the lexed token: return FALSE when not a match, otherwise return token test_match:function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { // save context backup = { 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 }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { // recover context for (var k in backup) { this[k] = backup[k]; } return false; // rule action called reject() implying the next rule should be tested instead. } return false; }, // return next match in input next:function () { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ''; this.match = ''; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; // rule action called reject() implying a rule MISmatch. } else { // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } if (this._input === "") { return this.EOF; } else { return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, // return next match that has a token lex:function lex () { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin:function begin (condition) { this.conditionStack.push(condition); }, // pop the previously active lexer condition state off the condition stack popState:function popState () { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, // produce the lexer rule set which is active for the currently active lexer condition state _currentRules:function _currentRules () { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState:function topState (n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, // alias for begin(condition) pushState:function pushState (condition) { this.begin(condition); }, // return the number of states currently on the stack stateStackSize:function stateStackSize() { return this.conditionStack.length; }, options: {}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { var YYSTATE=YY_START; switch($avoiding_name_collisions) { case 0: this.begin('open_directive'); return 12; break; case 1: this.begin('type_directive'); return 13; break; case 2: this.popState(); this.begin('arg_directive'); return 10; break; case 3: this.popState(); this.popState(); return 15; break; case 4:return 14; break; case 5:/* skip comments */ break; case 6:/* skip comments */ break; case 7: this.begin("title");return 44; break; case 8: this.popState(); return "title_value"; break; case 9: this.begin("accDescription");return 46; break; case 10: this.popState(); return "description_value"; break; case 11:this.begin("string"); break; case 12:this.popState(); break; case 13:return "STR"; break; case 14:return 85; break; case 15:return 94; break; case 16:return 86; break; case 17:return 103; break; case 18:return 87; break; case 19:return 88; break; case 20:this.begin("href"); break; case 21:this.popState(); break; case 22:return 99; break; case 23:this.begin("callbackname"); break; case 24:this.popState(); break; case 25:this.popState(); this.begin("callbackargs"); break; case 26:return 97; break; case 27:this.popState(); break; case 28:return 98; break; case 29:this.begin("click"); break; case 30:this.popState(); break; case 31:return 89; break; case 32:if(yy.lex.firstGraph()){this.begin("dir");} return 24; break; case 33:if(yy.lex.firstGraph()){this.begin("dir");} return 24; break; case 34:return 38; break; case 35:return 42; break; case 36:return 100; break; case 37:return 100; break; case 38:return 100; break; case 39:return 100; break; case 40: this.popState(); return 25; break; case 41: this.popState(); return 26; break; case 42: this.popState(); return 26; break; case 43: this.popState(); return 26; break; case 44: this.popState(); return 26; break; case 45: this.popState(); return 26; break; case 46: this.popState(); return 26; break; case 47: this.popState(); return 26; break; case 48: this.popState(); return 26; break; case 49: this.popState(); return 26; break; case 50: this.popState(); return 26; break; case 51:return 117; break; case 52:return 118; break; case 53:return 119; break; case 54:return 120; break; case 55: return 104; break; case 56:return 110; break; case 57:return 52; break; case 58:return 66; break; case 59:return 51; break; case 60:return 20; break; case 61:return 105; break; case 62:return 125; break; case 63:return 81; break; case 64:return 81; break; case 65:return 81; break; case 66:return 80; break; case 67:return 80; break; case 68:return 80; break; case 69:return 58; break; case 70:return 59; break; case 71:return 60; break; case 72:return 61; break; case 73:return 62; break; case 74:return 63; break; case 75:return 64; break; case 76:return 68; break; case 77:return 69; break; case 78:return 54; break; case 79:return 55; break; case 80:return 108; break; case 81:return 111; break; case 82:return 126; break; case 83:return 123; break; case 84:return 112; break; case 85:return 124; break; case 86:return 124; break; case 87:return 113; break; case 88:return 72; break; case 89:return 91; break; case 90:return 'SEP'; break; case 91:return 90; break; case 92:return 65; break; case 93:return 74; break; case 94:return 73; break; case 95:return 76; break; case 96:return 75; break; case 97:return 121; break; case 98:return 122; break; case 99:return 67; break; case 100:return 56; break; case 101:return 57; break; case 102:return 40; break; case 103:return 41; break; case 104:return 70 break; case 105:return 71 break; case 106:return 132; break; case 107:return 21; break; case 108:return 22; break; case 109:return 23; break; } }, rules: [/^(?:%%\{)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[^\}]%%[^\n]*)/,/^(?:title\b)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescription\b)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\[)/,/^(?:\]\))/,/^(?:\[\[)/,/^(?:\]\])/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\])/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:-)/,/^(?:\.)/,/^(?:[\_])/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:[A-Za-z]+)/,/^(?:\\\])/,/^(?:\[\/)/,/^(?:\/\])/,/^(?:\[\\)/,/^(?:[!"#$%&'*+,-.`?\\_/])/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/], conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"callbackargs":{"rules":[27,28],"inclusive":false},"callbackname":{"rules":[24,25,26],"inclusive":false},"href":{"rules":[21,22],"inclusive":false},"click":{"rules":[30,31],"inclusive":false},"vertex":{"rules":[],"inclusive":false},"dir":{"rules":[40,41,42,43,44,45,46,47,48,49,50],"inclusive":false},"accDescription":{"rules":[10],"inclusive":false},"title":{"rules":[8],"inclusive":false},"string":{"rules":[12,13],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,9,11,14,15,16,17,18,19,20,23,29,32,33,34,35,36,37,38,39,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,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,105,106,107,108,109],"inclusive":true}} }); return lexer; })(); parser.lexer = lexer; function Parser () { this.yy = {}; } Parser.prototype = parser;parser.Parser = Parser; return new Parser; })(); if (true) { exports.parser = parser; exports.Parser = parser.Parser; exports.parse = function () { return parser.parse.apply(parser, arguments); }; exports.main = function commonjsMain (args) { if (!args[1]) { console.log('Usage: '+args[0]+' FILE'); process.exit(1); } var source = (__webpack_require__(/*! fs */ "?dbae").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); return exports.parser.parse(source); }; if ( true && __webpack_require__.c[__webpack_require__.s] === module) { exports.main(process.argv.slice(1)); } } /***/ }), /***/ "./src/diagrams/gantt/parser/gantt.jison": /*!***********************************************!*\ !*** ./src/diagrams/gantt/parser/gantt.jison ***! \***********************************************/ /***/ ((module, exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); /* parser generated by jison 0.4.18 */ /* Returns a Parser object of the following structure: Parser: { yy: {} } Parser.prototype: { yy: {}, trace: function(), symbols_: {associative list: name ==> number}, terminals_: {associative list: number ==> name}, productions_: [...], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), table: [...], defaultActions: {...}, parseError: function(str, hash), parse: function(input), lexer: { EOF: 1, parseError: function(str, hash), setInput: function(input), input: function(), unput: function(str), more: function(), less: function(n), pastInput: function(), upcomingInput: function(), showPosition: function(), test_match: function(regex_match_array, rule_index), next: function(), lex: function(), begin: function(condition), popState: function(), _currentRules: function(), topState: function(), pushState: function(condition), options: { ranges: boolean (optional: true ==> token location info will include a .range[] member) flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) }, performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), rules: [...], conditions: {associative list: name ==> set}, } } token location info (@$, _$, etc.): { first_line: n, last_line: n, first_column: n, last_column: n, range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) } the parseError function receives a 'hash' object with these members for lexer and parser errors: { text: (matched text) token: (the produced terminal token, if any) line: (yylineno) } while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { loc: (yylloc) expected: (string describing the set of expected tokens) recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) } */ var parser = (function(){ var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,5],$V2=[7,9,11,12,13,14,15,16,17,18,19,20,21,23,30,35],$V3=[1,15],$V4=[1,16],$V5=[1,17],$V6=[1,18],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,23],$Vc=[1,24],$Vd=[1,26],$Ve=[1,28],$Vf=[1,31],$Vg=[5,7,9,11,12,13,14,15,16,17,18,19,20,21,23,30,35]; var parser = {trace: function trace () { }, yy: {}, symbols_: {"error":2,"start":3,"directive":4,"gantt":5,"document":6,"EOF":7,"line":8,"SPACE":9,"statement":10,"NL":11,"dateFormat":12,"inclusiveEndDates":13,"topAxis":14,"axisFormat":15,"excludes":16,"includes":17,"todayMarker":18,"title":19,"accDescription":20,"section":21,"clickStatement":22,"taskTxt":23,"taskData":24,"openDirective":25,"typeDirective":26,"closeDirective":27,":":28,"argDirective":29,"click":30,"callbackname":31,"callbackargs":32,"href":33,"clickStatementDebug":34,"open_directive":35,"type_directive":36,"arg_directive":37,"close_directive":38,"$accept":0,"$end":1}, terminals_: {2:"error",5:"gantt",7:"EOF",9:"SPACE",11:"NL",12:"dateFormat",13:"inclusiveEndDates",14:"topAxis",15:"axisFormat",16:"excludes",17:"includes",18:"todayMarker",19:"title",20:"accDescription",21:"section",23:"taskTxt",24:"taskData",28:":",30:"click",31:"callbackname",32:"callbackargs",33:"href",35:"open_directive",36:"type_directive",37:"arg_directive",38:"close_directive"}, productions_: [0,[3,2],[3,3],[6,0],[6,2],[8,2],[8,1],[8,1],[8,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,1],[4,4],[4,6],[22,2],[22,3],[22,3],[22,4],[22,3],[22,4],[22,2],[34,2],[34,3],[34,3],[34,4],[34,3],[34,4],[34,2],[25,1],[26,1],[29,1],[27,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { case 2: return $$[$0-1]; break; case 3: this.$ = [] break; case 4: $$[$0-1].push($$[$0]);this.$ = $$[$0-1] break; case 5: case 6: this.$ = $$[$0] break; case 7: case 8: this.$=[]; break; case 9: yy.setDateFormat($$[$0].substr(11));this.$=$$[$0].substr(11); break; case 10: yy.enableInclusiveEndDates();this.$=$$[$0].substr(18); break; case 11: yy.TopAxis();this.$=$$[$0].substr(8); break; case 12: yy.setAxisFormat($$[$0].substr(11));this.$=$$[$0].substr(11); break; case 13: yy.setExcludes($$[$0].substr(9));this.$=$$[$0].substr(9); break; case 14: yy.setIncludes($$[$0].substr(9));this.$=$$[$0].substr(9); break; case 15: yy.setTodayMarker($$[$0].substr(12));this.$=$$[$0].substr(12); break; case 16: yy.setTitle($$[$0].substr(6));this.$=$$[$0].substr(6); break; case 17: yy.setAccDescription($$[$0].substr(15));this.$=$$[$0].substr(15); break; case 18: yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8); break; case 20: yy.addTask($$[$0-1],$$[$0]);this.$='task'; break; case 24: this.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0], null); break; case 25: this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]); break; case 26: this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], null);yy.setLink($$[$0-2],$$[$0]); break; case 27: this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2], $$[$0-1]);yy.setLink($$[$0-3],$$[$0]); break; case 28: this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0], null);yy.setLink($$[$0-2],$$[$0-1]); break; case 29: this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-1], $$[$0]);yy.setLink($$[$0-3],$$[$0-2]); break; case 30: this.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]); break; case 31: case 37: this.$=$$[$0-1] + ' ' + $$[$0]; break; case 32: case 33: case 35: this.$=$$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0]; break; case 34: case 36: this.$=$$[$0-3] + ' ' + $$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0]; break; case 38: yy.parseDirective('%%{', 'open_directive'); break; case 39: yy.parseDirective($$[$0], 'type_directive'); break; case 40: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); break; case 41: yy.parseDirective('}%%', 'close_directive', 'gantt'); break; } }, table: [{3:1,4:2,5:$V0,25:4,35:$V1},{1:[3]},{3:6,4:2,5:$V0,25:4,35:$V1},o($V2,[2,3],{6:7}),{26:8,36:[1,9]},{36:[2,38]},{1:[2,1]},{4:27,7:[1,10],8:11,9:[1,12],10:13,11:[1,14],12:$V3,13:$V4,14:$V5,15:$V6,16:$V7,17:$V8,18:$V9,19:$Va,20:$Vb,21:$Vc,22:25,23:$Vd,25:4,30:$Ve,35:$V1},{27:29,28:[1,30],38:$Vf},o([28,38],[2,39]),o($V2,[2,8],{1:[2,2]}),o($V2,[2,4]),{4:27,10:32,12:$V3,13:$V4,14:$V5,15:$V6,16:$V7,17:$V8,18:$V9,19:$Va,20:$Vb,21:$Vc,22:25,23:$Vd,25:4,30:$Ve,35:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,9]),o($V2,[2,10]),o($V2,[2,11]),o($V2,[2,12]),o($V2,[2,13]),o($V2,[2,14]),o($V2,[2,15]),o($V2,[2,16]),o($V2,[2,17]),o($V2,[2,18]),o($V2,[2,19]),{24:[1,33]},o($V2,[2,21]),{31:[1,34],33:[1,35]},{11:[1,36]},{29:37,37:[1,38]},{11:[2,41]},o($V2,[2,5]),o($V2,[2,20]),o($V2,[2,24],{32:[1,39],33:[1,40]}),o($V2,[2,30],{31:[1,41]}),o($Vg,[2,22]),{27:42,38:$Vf},{38:[2,40]},o($V2,[2,25],{33:[1,43]}),o($V2,[2,26]),o($V2,[2,28],{32:[1,44]}),{11:[1,45]},o($V2,[2,27]),o($V2,[2,29]),o($Vg,[2,23])], defaultActions: {5:[2,38],6:[2,1],31:[2,41],38:[2,40]}, parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse(input) { var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer; sharedState.yy.parser = this; if (typeof lexer.yylloc == 'undefined') { lexer.yylloc = {}; } var yyloc = lexer.yylloc; lstack.push(yyloc); var ranges = lexer.options && lexer.options.ranges; if (typeof sharedState.yy.parseError === 'function') { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function popStack(n) { stack.length = stack.length - 2 * n; vstack.length = vstack.length - n; lstack.length = lstack.length - n; } function lex() { var token; token = tstack.pop() || lexer.lex() || EOF; if (typeof token !== 'number') { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self.symbols_[token] || token; } return token; } var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == 'undefined') { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === 'undefined' || !action.length || !action[0]) { var errStr = ''; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push('\'' + this.terminals_[p] + '\''); } } if (lexer.showPosition) { errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; } else { errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); } this.parseError(errStr, { text: lexer.match, token: this.terminals_[symbol] || symbol, line: lexer.yylineno, loc: yyloc, expected: expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer.yytext); lstack.push(lexer.yylloc); stack.push(action[1]); symbol = null; if (!preErrorSymbol) { yyleng = lexer.yyleng; yytext = lexer.yytext; yylineno = lexer.yylineno; yyloc = lexer.yylloc; if (recovering > 0) { recovering--; } } else { symbol = preErrorSymbol; preErrorSymbol = null; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== 'undefined') { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; }}; /* generated by jison-lex 0.3.4 */ var lexer = (function(){ var lexer = ({ EOF:1, parseError:function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, // resets the lexer, sets new input setInput:function (input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; 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 }; if (this.options.ranges) { this.yylloc.range = [0,0]; } this.offset = 0; return this; }, // consumes and returns one char from the input input:function () { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, // unshifts one char (or a string) into the input unput:function (ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); //this.yyleng -= len; this.offset -= len; var oldLines = 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); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, // When called from action, caches matched text and appends it on next action more:function () { this._more = true; return this; }, // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject:function () { if (this.options.backtrack_lexer) { this._backtrack = true; } 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).\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, // retain first n characters of the match less:function (n) { this.unput(this.match.slice(n)); }, // displays already matched input, i.e. for error messages pastInput:function () { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); }, // displays upcoming input, i.e. for error messages upcomingInput:function () { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20-next.length); } return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); }, // displays the character position where the lexing error occurred, i.e. for error messages showPosition:function () { var pre = this.pastInput(); var c = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c + "^"; }, // test the lexed token: return FALSE when not a match, otherwise return token test_match:function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { // save context backup = { 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 }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { // recover context for (var k in backup) { this[k] = backup[k]; } return false; // rule action called reject() implying the next rule should be tested instead. } return false; }, // return next match in input next:function () { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ''; this.match = ''; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; // rule action called reject() implying a rule MISmatch. } else { // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } if (this._input === "") { return this.EOF; } else { return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, // return next match that has a token lex:function lex () { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin:function begin (condition) { this.conditionStack.push(condition); }, // pop the previously active lexer condition state off the condition stack popState:function popState () { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, // produce the lexer rule set which is active for the currently active lexer condition state _currentRules:function _currentRules () { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState:function topState (n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, // alias for begin(condition) pushState:function pushState (condition) { this.begin(condition); }, // return the number of states currently on the stack stateStackSize:function stateStackSize() { return this.conditionStack.length; }, options: {"case-insensitive":true}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { var YYSTATE=YY_START; switch($avoiding_name_collisions) { case 0: this.begin('open_directive'); return 35; break; case 1: this.begin('type_directive'); return 36; break; case 2: this.popState(); this.begin('arg_directive'); return 28; break; case 3: this.popState(); this.popState(); return 38; break; case 4:return 37; break; case 5:/* skip comments */ break; case 6:/* skip comments */ break; case 7:/* do nothing */ break; case 8:return 11; break; case 9:/* skip whitespace */ break; case 10:/* skip comments */ break; case 11:/* skip comments */ break; case 12:this.begin("href"); break; case 13:this.popState(); break; case 14:return 33; break; case 15:this.begin("callbackname"); break; case 16:this.popState(); break; case 17:this.popState(); this.begin("callbackargs"); break; case 18:return 31; break; case 19:this.popState(); break; case 20:return 32; break; case 21:this.begin("click"); break; case 22:this.popState(); break; case 23:return 30; break; case 24:return 5; break; case 25:return 12; break; case 26:return 13; break; case 27:return 14; break; case 28:return 15; break; case 29:return 17; break; case 30:return 16; break; case 31:return 18; break; case 32:return 'date'; break; case 33:return 19; break; case 34:return 20 break; case 35:return 21; break; case 36:return 23; break; case 37:return 24; break; case 38:return 28; break; case 39:return 7; break; case 40:return 'INVALID'; break; } }, rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i], conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"callbackargs":{"rules":[19,20],"inclusive":false},"callbackname":{"rules":[16,17,18],"inclusive":false},"href":{"rules":[13,14],"inclusive":false},"click":{"rules":[22,23],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,11,12,15,21,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"inclusive":true}} }); return lexer; })(); parser.lexer = lexer; function Parser () { this.yy = {}; } Parser.prototype = parser;parser.Parser = Parser; return new Parser; })(); if (true) { exports.parser = parser; exports.Parser = parser.Parser; exports.parse = function () { return parser.parse.apply(parser, arguments); }; exports.main = function commonjsMain (args) { if (!args[1]) { console.log('Usage: '+args[0]+' FILE'); process.exit(1); } var source = (__webpack_require__(/*! fs */ "?8ed1").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); return exports.parser.parse(source); }; if ( true && __webpack_require__.c[__webpack_require__.s] === module) { exports.main(process.argv.slice(1)); } } /***/ }), /***/ "./src/diagrams/git/parser/gitGraph.jison": /*!************************************************!*\ !*** ./src/diagrams/git/parser/gitGraph.jison ***! \************************************************/ /***/ ((module, exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); /* parser generated by jison 0.4.18 */ /* Returns a Parser object of the following structure: Parser: { yy: {} } Parser.prototype: { yy: {}, trace: function(), symbols_: {associative list: name ==> number}, terminals_: {associative list: number ==> name}, productions_: [...], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), table: [...], defaultActions: {...}, parseError: function(str, hash), parse: function(input), lexer: { EOF: 1, parseError: function(str, hash), setInput: function(input), input: function(), unput: function(str), more: function(), less: function(n), pastInput: function(), upcomingInput: function(), showPosition: function(), test_match: function(regex_match_array, rule_index), next: function(), lex: function(), begin: function(condition), popState: function(), _currentRules: function(), topState: function(), pushState: function(condition), options: { ranges: boolean (optional: true ==> token location info will include a .range[] member) flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) }, performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), rules: [...], conditions: {associative list: name ==> set}, } } token location info (@$, _$, etc.): { first_line: n, last_line: n, first_column: n, last_column: n, range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) } the parseError function receives a 'hash' object with these members for lexer and parser errors: { text: (matched text) token: (the produced terminal token, if any) line: (yylineno) } while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { loc: (yylloc) expected: (string describing the set of expected tokens) recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) } */ var parser = (function(){ var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,7],$V2=[1,5],$V3=[1,9],$V4=[1,6],$V5=[2,6],$V6=[1,16],$V7=[6,8,14,19,21,22,25,38,42],$V8=[8,14,19,21,22,25],$V9=[8,13,14,19,21,22,25],$Va=[1,26],$Vb=[6,8,14,38,42],$Vc=[8,14,42],$Vd=[1,54],$Ve=[1,55],$Vf=[1,56],$Vg=[8,14,23,29,30,42]; var parser = {trace: function trace () { }, yy: {}, symbols_: {"error":2,"start":3,"eol":4,"directive":5,"GG":6,"document":7,"EOF":8,":":9,"DIR":10,"options":11,"body":12,"OPT":13,"NL":14,"line":15,"statement":16,"commitStatement":17,"mergeStatement":18,"BRANCH":19,"ID":20,"CHECKOUT":21,"MERGE":22,"COMMIT_TAG":23,"STR":24,"COMMIT":25,"commit_arg":26,"COMMIT_TYPE":27,"commitType":28,"COMMIT_ID":29,"COMMIT_MSG":30,"NORMAL":31,"REVERSE":32,"HIGHLIGHT":33,"openDirective":34,"typeDirective":35,"closeDirective":36,"argDirective":37,"open_directive":38,"type_directive":39,"arg_directive":40,"close_directive":41,";":42,"$accept":0,"$end":1}, terminals_: {2:"error",6:"GG",8:"EOF",9:":",10:"DIR",13:"OPT",14:"NL",19:"BRANCH",20:"ID",21:"CHECKOUT",22:"MERGE",23:"COMMIT_TAG",24:"STR",25:"COMMIT",27:"COMMIT_TYPE",29:"COMMIT_ID",30:"COMMIT_MSG",31:"NORMAL",32:"REVERSE",33:"HIGHLIGHT",38:"open_directive",39:"type_directive",40:"arg_directive",41:"close_directive",42:";"}, productions_: [0,[3,2],[3,2],[3,3],[3,4],[3,5],[7,0],[7,2],[11,2],[11,1],[12,0],[12,2],[15,2],[15,1],[16,1],[16,1],[16,2],[16,2],[18,2],[18,4],[17,2],[17,3],[17,3],[17,5],[17,5],[17,3],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,3],[17,5],[17,5],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[26,0],[26,1],[28,1],[28,1],[28,1],[5,3],[5,5],[34,1],[35,1],[37,1],[36,1],[4,1],[4,1],[4,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { case 3: return $$[$0]; break; case 4: return $$[$0-1]; break; case 5: yy.setDirection($$[$0-3]); return $$[$0-1]; break; case 7: yy.setOptions($$[$0-1]); this.$ = $$[$0] break; case 8: $$[$0-1] +=$$[$0]; this.$=$$[$0-1] break; case 10: this.$ = [] break; case 11: $$[$0-1].push($$[$0]); this.$=$$[$0-1]; break; case 12: this.$ =$$[$0-1] break; case 16: yy.branch($$[$0]) break; case 17: yy.checkout($$[$0]) break; case 18: yy.merge($$[$0]) break; case 19: yy.merge($$[$0-2], $$[$0]) break; case 20: yy.commit($$[$0]) break; case 21: yy.commit('','',yy.commitType.NORMAL,$$[$0]) break; case 22: yy.commit('','',$$[$0],'') break; case 23: yy.commit('','',$$[$0],$$[$0-2]) break; case 24: yy.commit('','',$$[$0-2],$$[$0]) break; case 25: yy.commit('',$$[$0],yy.commitType.NORMAL,'') break; case 26: yy.commit('',$$[$0-2],yy.commitType.NORMAL,$$[$0]) break; case 27: yy.commit('',$$[$0],yy.commitType.NORMAL,$$[$0-2]) break; case 28: yy.commit('',$$[$0-2],$$[$0],'') break; case 29: yy.commit('',$$[$0],$$[$0-2],'') break; case 30: yy.commit('',$$[$0-4],$$[$0-2],$$[$0]) break; case 31: yy.commit('',$$[$0-4],$$[$0],$$[$0-2]) break; case 32: yy.commit('',$$[$0-2],$$[$0-4],$$[$0]) break; case 33: yy.commit('',$$[$0],$$[$0-4],$$[$0-2]) break; case 34: yy.commit('',$$[$0],$$[$0-2],$$[$0-4]) break; case 35: yy.commit('',$$[$0-2],$$[$0],$$[$0-4]) break; case 36: yy.commit($$[$0],'',yy.commitType.NORMAL,'') break; case 37: yy.commit($$[$0],'',yy.commitType.NORMAL,$$[$0-2]) break; case 38: yy.commit($$[$0-2],'',yy.commitType.NORMAL,$$[$0]) break; case 39: yy.commit($$[$0-2],'',$$[$0],'') break; case 40: yy.commit($$[$0],'',$$[$0-2],'') break; case 41: yy.commit($$[$0],$$[$0-2],yy.commitType.NORMAL,'') break; case 42: yy.commit($$[$0-2],$$[$0],yy.commitType.NORMAL,'') break; case 43: yy.commit($$[$0-4],'',$$[$0-2],$$[$0]) break; case 44: yy.commit($$[$0-4],'',$$[$0],$$[$0-2]) break; case 45: yy.commit($$[$0-2],'',$$[$0-4],$$[$0]) break; case 46: yy.commit($$[$0],'',$$[$0-4],$$[$0-2]) break; case 47: yy.commit($$[$0],'',$$[$0-2],$$[$0-4]) break; case 48: yy.commit($$[$0-2],'',$$[$0],$$[$0-4]) break; case 49: yy.commit($$[$0-4],$$[$0],$$[$0-2],'') break; case 50: yy.commit($$[$0-4],$$[$0-2],$$[$0],'') break; case 51: yy.commit($$[$0-2],$$[$0],$$[$0-4],'') break; case 52: yy.commit($$[$0],$$[$0-2],$$[$0-4],'') break; case 53: yy.commit($$[$0],$$[$0-4],$$[$0-2],'') break; case 54: yy.commit($$[$0-2],$$[$0-4],$$[$0],'') break; case 55: yy.commit($$[$0-4],$$[$0],yy.commitType.NORMAL,$$[$0-2]) break; case 56: yy.commit($$[$0-4],$$[$0-2],yy.commitType.NORMAL,$$[$0]) break; case 57: yy.commit($$[$0-2],$$[$0],yy.commitType.NORMAL,$$[$0-4]) break; case 58: yy.commit($$[$0],$$[$0-2],yy.commitType.NORMAL,$$[$0-4]) break; case 59: yy.commit($$[$0],$$[$0-4],yy.commitType.NORMAL,$$[$0-2]) break; case 60: yy.commit($$[$0-2],$$[$0-4],yy.commitType.NORMAL,$$[$0]) break; case 61: yy.commit($$[$0-6],$$[$0-4],$$[$0-2],$$[$0]) break; case 62: yy.commit($$[$0-6],$$[$0-4],$$[$0],$$[$0-2]) break; case 63: yy.commit($$[$0-6],$$[$0-2],$$[$0-4],$$[$0]) break; case 64: yy.commit($$[$0-6],$$[$0],$$[$0-4],$$[$0-2]) break; case 65: yy.commit($$[$0-6],$$[$0-2],$$[$0],$$[$0-4]) break; case 66: yy.commit($$[$0-6],$$[$0],$$[$0-2],$$[$0-4]) break; case 67: yy.commit($$[$0-4],$$[$0-6],$$[$0-2],$$[$0]) break; case 68: yy.commit($$[$0-4],$$[$0-6],$$[$0],$$[$0-2]) break; case 69: yy.commit($$[$0-2],$$[$0-6],$$[$0-4],$$[$0]) break; case 70: yy.commit($$[$0],$$[$0-6],$$[$0-4],$$[$0-2]) break; case 71: yy.commit($$[$0-2],$$[$0-6],$$[$0],$$[$0-4]) break; case 72: yy.commit($$[$0],$$[$0-6],$$[$0-2],$$[$0-4]) break; case 73: yy.commit($$[$0],$$[$0-4],$$[$0-2],$$[$0-6]) break; case 74: yy.commit($$[$0-2],$$[$0-4],$$[$0],$$[$0-6]) break; case 75: yy.commit($$[$0],$$[$0-2],$$[$0-4],$$[$0-6]) break; case 76: yy.commit($$[$0-2],$$[$0],$$[$0-4],$$[$0-6]) break; case 77: yy.commit($$[$0-4],$$[$0-2],$$[$0],$$[$0-6]) break; case 78: yy.commit($$[$0-4],$$[$0],$$[$0-2],$$[$0-6]) break; case 79: yy.commit($$[$0-2],$$[$0-4],$$[$0-6],$$[$0]) break; case 80: yy.commit($$[$0],$$[$0-4],$$[$0-6],$$[$0-2]) break; case 81: yy.commit($$[$0-2],$$[$0],$$[$0-6],$$[$0-4]) break; case 82: yy.commit($$[$0],$$[$0-2],$$[$0-6],$$[$0-4]) break; case 83: yy.commit($$[$0-4],$$[$0-2],$$[$0-6],$$[$0]) break; case 84: yy.commit($$[$0-4],$$[$0],$$[$0-6],$$[$0-2]) break; case 85: this.$ = "" break; case 86: this.$=$$[$0] break; case 87: this.$=yy.commitType.NORMAL; break; case 88: this.$=yy.commitType.REVERSE; break; case 89: this.$=yy.commitType.HIGHLIGHT; break; case 92: yy.parseDirective('%%{', 'open_directive'); break; case 93: yy.parseDirective($$[$0], 'type_directive'); break; case 94: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); break; case 95: yy.parseDirective('}%%', 'close_directive', 'gitGraph'); break; } }, table: [{3:1,4:2,5:3,6:$V0,8:$V1,14:$V2,34:8,38:$V3,42:$V4},{1:[3]},{3:10,4:2,5:3,6:$V0,8:$V1,14:$V2,34:8,38:$V3,42:$V4},{3:11,4:2,5:3,6:$V0,8:$V1,14:$V2,34:8,38:$V3,42:$V4},{7:12,8:$V5,9:[1,13],10:[1,14],11:15,14:$V6},o($V7,[2,96]),o($V7,[2,97]),o($V7,[2,98]),{35:17,39:[1,18]},{39:[2,92]},{1:[2,1]},{1:[2,2]},{8:[1,19]},{7:20,8:$V5,11:15,14:$V6},{9:[1,21]},o($V8,[2,10],{12:22,13:[1,23]}),o($V9,[2,9]),{9:[1,25],36:24,41:$Va},o([9,41],[2,93]),{1:[2,3]},{8:[1,27]},{7:28,8:$V5,11:15,14:$V6},{8:[2,7],14:[1,31],15:29,16:30,17:32,18:33,19:[1,34],21:[1,35],22:[1,37],25:[1,36]},o($V9,[2,8]),o($Vb,[2,90]),{37:38,40:[1,39]},o($Vb,[2,95]),{1:[2,4]},{8:[1,40]},o($V8,[2,11]),{4:41,8:$V1,14:$V2,42:$V4},o($V8,[2,13]),o($Vc,[2,14]),o($Vc,[2,15]),{20:[1,42]},{20:[1,43]},o($Vc,[2,85],{26:44,23:[1,45],24:[1,49],27:[1,46],29:[1,47],30:[1,48]}),{20:[1,50]},{36:51,41:$Va},{41:[2,94]},{1:[2,5]},o($V8,[2,12]),o($Vc,[2,16]),o($Vc,[2,17]),o($Vc,[2,20]),{24:[1,52]},{28:53,31:$Vd,32:$Ve,33:$Vf},{24:[1,57]},{24:[1,58]},o($Vc,[2,86]),o($Vc,[2,18],{23:[1,59]}),o($Vb,[2,91]),o($Vc,[2,21],{27:[1,60],29:[1,61],30:[1,62]}),o($Vc,[2,22],{23:[1,63],29:[1,64],30:[1,65]}),o($Vg,[2,87]),o($Vg,[2,88]),o($Vg,[2,89]),o($Vc,[2,25],{23:[1,66],27:[1,67],30:[1,68]}),o($Vc,[2,36],{23:[1,69],27:[1,70],29:[1,71]}),{24:[1,72]},{28:73,31:$Vd,32:$Ve,33:$Vf},{24:[1,74]},{24:[1,75]},{24:[1,76]},{24:[1,77]},{24:[1,78]},{24:[1,79]},{28:80,31:$Vd,32:$Ve,33:$Vf},{24:[1,81]},{24:[1,82]},{28:83,31:$Vd,32:$Ve,33:$Vf},{24:[1,84]},o($Vc,[2,19]),o($Vc,[2,23],{29:[1,85],30:[1,86]}),o($Vc,[2,27],{27:[1,87],30:[1,88]}),o($Vc,[2,37],{27:[1,89],29:[1,90]}),o($Vc,[2,24],{29:[1,91],30:[1,92]}),o($Vc,[2,29],{23:[1,93],30:[1,94]}),o($Vc,[2,40],{23:[1,95],29:[1,96]}),o($Vc,[2,26],{27:[1,97],30:[1,98]}),o($Vc,[2,28],{23:[1,99],30:[1,100]}),o($Vc,[2,41],{23:[1,102],27:[1,101]}),o($Vc,[2,38],{27:[1,103],29:[1,104]}),o($Vc,[2,39],{23:[1,105],29:[1,106]}),o($Vc,[2,42],{23:[1,108],27:[1,107]}),{24:[1,109]},{24:[1,110]},{28:111,31:$Vd,32:$Ve,33:$Vf},{24:[1,112]},{28:113,31:$Vd,32:$Ve,33:$Vf},{24:[1,114]},{24:[1,115]},{24:[1,116]},{24:[1,117]},{24:[1,118]},{24:[1,119]},{24:[1,120]},{28:121,31:$Vd,32:$Ve,33:$Vf},{24:[1,122]},{24:[1,123]},{24:[1,124]},{28:125,31:$Vd,32:$Ve,33:$Vf},{24:[1,126]},{28:127,31:$Vd,32:$Ve,33:$Vf},{24:[1,128]},{24:[1,129]},{24:[1,130]},{28:131,31:$Vd,32:$Ve,33:$Vf},{24:[1,132]},o($Vc,[2,34],{30:[1,133]}),o($Vc,[2,47],{29:[1,134]}),o($Vc,[2,35],{30:[1,135]}),o($Vc,[2,58],{27:[1,136]}),o($Vc,[2,48],{29:[1,137]}),o($Vc,[2,57],{27:[1,138]}),o($Vc,[2,33],{30:[1,139]}),o($Vc,[2,46],{29:[1,140]}),o($Vc,[2,32],{30:[1,141]}),o($Vc,[2,52],{23:[1,142]}),o($Vc,[2,45],{29:[1,143]}),o($Vc,[2,51],{23:[1,144]}),o($Vc,[2,31],{30:[1,145]}),o($Vc,[2,59],{27:[1,146]}),o($Vc,[2,30],{30:[1,147]}),o($Vc,[2,53],{23:[1,148]}),o($Vc,[2,54],{23:[1,149]}),o($Vc,[2,60],{27:[1,150]}),o($Vc,[2,44],{29:[1,151]}),o($Vc,[2,55],{27:[1,152]}),o($Vc,[2,43],{29:[1,153]}),o($Vc,[2,49],{23:[1,154]}),o($Vc,[2,50],{23:[1,155]}),o($Vc,[2,56],{27:[1,156]}),{24:[1,157]},{24:[1,158]},{24:[1,159]},{28:160,31:$Vd,32:$Ve,33:$Vf},{24:[1,161]},{28:162,31:$Vd,32:$Ve,33:$Vf},{24:[1,163]},{24:[1,164]},{24:[1,165]},{24:[1,166]},{24:[1,167]},{24:[1,168]},{24:[1,169]},{28:170,31:$Vd,32:$Ve,33:$Vf},{24:[1,171]},{24:[1,172]},{24:[1,173]},{28:174,31:$Vd,32:$Ve,33:$Vf},{24:[1,175]},{28:176,31:$Vd,32:$Ve,33:$Vf},{24:[1,177]},{24:[1,178]},{24:[1,179]},{28:180,31:$Vd,32:$Ve,33:$Vf},o($Vc,[2,75]),o($Vc,[2,76]),o($Vc,[2,73]),o($Vc,[2,74]),o($Vc,[2,78]),o($Vc,[2,77]),o($Vc,[2,82]),o($Vc,[2,81]),o($Vc,[2,80]),o($Vc,[2,79]),o($Vc,[2,84]),o($Vc,[2,83]),o($Vc,[2,72]),o($Vc,[2,71]),o($Vc,[2,70]),o($Vc,[2,69]),o($Vc,[2,67]),o($Vc,[2,68]),o($Vc,[2,66]),o($Vc,[2,65]),o($Vc,[2,64]),o($Vc,[2,63]),o($Vc,[2,61]),o($Vc,[2,62])], defaultActions: {9:[2,92],10:[2,1],11:[2,2],19:[2,3],27:[2,4],39:[2,94],40:[2,5]}, parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse(input) { var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer; sharedState.yy.parser = this; if (typeof lexer.yylloc == 'undefined') { lexer.yylloc = {}; } var yyloc = lexer.yylloc; lstack.push(yyloc); var ranges = lexer.options && lexer.options.ranges; if (typeof sharedState.yy.parseError === 'function') { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function popStack(n) { stack.length = stack.length - 2 * n; vstack.length = vstack.length - n; lstack.length = lstack.length - n; } function lex() { var token; token = tstack.pop() || lexer.lex() || EOF; if (typeof token !== 'number') { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self.symbols_[token] || token; } return token; } var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == 'undefined') { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === 'undefined' || !action.length || !action[0]) { var errStr = ''; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push('\'' + this.terminals_[p] + '\''); } } if (lexer.showPosition) { errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; } else { errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); } this.parseError(errStr, { text: lexer.match, token: this.terminals_[symbol] || symbol, line: lexer.yylineno, loc: yyloc, expected: expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer.yytext); lstack.push(lexer.yylloc); stack.push(action[1]); symbol = null; if (!preErrorSymbol) { yyleng = lexer.yyleng; yytext = lexer.yytext; yylineno = lexer.yylineno; yyloc = lexer.yylloc; if (recovering > 0) { recovering--; } } else { symbol = preErrorSymbol; preErrorSymbol = null; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== 'undefined') { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; }}; /* generated by jison-lex 0.3.4 */ var lexer = (function(){ var lexer = ({ EOF:1, parseError:function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, // resets the lexer, sets new input setInput:function (input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; 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 }; if (this.options.ranges) { this.yylloc.range = [0,0]; } this.offset = 0; return this; }, // consumes and returns one char from the input input:function () { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, // unshifts one char (or a string) into the input unput:function (ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); //this.yyleng -= len; this.offset -= len; var oldLines = 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); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, // When called from action, caches matched text and appends it on next action more:function () { this._more = true; return this; }, // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject:function () { if (this.options.backtrack_lexer) { this._backtrack = true; } 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).\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, // retain first n characters of the match less:function (n) { this.unput(this.match.slice(n)); }, // displays already matched input, i.e. for error messages pastInput:function () { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); }, // displays upcoming input, i.e. for error messages upcomingInput:function () { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20-next.length); } return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); }, // displays the character position where the lexing error occurred, i.e. for error messages showPosition:function () { var pre = this.pastInput(); var c = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c + "^"; }, // test the lexed token: return FALSE when not a match, otherwise return token test_match:function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { // save context backup = { 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 }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { // recover context for (var k in backup) { this[k] = backup[k]; } return false; // rule action called reject() implying the next rule should be tested instead. } return false; }, // return next match in input next:function () { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ''; this.match = ''; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; // rule action called reject() implying a rule MISmatch. } else { // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } if (this._input === "") { return this.EOF; } else { return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, // return next match that has a token lex:function lex () { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin:function begin (condition) { this.conditionStack.push(condition); }, // pop the previously active lexer condition state off the condition stack popState:function popState () { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, // produce the lexer rule set which is active for the currently active lexer condition state _currentRules:function _currentRules () { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState:function topState (n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, // alias for begin(condition) pushState:function pushState (condition) { this.begin(condition); }, // return the number of states currently on the stack stateStackSize:function stateStackSize() { return this.conditionStack.length; }, options: {"case-insensitive":true}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { var YYSTATE=YY_START; switch($avoiding_name_collisions) { case 0: this.begin('open_directive'); return 38; break; case 1: this.begin('type_directive'); return 39; break; case 2: this.popState(); this.begin('arg_directive'); return 9; break; case 3: this.popState(); this.popState(); return 41; break; case 4:return 40; break; case 5:/*{console.log('New line');return 14;}*/ return 14; break; case 6:/* skip all whitespace */ break; case 7:/* skip comments */ break; case 8:/* skip comments */ break; case 9:return 6; break; case 10:return 25; break; case 11:return 29; break; case 12:return 27; break; case 13:return 30; break; case 14:return 31; break; case 15:return 32; break; case 16:return 33; break; case 17:return 23; break; case 18:return 19; break; case 19:return 22; break; case 20:return 21; break; case 21:return 10; break; case 22:return 10; break; case 23:return 9; break; case 24:return 'CARET' break; case 25:this.begin("options"); // break; case 26:this.popState(); // not used anymore in the renderer, fixed for backward compatibility break; case 27:return 13; // break; case 28:this.begin("string"); break; case 29:this.popState(); break; case 30:return 24; break; case 31:return 20; break; case 32:return 8; break; } }, rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gitGraph\b)/i,/^(?:commit\b)/i,/^(?:id:)/i,/^(?:type:)/i,/^(?:msg:)/i,/^(?:NORMAL\b)/i,/^(?:REVERSE\b)/i,/^(?:HIGHLIGHT\b)/i,/^(?:tag:)/i,/^(?:branch\b)/i,/^(?:merge\b)/i,/^(?:checkout\b)/i,/^(?:LR\b)/i,/^(?:BT\b)/i,/^(?::)/i,/^(?:\^)/i,/^(?:options\r?\n)/i,/^(?:[ \r\n\t]+end\b)/i,/^(?:[\s\S]+(?=[ \r\n\t]+end))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[a-zA-Z][-_\./a-zA-Z0-9]*[-_a-zA-Z0-9])/i,/^(?:$)/i], conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"options":{"rules":[26,27],"inclusive":false},"string":{"rules":[29,30],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,28,31,32],"inclusive":true}} }); return lexer; })(); parser.lexer = lexer; function Parser () { this.yy = {}; } Parser.prototype = parser;parser.Parser = Parser; return new Parser; })(); if (true) { exports.parser = parser; exports.Parser = parser.Parser; exports.parse = function () { return parser.parse.apply(parser, arguments); }; exports.main = function commonjsMain (args) { if (!args[1]) { console.log('Usage: '+args[0]+' FILE'); process.exit(1); } var source = (__webpack_require__(/*! fs */ "?2b40").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); return exports.parser.parse(source); }; if ( true && __webpack_require__.c[__webpack_require__.s] === module) { exports.main(process.argv.slice(1)); } } /***/ }), /***/ "./src/diagrams/info/parser/info.jison": /*!*********************************************!*\ !*** ./src/diagrams/info/parser/info.jison ***! \*********************************************/ /***/ ((module, exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); /* parser generated by jison 0.4.18 */ /* Returns a Parser object of the following structure: Parser: { yy: {} } Parser.prototype: { yy: {}, trace: function(), symbols_: {associative list: name ==> number}, terminals_: {associative list: number ==> name}, productions_: [...], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), table: [...], defaultActions: {...}, parseError: function(str, hash), parse: function(input), lexer: { EOF: 1, parseError: function(str, hash), setInput: function(input), input: function(), unput: function(str), more: function(), less: function(n), pastInput: function(), upcomingInput: function(), showPosition: function(), test_match: function(regex_match_array, rule_index), next: function(), lex: function(), begin: function(condition), popState: function(), _currentRules: function(), topState: function(), pushState: function(condition), options: { ranges: boolean (optional: true ==> token location info will include a .range[] member) flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) }, performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), rules: [...], conditions: {associative list: name ==> set}, } } token location info (@$, _$, etc.): { first_line: n, last_line: n, first_column: n, last_column: n, range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) } the parseError function receives a 'hash' object with these members for lexer and parser errors: { text: (matched text) token: (the produced terminal token, if any) line: (yylineno) } while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { loc: (yylloc) expected: (string describing the set of expected tokens) recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) } */ var parser = (function(){ var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,9,10]; var parser = {trace: function trace () { }, yy: {}, symbols_: {"error":2,"start":3,"info":4,"document":5,"EOF":6,"line":7,"statement":8,"NL":9,"showInfo":10,"$accept":0,"$end":1}, terminals_: {2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo"}, productions_: [0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { case 1: return yy; break; case 4: break; case 6: yy.setInfo(true); break; } }, table: [{3:1,4:[1,2]},{1:[3]},o($V0,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8]},{1:[2,1]},o($V0,[2,3]),o($V0,[2,4]),o($V0,[2,5]),o($V0,[2,6])], defaultActions: {4:[2,1]}, parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse(input) { var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer; sharedState.yy.parser = this; if (typeof lexer.yylloc == 'undefined') { lexer.yylloc = {}; } var yyloc = lexer.yylloc; lstack.push(yyloc); var ranges = lexer.options && lexer.options.ranges; if (typeof sharedState.yy.parseError === 'function') { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function popStack(n) { stack.length = stack.length - 2 * n; vstack.length = vstack.length - n; lstack.length = lstack.length - n; } function lex() { var token; token = tstack.pop() || lexer.lex() || EOF; if (typeof token !== 'number') { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self.symbols_[token] || token; } return token; } var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == 'undefined') { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === 'undefined' || !action.length || !action[0]) { var errStr = ''; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push('\'' + this.terminals_[p] + '\''); } } if (lexer.showPosition) { errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; } else { errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); } this.parseError(errStr, { text: lexer.match, token: this.terminals_[symbol] || symbol, line: lexer.yylineno, loc: yyloc, expected: expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer.yytext); lstack.push(lexer.yylloc); stack.push(action[1]); symbol = null; if (!preErrorSymbol) { yyleng = lexer.yyleng; yytext = lexer.yytext; yylineno = lexer.yylineno; yyloc = lexer.yylloc; if (recovering > 0) { recovering--; } } else { symbol = preErrorSymbol; preErrorSymbol = null; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== 'undefined') { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; }}; /* generated by jison-lex 0.3.4 */ var lexer = (function(){ var lexer = ({ EOF:1, parseError:function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, // resets the lexer, sets new input setInput:function (input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; 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 }; if (this.options.ranges) { this.yylloc.range = [0,0]; } this.offset = 0; return this; }, // consumes and returns one char from the input input:function () { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, // unshifts one char (or a string) into the input unput:function (ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); //this.yyleng -= len; this.offset -= len; var oldLines = 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); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, // When called from action, caches matched text and appends it on next action more:function () { this._more = true; return this; }, // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject:function () { if (this.options.backtrack_lexer) { this._backtrack = true; } 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).\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, // retain first n characters of the match less:function (n) { this.unput(this.match.slice(n)); }, // displays already matched input, i.e. for error messages pastInput:function () { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); }, // displays upcoming input, i.e. for error messages upcomingInput:function () { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20-next.length); } return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); }, // displays the character position where the lexing error occurred, i.e. for error messages showPosition:function () { var pre = this.pastInput(); var c = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c + "^"; }, // test the lexed token: return FALSE when not a match, otherwise return token test_match:function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { // save context backup = { 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 }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { // recover context for (var k in backup) { this[k] = backup[k]; } return false; // rule action called reject() implying the next rule should be tested instead. } return false; }, // return next match in input next:function () { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ''; this.match = ''; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; // rule action called reject() implying a rule MISmatch. } else { // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } if (this._input === "") { return this.EOF; } else { return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, // return next match that has a token lex:function lex () { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin:function begin (condition) { this.conditionStack.push(condition); }, // pop the previously active lexer condition state off the condition stack popState:function popState () { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, // produce the lexer rule set which is active for the currently active lexer condition state _currentRules:function _currentRules () { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState:function topState (n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, // alias for begin(condition) pushState:function pushState (condition) { this.begin(condition); }, // return the number of states currently on the stack stateStackSize:function stateStackSize() { return this.conditionStack.length; }, options: {"case-insensitive":true}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { // Pre-lexer code can go here var YYSTATE=YY_START; switch($avoiding_name_collisions) { case 0:return 4 ; break; case 1:return 9 ; break; case 2:return 'space'; break; case 3:return 10; break; case 4:return 6 ; break; case 5:return 'TXT' ; break; } }, rules: [/^(?:info\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:showInfo\b)/i,/^(?:$)/i,/^(?:.)/i], conditions: {"INITIAL":{"rules":[0,1,2,3,4,5],"inclusive":true}} }); return lexer; })(); parser.lexer = lexer; function Parser () { this.yy = {}; } Parser.prototype = parser;parser.Parser = Parser; return new Parser; })(); if (true) { exports.parser = parser; exports.Parser = parser.Parser; exports.parse = function () { return parser.parse.apply(parser, arguments); }; exports.main = function commonjsMain (args) { if (!args[1]) { console.log('Usage: '+args[0]+' FILE'); process.exit(1); } var source = (__webpack_require__(/*! fs */ "?c5f1").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); return exports.parser.parse(source); }; if ( true && __webpack_require__.c[__webpack_require__.s] === module) { exports.main(process.argv.slice(1)); } } /***/ }), /***/ "./src/diagrams/pie/parser/pie.jison": /*!*******************************************!*\ !*** ./src/diagrams/pie/parser/pie.jison ***! \*******************************************/ /***/ ((module, exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); /* parser generated by jison 0.4.18 */ /* Returns a Parser object of the following structure: Parser: { yy: {} } Parser.prototype: { yy: {}, trace: function(), symbols_: {associative list: name ==> number}, terminals_: {associative list: number ==> name}, productions_: [...], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), table: [...], defaultActions: {...}, parseError: function(str, hash), parse: function(input), lexer: { EOF: 1, parseError: function(str, hash), setInput: function(input), input: function(), unput: function(str), more: function(), less: function(n), pastInput: function(), upcomingInput: function(), showPosition: function(), test_match: function(regex_match_array, rule_index), next: function(), lex: function(), begin: function(condition), popState: function(), _currentRules: function(), topState: function(), pushState: function(condition), options: { ranges: boolean (optional: true ==> token location info will include a .range[] member) flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) }, performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), rules: [...], conditions: {associative list: name ==> set}, } } token location info (@$, _$, etc.): { first_line: n, last_line: n, first_column: n, last_column: n, range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) } the parseError function receives a 'hash' object with these members for lexer and parser errors: { text: (matched text) token: (the produced terminal token, if any) line: (yylineno) } while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { loc: (yylloc) expected: (string describing the set of expected tokens) recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) } */ var parser = (function(){ var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,5],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,11,13,15,22,23,24,25],$V6=[2,5],$V7=[1,6,11,13,15,22,23,24,25],$V8=[22,23,24],$V9=[2,8],$Va=[1,18],$Vb=[1,19],$Vc=[1,20],$Vd=[1,25],$Ve=[6,22,23,24,25]; var parser = {trace: function trace () { }, yy: {}, symbols_: {"error":2,"start":3,"eol":4,"directive":5,"PIE":6,"document":7,"showData":8,"line":9,"statement":10,"txt":11,"value":12,"title":13,"title_value":14,"accDescription":15,"description_value":16,"openDirective":17,"typeDirective":18,"closeDirective":19,":":20,"argDirective":21,"NEWLINE":22,";":23,"EOF":24,"open_directive":25,"type_directive":26,"arg_directive":27,"close_directive":28,"$accept":0,"$end":1}, terminals_: {2:"error",6:"PIE",8:"showData",11:"txt",12:"value",13:"title",14:"title_value",15:"accDescription",16:"description_value",20:":",22:"NEWLINE",23:";",24:"EOF",25:"open_directive",26:"type_directive",27:"arg_directive",28:"close_directive"}, productions_: [0,[3,2],[3,2],[3,2],[3,3],[7,0],[7,2],[9,2],[10,0],[10,2],[10,2],[10,2],[10,1],[5,3],[5,5],[4,1],[4,1],[4,1],[17,1],[18,1],[21,1],[19,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { case 4: yy.setShowData(true); break; case 7: this.$ = $$[$0-1] break; case 9: yy.addSection($$[$0-1],yy.cleanupValue($$[$0])); break; case 10: this.$=$$[$0].trim();yy.setTitle(this.$); break; case 11: this.$=$$[$0].trim();yy.setAccDescription(this.$); break; case 18: yy.parseDirective('%%{', 'open_directive'); break; case 19: yy.parseDirective($$[$0], 'type_directive'); break; case 20: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); break; case 21: yy.parseDirective('}%%', 'close_directive', 'pie'); break; } }, table: [{3:1,4:2,5:3,6:$V0,17:8,22:$V1,23:$V2,24:$V3,25:$V4},{1:[3]},{3:10,4:2,5:3,6:$V0,17:8,22:$V1,23:$V2,24:$V3,25:$V4},{3:11,4:2,5:3,6:$V0,17:8,22:$V1,23:$V2,24:$V3,25:$V4},o($V5,$V6,{7:12,8:[1,13]}),o($V7,[2,15]),o($V7,[2,16]),o($V7,[2,17]),{18:14,26:[1,15]},{26:[2,18]},{1:[2,1]},{1:[2,2]},o($V8,$V9,{17:8,9:16,10:17,5:21,1:[2,3],11:$Va,13:$Vb,15:$Vc,25:$V4}),o($V5,$V6,{7:22}),{19:23,20:[1,24],28:$Vd},o([20,28],[2,19]),o($V5,[2,6]),{4:26,22:$V1,23:$V2,24:$V3},{12:[1,27]},{14:[1,28]},{16:[1,29]},o($V8,[2,12]),o($V8,$V9,{17:8,9:16,10:17,5:21,1:[2,4],11:$Va,13:$Vb,15:$Vc,25:$V4}),o($Ve,[2,13]),{21:30,27:[1,31]},o($Ve,[2,21]),o($V5,[2,7]),o($V8,[2,9]),o($V8,[2,10]),o($V8,[2,11]),{19:32,28:$Vd},{28:[2,20]},o($Ve,[2,14])], defaultActions: {9:[2,18],10:[2,1],11:[2,2],31:[2,20]}, parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse(input) { var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer; sharedState.yy.parser = this; if (typeof lexer.yylloc == 'undefined') { lexer.yylloc = {}; } var yyloc = lexer.yylloc; lstack.push(yyloc); var ranges = lexer.options && lexer.options.ranges; if (typeof sharedState.yy.parseError === 'function') { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function popStack(n) { stack.length = stack.length - 2 * n; vstack.length = vstack.length - n; lstack.length = lstack.length - n; } function lex() { var token; token = tstack.pop() || lexer.lex() || EOF; if (typeof token !== 'number') { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self.symbols_[token] || token; } return token; } var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == 'undefined') { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === 'undefined' || !action.length || !action[0]) { var errStr = ''; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push('\'' + this.terminals_[p] + '\''); } } if (lexer.showPosition) { errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; } else { errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); } this.parseError(errStr, { text: lexer.match, token: this.terminals_[symbol] || symbol, line: lexer.yylineno, loc: yyloc, expected: expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer.yytext); lstack.push(lexer.yylloc); stack.push(action[1]); symbol = null; if (!preErrorSymbol) { yyleng = lexer.yyleng; yytext = lexer.yytext; yylineno = lexer.yylineno; yyloc = lexer.yylloc; if (recovering > 0) { recovering--; } } else { symbol = preErrorSymbol; preErrorSymbol = null; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== 'undefined') { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; }}; /* generated by jison-lex 0.3.4 */ var lexer = (function(){ var lexer = ({ EOF:1, parseError:function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, // resets the lexer, sets new input setInput:function (input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; 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 }; if (this.options.ranges) { this.yylloc.range = [0,0]; } this.offset = 0; return this; }, // consumes and returns one char from the input input:function () { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, // unshifts one char (or a string) into the input unput:function (ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); //this.yyleng -= len; this.offset -= len; var oldLines = 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); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, // When called from action, caches matched text and appends it on next action more:function () { this._more = true; return this; }, // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject:function () { if (this.options.backtrack_lexer) { this._backtrack = true; } 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).\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, // retain first n characters of the match less:function (n) { this.unput(this.match.slice(n)); }, // displays already matched input, i.e. for error messages pastInput:function () { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); }, // displays upcoming input, i.e. for error messages upcomingInput:function () { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20-next.length); } return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); }, // displays the character position where the lexing error occurred, i.e. for error messages showPosition:function () { var pre = this.pastInput(); var c = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c + "^"; }, // test the lexed token: return FALSE when not a match, otherwise return token test_match:function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { // save context backup = { 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 }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { // recover context for (var k in backup) { this[k] = backup[k]; } return false; // rule action called reject() implying the next rule should be tested instead. } return false; }, // return next match in input next:function () { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ''; this.match = ''; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; // rule action called reject() implying a rule MISmatch. } else { // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } if (this._input === "") { return this.EOF; } else { return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, // return next match that has a token lex:function lex () { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin:function begin (condition) { this.conditionStack.push(condition); }, // pop the previously active lexer condition state off the condition stack popState:function popState () { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, // produce the lexer rule set which is active for the currently active lexer condition state _currentRules:function _currentRules () { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState:function topState (n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, // alias for begin(condition) pushState:function pushState (condition) { this.begin(condition); }, // return the number of states currently on the stack stateStackSize:function stateStackSize() { return this.conditionStack.length; }, options: {"case-insensitive":true}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { var YYSTATE=YY_START; switch($avoiding_name_collisions) { case 0: this.begin('open_directive'); return 25; break; case 1: this.begin('type_directive'); return 26; break; case 2: this.popState(); this.begin('arg_directive'); return 20; break; case 3: this.popState(); this.popState(); return 28; break; case 4:return 27; break; case 5:/* skip comments */ break; case 6:/* skip comments */{ /*console.log('');*/ } break; case 7:return 22; break; case 8:/* do nothing */ break; case 9:/* ignore */ break; case 10: this.begin("title");return 13; break; case 11: this.popState(); return "title_value"; break; case 12: this.begin("accDescription");return 15; break; case 13: this.popState(); return "description_value"; break; case 14: this.begin("string"); break; case 15: this.popState(); break; case 16: return "txt"; break; case 17:return 6; break; case 18:return 8; break; case 19:return "value"; break; case 20:return 24; break; } }, rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescription\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?:showData\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i], conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"accDescription":{"rules":[13],"inclusive":false},"title":{"rules":[11],"inclusive":false},"string":{"rules":[15,16],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,12,14,17,18,19,20],"inclusive":true}} }); return lexer; })(); parser.lexer = lexer; function Parser () { this.yy = {}; } Parser.prototype = parser;parser.Parser = Parser; return new Parser; })(); if (true) { exports.parser = parser; exports.Parser = parser.Parser; exports.parse = function () { return parser.parse.apply(parser, arguments); }; exports.main = function commonjsMain (args) { if (!args[1]) { console.log('Usage: '+args[0]+' FILE'); process.exit(1); } var source = (__webpack_require__(/*! fs */ "?a3fa").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); return exports.parser.parse(source); }; if ( true && __webpack_require__.c[__webpack_require__.s] === module) { exports.main(process.argv.slice(1)); } } /***/ }), /***/ "./src/diagrams/requirement/parser/requirementDiagram.jison": /*!******************************************************************!*\ !*** ./src/diagrams/requirement/parser/requirementDiagram.jison ***! \******************************************************************/ /***/ ((module, exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); /* parser generated by jison 0.4.18 */ /* Returns a Parser object of the following structure: Parser: { yy: {} } Parser.prototype: { yy: {}, trace: function(), symbols_: {associative list: name ==> number}, terminals_: {associative list: number ==> name}, productions_: [...], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), table: [...], defaultActions: {...}, parseError: function(str, hash), parse: function(input), lexer: { EOF: 1, parseError: function(str, hash), setInput: function(input), input: function(), unput: function(str), more: function(), less: function(n), pastInput: function(), upcomingInput: function(), showPosition: function(), test_match: function(regex_match_array, rule_index), next: function(), lex: function(), begin: function(condition), popState: function(), _currentRules: function(), topState: function(), pushState: function(condition), options: { ranges: boolean (optional: true ==> token location info will include a .range[] member) flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) }, performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), rules: [...], conditions: {associative list: name ==> set}, } } token location info (@$, _$, etc.): { first_line: n, last_line: n, first_column: n, last_column: n, range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) } the parseError function receives a 'hash' object with these members for lexer and parser errors: { text: (matched text) token: (the produced terminal token, if any) line: (yylineno) } while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { loc: (yylloc) expected: (string describing the set of expected tokens) recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) } */ var parser = (function(){ var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,5],$V2=[1,6],$V3=[1,7],$V4=[5,6,8,14,15,16,37,38,39,40,41,42,50,68,69],$V5=[1,19],$V6=[2,12],$V7=[1,23],$V8=[1,24],$V9=[1,25],$Va=[1,26],$Vb=[1,27],$Vc=[1,28],$Vd=[1,21],$Ve=[1,29],$Vf=[1,30],$Vg=[1,33],$Vh=[68,69],$Vi=[5,8,14,15,16,37,38,39,40,41,42,50,57,59,68,69],$Vj=[1,53],$Vk=[1,54],$Vl=[1,55],$Vm=[1,56],$Vn=[1,57],$Vo=[1,58],$Vp=[1,59],$Vq=[59,60],$Vr=[1,71],$Vs=[1,67],$Vt=[1,68],$Vu=[1,69],$Vv=[1,70],$Vw=[1,72],$Vx=[1,76],$Vy=[1,77],$Vz=[1,74],$VA=[1,75],$VB=[5,8,14,15,16,37,38,39,40,41,42,50,68,69]; var parser = {trace: function trace () { }, yy: {}, symbols_: {"error":2,"start":3,"directive":4,"NEWLINE":5,"RD":6,"diagram":7,"EOF":8,"openDirective":9,"typeDirective":10,"closeDirective":11,":":12,"argDirective":13,"title":14,"accDescription":15,"open_directive":16,"type_directive":17,"arg_directive":18,"close_directive":19,"requirementDef":20,"elementDef":21,"relationshipDef":22,"requirementType":23,"requirementName":24,"STRUCT_START":25,"requirementBody":26,"ID":27,"COLONSEP":28,"id":29,"TEXT":30,"text":31,"RISK":32,"riskLevel":33,"VERIFYMTHD":34,"verifyType":35,"STRUCT_STOP":36,"REQUIREMENT":37,"FUNCTIONAL_REQUIREMENT":38,"INTERFACE_REQUIREMENT":39,"PERFORMANCE_REQUIREMENT":40,"PHYSICAL_REQUIREMENT":41,"DESIGN_CONSTRAINT":42,"LOW_RISK":43,"MED_RISK":44,"HIGH_RISK":45,"VERIFY_ANALYSIS":46,"VERIFY_DEMONSTRATION":47,"VERIFY_INSPECTION":48,"VERIFY_TEST":49,"ELEMENT":50,"elementName":51,"elementBody":52,"TYPE":53,"type":54,"DOCREF":55,"ref":56,"END_ARROW_L":57,"relationship":58,"LINE":59,"END_ARROW_R":60,"CONTAINS":61,"COPIES":62,"DERIVES":63,"SATISFIES":64,"VERIFIES":65,"REFINES":66,"TRACES":67,"unqString":68,"qString":69,"$accept":0,"$end":1}, terminals_: {2:"error",5:"NEWLINE",6:"RD",8:"EOF",12:":",14:"title",15:"accDescription",16:"open_directive",17:"type_directive",18:"arg_directive",19:"close_directive",25:"STRUCT_START",27:"ID",28:"COLONSEP",30:"TEXT",32:"RISK",34:"VERIFYMTHD",36:"STRUCT_STOP",37:"REQUIREMENT",38:"FUNCTIONAL_REQUIREMENT",39:"INTERFACE_REQUIREMENT",40:"PERFORMANCE_REQUIREMENT",41:"PHYSICAL_REQUIREMENT",42:"DESIGN_CONSTRAINT",43:"LOW_RISK",44:"MED_RISK",45:"HIGH_RISK",46:"VERIFY_ANALYSIS",47:"VERIFY_DEMONSTRATION",48:"VERIFY_INSPECTION",49:"VERIFY_TEST",50:"ELEMENT",53:"TYPE",55:"DOCREF",57:"END_ARROW_L",59:"LINE",60:"END_ARROW_R",61:"CONTAINS",62:"COPIES",63:"DERIVES",64:"SATISFIES",65:"VERIFIES",66:"REFINES",67:"TRACES",68:"unqString",69:"qString"}, productions_: [0,[3,3],[3,2],[3,4],[4,3],[4,5],[4,1],[4,1],[9,1],[10,1],[13,1],[11,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[20,5],[26,5],[26,5],[26,5],[26,5],[26,2],[26,1],[23,1],[23,1],[23,1],[23,1],[23,1],[23,1],[33,1],[33,1],[33,1],[35,1],[35,1],[35,1],[35,1],[21,5],[52,5],[52,5],[52,2],[52,1],[22,5],[22,5],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[24,1],[24,1],[29,1],[29,1],[31,1],[31,1],[51,1],[51,1],[54,1],[54,1],[56,1],[56,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { case 6: yy.setTitle($$[$0].substring(6));this.$=$$[$0].substring(6); break; case 7: yy.setAccDescription($$[$0].substring(15));this.$=$$[$0].substring(15); break; case 8: yy.parseDirective('%%{', 'open_directive'); break; case 9: yy.parseDirective($$[$0], 'type_directive'); break; case 10: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); break; case 11: yy.parseDirective('}%%', 'close_directive', 'pie'); break; case 12: this.$ = [] break; case 18: yy.addRequirement($$[$0-3], $$[$0-4]) break; case 19: yy.setNewReqId($$[$0-2]); break; case 20: yy.setNewReqText($$[$0-2]); break; case 21: yy.setNewReqRisk($$[$0-2]); break; case 22: yy.setNewReqVerifyMethod($$[$0-2]); break; case 25: this.$=yy.RequirementType.REQUIREMENT; break; case 26: this.$=yy.RequirementType.FUNCTIONAL_REQUIREMENT; break; case 27: this.$=yy.RequirementType.INTERFACE_REQUIREMENT; break; case 28: this.$=yy.RequirementType.PERFORMANCE_REQUIREMENT; break; case 29: this.$=yy.RequirementType.PHYSICAL_REQUIREMENT; break; case 30: this.$=yy.RequirementType.DESIGN_CONSTRAINT; break; case 31: this.$=yy.RiskLevel.LOW_RISK; break; case 32: this.$=yy.RiskLevel.MED_RISK; break; case 33: this.$=yy.RiskLevel.HIGH_RISK; break; case 34: this.$=yy.VerifyType.VERIFY_ANALYSIS; break; case 35: this.$=yy.VerifyType.VERIFY_DEMONSTRATION; break; case 36: this.$=yy.VerifyType.VERIFY_INSPECTION; break; case 37: this.$=yy.VerifyType.VERIFY_TEST; break; case 38: yy.addElement($$[$0-3]) break; case 39: yy.setNewElementType($$[$0-2]); break; case 40: yy.setNewElementDocRef($$[$0-2]); break; case 43: yy.addRelationship($$[$0-2], $$[$0], $$[$0-4]) break; case 44: yy.addRelationship($$[$0-2], $$[$0-4], $$[$0]) break; case 45: this.$=yy.Relationships.CONTAINS; break; case 46: this.$=yy.Relationships.COPIES; break; case 47: this.$=yy.Relationships.DERIVES; break; case 48: this.$=yy.Relationships.SATISFIES; break; case 49: this.$=yy.Relationships.VERIFIES; break; case 50: this.$=yy.Relationships.REFINES; break; case 51: this.$=yy.Relationships.TRACES; break; } }, table: [{3:1,4:2,6:$V0,9:4,14:$V1,15:$V2,16:$V3},{1:[3]},{3:9,4:2,5:[1,8],6:$V0,9:4,14:$V1,15:$V2,16:$V3},{5:[1,10]},{10:11,17:[1,12]},o($V4,[2,6]),o($V4,[2,7]),{17:[2,8]},{3:13,4:2,6:$V0,9:4,14:$V1,15:$V2,16:$V3},{1:[2,2]},{4:18,5:$V5,7:14,8:$V6,9:4,14:$V1,15:$V2,16:$V3,20:15,21:16,22:17,23:20,29:22,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb,42:$Vc,50:$Vd,68:$Ve,69:$Vf},{11:31,12:[1,32],19:$Vg},o([12,19],[2,9]),{1:[2,1]},{8:[1,34]},{4:18,5:$V5,7:35,8:$V6,9:4,14:$V1,15:$V2,16:$V3,20:15,21:16,22:17,23:20,29:22,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb,42:$Vc,50:$Vd,68:$Ve,69:$Vf},{4:18,5:$V5,7:36,8:$V6,9:4,14:$V1,15:$V2,16:$V3,20:15,21:16,22:17,23:20,29:22,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb,42:$Vc,50:$Vd,68:$Ve,69:$Vf},{4:18,5:$V5,7:37,8:$V6,9:4,14:$V1,15:$V2,16:$V3,20:15,21:16,22:17,23:20,29:22,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb,42:$Vc,50:$Vd,68:$Ve,69:$Vf},{4:18,5:$V5,7:38,8:$V6,9:4,14:$V1,15:$V2,16:$V3,20:15,21:16,22:17,23:20,29:22,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb,42:$Vc,50:$Vd,68:$Ve,69:$Vf},{4:18,5:$V5,7:39,8:$V6,9:4,14:$V1,15:$V2,16:$V3,20:15,21:16,22:17,23:20,29:22,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb,42:$Vc,50:$Vd,68:$Ve,69:$Vf},{24:40,68:[1,41],69:[1,42]},{51:43,68:[1,44],69:[1,45]},{57:[1,46],59:[1,47]},o($Vh,[2,25]),o($Vh,[2,26]),o($Vh,[2,27]),o($Vh,[2,28]),o($Vh,[2,29]),o($Vh,[2,30]),o($Vi,[2,54]),o($Vi,[2,55]),o($V4,[2,4]),{13:48,18:[1,49]},o($V4,[2,11]),{1:[2,3]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{8:[2,17]},{25:[1,50]},{25:[2,52]},{25:[2,53]},{25:[1,51]},{25:[2,58]},{25:[2,59]},{58:52,61:$Vj,62:$Vk,63:$Vl,64:$Vm,65:$Vn,66:$Vo,67:$Vp},{58:60,61:$Vj,62:$Vk,63:$Vl,64:$Vm,65:$Vn,66:$Vo,67:$Vp},{11:61,19:$Vg},{19:[2,10]},{5:[1,62]},{5:[1,63]},{59:[1,64]},o($Vq,[2,45]),o($Vq,[2,46]),o($Vq,[2,47]),o($Vq,[2,48]),o($Vq,[2,49]),o($Vq,[2,50]),o($Vq,[2,51]),{60:[1,65]},o($V4,[2,5]),{5:$Vr,26:66,27:$Vs,30:$Vt,32:$Vu,34:$Vv,36:$Vw},{5:$Vx,36:$Vy,52:73,53:$Vz,55:$VA},{29:78,68:$Ve,69:$Vf},{29:79,68:$Ve,69:$Vf},o($VB,[2,18]),{28:[1,80]},{28:[1,81]},{28:[1,82]},{28:[1,83]},{5:$Vr,26:84,27:$Vs,30:$Vt,32:$Vu,34:$Vv,36:$Vw},o($VB,[2,24]),o($VB,[2,38]),{28:[1,85]},{28:[1,86]},{5:$Vx,36:$Vy,52:87,53:$Vz,55:$VA},o($VB,[2,42]),o($VB,[2,43]),o($VB,[2,44]),{29:88,68:$Ve,69:$Vf},{31:89,68:[1,90],69:[1,91]},{33:92,43:[1,93],44:[1,94],45:[1,95]},{35:96,46:[1,97],47:[1,98],48:[1,99],49:[1,100]},o($VB,[2,23]),{54:101,68:[1,102],69:[1,103]},{56:104,68:[1,105],69:[1,106]},o($VB,[2,41]),{5:[1,107]},{5:[1,108]},{5:[2,56]},{5:[2,57]},{5:[1,109]},{5:[2,31]},{5:[2,32]},{5:[2,33]},{5:[1,110]},{5:[2,34]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,111]},{5:[2,60]},{5:[2,61]},{5:[1,112]},{5:[2,62]},{5:[2,63]},{5:$Vr,26:113,27:$Vs,30:$Vt,32:$Vu,34:$Vv,36:$Vw},{5:$Vr,26:114,27:$Vs,30:$Vt,32:$Vu,34:$Vv,36:$Vw},{5:$Vr,26:115,27:$Vs,30:$Vt,32:$Vu,34:$Vv,36:$Vw},{5:$Vr,26:116,27:$Vs,30:$Vt,32:$Vu,34:$Vv,36:$Vw},{5:$Vx,36:$Vy,52:117,53:$Vz,55:$VA},{5:$Vx,36:$Vy,52:118,53:$Vz,55:$VA},o($VB,[2,19]),o($VB,[2,20]),o($VB,[2,21]),o($VB,[2,22]),o($VB,[2,39]),o($VB,[2,40])], defaultActions: {7:[2,8],9:[2,2],13:[2,1],34:[2,3],35:[2,13],36:[2,14],37:[2,15],38:[2,16],39:[2,17],41:[2,52],42:[2,53],44:[2,58],45:[2,59],49:[2,10],90:[2,56],91:[2,57],93:[2,31],94:[2,32],95:[2,33],97:[2,34],98:[2,35],99:[2,36],100:[2,37],102:[2,60],103:[2,61],105:[2,62],106:[2,63]}, parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse(input) { var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer; sharedState.yy.parser = this; if (typeof lexer.yylloc == 'undefined') { lexer.yylloc = {}; } var yyloc = lexer.yylloc; lstack.push(yyloc); var ranges = lexer.options && lexer.options.ranges; if (typeof sharedState.yy.parseError === 'function') { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function popStack(n) { stack.length = stack.length - 2 * n; vstack.length = vstack.length - n; lstack.length = lstack.length - n; } function lex() { var token; token = tstack.pop() || lexer.lex() || EOF; if (typeof token !== 'number') { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self.symbols_[token] || token; } return token; } var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == 'undefined') { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === 'undefined' || !action.length || !action[0]) { var errStr = ''; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push('\'' + this.terminals_[p] + '\''); } } if (lexer.showPosition) { errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; } else { errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); } this.parseError(errStr, { text: lexer.match, token: this.terminals_[symbol] || symbol, line: lexer.yylineno, loc: yyloc, expected: expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer.yytext); lstack.push(lexer.yylloc); stack.push(action[1]); symbol = null; if (!preErrorSymbol) { yyleng = lexer.yyleng; yytext = lexer.yytext; yylineno = lexer.yylineno; yyloc = lexer.yylloc; if (recovering > 0) { recovering--; } } else { symbol = preErrorSymbol; preErrorSymbol = null; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== 'undefined') { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; }}; /* generated by jison-lex 0.3.4 */ var lexer = (function(){ var lexer = ({ EOF:1, parseError:function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, // resets the lexer, sets new input setInput:function (input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; 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 }; if (this.options.ranges) { this.yylloc.range = [0,0]; } this.offset = 0; return this; }, // consumes and returns one char from the input input:function () { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, // unshifts one char (or a string) into the input unput:function (ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); //this.yyleng -= len; this.offset -= len; var oldLines = 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); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, // When called from action, caches matched text and appends it on next action more:function () { this._more = true; return this; }, // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject:function () { if (this.options.backtrack_lexer) { this._backtrack = true; } 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).\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, // retain first n characters of the match less:function (n) { this.unput(this.match.slice(n)); }, // displays already matched input, i.e. for error messages pastInput:function () { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); }, // displays upcoming input, i.e. for error messages upcomingInput:function () { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20-next.length); } return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); }, // displays the character position where the lexing error occurred, i.e. for error messages showPosition:function () { var pre = this.pastInput(); var c = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c + "^"; }, // test the lexed token: return FALSE when not a match, otherwise return token test_match:function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { // save context backup = { 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 }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { // recover context for (var k in backup) { this[k] = backup[k]; } return false; // rule action called reject() implying the next rule should be tested instead. } return false; }, // return next match in input next:function () { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ''; this.match = ''; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; // rule action called reject() implying a rule MISmatch. } else { // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } if (this._input === "") { return this.EOF; } else { return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, // return next match that has a token lex:function lex () { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin:function begin (condition) { this.conditionStack.push(condition); }, // pop the previously active lexer condition state off the condition stack popState:function popState () { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, // produce the lexer rule set which is active for the currently active lexer condition state _currentRules:function _currentRules () { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState:function topState (n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, // alias for begin(condition) pushState:function pushState (condition) { this.begin(condition); }, // return the number of states currently on the stack stateStackSize:function stateStackSize() { return this.conditionStack.length; }, options: {"case-insensitive":true}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { var YYSTATE=YY_START; switch($avoiding_name_collisions) { case 0: this.begin('open_directive'); return 16; break; case 1: this.begin('type_directive'); return 17; break; case 2: this.popState(); this.begin('arg_directive'); return 12; break; case 3: this.popState(); this.popState(); return 19; break; case 4:return 18; break; case 5:return 14; break; case 6:return 15; break; case 7:return 5; break; case 8:/* skip all whitespace */ break; case 9:/* skip comments */ break; case 10:/* skip comments */ break; case 11:return 8; break; case 12:return 6; break; case 13:return 25; break; case 14:return 36; break; case 15:return 28; break; case 16:return 27; break; case 17:return 30; break; case 18:return 32; break; case 19:return 34; break; case 20:return 37; break; case 21:return 38; break; case 22:return 39; break; case 23:return 40; break; case 24:return 41; break; case 25:return 42; break; case 26:return 43; break; case 27:return 44; break; case 28:return 45; break; case 29:return 46; break; case 30:return 47; break; case 31:return 48; break; case 32:return 49; break; case 33:return 50; break; case 34:return 61; break; case 35:return 62; break; case 36:return 63; break; case 37:return 64; break; case 38:return 65; break; case 39:return 66; break; case 40:return 67; break; case 41:return 53; break; case 42:return 55; break; case 43:return 57; break; case 44:return 60; break; case 45:return 59; break; case 46: this.begin("string"); break; case 47: this.popState(); break; case 48: return "qString"; break; case 49: yy_.yytext = yy_.yytext.trim(); return 68; break; } }, rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:title\s[^#\n;]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i], conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"unqString":{"rules":[],"inclusive":false},"token":{"rules":[],"inclusive":false},"string":{"rules":[47,48],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,49],"inclusive":true}} }); return lexer; })(); parser.lexer = lexer; function Parser () { this.yy = {}; } Parser.prototype = parser;parser.Parser = Parser; return new Parser; })(); if (true) { exports.parser = parser; exports.Parser = parser.Parser; exports.parse = function () { return parser.parse.apply(parser, arguments); }; exports.main = function commonjsMain (args) { if (!args[1]) { console.log('Usage: '+args[0]+' FILE'); process.exit(1); } var source = (__webpack_require__(/*! fs */ "?ebf4").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); return exports.parser.parse(source); }; if ( true && __webpack_require__.c[__webpack_require__.s] === module) { exports.main(process.argv.slice(1)); } } /***/ }), /***/ "./src/diagrams/sequence/parser/sequenceDiagram.jison": /*!************************************************************!*\ !*** ./src/diagrams/sequence/parser/sequenceDiagram.jison ***! \************************************************************/ /***/ ((module, exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); /* parser generated by jison 0.4.18 */ /* Returns a Parser object of the following structure: Parser: { yy: {} } Parser.prototype: { yy: {}, trace: function(), symbols_: {associative list: name ==> number}, terminals_: {associative list: number ==> name}, productions_: [...], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), table: [...], defaultActions: {...}, parseError: function(str, hash), parse: function(input), lexer: { EOF: 1, parseError: function(str, hash), setInput: function(input), input: function(), unput: function(str), more: function(), less: function(n), pastInput: function(), upcomingInput: function(), showPosition: function(), test_match: function(regex_match_array, rule_index), next: function(), lex: function(), begin: function(condition), popState: function(), _currentRules: function(), topState: function(), pushState: function(condition), options: { ranges: boolean (optional: true ==> token location info will include a .range[] member) flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) }, performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), rules: [...], conditions: {associative list: name ==> set}, } } token location info (@$, _$, etc.): { first_line: n, last_line: n, first_column: n, last_column: n, range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) } the parseError function receives a 'hash' object with these members for lexer and parser errors: { text: (matched text) token: (the produced terminal token, if any) line: (yylineno) } while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { loc: (yylloc) expected: (string describing the set of expected tokens) recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) } */ var parser = (function(){ var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,18],$V8=[1,19],$V9=[1,21],$Va=[1,22],$Vb=[1,23],$Vc=[1,29],$Vd=[1,30],$Ve=[1,31],$Vf=[1,32],$Vg=[1,33],$Vh=[1,34],$Vi=[1,35],$Vj=[1,36],$Vk=[1,39],$Vl=[1,40],$Vm=[1,41],$Vn=[1,42],$Vo=[1,43],$Vp=[1,44],$Vq=[1,47],$Vr=[1,4,5,16,20,22,25,26,32,33,34,35,36,37,38,39,41,43,44,45,50,51,52,53,61,71],$Vs=[4,5,16,20,22,25,26,32,33,34,35,36,37,38,39,41,45,50,51,52,53,61,71],$Vt=[4,5,16,20,22,25,26,32,33,34,35,36,37,38,39,41,44,45,50,51,52,53,61,71],$Vu=[4,5,16,20,22,25,26,32,33,34,35,36,37,38,39,41,43,45,50,51,52,53,61,71],$Vv=[59,60,61],$Vw=[1,110],$Vx=[1,4,5,7,16,20,22,25,26,32,33,34,35,36,37,38,39,41,43,44,45,50,51,52,53,61,71]; var parser = {trace: function trace () { }, yy: {}, symbols_: {"error":2,"start":3,"SPACE":4,"NEWLINE":5,"directive":6,"SD":7,"document":8,"line":9,"statement":10,"openDirective":11,"typeDirective":12,"closeDirective":13,":":14,"argDirective":15,"participant":16,"actor":17,"AS":18,"restOfLine":19,"participant_actor":20,"signal":21,"autonumber":22,"NUM":23,"off":24,"activate":25,"deactivate":26,"note_statement":27,"links_statement":28,"link_statement":29,"properties_statement":30,"details_statement":31,"title":32,"legacy_title":33,"accDescription":34,"loop":35,"end":36,"rect":37,"opt":38,"alt":39,"else_sections":40,"par":41,"par_sections":42,"and":43,"else":44,"note":45,"placement":46,"text2":47,"over":48,"actor_pair":49,"links":50,"link":51,"properties":52,"details":53,"spaceList":54,",":55,"left_of":56,"right_of":57,"signaltype":58,"+":59,"-":60,"ACTOR":61,"SOLID_OPEN_ARROW":62,"DOTTED_OPEN_ARROW":63,"SOLID_ARROW":64,"DOTTED_ARROW":65,"SOLID_CROSS":66,"DOTTED_CROSS":67,"SOLID_POINT":68,"DOTTED_POINT":69,"TXT":70,"open_directive":71,"type_directive":72,"arg_directive":73,"close_directive":74,"$accept":0,"$end":1}, terminals_: {2:"error",4:"SPACE",5:"NEWLINE",7:"SD",14:":",16:"participant",18:"AS",19:"restOfLine",20:"participant_actor",22:"autonumber",23:"NUM",24:"off",25:"activate",26:"deactivate",32:"title",33:"legacy_title",34:"accDescription",35:"loop",36:"end",37:"rect",38:"opt",39:"alt",41:"par",43:"and",44:"else",45:"note",48:"over",50:"links",51:"link",52:"properties",53:"details",55:",",56:"left_of",57:"right_of",59:"+",60:"-",61:"ACTOR",62:"SOLID_OPEN_ARROW",63:"DOTTED_OPEN_ARROW",64:"SOLID_ARROW",65:"DOTTED_ARROW",66:"SOLID_CROSS",67:"DOTTED_CROSS",68:"SOLID_POINT",69:"DOTTED_POINT",70:"TXT",71:"open_directive",72:"type_directive",73:"arg_directive",74:"close_directive"}, productions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[6,4],[6,6],[10,5],[10,3],[10,5],[10,3],[10,2],[10,4],[10,3],[10,3],[10,2],[10,3],[10,3],[10,2],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,1],[10,4],[10,4],[10,4],[10,4],[10,4],[10,1],[42,1],[42,4],[40,1],[40,4],[27,4],[27,4],[28,3],[29,3],[30,3],[31,3],[54,2],[54,1],[49,3],[49,1],[46,1],[46,1],[21,5],[21,5],[21,4],[17,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[47,1],[11,1],[12,1],[15,1],[13,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { case 4: yy.apply($$[$0]);return $$[$0]; break; case 5: this.$ = [] break; case 6: $$[$0-1].push($$[$0]);this.$ = $$[$0-1] break; case 7: case 8: this.$ = $$[$0] break; case 9: this.$=[]; break; case 12: $$[$0-3].type='addParticipant';$$[$0-3].description=yy.parseMessage($$[$0-1]); this.$=$$[$0-3]; break; case 13: $$[$0-1].type='addParticipant';this.$=$$[$0-1]; break; case 14: $$[$0-3].type='addActor';$$[$0-3].description=yy.parseMessage($$[$0-1]); this.$=$$[$0-3]; break; case 15: $$[$0-1].type='addActor'; this.$=$$[$0-1]; break; case 17: this.$= {type:'sequenceIndex',sequenceIndex: Number($$[$0-2]), sequenceIndexStep:Number($$[$0-1]), sequenceVisible:true, signalType:yy.LINETYPE.AUTONUMBER}; break; case 18: this.$ = {type:'sequenceIndex',sequenceIndex: Number($$[$0-1]), sequenceIndexStep:1, sequenceVisible:true, signalType:yy.LINETYPE.AUTONUMBER}; break; case 19: this.$ = {type:'sequenceIndex', sequenceVisible:false, signalType:yy.LINETYPE.AUTONUMBER}; break; case 20: this.$ = {type:'sequenceIndex', sequenceVisible:true, signalType:yy.LINETYPE.AUTONUMBER}; break; case 21: this.$={type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]}; break; case 22: this.$={type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-1]}; break; case 28: yy.setTitle($$[$0].substring(6));this.$=$$[$0].substring(6); break; case 29: yy.setTitle($$[$0].substring(7));this.$=$$[$0].substring(7); break; case 30: yy.setAccDescription($$[$0].substring(15));this.$=$$[$0].substring(15); break; case 31: $$[$0-1].unshift({type: 'loopStart', loopText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.LOOP_START}); $$[$0-1].push({type: 'loopEnd', loopText:$$[$0-2], signalType: yy.LINETYPE.LOOP_END}); this.$=$$[$0-1]; break; case 32: $$[$0-1].unshift({type: 'rectStart', color:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.RECT_START }); $$[$0-1].push({type: 'rectEnd', color:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.RECT_END }); this.$=$$[$0-1]; break; case 33: $$[$0-1].unshift({type: 'optStart', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.OPT_START}); $$[$0-1].push({type: 'optEnd', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.OPT_END}); this.$=$$[$0-1]; break; case 34: // Alt start $$[$0-1].unshift({type: 'altStart', altText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.ALT_START}); // Content in alt is already in $$[$0-1] // End $$[$0-1].push({type: 'altEnd', signalType: yy.LINETYPE.ALT_END}); this.$=$$[$0-1]; break; case 35: // Parallel start $$[$0-1].unshift({type: 'parStart', parText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.PAR_START}); // Content in par is already in $$[$0-1] // End $$[$0-1].push({type: 'parEnd', signalType: yy.LINETYPE.PAR_END}); this.$=$$[$0-1]; break; case 38: this.$ = $$[$0-3].concat([{type: 'and', parText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.PAR_AND}, $$[$0]]); break; case 40: this.$ = $$[$0-3].concat([{type: 'else', altText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.ALT_ELSE}, $$[$0]]); break; case 41: this.$ = [$$[$0-1], {type:'addNote', placement:$$[$0-2], actor:$$[$0-1].actor, text:$$[$0]}]; break; case 42: // Coerce actor_pair into a [to, from, ...] array $$[$0-2] = [].concat($$[$0-1], $$[$0-1]).slice(0, 2); $$[$0-2][0] = $$[$0-2][0].actor; $$[$0-2][1] = $$[$0-2][1].actor; this.$ = [$$[$0-1], {type:'addNote', placement:yy.PLACEMENT.OVER, actor:$$[$0-2].slice(0, 2), text:$$[$0]}]; break; case 43: this.$ = [$$[$0-1], {type:'addLinks', actor:$$[$0-1].actor, text:$$[$0]}]; break; case 44: this.$ = [$$[$0-1], {type:'addALink', actor:$$[$0-1].actor, text:$$[$0]}]; break; case 45: this.$ = [$$[$0-1], {type:'addProperties', actor:$$[$0-1].actor, text:$$[$0]}]; break; case 46: this.$ = [$$[$0-1], {type:'addDetails', actor:$$[$0-1].actor, text:$$[$0]}]; break; case 49: this.$ = [$$[$0-2], $$[$0]]; break; case 50: this.$ = $$[$0]; break; case 51: this.$ = yy.PLACEMENT.LEFTOF; break; case 52: this.$ = yy.PLACEMENT.RIGHTOF; break; case 53: this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]}, {type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]} ] break; case 54: this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]}, {type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-4]} ] break; case 55: this.$ = [$$[$0-3],$$[$0-1],{type: 'addMessage', from:$$[$0-3].actor, to:$$[$0-1].actor, signalType:$$[$0-2], msg:$$[$0]}] break; case 56: this.$={ type: 'addParticipant', actor:$$[$0]} break; case 57: this.$ = yy.LINETYPE.SOLID_OPEN; break; case 58: this.$ = yy.LINETYPE.DOTTED_OPEN; break; case 59: this.$ = yy.LINETYPE.SOLID; break; case 60: this.$ = yy.LINETYPE.DOTTED; break; case 61: this.$ = yy.LINETYPE.SOLID_CROSS; break; case 62: this.$ = yy.LINETYPE.DOTTED_CROSS; break; case 63: this.$ = yy.LINETYPE.SOLID_POINT; break; case 64: this.$ = yy.LINETYPE.DOTTED_POINT; break; case 65: this.$ = yy.parseMessage($$[$0].trim().substring(1)) break; case 66: yy.parseDirective('%%{', 'open_directive'); break; case 67: yy.parseDirective($$[$0], 'type_directive'); break; case 68: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); break; case 69: yy.parseDirective('}%%', 'close_directive', 'sequence'); break; } }, table: [{3:1,4:$V0,5:$V1,6:4,7:$V2,11:6,71:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,11:6,71:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,11:6,71:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,11:6,71:$V3},o([1,4,5,16,20,22,25,26,32,33,34,35,37,38,39,41,45,50,51,52,53,61,71],$V4,{8:11}),{12:12,72:[1,13]},{72:[2,66]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:37,9:14,10:16,11:6,16:$V7,17:38,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,35:$Vf,37:$Vg,38:$Vh,39:$Vi,41:$Vj,45:$Vk,50:$Vl,51:$Vm,52:$Vn,53:$Vo,61:$Vp,71:$V3},{13:45,14:[1,46],74:$Vq},o([14,74],[2,67]),o($Vr,[2,6]),{6:37,10:48,11:6,16:$V7,17:38,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,35:$Vf,37:$Vg,38:$Vh,39:$Vi,41:$Vj,45:$Vk,50:$Vl,51:$Vm,52:$Vn,53:$Vo,61:$Vp,71:$V3},o($Vr,[2,8]),o($Vr,[2,9]),{17:49,61:$Vp},{17:50,61:$Vp},{5:[1,51]},{5:[1,54],23:[1,52],24:[1,53]},{17:55,61:$Vp},{17:56,61:$Vp},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},o($Vr,[2,28]),o($Vr,[2,29]),o($Vr,[2,30]),{19:[1,62]},{19:[1,63]},{19:[1,64]},{19:[1,65]},{19:[1,66]},o($Vr,[2,36]),{58:67,62:[1,68],63:[1,69],64:[1,70],65:[1,71],66:[1,72],67:[1,73],68:[1,74],69:[1,75]},{46:76,48:[1,77],56:[1,78],57:[1,79]},{17:80,61:$Vp},{17:81,61:$Vp},{17:82,61:$Vp},{17:83,61:$Vp},o([5,18,55,62,63,64,65,66,67,68,69,70],[2,56]),{5:[1,84]},{15:85,73:[1,86]},{5:[2,69]},o($Vr,[2,7]),{5:[1,88],18:[1,87]},{5:[1,90],18:[1,89]},o($Vr,[2,16]),{5:[1,92],23:[1,91]},{5:[1,93]},o($Vr,[2,20]),{5:[1,94]},{5:[1,95]},o($Vr,[2,23]),o($Vr,[2,24]),o($Vr,[2,25]),o($Vr,[2,26]),o($Vr,[2,27]),o($Vs,$V4,{8:96}),o($Vs,$V4,{8:97}),o($Vs,$V4,{8:98}),o($Vt,$V4,{40:99,8:100}),o($Vu,$V4,{42:101,8:102}),{17:105,59:[1,103],60:[1,104],61:$Vp},o($Vv,[2,57]),o($Vv,[2,58]),o($Vv,[2,59]),o($Vv,[2,60]),o($Vv,[2,61]),o($Vv,[2,62]),o($Vv,[2,63]),o($Vv,[2,64]),{17:106,61:$Vp},{17:108,49:107,61:$Vp},{61:[2,51]},{61:[2,52]},{47:109,70:$Vw},{47:111,70:$Vw},{47:112,70:$Vw},{47:113,70:$Vw},o($Vx,[2,10]),{13:114,74:$Vq},{74:[2,68]},{19:[1,115]},o($Vr,[2,13]),{19:[1,116]},o($Vr,[2,15]),{5:[1,117]},o($Vr,[2,18]),o($Vr,[2,19]),o($Vr,[2,21]),o($Vr,[2,22]),{4:$V5,5:$V6,6:37,9:14,10:16,11:6,16:$V7,17:38,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,35:$Vf,36:[1,118],37:$Vg,38:$Vh,39:$Vi,41:$Vj,45:$Vk,50:$Vl,51:$Vm,52:$Vn,53:$Vo,61:$Vp,71:$V3},{4:$V5,5:$V6,6:37,9:14,10:16,11:6,16:$V7,17:38,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,35:$Vf,36:[1,119],37:$Vg,38:$Vh,39:$Vi,41:$Vj,45:$Vk,50:$Vl,51:$Vm,52:$Vn,53:$Vo,61:$Vp,71:$V3},{4:$V5,5:$V6,6:37,9:14,10:16,11:6,16:$V7,17:38,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,35:$Vf,36:[1,120],37:$Vg,38:$Vh,39:$Vi,41:$Vj,45:$Vk,50:$Vl,51:$Vm,52:$Vn,53:$Vo,61:$Vp,71:$V3},{36:[1,121]},{4:$V5,5:$V6,6:37,9:14,10:16,11:6,16:$V7,17:38,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,35:$Vf,36:[2,39],37:$Vg,38:$Vh,39:$Vi,41:$Vj,44:[1,122],45:$Vk,50:$Vl,51:$Vm,52:$Vn,53:$Vo,61:$Vp,71:$V3},{36:[1,123]},{4:$V5,5:$V6,6:37,9:14,10:16,11:6,16:$V7,17:38,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,35:$Vf,36:[2,37],37:$Vg,38:$Vh,39:$Vi,41:$Vj,43:[1,124],45:$Vk,50:$Vl,51:$Vm,52:$Vn,53:$Vo,61:$Vp,71:$V3},{17:125,61:$Vp},{17:126,61:$Vp},{47:127,70:$Vw},{47:128,70:$Vw},{47:129,70:$Vw},{55:[1,130],70:[2,50]},{5:[2,43]},{5:[2,65]},{5:[2,44]},{5:[2,45]},{5:[2,46]},{5:[1,131]},{5:[1,132]},{5:[1,133]},o($Vr,[2,17]),o($Vr,[2,31]),o($Vr,[2,32]),o($Vr,[2,33]),o($Vr,[2,34]),{19:[1,134]},o($Vr,[2,35]),{19:[1,135]},{47:136,70:$Vw},{47:137,70:$Vw},{5:[2,55]},{5:[2,41]},{5:[2,42]},{17:138,61:$Vp},o($Vx,[2,11]),o($Vr,[2,12]),o($Vr,[2,14]),o($Vt,$V4,{8:100,40:139}),o($Vu,$V4,{8:102,42:140}),{5:[2,53]},{5:[2,54]},{70:[2,49]},{36:[2,40]},{36:[2,38]}], defaultActions: {7:[2,66],8:[2,1],9:[2,2],10:[2,3],47:[2,69],78:[2,51],79:[2,52],86:[2,68],109:[2,43],110:[2,65],111:[2,44],112:[2,45],113:[2,46],127:[2,55],128:[2,41],129:[2,42],136:[2,53],137:[2,54],138:[2,49],139:[2,40],140:[2,38]}, parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse(input) { var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer; sharedState.yy.parser = this; if (typeof lexer.yylloc == 'undefined') { lexer.yylloc = {}; } var yyloc = lexer.yylloc; lstack.push(yyloc); var ranges = lexer.options && lexer.options.ranges; if (typeof sharedState.yy.parseError === 'function') { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function popStack(n) { stack.length = stack.length - 2 * n; vstack.length = vstack.length - n; lstack.length = lstack.length - n; } function lex() { var token; token = tstack.pop() || lexer.lex() || EOF; if (typeof token !== 'number') { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self.symbols_[token] || token; } return token; } var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == 'undefined') { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === 'undefined' || !action.length || !action[0]) { var errStr = ''; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push('\'' + this.terminals_[p] + '\''); } } if (lexer.showPosition) { errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; } else { errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); } this.parseError(errStr, { text: lexer.match, token: this.terminals_[symbol] || symbol, line: lexer.yylineno, loc: yyloc, expected: expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer.yytext); lstack.push(lexer.yylloc); stack.push(action[1]); symbol = null; if (!preErrorSymbol) { yyleng = lexer.yyleng; yytext = lexer.yytext; yylineno = lexer.yylineno; yyloc = lexer.yylloc; if (recovering > 0) { recovering--; } } else { symbol = preErrorSymbol; preErrorSymbol = null; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== 'undefined') { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; }}; /* generated by jison-lex 0.3.4 */ var lexer = (function(){ var lexer = ({ EOF:1, parseError:function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, // resets the lexer, sets new input setInput:function (input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; 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 }; if (this.options.ranges) { this.yylloc.range = [0,0]; } this.offset = 0; return this; }, // consumes and returns one char from the input input:function () { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, // unshifts one char (or a string) into the input unput:function (ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); //this.yyleng -= len; this.offset -= len; var oldLines = 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); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, // When called from action, caches matched text and appends it on next action more:function () { this._more = true; return this; }, // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject:function () { if (this.options.backtrack_lexer) { this._backtrack = true; } 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).\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, // retain first n characters of the match less:function (n) { this.unput(this.match.slice(n)); }, // displays already matched input, i.e. for error messages pastInput:function () { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); }, // displays upcoming input, i.e. for error messages upcomingInput:function () { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20-next.length); } return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); }, // displays the character position where the lexing error occurred, i.e. for error messages showPosition:function () { var pre = this.pastInput(); var c = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c + "^"; }, // test the lexed token: return FALSE when not a match, otherwise return token test_match:function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { // save context backup = { 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 }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { // recover context for (var k in backup) { this[k] = backup[k]; } return false; // rule action called reject() implying the next rule should be tested instead. } return false; }, // return next match in input next:function () { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ''; this.match = ''; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; // rule action called reject() implying a rule MISmatch. } else { // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } if (this._input === "") { return this.EOF; } else { return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, // return next match that has a token lex:function lex () { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin:function begin (condition) { this.conditionStack.push(condition); }, // pop the previously active lexer condition state off the condition stack popState:function popState () { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, // produce the lexer rule set which is active for the currently active lexer condition state _currentRules:function _currentRules () { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState:function topState (n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, // alias for begin(condition) pushState:function pushState (condition) { this.begin(condition); }, // return the number of states currently on the stack stateStackSize:function stateStackSize() { return this.conditionStack.length; }, options: {"case-insensitive":true}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { var YYSTATE=YY_START; switch($avoiding_name_collisions) { case 0: this.begin('open_directive'); return 71; break; case 1: this.begin('type_directive'); return 72; break; case 2: this.popState(); this.begin('arg_directive'); return 14; break; case 3: this.popState(); this.popState(); return 74; break; case 4:return 73; break; case 5:return 5; break; case 6:/* skip all whitespace */ break; case 7:/* skip same-line whitespace */ break; case 8:/* skip comments */ break; case 9:/* skip comments */ break; case 10:/* skip comments */ break; case 11:return 23; break; case 12: this.begin('ID'); return 16; break; case 13: this.begin('ID'); return 20; break; case 14: yy_.yytext = yy_.yytext.trim(); this.begin('ALIAS'); return 61; break; case 15: this.popState(); this.popState(); this.begin('LINE'); return 18; break; case 16: this.popState(); this.popState(); return 5; break; case 17: this.begin('LINE'); return 35; break; case 18: this.begin('LINE'); return 37; break; case 19: this.begin('LINE'); return 38; break; case 20: this.begin('LINE'); return 39; break; case 21: this.begin('LINE'); return 44; break; case 22: this.begin('LINE'); return 41; break; case 23: this.begin('LINE'); return 43; break; case 24: this.popState(); return 19; break; case 25:return 36; break; case 26:return 56; break; case 27:return 57; break; case 28:return 50; break; case 29:return 51; break; case 30:return 52; break; case 31:return 53; break; case 32:return 48; break; case 33:return 45; break; case 34: this.begin('ID'); return 25; break; case 35: this.begin('ID'); return 26; break; case 36:return 32; break; case 37:return 33; break; case 38:return 34; break; case 39:return 7; break; case 40:return 22; break; case 41:return 24; break; case 42:return 55; break; case 43:return 5; break; case 44: yy_.yytext = yy_.yytext.trim(); return 61; break; case 45:return 64; break; case 46:return 65; break; case 47:return 62; break; case 48:return 63; break; case 49:return 66; break; case 50:return 67; break; case 51:return 68; break; case 52:return 69; break; case 53:return 70; break; case 54:return 59; break; case 55:return 60; break; case 56:return 5; break; case 57:return 'INVALID'; break; } }, rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i], conditions: {"open_directive":{"rules":[1,8],"inclusive":false},"type_directive":{"rules":[2,3,8],"inclusive":false},"arg_directive":{"rules":[3,4,8],"inclusive":false},"ID":{"rules":[7,8,14],"inclusive":false},"ALIAS":{"rules":[7,8,15,16],"inclusive":false},"LINE":{"rules":[7,8,24],"inclusive":false},"INITIAL":{"rules":[0,5,6,8,9,10,11,12,13,17,18,19,20,21,22,23,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57],"inclusive":true}} }); return lexer; })(); parser.lexer = lexer; function Parser () { this.yy = {}; } Parser.prototype = parser;parser.Parser = Parser; return new Parser; })(); if (true) { exports.parser = parser; exports.Parser = parser.Parser; exports.parse = function () { return parser.parse.apply(parser, arguments); }; exports.main = function commonjsMain (args) { if (!args[1]) { console.log('Usage: '+args[0]+' FILE'); process.exit(1); } var source = (__webpack_require__(/*! fs */ "?e940").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); return exports.parser.parse(source); }; if ( true && __webpack_require__.c[__webpack_require__.s] === module) { exports.main(process.argv.slice(1)); } } /***/ }), /***/ "./src/diagrams/state/parser/stateDiagram.jison": /*!******************************************************!*\ !*** ./src/diagrams/state/parser/stateDiagram.jison ***! \******************************************************/ /***/ ((module, exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); /* parser generated by jison 0.4.18 */ /* Returns a Parser object of the following structure: Parser: { yy: {} } Parser.prototype: { yy: {}, trace: function(), symbols_: {associative list: name ==> number}, terminals_: {associative list: number ==> name}, productions_: [...], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), table: [...], defaultActions: {...}, parseError: function(str, hash), parse: function(input), lexer: { EOF: 1, parseError: function(str, hash), setInput: function(input), input: function(), unput: function(str), more: function(), less: function(n), pastInput: function(), upcomingInput: function(), showPosition: function(), test_match: function(regex_match_array, rule_index), next: function(), lex: function(), begin: function(condition), popState: function(), _currentRules: function(), topState: function(), pushState: function(condition), options: { ranges: boolean (optional: true ==> token location info will include a .range[] member) flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) }, performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), rules: [...], conditions: {associative list: name ==> set}, } } token location info (@$, _$, etc.): { first_line: n, last_line: n, first_column: n, last_column: n, range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) } the parseError function receives a 'hash' object with these members for lexer and parser errors: { text: (matched text) token: (the produced terminal token, if any) line: (yylineno) } while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { loc: (yylloc) expected: (string describing the set of expected tokens) recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) } */ var parser = (function(){ var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,32],$Vc=[1,23],$Vd=[1,24],$Ve=[1,25],$Vf=[1,26],$Vg=[1,27],$Vh=[1,30],$Vi=[1,31],$Vj=[1,34],$Vk=[1,35],$Vl=[1,36],$Vm=[1,37],$Vn=[1,33],$Vo=[1,40],$Vp=[1,4,5,14,15,17,19,20,22,23,24,25,26,27,31,33,40,41,42,43,46,49],$Vq=[1,4,5,12,13,14,15,17,19,20,22,23,24,25,26,27,31,33,40,41,42,43,46,49],$Vr=[1,4,5,7,14,15,17,19,20,22,23,24,25,26,27,31,33,40,41,42,43,46,49],$Vs=[4,5,14,15,17,19,20,22,23,24,25,26,27,31,33,40,41,42,43,46,49]; var parser = {trace: function trace () { }, yy: {}, symbols_: {"error":2,"start":3,"SPACE":4,"NL":5,"directive":6,"SD":7,"document":8,"line":9,"statement":10,"idStatement":11,"DESCR":12,"-->":13,"HIDE_EMPTY":14,"scale":15,"WIDTH":16,"COMPOSIT_STATE":17,"STRUCT_START":18,"STRUCT_STOP":19,"STATE_DESCR":20,"AS":21,"ID":22,"FORK":23,"JOIN":24,"CHOICE":25,"CONCURRENT":26,"note":27,"notePosition":28,"NOTE_TEXT":29,"direction":30,"title":31,"title_value":32,"accDescription":33,"description_value":34,"openDirective":35,"typeDirective":36,"closeDirective":37,":":38,"argDirective":39,"direction_tb":40,"direction_bt":41,"direction_rl":42,"direction_lr":43,"eol":44,";":45,"EDGE_STATE":46,"left_of":47,"right_of":48,"open_directive":49,"type_directive":50,"arg_directive":51,"close_directive":52,"$accept":0,"$end":1}, terminals_: {2:"error",4:"SPACE",5:"NL",7:"SD",12:"DESCR",13:"-->",14:"HIDE_EMPTY",15:"scale",16:"WIDTH",17:"COMPOSIT_STATE",18:"STRUCT_START",19:"STRUCT_STOP",20:"STATE_DESCR",21:"AS",22:"ID",23:"FORK",24:"JOIN",25:"CHOICE",26:"CONCURRENT",27:"note",29:"NOTE_TEXT",31:"title",32:"title_value",33:"accDescription",34:"description_value",38:":",40:"direction_tb",41:"direction_bt",42:"direction_rl",43:"direction_lr",45:";",46:"EDGE_STATE",47:"left_of",48:"right_of",49:"open_directive",50:"type_directive",51:"arg_directive",52:"close_directive"}, productions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[10,1],[10,2],[10,2],[6,3],[6,5],[30,1],[30,1],[30,1],[30,1],[44,1],[44,1],[11,1],[11,1],[28,1],[28,1],[35,1],[36,1],[39,1],[37,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { case 4: /*console.warn('Root document', $$[$0]);*/ yy.setRootDoc($$[$0]);return $$[$0]; break; case 5: this.$ = [] break; case 6: if($$[$0]!='nl'){ $$[$0-1].push($$[$0]);this.$ = $$[$0-1] } // console.warn('Got document',$$[$0-1], $$[$0]); break; case 7: case 8: this.$ = $$[$0] break; case 9: this.$='nl'; break; case 10: /*console.warn('got id and descr', $$[$0]);*/this.$={ stmt: 'state', id: $$[$0], type: 'default', description: ''}; break; case 11: /*console.warn('got id and descr', $$[$0-1], $$[$0].trim());*/this.$={ stmt: 'state', id: $$[$0-1], type: 'default', description: yy.trimColon($$[$0])}; break; case 12: /*console.warn('got id', $$[$0-2]);yy.addRelation($$[$0-2], $$[$0]);*/ this.$={ stmt: 'relation', state1: { stmt: 'state', id: $$[$0-2], type: 'default', description: '' }, state2:{ stmt: 'state', id: $$[$0] ,type: 'default', description: ''}}; break; case 13: /*yy.addRelation($$[$0-3], $$[$0-1], $$[$0].substr(1).trim());*/ this.$={ stmt: 'relation', state1: { stmt: 'state', id: $$[$0-3], type: 'default', description: '' }, state2:{ stmt: 'state', id: $$[$0-1] ,type: 'default', description: ''}, description: $$[$0].substr(1).trim()}; break; case 17: /* console.warn('Adding document for state without id ', $$[$0-3]);*/ this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: '', doc: $$[$0-1] } break; case 18: var id=$$[$0]; var description = $$[$0-2].trim(); if($$[$0].match(':')){ var parts = $$[$0].split(':'); id=parts[0]; description = [description, parts[1]]; } this.$={stmt: 'state', id: id, type: 'default', description: description}; break; case 19: // console.warn('Adding document for state with id zxzx', $$[$0-3], $$[$0-2], yy.getDirection()); yy.addDocument($$[$0-3]); this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: $$[$0-5], doc: $$[$0-1] } break; case 20: this.$={ stmt: 'state', id: $$[$0], type: 'fork' } break; case 21: this.$={ stmt: 'state', id: $$[$0], type: 'join' } break; case 22: this.$={ stmt: 'state', id: $$[$0], type: 'choice' } break; case 23: this.$={ stmt: 'state', id: yy.getDividerId(), type: 'divider' } break; case 24: /* console.warn('got NOTE, position: ', $$[$0-2].trim(), 'id = ', $$[$0-1].trim(), 'note: ', $$[$0]);*/ this.$={ stmt: 'state', id: $$[$0-1].trim(), note:{position: $$[$0-2].trim(), text: $$[$0].trim()}}; break; case 28: this.$=$$[$0].trim();yy.setTitle(this.$); break; case 29: this.$=$$[$0].trim();yy.setAccDescription(this.$); break; case 32: yy.setDirection('TB');this.$={stmt:'dir', value:'TB'}; break; case 33: yy.setDirection('BT');this.$={stmt:'dir', value:'BT'}; break; case 34: yy.setDirection('RL'); this.$={stmt:'dir', value:'RL'}; break; case 35: yy.setDirection('LR');this.$={stmt:'dir', value:'LR'}; break; case 38: case 39: this.$=$$[$0]; break; case 42: yy.parseDirective('%%{', 'open_directive'); break; case 43: yy.parseDirective($$[$0], 'type_directive'); break; case 44: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); break; case 45: yy.parseDirective('}%%', 'close_directive', 'state'); break; } }, table: [{3:1,4:$V0,5:$V1,6:4,7:$V2,35:6,49:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,35:6,49:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,35:6,49:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,35:6,49:$V3},o([1,4,5,14,15,17,20,22,23,24,25,26,27,31,33,40,41,42,43,46,49],$V4,{8:11}),{36:12,50:[1,13]},{50:[2,42]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:$Vh,33:$Vi,35:6,40:$Vj,41:$Vk,42:$Vl,43:$Vm,46:$Vn,49:$V3},{37:38,38:[1,39],52:$Vo},o([38,52],[2,43]),o($Vp,[2,6]),{6:28,10:41,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:$Vh,33:$Vi,35:6,40:$Vj,41:$Vk,42:$Vl,43:$Vm,46:$Vn,49:$V3},o($Vp,[2,8]),o($Vp,[2,9]),o($Vp,[2,10],{12:[1,42],13:[1,43]}),o($Vp,[2,14]),{16:[1,44]},o($Vp,[2,16],{18:[1,45]}),{21:[1,46]},o($Vp,[2,20]),o($Vp,[2,21]),o($Vp,[2,22]),o($Vp,[2,23]),{28:47,29:[1,48],47:[1,49],48:[1,50]},o($Vp,[2,26]),o($Vp,[2,27]),{32:[1,51]},{34:[1,52]},o($Vq,[2,38]),o($Vq,[2,39]),o($Vp,[2,32]),o($Vp,[2,33]),o($Vp,[2,34]),o($Vp,[2,35]),o($Vr,[2,30]),{39:53,51:[1,54]},o($Vr,[2,45]),o($Vp,[2,7]),o($Vp,[2,11]),{11:55,22:$Vb,46:$Vn},o($Vp,[2,15]),o($Vs,$V4,{8:56}),{22:[1,57]},{22:[1,58]},{21:[1,59]},{22:[2,40]},{22:[2,41]},o($Vp,[2,28]),o($Vp,[2,29]),{37:60,52:$Vo},{52:[2,44]},o($Vp,[2,12],{12:[1,61]}),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,62],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:$Vh,33:$Vi,35:6,40:$Vj,41:$Vk,42:$Vl,43:$Vm,46:$Vn,49:$V3},o($Vp,[2,18],{18:[1,63]}),{29:[1,64]},{22:[1,65]},o($Vr,[2,31]),o($Vp,[2,13]),o($Vp,[2,17]),o($Vs,$V4,{8:66}),o($Vp,[2,24]),o($Vp,[2,25]),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,67],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:$Vh,33:$Vi,35:6,40:$Vj,41:$Vk,42:$Vl,43:$Vm,46:$Vn,49:$V3},o($Vp,[2,19])], defaultActions: {7:[2,42],8:[2,1],9:[2,2],10:[2,3],49:[2,40],50:[2,41],54:[2,44]}, parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse(input) { var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer; sharedState.yy.parser = this; if (typeof lexer.yylloc == 'undefined') { lexer.yylloc = {}; } var yyloc = lexer.yylloc; lstack.push(yyloc); var ranges = lexer.options && lexer.options.ranges; if (typeof sharedState.yy.parseError === 'function') { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function popStack(n) { stack.length = stack.length - 2 * n; vstack.length = vstack.length - n; lstack.length = lstack.length - n; } function lex() { var token; token = tstack.pop() || lexer.lex() || EOF; if (typeof token !== 'number') { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self.symbols_[token] || token; } return token; } var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == 'undefined') { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === 'undefined' || !action.length || !action[0]) { var errStr = ''; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push('\'' + this.terminals_[p] + '\''); } } if (lexer.showPosition) { errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; } else { errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); } this.parseError(errStr, { text: lexer.match, token: this.terminals_[symbol] || symbol, line: lexer.yylineno, loc: yyloc, expected: expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer.yytext); lstack.push(lexer.yylloc); stack.push(action[1]); symbol = null; if (!preErrorSymbol) { yyleng = lexer.yyleng; yytext = lexer.yytext; yylineno = lexer.yylineno; yyloc = lexer.yylloc; if (recovering > 0) { recovering--; } } else { symbol = preErrorSymbol; preErrorSymbol = null; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== 'undefined') { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; }}; /* generated by jison-lex 0.3.4 */ var lexer = (function(){ var lexer = ({ EOF:1, parseError:function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, // resets the lexer, sets new input setInput:function (input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; 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 }; if (this.options.ranges) { this.yylloc.range = [0,0]; } this.offset = 0; return this; }, // consumes and returns one char from the input input:function () { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, // unshifts one char (or a string) into the input unput:function (ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); //this.yyleng -= len; this.offset -= len; var oldLines = 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); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, // When called from action, caches matched text and appends it on next action more:function () { this._more = true; return this; }, // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject:function () { if (this.options.backtrack_lexer) { this._backtrack = true; } 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).\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, // retain first n characters of the match less:function (n) { this.unput(this.match.slice(n)); }, // displays already matched input, i.e. for error messages pastInput:function () { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); }, // displays upcoming input, i.e. for error messages upcomingInput:function () { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20-next.length); } return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); }, // displays the character position where the lexing error occurred, i.e. for error messages showPosition:function () { var pre = this.pastInput(); var c = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c + "^"; }, // test the lexed token: return FALSE when not a match, otherwise return token test_match:function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { // save context backup = { 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 }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { // recover context for (var k in backup) { this[k] = backup[k]; } return false; // rule action called reject() implying the next rule should be tested instead. } return false; }, // return next match in input next:function () { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ''; this.match = ''; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; // rule action called reject() implying a rule MISmatch. } else { // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } if (this._input === "") { return this.EOF; } else { return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, // return next match that has a token lex:function lex () { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin:function begin (condition) { this.conditionStack.push(condition); }, // pop the previously active lexer condition state off the condition stack popState:function popState () { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, // produce the lexer rule set which is active for the currently active lexer condition state _currentRules:function _currentRules () { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState:function topState (n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, // alias for begin(condition) pushState:function pushState (condition) { this.begin(condition); }, // return the number of states currently on the stack stateStackSize:function stateStackSize() { return this.conditionStack.length; }, options: {"case-insensitive":true}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { var YYSTATE=YY_START; switch($avoiding_name_collisions) { case 0:return 40; break; case 1:return 41; break; case 2:return 42; break; case 3:return 43; break; case 4: this.begin('open_directive'); return 49; break; case 5: this.begin('type_directive'); return 50; break; case 6: this.popState(); this.begin('arg_directive'); return 38; break; case 7: this.popState(); this.popState(); return 52; break; case 8:return 51; break; case 9:/* skip comments */ break; case 10:/* skip comments */{ /*console.log('Crap after close');*/ } break; case 11:return 5; break; case 12:/* skip all whitespace */ break; case 13:/* skip same-line whitespace */ break; case 14:/* skip comments */ break; case 15:/* skip comments */ break; case 16: this.pushState('SCALE'); /* console.log('Got scale', yy_.yytext);*/ return 15; break; case 17:return 16; break; case 18:this.popState(); break; case 19: this.begin("title");return 31; break; case 20: this.popState(); return "title_value"; break; case 21: this.begin("accDescription");return 33; break; case 22: this.popState(); return "description_value"; break; case 23: /*console.log('Starting STATE zxzx'+yy.getDirection());*/this.pushState('STATE'); break; case 24:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim(); /*console.warn('Fork Fork: ',yy_.yytext);*/return 23; break; case 25:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24; break; case 26:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25; break; case 27:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Fork: ',yy_.yytext);*/return 23; break; case 28:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24; break; case 29:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25; break; case 30: return 40; break; case 31: return 41; break; case 32: return 42; break; case 33: return 43; break; case 34: /*console.log('Starting STATE_STRING zxzx');*/this.begin("STATE_STRING"); break; case 35:this.popState();this.pushState('STATE_ID');return "AS"; break; case 36:this.popState();/* console.log('STATE_ID', yy_.yytext);*/return "ID"; break; case 37:this.popState(); break; case 38: /*console.log('Long description:', yy_.yytext);*/return "STATE_DESCR"; break; case 39:/*console.log('COMPOSIT_STATE', yy_.yytext);*/return 17; break; case 40:this.popState(); break; case 41:this.popState();this.pushState('struct'); /*console.log('begin struct', yy_.yytext);*/return 18; break; case 42: /*console.log('Ending struct');*/ this.popState(); return 19; break; case 43:/* nothing */ break; case 44: this.begin('NOTE'); return 27; break; case 45: this.popState();this.pushState('NOTE_ID');return 47; break; case 46: this.popState();this.pushState('NOTE_ID');return 48; break; case 47: this.popState();this.pushState('FLOATING_NOTE'); break; case 48:this.popState();this.pushState('FLOATING_NOTE_ID');return "AS"; break; case 49:/**/ break; case 50: /*console.log('Floating note text: ', yy_.yytext);*/return "NOTE_TEXT"; break; case 51:this.popState();/*console.log('Floating note ID', yy_.yytext);*/return "ID"; break; case 52: this.popState();this.pushState('NOTE_TEXT');/*console.log('Got ID for note', yy_.yytext);*/return 22; break; case 53: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.substr(2).trim();return 29; break; case 54: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.slice(0,-8).trim();return 29; break; case 55: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7; break; case 56: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7; break; case 57: /*console.log('HIDE_EMPTY', yy_.yytext,'#');*/return 14; break; case 58: /*console.log('EDGE_STATE=',yy_.yytext);*/ return 46; break; case 59: /*console.log('=>ID=',yy_.yytext);*/ return 22; break; case 60: yy_.yytext = yy_.yytext.trim(); /*console.log('Descr = ', yy_.yytext);*/ return 12; break; case 61:return 13; break; case 62:return 26; break; case 63:return 5; break; case 64:return 'INVALID'; break; } }, rules: [/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescription\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i], conditions: {"LINE":{"rules":[13,14],"inclusive":false},"close_directive":{"rules":[13,14],"inclusive":false},"arg_directive":{"rules":[7,8,13,14],"inclusive":false},"type_directive":{"rules":[6,7,13,14],"inclusive":false},"open_directive":{"rules":[5,13,14],"inclusive":false},"struct":{"rules":[13,14,23,30,31,32,33,42,43,44,58,59,60,61,62],"inclusive":false},"FLOATING_NOTE_ID":{"rules":[51],"inclusive":false},"FLOATING_NOTE":{"rules":[48,49,50],"inclusive":false},"NOTE_TEXT":{"rules":[53,54],"inclusive":false},"NOTE_ID":{"rules":[52],"inclusive":false},"NOTE":{"rules":[45,46,47],"inclusive":false},"accDescription":{"rules":[22],"inclusive":false},"title":{"rules":[20],"inclusive":false},"SCALE":{"rules":[17,18],"inclusive":false},"ALIAS":{"rules":[],"inclusive":false},"STATE_ID":{"rules":[36],"inclusive":false},"STATE_STRING":{"rules":[37,38],"inclusive":false},"FORK_STATE":{"rules":[],"inclusive":false},"STATE":{"rules":[13,14,24,25,26,27,28,29,34,35,39,40,41],"inclusive":false},"ID":{"rules":[13,14],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,9,10,11,12,14,15,16,19,21,23,41,44,55,56,57,58,59,60,61,63,64],"inclusive":true}} }); return lexer; })(); parser.lexer = lexer; function Parser () { this.yy = {}; } Parser.prototype = parser;parser.Parser = Parser; return new Parser; })(); if (true) { exports.parser = parser; exports.Parser = parser.Parser; exports.parse = function () { return parser.parse.apply(parser, arguments); }; exports.main = function commonjsMain (args) { if (!args[1]) { console.log('Usage: '+args[0]+' FILE'); process.exit(1); } var source = (__webpack_require__(/*! fs */ "?a3b8").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); return exports.parser.parse(source); }; if ( true && __webpack_require__.c[__webpack_require__.s] === module) { exports.main(process.argv.slice(1)); } } /***/ }), /***/ "./src/diagrams/user-journey/parser/journey.jison": /*!********************************************************!*\ !*** ./src/diagrams/user-journey/parser/journey.jison ***! \********************************************************/ /***/ ((module, exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); /* parser generated by jison 0.4.18 */ /* Returns a Parser object of the following structure: Parser: { yy: {} } Parser.prototype: { yy: {}, trace: function(), symbols_: {associative list: name ==> number}, terminals_: {associative list: number ==> name}, productions_: [...], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), table: [...], defaultActions: {...}, parseError: function(str, hash), parse: function(input), lexer: { EOF: 1, parseError: function(str, hash), setInput: function(input), input: function(), unput: function(str), more: function(), less: function(n), pastInput: function(), upcomingInput: function(), showPosition: function(), test_match: function(regex_match_array, rule_index), next: function(), lex: function(), begin: function(condition), popState: function(), _currentRules: function(), topState: function(), pushState: function(condition), options: { ranges: boolean (optional: true ==> token location info will include a .range[] member) flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) }, performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), rules: [...], conditions: {associative list: name ==> set}, } } token location info (@$, _$, etc.): { first_line: n, last_line: n, first_column: n, last_column: n, range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) } the parseError function receives a 'hash' object with these members for lexer and parser errors: { text: (matched text) token: (the produced terminal token, if any) line: (yylineno) } while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { loc: (yylloc) expected: (string describing the set of expected tokens) recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) } */ var parser = (function(){ var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,5],$V2=[6,9,11,17,18,19,20,22],$V3=[1,15],$V4=[1,16],$V5=[1,17],$V6=[1,18],$V7=[1,22],$V8=[4,6,9,11,17,18,19,20,22]; var parser = {trace: function trace () { }, yy: {}, symbols_: {"error":2,"start":3,"journey":4,"document":5,"EOF":6,"directive":7,"line":8,"SPACE":9,"statement":10,"NEWLINE":11,"openDirective":12,"typeDirective":13,"closeDirective":14,":":15,"argDirective":16,"title":17,"accDescription":18,"section":19,"taskName":20,"taskData":21,"open_directive":22,"type_directive":23,"arg_directive":24,"close_directive":25,"$accept":0,"$end":1}, terminals_: {2:"error",4:"journey",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",17:"title",18:"accDescription",19:"section",20:"taskName",21:"taskData",22:"open_directive",23:"type_directive",24:"arg_directive",25:"close_directive"}, productions_: [0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,1],[10,1],[10,2],[10,1],[12,1],[13,1],[16,1],[14,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { case 1: return $$[$0-1]; break; case 3: this.$ = [] break; case 4: $$[$0-1].push($$[$0]);this.$ = $$[$0-1] break; case 5: case 6: this.$ = $$[$0] break; case 7: case 8: this.$=[]; break; case 11: yy.setTitle($$[$0].substr(6));this.$=$$[$0].substr(6); break; case 12: yy.setAccDescription($$[$0].substring(15));this.$=$$[$0].substring(15); break; case 13: yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8); break; case 14: yy.addTask($$[$0-1], $$[$0]);this.$='task'; break; case 16: yy.parseDirective('%%{', 'open_directive'); break; case 17: yy.parseDirective($$[$0], 'type_directive'); break; case 18: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); break; case 19: yy.parseDirective('}%%', 'close_directive', 'journey'); break; } }, table: [{3:1,4:$V0,7:3,12:4,22:$V1},{1:[3]},o($V2,[2,3],{5:6}),{3:7,4:$V0,7:3,12:4,22:$V1},{13:8,23:[1,9]},{23:[2,16]},{6:[1,10],7:19,8:11,9:[1,12],10:13,11:[1,14],12:4,17:$V3,18:$V4,19:$V5,20:$V6,22:$V1},{1:[2,2]},{14:20,15:[1,21],25:$V7},o([15,25],[2,17]),o($V2,[2,8],{1:[2,1]}),o($V2,[2,4]),{7:19,10:23,12:4,17:$V3,18:$V4,19:$V5,20:$V6,22:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,11]),o($V2,[2,12]),o($V2,[2,13]),{21:[1,24]},o($V2,[2,15]),{11:[1,25]},{16:26,24:[1,27]},{11:[2,19]},o($V2,[2,5]),o($V2,[2,14]),o($V8,[2,9]),{14:28,25:$V7},{25:[2,18]},{11:[1,29]},o($V8,[2,10])], defaultActions: {5:[2,16],7:[2,2],22:[2,19],27:[2,18]}, parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse(input) { var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer; sharedState.yy.parser = this; if (typeof lexer.yylloc == 'undefined') { lexer.yylloc = {}; } var yyloc = lexer.yylloc; lstack.push(yyloc); var ranges = lexer.options && lexer.options.ranges; if (typeof sharedState.yy.parseError === 'function') { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function popStack(n) { stack.length = stack.length - 2 * n; vstack.length = vstack.length - n; lstack.length = lstack.length - n; } function lex() { var token; token = tstack.pop() || lexer.lex() || EOF; if (typeof token !== 'number') { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self.symbols_[token] || token; } return token; } var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == 'undefined') { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === 'undefined' || !action.length || !action[0]) { var errStr = ''; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push('\'' + this.terminals_[p] + '\''); } } if (lexer.showPosition) { errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; } else { errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); } this.parseError(errStr, { text: lexer.match, token: this.terminals_[symbol] || symbol, line: lexer.yylineno, loc: yyloc, expected: expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer.yytext); lstack.push(lexer.yylloc); stack.push(action[1]); symbol = null; if (!preErrorSymbol) { yyleng = lexer.yyleng; yytext = lexer.yytext; yylineno = lexer.yylineno; yyloc = lexer.yylloc; if (recovering > 0) { recovering--; } } else { symbol = preErrorSymbol; preErrorSymbol = null; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== 'undefined') { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; }}; /* generated by jison-lex 0.3.4 */ var lexer = (function(){ var lexer = ({ EOF:1, parseError:function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, // resets the lexer, sets new input setInput:function (input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; 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 }; if (this.options.ranges) { this.yylloc.range = [0,0]; } this.offset = 0; return this; }, // consumes and returns one char from the input input:function () { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, // unshifts one char (or a string) into the input unput:function (ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); //this.yyleng -= len; this.offset -= len; var oldLines = 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); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, // When called from action, caches matched text and appends it on next action more:function () { this._more = true; return this; }, // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject:function () { if (this.options.backtrack_lexer) { this._backtrack = true; } 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).\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, // retain first n characters of the match less:function (n) { this.unput(this.match.slice(n)); }, // displays already matched input, i.e. for error messages pastInput:function () { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); }, // displays upcoming input, i.e. for error messages upcomingInput:function () { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20-next.length); } return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); }, // displays the character position where the lexing error occurred, i.e. for error messages showPosition:function () { var pre = this.pastInput(); var c = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c + "^"; }, // test the lexed token: return FALSE when not a match, otherwise return token test_match:function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { // save context backup = { 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 }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { // recover context for (var k in backup) { this[k] = backup[k]; } return false; // rule action called reject() implying the next rule should be tested instead. } return false; }, // return next match in input next:function () { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ''; this.match = ''; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; // rule action called reject() implying a rule MISmatch. } else { // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } if (this._input === "") { return this.EOF; } else { return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, // return next match that has a token lex:function lex () { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin:function begin (condition) { this.conditionStack.push(condition); }, // pop the previously active lexer condition state off the condition stack popState:function popState () { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, // produce the lexer rule set which is active for the currently active lexer condition state _currentRules:function _currentRules () { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState:function topState (n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, // alias for begin(condition) pushState:function pushState (condition) { this.begin(condition); }, // return the number of states currently on the stack stateStackSize:function stateStackSize() { return this.conditionStack.length; }, options: {"case-insensitive":true}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { var YYSTATE=YY_START; switch($avoiding_name_collisions) { case 0: this.begin('open_directive'); return 22; break; case 1: this.begin('type_directive'); return 23; break; case 2: this.popState(); this.begin('arg_directive'); return 15; break; case 3: this.popState(); this.popState(); return 25; break; case 4:return 24; break; case 5:/* skip comments */ break; case 6:/* skip comments */ break; case 7:return 11; break; case 8:/* skip whitespace */ break; case 9:/* skip comments */ break; case 10:return 4; break; case 11:return 17; break; case 12:return 18; break; case 13:return 19; break; case 14:return 20; break; case 15:return 21; break; case 16:return 15; break; case 17:return 6; break; case 18:return 'INVALID'; break; } }, rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i], conditions: {"open_directive":{"rules":[1],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,11,12,13,14,15,16,17,18],"inclusive":true}} }); return lexer; })(); parser.lexer = lexer; function Parser () { this.yy = {}; } Parser.prototype = parser;parser.Parser = Parser; return new Parser; })(); if (true) { exports.parser = parser; exports.Parser = parser.Parser; exports.parse = function () { return parser.parse.apply(parser, arguments); }; exports.main = function commonjsMain (args) { if (!args[1]) { console.log('Usage: '+args[0]+' FILE'); process.exit(1); } var source = (__webpack_require__(/*! fs */ "?0f62").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); return exports.parser.parse(source); }; if ( true && __webpack_require__.c[__webpack_require__.s] === module) { exports.main(process.argv.slice(1)); } } /***/ }), /***/ "./src/accessibility.js": /*!******************************!*\ !*** ./src/accessibility.js ***! \******************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ addSVGAccessibilityFields) /* harmony export */ }); /** * This method will add a basic title and description element to a chart. The yy parser will need to * respond to getTitle and getAccDescription, where the title is the title element on the chart, * which is generally not displayed and the accDescription is the description element on the chart, * which is never displayed. * * The following charts display their title as a visual and accessibility element: gantt * * @param yy_parser * @param svg * @param id */ function addSVGAccessibilityFields(yy_parser, svg, id) { if (typeof svg.insert === 'undefined') { return; } var title_string = yy_parser.getTitle(); var description = yy_parser.getAccDescription(); svg.attr('role', 'img').attr('aria-labelledby', 'chart-title-' + id + ' chart-desc-' + id); svg.insert('desc', ':first-child').attr('id', 'chart-desc-' + id).text(description); svg.insert('title', ':first-child').attr('id', 'chart-title-' + id).text(title_string); } /***/ }), /***/ "./src/config.js": /*!***********************!*\ !*** ./src/config.js ***! \***********************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "addDirective": () => (/* binding */ addDirective), /* harmony export */ "defaultConfig": () => (/* binding */ defaultConfig), /* harmony export */ "getConfig": () => (/* binding */ getConfig), /* harmony export */ "getSiteConfig": () => (/* binding */ getSiteConfig), /* harmony export */ "reset": () => (/* binding */ reset), /* harmony export */ "sanitize": () => (/* binding */ sanitize), /* harmony export */ "saveConfigFromInitilize": () => (/* binding */ saveConfigFromInitilize), /* harmony export */ "setConfig": () => (/* binding */ setConfig), /* harmony export */ "setSiteConfig": () => (/* binding */ setSiteConfig), /* harmony export */ "updateCurrentConfig": () => (/* binding */ updateCurrentConfig), /* harmony export */ "updateSiteConfig": () => (/* binding */ updateSiteConfig) /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./src/utils.js"); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./logger */ "./src/logger.js"); /* harmony import */ var _themes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./themes */ "./src/themes/index.js"); /* harmony import */ var _defaultConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultConfig */ "./src/defaultConfig.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } var defaultConfig = Object.freeze(_defaultConfig__WEBPACK_IMPORTED_MODULE_0__["default"]); var siteConfig = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, defaultConfig); var configFromInitialize; var directives = []; var currentConfig = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, defaultConfig); var updateCurrentConfig = function updateCurrentConfig(siteCfg, _directives) { // start with config beeing the siteConfig var cfg = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, siteCfg); // let sCfg = assignWithDepth(defaultConfig, siteConfigDelta); // Join directives var sumOfDirectives = {}; for (var i = 0; i < _directives.length; i++) { var d = _directives[i]; sanitize(d); // Apply the data from the directive where the the overrides the themeVaraibles sumOfDirectives = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(sumOfDirectives, d); } cfg = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(cfg, sumOfDirectives); if (sumOfDirectives.theme && _themes__WEBPACK_IMPORTED_MODULE_2__["default"][sumOfDirectives.theme]) { var tmpConfigFromInitialize = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, configFromInitialize); var themeVariables = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(tmpConfigFromInitialize.themeVariables || {}, sumOfDirectives.themeVariables); cfg.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_2__["default"][cfg.theme].getThemeVariables(themeVariables); } currentConfig = cfg; return cfg; }; /** * ## setSiteConfig * * | Function | Description | Type | Values | * | ------------- | ------------------------------------- | ----------- | --------------------------------------- | * | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array | * * **Notes:** Sets the siteConfig. The siteConfig is a protected configuration for repeat use. Calls * to reset() will reset the currentConfig to siteConfig. Calls to reset(configApi.defaultConfig) * will reset siteConfig and currentConfig to the defaultConfig Note: currentConfig is set in this * function _Default value: At default, will mirror Global Config_ * * @param conf - The base currentConfig to use as siteConfig * @returns {object} - The siteConfig */ var setSiteConfig = function setSiteConfig(conf) { siteConfig = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, defaultConfig); siteConfig = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(siteConfig, conf); if (conf.theme && _themes__WEBPACK_IMPORTED_MODULE_2__["default"][conf.theme]) { siteConfig.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_2__["default"][conf.theme].getThemeVariables(conf.themeVariables); } currentConfig = updateCurrentConfig(siteConfig, directives); return siteConfig; }; var saveConfigFromInitilize = function saveConfigFromInitilize(conf) { configFromInitialize = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, conf); }; var updateSiteConfig = function updateSiteConfig(conf) { siteConfig = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(siteConfig, conf); updateCurrentConfig(siteConfig, directives); return siteConfig; }; /** * ## getSiteConfig * * | Function | Description | Type | Values | * | ------------- | ------------------------------------------------- | ----------- | -------------------------------- | * | setSiteConfig | Returns the current siteConfig base configuration | Get Request | Returns Any Values in siteConfig | * * **Notes**: Returns **any** values in siteConfig. * * @returns {object} - The siteConfig */ var getSiteConfig = function getSiteConfig() { return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, siteConfig); }; /** * ## setConfig * * | Function | Description | Type | Values | * | ------------- | ------------------------------------- | ----------- | --------------------------------------- | * | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array | * * **Notes**: Sets the currentConfig. The parameter conf is sanitized based on the siteConfig.secure * keys. Any values found in conf with key found in siteConfig.secure will be replaced with the * corresponding siteConfig value. * * @param {any} conf - The potential currentConfig * @returns {any} - The currentConfig merged with the sanitized conf */ var setConfig = function setConfig(conf) { // sanitize(conf); // Object.keys(conf).forEach(key => { // const manipulator = manipulators[key]; // conf[key] = manipulator ? manipulator(conf[key]) : conf[key]; // }); (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(currentConfig, conf); return getConfig(); }; /** * ## getConfig * * | Function | Description | Type | Return Values | * | --------- | ------------------------- | ----------- | ------------------------------ | * | getConfig | Obtains the currentConfig | Get Request | Any Values from current Config | * * **Notes**: Returns **any** the currentConfig * * @returns {any} - The currentConfig */ var getConfig = function getConfig() { return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, currentConfig); }; /** * ## sanitize * * | Function | Description | Type | Values | * | -------- | -------------------------------------- | ----------- | ------ | * | sanitize | Sets the siteConfig to desired values. | Put Request | None | * * Ensures options parameter does not attempt to override siteConfig secure keys **Notes**: modifies * options in-place * * @param {any} options - The potential setConfig parameter */ var sanitize = function sanitize(options) { // Checking that options are not in the list of excluded options Object.keys(siteConfig.secure).forEach(function (key) { if (typeof options[siteConfig.secure[key]] !== 'undefined') { // DO NOT attempt to print options[siteConfig.secure[key]] within `${}` as a malicious script // can exploit the logger's attempt to stringify the value and execute arbitrary code _logger__WEBPACK_IMPORTED_MODULE_3__.log.debug("Denied attempt to modify a secure key ".concat(siteConfig.secure[key]), options[siteConfig.secure[key]]); delete options[siteConfig.secure[key]]; } }); // Check that there no attempts of prototype pollution Object.keys(options).forEach(function (key) { if (key.indexOf('__') === 0) { delete options[key]; } }); // Check that there no attempts of xss, there should be no tags at all in the directive // blocking data urls as base64 urls can contain svgs with inline script tags Object.keys(options).forEach(function (key) { if (typeof options[key] === 'string') { if (options[key].indexOf('<') > -1 || options[key].indexOf('>') > -1 || options[key].indexOf('url(data:') > -1) { delete options[key]; } } if (_typeof(options[key]) === 'object') { sanitize(options[key]); } }); }; /** * Pushes in a directive to the configuration * * @param {object} directive The directive to push in */ var addDirective = function addDirective(directive) { if (directive.fontFamily) { if (!directive.themeVariables) { directive.themeVariables = { fontFamily: directive.fontFamily }; } else { if (!directive.themeVariables.fontFamily) { directive.themeVariables = { fontFamily: directive.fontFamily }; } } } directives.push(directive); updateCurrentConfig(siteConfig, directives); }; /** * ## reset * * | Function | Description | Type | Required | Values | * | -------- | ---------------------------- | ----------- | -------- | ------ | * | reset | Resets currentConfig to conf | Put Request | Required | None | * * ## conf * * | Parameter | Description | Type | Required | Values | * | --------- | ------------------------------------------------------------- | ---------- | -------- | -------------------------------------------- | * | conf | base set of values, which currentConfig coul be **reset** to. | Dictionary | Required | Any Values, with respect to the secure Array | * * **Notes**: (default: current siteConfig ) (optional, default `getSiteConfig()`) */ var reset = function reset() { // Replace current config with siteConfig directives = []; updateCurrentConfig(siteConfig, directives); }; /***/ }), /***/ "./src/dagre-wrapper/clusters.js": /*!***************************************!*\ !*** ./src/dagre-wrapper/clusters.js ***! \***************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "clear": () => (/* binding */ clear), /* harmony export */ "getClusterTitleWidth": () => (/* binding */ getClusterTitleWidth), /* harmony export */ "insertCluster": () => (/* binding */ insertCluster), /* harmony export */ "positionCluster": () => (/* binding */ positionCluster) /* harmony export */ }); /* harmony import */ var _intersect_intersect_rect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./intersect/intersect-rect */ "./src/dagre-wrapper/intersect/intersect-rect.js"); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); /* harmony import */ var _createLabel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./createLabel */ "./src/dagre-wrapper/createLabel.js"); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../config */ "./src/config.js"); /* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js"); var rect = function rect(parent, node) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Creating subgraph rect for ', node.id, node); // Add outer g element var shapeSvg = parent.insert('g').attr('class', 'cluster' + (node.class ? ' ' + node.class : '')).attr('id', node.id); // add the rect var rect = shapeSvg.insert('rect', ':first-child'); // Create the label and insert it after the rect var label = shapeSvg.insert('g').attr('class', 'cluster-label'); var text = label.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_2__["default"])(node.labelText, node.labelStyle, undefined, true)); // Get the size of the label var bbox = text.getBBox(); if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_4__.getConfig)().flowchart.htmlLabels)) { var div = text.children[0]; var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text); bbox = div.getBoundingClientRect(); dv.attr('width', bbox.width); dv.attr('height', bbox.height); } var padding = 0 * node.padding; var halfPadding = padding / 2; var width = node.width <= bbox.width + padding ? bbox.width + padding : node.width; if (node.width <= bbox.width + padding) { node.diff = (bbox.width - node.width) / 2; } else { node.diff = -node.padding / 2; } _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Data ', node, JSON.stringify(node)); // center the rect around its coordinate rect.attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('x', node.x - width / 2).attr('y', node.y - node.height / 2 - halfPadding).attr('width', width).attr('height', node.height + padding); // Center the label label.attr('transform', 'translate(' + (node.x - bbox.width / 2) + ', ' + (node.y - node.height / 2 + node.padding / 3) + ')'); var rectBox = rect.node().getBBox(); node.width = rectBox.width; node.height = rectBox.height; node.intersect = function (point) { return (0,_intersect_intersect_rect__WEBPACK_IMPORTED_MODULE_5__["default"])(node, point); }; return shapeSvg; }; /** * Non visiable cluster where the note is group with its * * @param {any} parent * @param {any} node * @returns {any} ShapeSvg */ var noteGroup = function noteGroup(parent, node) { // Add outer g element var shapeSvg = parent.insert('g').attr('class', 'note-cluster').attr('id', node.id); // add the rect var rect = shapeSvg.insert('rect', ':first-child'); var padding = 0 * node.padding; var halfPadding = padding / 2; // center the rect around its coordinate rect.attr('rx', node.rx).attr('ry', node.ry).attr('x', node.x - node.width / 2 - halfPadding).attr('y', node.y - node.height / 2 - halfPadding).attr('width', node.width + padding).attr('height', node.height + padding).attr('fill', 'none'); var rectBox = rect.node().getBBox(); node.width = rectBox.width; node.height = rectBox.height; node.intersect = function (point) { return (0,_intersect_intersect_rect__WEBPACK_IMPORTED_MODULE_5__["default"])(node, point); }; return shapeSvg; }; var roundedWithTitle = function roundedWithTitle(parent, node) { // Add outer g element var shapeSvg = parent.insert('g').attr('class', node.classes).attr('id', node.id); // add the rect var rect = shapeSvg.insert('rect', ':first-child'); // Create the label and insert it after the rect var label = shapeSvg.insert('g').attr('class', 'cluster-label'); var innerRect = shapeSvg.append('rect'); var text = label.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_2__["default"])(node.labelText, node.labelStyle, undefined, true)); // Get the size of the label var bbox = text.getBBox(); if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_4__.getConfig)().flowchart.htmlLabels)) { var div = text.children[0]; var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text); bbox = div.getBoundingClientRect(); dv.attr('width', bbox.width); dv.attr('height', bbox.height); } bbox = text.getBBox(); var padding = 0 * node.padding; var halfPadding = padding / 2; var width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width; if (node.width <= bbox.width + node.padding) { node.diff = (bbox.width + node.padding * 0 - node.width) / 2; } else { node.diff = -node.padding / 2; } // center the rect around its coordinate rect.attr('class', 'outer').attr('x', node.x - width / 2 - halfPadding).attr('y', node.y - node.height / 2 - halfPadding).attr('width', width + padding).attr('height', node.height + padding); innerRect.attr('class', 'inner').attr('x', node.x - width / 2 - halfPadding).attr('y', node.y - node.height / 2 - halfPadding + bbox.height - 1).attr('width', width + padding).attr('height', node.height + padding - bbox.height - 3); // Center the label label.attr('transform', 'translate(' + (node.x - bbox.width / 2) + ', ' + (node.y - node.height / 2 - node.padding / 3 + ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_4__.getConfig)().flowchart.htmlLabels) ? 5 : 3)) + ')'); var rectBox = rect.node().getBBox(); node.height = rectBox.height; node.intersect = function (point) { return (0,_intersect_intersect_rect__WEBPACK_IMPORTED_MODULE_5__["default"])(node, point); }; return shapeSvg; }; var divider = function divider(parent, node) { // Add outer g element var shapeSvg = parent.insert('g').attr('class', node.classes).attr('id', node.id); // add the rect var rect = shapeSvg.insert('rect', ':first-child'); var padding = 0 * node.padding; var halfPadding = padding / 2; // center the rect around its coordinate rect.attr('class', 'divider').attr('x', node.x - node.width / 2 - halfPadding).attr('y', node.y - node.height / 2).attr('width', node.width + padding).attr('height', node.height + padding); var rectBox = rect.node().getBBox(); node.width = rectBox.width; node.height = rectBox.height; node.diff = -node.padding / 2; node.intersect = function (point) { return (0,_intersect_intersect_rect__WEBPACK_IMPORTED_MODULE_5__["default"])(node, point); }; return shapeSvg; }; var shapes = { rect: rect, roundedWithTitle: roundedWithTitle, noteGroup: noteGroup, divider: divider }; var clusterElems = {}; var insertCluster = function insertCluster(elem, node) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Inserting cluster'); var shape = node.shape || 'rect'; clusterElems[node.id] = shapes[shape](elem, node); }; var getClusterTitleWidth = function getClusterTitleWidth(elem, node) { var label = (0,_createLabel__WEBPACK_IMPORTED_MODULE_2__["default"])(node.labelText, node.labelStyle, undefined, true); elem.node().appendChild(label); var width = label.getBBox().width; elem.node().removeChild(label); return width; }; var clear = function clear() { clusterElems = {}; }; var positionCluster = function positionCluster(node) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Position cluster (' + node.id + ', ' + node.x + ', ' + node.y + ')'); var el = clusterElems[node.id]; el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')'); }; /***/ }), /***/ "./src/dagre-wrapper/createLabel.js": /*!******************************************!*\ !*** ./src/dagre-wrapper/createLabel.js ***! \******************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config */ "./src/config.js"); /* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } // eslint-disable-line var sanitizeTxt = function sanitizeTxt(txt) { return (0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.sanitizeText)(txt, (0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)()); }; /** * @param dom * @param styleFn */ function applyStyle(dom, styleFn) { if (styleFn) { dom.attr('style', styleFn); } } /** * @param {any} node * @returns {SVGForeignObjectElement} Node */ function addHtmlLabel(node) { var fo = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject')); var div = fo.append('xhtml:div'); var label = node.label; var labelClass = node.isNode ? 'nodeLabel' : 'edgeLabel'; div.html('' + label + ''); applyStyle(div, node.labelStyle); div.style('display', 'inline-block'); // Fix for firefox div.style('white-space', 'nowrap'); div.attr('xmlns', 'http://www.w3.org/1999/xhtml'); return fo.node(); } var createLabel = function createLabel(_vertexText, style, isTitle, isNode) { var vertexText = _vertexText || ''; if (_typeof(vertexText) === 'object') vertexText = vertexText[0]; if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that? vertexText = vertexText.replace(/\\n|\n/g, '
'); _logger__WEBPACK_IMPORTED_MODULE_3__.log.info('vertexText' + vertexText); var node = { isNode: isNode, label: vertexText.replace(/fa[lrsb]?:fa-[\w-]+/g, function (s) { return ""); }), labelStyle: style.replace('fill:', 'color:') }; var vertexNode = addHtmlLabel(node); // vertexNode.parentNode.removeChild(vertexNode); return vertexNode; } else { var svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text'); svgLabel.setAttribute('style', style.replace('color:', 'fill:')); var rows = []; if (typeof vertexText === 'string') { rows = vertexText.split(/\\n|\n|/gi); } else if (Array.isArray(vertexText)) { rows = vertexText; } else { rows = []; } for (var j = 0; j < rows.length; j++) { var tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve'); tspan.setAttribute('dy', '1em'); tspan.setAttribute('x', '0'); if (isTitle) { tspan.setAttribute('class', 'title-row'); } else { tspan.setAttribute('class', 'row'); } tspan.textContent = rows[j].trim(); svgLabel.appendChild(tspan); } return svgLabel; } }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (createLabel); /***/ }), /***/ "./src/dagre-wrapper/edges.js": /*!************************************!*\ !*** ./src/dagre-wrapper/edges.js ***! \************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "clear": () => (/* binding */ clear), /* harmony export */ "insertEdge": () => (/* binding */ insertEdge), /* harmony export */ "insertEdgeLabel": () => (/* binding */ insertEdgeLabel), /* harmony export */ "intersection": () => (/* binding */ intersection), /* harmony export */ "positionEdgeLabel": () => (/* binding */ positionEdgeLabel) /* harmony export */ }); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); /* harmony import */ var _createLabel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./createLabel */ "./src/dagre-wrapper/createLabel.js"); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config */ "./src/config.js"); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils */ "./src/utils.js"); /* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js"); // eslint-disable-line var edgeLabels = {}; var terminalLabels = {}; var clear = function clear() { edgeLabels = {}; terminalLabels = {}; }; var insertEdgeLabel = function insertEdgeLabel(elem, edge) { // Create the actual text element var labelElement = (0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])(edge.label, edge.labelStyle); // Create outer g, edgeLabel, this will be positioned after graph layout var edgeLabel = elem.insert('g').attr('class', 'edgeLabel'); // Create inner g, label, this will be positioned now for centering the text var label = edgeLabel.insert('g').attr('class', 'label'); label.node().appendChild(labelElement); // Center the label var bbox = labelElement.getBBox(); if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_3__.getConfig)().flowchart.htmlLabels)) { var div = labelElement.children[0]; var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(labelElement); bbox = div.getBoundingClientRect(); dv.attr('width', bbox.width); dv.attr('height', bbox.height); } label.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + -bbox.height / 2 + ')'); // Make element accessible by id for positioning edgeLabels[edge.id] = edgeLabel; // Update the abstract data of the edge with the new information about its width and height edge.width = bbox.width; edge.height = bbox.height; var fo; if (edge.startLabelLeft) { // Create the actual text element var startLabelElement = (0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])(edge.startLabelLeft, edge.labelStyle); var startEdgeLabelLeft = elem.insert('g').attr('class', 'edgeTerminals'); var inner = startEdgeLabelLeft.insert('g').attr('class', 'inner'); fo = inner.node().appendChild(startLabelElement); var slBox = startLabelElement.getBBox(); inner.attr('transform', 'translate(' + -slBox.width / 2 + ', ' + -slBox.height / 2 + ')'); if (!terminalLabels[edge.id]) { terminalLabels[edge.id] = {}; } terminalLabels[edge.id].startLeft = startEdgeLabelLeft; setTerminalWidth(fo, edge.startLabelLeft); } if (edge.startLabelRight) { // Create the actual text element var _startLabelElement = (0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])(edge.startLabelRight, edge.labelStyle); var startEdgeLabelRight = elem.insert('g').attr('class', 'edgeTerminals'); var _inner = startEdgeLabelRight.insert('g').attr('class', 'inner'); fo = startEdgeLabelRight.node().appendChild(_startLabelElement); _inner.node().appendChild(_startLabelElement); var _slBox = _startLabelElement.getBBox(); _inner.attr('transform', 'translate(' + -_slBox.width / 2 + ', ' + -_slBox.height / 2 + ')'); if (!terminalLabels[edge.id]) { terminalLabels[edge.id] = {}; } terminalLabels[edge.id].startRight = startEdgeLabelRight; setTerminalWidth(fo, edge.startLabelRight); } if (edge.endLabelLeft) { // Create the actual text element var endLabelElement = (0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])(edge.endLabelLeft, edge.labelStyle); var endEdgeLabelLeft = elem.insert('g').attr('class', 'edgeTerminals'); var _inner2 = endEdgeLabelLeft.insert('g').attr('class', 'inner'); fo = _inner2.node().appendChild(endLabelElement); var _slBox2 = endLabelElement.getBBox(); _inner2.attr('transform', 'translate(' + -_slBox2.width / 2 + ', ' + -_slBox2.height / 2 + ')'); endEdgeLabelLeft.node().appendChild(endLabelElement); if (!terminalLabels[edge.id]) { terminalLabels[edge.id] = {}; } terminalLabels[edge.id].endLeft = endEdgeLabelLeft; setTerminalWidth(fo, edge.endLabelLeft); } if (edge.endLabelRight) { // Create the actual text element var _endLabelElement = (0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])(edge.endLabelRight, edge.labelStyle); var endEdgeLabelRight = elem.insert('g').attr('class', 'edgeTerminals'); var _inner3 = endEdgeLabelRight.insert('g').attr('class', 'inner'); fo = _inner3.node().appendChild(_endLabelElement); var _slBox3 = _endLabelElement.getBBox(); _inner3.attr('transform', 'translate(' + -_slBox3.width / 2 + ', ' + -_slBox3.height / 2 + ')'); endEdgeLabelRight.node().appendChild(_endLabelElement); if (!terminalLabels[edge.id]) { terminalLabels[edge.id] = {}; } terminalLabels[edge.id].endRight = endEdgeLabelRight; setTerminalWidth(fo, edge.endLabelRight); } }; /** * @param {any} fo * @param {any} value */ function setTerminalWidth(fo, value) { if ((0,_config__WEBPACK_IMPORTED_MODULE_3__.getConfig)().flowchart.htmlLabels && fo) { fo.style.width = value.length * 9 + 'px'; fo.style.height = '12px'; } } var positionEdgeLabel = function positionEdgeLabel(edge, paths) { _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Moving label abc78 ', edge.id, edge.label, edgeLabels[edge.id]); var path = paths.updatedPath ? paths.updatedPath : paths.originalPath; if (edge.label) { var el = edgeLabels[edge.id]; var x = edge.x; var y = edge.y; if (path) { // // debugger; var pos = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcLabelPosition(path); _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Moving label from (', x, ',', y, ') to (', pos.x, ',', pos.y, ') abc78'); // x = pos.x; // y = pos.y; } el.attr('transform', 'translate(' + x + ', ' + y + ')'); } //let path = paths.updatedPath ? paths.updatedPath : paths.originalPath; if (edge.startLabelLeft) { var _el = terminalLabels[edge.id].startLeft; var _x2 = edge.x; var _y2 = edge.y; if (path) { // debugger; var _pos = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, 'start_left', path); _x2 = _pos.x; _y2 = _pos.y; } _el.attr('transform', 'translate(' + _x2 + ', ' + _y2 + ')'); } if (edge.startLabelRight) { var _el2 = terminalLabels[edge.id].startRight; var _x3 = edge.x; var _y3 = edge.y; if (path) { // debugger; var _pos2 = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, 'start_right', path); _x3 = _pos2.x; _y3 = _pos2.y; } _el2.attr('transform', 'translate(' + _x3 + ', ' + _y3 + ')'); } if (edge.endLabelLeft) { var _el3 = terminalLabels[edge.id].endLeft; var _x4 = edge.x; var _y4 = edge.y; if (path) { // debugger; var _pos3 = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, 'end_left', path); _x4 = _pos3.x; _y4 = _pos3.y; } _el3.attr('transform', 'translate(' + _x4 + ', ' + _y4 + ')'); } if (edge.endLabelRight) { var _el4 = terminalLabels[edge.id].endRight; var _x5 = edge.x; var _y5 = edge.y; if (path) { // debugger; var _pos4 = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, 'end_right', path); _x5 = _pos4.x; _y5 = _pos4.y; } _el4.attr('transform', 'translate(' + _x5 + ', ' + _y5 + ')'); } }; // const getRelationType = function(type) { // switch (type) { // case stateDb.relationType.AGGREGATION: // return 'aggregation'; // case stateDb.relationType.EXTENSION: // return 'extension'; // case stateDb.relationType.COMPOSITION: // return 'composition'; // case stateDb.relationType.DEPENDENCY: // return 'dependency'; // } // }; var outsideNode = function outsideNode(node, point) { // log.warn('Checking bounds ', node, point); var x = node.x; var y = node.y; var dx = Math.abs(point.x - x); var dy = Math.abs(point.y - y); var w = node.width / 2; var h = node.height / 2; if (dx >= w || dy >= h) { return true; } return false; }; var intersection = function intersection(node, outsidePoint, insidePoint) { _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn("intersection calc abc89:\n outsidePoint: ".concat(JSON.stringify(outsidePoint), "\n insidePoint : ").concat(JSON.stringify(insidePoint), "\n node : x:").concat(node.x, " y:").concat(node.y, " w:").concat(node.width, " h:").concat(node.height)); var x = node.x; var y = node.y; var dx = Math.abs(x - insidePoint.x); // const dy = Math.abs(y - insidePoint.y); var w = node.width / 2; var r = insidePoint.x < outsidePoint.x ? w - dx : w + dx; var h = node.height / 2; // const edges = { // x1: x - w, // x2: x + w, // y1: y - h, // y2: y + h // }; // if ( // outsidePoint.x === edges.x1 || // outsidePoint.x === edges.x2 || // outsidePoint.y === edges.y1 || // outsidePoint.y === edges.y2 // ) { // log.warn('abc89 calc equals on edge', outsidePoint, edges); // return outsidePoint; // } var Q = Math.abs(outsidePoint.y - insidePoint.y); var R = Math.abs(outsidePoint.x - insidePoint.x); // log.warn(); if (Math.abs(y - outsidePoint.y) * w > Math.abs(x - outsidePoint.x) * h) { // eslint-disable-line // Intersection is top or bottom of rect. // let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y; var q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y; r = R * q / Q; var res = { x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r, y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q }; if (r === 0) { res.x = outsidePoint.x; res.y = outsidePoint.y; } if (R === 0) { res.x = outsidePoint.x; } if (Q === 0) { res.y = outsidePoint.y; } _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn("abc89 topp/bott calc, Q ".concat(Q, ", q ").concat(q, ", R ").concat(R, ", r ").concat(r), res); return res; } else { // Intersection onn sides of rect if (insidePoint.x < outsidePoint.x) { r = outsidePoint.x - w - x; } else { // r = outsidePoint.x - w - x; r = x - w - outsidePoint.x; } var _q = Q * r / R; // OK let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x + dx - w; // OK let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : outsidePoint.x + r; var _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - R + r; // let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : outsidePoint.x + r; var _y = insidePoint.y < outsidePoint.y ? insidePoint.y + _q : insidePoint.y - _q; _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn("sides calc abc89, Q ".concat(Q, ", q ").concat(_q, ", R ").concat(R, ", r ").concat(r), { _x: _x, _y: _y }); if (r === 0) { _x = outsidePoint.x; _y = outsidePoint.y; } if (R === 0) { _x = outsidePoint.x; } if (Q === 0) { _y = outsidePoint.y; } return { x: _x, y: _y }; } }; /** * This function will page a path and node where the last point(s) in the path is inside the node * and return an update path ending by the border of the node. * * @param {Array} _points * @param {any} boundryNode * @returns {Array} Points */ var cutPathAtIntersect = function cutPathAtIntersect(_points, boundryNode) { _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 cutPathAtIntersect', _points, boundryNode); var points = []; var lastPointOutside = _points[0]; var isInside = false; _points.forEach(function (point) { // const node = clusterDb[edge.toCluster].node; _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('abc88 checking point', point, boundryNode); // check if point is inside the boundry rect if (!outsideNode(boundryNode, point) && !isInside) { // First point inside the rect found // Calc the intersection coord between the point anf the last opint ouside the rect var inter = intersection(boundryNode, lastPointOutside, point); _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 inside', point, lastPointOutside, inter); _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 intersection', inter); // // Check case where the intersection is the same as the last point var pointPresent = false; points.forEach(function (p) { pointPresent = pointPresent || p.x === inter.x && p.y === inter.y; }); // // if (!pointPresent) { if (!points.find(function (e) { return e.x === inter.x && e.y === inter.y; })) { points.push(inter); } else { _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 no intersect', inter, points); } // points.push(inter); isInside = true; } else { // Outside _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 outside', point, lastPointOutside); lastPointOutside = point; // points.push(point); if (!isInside) points.push(point); } }); _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 returning points', points); return points; }; //(edgePaths, e, edge, clusterDb, diagramtype, graph) var insertEdge = function insertEdge(elem, e, edge, clusterDb, diagramType, graph) { var points = edge.points; var pointsHasChanged = false; var tail = graph.node(e.v); var head = graph.node(e.w); _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('abc88 InsertEdge: ', edge); if (head.intersect && tail.intersect) { points = points.slice(1, edge.points.length - 1); points.unshift(tail.intersect(points[0])); _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Last point', points[points.length - 1], head, head.intersect(points[points.length - 1])); points.push(head.intersect(points[points.length - 1])); } if (edge.toCluster) { _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('to cluster abc88', clusterDb[edge.toCluster]); points = cutPathAtIntersect(edge.points, clusterDb[edge.toCluster].node); // log.trace('edge', edge); // points = []; // let lastPointOutside; // = edge.points[0]; // let isInside = false; // edge.points.forEach(point => { // const node = clusterDb[edge.toCluster].node; // log.warn('checking from', edge.fromCluster, point, node); // if (!outsideNode(node, point) && !isInside) { // log.trace('inside', edge.toCluster, point, lastPointOutside); // // First point inside the rect // const inter = intersection(node, lastPointOutside, point); // let pointPresent = false; // points.forEach(p => { // pointPresent = pointPresent || (p.x === inter.x && p.y === inter.y); // }); // // if (!pointPresent) { // if (!points.find(e => e.x === inter.x && e.y === inter.y)) { // points.push(inter); // } else { // log.warn('no intersect', inter, points); // } // isInside = true; // } else { // // outtside // lastPointOutside = point; // if (!isInside) points.push(point); // } // }); pointsHasChanged = true; } if (edge.fromCluster) { _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('from cluster abc88', clusterDb[edge.fromCluster]); points = cutPathAtIntersect(points.reverse(), clusterDb[edge.fromCluster].node).reverse(); // log.warn('edge', edge); // log.warn('from cluster', clusterDb[edge.fromCluster], points); // const updatedPoints = []; // let lastPointOutside = edge.points[edge.points.length - 1]; // let isInside = false; // for (let i = points.length - 1; i >= 0; i--) { // const point = points[i]; // const node = clusterDb[edge.fromCluster].node; // log.warn('checking to', edge.fromCluster, point, node); // if (!outsideNode(node, point) && !isInside) { // log.warn('inside', edge.fromCluster, point, node); // // First point inside the rect // const inter = intersection(node, lastPointOutside, point); // log.warn('intersect', intersection(node, lastPointOutside, point)); // let pointPresent = false; // points.forEach(p => { // pointPresent = pointPresent || (p.x === inter.x && p.y === inter.y); // }); // // if (!pointPresent) { // if (!points.find(e => e.x === inter.x && e.y === inter.y)) { // updatedPoints.unshift(inter); // log.warn('Adding point -updated = ', updatedPoints); // } else { // log.warn('no intersect', inter, points); // } // // points.push(insterection); // isInside = true; // } else { // // at the outside // // if (!isInside) updatedPoints.unshift(point); // updatedPoints.unshift(point); // log.warn('Outside point', point, updatedPoints); // } // lastPointOutside = point; // } // points = updatedPoints; // points = edge.points; pointsHasChanged = true; } // The data for our line var lineData = points.filter(function (p) { return !Number.isNaN(p.y); }); // This is the accessor function we talked about above var curve; // Currently only flowcharts get the curve from the settings, perhaps this should // be expanded to a common setting? Restricting it for now in order not to cause side-effects that // have not been thought through if (diagramType === 'graph' || diagramType === 'flowchart') { curve = edge.curve || d3__WEBPACK_IMPORTED_MODULE_0__.curveBasis; } else { curve = d3__WEBPACK_IMPORTED_MODULE_0__.curveBasis; } // curve = curveLinear; var lineFunction = (0,d3__WEBPACK_IMPORTED_MODULE_0__.line)().x(function (d) { return d.x; }).y(function (d) { return d.y; }).curve(curve); // Contruct stroke classes based on properties var strokeClasses; switch (edge.thickness) { case 'normal': strokeClasses = 'edge-thickness-normal'; break; case 'thick': strokeClasses = 'edge-thickness-thick'; break; default: strokeClasses = ''; } switch (edge.pattern) { case 'solid': strokeClasses += ' edge-pattern-solid'; break; case 'dotted': strokeClasses += ' edge-pattern-dotted'; break; case 'dashed': strokeClasses += ' edge-pattern-dashed'; break; } var svgPath = elem.append('path').attr('d', lineFunction(lineData)).attr('id', edge.id).attr('class', ' ' + strokeClasses + (edge.classes ? ' ' + edge.classes : '')).attr('style', edge.style); // DEBUG code, adds a red circle at each edge coordinate // edge.points.forEach(point => { // elem // .append('circle') // .style('stroke', 'red') // .style('fill', 'red') // .attr('r', 1) // .attr('cx', point.x) // .attr('cy', point.y); // }); var url = ''; if ((0,_config__WEBPACK_IMPORTED_MODULE_3__.getConfig)().state.arrowMarkerAbsolute) { url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search; url = url.replace(/\(/g, '\\('); url = url.replace(/\)/g, '\\)'); } _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('arrowTypeStart', edge.arrowTypeStart); _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('arrowTypeEnd', edge.arrowTypeEnd); switch (edge.arrowTypeStart) { case 'arrow_cross': svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-crossStart' + ')'); break; case 'arrow_point': svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-pointStart' + ')'); break; case 'arrow_barb': svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-barbStart' + ')'); break; case 'arrow_circle': svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-circleStart' + ')'); break; case 'aggregation': svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-aggregationStart' + ')'); break; case 'extension': svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-extensionStart' + ')'); break; case 'composition': svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-compositionStart' + ')'); break; case 'dependency': svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-dependencyStart' + ')'); break; default: } switch (edge.arrowTypeEnd) { case 'arrow_cross': svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-crossEnd' + ')'); break; case 'arrow_point': svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-pointEnd' + ')'); break; case 'arrow_barb': svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-barbEnd' + ')'); break; case 'arrow_circle': svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-circleEnd' + ')'); break; case 'aggregation': svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-aggregationEnd' + ')'); break; case 'extension': svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-extensionEnd' + ')'); break; case 'composition': svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-compositionEnd' + ')'); break; case 'dependency': svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-dependencyEnd' + ')'); break; default: } var paths = {}; if (pointsHasChanged) { paths.updatedPath = points; } paths.originalPath = edge.points; return paths; }; /***/ }), /***/ "./src/dagre-wrapper/index.js": /*!************************************!*\ !*** ./src/dagre-wrapper/index.js ***! \************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* binding */ render) /* harmony export */ }); /* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dagre */ "dagre"); /* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! graphlib */ "graphlib"); /* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _markers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./markers */ "./src/dagre-wrapper/markers.js"); /* harmony import */ var _shapes_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shapes/util */ "./src/dagre-wrapper/shapes/util.js"); /* harmony import */ var _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mermaid-graphlib */ "./src/dagre-wrapper/mermaid-graphlib.js"); /* harmony import */ var _nodes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./nodes */ "./src/dagre-wrapper/nodes.js"); /* harmony import */ var _clusters__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./clusters */ "./src/dagre-wrapper/clusters.js"); /* harmony import */ var _edges__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./edges */ "./src/dagre-wrapper/edges.js"); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); var recursiveRender = function recursiveRender(_elem, graph, diagramtype, parentCluster) { _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Graph in recursive render: XXX', graphlib__WEBPACK_IMPORTED_MODULE_1___default().json.write(graph), parentCluster); var dir = graph.graph().rankdir; _logger__WEBPACK_IMPORTED_MODULE_2__.log.trace('Dir in recursive render - dir:', dir); var elem = _elem.insert('g').attr('class', 'root'); // eslint-disable-line if (!graph.nodes()) { _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('No nodes found for', graph); } else { _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Recursive render XXX', graph.nodes()); } if (graph.edges().length > 0) { _logger__WEBPACK_IMPORTED_MODULE_2__.log.trace('Recursive edges', graph.edge(graph.edges()[0])); } var clusters = elem.insert('g').attr('class', 'clusters'); // eslint-disable-line var edgePaths = elem.insert('g').attr('class', 'edgePaths'); var edgeLabels = elem.insert('g').attr('class', 'edgeLabels'); var nodes = elem.insert('g').attr('class', 'nodes'); // Insert nodes, this will insert them into the dom and each node will get a size. The size is updated // to the abstract node and is later used by dagre for the layout graph.nodes().forEach(function (v) { var node = graph.node(v); if (typeof parentCluster !== 'undefined') { var data = JSON.parse(JSON.stringify(parentCluster.clusterData)); // data.clusterPositioning = true; _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Setting data for cluster XXX (', v, ') ', data, parentCluster); graph.setNode(parentCluster.id, data); if (!graph.parent(v)) { _logger__WEBPACK_IMPORTED_MODULE_2__.log.trace('Setting parent', v, parentCluster.id); graph.setParent(v, parentCluster.id, data); } } _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('(Insert) Node XXX' + v + ': ' + JSON.stringify(graph.node(v))); if (node && node.clusterNode) { // const children = graph.children(v); _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Cluster identified', v, node.width, graph.node(v)); var o = recursiveRender(nodes, node.graph, diagramtype, graph.node(v)); var newEl = o.elem; (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, newEl); node.diff = o.diff || 0; _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Node bounds (abc123)', v, node, node.width, node.x, node.y); (0,_nodes__WEBPACK_IMPORTED_MODULE_4__.setNodeElem)(newEl, node); _logger__WEBPACK_IMPORTED_MODULE_2__.log.warn('Recursive render complete ', newEl, node); } else { if (graph.children(v).length > 0) { // This is a cluster but not to be rendered recusively // Render as before _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Cluster - the non recursive path XXX', v, node.id, node, graph); _logger__WEBPACK_IMPORTED_MODULE_2__.log.info((0,_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.findNonClusterChild)(node.id, graph)); _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb[node.id] = { id: (0,_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.findNonClusterChild)(node.id, graph), node: node }; // insertCluster(clusters, graph.node(v)); } else { _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Node - the non recursive path', v, node.id, node); (0,_nodes__WEBPACK_IMPORTED_MODULE_4__.insertNode)(nodes, graph.node(v), dir); } } }); // Insert labels, this will insert them into the dom so that the width can be calculated // Also figure out which edges point to/from clusters and adjust them accordingly // Edges from/to clusters really points to the first child in the cluster. // TODO: pick optimal child in the cluster to us as link anchor graph.edges().forEach(function (e) { var edge = graph.edge(e.v, e.w, e.name); _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e)); _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Edge ' + e.v + ' -> ' + e.w + ': ', e, ' ', JSON.stringify(graph.edge(e))); // Check if link is either from or to a cluster _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Fix', _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb, 'ids:', e.v, e.w, 'Translateing: ', _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb[e.v], _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb[e.w]); (0,_edges__WEBPACK_IMPORTED_MODULE_6__.insertEdgeLabel)(edgeLabels, edge); }); graph.edges().forEach(function (e) { _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e)); }); _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('#############################################'); _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('### Layout ###'); _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('#############################################'); _logger__WEBPACK_IMPORTED_MODULE_2__.log.info(graph); dagre__WEBPACK_IMPORTED_MODULE_0___default().layout(graph); _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Graph after layout:', graphlib__WEBPACK_IMPORTED_MODULE_1___default().json.write(graph)); // Move the nodes to the correct place var diff = 0; (0,_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.sortNodesByHierarchy)(graph).forEach(function (v) { var node = graph.node(v); _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Position ' + v + ': ' + JSON.stringify(graph.node(v))); _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Position ' + v + ': (' + node.x, ',' + node.y, ') width: ', node.width, ' height: ', node.height); if (node && node.clusterNode) { // clusterDb[node.id].node = node; (0,_nodes__WEBPACK_IMPORTED_MODULE_4__.positionNode)(node); } else { // Non cluster node if (graph.children(v).length > 0) { // A cluster in the non-recurive way // positionCluster(node); (0,_clusters__WEBPACK_IMPORTED_MODULE_7__.insertCluster)(clusters, node); _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb[node.id].node = node; } else { (0,_nodes__WEBPACK_IMPORTED_MODULE_4__.positionNode)(node); } } }); // Move the edge labels to the correct place after layout graph.edges().forEach(function (e) { var edge = graph.edge(e); _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(edge), edge); var paths = (0,_edges__WEBPACK_IMPORTED_MODULE_6__.insertEdge)(edgePaths, e, edge, _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb, diagramtype, graph); (0,_edges__WEBPACK_IMPORTED_MODULE_6__.positionEdgeLabel)(edge, paths); }); graph.nodes().forEach(function (v) { var n = graph.node(v); _logger__WEBPACK_IMPORTED_MODULE_2__.log.info(v, n.type, n.diff); if (n.type === 'group') { diff = n.diff; } }); return { elem: elem, diff: diff }; }; var render = function render(elem, graph, markers, diagramtype, id) { (0,_markers__WEBPACK_IMPORTED_MODULE_8__["default"])(elem, markers, diagramtype, id); (0,_nodes__WEBPACK_IMPORTED_MODULE_4__.clear)(); (0,_edges__WEBPACK_IMPORTED_MODULE_6__.clear)(); (0,_clusters__WEBPACK_IMPORTED_MODULE_7__.clear)(); (0,_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clear)(); _logger__WEBPACK_IMPORTED_MODULE_2__.log.warn('Graph at first:', graphlib__WEBPACK_IMPORTED_MODULE_1___default().json.write(graph)); (0,_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.adjustClustersAndEdges)(graph); _logger__WEBPACK_IMPORTED_MODULE_2__.log.warn('Graph after:', graphlib__WEBPACK_IMPORTED_MODULE_1___default().json.write(graph)); // log.warn('Graph ever after:', graphlib.json.write(graph.node('A').graph)); recursiveRender(elem, graph, diagramtype); }; // const shapeDefinitions = {}; // export const addShape = ({ shapeType: fun }) => { // shapeDefinitions[shapeType] = fun; // }; // const arrowDefinitions = {}; // export const addArrow = ({ arrowType: fun }) => { // arrowDefinitions[arrowType] = fun; // }; /***/ }), /***/ "./src/dagre-wrapper/intersect/index.js": /*!**********************************************!*\ !*** ./src/dagre-wrapper/intersect/index.js ***! \**********************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _intersect_node_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./intersect-node.js */ "./src/dagre-wrapper/intersect/intersect-node.js"); /* harmony import */ var _intersect_node_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_intersect_node_js__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _intersect_circle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./intersect-circle.js */ "./src/dagre-wrapper/intersect/intersect-circle.js"); /* harmony import */ var _intersect_ellipse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./intersect-ellipse.js */ "./src/dagre-wrapper/intersect/intersect-ellipse.js"); /* harmony import */ var _intersect_polygon_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./intersect-polygon.js */ "./src/dagre-wrapper/intersect/intersect-polygon.js"); /* harmony import */ var _intersect_rect_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./intersect-rect.js */ "./src/dagre-wrapper/intersect/intersect-rect.js"); /* * Borrowed with love from from dagrge-d3. Many thanks to cpettitt! */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ node: (_intersect_node_js__WEBPACK_IMPORTED_MODULE_0___default()), circle: _intersect_circle_js__WEBPACK_IMPORTED_MODULE_1__["default"], ellipse: _intersect_ellipse_js__WEBPACK_IMPORTED_MODULE_2__["default"], polygon: _intersect_polygon_js__WEBPACK_IMPORTED_MODULE_3__["default"], rect: _intersect_rect_js__WEBPACK_IMPORTED_MODULE_4__["default"] }); /***/ }), /***/ "./src/dagre-wrapper/intersect/intersect-circle.js": /*!*********************************************************!*\ !*** ./src/dagre-wrapper/intersect/intersect-circle.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _intersect_ellipse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./intersect-ellipse */ "./src/dagre-wrapper/intersect/intersect-ellipse.js"); /** * @param node * @param rx * @param point */ function intersectCircle(node, rx, point) { return (0,_intersect_ellipse__WEBPACK_IMPORTED_MODULE_0__["default"])(node, rx, rx, point); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (intersectCircle); /***/ }), /***/ "./src/dagre-wrapper/intersect/intersect-ellipse.js": /*!**********************************************************!*\ !*** ./src/dagre-wrapper/intersect/intersect-ellipse.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /** * @param node * @param rx * @param ry * @param point */ function intersectEllipse(node, rx, ry, point) { // Formulae from: http://mathworld.wolfram.com/Ellipse-LineIntersection.html var cx = node.x; var cy = node.y; var px = cx - point.x; var py = cy - point.y; var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px); var dx = Math.abs(rx * ry * px / det); if (point.x < cx) { dx = -dx; } var dy = Math.abs(rx * ry * py / det); if (point.y < cy) { dy = -dy; } return { x: cx + dx, y: cy + dy }; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (intersectEllipse); /***/ }), /***/ "./src/dagre-wrapper/intersect/intersect-line.js": /*!*******************************************************!*\ !*** ./src/dagre-wrapper/intersect/intersect-line.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /** * Returns the point at which two lines, p and q, intersect or returns undefined if they do not intersect. * * @param p1 * @param p2 * @param q1 * @param q2 */ function intersectLine(p1, p2, q1, q2) { // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994, // p7 and p473. var a1, a2, b1, b2, c1, c2; var r1, r2, r3, r4; var denom, offset, num; var x, y; // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x + // b1 y + c1 = 0. a1 = p2.y - p1.y; b1 = p1.x - p2.x; c1 = p2.x * p1.y - p1.x * p2.y; // Compute r3 and r4. r3 = a1 * q1.x + b1 * q1.y + c1; r4 = a1 * q2.x + b1 * q2.y + c1; // Check signs of r3 and r4. If both point 3 and point 4 lie on // same side of line 1, the line segments do not intersect. if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) { return; } // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0 a2 = q2.y - q1.y; b2 = q1.x - q2.x; c2 = q2.x * q1.y - q1.x * q2.y; // Compute r1 and r2 r1 = a2 * p1.x + b2 * p1.y + c2; r2 = a2 * p2.x + b2 * p2.y + c2; // Check signs of r1 and r2. If both point 1 and point 2 lie // on same side of second line segment, the line segments do // not intersect. if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) { return; } // Line segments intersect: compute intersection point. denom = a1 * b2 - a2 * b1; if (denom === 0) { return; } offset = Math.abs(denom / 2); // The denom/2 is to get rounding instead of truncating. It // is added or subtracted to the numerator, depending upon the // sign of the numerator. num = b1 * c2 - b2 * c1; x = num < 0 ? (num - offset) / denom : (num + offset) / denom; num = a2 * c1 - a1 * c2; y = num < 0 ? (num - offset) / denom : (num + offset) / denom; return { x: x, y: y }; } /** * @param r1 * @param r2 */ function sameSign(r1, r2) { return r1 * r2 > 0; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (intersectLine); /***/ }), /***/ "./src/dagre-wrapper/intersect/intersect-node.js": /*!*******************************************************!*\ !*** ./src/dagre-wrapper/intersect/intersect-node.js ***! \*******************************************************/ /***/ ((module) => { module.exports = intersectNode; /** * @param node * @param point */ function intersectNode(node, point) { // console.info('Intersect Node'); return node.intersect(point); } /***/ }), /***/ "./src/dagre-wrapper/intersect/intersect-polygon.js": /*!**********************************************************!*\ !*** ./src/dagre-wrapper/intersect/intersect-polygon.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _intersect_line__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./intersect-line */ "./src/dagre-wrapper/intersect/intersect-line.js"); /* eslint "no-console": off */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (intersectPolygon); /** * Returns the point ({x, y}) at which the point argument intersects with the node argument assuming * that it has the shape specified by polygon. * * @param node * @param polyPoints * @param point */ function intersectPolygon(node, polyPoints, point) { var x1 = node.x; var y1 = node.y; var intersections = []; var minX = Number.POSITIVE_INFINITY; var minY = Number.POSITIVE_INFINITY; if (typeof polyPoints.forEach === 'function') { polyPoints.forEach(function (entry) { minX = Math.min(minX, entry.x); minY = Math.min(minY, entry.y); }); } else { minX = Math.min(minX, polyPoints.x); minY = Math.min(minY, polyPoints.y); } var left = x1 - node.width / 2 - minX; var top = y1 - node.height / 2 - minY; for (var i = 0; i < polyPoints.length; i++) { var p1 = polyPoints[i]; var p2 = polyPoints[i < polyPoints.length - 1 ? i + 1 : 0]; var intersect = (0,_intersect_line__WEBPACK_IMPORTED_MODULE_0__["default"])(node, point, { x: left + p1.x, y: top + p1.y }, { x: left + p2.x, y: top + p2.y }); if (intersect) { intersections.push(intersect); } } if (!intersections.length) { // console.log('NO INTERSECTION FOUND, RETURN NODE CENTER', node); return node; } if (intersections.length > 1) { // More intersections, find the one nearest to edge end point intersections.sort(function (p, q) { var pdx = p.x - point.x; var pdy = p.y - point.y; var distp = Math.sqrt(pdx * pdx + pdy * pdy); var qdx = q.x - point.x; var qdy = q.y - point.y; var distq = Math.sqrt(qdx * qdx + qdy * qdy); return distp < distq ? -1 : distp === distq ? 0 : 1; }); } return intersections[0]; } /***/ }), /***/ "./src/dagre-wrapper/intersect/intersect-rect.js": /*!*******************************************************!*\ !*** ./src/dagre-wrapper/intersect/intersect-rect.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var intersectRect = function intersectRect(node, point) { var x = node.x; var y = node.y; // Rectangle intersection algorithm from: // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes var dx = point.x - x; var dy = point.y - y; var w = node.width / 2; var h = node.height / 2; var sx, sy; if (Math.abs(dy) * w > Math.abs(dx) * h) { // Intersection is top or bottom of rect. if (dy < 0) { h = -h; } sx = dy === 0 ? 0 : h * dx / dy; sy = h; } else { // Intersection is left or right of rect. if (dx < 0) { w = -w; } sx = w; sy = dx === 0 ? 0 : w * dy / dx; } return { x: x + sx, y: y + sy }; }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (intersectRect); /***/ }), /***/ "./src/dagre-wrapper/markers.js": /*!**************************************!*\ !*** ./src/dagre-wrapper/markers.js ***! \**************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); /** Setup arrow head and define the marker. The result is appended to the svg. */ // Only add the number of markers that the diagram needs var insertMarkers = function insertMarkers(elem, markerArray, type, id) { markerArray.forEach(function (markerName) { markers[markerName](elem, type, id); }); }; var extension = function extension(elem, type, id) { _logger__WEBPACK_IMPORTED_MODULE_0__.log.trace('Making markers for ', id); elem.append('defs').append('marker').attr('id', type + '-extensionStart').attr('class', 'marker extension ' + type).attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 1,7 L18,13 V 1 Z'); elem.append('defs').append('marker').attr('id', type + '-extensionEnd').attr('class', 'marker extension ' + type).attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead }; var composition = function composition(elem, type) { elem.append('defs').append('marker').attr('id', type + '-compositionStart').attr('class', 'marker composition ' + type).attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); elem.append('defs').append('marker').attr('id', type + '-compositionEnd').attr('class', 'marker composition ' + type).attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); }; var aggregation = function aggregation(elem, type) { elem.append('defs').append('marker').attr('id', type + '-aggregationStart').attr('class', 'marker aggregation ' + type).attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); elem.append('defs').append('marker').attr('id', type + '-aggregationEnd').attr('class', 'marker aggregation ' + type).attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); }; var dependency = function dependency(elem, type) { elem.append('defs').append('marker').attr('id', type + '-dependencyStart').attr('class', 'marker dependency ' + type).attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z'); elem.append('defs').append('marker').attr('id', type + '-dependencyEnd').attr('class', 'marker dependency ' + type).attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z'); }; var point = function point(elem, type) { elem.append('marker').attr('id', type + '-pointEnd').attr('class', 'marker ' + type).attr('viewBox', '0 0 10 10').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 12).attr('markerHeight', 12).attr('orient', 'auto').append('path').attr('d', 'M 0 0 L 10 5 L 0 10 z').attr('class', 'arrowMarkerPath').style('stroke-width', 1).style('stroke-dasharray', '1,0'); elem.append('marker').attr('id', type + '-pointStart').attr('class', 'marker ' + type).attr('viewBox', '0 0 10 10').attr('refX', 0).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 12).attr('markerHeight', 12).attr('orient', 'auto').append('path').attr('d', 'M 0 5 L 10 10 L 10 0 z').attr('class', 'arrowMarkerPath').style('stroke-width', 1).style('stroke-dasharray', '1,0'); }; var circle = function circle(elem, type) { elem.append('marker').attr('id', type + '-circleEnd').attr('class', 'marker ' + type).attr('viewBox', '0 0 10 10').attr('refX', 11).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 11).attr('markerHeight', 11).attr('orient', 'auto').append('circle').attr('cx', '5').attr('cy', '5').attr('r', '5').attr('class', 'arrowMarkerPath').style('stroke-width', 1).style('stroke-dasharray', '1,0'); elem.append('marker').attr('id', type + '-circleStart').attr('class', 'marker ' + type).attr('viewBox', '0 0 10 10').attr('refX', -1).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 11).attr('markerHeight', 11).attr('orient', 'auto').append('circle').attr('cx', '5').attr('cy', '5').attr('r', '5').attr('class', 'arrowMarkerPath').style('stroke-width', 1).style('stroke-dasharray', '1,0'); }; var cross = function cross(elem, type) { elem.append('marker').attr('id', type + '-crossEnd').attr('class', 'marker cross ' + type).attr('viewBox', '0 0 11 11').attr('refX', 12).attr('refY', 5.2).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 11).attr('markerHeight', 11).attr('orient', 'auto').append('path') // .attr('stroke', 'black') .attr('d', 'M 1,1 l 9,9 M 10,1 l -9,9').attr('class', 'arrowMarkerPath').style('stroke-width', 2).style('stroke-dasharray', '1,0'); elem.append('marker').attr('id', type + '-crossStart').attr('class', 'marker cross ' + type).attr('viewBox', '0 0 11 11').attr('refX', -1).attr('refY', 5.2).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 11).attr('markerHeight', 11).attr('orient', 'auto').append('path') // .attr('stroke', 'black') .attr('d', 'M 1,1 l 9,9 M 10,1 l -9,9').attr('class', 'arrowMarkerPath').style('stroke-width', 2).style('stroke-dasharray', '1,0'); }; var barb = function barb(elem, type) { elem.append('defs').append('marker').attr('id', type + '-barbEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 14).attr('markerUnits', 'strokeWidth').attr('orient', 'auto').append('path').attr('d', 'M 19,7 L9,13 L14,7 L9,1 Z'); }; // TODO rename the class diagram markers to something shape descriptive and semanitc free var markers = { extension: extension, composition: composition, aggregation: aggregation, dependency: dependency, point: point, circle: circle, cross: cross, barb: barb }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (insertMarkers); /***/ }), /***/ "./src/dagre-wrapper/mermaid-graphlib.js": /*!***********************************************!*\ !*** ./src/dagre-wrapper/mermaid-graphlib.js ***! \***********************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "adjustClustersAndEdges": () => (/* binding */ adjustClustersAndEdges), /* harmony export */ "clear": () => (/* binding */ clear), /* harmony export */ "clusterDb": () => (/* binding */ clusterDb), /* harmony export */ "extractDecendants": () => (/* binding */ extractDecendants), /* harmony export */ "extractor": () => (/* binding */ extractor), /* harmony export */ "findNonClusterChild": () => (/* binding */ findNonClusterChild), /* harmony export */ "sortNodesByHierarchy": () => (/* binding */ sortNodesByHierarchy), /* harmony export */ "validate": () => (/* binding */ validate) /* harmony export */ }); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); /* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! graphlib */ "graphlib"); /* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_0__); /** Decorates with functions required by mermaids dagre-wrapper. */ var clusterDb = {}; var decendants = {}; var parents = {}; var clear = function clear() { decendants = {}; parents = {}; clusterDb = {}; }; var isDecendant = function isDecendant(id, ancenstorId) { // if (id === ancenstorId) return true; _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('In isDecendant', ancenstorId, ' ', id, ' = ', decendants[ancenstorId].indexOf(id) >= 0); if (decendants[ancenstorId].indexOf(id) >= 0) return true; return false; }; var edgeInCluster = function edgeInCluster(edge, clusterId) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Decendants of ', clusterId, ' is ', decendants[clusterId]); _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Edge is ', edge); // Edges to/from the cluster is not in the cluster, they are in the parent if (edge.v === clusterId) return false; if (edge.w === clusterId) return false; if (!decendants[clusterId]) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Tilt, ', clusterId, ',not in decendants'); return false; } _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Here '); if (decendants[clusterId].indexOf(edge.v) >= 0) return true; if (isDecendant(edge.v, clusterId)) return true; if (isDecendant(edge.w, clusterId)) return true; if (decendants[clusterId].indexOf(edge.w) >= 0) return true; return false; }; var copy = function copy(clusterId, graph, newGraph, rootId) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Copying children of ', clusterId, 'root', rootId, 'data', graph.node(clusterId), rootId); var nodes = graph.children(clusterId) || []; // Include cluster node if it is not the root if (clusterId !== rootId) { nodes.push(clusterId); } _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Copying (nodes) clusterId', clusterId, 'nodes', nodes); nodes.forEach(function (node) { if (graph.children(node).length > 0) { copy(node, graph, newGraph, rootId); } else { var data = graph.node(node); _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('cp ', node, ' to ', rootId, ' with parent ', clusterId); //,node, data, ' parent is ', clusterId); newGraph.setNode(node, data); if (rootId !== graph.parent(node)) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Setting parent', node, graph.parent(node)); newGraph.setParent(node, graph.parent(node)); } if (clusterId !== rootId && node !== clusterId) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Setting parent', node, clusterId); newGraph.setParent(node, clusterId); } else { _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('In copy ', clusterId, 'root', rootId, 'data', graph.node(clusterId), rootId); _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Not Setting parent for node=', node, 'cluster!==rootId', clusterId !== rootId, 'node!==clusterId', node !== clusterId); } var edges = graph.edges(node); _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Copying Edges', edges); edges.forEach(function (edge) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Edge', edge); var data = graph.edge(edge.v, edge.w, edge.name); _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Edge data', data, rootId); try { // Do not copy edges in and out of the root cluster, they belong to the parent graph if (edgeInCluster(edge, rootId)) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Copying as ', edge.v, edge.w, data, edge.name); newGraph.setEdge(edge.v, edge.w, data, edge.name); _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('newGraph edges ', newGraph.edges(), newGraph.edge(newGraph.edges()[0])); } else { _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Skipping copy of edge ', edge.v, '-->', edge.w, ' rootId: ', rootId, ' clusterId:', clusterId); } } catch (e) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.error(e); } }); } _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Removing node', node); graph.removeNode(node); }); }; var extractDecendants = function extractDecendants(id, graph) { // log.debug('Extracting ', id); var children = graph.children(id); var res = [].concat(children); for (var i = 0; i < children.length; i++) { parents[children[i]] = id; res = res.concat(extractDecendants(children[i], graph)); } return res; }; /** * Validates the graph, checking that all parent child relation points to existing nodes and that * edges between nodes also ia correct. When not correct the function logs the discrepancies. * * @param graph */ var validate = function validate(graph) { var edges = graph.edges(); _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Edges: ', edges); for (var i = 0; i < edges.length; i++) { if (graph.children(edges[i].v).length > 0) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('The node ', edges[i].v, ' is part of and edge even though it has children'); return false; } if (graph.children(edges[i].w).length > 0) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('The node ', edges[i].w, ' is part of and edge even though it has children'); return false; } } return true; }; /** * Finds a child that is not a cluster. When faking a edge between a node and a cluster. * * @param {Finds a} id * @param {any} graph */ var findNonClusterChild = function findNonClusterChild(id, graph) { // const node = graph.node(id); _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Searching', id); // const children = graph.children(id).reverse(); var children = graph.children(id); //.reverse(); _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Searching children of id ', id, children); if (children.length < 1) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('This is a valid node', id); return id; } for (var i = 0; i < children.length; i++) { var _id = findNonClusterChild(children[i], graph); if (_id) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Found replacement for', id, ' => ', _id); return _id; } } }; var getAnchorId = function getAnchorId(id) { if (!clusterDb[id]) { return id; } // If the cluster has no external connections if (!clusterDb[id].externalConnections) { return id; } // Return the replacement node if (clusterDb[id]) { return clusterDb[id].id; } return id; }; var adjustClustersAndEdges = function adjustClustersAndEdges(graph, depth) { if (!graph || depth > 10) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Opting out, no graph '); return; } else { _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Opting in, graph '); } // Go through the nodes and for each cluster found, save a replacment node, this can be used when // faking a link to a cluster graph.nodes().forEach(function (id) { var children = graph.children(id); if (children.length > 0) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Cluster identified', id, ' Replacement id in edges: ', findNonClusterChild(id, graph)); decendants[id] = extractDecendants(id, graph); clusterDb[id] = { id: findNonClusterChild(id, graph), clusterData: graph.node(id) }; } }); // Check incoming and outgoing edges for each cluster graph.nodes().forEach(function (id) { var children = graph.children(id); var edges = graph.edges(); if (children.length > 0) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Cluster identified', id, decendants); edges.forEach(function (edge) { // log.debug('Edge, decendants: ', edge, decendants[id]); // Check if any edge leaves the cluster (not the actual cluster, thats a link from the box) if (edge.v !== id && edge.w !== id) { // Any edge where either the one of the nodes is decending to the cluster but not the other // if (decendants[id].indexOf(edge.v) < 0 && decendants[id].indexOf(edge.w) < 0) { var d1 = isDecendant(edge.v, id); var d2 = isDecendant(edge.w, id); // d1 xor d2 - if either d1 is true and d2 is false or the other way around if (d1 ^ d2) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Edge: ', edge, ' leaves cluster ', id); _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Decendants of XXX ', id, ': ', decendants[id]); clusterDb[id].externalConnections = true; } } }); } else { _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Not a cluster ', id, decendants); } }); // For clusters with incoming and/or outgoing edges translate those edges to a real node // in the cluster inorder to fake the edge graph.edges().forEach(function (e) { var edge = graph.edge(e); _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e)); _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(graph.edge(e))); var v = e.v; var w = e.w; // Check if link is either from or to a cluster _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Fix XXX', clusterDb, 'ids:', e.v, e.w, 'Translateing: ', clusterDb[e.v], ' --- ', clusterDb[e.w]); if (clusterDb[e.v] || clusterDb[e.w]) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Fixing and trixing - removing XXX', e.v, e.w, e.name); v = getAnchorId(e.v); w = getAnchorId(e.w); graph.removeEdge(e.v, e.w, e.name); if (v !== e.v) edge.fromCluster = e.v; if (w !== e.w) edge.toCluster = e.w; _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Fix Replacing with XXX', v, w, e.name); graph.setEdge(v, w, edge, e.name); } }); _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Adjusted Graph', graphlib__WEBPACK_IMPORTED_MODULE_0___default().json.write(graph)); extractor(graph, 0); _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace(clusterDb); // Remove references to extracted cluster // graph.edges().forEach(edge => { // if (isDecendant(edge.v, clusterId) || isDecendant(edge.w, clusterId)) { // graph.removeEdge(edge); // } // }); }; var extractor = function extractor(graph, depth) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('extractor - ', depth, graphlib__WEBPACK_IMPORTED_MODULE_0___default().json.write(graph), graph.children('D')); if (depth > 10) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.error('Bailing out'); return; } // For clusters without incoming and/or outgoing edges, create a new cluster-node // containing the nodes and edges in the custer in a new graph // for (let i = 0;) var nodes = graph.nodes(); var hasChildren = false; for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; var children = graph.children(node); hasChildren = hasChildren || children.length > 0; } if (!hasChildren) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Done, no node has children', graph.nodes()); return; } // const clusters = Object.keys(clusterDb); // clusters.forEach(clusterId => { _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Nodes = ', nodes, depth); for (var _i = 0; _i < nodes.length; _i++) { var _node = nodes[_i]; _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Extracting node', _node, clusterDb, clusterDb[_node] && !clusterDb[_node].externalConnections, !graph.parent(_node), graph.node(_node), graph.children('D'), ' Depth ', depth); // Note that the node might have been removed after the Object.keys call so better check // that it still is in the game if (!clusterDb[_node]) { // Skip if the node is not a cluster _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Not a cluster', _node, depth); // break; } else if (!clusterDb[_node].externalConnections && // !graph.parent(node) && graph.children(_node) && graph.children(_node).length > 0) { _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Cluster without external connections, without a parent and with children', _node, depth); var graphSettings = graph.graph(); var dir = graphSettings.rankdir === 'TB' ? 'LR' : 'TB'; if (clusterDb[_node]) { if (clusterDb[_node].clusterData && clusterDb[_node].clusterData.dir) { dir = clusterDb[_node].clusterData.dir; _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Fixing dir', clusterDb[_node].clusterData.dir, dir); } } var clusterGraph = new (graphlib__WEBPACK_IMPORTED_MODULE_0___default().Graph)({ multigraph: true, compound: true }).setGraph({ rankdir: dir, // Todo: set proper spacing nodesep: 50, ranksep: 50, marginx: 8, marginy: 8 }).setDefaultEdgeLabel(function () { return {}; }); _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Old graph before copy', graphlib__WEBPACK_IMPORTED_MODULE_0___default().json.write(graph)); copy(_node, graph, clusterGraph, _node); graph.setNode(_node, { clusterNode: true, id: _node, clusterData: clusterDb[_node].clusterData, labelText: clusterDb[_node].labelText, graph: clusterGraph }); _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('New graph after copy node: (', _node, ')', graphlib__WEBPACK_IMPORTED_MODULE_0___default().json.write(clusterGraph)); _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Old graph after copy', graphlib__WEBPACK_IMPORTED_MODULE_0___default().json.write(graph)); } else { _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Cluster ** ', _node, ' **not meeting the criteria !externalConnections:', !clusterDb[_node].externalConnections, ' no parent: ', !graph.parent(_node), ' children ', graph.children(_node) && graph.children(_node).length > 0, graph.children('D'), depth); _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug(clusterDb); } } nodes = graph.nodes(); _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('New list of nodes', nodes); for (var _i2 = 0; _i2 < nodes.length; _i2++) { var _node2 = nodes[_i2]; var data = graph.node(_node2); _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn(' Now next level', _node2, data); if (data.clusterNode) { extractor(data.graph, depth + 1); } } }; var sorter = function sorter(graph, nodes) { if (nodes.length === 0) return []; var result = Object.assign(nodes); nodes.forEach(function (node) { var children = graph.children(node); var sorted = sorter(graph, children); result = result.concat(sorted); }); return result; }; var sortNodesByHierarchy = function sortNodesByHierarchy(graph) { return sorter(graph, graph.children()); }; /***/ }), /***/ "./src/dagre-wrapper/nodes.js": /*!************************************!*\ !*** ./src/dagre-wrapper/nodes.js ***! \************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "clear": () => (/* binding */ clear), /* harmony export */ "insertNode": () => (/* binding */ insertNode), /* harmony export */ "positionNode": () => (/* binding */ positionNode), /* harmony export */ "setNodeElem": () => (/* binding */ setNodeElem) /* harmony export */ }); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); /* harmony import */ var _shapes_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shapes/util */ "./src/dagre-wrapper/shapes/util.js"); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config */ "./src/config.js"); /* harmony import */ var _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./intersect/index.js */ "./src/dagre-wrapper/intersect/index.js"); /* harmony import */ var _createLabel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./createLabel */ "./src/dagre-wrapper/createLabel.js"); /* harmony import */ var _shapes_note__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./shapes/note */ "./src/dagre-wrapper/shapes/note.js"); /* harmony import */ var _diagrams_class_svgDraw__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../diagrams/class/svgDraw */ "./src/diagrams/class/svgDraw.js"); /* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } // eslint-disable-line var sanitizeText = function sanitizeText(txt) { return (0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.sanitizeText)(txt, (0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)()); }; var question = function question(parent, node) { var _labelHelper = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), shapeSvg = _labelHelper.shapeSvg, bbox = _labelHelper.bbox; var w = bbox.width + node.padding; var h = bbox.height + node.padding; var s = w + h; var points = [{ x: s / 2, y: 0 }, { x: s, y: -s / 2 }, { x: s / 2, y: -s }, { x: 0, y: -s / 2 }]; _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Question main (Circle)'); var questionElem = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, s, s, points); questionElem.attr('style', node.style); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, questionElem); node.intersect = function (point) { _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('Intersect called'); return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); }; return shapeSvg; }; var choice = function choice(parent, node) { var shapeSvg = parent.insert('g').attr('class', 'node default').attr('id', node.domId || node.id); var s = 28; var points = [{ x: 0, y: s / 2 }, { x: s / 2, y: 0 }, { x: 0, y: -s / 2 }, { x: -s / 2, y: 0 }]; var choice = shapeSvg.insert('polygon', ':first-child').attr('points', points.map(function (d) { return d.x + ',' + d.y; }).join(' ')); // center the circle around its coordinate choice.attr('class', 'state-start').attr('r', 7).attr('width', 28).attr('height', 28); node.width = 28; node.height = 28; node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].circle(node, 14, point); }; return shapeSvg; }; var hexagon = function hexagon(parent, node) { var _labelHelper2 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), shapeSvg = _labelHelper2.shapeSvg, bbox = _labelHelper2.bbox; var f = 4; var h = bbox.height + node.padding; var m = h / f; var w = bbox.width + 2 * m + node.padding; var points = [{ x: m, y: 0 }, { x: w - m, y: 0 }, { x: w, y: -h / 2 }, { x: w - m, y: -h }, { x: m, y: -h }, { x: 0, y: -h / 2 }]; var hex = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); hex.attr('style', node.style); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, hex); node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); }; return shapeSvg; }; var rect_left_inv_arrow = function rect_left_inv_arrow(parent, node) { var _labelHelper3 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), shapeSvg = _labelHelper3.shapeSvg, bbox = _labelHelper3.bbox; var w = bbox.width + node.padding; var h = bbox.height + node.padding; var points = [{ x: -h / 2, y: 0 }, { x: w, y: 0 }, { x: w, y: -h }, { x: -h / 2, y: -h }, { x: 0, y: -h / 2 }]; var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); el.attr('style', node.style); node.width = w + h; node.height = h; node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); }; return shapeSvg; }; var lean_right = function lean_right(parent, node) { var _labelHelper4 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), shapeSvg = _labelHelper4.shapeSvg, bbox = _labelHelper4.bbox; var w = bbox.width + node.padding; var h = bbox.height + node.padding; var points = [{ x: -2 * h / 6, y: 0 }, { x: w - h / 6, y: 0 }, { x: w + 2 * h / 6, y: -h }, { x: h / 6, y: -h }]; var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); el.attr('style', node.style); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); }; return shapeSvg; }; var lean_left = function lean_left(parent, node) { var _labelHelper5 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), shapeSvg = _labelHelper5.shapeSvg, bbox = _labelHelper5.bbox; var w = bbox.width + node.padding; var h = bbox.height + node.padding; var points = [{ x: 2 * h / 6, y: 0 }, { x: w + h / 6, y: 0 }, { x: w - 2 * h / 6, y: -h }, { x: -h / 6, y: -h }]; var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); el.attr('style', node.style); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); }; return shapeSvg; }; var trapezoid = function trapezoid(parent, node) { var _labelHelper6 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), shapeSvg = _labelHelper6.shapeSvg, bbox = _labelHelper6.bbox; var w = bbox.width + node.padding; var h = bbox.height + node.padding; var points = [{ x: -2 * h / 6, y: 0 }, { x: w + 2 * h / 6, y: 0 }, { x: w - h / 6, y: -h }, { x: h / 6, y: -h }]; var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); el.attr('style', node.style); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); }; return shapeSvg; }; var inv_trapezoid = function inv_trapezoid(parent, node) { var _labelHelper7 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), shapeSvg = _labelHelper7.shapeSvg, bbox = _labelHelper7.bbox; var w = bbox.width + node.padding; var h = bbox.height + node.padding; var points = [{ x: h / 6, y: 0 }, { x: w - h / 6, y: 0 }, { x: w + 2 * h / 6, y: -h }, { x: -2 * h / 6, y: -h }]; var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); el.attr('style', node.style); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); }; return shapeSvg; }; var rect_right_inv_arrow = function rect_right_inv_arrow(parent, node) { var _labelHelper8 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), shapeSvg = _labelHelper8.shapeSvg, bbox = _labelHelper8.bbox; var w = bbox.width + node.padding; var h = bbox.height + node.padding; var points = [{ x: 0, y: 0 }, { x: w + h / 2, y: 0 }, { x: w, y: -h / 2 }, { x: w + h / 2, y: -h }, { x: 0, y: -h }]; var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); el.attr('style', node.style); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); }; return shapeSvg; }; var cylinder = function cylinder(parent, node) { var _labelHelper9 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), shapeSvg = _labelHelper9.shapeSvg, bbox = _labelHelper9.bbox; var w = bbox.width + node.padding; var rx = w / 2; var ry = rx / (2.5 + w / 50); var h = bbox.height + ry + node.padding; var shape = 'M 0,' + ry + ' a ' + rx + ',' + ry + ' 0,0,0 ' + w + ' 0 a ' + rx + ',' + ry + ' 0,0,0 ' + -w + ' 0 l 0,' + h + ' a ' + rx + ',' + ry + ' 0,0,0 ' + w + ' 0 l 0,' + -h; var el = shapeSvg.attr('label-offset-y', ry).insert('path', ':first-child').attr('style', node.style).attr('d', shape).attr('transform', 'translate(' + -w / 2 + ',' + -(h / 2 + ry) + ')'); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); node.intersect = function (point) { var pos = _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); var x = pos.x - node.x; if (rx != 0 && (Math.abs(x) < node.width / 2 || Math.abs(x) == node.width / 2 && Math.abs(pos.y - node.y) > node.height / 2 - ry)) { // ellipsis equation: x*x / a*a + y*y / b*b = 1 // solve for y to get adjustion value for pos.y var y = ry * ry * (1 - x * x / (rx * rx)); if (y != 0) y = Math.sqrt(y); y = ry - y; if (point.y - node.y > 0) y = -y; pos.y += y; } return pos; }; return shapeSvg; }; var rect = function rect(parent, node) { var _labelHelper10 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, 'node ' + node.classes, true), shapeSvg = _labelHelper10.shapeSvg, bbox = _labelHelper10.bbox, halfPadding = _labelHelper10.halfPadding; _logger__WEBPACK_IMPORTED_MODULE_4__.log.trace('Classes = ', node.classes); // add the rect var rect = shapeSvg.insert('rect', ':first-child'); var totalWidth = bbox.width + node.padding; var totalHeight = bbox.height + node.padding; rect.attr('class', 'basic label-container').attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('x', -bbox.width / 2 - halfPadding).attr('y', -bbox.height / 2 - halfPadding).attr('width', totalWidth).attr('height', totalHeight); if (node.props) { var propKeys = new Set(Object.keys(node.props)); if (node.props.borders) { applyNodePropertyBorders(rect, node.props.borders, totalWidth, totalHeight); propKeys.delete('borders'); } propKeys.forEach(function (propKey) { _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn("Unknown node property ".concat(propKey)); }); } (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, rect); node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); }; return shapeSvg; }; /** * @param rect * @param borders * @param totalWidth * @param totalHeight */ function applyNodePropertyBorders(rect, borders, totalWidth, totalHeight) { var strokeDashArray = []; var addBorder = function addBorder(length) { strokeDashArray.push(length); strokeDashArray.push(0); }; var skipBorder = function skipBorder(length) { strokeDashArray.push(0); strokeDashArray.push(length); }; if (borders.includes('t')) { _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('add top border'); addBorder(totalWidth); } else { skipBorder(totalWidth); } if (borders.includes('r')) { _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('add right border'); addBorder(totalHeight); } else { skipBorder(totalHeight); } if (borders.includes('b')) { _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('add bottom border'); addBorder(totalWidth); } else { skipBorder(totalWidth); } if (borders.includes('l')) { _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('add left border'); addBorder(totalHeight); } else { skipBorder(totalHeight); } rect.attr('stroke-dasharray', strokeDashArray.join(' ')); } var rectWithTitle = function rectWithTitle(parent, node) { // const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, 'node ' + node.classes); var classes; if (!node.classes) { classes = 'node default'; } else { classes = 'node ' + node.classes; } // Add outer g element var shapeSvg = parent.insert('g').attr('class', classes).attr('id', node.domId || node.id); // Create the title label and insert it after the rect var rect = shapeSvg.insert('rect', ':first-child'); // const innerRect = shapeSvg.insert('rect'); var innerLine = shapeSvg.insert('line'); var label = shapeSvg.insert('g').attr('class', 'label'); var text2 = node.labelText.flat ? node.labelText.flat() : node.labelText; // const text2 = typeof text2prim === 'object' ? text2prim[0] : text2prim; var title = ''; if (_typeof(text2) === 'object') { title = text2[0]; } else { title = text2; } _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Label text abc79', title, text2, _typeof(text2) === 'object'); var text = label.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(title, node.labelStyle, true, true)); var bbox = { width: 0, height: 0 }; if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { var div = text.children[0]; var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text); bbox = div.getBoundingClientRect(); dv.attr('width', bbox.width); dv.attr('height', bbox.height); } _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Text 2', text2); var textRows = text2.slice(1, text2.length); var titleBox = text.getBBox(); var descr = label.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(textRows.join ? textRows.join('
') : textRows, node.labelStyle, true, true)); if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { var _div = descr.children[0]; var _dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(descr); bbox = _div.getBoundingClientRect(); _dv.attr('width', bbox.width); _dv.attr('height', bbox.height); } // bbox = label.getBBox(); // log.info(descr); var halfPadding = node.padding / 2; (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(descr).attr('transform', 'translate( ' + ( // (titleBox.width - bbox.width) / 2 + bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ', ' + (titleBox.height + halfPadding + 5) + ')'); (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text).attr('transform', 'translate( ' + ( // (titleBox.width - bbox.width) / 2 + bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ', ' + 0 + ')'); // Get the size of the label // Bounding box for title and text bbox = label.node().getBBox(); // Center the label label.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + (-bbox.height / 2 - halfPadding + 3) + ')'); rect.attr('class', 'outer title-state').attr('x', -bbox.width / 2 - halfPadding).attr('y', -bbox.height / 2 - halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding); innerLine.attr('class', 'divider').attr('x1', -bbox.width / 2 - halfPadding).attr('x2', bbox.width / 2 + halfPadding).attr('y1', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding).attr('y2', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, rect); node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); }; return shapeSvg; }; var stadium = function stadium(parent, node) { var _labelHelper11 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), shapeSvg = _labelHelper11.shapeSvg, bbox = _labelHelper11.bbox; var h = bbox.height + node.padding; var w = bbox.width + h / 4 + node.padding; // add the rect var rect = shapeSvg.insert('rect', ':first-child').attr('style', node.style).attr('rx', h / 2).attr('ry', h / 2).attr('x', -w / 2).attr('y', -h / 2).attr('width', w).attr('height', h); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, rect); node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); }; return shapeSvg; }; var circle = function circle(parent, node) { var _labelHelper12 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), shapeSvg = _labelHelper12.shapeSvg, bbox = _labelHelper12.bbox, halfPadding = _labelHelper12.halfPadding; var circle = shapeSvg.insert('circle', ':first-child'); // center the circle around its coordinate circle.attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('r', bbox.width / 2 + halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding); _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Circle main'); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, circle); node.intersect = function (point) { _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Circle intersect', node, bbox.width / 2 + halfPadding, point); return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].circle(node, bbox.width / 2 + halfPadding, point); }; return shapeSvg; }; var doublecircle = function doublecircle(parent, node) { var _labelHelper13 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), shapeSvg = _labelHelper13.shapeSvg, bbox = _labelHelper13.bbox, halfPadding = _labelHelper13.halfPadding; var gap = 5; var circleGroup = shapeSvg.insert('g', ':first-child'); var outerCircle = circleGroup.insert('circle'); var innerCircle = circleGroup.insert('circle'); // center the circle around its coordinate outerCircle.attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('r', bbox.width / 2 + halfPadding + gap).attr('width', bbox.width + node.padding + gap * 2).attr('height', bbox.height + node.padding + gap * 2); innerCircle.attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('r', bbox.width / 2 + halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding); _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('DoubleCircle main'); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, outerCircle); node.intersect = function (point) { _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('DoubleCircle intersect', node, bbox.width / 2 + halfPadding + gap, point); return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].circle(node, bbox.width / 2 + halfPadding + gap, point); }; return shapeSvg; }; var subroutine = function subroutine(parent, node) { var _labelHelper14 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), shapeSvg = _labelHelper14.shapeSvg, bbox = _labelHelper14.bbox; var w = bbox.width + node.padding; var h = bbox.height + node.padding; var points = [{ x: 0, y: 0 }, { x: w, y: 0 }, { x: w, y: -h }, { x: 0, y: -h }, { x: 0, y: 0 }, { x: -8, y: 0 }, { x: w + 8, y: 0 }, { x: w + 8, y: -h }, { x: -8, y: -h }, { x: -8, y: 0 }]; var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); el.attr('style', node.style); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); }; return shapeSvg; }; var start = function start(parent, node) { var shapeSvg = parent.insert('g').attr('class', 'node default').attr('id', node.domId || node.id); var circle = shapeSvg.insert('circle', ':first-child'); // center the circle around its coordinate circle.attr('class', 'state-start').attr('r', 7).attr('width', 14).attr('height', 14); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, circle); node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].circle(node, 7, point); }; return shapeSvg; }; var forkJoin = function forkJoin(parent, node, dir) { var shapeSvg = parent.insert('g').attr('class', 'node default').attr('id', node.domId || node.id); var width = 70; var height = 10; if (dir === 'LR') { width = 10; height = 70; } var shape = shapeSvg.append('rect').attr('x', -1 * width / 2).attr('y', -1 * height / 2).attr('width', width).attr('height', height).attr('class', 'fork-join'); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, shape); node.height = node.height + node.padding / 2; node.width = node.width + node.padding / 2; node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); }; return shapeSvg; }; var end = function end(parent, node) { var shapeSvg = parent.insert('g').attr('class', 'node default').attr('id', node.domId || node.id); var innerCircle = shapeSvg.insert('circle', ':first-child'); var circle = shapeSvg.insert('circle', ':first-child'); circle.attr('class', 'state-start').attr('r', 7).attr('width', 14).attr('height', 14); innerCircle.attr('class', 'state-end').attr('r', 5).attr('width', 10).attr('height', 10); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, circle); node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].circle(node, 7, point); }; return shapeSvg; }; var class_box = function class_box(parent, node) { var halfPadding = node.padding / 2; var rowPadding = 4; var lineHeight = 8; var classes; if (!node.classes) { classes = 'node default'; } else { classes = 'node ' + node.classes; } // Add outer g element var shapeSvg = parent.insert('g').attr('class', classes).attr('id', node.domId || node.id); // Create the title label and insert it after the rect var rect = shapeSvg.insert('rect', ':first-child'); var topLine = shapeSvg.insert('line'); var bottomLine = shapeSvg.insert('line'); var maxWidth = 0; var maxHeight = rowPadding; var labelContainer = shapeSvg.insert('g').attr('class', 'label'); var verticalPos = 0; var hasInterface = node.classData.annotations && node.classData.annotations[0]; // 1. Create the labels var interfaceLabelText = node.classData.annotations[0] ? '«' + node.classData.annotations[0] + '»' : ''; var interfaceLabel = labelContainer.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(interfaceLabelText, node.labelStyle, true, true)); var interfaceBBox = interfaceLabel.getBBox(); if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { var div = interfaceLabel.children[0]; var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(interfaceLabel); interfaceBBox = div.getBoundingClientRect(); dv.attr('width', interfaceBBox.width); dv.attr('height', interfaceBBox.height); } if (node.classData.annotations[0]) { maxHeight += interfaceBBox.height + rowPadding; maxWidth += interfaceBBox.width; } var classTitleString = node.classData.id; if (node.classData.type !== undefined && node.classData.type !== '') { if ((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels) { classTitleString += '<' + node.classData.type + '>'; } else { classTitleString += '<' + node.classData.type + '>'; } } var classTitleLabel = labelContainer.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(classTitleString, node.labelStyle, true, true)); (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(classTitleLabel).attr('class', 'classTitle'); var classTitleBBox = classTitleLabel.getBBox(); if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { var _div2 = classTitleLabel.children[0]; var _dv2 = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(classTitleLabel); classTitleBBox = _div2.getBoundingClientRect(); _dv2.attr('width', classTitleBBox.width); _dv2.attr('height', classTitleBBox.height); } maxHeight += classTitleBBox.height + rowPadding; if (classTitleBBox.width > maxWidth) { maxWidth = classTitleBBox.width; } var classAttributes = []; node.classData.members.forEach(function (str) { var parsedInfo = (0,_diagrams_class_svgDraw__WEBPACK_IMPORTED_MODULE_7__.parseMember)(str); var parsedText = parsedInfo.displayText; if ((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels) { parsedText = parsedText.replace(//g, '>'); } var lbl = labelContainer.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(parsedText, parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle, true, true)); var bbox = lbl.getBBox(); if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { var _div3 = lbl.children[0]; var _dv3 = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(lbl); bbox = _div3.getBoundingClientRect(); _dv3.attr('width', bbox.width); _dv3.attr('height', bbox.height); } if (bbox.width > maxWidth) { maxWidth = bbox.width; } maxHeight += bbox.height + rowPadding; classAttributes.push(lbl); }); maxHeight += lineHeight; var classMethods = []; node.classData.methods.forEach(function (str) { var parsedInfo = (0,_diagrams_class_svgDraw__WEBPACK_IMPORTED_MODULE_7__.parseMember)(str); var displayText = parsedInfo.displayText; if ((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels) { displayText = displayText.replace(//g, '>'); } var lbl = labelContainer.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(displayText, parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle, true, true)); var bbox = lbl.getBBox(); if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { var _div4 = lbl.children[0]; var _dv4 = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(lbl); bbox = _div4.getBoundingClientRect(); _dv4.attr('width', bbox.width); _dv4.attr('height', bbox.height); } if (bbox.width > maxWidth) { maxWidth = bbox.width; } maxHeight += bbox.height + rowPadding; classMethods.push(lbl); }); maxHeight += lineHeight; // 2. Position the labels // position the interface label if (hasInterface) { var _diffX = (maxWidth - interfaceBBox.width) / 2; (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(interfaceLabel).attr('transform', 'translate( ' + (-1 * maxWidth / 2 + _diffX) + ', ' + -1 * maxHeight / 2 + ')'); verticalPos = interfaceBBox.height + rowPadding; } // Positin the class title label var diffX = (maxWidth - classTitleBBox.width) / 2; (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(classTitleLabel).attr('transform', 'translate( ' + (-1 * maxWidth / 2 + diffX) + ', ' + (-1 * maxHeight / 2 + verticalPos) + ')'); verticalPos += classTitleBBox.height + rowPadding; topLine.attr('class', 'divider').attr('x1', -maxWidth / 2 - halfPadding).attr('x2', maxWidth / 2 + halfPadding).attr('y1', -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr('y2', -maxHeight / 2 - halfPadding + lineHeight + verticalPos); verticalPos += lineHeight; classAttributes.forEach(function (lbl) { (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(lbl).attr('transform', 'translate( ' + -maxWidth / 2 + ', ' + (-1 * maxHeight / 2 + verticalPos + lineHeight / 2) + ')'); verticalPos += classTitleBBox.height + rowPadding; }); verticalPos += lineHeight; bottomLine.attr('class', 'divider').attr('x1', -maxWidth / 2 - halfPadding).attr('x2', maxWidth / 2 + halfPadding).attr('y1', -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr('y2', -maxHeight / 2 - halfPadding + lineHeight + verticalPos); verticalPos += lineHeight; classMethods.forEach(function (lbl) { (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(lbl).attr('transform', 'translate( ' + -maxWidth / 2 + ', ' + (-1 * maxHeight / 2 + verticalPos) + ')'); verticalPos += classTitleBBox.height + rowPadding; }); // // let bbox; // if (evaluate(getConfig().flowchart.htmlLabels)) { // const div = interfaceLabel.children[0]; // const dv = select(interfaceLabel); // bbox = div.getBoundingClientRect(); // dv.attr('width', bbox.width); // dv.attr('height', bbox.height); // } // bbox = labelContainer.getBBox(); // log.info('Text 2', text2); // const textRows = text2.slice(1, text2.length); // let titleBox = text.getBBox(); // const descr = label // .node() // .appendChild(createLabel(textRows.join('
'), node.labelStyle, true, true)); // if (evaluate(getConfig().flowchart.htmlLabels)) { // const div = descr.children[0]; // const dv = select(descr); // bbox = div.getBoundingClientRect(); // dv.attr('width', bbox.width); // dv.attr('height', bbox.height); // } // // bbox = label.getBBox(); // // log.info(descr); // select(descr).attr( // 'transform', // 'translate( ' + // // (titleBox.width - bbox.width) / 2 + // (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + // ', ' + // (titleBox.height + halfPadding + 5) + // ')' // ); // select(text).attr( // 'transform', // 'translate( ' + // // (titleBox.width - bbox.width) / 2 + // (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + // ', ' + // 0 + // ')' // ); // // Get the size of the label // // Bounding box for title and text // bbox = label.node().getBBox(); // // Center the label // label.attr( // 'transform', // 'translate(' + -bbox.width / 2 + ', ' + (-bbox.height / 2 - halfPadding + 3) + ')' // ); rect.attr('class', 'outer title-state').attr('x', -maxWidth / 2 - halfPadding).attr('y', -(maxHeight / 2) - halfPadding).attr('width', maxWidth + node.padding).attr('height', maxHeight + node.padding); // innerLine // .attr('class', 'divider') // .attr('x1', -bbox.width / 2 - halfPadding) // .attr('x2', bbox.width / 2 + halfPadding) // .attr('y1', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding) // .attr('y2', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding); (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, rect); node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); }; return shapeSvg; }; var shapes = { question: question, rect: rect, rectWithTitle: rectWithTitle, choice: choice, circle: circle, doublecircle: doublecircle, stadium: stadium, hexagon: hexagon, rect_left_inv_arrow: rect_left_inv_arrow, lean_right: lean_right, lean_left: lean_left, trapezoid: trapezoid, inv_trapezoid: inv_trapezoid, rect_right_inv_arrow: rect_right_inv_arrow, cylinder: cylinder, start: start, end: end, note: _shapes_note__WEBPACK_IMPORTED_MODULE_8__["default"], subroutine: subroutine, fork: forkJoin, join: forkJoin, class_box: class_box }; var nodeElems = {}; var insertNode = function insertNode(elem, node, dir) { var newEl; var el; // Add link when appropriate if (node.link) { var target; if ((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().securityLevel === 'sandbox') { target = '_top'; } else if (node.linkTarget) { target = node.linkTarget || '_blank'; } newEl = elem.insert('svg:a').attr('xlink:href', node.link).attr('target', target); el = shapes[node.shape](newEl, node, dir); } else { el = shapes[node.shape](elem, node, dir); newEl = el; } if (node.tooltip) { el.attr('title', node.tooltip); } if (node.class) { el.attr('class', 'node default ' + node.class); } nodeElems[node.id] = newEl; if (node.haveCallback) { nodeElems[node.id].attr('class', nodeElems[node.id].attr('class') + ' clickable'); } }; var setNodeElem = function setNodeElem(elem, node) { nodeElems[node.id] = elem; }; var clear = function clear() { nodeElems = {}; }; var positionNode = function positionNode(node) { var el = nodeElems[node.id]; _logger__WEBPACK_IMPORTED_MODULE_4__.log.trace('Transforming node', node.diff, node, 'translate(' + (node.x - node.width / 2 - 5) + ', ' + node.width / 2 + ')'); var padding = 8; var diff = node.diff || 0; if (node.clusterNode) { el.attr('transform', 'translate(' + (node.x + diff - node.width / 2) + ', ' + (node.y - node.height / 2 - padding) + ')'); } else { el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')'); } return diff; }; /***/ }), /***/ "./src/dagre-wrapper/shapes/note.js": /*!******************************************!*\ !*** ./src/dagre-wrapper/shapes/note.js ***! \******************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./src/dagre-wrapper/shapes/util.js"); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); /* harmony import */ var _intersect_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../intersect/index.js */ "./src/dagre-wrapper/intersect/index.js"); // eslint-disable-line var note = function note(parent, node) { var _labelHelper = (0,_util__WEBPACK_IMPORTED_MODULE_0__.labelHelper)(parent, node, 'node ' + node.classes, true), shapeSvg = _labelHelper.shapeSvg, bbox = _labelHelper.bbox, halfPadding = _labelHelper.halfPadding; _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Classes = ', node.classes); // add the rect var rect = shapeSvg.insert('rect', ':first-child'); rect.attr('rx', node.rx).attr('ry', node.ry).attr('x', -bbox.width / 2 - halfPadding).attr('y', -bbox.height / 2 - halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding); (0,_util__WEBPACK_IMPORTED_MODULE_0__.updateNodeBounds)(node, rect); node.intersect = function (point) { return _intersect_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].rect(node, point); }; return shapeSvg; }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (note); /***/ }), /***/ "./src/dagre-wrapper/shapes/util.js": /*!******************************************!*\ !*** ./src/dagre-wrapper/shapes/util.js ***! \******************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "insertPolygonShape": () => (/* binding */ insertPolygonShape), /* harmony export */ "labelHelper": () => (/* binding */ labelHelper), /* harmony export */ "updateNodeBounds": () => (/* binding */ updateNodeBounds) /* harmony export */ }); /* harmony import */ var _createLabel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../createLabel */ "./src/dagre-wrapper/createLabel.js"); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js"); /* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../diagrams/common/common */ "./src/diagrams/common/common.js"); var labelHelper = function labelHelper(parent, node, _classes, isNode) { var classes; if (!_classes) { classes = 'node default'; } else { classes = _classes; } // Add outer g element var shapeSvg = parent.insert('g').attr('class', classes).attr('id', node.domId || node.id); // Create the label and insert it after the rect var label = shapeSvg.insert('g').attr('class', 'label').attr('style', node.labelStyle); var labelText = typeof node.labelText === 'string' ? node.labelText : node.labelText[0]; var text = label.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__.sanitizeText)((0,_mermaidAPI__WEBPACK_IMPORTED_MODULE_3__.decodeEntities)(labelText), (0,_config__WEBPACK_IMPORTED_MODULE_4__.getConfig)()), node.labelStyle, false, isNode)); // Get the size of the label var bbox = text.getBBox(); if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_4__.getConfig)().flowchart.htmlLabels)) { var div = text.children[0]; var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text); bbox = div.getBoundingClientRect(); dv.attr('width', bbox.width); dv.attr('height', bbox.height); } var halfPadding = node.padding / 2; // Center the label label.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + -bbox.height / 2 + ')'); return { shapeSvg: shapeSvg, bbox: bbox, halfPadding: halfPadding, label: label }; }; var updateNodeBounds = function updateNodeBounds(node, element) { var bbox = element.node().getBBox(); node.width = bbox.width; node.height = bbox.height; }; /** * @param parent * @param w * @param h * @param points */ function insertPolygonShape(parent, w, h, points) { return parent.insert('polygon', ':first-child').attr('points', points.map(function (d) { return d.x + ',' + d.y; }).join(' ')).attr('class', 'label-container').attr('transform', 'translate(' + -w / 2 + ',' + h / 2 + ')'); } /***/ }), /***/ "./src/defaultConfig.js": /*!******************************!*\ !*** ./src/defaultConfig.js ***! \******************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "configKeys": () => (/* binding */ configKeys), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./themes */ "./src/themes/index.js"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } /** * **Configuration methods in Mermaid version 8.6.0 have been updated, to learn more[[click * here](8.6.0_docs.md)].** * * ## **What follows are config instructions for older versions** * * These are the default options which can be overridden with the initialization call like so: * * **Example 1:**
 mermaid.initialize({ flowchart:{ htmlLabels: false } }); 
* * **Example 2:**
  
* * A summary of all options and their defaults is found [here](#mermaidapi-configuration-defaults). * A description of each option follows below. * * @name Configuration */ var config = { /** * Theme , the CSS style sheet * * | Parameter | Description | Type | Required | Values | * | --------- | --------------- | ------ | -------- | ---------------------------------------------- | * | theme | Built in Themes | string | Optional | 'default', 'forest', 'dark', 'neutral', 'null' | * * **Notes:** To disable any pre-defined mermaid theme, use "null".
 "theme": "forest",
   * "themeCSS": ".node rect { fill: red; }" 
*/ theme: 'default', themeVariables: _themes__WEBPACK_IMPORTED_MODULE_0__["default"]["default"].getThemeVariables(), themeCSS: undefined, /* **maxTextSize** - The maximum allowed size of the users text diagram */ maxTextSize: 50000, darkMode: false, /** * | Parameter | Description | Type | Required | Values | * | ---------- | ------------------------------------------------------ | ------ | -------- | --------------------------- | * | fontFamily | specifies the font to be used in the rendered diagrams | string | Required | Any Possible CSS FontFamily | * * **Notes:** Default value: '"trebuchet ms", verdana, arial, sans-serif;'. */ fontFamily: '"trebuchet ms", verdana, arial, sans-serif;', /** * | Parameter | Description | Type | Required | Values | * | --------- | ----------------------------------------------------- | ---------------- | -------- | ------------- | * | logLevel | This option decides the amount of logging to be used. | string \| number | Required | 1, 2, 3, 4, 5 | * * **Notes:** * * - Debug: 1 * - Info: 2 * - Warn: 3 * - Error: 4 * - Fatal: 5 (default) */ logLevel: 5, /** * | Parameter | Description | Type | Required | Values | * | ------------- | --------------------------------- | ------ | -------- | ------------------------------- | * | securitylevel | Level of trust for parsed diagram | string | Required | 'strict', 'loose', 'antiscript' | * * **Notes**: * * - **strict**: (**default**) tags in text are encoded, click functionality is disabled * - **loose**: tags in text are allowed, click functionality is enabled * - **antiscript**: html tags in text are allowed, (only script element is removed), click * functionality is enabled */ securityLevel: 'strict', /** * | Parameter | Description | Type | Required | Values | * | ----------- | -------------------------------------------- | ------- | -------- | ----------- | * | startOnLoad | Dictates whether mermaid starts on Page load | boolean | Required | true, false | * * **Notes:** Default value: true */ startOnLoad: true, /** * | Parameter | Description | Type | Required | Values | * | ------------------- | ---------------------------------------------------------------------------- | ------- | -------- | ----------- | * | arrowMarkerAbsolute | Controls whether or arrow markers in html code are absolute paths or anchors | boolean | Required | true, false | * * **Notes**: * * This matters if you are using base tag settings. * * Default value: false */ arrowMarkerAbsolute: false, /** * This option controls which currentConfig keys are considered _secure_ and can only be changed * via call to mermaidAPI.initialize. Calls to mermaidAPI.reinitialize cannot make changes to the * `secure` keys in the current currentConfig. This prevents malicious graph directives from * overriding a site's default security. * * **Notes**: * * Default value: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'] */ secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'], /** * This option controls if the generated ids of nodes in the SVG are generated randomly or based * on a seed. If set to false, the IDs are generated based on the current date and thus are not * deterministic. This is the default behaviour. * * **Notes**: * * This matters if your files are checked into sourcecontrol e.g. git and should not change unless * content is changed. * * Default value: false */ deterministicIds: false, /** * This option is the optional seed for deterministic ids. if set to undefined but * deterministicIds is true, a simple number iterator is used. You can set this attribute to base * the seed on a static string. */ deterministicIDSeed: undefined, /** The object containing configurations specific for flowcharts */ flowchart: { /** * | Parameter | Description | Type | Required | Values | * | -------------- | ----------------------------------------------- | ------- | -------- | ------------------ | * | diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value | * * **Notes:** * * The amount of padding around the diagram as a whole so that embedded diagrams have margins, * expressed in pixels * * Default value: 8 */ diagramPadding: 8, /** * | Parameter | Description | Type | Required | Values | * | ---------- | -------------------------------------------------------------------------------------------- | ------- | -------- | ----------- | * | htmlLabels | Flag for setting whether or not a html tag should be used for rendering labels on the edges. | boolean | Required | true, false | * * **Notes:** Default value: true. */ htmlLabels: true, /** * | Parameter | Description | Type | Required | Values | * | ----------- | --------------------------------------------------- | ------- | -------- | ------------------- | * | nodeSpacing | Defines the spacing between nodes on the same level | Integer | Required | Any positive Number | * * **Notes:** * * Pertains to horizontal spacing for TB (top to bottom) or BT (bottom to top) graphs, and the * vertical spacing for LR as well as RL graphs.** * * Default value: 50 */ nodeSpacing: 50, /** * | Parameter | Description | Type | Required | Values | * | ----------- | ----------------------------------------------------- | ------- | -------- | ------------------- | * | rankSpacing | Defines the spacing between nodes on different levels | Integer | Required | Any Positive Number | * * **Notes**: * * Pertains to vertical spacing for TB (top to bottom) or BT (bottom to top), and the horizontal * spacing for LR as well as RL graphs. * * Default value 50 */ rankSpacing: 50, /** * | Parameter | Description | Type | Required | Values | * | --------- | -------------------------------------------------- | ------ | -------- | ----------------------------- | * | curve | Defines how mermaid renders curves for flowcharts. | string | Required | 'basis', 'linear', 'cardinal' | * * **Notes:** * * Default Value: 'basis' */ curve: 'basis', // Only used in new experimental rendering // represents the padding between the labels and the shape padding: 15, /** * | Parameter | Description | Type | Required | Values | * | ----------- | ----------- | ------- | -------- | ----------- | * | useMaxWidth | See notes | boolean | 4 | true, false | * * **Notes:** * * When this flag is set the height and width is set to 100% and is then scaling with the * available space if not the absolute space required is used. * * Default value: true */ useMaxWidth: true, /** * | Parameter | Description | Type | Required | Values | * | --------------- | ----------- | ------- | -------- | ----------------------- | * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper | * * **Notes:** * * Decides which rendering engine that is to be used for the rendering. Legal values are: * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid * * Default value: 'dagre-d3' */ defaultRenderer: 'dagre-d3' }, /** The object containing configurations specific for sequence diagrams */ sequence: { hideUnusedParticipants: false, /** * | Parameter | Description | Type | Required | Values | * | --------------- | ---------------------------- | ------- | -------- | ------------------ | * | activationWidth | Width of the activation rect | Integer | Required | Any Positive Value | * * **Notes:** Default value :10 */ activationWidth: 10, /** * | Parameter | Description | Type | Required | Values | * | -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ | * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value | * * **Notes:** Default value: 50 */ diagramMarginX: 50, /** * | Parameter | Description | Type | Required | Values | * | -------------- | ------------------------------------------------- | ------- | -------- | ------------------ | * | diagramMarginY | Margin to the over and under the sequence diagram | Integer | Required | Any Positive Value | * * **Notes:** Default value: 10 */ diagramMarginY: 10, /** * | Parameter | Description | Type | Required | Values | * | ----------- | --------------------- | ------- | -------- | ------------------ | * | actorMargin | Margin between actors | Integer | Required | Any Positive Value | * * **Notes:** Default value: 50 */ actorMargin: 50, /** * | Parameter | Description | Type | Required | Values | * | --------- | -------------------- | ------- | -------- | ------------------ | * | width | Width of actor boxes | Integer | Required | Any Positive Value | * * **Notes:** Default value: 150 */ width: 150, /** * | Parameter | Description | Type | Required | Values | * | --------- | --------------------- | ------- | -------- | ------------------ | * | height | Height of actor boxes | Integer | Required | Any Positive Value | * * **Notes:** Default value: 65 */ height: 65, /** * | Parameter | Description | Type | Required | Values | * | --------- | ------------------------ | ------- | -------- | ------------------ | * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value | * * **Notes:** Default value: 10 */ boxMargin: 10, /** * | Parameter | Description | Type | Required | Values | * | ------------- | -------------------------------------------- | ------- | -------- | ------------------ | * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value | * * **Notes:** Default value: 5 */ boxTextMargin: 5, /** * | Parameter | Description | Type | Required | Values | * | ---------- | ------------------- | ------- | -------- | ------------------ | * | noteMargin | margin around notes | Integer | Required | Any Positive Value | * * **Notes:** Default value: 10 */ noteMargin: 10, /** * | Parameter | Description | Type | Required | Values | * | ------------- | ---------------------- | ------- | -------- | ------------------ | * | messageMargin | Space between messages | Integer | Required | Any Positive Value | * * **Notes:** Default value: 35 */ messageMargin: 35, /** * | Parameter | Description | Type | Required | Values | * | ------------ | --------------------------- | ------ | -------- | ------------------------- | * | messageAlign | Multiline message alignment | string | Required | 'left', 'center', 'right' | * * **Notes:** Default value: 'center' */ messageAlign: 'center', /** * | Parameter | Description | Type | Required | Values | * | ------------ | --------------------------- | ------- | -------- | ----------- | * | mirrorActors | Mirror actors under diagram | boolean | Required | true, false | * * **Notes:** Default value: true */ mirrorActors: true, /** * | Parameter | Description | Type | Required | Values | * | ---------- | ----------------------------------------------------------------------- | ------- | -------- | ----------- | * | forceMenus | forces actor popup menus to always be visible (to support E2E testing). | Boolean | Required | True, False | * * **Notes:** * * Default value: false. */ forceMenus: false, /** * | Parameter | Description | Type | Required | Values | * | --------------- | ------------------------------------------ | ------- | -------- | ------------------ | * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | Required | Any Positive Value | * * **Notes:** * * Depending on css styling this might need adjustment. * * Default value: 1 */ bottomMarginAdj: 1, /** * | Parameter | Description | Type | Required | Values | * | ----------- | ----------- | ------- | -------- | ----------- | * | useMaxWidth | See Notes | boolean | Required | true, false | * * **Notes:** When this flag is set to true, the height and width is set to 100% and is then * scaling with the available space. If set to false, the absolute space required is used. * * Default value: true */ useMaxWidth: true, /** * | Parameter | Description | Type | Required | Values | * | ----------- | ------------------------------------ | ------- | -------- | ----------- | * | rightAngles | display curve arrows as right angles | boolean | Required | true, false | * * **Notes:** * * This will display arrows that start and begin at the same node as right angles, rather than a curve * * Default value: false */ rightAngles: false, /** * | Parameter | Description | Type | Required | Values | * | ------------------- | ------------------------------- | ------- | -------- | ----------- | * | showSequenceNumbers | This will show the node numbers | boolean | Required | true, false | * * **Notes:** Default value: false */ showSequenceNumbers: false, /** * | Parameter | Description | Type | Required | Values | * | ------------- | -------------------------------------------------- | ------- | -------- | ------------------ | * | actorFontSize | This sets the font size of the actor's description | Integer | Require | Any Positive Value | * * **Notes:** **Default value 14**.. */ actorFontSize: 14, /** * | Parameter | Description | Type | Required | Values | * | --------------- | ---------------------------------------------------- | ------ | -------- | --------------------------- | * | actorFontFamily | This sets the font family of the actor's description | string | Required | Any Possible CSS FontFamily | * * **Notes:** Default value: "'Open Sans", sans-serif' */ actorFontFamily: '"Open Sans", sans-serif', /** * This sets the font weight of the actor's description * * **Notes:** Default value: 400. */ actorFontWeight: 400, /** * | Parameter | Description | Type | Required | Values | * | ------------ | ----------------------------------------------- | ------- | -------- | ------------------ | * | noteFontSize | This sets the font size of actor-attached notes | Integer | Required | Any Positive Value | * * **Notes:** Default value: 14 */ noteFontSize: 14, /** * | Parameter | Description | Type | Required | Values | * | -------------- | -------------------------------------------------- | ------ | -------- | --------------------------- | * | noteFontFamily | This sets the font family of actor-attached notes. | string | Required | Any Possible CSS FontFamily | * * **Notes:** Default value: ''"trebuchet ms", verdana, arial, sans-serif' */ noteFontFamily: '"trebuchet ms", verdana, arial, sans-serif', /** * This sets the font weight of the note's description * * **Notes:** Default value: 400 */ noteFontWeight: 400, /** * | Parameter | Description | Type | Required | Values | * | --------- | ---------------------------------------------------- | ------ | -------- | ------------------------- | * | noteAlign | This sets the text alignment of actor-attached notes | string | required | 'left', 'center', 'right' | * * **Notes:** Default value: 'center' */ noteAlign: 'center', /** * | Parameter | Description | Type | Required | Values | * | --------------- | ----------------------------------------- | ------- | -------- | ------------------- | * | messageFontSize | This sets the font size of actor messages | Integer | Required | Any Positive Number | * * **Notes:** Default value: 16 */ messageFontSize: 16, /** * | Parameter | Description | Type | Required | Values | * | ----------------- | ------------------------------------------- | ------ | -------- | --------------------------- | * | messageFontFamily | This sets the font family of actor messages | string | Required | Any Possible CSS FontFamily | * * **Notes:** Default value: '"trebuchet ms", verdana, arial, sans-serif' */ messageFontFamily: '"trebuchet ms", verdana, arial, sans-serif', /** * This sets the font weight of the message's description * * **Notes:** Default value: 400. */ messageFontWeight: 400, /** * This sets the auto-wrap state for the diagram * * **Notes:** Default value: false. */ wrap: false, /** * This sets the auto-wrap padding for the diagram (sides only) * * **Notes:** Default value: 0. */ wrapPadding: 10, /** * This sets the width of the loop-box (loop, alt, opt, par) * * **Notes:** Default value: 50. */ labelBoxWidth: 50, /** * This sets the height of the loop-box (loop, alt, opt, par) * * **Notes:** Default value: 20. */ labelBoxHeight: 20, messageFont: function messageFont() { return { fontFamily: this.messageFontFamily, fontSize: this.messageFontSize, fontWeight: this.messageFontWeight }; }, noteFont: function noteFont() { return { fontFamily: this.noteFontFamily, fontSize: this.noteFontSize, fontWeight: this.noteFontWeight }; }, actorFont: function actorFont() { return { fontFamily: this.actorFontFamily, fontSize: this.actorFontSize, fontWeight: this.actorFontWeight }; } }, /** The object containing configurations specific for gantt diagrams */ gantt: { /** * ### titleTopMargin * * | Parameter | Description | Type | Required | Values | * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | * | titleTopMargin | Margin top for the text over the gantt diagram | Integer | Required | Any Positive Value | * * **Notes:** Default value: 25 */ titleTopMargin: 25, /** * | Parameter | Description | Type | Required | Values | * | --------- | ----------------------------------- | ------- | -------- | ------------------ | * | barHeight | The height of the bars in the graph | Integer | Required | Any Positive Value | * * **Notes:** Default value: 20 */ barHeight: 20, /** * | Parameter | Description | Type | Required | Values | * | --------- | ---------------------------------------------------------------- | ------- | -------- | ------------------ | * | barGap | The margin between the different activities in the gantt diagram | Integer | Optional | Any Positive Value | * * **Notes:** Default value: 4 */ barGap: 4, /** * | Parameter | Description | Type | Required | Values | * | ---------- | -------------------------------------------------------------------------- | ------- | -------- | ------------------ | * | topPadding | Margin between title and gantt diagram and between axis and gantt diagram. | Integer | Required | Any Positive Value | * * **Notes:** Default value: 50 */ topPadding: 50, /** * | Parameter | Description | Type | Required | Values | * | ------------ | ----------------------------------------------------------------------- | ------- | -------- | ------------------ | * | rightPadding | The space allocated for the section name to the right of the activities | Integer | Required | Any Positive Value | * * **Notes:** Default value: 75 */ rightPadding: 75, /** * | Parameter | Description | Type | Required | Values | * | ----------- | ---------------------------------------------------------------------- | ------- | -------- | ------------------ | * | leftPadding | The space allocated for the section name to the left of the activities | Integer | Required | Any Positive Value | * * **Notes:** Default value: 75 */ leftPadding: 75, /** * | Parameter | Description | Type | Required | Values | * | -------------------- | -------------------------------------------- | ------- | -------- | ------------------ | * | gridLineStartPadding | Vertical starting position of the grid lines | Integer | Required | Any Positive Value | * * **Notes:** Default value: 35 */ gridLineStartPadding: 35, /** * | Parameter | Description | Type | Required | Values | * | --------- | ----------- | ------- | -------- | ------------------ | * | fontSize | Font size | Integer | Required | Any Positive Value | * * **Notes:** Default value: 11 */ fontSize: 11, /** * | Parameter | Description | Type | Required | Values | * | --------------- | ---------------------- | ------- | -------- | ------------------ | * | sectionFontSize | Font size for sections | Integer | Required | Any Positive Value | * * **Notes:** Default value: 11 */ sectionFontSize: 11, /** * | Parameter | Description | Type | Required | Values | * | ------------------- | ---------------------------------------- | ------- | -------- | ------------------ | * | numberSectionStyles | The number of alternating section styles | Integer | 4 | Any Positive Value | * * **Notes:** Default value: 4 */ numberSectionStyles: 4, /** * | Parameter | Description | Type | Required | Values | * | ---------- | --------------------------- | ---- | -------- | ---------------- | * | axisFormat | Datetime format of the axis | 3 | Required | Date in yy-mm-dd | * * **Notes:** * * This might need adjustment to match your locale and preferences * * Default value: '%Y-%m-%d'. */ axisFormat: '%Y-%m-%d', /** * | Parameter | Description | Type | Required | Values | * | ----------- | ----------- | ------- | -------- | ----------- | * | useMaxWidth | See notes | boolean | 4 | true, false | * * **Notes:** * * When this flag is set the height and width is set to 100% and is then scaling with the * available space if not the absolute space required is used. * * Default value: true */ useMaxWidth: true, /** * | Parameter | Description | Type | Required | Values | * | --------- | ----------- | ------- | -------- | ----------- | * | topAxis | See notes | Boolean | 4 | True, False | * * **Notes:** when this flag is set date labels will be added to the top of the chart * * **Default value false**. */ topAxis: false, useWidth: undefined }, /** The object containing configurations specific for journey diagrams */ journey: { /** * | Parameter | Description | Type | Required | Values | * | -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ | * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value | * * **Notes:** Default value: 50 */ diagramMarginX: 50, /** * | Parameter | Description | Type | Required | Values | * | -------------- | -------------------------------------------------- | ------- | -------- | ------------------ | * | diagramMarginY | Margin to the over and under the sequence diagram. | Integer | Required | Any Positive Value | * * **Notes:** Default value: 10 */ diagramMarginY: 10, /** * | Parameter | Description | Type | Required | Values | * | ----------- | --------------------- | ------- | -------- | ------------------ | * | actorMargin | Margin between actors | Integer | Required | Any Positive Value | * * **Notes:** Default value: 50 */ leftMargin: 150, /** * | Parameter | Description | Type | Required | Values | * | --------- | -------------------- | ------- | -------- | ------------------ | * | width | Width of actor boxes | Integer | Required | Any Positive Value | * * **Notes:** Default value: 150 */ width: 150, /** * | Parameter | Description | Type | Required | Values | * | --------- | --------------------- | ------- | -------- | ------------------ | * | height | Height of actor boxes | Integer | Required | Any Positive Value | * * **Notes:** Default value: 65 */ height: 50, /** * | Parameter | Description | Type | Required | Values | * | --------- | ------------------------ | ------- | -------- | ------------------ | * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value | * * **Notes:** Default value: 10 */ boxMargin: 10, /** * | Parameter | Description | Type | Required | Values | * | ------------- | -------------------------------------------- | ------- | -------- | ------------------ | * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value | * * **Notes:** Default value: 5 */ boxTextMargin: 5, /** * | Parameter | Description | Type | Required | Values | * | ---------- | ------------------- | ------- | -------- | ------------------ | * | noteMargin | Margin around notes | Integer | Required | Any Positive Value | * * **Notes:** Default value: 10 */ noteMargin: 10, /** * | Parameter | Description | Type | Required | Values | * | ------------- | ----------------------- | ------- | -------- | ------------------ | * | messageMargin | Space between messages. | Integer | Required | Any Positive Value | * * **Notes:** * * Space between messages. * * Default value: 35 */ messageMargin: 35, /** * | Parameter | Description | Type | Required | Values | * | ------------ | --------------------------- | ---- | -------- | ------------------------- | * | messageAlign | Multiline message alignment | 3 | 4 | 'left', 'center', 'right' | * * **Notes:** Default value: 'center' */ messageAlign: 'center', /** * | Parameter | Description | Type | Required | Values | * | --------------- | ------------------------------------------ | ------- | -------- | ------------------ | * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | 4 | Any Positive Value | * * **Notes:** * * Depending on css styling this might need adjustment. * * Default value: 1 */ bottomMarginAdj: 1, /** * | Parameter | Description | Type | Required | Values | * | ----------- | ----------- | ------- | -------- | ----------- | * | useMaxWidth | See notes | boolean | 4 | true, false | * * **Notes:** * * When this flag is set the height and width is set to 100% and is then scaling with the * available space if not the absolute space required is used. * * Default value: true */ useMaxWidth: true, /** * | Parameter | Description | Type | Required | Values | * | ----------- | --------------------------------- | ---- | -------- | ----------- | * | rightAngles | Curved Arrows become Right Angles | 3 | 4 | true, false | * * **Notes:** * * This will display arrows that start and begin at the same node as right angles, rather than a curves * * Default value: false */ rightAngles: false, taskFontSize: 14, taskFontFamily: '"Open Sans", sans-serif', taskMargin: 50, // width of activation box activationWidth: 10, // text placement as: tspan | fo | old only text as before textPlacement: 'fo', actorColours: ['#8FBC8F', '#7CFC00', '#00FFFF', '#20B2AA', '#B0E0E6', '#FFFFE0'], sectionFills: ['#191970', '#8B008B', '#4B0082', '#2F4F4F', '#800000', '#8B4513', '#00008B'], sectionColours: ['#fff'] }, class: { arrowMarkerAbsolute: false, /** * | Parameter | Description | Type | Required | Values | * | ----------- | ----------- | ------- | -------- | ----------- | * | useMaxWidth | See notes | boolean | 4 | true, false | * * **Notes:** * * When this flag is set the height and width is set to 100% and is then scaling with the * available space if not the absolute space required is used. * * Default value: true */ useMaxWidth: true, /** * | Parameter | Description | Type | Required | Values | * | --------------- | ----------- | ------- | -------- | ----------------------- | * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper | * * **Notes**: * * Decides which rendering engine that is to be used for the rendering. Legal values are: * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid * * Default value: 'dagre-d3' */ defaultRenderer: 'dagre-wrapper' }, state: { dividerMargin: 10, sizeUnit: 5, padding: 8, textHeight: 10, titleShift: -15, noteMargin: 10, forkWidth: 70, forkHeight: 7, // Used miniPadding: 2, // Font size factor, this is used to guess the width of the edges labels before rendering by dagre // layout. This might need updating if/when switching font fontSizeFactor: 5.02, fontSize: 24, labelHeight: 16, edgeLengthFactor: '20', compositTitleSize: 35, radius: 5, /** * | Parameter | Description | Type | Required | Values | * | ----------- | ----------- | ------- | -------- | ----------- | * | useMaxWidth | See notes | boolean | 4 | true, false | * * **Notes:** * * When this flag is set the height and width is set to 100% and is then scaling with the * available space if not the absolute space required is used. * * Default value: true */ useMaxWidth: true, /** * | Parameter | Description | Type | Required | Values | * | --------------- | ----------- | ------- | -------- | ----------------------- | * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper | * * **Notes:** * * Decides which rendering engine that is to be used for the rendering. Legal values are: * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid * * Default value: 'dagre-d3' */ defaultRenderer: 'dagre-wrapper' }, /** The object containing configurations specific for entity relationship diagrams */ er: { /** * | Parameter | Description | Type | Required | Values | * | -------------- | ----------------------------------------------- | ------- | -------- | ------------------ | * | diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value | * * **Notes:** * * The amount of padding around the diagram as a whole so that embedded diagrams have margins, * expressed in pixels * * Default value: 20 */ diagramPadding: 20, /** * | Parameter | Description | Type | Required | Values | * | --------------- | ---------------------------------------- | ------ | -------- | ---------------------- | * | layoutDirection | Directional bias for layout of entities. | string | Required | "TB", "BT", "LR", "RL" | * * **Notes:** * * 'TB' for Top-Bottom, 'BT'for Bottom-Top, 'LR' for Left-Right, or 'RL' for Right to Left. * * T = top, B = bottom, L = left, and R = right. * * Default value: 'TB' */ layoutDirection: 'TB', /** * | Parameter | Description | Type | Required | Values | * | -------------- | ---------------------------------- | ------- | -------- | ------------------ | * | minEntityWidth | The minimum width of an entity box | Integer | Required | Any Positive Value | * * **Notes:** Expressed in pixels. Default value: 100 */ minEntityWidth: 100, /** * | Parameter | Description | Type | Required | Values | * | --------------- | ----------------------------------- | ------- | -------- | ------------------ | * | minEntityHeight | The minimum height of an entity box | Integer | 4 | Any Positive Value | * * **Notes:** Expressed in pixels Default value: 75 */ minEntityHeight: 75, /** * | Parameter | Description | Type | Required | Values | * | ------------- | ----------------------------------------------------------- | ------- | -------- | ------------------ | * | entityPadding | Minimum internal padding betweentext in box and box borders | Integer | 4 | Any Positive Value | * * **Notes:** * * The minimum internal padding betweentext in an entity box and the enclosing box borders, * expressed in pixels. * * Default value: 15 */ entityPadding: 15, /** * | Parameter | Description | Type | Required | Values | * | --------- | ----------------------------------- | ------ | -------- | -------------------- | * | stroke | Stroke color of box edges and lines | string | 4 | Any recognized color | * * **Notes:** Default value: 'gray' */ stroke: 'gray', /** * | Parameter | Description | Type | Required | Values | * | --------- | -------------------------- | ------ | -------- | -------------------- | * | fill | Fill color of entity boxes | string | 4 | Any recognized color | * * **Notes:** Default value: 'honeydew' */ fill: 'honeydew', /** * | Parameter | Description | Type | Required | Values | * | --------- | ------------------- | ------- | -------- | ------------------ | * | fontSize | Font Size in pixels | Integer | | Any Positive Value | * * **Notes:** * * Font size (expressed as an integer representing a number of pixels) Default value: 12 */ fontSize: 12, /** * | Parameter | Description | Type | Required | Values | * | ----------- | ----------- | ------- | -------- | ----------- | * | useMaxWidth | See Notes | boolean | Required | true, false | * * **Notes:** * * When this flag is set to true, the diagram width is locked to 100% and scaled based on * available space. If set to false, the diagram reserves its absolute width. * * Default value: true */ useMaxWidth: true }, /** The object containing configurations specific for pie diagrams */ pie: { useWidth: undefined, /** * | Parameter | Description | Type | Required | Values | * | ----------- | ----------- | ------- | -------- | ----------- | * | useMaxWidth | See Notes | boolean | Required | true, false | * * **Notes:** * * When this flag is set to true, the diagram width is locked to 100% and scaled based on * available space. If set to false, the diagram reserves its absolute width. * * Default value: true */ useMaxWidth: true }, /** The object containing configurations specific for req diagrams */ requirement: { useWidth: undefined, /** * | Parameter | Description | Type | Required | Values | * | ----------- | ----------- | ------- | -------- | ----------- | * | useMaxWidth | See Notes | boolean | Required | true, false | * * **Notes:** * * When this flag is set to true, the diagram width is locked to 100% and scaled based on * available space. If set to false, the diagram reserves its absolute width. * * Default value: true */ useMaxWidth: true, rect_fill: '#f9f9f9', text_color: '#333', rect_border_size: '0.5px', rect_border_color: '#bbb', rect_min_width: 200, rect_min_height: 200, fontSize: 14, rect_padding: 10, line_height: 20 }, gitGraph: { diagramPadding: 8, nodeLabel: { width: 75, height: 100, x: -25, y: 0 }, mainBranchName: 'main', showCommitLabel: true, showBranches: true } }; config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute; config.gitGraph.arrowMarkerAbsolute = config.arrowMarkerAbsolute; var keyify = function keyify(obj) { var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; return Object.keys(obj).reduce(function (res, el) { if (Array.isArray(obj[el])) { return res; } else if (_typeof(obj[el]) === 'object' && obj[el] !== null) { return [].concat(_toConsumableArray(res), [prefix + el], _toConsumableArray(keyify(obj[el], ''))); } return [].concat(_toConsumableArray(res), [prefix + el]); }, []); }; var configKeys = keyify(config, ''); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (config); /***/ }), /***/ "./src/diagrams/class/classDb.js": /*!***************************************!*\ !*** ./src/diagrams/class/classDb.js ***! \***************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "addAnnotation": () => (/* binding */ addAnnotation), /* harmony export */ "addClass": () => (/* binding */ addClass), /* harmony export */ "addMember": () => (/* binding */ addMember), /* harmony export */ "addMembers": () => (/* binding */ addMembers), /* harmony export */ "addRelation": () => (/* binding */ addRelation), /* harmony export */ "bindFunctions": () => (/* binding */ bindFunctions), /* harmony export */ "cleanupLabel": () => (/* binding */ cleanupLabel), /* harmony export */ "clear": () => (/* binding */ clear), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ "getAccDescription": () => (/* binding */ getAccDescription), /* harmony export */ "getClass": () => (/* binding */ getClass), /* harmony export */ "getClasses": () => (/* binding */ getClasses), /* harmony export */ "getRelations": () => (/* binding */ getRelations), /* harmony export */ "getTitle": () => (/* binding */ getTitle), /* harmony export */ "lineType": () => (/* binding */ lineType), /* harmony export */ "lookUpDomId": () => (/* binding */ lookUpDomId), /* harmony export */ "parseDirective": () => (/* binding */ parseDirective), /* harmony export */ "relationType": () => (/* binding */ relationType), /* harmony export */ "setAccDescription": () => (/* binding */ setAccDescription), /* harmony export */ "setClickEvent": () => (/* binding */ setClickEvent), /* harmony export */ "setCssClass": () => (/* binding */ setCssClass), /* harmony export */ "setLink": () => (/* binding */ setLink), /* harmony export */ "setTitle": () => (/* binding */ setTitle) /* harmony export */ }); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../config */ "./src/config.js"); /* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); /* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } var MERMAID_DOM_ID_PREFIX = 'classid-'; var relations = []; var classes = {}; var classCounter = 0; var funs = []; var sanitizeText = function sanitizeText(txt) { return _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(txt, _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); }; var parseDirective = function parseDirective(statement, context, type) { _mermaidAPI__WEBPACK_IMPORTED_MODULE_3__["default"].parseDirective(this, statement, context, type); }; var splitClassNameAndType = function splitClassNameAndType(id) { var genericType = ''; var className = id; if (id.indexOf('~') > 0) { var split = id.split('~'); className = split[0]; genericType = _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(split[1], _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); } return { className: className, type: genericType }; }; /** * Function called by parser when a node definition has been found. * * @param id * @public */ var addClass = function addClass(id) { var classId = splitClassNameAndType(id); // Only add class if not exists if (typeof classes[classId.className] !== 'undefined') return; classes[classId.className] = { id: classId.className, type: classId.type, cssClasses: [], methods: [], members: [], annotations: [], domId: MERMAID_DOM_ID_PREFIX + classId.className + '-' + classCounter }; classCounter++; }; /** * Function to lookup domId from id in the graph definition. * * @param id * @public */ var lookUpDomId = function lookUpDomId(id) { var classKeys = Object.keys(classes); for (var i = 0; i < classKeys.length; i++) { if (classes[classKeys[i]].id === id) { return classes[classKeys[i]].domId; } } }; var clear = function clear() { relations = []; classes = {}; funs = []; funs.push(setupToolTips); }; var getClass = function getClass(id) { return classes[id]; }; var getClasses = function getClasses() { return classes; }; var getRelations = function getRelations() { return relations; }; var addRelation = function addRelation(relation) { _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('Adding relation: ' + JSON.stringify(relation)); addClass(relation.id1); addClass(relation.id2); relation.id1 = splitClassNameAndType(relation.id1).className; relation.id2 = splitClassNameAndType(relation.id2).className; relation.relationTitle1 = _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(relation.relationTitle1.trim(), _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); relation.relationTitle2 = _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(relation.relationTitle2.trim(), _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); relations.push(relation); }; /** * Adds an annotation to the specified class Annotations mark special properties of the given type * (like 'interface' or 'service') * * @param className The class name * @param annotation The name of the annotation without any brackets * @public */ var addAnnotation = function addAnnotation(className, annotation) { var validatedClassName = splitClassNameAndType(className).className; classes[validatedClassName].annotations.push(annotation); }; /** * Adds a member to the specified class * * @param className The class name * @param member The full name of the member. If the member is enclosed in <> it is * treated as an annotation If the member is ending with a closing bracket ) it is treated as a * method Otherwise the member will be treated as a normal property * @public */ var addMember = function addMember(className, member) { var validatedClassName = splitClassNameAndType(className).className; var theClass = classes[validatedClassName]; if (typeof member === 'string') { // Member can contain white spaces, we trim them out var memberString = member.trim(); if (memberString.startsWith('<<') && memberString.endsWith('>>')) { // Remove leading and trailing brackets // theClass.annotations.push(memberString.substring(2, memberString.length - 2)); theClass.annotations.push(sanitizeText(memberString.substring(2, memberString.length - 2))); } else if (memberString.indexOf(')') > 0) { theClass.methods.push(sanitizeText(memberString)); } else if (memberString) { theClass.members.push(sanitizeText(memberString)); } } }; var addMembers = function addMembers(className, members) { if (Array.isArray(members)) { members.reverse(); members.forEach(function (member) { return addMember(className, member); }); } }; var cleanupLabel = function cleanupLabel(label) { if (label.substring(0, 1) === ':') { return _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(label.substr(1).trim(), _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); } else { return sanitizeText(label.trim()); } }; /** * Called by parser when a special node is found, e.g. a clickable element. * * @param ids Comma separated list of ids * @param className Class to add */ var setCssClass = function setCssClass(ids, className) { ids.split(',').forEach(function (_id) { var id = _id; if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id; if (typeof classes[id] !== 'undefined') { classes[id].cssClasses.push(className); } }); }; /** * Called by parser when a tooltip is found, e.g. a clickable element. * * @param ids Comma separated list of ids * @param tooltip Tooltip to add */ var setTooltip = function setTooltip(ids, tooltip) { var config = _config__WEBPACK_IMPORTED_MODULE_2__.getConfig(); ids.split(',').forEach(function (id) { if (typeof tooltip !== 'undefined') { classes[id].tooltip = _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(tooltip, config); } }); }; /** * Called by parser when a link is found. Adds the URL to the vertex data. * * @param ids Comma separated list of ids * @param linkStr URL to create a link for * @param target Target of the link, _blank by default as originally defined in the svgDraw.js file */ var setLink = function setLink(ids, linkStr, target) { var config = _config__WEBPACK_IMPORTED_MODULE_2__.getConfig(); ids.split(',').forEach(function (_id) { var id = _id; if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id; if (typeof classes[id] !== 'undefined') { classes[id].link = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].formatUrl(linkStr, config); if (config.securityLevel === 'sandbox') { classes[id].linkTarget = '_top'; } else if (typeof target === 'string') { classes[id].linkTarget = sanitizeText(target); } else { classes[id].linkTarget = '_blank'; } } }); setCssClass(ids, 'clickable'); }; /** * Called by parser when a click definition is found. Registers an event handler. * * @param ids Comma separated list of ids * @param functionName Function to be called on click * @param functionArgs Function args the function should be called with */ var setClickEvent = function setClickEvent(ids, functionName, functionArgs) { ids.split(',').forEach(function (id) { setClickFunc(id, functionName, functionArgs); classes[id].haveCallback = true; }); setCssClass(ids, 'clickable'); }; var setClickFunc = function setClickFunc(domId, functionName, functionArgs) { var config = _config__WEBPACK_IMPORTED_MODULE_2__.getConfig(); var id = domId; var elemId = lookUpDomId(id); if (config.securityLevel !== 'loose') { return; } if (typeof functionName === 'undefined') { return; } if (typeof classes[id] !== 'undefined') { var argList = []; if (typeof functionArgs === 'string') { /* Splits functionArgs by ',', ignoring all ',' in double quoted strings */ argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); for (var i = 0; i < argList.length; i++) { var item = argList[i].trim(); /* Removes all double quotes at the start and end of an argument */ /* This preserves all starting and ending whitespace inside */ if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') { item = item.substr(1, item.length - 2); } argList[i] = item; } } /* if no arguments passed into callback, default to passing in id */ if (argList.length === 0) { argList.push(elemId); } funs.push(function () { var elem = document.querySelector("[id=\"".concat(elemId, "\"]")); if (elem !== null) { elem.addEventListener('click', function () { _utils__WEBPACK_IMPORTED_MODULE_5__["default"].runFunc.apply(_utils__WEBPACK_IMPORTED_MODULE_5__["default"], [functionName].concat(_toConsumableArray(argList))); }, false); } }); } }; var bindFunctions = function bindFunctions(element) { funs.forEach(function (fun) { fun(element); }); }; var lineType = { LINE: 0, DOTTED_LINE: 1 }; var relationType = { AGGREGATION: 0, EXTENSION: 1, COMPOSITION: 2, DEPENDENCY: 3 }; var setupToolTips = function setupToolTips(element) { var tooltipElem = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('.mermaidTooltip'); if ((tooltipElem._groups || tooltipElem)[0][0] === null) { tooltipElem = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('body').append('div').attr('class', 'mermaidTooltip').style('opacity', 0); } var svg = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(element).select('svg'); var nodes = svg.selectAll('g.node'); nodes.on('mouseover', function () { var el = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(this); var title = el.attr('title'); // Dont try to draw a tooltip if no data is provided if (title === null) { return; } var rect = this.getBoundingClientRect(); tooltipElem.transition().duration(200).style('opacity', '.9'); tooltipElem.text(el.attr('title')).style('left', window.scrollX + rect.left + (rect.right - rect.left) / 2 + 'px').style('top', window.scrollY + rect.top - 14 + document.body.scrollTop + 'px'); el.classed('hover', true); }).on('mouseout', function () { tooltipElem.transition().duration(500).style('opacity', 0); var el = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(this); el.classed('hover', false); }); }; funs.push(setupToolTips); var direction = 'TB'; var getDirection = function getDirection() { return direction; }; var setDirection = function setDirection(dir) { direction = dir; }; var title = ''; var setTitle = function setTitle(txt) { var sanitizedText = sanitizeText(txt, _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); title = sanitizedText; }; var getTitle = function getTitle() { return title; }; var accDescription = ''; var setAccDescription = function setAccDescription(txt) { var sanitizedText = sanitizeText(txt, _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); accDescription = sanitizedText; }; var getAccDescription = function getAccDescription() { return accDescription; }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ parseDirective: parseDirective, setTitle: setTitle, getTitle: getTitle, getAccDescription: getAccDescription, setAccDescription: setAccDescription, getConfig: function getConfig() { return _config__WEBPACK_IMPORTED_MODULE_2__.getConfig().class; }, addClass: addClass, bindFunctions: bindFunctions, clear: clear, getClass: getClass, getClasses: getClasses, addAnnotation: addAnnotation, getRelations: getRelations, addRelation: addRelation, getDirection: getDirection, setDirection: setDirection, addMember: addMember, addMembers: addMembers, cleanupLabel: cleanupLabel, lineType: lineType, relationType: relationType, setClickEvent: setClickEvent, setCssClass: setCssClass, setLink: setLink, setTooltip: setTooltip, lookUpDomId: lookUpDomId }); /***/ }), /***/ "./src/diagrams/class/classRenderer-v2.js": /*!************************************************!*\ !*** ./src/diagrams/class/classRenderer-v2.js ***! \************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "addClasses": () => (/* binding */ addClasses), /* harmony export */ "addRelations": () => (/* binding */ addRelations), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ "draw": () => (/* binding */ draw), /* harmony export */ "setConf": () => (/* binding */ setConf) /* harmony export */ }); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dagre */ "dagre"); /* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! graphlib */ "graphlib"); /* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); /* harmony import */ var _classDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./classDb */ "./src/diagrams/class/classDb.js"); /* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.jison"); /* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../config */ "./src/config.js"); /* harmony import */ var _dagre_wrapper_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../dagre-wrapper/index.js */ "./src/dagre-wrapper/index.js"); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); /* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); /* harmony import */ var _accessibility__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../accessibility */ "./src/accessibility.js"); // import addHtmlLabel from 'dagre-d3/lib/label/add-html-label.js'; _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.yy = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"]; var idCache = {}; var padding = 20; var sanitizeText = function sanitizeText(txt) { return _common_common__WEBPACK_IMPORTED_MODULE_5__["default"].sanitizeText(txt, (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)()); }; var conf = { dividerMargin: 10, padding: 5, textHeight: 10 }; /** * Function that adds the vertices found during parsing to the graph to be rendered. * * @param {Object< * string, * { cssClasses: string[]; text: string; id: string; type: string; domId: string } * >} classes * Object containing the vertices. * @param {SVGGElement} g The graph that is to be drawn. */ var addClasses = function addClasses(classes, g) { // const svg = select(`[id="${svgId}"]`); var keys = Object.keys(classes); _logger__WEBPACK_IMPORTED_MODULE_7__.log.info('keys:', keys); _logger__WEBPACK_IMPORTED_MODULE_7__.log.info(classes); // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition keys.forEach(function (id) { var vertex = classes[id]; /** * Variable for storing the classes for the vertex * * @type {string} */ var cssClassStr = ''; if (vertex.cssClasses.length > 0) { cssClassStr = cssClassStr + ' ' + vertex.cssClasses.join(' '); } // if (vertex.classes.length > 0) { // classStr = vertex.classes.join(' '); // } var styles = { labelStyle: '' }; //getStylesFromArray(vertex.styles); // Use vertex id as text in the box if no text is provided by the graph definition var vertexText = vertex.text !== undefined ? vertex.text : vertex.id; // We create a SVG label, either by delegating to addHtmlLabel or manually // let vertexNode; // if (evaluate(getConfig().flowchart.htmlLabels)) { // const node = { // label: vertexText.replace( // /fa[lrsb]?:fa-[\w-]+/g, // s => `` // ) // }; // vertexNode = addHtmlLabel(svg, node).node(); // vertexNode.parentNode.removeChild(vertexNode); // } else { // const svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text'); // svgLabel.setAttribute('style', styles.labelStyle.replace('color:', 'fill:')); // const rows = vertexText.split(common.lineBreakRegex); // for (let j = 0; j < rows.length; j++) { // const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); // tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve'); // tspan.setAttribute('dy', '1em'); // tspan.setAttribute('x', '1'); // tspan.textContent = rows[j]; // svgLabel.appendChild(tspan); // } // vertexNode = svgLabel; // } var radious = 0; var _shape = ''; // Set the shape based parameters switch (vertex.type) { case 'class': _shape = 'class_box'; break; default: _shape = 'class_box'; } // Add the node g.setNode(vertex.id, { labelStyle: styles.labelStyle, shape: _shape, labelText: sanitizeText(vertexText), classData: vertex, rx: radious, ry: radious, class: cssClassStr, style: styles.style, id: vertex.id, domId: vertex.domId, haveCallback: vertex.haveCallback, link: vertex.link, width: vertex.type === 'group' ? 500 : undefined, type: vertex.type, padding: (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().flowchart.padding }); _logger__WEBPACK_IMPORTED_MODULE_7__.log.info('setNode', { labelStyle: styles.labelStyle, shape: _shape, labelText: vertexText, rx: radious, ry: radious, class: cssClassStr, style: styles.style, id: vertex.id, width: vertex.type === 'group' ? 500 : undefined, type: vertex.type, padding: (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().flowchart.padding }); }); }; /** * Add edges to graph based on parsed graph defninition * * @param relations * @param {object} g The graph object */ var addRelations = function addRelations(relations, g) { var cnt = 0; var defaultStyle; var defaultLabelStyle; // if (typeof relations.defaultStyle !== 'undefined') { // const defaultStyles = getStylesFromArray(relations.defaultStyle); // defaultStyle = defaultStyles.style; // defaultLabelStyle = defaultStyles.labelStyle; // } relations.forEach(function (edge) { cnt++; var edgeData = {}; //Set relationship style and line type edgeData.classes = 'relation'; edgeData.pattern = edge.relation.lineType == 1 ? 'dashed' : 'solid'; edgeData.id = 'id' + cnt; // Set link type for rendering if (edge.type === 'arrow_open') { edgeData.arrowhead = 'none'; } else { edgeData.arrowhead = 'normal'; } _logger__WEBPACK_IMPORTED_MODULE_7__.log.info(edgeData, edge); //Set edge extra labels //edgeData.startLabelLeft = edge.relationTitle1; edgeData.startLabelRight = edge.relationTitle1 === 'none' ? '' : edge.relationTitle1; edgeData.endLabelLeft = edge.relationTitle2 === 'none' ? '' : edge.relationTitle2; //edgeData.endLabelRight = edge.relationTitle2; //Set relation arrow types edgeData.arrowTypeStart = getArrowMarker(edge.relation.type1); edgeData.arrowTypeEnd = getArrowMarker(edge.relation.type2); var style = ''; var labelStyle = ''; if (typeof edge.style !== 'undefined') { var styles = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.getStylesFromArray)(edge.style); style = styles.style; labelStyle = styles.labelStyle; } else { style = 'fill:none'; if (typeof defaultStyle !== 'undefined') { style = defaultStyle; } if (typeof defaultLabelStyle !== 'undefined') { labelStyle = defaultLabelStyle; } } edgeData.style = style; edgeData.labelStyle = labelStyle; if (typeof edge.interpolate !== 'undefined') { edgeData.curve = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.interpolateToCurve)(edge.interpolate, d3__WEBPACK_IMPORTED_MODULE_0__.curveLinear); } else if (typeof relations.defaultInterpolate !== 'undefined') { edgeData.curve = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.interpolateToCurve)(relations.defaultInterpolate, d3__WEBPACK_IMPORTED_MODULE_0__.curveLinear); } else { edgeData.curve = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.interpolateToCurve)(conf.curve, d3__WEBPACK_IMPORTED_MODULE_0__.curveLinear); } edge.text = edge.title; if (typeof edge.text === 'undefined') { if (typeof edge.style !== 'undefined') { edgeData.arrowheadStyle = 'fill: #333'; } } else { edgeData.arrowheadStyle = 'fill: #333'; edgeData.labelpos = 'c'; if ((0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().flowchart.htmlLabels) { // eslint-disable-line edgeData.labelType = 'html'; edgeData.label = '' + edge.text + ''; } else { edgeData.labelType = 'text'; edgeData.label = edge.text.replace(_common_common__WEBPACK_IMPORTED_MODULE_5__["default"].lineBreakRegex, '\n'); if (typeof edge.style === 'undefined') { edgeData.style = edgeData.style || 'stroke: #333; stroke-width: 1.5px;fill:none'; } edgeData.labelStyle = edgeData.labelStyle.replace('color:', 'fill:'); } } // Add the edge to the graph g.setEdge(edge.id1, edge.id2, edgeData, cnt); }); }; /** * Gets the ID with the same label as in the cache * * @param {string} label The label to look for * @returns {string} The resulting ID */ var getGraphId = function getGraphId(label) { var foundEntry = Object.entries(idCache).find(function (entry) { return entry[1].label === label; }); if (foundEntry) { return foundEntry[0]; } }; /** * Merges the value of `conf` with the passed `cnf` * * @param {object} cnf Config to merge */ var setConf = function setConf(cnf) { var keys = Object.keys(cnf); keys.forEach(function (key) { conf[key] = cnf[key]; }); }; /** * Draws a flowchart in the tag with id: id based on the graph definition in text. * * @param {string} text * @param {string} id */ var draw = function draw(text, id) { _logger__WEBPACK_IMPORTED_MODULE_7__.log.info('Drawing class - ', id); _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].clear(); // const parser = classDb.parser; // parser.yy = classDb; // Parse the graph definition // try { _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.parse(text); // } catch (err) { // log.debug('Parsing failed'); // } // Fetch the default direction, use TD if none was found //let dir = 'TD'; var conf = (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().flowchart; var securityLevel = (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().securityLevel; _logger__WEBPACK_IMPORTED_MODULE_7__.log.info('config:', conf); var nodeSpacing = conf.nodeSpacing || 50; var rankSpacing = conf.rankSpacing || 50; // Create the input mermaid.graph var g = new (graphlib__WEBPACK_IMPORTED_MODULE_2___default().Graph)({ multigraph: true, compound: true }).setGraph({ rankdir: _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getDirection(), nodesep: nodeSpacing, ranksep: rankSpacing, marginx: 8, marginy: 8 }).setDefaultEdgeLabel(function () { return {}; }); // let subG; // const subGraphs = flowDb.getSubGraphs(); // log.info('Subgraphs - ', subGraphs); // for (let i = subGraphs.length - 1; i >= 0; i--) { // subG = subGraphs[i]; // log.info('Subgraph - ', subG); // flowDb.addVertex(subG.id, subG.title, 'group', undefined, subG.classes); // } // Fetch the verices/nodes and edges/links from the parsed graph definition var classes = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getClasses(); var relations = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRelations(); _logger__WEBPACK_IMPORTED_MODULE_7__.log.info(relations); // let i = 0; // for (i = subGraphs.length - 1; i >= 0; i--) { // subG = subGraphs[i]; // selectAll('cluster').append('text'); // for (let j = 0; j < subG.nodes.length; j++) { // g.setParent(subG.nodes[j], subG.id); // } // } addClasses(classes, g, id); addRelations(relations, g); // Add custom shapes // flowChartShapes.addToRenderV2(addShape); // Set up an SVG group so that we can translate the final graph. var sandboxElement; if (securityLevel === 'sandbox') { sandboxElement = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('#i' + id); } var root = securityLevel === 'sandbox' ? (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(sandboxElement.nodes()[0].contentDocument.body) : (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('body'); var svg = root.select("[id=\"".concat(id, "\"]")); svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink'); // Run the renderer. This is what draws the final graph. var element = root.select('#' + id + ' g'); (0,_dagre_wrapper_index_js__WEBPACK_IMPORTED_MODULE_9__.render)(element, g, ['aggregation', 'extension', 'composition', 'dependency'], 'classDiagram', id); // element.selectAll('g.node').attr('title', function() { // return flowDb.getTooltip(this.id); // }); var padding = 8; var svgBounds = svg.node().getBBox(); var width = svgBounds.width + padding * 2; var height = svgBounds.height + padding * 2; _logger__WEBPACK_IMPORTED_MODULE_7__.log.debug("new ViewBox 0 0 ".concat(width, " ").concat(height), "translate(".concat(padding - g._label.marginx, ", ").concat(padding - g._label.marginy, ")")); (0,_utils__WEBPACK_IMPORTED_MODULE_8__.configureSvgSize)(svg, height, width, conf.useMaxWidth); svg.attr('viewBox', "0 0 ".concat(width, " ").concat(height)); svg.select('g').attr('transform', "translate(".concat(padding - g._label.marginx, ", ").concat(padding - svgBounds.y, ")")); // Index nodes // flowDb.indexNodes('subGraph' + i); // Add label rects for non html labels if (!conf.htmlLabels) { var doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; var labels = doc.querySelectorAll('[id="' + id + '"] .edgeLabel .label'); for (var k = 0; k < labels.length; k++) { var label = labels[k]; // Get dimensions of label var dim = label.getBBox(); var rect = doc.createElementNS('http://www.w3.org/2000/svg', 'rect'); rect.setAttribute('rx', 0); rect.setAttribute('ry', 0); rect.setAttribute('width', dim.width); rect.setAttribute('height', dim.height); // rect.setAttribute('style', 'fill:#e8e8e8;'); label.insertBefore(rect, label.firstChild); } } (0,_accessibility__WEBPACK_IMPORTED_MODULE_10__["default"])(_parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.yy, svg, id); // If node has a link, wrap it in an anchor SVG object. // const keys = Object.keys(classes); // keys.forEach(function(key) { // const vertex = classes[key]; // if (vertex.link) { // const node = select('#' + id + ' [id="' + key + '"]'); // if (node) { // const link = document.createElementNS('http://www.w3.org/2000/svg', 'a'); // link.setAttributeNS('http://www.w3.org/2000/svg', 'class', vertex.classes.join(' ')); // link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link); // link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener'); // const linkNode = node.insert(function() { // return link; // }, ':first-child'); // const shape = node.select('.label-container'); // if (shape) { // linkNode.append(function() { // return shape.node(); // }); // } // const label = node.select('.label'); // if (label) { // linkNode.append(function() { // return label.node(); // }); // } // } // } // }); }; /** * Gets the arrow marker for a type index * * @param {number} type The type to look for * @returns {'aggregation' | 'extension' | 'composition' | 'dependency'} The arrow marker */ function getArrowMarker(type) { var marker; switch (type) { case 0: marker = 'aggregation'; break; case 1: marker = 'extension'; break; case 2: marker = 'composition'; break; case 3: marker = 'dependency'; break; default: marker = 'none'; } return marker; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ setConf: setConf, draw: draw }); /***/ }), /***/ "./src/diagrams/class/classRenderer.js": /*!*********************************************!*\ !*** ./src/diagrams/class/classRenderer.js ***! \*********************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ "draw": () => (/* binding */ draw), /* harmony export */ "setConf": () => (/* binding */ setConf) /* harmony export */ }); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dagre */ "dagre"); /* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! graphlib */ "graphlib"); /* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); /* harmony import */ var _classDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./classDb */ "./src/diagrams/class/classDb.js"); /* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.jison"); /* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _svgDraw__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./svgDraw */ "./src/diagrams/class/svgDraw.js"); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../config */ "./src/config.js"); /* harmony import */ var _accessibility__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../accessibility */ "./src/accessibility.js"); _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.yy = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"]; var idCache = {}; var padding = 20; var conf = { dividerMargin: 10, padding: 5, textHeight: 10 }; /** * Gets the ID with the same label as in the cache * * @param {string} label The label to look for * @returns {string} The resulting ID */ var getGraphId = function getGraphId(label) { var foundEntry = Object.entries(idCache).find(function (entry) { return entry[1].label === label; }); if (foundEntry) { return foundEntry[0]; } }; /** * Setup arrow head and define the marker. The result is appended to the svg. * * @param {SVGSVGElement} elem The SVG element to append to */ var insertMarkers = function insertMarkers(elem) { elem.append('defs').append('marker').attr('id', 'extensionStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 1,7 L18,13 V 1 Z'); elem.append('defs').append('marker').attr('id', 'extensionEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead elem.append('defs').append('marker').attr('id', 'compositionStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); elem.append('defs').append('marker').attr('id', 'compositionEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); elem.append('defs').append('marker').attr('id', 'aggregationStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); elem.append('defs').append('marker').attr('id', 'aggregationEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); elem.append('defs').append('marker').attr('id', 'dependencyStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z'); elem.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 18,7 L9,13 L14,7 L9,1 Z'); }; /** * Merges the value of `conf` with the passed `cnf` * * @param {object} cnf Config to merge */ var setConf = function setConf(cnf) { var keys = Object.keys(cnf); keys.forEach(function (key) { conf[key] = cnf[key]; }); }; /** * Draws a flowchart in the tag with id: id based on the graph definition in text. * * @param {string} text * @param {string} id */ var draw = function draw(text, id) { idCache = {}; _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.yy.clear(); _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.parse(text); _logger__WEBPACK_IMPORTED_MODULE_5__.log.info('Rendering diagram ' + text); var securityLevel = (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().securityLevel; // Handle root and ocument for when rendering in sanbox mode var sandboxElement; if (securityLevel === 'sandbox') { sandboxElement = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('#i' + id); } var root = securityLevel === 'sandbox' ? (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(sandboxElement.nodes()[0].contentDocument.body) : (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('body'); var doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; // Fetch the default direction, use TD if none was found var diagram = root.select("[id='".concat(id, "']")); diagram.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink'); insertMarkers(diagram); // Layout graph, Create a new directed graph var g = new (graphlib__WEBPACK_IMPORTED_MODULE_2___default().Graph)({ multigraph: true }); // Set an object for the graph label g.setGraph({ isMultiGraph: true }); // Default to assigning a new object as a label for each new edge. g.setDefaultEdgeLabel(function () { return {}; }); var classes = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getClasses(); var keys = Object.keys(classes); for (var i = 0; i < keys.length; i++) { var classDef = classes[keys[i]]; var node = _svgDraw__WEBPACK_IMPORTED_MODULE_7__["default"].drawClass(diagram, classDef, conf); idCache[node.id] = node; // Add nodes to the graph. The first argument is the node id. The second is // metadata about the node. In this case we're going to add labels to each of // our nodes. g.setNode(node.id, node); _logger__WEBPACK_IMPORTED_MODULE_5__.log.info('Org height: ' + node.height); } var relations = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRelations(); relations.forEach(function (relation) { _logger__WEBPACK_IMPORTED_MODULE_5__.log.info('tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation)); g.setEdge(getGraphId(relation.id1), getGraphId(relation.id2), { relation: relation }, relation.title || 'DEFAULT'); }); dagre__WEBPACK_IMPORTED_MODULE_1___default().layout(g); g.nodes().forEach(function (v) { if (typeof v !== 'undefined' && typeof g.node(v) !== 'undefined') { _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug('Node ' + v + ': ' + JSON.stringify(g.node(v))); root.select('#' + (0,_classDb__WEBPACK_IMPORTED_MODULE_4__.lookUpDomId)(v)).attr('transform', 'translate(' + (g.node(v).x - g.node(v).width / 2) + ',' + (g.node(v).y - g.node(v).height / 2) + ' )'); } }); g.edges().forEach(function (e) { if (typeof e !== 'undefined' && typeof g.edge(e) !== 'undefined') { _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e))); _svgDraw__WEBPACK_IMPORTED_MODULE_7__["default"].drawEdge(diagram, g.edge(e), g.edge(e).relation, conf); } }); var svgBounds = diagram.node().getBBox(); var width = svgBounds.width + padding * 2; var height = svgBounds.height + padding * 2; (0,_utils__WEBPACK_IMPORTED_MODULE_8__.configureSvgSize)(diagram, height, width, conf.useMaxWidth); // Ensure the viewBox includes the whole svgBounds area with extra space for padding var vBox = "".concat(svgBounds.x - padding, " ").concat(svgBounds.y - padding, " ").concat(width, " ").concat(height); _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug("viewBox ".concat(vBox)); diagram.attr('viewBox', vBox); (0,_accessibility__WEBPACK_IMPORTED_MODULE_9__["default"])(_parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.yy, diagram, id); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ setConf: setConf, draw: draw }); /***/ }), /***/ "./src/diagrams/class/styles.js": /*!**************************************!*\ !*** ./src/diagrams/class/styles.js ***! \**************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var getStyles = function getStyles(options) { return "g.classGroup text {\n fill: ".concat(options.nodeBorder, ";\n fill: ").concat(options.classText, ";\n stroke: none;\n font-family: ").concat(options.fontFamily, ";\n font-size: 10px;\n\n .title {\n font-weight: bolder;\n }\n\n}\n\n.nodeLabel, .edgeLabel {\n color: ").concat(options.classText, ";\n}\n.edgeLabel .label rect {\n fill: ").concat(options.mainBkg, ";\n}\n.label text {\n fill: ").concat(options.classText, ";\n}\n.edgeLabel .label span {\n background: ").concat(options.mainBkg, ";\n}\n\n.classTitle {\n font-weight: bolder;\n}\n.node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1px;\n }\n\n\n.divider {\n stroke: ").concat(options.nodeBorder, ";\n stroke: 1;\n}\n\ng.clickable {\n cursor: pointer;\n}\n\ng.classGroup rect {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n}\n\ng.classGroup line {\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1;\n}\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ").concat(options.mainBkg, ";\n opacity: 0.5;\n}\n\n.classLabel .label {\n fill: ").concat(options.nodeBorder, ";\n font-size: 10px;\n}\n\n.relation {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n fill: none;\n}\n\n.dashed-line{\n stroke-dasharray: 3;\n}\n\n#compositionStart, .composition {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#compositionEnd, .composition {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#extensionStart, .extension {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#extensionEnd, .extension {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#aggregationStart, .aggregation {\n fill: ").concat(options.mainBkg, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#aggregationEnd, .aggregation {\n fill: ").concat(options.mainBkg, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n.edgeTerminals {\n font-size: 11px;\n}\n\n"); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getStyles); /***/ }), /***/ "./src/diagrams/class/svgDraw.js": /*!***************************************!*\ !*** ./src/diagrams/class/svgDraw.js ***! \***************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ "drawClass": () => (/* binding */ drawClass), /* harmony export */ "drawEdge": () => (/* binding */ drawEdge), /* harmony export */ "parseMember": () => (/* binding */ parseMember) /* harmony export */ }); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _classDb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./classDb */ "./src/diagrams/class/classDb.js"); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); var edgeCount = 0; var drawEdge = function drawEdge(elem, path, relation, conf) { var getRelationType = function getRelationType(type) { switch (type) { case _classDb__WEBPACK_IMPORTED_MODULE_1__.relationType.AGGREGATION: return 'aggregation'; case _classDb__WEBPACK_IMPORTED_MODULE_1__.relationType.EXTENSION: return 'extension'; case _classDb__WEBPACK_IMPORTED_MODULE_1__.relationType.COMPOSITION: return 'composition'; case _classDb__WEBPACK_IMPORTED_MODULE_1__.relationType.DEPENDENCY: return 'dependency'; } }; path.points = path.points.filter(function (p) { return !Number.isNaN(p.y); }); // The data for our line var lineData = path.points; // This is the accessor function we talked about above var lineFunction = (0,d3__WEBPACK_IMPORTED_MODULE_0__.line)().x(function (d) { return d.x; }).y(function (d) { return d.y; }).curve(d3__WEBPACK_IMPORTED_MODULE_0__.curveBasis); var svgPath = elem.append('path').attr('d', lineFunction(lineData)).attr('id', 'edge' + edgeCount).attr('class', 'relation'); var url = ''; if (conf.arrowMarkerAbsolute) { url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search; url = url.replace(/\(/g, '\\('); url = url.replace(/\)/g, '\\)'); } if (relation.relation.lineType == 1) { svgPath.attr('class', 'relation dashed-line'); } if (relation.relation.type1 !== 'none') { svgPath.attr('marker-start', 'url(' + url + '#' + getRelationType(relation.relation.type1) + 'Start' + ')'); } if (relation.relation.type2 !== 'none') { svgPath.attr('marker-end', 'url(' + url + '#' + getRelationType(relation.relation.type2) + 'End' + ')'); } var x, y; var l = path.points.length; // Calculate Label position var labelPosition = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].calcLabelPosition(path.points); x = labelPosition.x; y = labelPosition.y; var p1_card_x, p1_card_y; var p2_card_x, p2_card_y; if (l % 2 !== 0 && l > 1) { var cardinality_1_point = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].calcCardinalityPosition(relation.relation.type1 !== 'none', path.points, path.points[0]); var cardinality_2_point = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].calcCardinalityPosition(relation.relation.type2 !== 'none', path.points, path.points[l - 1]); _logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('cardinality_1_point ' + JSON.stringify(cardinality_1_point)); _logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('cardinality_2_point ' + JSON.stringify(cardinality_2_point)); p1_card_x = cardinality_1_point.x; p1_card_y = cardinality_1_point.y; p2_card_x = cardinality_2_point.x; p2_card_y = cardinality_2_point.y; } if (typeof relation.title !== 'undefined') { var g = elem.append('g').attr('class', 'classLabel'); var label = g.append('text').attr('class', 'label').attr('x', x).attr('y', y).attr('fill', 'red').attr('text-anchor', 'middle').text(relation.title); window.label = label; var bounds = label.node().getBBox(); g.insert('rect', ':first-child').attr('class', 'box').attr('x', bounds.x - conf.padding / 2).attr('y', bounds.y - conf.padding / 2).attr('width', bounds.width + conf.padding).attr('height', bounds.height + conf.padding); } _logger__WEBPACK_IMPORTED_MODULE_3__.log.info('Rendering relation ' + JSON.stringify(relation)); if (typeof relation.relationTitle1 !== 'undefined' && relation.relationTitle1 !== 'none') { var _g = elem.append('g').attr('class', 'cardinality'); _g.append('text').attr('class', 'type1').attr('x', p1_card_x).attr('y', p1_card_y).attr('fill', 'black').attr('font-size', '6').text(relation.relationTitle1); } if (typeof relation.relationTitle2 !== 'undefined' && relation.relationTitle2 !== 'none') { var _g2 = elem.append('g').attr('class', 'cardinality'); _g2.append('text').attr('class', 'type2').attr('x', p2_card_x).attr('y', p2_card_y).attr('fill', 'black').attr('font-size', '6').text(relation.relationTitle2); } edgeCount++; }; /** * Renders a class diagram * * @param {SVGSVGElement} elem The element to draw it into * @param classDef * @param conf * @todo Add more information in the JSDOC here */ var drawClass = function drawClass(elem, classDef, conf) { _logger__WEBPACK_IMPORTED_MODULE_3__.log.info('Rendering class ' + classDef); var id = classDef.id; var classInfo = { id: id, label: classDef.id, width: 0, height: 0 }; // add class group var g = elem.append('g').attr('id', (0,_classDb__WEBPACK_IMPORTED_MODULE_1__.lookUpDomId)(id)).attr('class', 'classGroup'); // add title var title; if (classDef.link) { title = g.append('svg:a').attr('xlink:href', classDef.link).attr('target', classDef.linkTarget).append('text').attr('y', conf.textHeight + conf.padding).attr('x', 0); } else { title = g.append('text').attr('y', conf.textHeight + conf.padding).attr('x', 0); } // add annotations var isFirst = true; classDef.annotations.forEach(function (member) { var titleText2 = title.append('tspan').text('«' + member + '»'); if (!isFirst) titleText2.attr('dy', conf.textHeight); isFirst = false; }); var classTitleString = classDef.id; if (classDef.type !== undefined && classDef.type !== '') { classTitleString += '<' + classDef.type + '>'; } var classTitle = title.append('tspan').text(classTitleString).attr('class', 'title'); // If class has annotations the title needs to have an offset of the text height if (!isFirst) classTitle.attr('dy', conf.textHeight); var titleHeight = title.node().getBBox().height; var membersLine = g.append('line') // text label for the x axis .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin / 2).attr('y2', conf.padding + titleHeight + conf.dividerMargin / 2); var members = g.append('text') // text label for the x axis .attr('x', conf.padding).attr('y', titleHeight + conf.dividerMargin + conf.textHeight).attr('fill', 'white').attr('class', 'classText'); isFirst = true; classDef.members.forEach(function (member) { addTspan(members, member, isFirst, conf); isFirst = false; }); var membersBox = members.node().getBBox(); var methodsLine = g.append('line') // text label for the x axis .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin + membersBox.height).attr('y2', conf.padding + titleHeight + conf.dividerMargin + membersBox.height); var methods = g.append('text') // text label for the x axis .attr('x', conf.padding).attr('y', titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight).attr('fill', 'white').attr('class', 'classText'); isFirst = true; classDef.methods.forEach(function (method) { addTspan(methods, method, isFirst, conf); isFirst = false; }); var classBox = g.node().getBBox(); var cssClassStr = ' '; if (classDef.cssClasses.length > 0) { cssClassStr = cssClassStr + classDef.cssClasses.join(' '); } var rect = g.insert('rect', ':first-child').attr('x', 0).attr('y', 0).attr('width', classBox.width + 2 * conf.padding).attr('height', classBox.height + conf.padding + 0.5 * conf.dividerMargin).attr('class', cssClassStr); var rectWidth = rect.node().getBBox().width; // Center title // We subtract the width of each text element from the class box width and divide it by 2 title.node().childNodes.forEach(function (x) { x.setAttribute('x', (rectWidth - x.getBBox().width) / 2); }); if (classDef.tooltip) { title.insert('title').text(classDef.tooltip); } membersLine.attr('x2', rectWidth); methodsLine.attr('x2', rectWidth); classInfo.width = rectWidth; classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin; return classInfo; }; var parseMember = function parseMember(text) { var fieldRegEx = /^(\+|-|~|#)?(\w+)(~\w+~|\[\])?\s+(\w+) *(\*|\$)?$/; var methodRegEx = /^([+|\-|~|#])?(\w+) *\( *(.*)\) *(\*|\$)? *(\w*[~|[\]]*\s*\w*~?)$/; var fieldMatch = text.match(fieldRegEx); var methodMatch = text.match(methodRegEx); if (fieldMatch && !methodMatch) { return buildFieldDisplay(fieldMatch); } else if (methodMatch) { return buildMethodDisplay(methodMatch); } else { return buildLegacyDisplay(text); } }; var buildFieldDisplay = function buildFieldDisplay(parsedText) { var cssStyle = ''; var displayText = ''; try { var visibility = parsedText[1] ? parsedText[1].trim() : ''; var fieldType = parsedText[2] ? parsedText[2].trim() : ''; var genericType = parsedText[3] ? parseGenericTypes(parsedText[3].trim()) : ''; var fieldName = parsedText[4] ? parsedText[4].trim() : ''; var classifier = parsedText[5] ? parsedText[5].trim() : ''; displayText = visibility + fieldType + genericType + ' ' + fieldName; cssStyle = parseClassifier(classifier); } catch (err) { displayText = parsedText; } return { displayText: displayText, cssStyle: cssStyle }; }; var buildMethodDisplay = function buildMethodDisplay(parsedText) { var cssStyle = ''; var displayText = ''; try { var visibility = parsedText[1] ? parsedText[1].trim() : ''; var methodName = parsedText[2] ? parsedText[2].trim() : ''; var parameters = parsedText[3] ? parseGenericTypes(parsedText[3].trim()) : ''; var classifier = parsedText[4] ? parsedText[4].trim() : ''; var returnType = parsedText[5] ? ' : ' + parseGenericTypes(parsedText[5]).trim() : ''; displayText = visibility + methodName + '(' + parameters + ')' + returnType; cssStyle = parseClassifier(classifier); } catch (err) { displayText = parsedText; } return { displayText: displayText, cssStyle: cssStyle }; }; var buildLegacyDisplay = function buildLegacyDisplay(text) { // if for some reason we dont have any match, use old format to parse text var displayText = ''; var cssStyle = ''; var memberText = ''; var returnType = ''; var methodStart = text.indexOf('('); var methodEnd = text.indexOf(')'); if (methodStart > 1 && methodEnd > methodStart && methodEnd <= text.length) { var visibility = ''; var methodName = ''; var firstChar = text.substring(0, 1); if (firstChar.match(/\w/)) { methodName = text.substring(0, methodStart).trim(); } else { if (firstChar.match(/\+|-|~|#/)) { visibility = firstChar; } methodName = text.substring(1, methodStart).trim(); } var parameters = text.substring(methodStart + 1, methodEnd); var classifier = text.substring(methodEnd + 1, 1); cssStyle = parseClassifier(classifier); displayText = visibility + methodName + '(' + parseGenericTypes(parameters.trim()) + ')'; if (methodEnd < memberText.length) { returnType = text.substring(methodEnd + 2).trim(); if (returnType !== '') { returnType = ' : ' + parseGenericTypes(returnType); } } } else { // finally - if all else fails, just send the text back as written (other than parsing for generic types) displayText = parseGenericTypes(text); } return { displayText: displayText, cssStyle: cssStyle }; }; /** * Adds a for a member in a diagram * * @param {SVGElement} textEl The element to append to * @param {string} txt The member * @param {boolean} isFirst * @param {{ padding: string; textHeight: string }} conf The configuration for the member */ var addTspan = function addTspan(textEl, txt, isFirst, conf) { var member = parseMember(txt); var tSpan = textEl.append('tspan').attr('x', conf.padding).text(member.displayText); if (member.cssStyle !== '') { tSpan.attr('style', member.cssStyle); } if (!isFirst) { tSpan.attr('dy', conf.textHeight); } }; /** * Makes generics in typescript syntax * * @example Array of array of strings in typescript syntax * // returns "Array>" * parseGenericTypes('Array~Array~string~~'); * * @param {string} text The text to convert * @returns {string} The converted string */ var parseGenericTypes = function parseGenericTypes(text) { var cleanedText = text; if (text.indexOf('~') != -1) { cleanedText = cleanedText.replace('~', '<'); cleanedText = cleanedText.replace('~', '>'); return parseGenericTypes(cleanedText); } else { return cleanedText; } }; /** * Gives the styles for a classifier * * @param {'+' | '-' | '#' | '~' | '*' | '$'} classifier The classifier string * @returns {string} Styling for the classifier */ var parseClassifier = function parseClassifier(classifier) { switch (classifier) { case '*': return 'font-style:italic;'; case '$': return 'text-decoration:underline;'; default: return ''; } }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ drawClass: drawClass, drawEdge: drawEdge, parseMember: parseMember }); /***/ }), /***/ "./src/diagrams/common/common.js": /*!***************************************!*\ !*** ./src/diagrams/common/common.js ***! \***************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ "evaluate": () => (/* binding */ evaluate), /* harmony export */ "getRows": () => (/* binding */ getRows), /* harmony export */ "hasBreaks": () => (/* binding */ hasBreaks), /* harmony export */ "lineBreakRegex": () => (/* binding */ lineBreakRegex), /* harmony export */ "removeEscapes": () => (/* binding */ removeEscapes), /* harmony export */ "removeScript": () => (/* binding */ removeScript), /* harmony export */ "sanitizeText": () => (/* binding */ sanitizeText), /* harmony export */ "sanitizeTextOrArray": () => (/* binding */ sanitizeTextOrArray), /* harmony export */ "splitBreaks": () => (/* binding */ splitBreaks) /* harmony export */ }); /* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dompurify */ "dompurify"); /* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dompurify__WEBPACK_IMPORTED_MODULE_0__); /** * Gets the number of lines in a string * * @param {string | undefined} s The string to check the lines for * @returns {number} The number of lines in that string */ var getRows = function getRows(s) { if (!s) return 1; var str = breakToPlaceholder(s); str = str.replace(/\\n/g, '#br#'); return str.split('#br#'); }; var removeEscapes = function removeEscapes(text) { var newStr = text.replace(/\\u[\dA-F]{4}/gi, function (match) { return String.fromCharCode(parseInt(match.replace(/\\u/g, ''), 16)); }); newStr = newStr.replace(/\\x([0-9a-f]{2})/gi, function (_, c) { return String.fromCharCode(parseInt(c, 16)); }); newStr = newStr.replace(/\\[\d\d\d]{3}/gi, function (match) { return String.fromCharCode(parseInt(match.replace(/\\/g, ''), 8)); }); newStr = newStr.replace(/\\[\d\d\d]{2}/gi, function (match) { return String.fromCharCode(parseInt(match.replace(/\\/g, ''), 8)); }); return newStr; }; /** * Removes script tags from a text * * @param {string} txt The text to sanitize * @returns {string} The safer text */ var removeScript = function removeScript(txt) { var rs = ''; var idx = 0; while (idx >= 0) { idx = txt.indexOf('= 0) { rs += txt.substr(0, idx); txt = txt.substr(idx + 1); idx = txt.indexOf(''); if (idx >= 0) { idx += 9; txt = txt.substr(idx); } } else { rs += txt; idx = -1; break; } } var decodedText = removeEscapes(rs); decodedText = decodedText.replaceAll(/script>/gi, '#'); decodedText = decodedText.replaceAll(/javascript:/gi, '#'); decodedText = decodedText.replaceAll(/javascript&colon/gi, '#'); decodedText = decodedText.replaceAll(/onerror=/gi, 'onerror:'); decodedText = decodedText.replaceAll(/"); } else { if (cnf.securityLevel !== 'loose') { svgCode = dompurify__WEBPACK_IMPORTED_MODULE_2___default().sanitize(svgCode, { ADD_TAGS: ['foreignobject'], ADD_ATTR: ['dominant-baseline'] }); } } if (typeof cb !== 'undefined') { switch (graphType) { case 'flowchart': case 'flowchart-v2': cb(svgCode, _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"].bindFunctions); break; case 'gantt': cb(svgCode, _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_13__["default"].bindFunctions); break; case 'class': case 'classDiagram': cb(svgCode, _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_15__["default"].bindFunctions); break; default: cb(svgCode); } } else { _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug('CB = undefined!'); } (0,_interactionDb__WEBPACK_IMPORTED_MODULE_45__.attachFunctions)(); var tmpElementSelector = cnf.securityLevel === 'sandbox' ? '#i' + id : '#d' + id; var node = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(tmpElementSelector).node(); if (node !== null && typeof node.remove === 'function') { (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(tmpElementSelector).node().remove(); } return svgCode; }; var currentDirective = {}; var parseDirective = function parseDirective(p, statement, context, type) { try { if (statement !== undefined) { statement = statement.trim(); switch (context) { case 'open_directive': currentDirective = {}; break; case 'type_directive': currentDirective.type = statement.toLowerCase(); break; case 'arg_directive': currentDirective.args = JSON.parse(statement); break; case 'close_directive': handleDirective(p, currentDirective, type); currentDirective = null; break; } } } catch (error) { _logger__WEBPACK_IMPORTED_MODULE_5__.log.error("Error while rendering sequenceDiagram directive: ".concat(statement, " jison context: ").concat(context)); _logger__WEBPACK_IMPORTED_MODULE_5__.log.error(error.message); } }; var handleDirective = function handleDirective(p, directive, type) { _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug("Directive type=".concat(directive.type, " with args:"), directive.args); switch (directive.type) { case 'init': case 'initialize': { ['config'].forEach(function (prop) { if (typeof directive.args[prop] !== 'undefined') { if (type === 'flowchart-v2') { type = 'flowchart'; } directive.args[type] = directive.args[prop]; delete directive.args[prop]; } }); _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug('sanitize in handleDirective', directive.args); (0,_utils__WEBPACK_IMPORTED_MODULE_4__.directiveSanitizer)(directive.args); _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug('sanitize in handleDirective (done)', directive.args); reinitialize(directive.args); _config__WEBPACK_IMPORTED_MODULE_3__.addDirective(directive.args); break; } case 'wrap': case 'nowrap': if (p && p['setWrap']) { p.setWrap(directive.type === 'wrap'); } break; case 'themeCss': _logger__WEBPACK_IMPORTED_MODULE_5__.log.warn('themeCss encountered'); break; default: _logger__WEBPACK_IMPORTED_MODULE_5__.log.warn("Unhandled directive: source: '%%{".concat(directive.type, ": ").concat(JSON.stringify(directive.args ? directive.args : {}), "}%%"), directive); break; } }; /** @param {any} conf */ function updateRendererConfigs(conf) { // Todo remove, all diagrams should get config on demoand from the config object, no need for this // gitGraphRenderer.setConf(conf.git); // Todo Remove all of these _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_28__["default"].setConf(conf.flowchart); _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_31__["default"].setConf(conf.flowchart); if (typeof conf['sequenceDiagram'] !== 'undefined') { _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_32__["default"].setConf((0,_utils__WEBPACK_IMPORTED_MODULE_4__.assignWithDepth)(conf.sequence, conf['sequenceDiagram'])); } _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_32__["default"].setConf(conf.sequence); _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_33__["default"].setConf(conf.gantt); _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_34__["default"].setConf(conf.class); _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_36__["default"].setConf(conf.state); _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_37__["default"].setConf(conf.state); _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_38__["default"].setConf(conf.class); // pieRenderer.setConf(conf.class); _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_41__["default"].setConf(conf.er); _diagrams_user_journey_journeyRenderer__WEBPACK_IMPORTED_MODULE_42__["default"].setConf(conf.journey); _diagrams_requirement_requirementRenderer__WEBPACK_IMPORTED_MODULE_43__["default"].setConf(conf.requirement); _errorRenderer__WEBPACK_IMPORTED_MODULE_44__["default"].setConf(conf.class); } /** To be removed */ function reinitialize() {// `mermaidAPI.reinitialize: v${pkg.version}`, // JSON.stringify(options), // options.themeVariables.primaryColor; // // if (options.theme && theme[options.theme]) { // // options.themeVariables = theme[options.theme].getThemeVariables(options.themeVariables); // // } // // Set default options // const config = // typeof options === 'object' ? configApi.setConfig(options) : configApi.getSiteConfig(); // updateRendererConfigs(config); // setLogLevel(config.logLevel); // log.debug('mermaidAPI.reinitialize: ', config); } /** @param {any} options */ function initialize(options) { // console.warn(`mermaidAPI.initialize: v${pkg.version} `, options); // Handle legacy location of font-family configuration if (options && options.fontFamily) { if (!options.themeVariables) { options.themeVariables = { fontFamily: options.fontFamily }; } else { if (!options.themeVariables.fontFamily) { options.themeVariables = { fontFamily: options.fontFamily }; } } } // Set default options _config__WEBPACK_IMPORTED_MODULE_3__.saveConfigFromInitilize(options); if (options && options.theme && _themes__WEBPACK_IMPORTED_MODULE_46__["default"][options.theme]) { // Todo merge with user options options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_46__["default"][options.theme].getThemeVariables(options.themeVariables); } else { if (options) options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_46__["default"]["default"].getThemeVariables(options.themeVariables); } var config = _typeof(options) === 'object' ? _config__WEBPACK_IMPORTED_MODULE_3__.setSiteConfig(options) : _config__WEBPACK_IMPORTED_MODULE_3__.getSiteConfig(); updateRendererConfigs(config); (0,_logger__WEBPACK_IMPORTED_MODULE_5__.setLogLevel)(config.logLevel); // log.debug('mermaidAPI.initialize: ', config); } var mermaidAPI = Object.freeze({ render: render, parse: parse, parseDirective: parseDirective, initialize: initialize, reinitialize: reinitialize, getConfig: _config__WEBPACK_IMPORTED_MODULE_3__.getConfig, setConfig: _config__WEBPACK_IMPORTED_MODULE_3__.setConfig, getSiteConfig: _config__WEBPACK_IMPORTED_MODULE_3__.getSiteConfig, updateSiteConfig: _config__WEBPACK_IMPORTED_MODULE_3__.updateSiteConfig, reset: function reset() { // console.warn('reset'); _config__WEBPACK_IMPORTED_MODULE_3__.reset(); // const siteConfig = configApi.getSiteConfig(); // updateRendererConfigs(siteConfig); }, globalReset: function globalReset() { _config__WEBPACK_IMPORTED_MODULE_3__.reset(_config__WEBPACK_IMPORTED_MODULE_3__.defaultConfig); updateRendererConfigs(_config__WEBPACK_IMPORTED_MODULE_3__.getConfig()); }, defaultConfig: _config__WEBPACK_IMPORTED_MODULE_3__.defaultConfig }); (0,_logger__WEBPACK_IMPORTED_MODULE_5__.setLogLevel)(_config__WEBPACK_IMPORTED_MODULE_3__.getConfig().logLevel); _config__WEBPACK_IMPORTED_MODULE_3__.reset(_config__WEBPACK_IMPORTED_MODULE_3__.getConfig()); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mermaidAPI); /** * ## mermaidAPI configuration defaults * * ```html * * ``` */ /***/ }), /***/ "./src/styles.js": /*!***********************!*\ !*** ./src/styles.js ***! \***********************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "calcThemeVariables": () => (/* binding */ calcThemeVariables), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./diagrams/class/styles */ "./src/diagrams/class/styles.js"); /* harmony import */ var _diagrams_er_styles__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./diagrams/er/styles */ "./src/diagrams/er/styles.js"); /* harmony import */ var _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diagrams/flowchart/styles */ "./src/diagrams/flowchart/styles.js"); /* harmony import */ var _diagrams_gantt_styles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./diagrams/gantt/styles */ "./src/diagrams/gantt/styles.js"); /* harmony import */ var _diagrams_git_styles__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./diagrams/git/styles */ "./src/diagrams/git/styles.js"); /* harmony import */ var _diagrams_info_styles__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./diagrams/info/styles */ "./src/diagrams/info/styles.js"); /* harmony import */ var _diagrams_pie_styles__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./diagrams/pie/styles */ "./src/diagrams/pie/styles.js"); /* harmony import */ var _diagrams_requirement_styles__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./diagrams/requirement/styles */ "./src/diagrams/requirement/styles.js"); /* harmony import */ var _diagrams_sequence_styles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./diagrams/sequence/styles */ "./src/diagrams/sequence/styles.js"); /* harmony import */ var _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./diagrams/state/styles */ "./src/diagrams/state/styles.js"); /* harmony import */ var _diagrams_user_journey_styles__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./diagrams/user-journey/styles */ "./src/diagrams/user-journey/styles.js"); var themes = { flowchart: _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_0__["default"], 'flowchart-v2': _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_0__["default"], sequence: _diagrams_sequence_styles__WEBPACK_IMPORTED_MODULE_1__["default"], gantt: _diagrams_gantt_styles__WEBPACK_IMPORTED_MODULE_2__["default"], classDiagram: _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_3__["default"], 'classDiagram-v2': _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_3__["default"], class: _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_3__["default"], stateDiagram: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__["default"], state: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__["default"], gitGraph: _diagrams_git_styles__WEBPACK_IMPORTED_MODULE_5__["default"], info: _diagrams_info_styles__WEBPACK_IMPORTED_MODULE_6__["default"], pie: _diagrams_pie_styles__WEBPACK_IMPORTED_MODULE_7__["default"], er: _diagrams_er_styles__WEBPACK_IMPORTED_MODULE_8__["default"], journey: _diagrams_user_journey_styles__WEBPACK_IMPORTED_MODULE_9__["default"], requirement: _diagrams_requirement_styles__WEBPACK_IMPORTED_MODULE_10__["default"] }; var calcThemeVariables = function calcThemeVariables(theme, userOverRides) { return theme.calcColors(userOverRides); }; var getStyles = function getStyles(type, userStyles, options) { //console.warn('options in styles: ', options); return " {\n font-family: ".concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n fill: ").concat(options.textColor, "\n }\n\n /* Classes common for multiple diagrams */\n\n .error-icon {\n fill: ").concat(options.errorBkgColor, ";\n }\n .error-text {\n fill: ").concat(options.errorTextColor, ";\n stroke: ").concat(options.errorTextColor, ";\n }\n\n .edge-thickness-normal {\n stroke-width: 2px;\n }\n .edge-thickness-thick {\n stroke-width: 3.5px\n }\n .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n\n .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n .marker {\n fill: ").concat(options.lineColor, ";\n stroke: ").concat(options.lineColor, ";\n }\n .marker.cross {\n stroke: ").concat(options.lineColor, ";\n }\n\n svg {\n font-family: ").concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n }\n\n ").concat(themes[type](options), "\n\n ").concat(userStyles, "\n"); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getStyles); /***/ }), /***/ "./src/themes/index.js": /*!*****************************!*\ !*** ./src/themes/index.js ***! \*****************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _theme_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./theme-base */ "./src/themes/theme-base.js"); /* harmony import */ var _theme_dark__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-dark */ "./src/themes/theme-dark.js"); /* harmony import */ var _theme_default__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./theme-default */ "./src/themes/theme-default.js"); /* harmony import */ var _theme_forest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./theme-forest */ "./src/themes/theme-forest.js"); /* harmony import */ var _theme_neutral__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./theme-neutral */ "./src/themes/theme-neutral.js"); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ base: { getThemeVariables: _theme_base__WEBPACK_IMPORTED_MODULE_0__.getThemeVariables }, dark: { getThemeVariables: _theme_dark__WEBPACK_IMPORTED_MODULE_1__.getThemeVariables }, default: { getThemeVariables: _theme_default__WEBPACK_IMPORTED_MODULE_2__.getThemeVariables }, forest: { getThemeVariables: _theme_forest__WEBPACK_IMPORTED_MODULE_3__.getThemeVariables }, neutral: { getThemeVariables: _theme_neutral__WEBPACK_IMPORTED_MODULE_4__.getThemeVariables } }); /***/ }), /***/ "./src/themes/theme-base.js": /*!**********************************!*\ !*** ./src/themes/theme-base.js ***! \**********************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "getThemeVariables": () => (/* binding */ getThemeVariables) /* harmony export */ }); /* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); /* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } var Theme = /*#__PURE__*/function () { function Theme() { _classCallCheck(this, Theme); /** # Base variables */ /** * - Background - used to know what the background color is of the diagram. This is used for * deducing colors for istance line color. Defaulr value is #f4f4f4. */ this.background = '#f4f4f4'; this.darkMode = false; // this.background = '#0c0c0c'; // this.darkMode = true; this.primaryColor = '#fff4dd'; // this.background = '#0c0c0c'; // this.primaryColor = '#1f1f00'; this.noteBkgColor = '#fff5ad'; this.noteTextColor = '#333'; // dark // this.primaryColor = '#034694'; // this.primaryColor = '#f2ee7e'; // this.primaryColor = '#9f33be'; // this.primaryColor = '#f0fff0'; // this.primaryColor = '#fa255e'; // this.primaryColor = '#ECECFF'; // this.secondaryColor = '#c39ea0'; // this.tertiaryColor = '#f8e5e5'; // this.secondaryColor = '#dfdfde'; // this.tertiaryColor = '#CCCCFF'; this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; this.fontSize = '16px'; // this.updateColors(); } _createClass(Theme, [{ key: "updateColors", value: function updateColors() { // The || is to make sure that if the variable has been defiend by a user override that value is to be used /* Main */ this.primaryTextColor = this.primaryTextColor || (this.darkMode ? '#eee' : '#333'); // invert(this.primaryColor); this.secondaryColor = this.secondaryColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -120 }); this.tertiaryColor = this.tertiaryColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 180, l: 5 }); this.primaryBorderColor = this.primaryBorderColor || (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.primaryColor, this.darkMode); this.secondaryBorderColor = this.secondaryBorderColor || (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.secondaryColor, this.darkMode); this.tertiaryBorderColor = this.tertiaryBorderColor || (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.tertiaryColor, this.darkMode); this.noteBorderColor = this.noteBorderColor || (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.noteBkgColor, this.darkMode); this.noteBkgColor = this.noteBkgColor || '#fff5ad'; this.noteTextColor = this.noteTextColor || '#333'; this.secondaryTextColor = this.secondaryTextColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.secondaryColor); this.tertiaryTextColor = this.tertiaryTextColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.tertiaryColor); this.lineColor = this.lineColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); this.textColor = this.textColor || this.primaryTextColor; /* Flowchart variables */ this.nodeBkg = this.nodeBkg || this.primaryColor; this.mainBkg = this.mainBkg || this.primaryColor; this.nodeBorder = this.nodeBorder || this.primaryBorderColor; this.clusterBkg = this.clusterBkg || this.tertiaryColor; this.clusterBorder = this.clusterBorder || this.tertiaryBorderColor; this.defaultLinkColor = this.defaultLinkColor || this.lineColor; this.titleColor = this.titleColor || this.tertiaryTextColor; this.edgeLabelBackground = this.edgeLabelBackground || (this.darkMode ? (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.secondaryColor, 30) : this.secondaryColor); this.nodeTextColor = this.nodeTextColor || this.primaryTextColor; /* Sequence Diagram variables */ // this.actorBorder = lighten(this.border1, 0.5); this.actorBorder = this.actorBorder || this.primaryBorderColor; this.actorBkg = this.actorBkg || this.mainBkg; this.actorTextColor = this.actorTextColor || this.primaryTextColor; this.actorLineColor = this.actorLineColor || 'grey'; this.labelBoxBkgColor = this.labelBoxBkgColor || this.actorBkg; this.signalColor = this.signalColor || this.textColor; this.signalTextColor = this.signalTextColor || this.textColor; this.labelBoxBorderColor = this.labelBoxBorderColor || this.actorBorder; this.labelTextColor = this.labelTextColor || this.actorTextColor; this.loopTextColor = this.loopTextColor || this.actorTextColor; this.activationBorderColor = this.activationBorderColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.secondaryColor, 10); this.activationBkgColor = this.activationBkgColor || this.secondaryColor; this.sequenceNumberColor = this.sequenceNumberColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.lineColor); /* Gantt chart variables */ this.sectionBkgColor = this.sectionBkgColor || this.tertiaryColor; this.altSectionBkgColor = this.altSectionBkgColor || 'white'; this.sectionBkgColor = this.sectionBkgColor || this.secondaryColor; this.sectionBkgColor2 = this.sectionBkgColor2 || this.primaryColor; this.excludeBkgColor = this.excludeBkgColor || '#eeeeee'; this.taskBorderColor = this.taskBorderColor || this.primaryBorderColor; this.taskBkgColor = this.taskBkgColor || this.primaryColor; this.activeTaskBorderColor = this.activeTaskBorderColor || this.primaryColor; this.activeTaskBkgColor = this.activeTaskBkgColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.primaryColor, 23); this.gridColor = this.gridColor || 'lightgrey'; this.doneTaskBkgColor = this.doneTaskBkgColor || 'lightgrey'; this.doneTaskBorderColor = this.doneTaskBorderColor || 'grey'; this.critBorderColor = this.critBorderColor || '#ff8888'; this.critBkgColor = this.critBkgColor || 'red'; this.todayLineColor = this.todayLineColor || 'red'; this.taskTextColor = this.taskTextColor || this.textColor; this.taskTextOutsideColor = this.taskTextOutsideColor || this.textColor; this.taskTextLightColor = this.taskTextLightColor || this.textColor; this.taskTextColor = this.taskTextColor || this.primaryTextColor; this.taskTextDarkColor = this.taskTextDarkColor || this.textColor; this.taskTextClickableColor = this.taskTextClickableColor || '#003163'; /* state colors */ this.transitionColor = this.transitionColor || this.lineColor; this.transitionLabelColor = this.transitionLabelColor || this.textColor; /* The color of the text tables of the tstates*/ this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; this.stateBkg = this.stateBkg || this.mainBkg; this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; this.altBackground = this.altBackground || this.tertiaryColor; this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; this.compositeBorder = this.compositeBorder || this.nodeBorder; this.innerEndBackground = this.nodeBorder; this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; this.transitionColor = this.transitionColor || this.lineColor; this.specialStateColor = this.lineColor; /* class */ this.classText = this.classText || this.textColor; /* user-journey */ this.fillType0 = this.fillType0 || this.primaryColor; this.fillType1 = this.fillType1 || this.secondaryColor; this.fillType2 = this.fillType2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 64 }); this.fillType3 = this.fillType3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { h: 64 }); this.fillType4 = this.fillType4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -64 }); this.fillType5 = this.fillType5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { h: -64 }); this.fillType6 = this.fillType6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 128 }); this.fillType7 = this.fillType7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { h: 128 }); /* pie */ this.pie1 = this.pie1 || this.primaryColor; this.pie2 = this.pie2 || this.secondaryColor; this.pie3 = this.pie3 || this.tertiaryColor; this.pie4 = this.pie4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { l: -10 }); this.pie5 = this.pie5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { l: -10 }); this.pie6 = this.pie6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.tertiaryColor, { l: -10 }); this.pie7 = this.pie7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: +60, l: -10 }); this.pie8 = this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -60, l: -10 }); this.pie9 = this.pie9 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 120, l: 0 }); this.pie10 = this.pie10 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: +60, l: -20 }); this.pie11 = this.pie11 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -60, l: -20 }); this.pie12 = this.pie12 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 120, l: -10 }); this.pieTitleTextSize = this.pieTitleTextSize || '25px'; this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; this.pieSectionTextSize = this.pieSectionTextSize || '17px'; this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; this.pieLegendTextSize = this.pieLegendTextSize || '17px'; this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; this.pieStrokeColor = this.pieStrokeColor || 'black'; this.pieStrokeWidth = this.pieStrokeWidth || '2px'; this.pieOpacity = this.pieOpacity || '0.7'; /* requirement-diagram */ this.requirementBackground = this.requirementBackground || this.primaryColor; this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; this.relationColor = this.relationColor || this.lineColor; this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.secondaryColor, 30) : this.secondaryColor); this.relationLabelColor = this.relationLabelColor || this.actorTextColor; /* git */ this.git0 = this.git0 || this.primaryColor; this.git1 = this.git1 || this.secondaryColor; this.git2 = this.git2 || this.tertiaryColor; this.git3 = this.git3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -30 }); this.git4 = this.git4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -60 }); this.git5 = this.git5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -90 }); this.git6 = this.git6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: +60 }); this.git7 = this.git7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: +120 }); if (this.darkMode) { this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git0, 25); this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git1, 25); this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git2, 25); this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git3, 25); this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git4, 25); this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git5, 25); this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git6, 25); this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git7, 25); } else { this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git0, 25); this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git1, 25); this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git2, 25); this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git3, 25); this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git4, 25); this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git5, 25); this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git6, 25); this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25); } this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0); this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1); this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2); this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3); this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4); this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5); this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6); this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7); this.branchLabelColor = this.branchLabelColor || (this.darkMode ? 'black' : this.labelTextColor); this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor; this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor; this.gitBranchLabel2 = this.gitBranchLabel2 || this.branchLabelColor; this.gitBranchLabel3 = this.gitBranchLabel3 || this.branchLabelColor; this.gitBranchLabel4 = this.gitBranchLabel4 || this.branchLabelColor; this.gitBranchLabel5 = this.gitBranchLabel5 || this.branchLabelColor; this.gitBranchLabel6 = this.gitBranchLabel6 || this.branchLabelColor; this.gitBranchLabel7 = this.gitBranchLabel7 || this.branchLabelColor; this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; } }, { key: "calculate", value: function calculate(overrides) { var _this = this; if (_typeof(overrides) !== 'object') { // Calculate colors form base colors this.updateColors(); return; } var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors keys.forEach(function (k) { _this[k] = overrides[k]; }); // Calculate colors form base colors this.updateColors(); // Copy values from overrides again in case of an override of derived value keys.forEach(function (k) { _this[k] = overrides[k]; }); } }]); return Theme; }(); var getThemeVariables = function getThemeVariables(userOverrides) { var theme = new Theme(); theme.calculate(userOverrides); return theme; }; /***/ }), /***/ "./src/themes/theme-dark.js": /*!**********************************!*\ !*** ./src/themes/theme-dark.js ***! \**********************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "getThemeVariables": () => (/* binding */ getThemeVariables) /* harmony export */ }); /* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); /* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } var Theme = /*#__PURE__*/function () { function Theme() { _classCallCheck(this, Theme); this.background = '#333'; this.primaryColor = '#1f2020'; this.secondaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.primaryColor, 16); this.tertiaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -160 }); this.primaryBorderColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); this.secondaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.secondaryColor, this.darkMode); this.tertiaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.tertiaryColor, this.darkMode); this.primaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.primaryColor); this.secondaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.secondaryColor); this.tertiaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.tertiaryColor); this.lineColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); this.textColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); this.mainBkg = '#1f2020'; this.secondBkg = 'calculated'; this.mainContrastColor = 'lightgrey'; this.darkTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)((0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)('#323D47'), 10); this.lineColor = 'calculated'; this.border1 = '#81B1DB'; this.border2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.rgba)(255, 255, 255, 0.25); this.arrowheadColor = 'calculated'; this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; this.fontSize = '16px'; this.labelBackground = '#181818'; this.textColor = '#ccc'; /* Flowchart variables */ this.nodeBkg = 'calculated'; this.nodeBorder = 'calculated'; this.clusterBkg = 'calculated'; this.clusterBorder = 'calculated'; this.defaultLinkColor = 'calculated'; this.titleColor = '#F9FFFE'; this.edgeLabelBackground = 'calculated'; /* Sequence Diagram variables */ this.actorBorder = 'calculated'; this.actorBkg = 'calculated'; this.actorTextColor = 'calculated'; this.actorLineColor = 'calculated'; this.signalColor = 'calculated'; this.signalTextColor = 'calculated'; this.labelBoxBkgColor = 'calculated'; this.labelBoxBorderColor = 'calculated'; this.labelTextColor = 'calculated'; this.loopTextColor = 'calculated'; this.noteBorderColor = 'calculated'; this.noteBkgColor = '#fff5ad'; this.noteTextColor = 'calculated'; this.activationBorderColor = 'calculated'; this.activationBkgColor = 'calculated'; this.sequenceNumberColor = 'black'; /* Gantt chart variables */ this.sectionBkgColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)('#EAE8D9', 30); this.altSectionBkgColor = 'calculated'; this.sectionBkgColor2 = '#EAE8D9'; this.taskBorderColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.rgba)(255, 255, 255, 70); this.taskBkgColor = 'calculated'; this.taskTextColor = 'calculated'; this.taskTextLightColor = 'calculated'; this.taskTextOutsideColor = 'calculated'; this.taskTextClickableColor = '#003163'; this.activeTaskBorderColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.rgba)(255, 255, 255, 50); this.activeTaskBkgColor = '#81B1DB'; this.gridColor = 'calculated'; this.doneTaskBkgColor = 'calculated'; this.doneTaskBorderColor = 'grey'; this.critBorderColor = '#E83737'; this.critBkgColor = '#E83737'; this.taskTextDarkColor = 'calculated'; this.todayLineColor = '#DB5757'; /* state colors */ this.labelColor = 'calculated'; this.errorBkgColor = '#a44141'; this.errorTextColor = '#ddd'; } _createClass(Theme, [{ key: "updateColors", value: function updateColors() { this.secondBkg = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.mainBkg, 16); this.lineColor = this.mainContrastColor; this.arrowheadColor = this.mainContrastColor; /* Flowchart variables */ this.nodeBkg = this.mainBkg; this.nodeBorder = this.border1; this.clusterBkg = this.secondBkg; this.clusterBorder = this.border2; this.defaultLinkColor = this.lineColor; this.edgeLabelBackground = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.labelBackground, 25); /* Sequence Diagram variables */ this.actorBorder = this.border1; this.actorBkg = this.mainBkg; this.actorTextColor = this.mainContrastColor; this.actorLineColor = this.mainContrastColor; this.signalColor = this.mainContrastColor; this.signalTextColor = this.mainContrastColor; this.labelBoxBkgColor = this.actorBkg; this.labelBoxBorderColor = this.actorBorder; this.labelTextColor = this.mainContrastColor; this.loopTextColor = this.mainContrastColor; this.noteBorderColor = this.secondaryBorderColor; this.noteBkgColor = this.secondBkg; this.noteTextColor = this.secondaryTextColor; this.activationBorderColor = this.border1; this.activationBkgColor = this.secondBkg; /* Gantt chart variables */ this.altSectionBkgColor = this.background; this.taskBkgColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.mainBkg, 23); this.taskTextColor = this.darkTextColor; this.taskTextLightColor = this.mainContrastColor; this.taskTextOutsideColor = this.taskTextLightColor; this.gridColor = this.mainContrastColor; this.doneTaskBkgColor = this.mainContrastColor; this.taskTextDarkColor = this.darkTextColor; /* state colors */ this.transitionColor = this.transitionColor || this.lineColor; this.transitionLabelColor = this.transitionLabelColor || this.textColor; this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; this.stateBkg = this.stateBkg || this.mainBkg; this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; this.altBackground = this.altBackground || '#555'; this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; this.compositeBorder = this.compositeBorder || this.nodeBorder; this.innerEndBackground = this.primaryBorderColor; this.specialStateColor = '#f4f4f4'; // this.lineColor; this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; this.fillType0 = this.primaryColor; this.fillType1 = this.secondaryColor; this.fillType2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 64 }); this.fillType3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { h: 64 }); this.fillType4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -64 }); this.fillType5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { h: -64 }); this.fillType6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 128 }); this.fillType7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { h: 128 }); /* pie */ this.pie1 = this.pie1 || '#0b0000'; this.pie2 = this.pie2 || '#4d1037'; this.pie3 = this.pie3 || '#3f5258'; this.pie4 = this.pie4 || '#4f2f1b'; this.pie5 = this.pie5 || '#6e0a0a'; this.pie6 = this.pie6 || '#3b0048'; this.pie7 = this.pie7 || '#995a01'; this.pie8 = this.pie8 || '#154706'; this.pie9 = this.pie9 || '#161722'; this.pie10 = this.pie10 || '#00296f'; this.pie11 = this.pie11 || '#01629c'; this.pie12 = this.pie12 || '#010029'; this.pieTitleTextSize = this.pieTitleTextSize || '25px'; this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; this.pieSectionTextSize = this.pieSectionTextSize || '17px'; this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; this.pieLegendTextSize = this.pieLegendTextSize || '17px'; this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; this.pieStrokeColor = this.pieStrokeColor || 'black'; this.pieStrokeWidth = this.pieStrokeWidth || '2px'; this.pieOpacity = this.pieOpacity || '0.7'; /* class */ this.classText = this.primaryTextColor; /* requirement-diagram */ this.requirementBackground = this.requirementBackground || this.primaryColor; this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; this.relationColor = this.relationColor || this.lineColor; this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.secondaryColor, 30) : this.secondaryColor); this.relationLabelColor = this.relationLabelColor || this.actorTextColor; /* git */ this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.secondaryColor, 20); this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie2 || this.secondaryColor, 20); this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie3 || this.tertiaryColor, 20); this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -30 }), 20); this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -60 }), 20); this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -90 }), 10); this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: +60 }), 10); this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: +120 }), 20); this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0); this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1); this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2); this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3); this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4); this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5); this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6); this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7); this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; } }, { key: "calculate", value: function calculate(overrides) { var _this = this; if (_typeof(overrides) !== 'object') { // Calculate colors form base colors this.updateColors(); return; } var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors keys.forEach(function (k) { _this[k] = overrides[k]; }); // Calculate colors form base colors this.updateColors(); // Copy values from overrides again in case of an override of derived value keys.forEach(function (k) { _this[k] = overrides[k]; }); } }]); return Theme; }(); var getThemeVariables = function getThemeVariables(userOverrides) { var theme = new Theme(); theme.calculate(userOverrides); return theme; }; /***/ }), /***/ "./src/themes/theme-default.js": /*!*************************************!*\ !*** ./src/themes/theme-default.js ***! \*************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "getThemeVariables": () => (/* binding */ getThemeVariables) /* harmony export */ }); /* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); /* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } var Theme = /*#__PURE__*/function () { function Theme() { _classCallCheck(this, Theme); /* Base variables */ this.background = '#f4f4f4'; this.primaryColor = '#ECECFF'; this.secondaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 120 }); this.secondaryColor = '#ffffde'; this.tertiaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -160 }); this.primaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.primaryColor, this.darkMode); this.secondaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.secondaryColor, this.darkMode); this.tertiaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.tertiaryColor, this.darkMode); // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode); this.primaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.primaryColor); this.secondaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.secondaryColor); this.tertiaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.tertiaryColor); this.lineColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); this.textColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); this.background = 'white'; this.mainBkg = '#ECECFF'; this.secondBkg = '#ffffde'; this.lineColor = '#333333'; this.border1 = '#9370DB'; this.border2 = '#aaaa33'; this.arrowheadColor = '#333333'; this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; this.fontSize = '16px'; this.labelBackground = '#e8e8e8'; this.textColor = '#333'; /* Flowchart variables */ this.nodeBkg = 'calculated'; this.nodeBorder = 'calculated'; this.clusterBkg = 'calculated'; this.clusterBorder = 'calculated'; this.defaultLinkColor = 'calculated'; this.titleColor = 'calculated'; this.edgeLabelBackground = 'calculated'; /* Sequence Diagram variables */ this.actorBorder = 'calculated'; this.actorBkg = 'calculated'; this.actorTextColor = 'black'; this.actorLineColor = 'grey'; this.signalColor = 'calculated'; this.signalTextColor = 'calculated'; this.labelBoxBkgColor = 'calculated'; this.labelBoxBorderColor = 'calculated'; this.labelTextColor = 'calculated'; this.loopTextColor = 'calculated'; this.noteBorderColor = 'calculated'; this.noteBkgColor = '#fff5ad'; this.noteTextColor = 'calculated'; this.activationBorderColor = '#666'; this.activationBkgColor = '#f4f4f4'; this.sequenceNumberColor = 'white'; /* Gantt chart variables */ this.sectionBkgColor = 'calculated'; this.altSectionBkgColor = 'calculated'; this.sectionBkgColor2 = 'calculated'; this.excludeBkgColor = '#eeeeee'; this.taskBorderColor = 'calculated'; this.taskBkgColor = 'calculated'; this.taskTextLightColor = 'calculated'; this.taskTextColor = this.taskTextLightColor; this.taskTextDarkColor = 'calculated'; this.taskTextOutsideColor = this.taskTextDarkColor; this.taskTextClickableColor = 'calculated'; this.activeTaskBorderColor = 'calculated'; this.activeTaskBkgColor = 'calculated'; this.gridColor = 'calculated'; this.doneTaskBkgColor = 'calculated'; this.doneTaskBorderColor = 'calculated'; this.critBorderColor = 'calculated'; this.critBkgColor = 'calculated'; this.todayLineColor = 'calculated'; this.sectionBkgColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.rgba)(102, 102, 255, 0.49); this.altSectionBkgColor = 'white'; this.sectionBkgColor2 = '#fff400'; this.taskBorderColor = '#534fbc'; this.taskBkgColor = '#8a90dd'; this.taskTextLightColor = 'white'; this.taskTextColor = 'calculated'; this.taskTextDarkColor = 'black'; this.taskTextOutsideColor = 'calculated'; this.taskTextClickableColor = '#003163'; this.activeTaskBorderColor = '#534fbc'; this.activeTaskBkgColor = '#bfc7ff'; this.gridColor = 'lightgrey'; this.doneTaskBkgColor = 'lightgrey'; this.doneTaskBorderColor = 'grey'; this.critBorderColor = '#ff8888'; this.critBkgColor = 'red'; this.todayLineColor = 'red'; /* state colors */ this.labelColor = 'black'; this.errorBkgColor = '#552222'; this.errorTextColor = '#552222'; this.updateColors(); } _createClass(Theme, [{ key: "updateColors", value: function updateColors() { /* Flowchart variables */ this.nodeBkg = this.mainBkg; this.nodeBorder = this.border1; // border 1 this.clusterBkg = this.secondBkg; this.clusterBorder = this.border2; this.defaultLinkColor = this.lineColor; this.titleColor = this.textColor; this.edgeLabelBackground = this.labelBackground; /* Sequence Diagram variables */ // this.actorBorder = lighten(this.border1, 0.5); this.actorBorder = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.border1, 23); this.actorBkg = this.mainBkg; this.labelBoxBkgColor = this.actorBkg; this.signalColor = this.textColor; this.signalTextColor = this.textColor; this.labelBoxBorderColor = this.actorBorder; this.labelTextColor = this.actorTextColor; this.loopTextColor = this.actorTextColor; this.noteBorderColor = this.border2; this.noteTextColor = this.actorTextColor; /* Gantt chart variables */ this.taskTextColor = this.taskTextLightColor; this.taskTextOutsideColor = this.taskTextDarkColor; /* state colors */ this.transitionColor = this.transitionColor || this.lineColor; this.transitionLabelColor = this.transitionLabelColor || this.textColor; this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; this.stateBkg = this.stateBkg || this.mainBkg; this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; this.altBackground = this.altBackground || '#f0f0f0'; this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; this.compositeBorder = this.compositeBorder || this.nodeBorder; this.innerEndBackground = this.nodeBorder; this.specialStateColor = this.lineColor; this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; this.transitionColor = this.transitionColor || this.lineColor; /* class */ this.classText = this.primaryTextColor; /* journey */ this.fillType0 = this.primaryColor; this.fillType1 = this.secondaryColor; this.fillType2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 64 }); this.fillType3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { h: 64 }); this.fillType4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -64 }); this.fillType5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { h: -64 }); this.fillType6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 128 }); this.fillType7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { h: 128 }); /* pie */ this.pie1 = this.pie1 || this.primaryColor; this.pie2 = this.pie2 || this.secondaryColor; this.pie3 = this.pie3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.tertiaryColor, { l: -40 }); this.pie4 = this.pie4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { l: -10 }); this.pie5 = this.pie5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { l: -30 }); this.pie6 = this.pie6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.tertiaryColor, { l: -20 }); this.pie7 = this.pie7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: +60, l: -20 }); this.pie8 = this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -60, l: -40 }); this.pie9 = this.pie9 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 120, l: -40 }); this.pie10 = this.pie10 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: +60, l: -40 }); this.pie11 = this.pie11 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -90, l: -40 }); this.pie12 = this.pie12 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 120, l: -30 }); this.pieTitleTextSize = this.pieTitleTextSize || '25px'; this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; this.pieSectionTextSize = this.pieSectionTextSize || '17px'; this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; this.pieLegendTextSize = this.pieLegendTextSize || '17px'; this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; this.pieStrokeColor = this.pieStrokeColor || 'black'; this.pieStrokeWidth = this.pieStrokeWidth || '2px'; this.pieOpacity = this.pieOpacity || '0.7'; /* requirement-diagram */ this.requirementBackground = this.requirementBackground || this.primaryColor; this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; this.relationColor = this.relationColor || this.lineColor; this.relationLabelBackground = this.relationLabelBackground || this.labelBackground; this.relationLabelColor = this.relationLabelColor || this.actorTextColor; /* git */ this.git0 = this.git0 || this.primaryColor; this.git1 = this.git1 || this.secondaryColor; this.git2 = this.git2 || this.tertiaryColor; this.git3 = this.git3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -30 }); this.git4 = this.git4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -60 }); this.git5 = this.git5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -90 }); this.git6 = this.git6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: +60 }); this.git7 = this.git7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: +120 }); if (this.darkMode) { this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git0, 25); this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git1, 25); this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git2, 25); this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git3, 25); this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git4, 25); this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git5, 25); this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git6, 25); this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git7, 25); } else { this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git0, 25); this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git1, 25); this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git2, 25); this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git3, 25); this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git4, 25); this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git5, 25); this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git6, 25); this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25); } this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)((0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0), 25); this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1); this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2); this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3); this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4); this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5); this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6); this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7); this.gitBranchLabel0 = this.gitBranchLabel0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.labelTextColor); this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor; this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor; this.gitBranchLabel3 = this.gitBranchLabel3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.labelTextColor); this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor; this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor; this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor; this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor; this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; } }, { key: "calculate", value: function calculate(overrides) { var _this = this; if (_typeof(overrides) !== 'object') { // Calculate colors form base colors this.updateColors(); return; } var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors keys.forEach(function (k) { _this[k] = overrides[k]; }); // Calculate colors form base colors this.updateColors(); // Copy values from overrides again in case of an override of derived value keys.forEach(function (k) { _this[k] = overrides[k]; }); } }]); return Theme; }(); var getThemeVariables = function getThemeVariables(userOverrides) { var theme = new Theme(); theme.calculate(userOverrides); return theme; }; /***/ }), /***/ "./src/themes/theme-forest.js": /*!************************************!*\ !*** ./src/themes/theme-forest.js ***! \************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "getThemeVariables": () => (/* binding */ getThemeVariables) /* harmony export */ }); /* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); /* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } var Theme = /*#__PURE__*/function () { function Theme() { _classCallCheck(this, Theme); /* Base vales */ this.background = '#f4f4f4'; this.primaryColor = '#cde498'; this.secondaryColor = '#cdffb2'; this.background = 'white'; this.mainBkg = '#cde498'; this.secondBkg = '#cdffb2'; this.lineColor = 'green'; this.border1 = '#13540c'; this.border2 = '#6eaa49'; this.arrowheadColor = 'green'; this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; this.fontSize = '16px'; this.tertiaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)('#cde498', 10); this.primaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.primaryColor, this.darkMode); this.secondaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.secondaryColor, this.darkMode); this.tertiaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.tertiaryColor, this.darkMode); this.primaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.primaryColor); this.secondaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.secondaryColor); this.tertiaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.primaryColor); this.lineColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); this.textColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); /* Flowchart variables */ this.nodeBkg = 'calculated'; this.nodeBorder = 'calculated'; this.clusterBkg = 'calculated'; this.clusterBorder = 'calculated'; this.defaultLinkColor = 'calculated'; this.titleColor = '#333'; this.edgeLabelBackground = '#e8e8e8'; /* Sequence Diagram variables */ this.actorBorder = 'calculated'; this.actorBkg = 'calculated'; this.actorTextColor = 'black'; this.actorLineColor = 'grey'; this.signalColor = '#333'; this.signalTextColor = '#333'; this.labelBoxBkgColor = 'calculated'; this.labelBoxBorderColor = '#326932'; this.labelTextColor = 'calculated'; this.loopTextColor = 'calculated'; this.noteBorderColor = 'calculated'; this.noteBkgColor = '#fff5ad'; this.noteTextColor = 'calculated'; this.activationBorderColor = '#666'; this.activationBkgColor = '#f4f4f4'; this.sequenceNumberColor = 'white'; /* Gantt chart variables */ this.sectionBkgColor = '#6eaa49'; this.altSectionBkgColor = 'white'; this.sectionBkgColor2 = '#6eaa49'; this.excludeBkgColor = '#eeeeee'; this.taskBorderColor = 'calculated'; this.taskBkgColor = '#487e3a'; this.taskTextLightColor = 'white'; this.taskTextColor = 'calculated'; this.taskTextDarkColor = 'black'; this.taskTextOutsideColor = 'calculated'; this.taskTextClickableColor = '#003163'; this.activeTaskBorderColor = 'calculated'; this.activeTaskBkgColor = 'calculated'; this.gridColor = 'lightgrey'; this.doneTaskBkgColor = 'lightgrey'; this.doneTaskBorderColor = 'grey'; this.critBorderColor = '#ff8888'; this.critBkgColor = 'red'; this.todayLineColor = 'red'; /* state colors */ this.labelColor = 'black'; this.errorBkgColor = '#552222'; this.errorTextColor = '#552222'; } _createClass(Theme, [{ key: "updateColors", value: function updateColors() { /* Flowchart variables */ this.nodeBkg = this.mainBkg; this.nodeBorder = this.border1; this.clusterBkg = this.secondBkg; this.clusterBorder = this.border2; this.defaultLinkColor = this.lineColor; /* Sequence Diagram variables */ this.actorBorder = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.mainBkg, 20); this.actorBkg = this.mainBkg; this.labelBoxBkgColor = this.actorBkg; this.labelTextColor = this.actorTextColor; this.loopTextColor = this.actorTextColor; this.noteBorderColor = this.border2; this.noteTextColor = this.actorTextColor; /* Gantt chart variables */ this.taskBorderColor = this.border1; this.taskTextColor = this.taskTextLightColor; this.taskTextOutsideColor = this.taskTextDarkColor; this.activeTaskBorderColor = this.taskBorderColor; this.activeTaskBkgColor = this.mainBkg; /* state colors */ this.transitionColor = this.transitionColor || this.lineColor; this.transitionLabelColor = this.transitionLabelColor || this.textColor; this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; this.stateBkg = this.stateBkg || this.mainBkg; this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; this.altBackground = this.altBackground || '#f0f0f0'; this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; this.compositeBorder = this.compositeBorder || this.nodeBorder; this.innerEndBackground = this.primaryBorderColor; this.specialStateColor = this.lineColor; this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; this.transitionColor = this.transitionColor || this.lineColor; /* class */ this.classText = this.primaryTextColor; /* journey */ this.fillType0 = this.primaryColor; this.fillType1 = this.secondaryColor; this.fillType2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 64 }); this.fillType3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { h: 64 }); this.fillType4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -64 }); this.fillType5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { h: -64 }); this.fillType6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 128 }); this.fillType7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { h: 128 }); /* pie */ this.pie1 = this.pie1 || this.primaryColor; this.pie2 = this.pie2 || this.secondaryColor; this.pie3 = this.pie3 || this.tertiaryColor; this.pie4 = this.pie4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { l: -30 }); this.pie5 = this.pie5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { l: -30 }); this.pie6 = this.pie6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.tertiaryColor, { h: +40, l: -40 }); this.pie7 = this.pie7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: +60, l: -10 }); this.pie8 = this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -60, l: -10 }); this.pie9 = this.pie9 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 120, l: 0 }); this.pie10 = this.pie10 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: +60, l: -50 }); this.pie11 = this.pie11 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -60, l: -50 }); this.pie12 = this.pie12 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 120, l: -50 }); this.pieTitleTextSize = this.pieTitleTextSize || '25px'; this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; this.pieSectionTextSize = this.pieSectionTextSize || '17px'; this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; this.pieLegendTextSize = this.pieLegendTextSize || '17px'; this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; this.pieStrokeColor = this.pieStrokeColor || 'black'; this.pieStrokeWidth = this.pieStrokeWidth || '2px'; this.pieOpacity = this.pieOpacity || '0.7'; /* requirement-diagram */ this.requirementBackground = this.requirementBackground || this.primaryColor; this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; this.relationColor = this.relationColor || this.lineColor; this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground; this.relationLabelColor = this.relationLabelColor || this.actorTextColor; /* git */ this.git0 = this.git0 || this.primaryColor; this.git1 = this.git1 || this.secondaryColor; this.git2 = this.git2 || this.tertiaryColor; this.git3 = this.git3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -30 }); this.git4 = this.git4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -60 }); this.git5 = this.git5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -90 }); this.git6 = this.git6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: +60 }); this.git7 = this.git7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: +120 }); if (this.darkMode) { this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git0, 25); this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git1, 25); this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git2, 25); this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git3, 25); this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git4, 25); this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git5, 25); this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git6, 25); this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git7, 25); } else { this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git0, 25); this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git1, 25); this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git2, 25); this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git3, 25); this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git4, 25); this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git5, 25); this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git6, 25); this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25); } this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0); this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1); this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2); this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3); this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4); this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5); this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6); this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7); this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; } }, { key: "calculate", value: function calculate(overrides) { var _this = this; if (_typeof(overrides) !== 'object') { // Calculate colors form base colors this.updateColors(); return; } var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors keys.forEach(function (k) { _this[k] = overrides[k]; }); // Calculate colors form base colors this.updateColors(); // Copy values from overrides again in case of an override of derived value keys.forEach(function (k) { _this[k] = overrides[k]; }); } }]); return Theme; }(); var getThemeVariables = function getThemeVariables(userOverrides) { var theme = new Theme(); theme.calculate(userOverrides); return theme; }; /***/ }), /***/ "./src/themes/theme-helpers.js": /*!*************************************!*\ !*** ./src/themes/theme-helpers.js ***! \*************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "mkBorder": () => (/* binding */ mkBorder) /* harmony export */ }); /* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); /* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); var mkBorder = function mkBorder(col, darkMode) { return darkMode ? (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(col, { s: -40, l: 10 }) : (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(col, { s: -40, l: -10 }); }; /***/ }), /***/ "./src/themes/theme-neutral.js": /*!*************************************!*\ !*** ./src/themes/theme-neutral.js ***! \*************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "getThemeVariables": () => (/* binding */ getThemeVariables) /* harmony export */ }); /* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); /* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } // const Color = require ( 'khroma/dist/color' ).default // Color.format.hex.stringify(Color.parse('hsl(210, 66.6666666667%, 95%)')); // => "#EAF2FB" var Theme = /*#__PURE__*/function () { function Theme() { _classCallCheck(this, Theme); this.primaryColor = '#eee'; this.contrast = '#707070'; this.secondaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.contrast, 55); this.background = '#ffffff'; // this.secondaryColor = adjust(this.primaryColor, { h: 120 }); this.tertiaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -160 }); this.primaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.primaryColor, this.darkMode); this.secondaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.secondaryColor, this.darkMode); this.tertiaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.tertiaryColor, this.darkMode); // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode); this.primaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.primaryColor); this.secondaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.secondaryColor); this.tertiaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.tertiaryColor); this.lineColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); this.textColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); // this.altBackground = lighten(this.contrast, 55); this.mainBkg = '#eee'; this.secondBkg = 'calculated'; this.lineColor = '#666'; this.border1 = '#999'; this.border2 = 'calculated'; this.note = '#ffa'; this.text = '#333'; this.critical = '#d42'; this.done = '#bbb'; this.arrowheadColor = '#333333'; this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; this.fontSize = '16px'; /* Flowchart variables */ this.nodeBkg = 'calculated'; this.nodeBorder = 'calculated'; this.clusterBkg = 'calculated'; this.clusterBorder = 'calculated'; this.defaultLinkColor = 'calculated'; this.titleColor = 'calculated'; this.edgeLabelBackground = 'white'; /* Sequence Diagram variables */ this.actorBorder = 'calculated'; this.actorBkg = 'calculated'; this.actorTextColor = 'calculated'; this.actorLineColor = 'calculated'; this.signalColor = 'calculated'; this.signalTextColor = 'calculated'; this.labelBoxBkgColor = 'calculated'; this.labelBoxBorderColor = 'calculated'; this.labelTextColor = 'calculated'; this.loopTextColor = 'calculated'; this.noteBorderColor = 'calculated'; this.noteBkgColor = 'calculated'; this.noteTextColor = 'calculated'; this.activationBorderColor = '#666'; this.activationBkgColor = '#f4f4f4'; this.sequenceNumberColor = 'white'; /* Gantt chart variables */ this.sectionBkgColor = 'calculated'; this.altSectionBkgColor = 'white'; this.sectionBkgColor2 = 'calculated'; this.excludeBkgColor = '#eeeeee'; this.taskBorderColor = 'calculated'; this.taskBkgColor = 'calculated'; this.taskTextLightColor = 'white'; this.taskTextColor = 'calculated'; this.taskTextDarkColor = 'calculated'; this.taskTextOutsideColor = 'calculated'; this.taskTextClickableColor = '#003163'; this.activeTaskBorderColor = 'calculated'; this.activeTaskBkgColor = 'calculated'; this.gridColor = 'calculated'; this.doneTaskBkgColor = 'calculated'; this.doneTaskBorderColor = 'calculated'; this.critBkgColor = 'calculated'; this.critBorderColor = 'calculated'; this.todayLineColor = 'calculated'; /* state colors */ this.labelColor = 'black'; this.errorBkgColor = '#552222'; this.errorTextColor = '#552222'; } _createClass(Theme, [{ key: "updateColors", value: function updateColors() { this.secondBkg = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.contrast, 55); this.border2 = this.contrast; /* Flowchart variables */ this.nodeBkg = this.mainBkg; this.nodeBorder = this.border1; this.clusterBkg = this.secondBkg; this.clusterBorder = this.border2; this.defaultLinkColor = this.lineColor; this.titleColor = this.text; /* Sequence Diagram variables */ this.actorBorder = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.border1, 23); this.actorBkg = this.mainBkg; this.actorTextColor = this.text; this.actorLineColor = this.lineColor; this.signalColor = this.text; this.signalTextColor = this.text; this.labelBoxBkgColor = this.actorBkg; this.labelBoxBorderColor = this.actorBorder; this.labelTextColor = this.text; this.loopTextColor = this.text; this.noteBorderColor = '#999'; this.noteBkgColor = '#666'; this.noteTextColor = '#fff'; /* Gantt chart variables */ this.sectionBkgColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.contrast, 30); this.sectionBkgColor2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.contrast, 30); this.taskBorderColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.contrast, 10); this.taskBkgColor = this.contrast; this.taskTextColor = this.taskTextLightColor; this.taskTextDarkColor = this.text; this.taskTextOutsideColor = this.taskTextDarkColor; this.activeTaskBorderColor = this.taskBorderColor; this.activeTaskBkgColor = this.mainBkg; this.gridColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.border1, 30); this.doneTaskBkgColor = this.done; this.doneTaskBorderColor = this.lineColor; this.critBkgColor = this.critical; this.critBorderColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.critBkgColor, 10); this.todayLineColor = this.critBkgColor; /* state colors */ this.transitionColor = this.transitionColor || '#000'; this.transitionLabelColor = this.transitionLabelColor || this.textColor; this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; this.stateBkg = this.stateBkg || this.mainBkg; this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; this.altBackground = this.altBackground || '#f4f4f4'; this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; this.stateBorder = this.stateBorder || '#000'; this.innerEndBackground = this.primaryBorderColor; this.specialStateColor = '#222'; this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; /* class */ this.classText = this.primaryTextColor; /* journey */ this.fillType0 = this.primaryColor; this.fillType1 = this.secondaryColor; this.fillType2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 64 }); this.fillType3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { h: 64 }); this.fillType4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -64 }); this.fillType5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { h: -64 }); this.fillType6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: 128 }); this.fillType7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { h: 128 }); // /* pie */ this.pie1 = this.pie1 || '#F4F4F4'; this.pie2 = this.pie2 || '#555'; this.pie3 = this.pie3 || '#BBB'; this.pie4 = this.pie4 || '#777'; this.pie5 = this.pie5 || '#999'; this.pie6 = this.pie6 || '#DDD'; this.pie7 = this.pie7 || '#FFF'; this.pie8 = this.pie8 || '#DDD'; this.pie9 = this.pie9 || '#BBB'; this.pie10 = this.pie10 || '#999'; this.pie11 = this.pie11 || '#777'; this.pie12 = this.pie12 || '#555'; this.pieTitleTextSize = this.pieTitleTextSize || '25px'; this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; this.pieSectionTextSize = this.pieSectionTextSize || '17px'; this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; this.pieLegendTextSize = this.pieLegendTextSize || '17px'; this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; this.pieStrokeColor = this.pieStrokeColor || 'black'; this.pieStrokeWidth = this.pieStrokeWidth || '2px'; this.pieOpacity = this.pieOpacity || '0.7'; // this.pie1 = this.pie1 || '#212529'; // this.pie2 = this.pie2 || '#343A40'; // this.pie3 = this.pie3 || '#495057'; // this.pie4 = this.pie4 || '#6C757D'; // this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -10 }); // this.pie6 = this.pie6 || adjust(this.tertiaryColor, { l: -10 }); // this.pie7 = this.pie7 || adjust(this.primaryColor, { h: +60, l: -10 }); // this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -10 }); // this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: 0 }); // this.pie10 = this.pie10 || adjust(this.primaryColor, { h: +60, l: -20 }); // this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -60, l: -20 }); // this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -10 }); /* requirement-diagram */ this.requirementBackground = this.requirementBackground || this.primaryColor; this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; this.relationColor = this.relationColor || this.lineColor; this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground; this.relationLabelColor = this.relationLabelColor || this.actorTextColor; /* git */ this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.pie1, 25) || this.primaryColor; this.git1 = this.pie2 || this.secondaryColor; this.git2 = this.pie3 || this.tertiaryColor; this.git3 = this.pie4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -30 }); this.git4 = this.pie5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -60 }); this.git5 = this.pie6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: -90 }); this.git6 = this.pie7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: +60 }); this.git7 = this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { h: +120 }); this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0); this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1); this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2); this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3); this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4); this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5); this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6); this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7); this.branchLabelColor = this.branchLabelColor || this.labelTextColor; this.gitBranchLabel0 = this.branchLabelColor; this.gitBranchLabel1 = 'white'; this.gitBranchLabel2 = this.branchLabelColor; this.gitBranchLabel3 = 'white'; this.gitBranchLabel4 = this.branchLabelColor; this.gitBranchLabel5 = this.branchLabelColor; this.gitBranchLabel6 = this.branchLabelColor; this.gitBranchLabel7 = this.branchLabelColor; this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; } }, { key: "calculate", value: function calculate(overrides) { var _this = this; if (_typeof(overrides) !== 'object') { // Calculate colors form base colors this.updateColors(); return; } var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors keys.forEach(function (k) { _this[k] = overrides[k]; }); // Calculate colors form base colors this.updateColors(); // Copy values from overrides again in case of an override of derived value keys.forEach(function (k) { _this[k] = overrides[k]; }); } }]); return Theme; }(); var getThemeVariables = function getThemeVariables(userOverrides) { var theme = new Theme(); theme.calculate(userOverrides); return theme; }; /***/ }), /***/ "./src/utils.js": /*!**********************!*\ !*** ./src/utils.js ***! \**********************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "assignWithDepth": () => (/* binding */ assignWithDepth), /* harmony export */ "calculateSvgSizeAttrs": () => (/* binding */ calculateSvgSizeAttrs), /* harmony export */ "calculateTextDimensions": () => (/* binding */ calculateTextDimensions), /* harmony export */ "calculateTextHeight": () => (/* binding */ calculateTextHeight), /* harmony export */ "calculateTextWidth": () => (/* binding */ calculateTextWidth), /* harmony export */ "configureSvgSize": () => (/* binding */ configureSvgSize), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ "detectDirective": () => (/* binding */ detectDirective), /* harmony export */ "detectInit": () => (/* binding */ detectInit), /* harmony export */ "detectType": () => (/* binding */ detectType), /* harmony export */ "directiveSanitizer": () => (/* binding */ directiveSanitizer), /* harmony export */ "drawSimpleText": () => (/* binding */ drawSimpleText), /* harmony export */ "entityDecode": () => (/* binding */ entityDecode), /* harmony export */ "formatUrl": () => (/* binding */ formatUrl), /* harmony export */ "generateId": () => (/* binding */ generateId), /* harmony export */ "getStylesFromArray": () => (/* binding */ getStylesFromArray), /* harmony export */ "getTextObj": () => (/* binding */ getTextObj), /* harmony export */ "initIdGeneratior": () => (/* binding */ initIdGeneratior), /* harmony export */ "interpolateToCurve": () => (/* binding */ interpolateToCurve), /* harmony export */ "isSubstringInArray": () => (/* binding */ isSubstringInArray), /* harmony export */ "random": () => (/* binding */ random), /* harmony export */ "runFunc": () => (/* binding */ runFunc), /* harmony export */ "sanitizeCss": () => (/* binding */ sanitizeCss), /* harmony export */ "wrapLabel": () => (/* binding */ wrapLabel) /* harmony export */ }); /* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @braintree/sanitize-url */ "@braintree/sanitize-url"); /* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3 */ "d3"); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./diagrams/common/common */ "./src/diagrams/common/common.js"); /* harmony import */ var _defaultConfig__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defaultConfig */ "./src/defaultConfig.js"); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./logger */ "./src/logger.js"); var _this = undefined; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } // Effectively an enum of the supported curve types, accessible by name var d3CurveTypes = { curveBasis: d3__WEBPACK_IMPORTED_MODULE_1__.curveBasis, curveBasisClosed: d3__WEBPACK_IMPORTED_MODULE_1__.curveBasisClosed, curveBasisOpen: d3__WEBPACK_IMPORTED_MODULE_1__.curveBasisOpen, curveLinear: d3__WEBPACK_IMPORTED_MODULE_1__.curveLinear, curveLinearClosed: d3__WEBPACK_IMPORTED_MODULE_1__.curveLinearClosed, curveMonotoneX: d3__WEBPACK_IMPORTED_MODULE_1__.curveMonotoneX, curveMonotoneY: d3__WEBPACK_IMPORTED_MODULE_1__.curveMonotoneY, curveNatural: d3__WEBPACK_IMPORTED_MODULE_1__.curveNatural, curveStep: d3__WEBPACK_IMPORTED_MODULE_1__.curveStep, curveStepAfter: d3__WEBPACK_IMPORTED_MODULE_1__.curveStepAfter, curveStepBefore: d3__WEBPACK_IMPORTED_MODULE_1__.curveStepBefore }; var directive = /[%]{2}[{]\s*(?:(?:(\w+)\s*:|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; var directiveWithoutOpen = /\s*(?:(?:(\w+)(?=:):|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; var anyComment = /\s*%%.*\n/gm; /** * @function detectInit Detects the init config object from the text * * ```mermaid * %%{init: {"theme": "debug", "logLevel": 1 }}%% * graph LR * a-->b * b-->c * c-->d * d-->e * e-->f * f-->g * g-->h * ``` * * Or * * ```mermaid * %%{initialize: {"theme": "dark", logLevel: "debug" }}%% * graph LR * a-->b * b-->c * c-->d * d-->e * e-->f * f-->g * g-->h * ``` * @param {string} text The text defining the graph * @param {any} cnf * @returns {object} The json object representing the init passed to mermaid.initialize() */ var detectInit = function detectInit(text, cnf) { var inits = detectDirective(text, /(?:init\b)|(?:initialize\b)/); var results = {}; if (Array.isArray(inits)) { var args = inits.map(function (init) { return init.args; }); directiveSanitizer(args); results = assignWithDepth(results, _toConsumableArray(args)); } else { results = inits.args; } if (results) { var type = detectType(text, cnf); ['config'].forEach(function (prop) { if (typeof results[prop] !== 'undefined') { if (type === 'flowchart-v2') { type = 'flowchart'; } results[type] = results[prop]; delete results[prop]; } }); } // Todo: refactor this, these results are never used return results; }; /** * @function detectDirective Detects the directive from the text. Text can be single line or * multiline. If type is null or omitted the first directive encountered in text will be returned * * ```mermaid * graph LR * %%{somedirective}%% * a-->b * b-->c * c-->d * d-->e * e-->f * f-->g * g-->h * ``` * @param {string} text The text defining the graph * @param {string | RegExp} type The directive to return (default: null) * @returns {object | Array} An object or Array representing the directive(s): { type: string, args: * object|null } matched by the input type if a single directive was found, that directive object * will be returned. */ var detectDirective = function detectDirective(text) { var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; try { var commentWithoutDirectives = new RegExp("[%]{2}(?![{]".concat(directiveWithoutOpen.source, ")(?=[}][%]{2}).*\n"), 'ig'); text = text.trim().replace(commentWithoutDirectives, '').replace(/'/gm, '"'); _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug("Detecting diagram directive".concat(type !== null ? ' type:' + type : '', " based on the text:").concat(text)); var match, result = []; while ((match = directive.exec(text)) !== null) { // This is necessary to avoid infinite loops with zero-width matches if (match.index === directive.lastIndex) { directive.lastIndex++; } if (match && !type || type && match[1] && match[1].match(type) || type && match[2] && match[2].match(type)) { var _type = match[1] ? match[1] : match[2]; var args = match[3] ? match[3].trim() : match[4] ? JSON.parse(match[4].trim()) : null; result.push({ type: _type, args: args }); } } if (result.length === 0) { result.push({ type: text, args: null }); } return result.length === 1 ? result[0] : result; } catch (error) { _logger__WEBPACK_IMPORTED_MODULE_2__.log.error("ERROR: ".concat(error.message, " - Unable to parse directive\n ").concat(type !== null ? ' type:' + type : '', " based on the text:").concat(text)); return { type: null, args: null }; } }; /** * @function detectType Detects the type of the graph text. Takes into consideration the possible * existence of an %%init directive * * ```mermaid * %%{initialize: {"startOnLoad": true, logLevel: "fatal" }}%% * graph LR * a-->b * b-->c * c-->d * d-->e * e-->f * f-->g * g-->h * ``` * @param {string} text The text defining the graph * @param {{ * class: { defaultRenderer: string } | undefined; * state: { defaultRenderer: string } | undefined; * flowchart: { defaultRenderer: string } | undefined; * }} [cnf] * @returns {string} A graph definition key */ var detectType = function detectType(text, cnf) { text = text.replace(directive, '').replace(anyComment, '\n'); if (text.match(/^\s*sequenceDiagram/)) { return 'sequence'; } if (text.match(/^\s*gantt/)) { return 'gantt'; } if (text.match(/^\s*classDiagram-v2/)) { return 'classDiagram'; } if (text.match(/^\s*classDiagram/)) { if (cnf && cnf.class && cnf.class.defaultRenderer === 'dagre-wrapper') return 'classDiagram'; return 'class'; } if (text.match(/^\s*stateDiagram-v2/)) { return 'stateDiagram'; } if (text.match(/^\s*stateDiagram/)) { if (cnf && cnf.class && cnf.state.defaultRenderer === 'dagre-wrapper') return 'stateDiagram'; return 'state'; } if (text.match(/^\s*gitGraph/)) { return 'gitGraph'; } if (text.match(/^\s*flowchart/)) { return 'flowchart-v2'; } if (text.match(/^\s*info/)) { return 'info'; } if (text.match(/^\s*pie/)) { return 'pie'; } if (text.match(/^\s*erDiagram/)) { return 'er'; } if (text.match(/^\s*journey/)) { return 'journey'; } if (text.match(/^\s*requirement/) || text.match(/^\s*requirementDiagram/)) { return 'requirement'; } if (cnf && cnf.flowchart && cnf.flowchart.defaultRenderer === 'dagre-wrapper') return 'flowchart-v2'; return 'flowchart'; }; /** * Caches results of functions based on input * * @param {Function} fn Function to run * @param {Function} resolver Function that resolves to an ID given arguments the `fn` takes * @returns {Function} An optimized caching function */ var memoize = function memoize(fn, resolver) { var cache = {}; return function () { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var n = resolver ? resolver.apply(_this, args) : args[0]; if (n in cache) { return cache[n]; } else { var result = fn.apply(void 0, args); cache[n] = result; return result; } }; }; /** * @function isSubstringInArray Detects whether a substring in present in a given array * @param {string} str The substring to detect * @param {Array} arr The array to search * @returns {number} The array index containing the substring or -1 if not present */ var isSubstringInArray = function isSubstringInArray(str, arr) { for (var i = 0; i < arr.length; i++) { if (arr[i].match(str)) return i; } return -1; }; /** * Returns a d3 curve given a curve name * * @param {string | undefined} interpolate The interpolation name * @param {any} defaultCurve The default curve to return * @returns {import('d3-shape').CurveFactory} The curve factory to use */ var interpolateToCurve = function interpolateToCurve(interpolate, defaultCurve) { if (!interpolate) { return defaultCurve; } var curveName = "curve".concat(interpolate.charAt(0).toUpperCase() + interpolate.slice(1)); return d3CurveTypes[curveName] || defaultCurve; }; /** * Formats a URL string * * @param {string} linkStr String of the URL * @param {{ securityLevel: string }} config Configuration passed to MermaidJS * @returns {string | undefined} The formatted URL */ var formatUrl = function formatUrl(linkStr, config) { var url = linkStr.trim(); if (url) { if (config.securityLevel !== 'loose') { return (0,_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__.sanitizeUrl)(url); } return url; } }; /** * Runs a function * * @param {string} functionName A dot seperated path to the function relative to the `window` * @param {...any} params Parameters to pass to the function */ var runFunc = function runFunc(functionName) { var _obj; var arrPaths = functionName.split('.'); var len = arrPaths.length - 1; var fnName = arrPaths[len]; var obj = window; for (var i = 0; i < len; i++) { obj = obj[arrPaths[i]]; if (!obj) return; } for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { params[_key2 - 1] = arguments[_key2]; } (_obj = obj)[fnName].apply(_obj, params); }; /** * @typedef {object} Point A (x, y) point * @property {number} x The x value * @property {number} y The y value */ /** * Finds the distance between two points using the Distance Formula * * @param {Point} p1 The first point * @param {Point} p2 The second point * @returns {number} The distance */ var distance = function distance(p1, p2) { return p1 && p2 ? Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) : 0; }; /** * @param {Point[]} points List of points * @returns {Point} * @todo Give this a description */ var traverseEdge = function traverseEdge(points) { var prevPoint; var totalDistance = 0; points.forEach(function (point) { totalDistance += distance(point, prevPoint); prevPoint = point; }); // Traverse half of total distance along points var remainingDistance = totalDistance / 2; var center = undefined; prevPoint = undefined; points.forEach(function (point) { if (prevPoint && !center) { var vectorDistance = distance(point, prevPoint); if (vectorDistance < remainingDistance) { remainingDistance -= vectorDistance; } else { // The point is remainingDistance from prevPoint in the vector between prevPoint and point // Calculate the coordinates var distanceRatio = remainingDistance / vectorDistance; if (distanceRatio <= 0) center = prevPoint; if (distanceRatio >= 1) center = { x: point.x, y: point.y }; if (distanceRatio > 0 && distanceRatio < 1) { center = { x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y }; } } } prevPoint = point; }); return center; }; /** * Alias for `traverseEdge` * * @param {Point[]} points List of points * @returns {Point} Return result of `transverseEdge` */ var calcLabelPosition = function calcLabelPosition(points) { return traverseEdge(points); }; var calcCardinalityPosition = function calcCardinalityPosition(isRelationTypePresent, points, initialPosition) { var prevPoint; var totalDistance = 0; // eslint-disable-line _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('our points', points); if (points[0] !== initialPosition) { points = points.reverse(); } points.forEach(function (point) { totalDistance += distance(point, prevPoint); prevPoint = point; }); // Traverse only 25 total distance along points to find cardinality point var distanceToCardinalityPoint = 25; var remainingDistance = distanceToCardinalityPoint; var center; prevPoint = undefined; points.forEach(function (point) { if (prevPoint && !center) { var vectorDistance = distance(point, prevPoint); if (vectorDistance < remainingDistance) { remainingDistance -= vectorDistance; } else { // The point is remainingDistance from prevPoint in the vector between prevPoint and point // Calculate the coordinates var distanceRatio = remainingDistance / vectorDistance; if (distanceRatio <= 0) center = prevPoint; if (distanceRatio >= 1) center = { x: point.x, y: point.y }; if (distanceRatio > 0 && distanceRatio < 1) { center = { x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y }; } } } prevPoint = point; }); // if relation is present (Arrows will be added), change cardinality point off-set distance (d) var d = isRelationTypePresent ? 10 : 5; //Calculate Angle for x and y axis var angle = Math.atan2(points[0].y - center.y, points[0].x - center.x); var cardinalityPosition = { x: 0, y: 0 }; //Calculation cardinality position using angle, center point on the line/curve but pendicular and with offset-distance cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2; cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2; return cardinalityPosition; }; /** * Position ['start_left', 'start_right', 'end_left', 'end_right'] * * @param {any} terminalMarkerSize * @param {any} position * @param {any} _points * @returns {any} */ var calcTerminalLabelPosition = function calcTerminalLabelPosition(terminalMarkerSize, position, _points) { // Todo looking to faster cloning method var points = JSON.parse(JSON.stringify(_points)); var prevPoint; var totalDistance = 0; // eslint-disable-line _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('our points', points); if (position !== 'start_left' && position !== 'start_right') { points = points.reverse(); } points.forEach(function (point) { totalDistance += distance(point, prevPoint); prevPoint = point; }); // Traverse only 25 total distance along points to find cardinality point var distanceToCardinalityPoint = 25 + terminalMarkerSize; var remainingDistance = distanceToCardinalityPoint; var center; prevPoint = undefined; points.forEach(function (point) { if (prevPoint && !center) { var vectorDistance = distance(point, prevPoint); if (vectorDistance < remainingDistance) { remainingDistance -= vectorDistance; } else { // The point is remainingDistance from prevPoint in the vector between prevPoint and point // Calculate the coordinates var distanceRatio = remainingDistance / vectorDistance; if (distanceRatio <= 0) center = prevPoint; if (distanceRatio >= 1) center = { x: point.x, y: point.y }; if (distanceRatio > 0 && distanceRatio < 1) { center = { x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y }; } } } prevPoint = point; }); // if relation is present (Arrows will be added), change cardinality point off-set distance (d) var d = 10 + terminalMarkerSize * 0.5; //Calculate Angle for x and y axis var angle = Math.atan2(points[0].y - center.y, points[0].x - center.x); var cardinalityPosition = { x: 0, y: 0 }; //Calculation cardinality position using angle, center point on the line/curve but pendicular and with offset-distance cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2; cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2; if (position === 'start_left') { cardinalityPosition.x = Math.sin(angle + Math.PI) * d + (points[0].x + center.x) / 2; cardinalityPosition.y = -Math.cos(angle + Math.PI) * d + (points[0].y + center.y) / 2; } if (position === 'end_right') { cardinalityPosition.x = Math.sin(angle - Math.PI) * d + (points[0].x + center.x) / 2 - 5; cardinalityPosition.y = -Math.cos(angle - Math.PI) * d + (points[0].y + center.y) / 2 - 5; } if (position === 'end_left') { cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2 - 5; cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2 - 5; } return cardinalityPosition; }; /** * Gets styles from an array of declarations * * @param {string[]} arr Declarations * @returns {{ style: string; labelStyle: string }} The styles grouped as strings */ var getStylesFromArray = function getStylesFromArray(arr) { var style = ''; var labelStyle = ''; for (var i = 0; i < arr.length; i++) { if (typeof arr[i] !== 'undefined') { // add text properties to label style definition if (arr[i].startsWith('color:') || arr[i].startsWith('text-align:')) { labelStyle = labelStyle + arr[i] + ';'; } else { style = style + arr[i] + ';'; } } } return { style: style, labelStyle: labelStyle }; }; var cnt = 0; var generateId = function generateId() { cnt++; return 'id-' + Math.random().toString(36).substr(2, 12) + '-' + cnt; }; /** * @param {any} length * @returns {any} */ function makeid(length) { var result = ''; var characters = '0123456789abcdef'; var charactersLength = characters.length; for (var i = 0; i < length; i++) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); } return result; } var random = function random(options) { return makeid(options.length); }; /** * @function assignWithDepth Extends the functionality of {@link ObjectConstructor.assign} with the * ability to merge arbitrary-depth objects For each key in src with path `k` (recursively) * performs an Object.assign(dst[`k`], src[`k`]) with a slight change from the typical handling of * undefined for dst[`k`]: instead of raising an error, dst[`k`] is auto-initialized to {} and * effectively merged with src[`k`]

Additionally, dissimilar types will not clobber unless the * config.clobber parameter === true. Example: * * ```js * let config_0 = { foo: { bar: 'bar' }, bar: 'foo' }; * let config_1 = { foo: 'foo', bar: 'bar' }; * let result = assignWithDepth(config_0, config_1); * console.log(result); * //-> result: { foo: { bar: 'bar' }, bar: 'bar' } * ``` * * Traditional Object.assign would have clobbered foo in config_0 with foo in config_1. If src is a * destructured array of objects and dst is not an array, assignWithDepth will apply each element * of src to dst in order. * @param dst * @param src * @param config * @param dst * @param src * @param config * @param dst * @param src * @param config * @param {any} dst - The destination of the merge * @param {any} src - The source object(s) to merge into destination * @param {{ depth: number; clobber: boolean }} [config={ depth: 2, clobber: false }] - Depth: depth * to traverse within src and dst for merging - clobber: should dissimilar types clobber (default: * { depth: 2, clobber: false }). Default is `{ depth: 2, clobber: false }` * @returns {any} */ var assignWithDepth = function assignWithDepth(dst, src, config) { var _Object$assign = Object.assign({ depth: 2, clobber: false }, config), depth = _Object$assign.depth, clobber = _Object$assign.clobber; if (Array.isArray(src) && !Array.isArray(dst)) { src.forEach(function (s) { return assignWithDepth(dst, s, config); }); return dst; } else if (Array.isArray(src) && Array.isArray(dst)) { src.forEach(function (s) { if (dst.indexOf(s) === -1) { dst.push(s); } }); return dst; } if (typeof dst === 'undefined' || depth <= 0) { if (dst !== undefined && dst !== null && _typeof(dst) === 'object' && _typeof(src) === 'object') { return Object.assign(dst, src); } else { return src; } } if (typeof src !== 'undefined' && _typeof(dst) === 'object' && _typeof(src) === 'object') { Object.keys(src).forEach(function (key) { if (_typeof(src[key]) === 'object' && (dst[key] === undefined || _typeof(dst[key]) === 'object')) { if (dst[key] === undefined) { dst[key] = Array.isArray(src[key]) ? [] : {}; } dst[key] = assignWithDepth(dst[key], src[key], { depth: depth - 1, clobber: clobber }); } else if (clobber || _typeof(dst[key]) !== 'object' && _typeof(src[key]) !== 'object') { dst[key] = src[key]; } }); } return dst; }; var getTextObj = function getTextObj() { return { x: 0, y: 0, fill: undefined, anchor: 'start', style: '#666', width: 100, height: 100, textMargin: 0, rx: 0, ry: 0, valign: undefined }; }; /** * Adds text to an element * * @param {SVGElement} elem Element to add text to * @param {{ * text: string; * x: number; * y: number; * anchor: 'start' | 'middle' | 'end'; * fontFamily: string; * fontSize: string | number; * fontWeight: string | number; * fill: string; * class: string | undefined; * textMargin: number; * }} textData * @returns {SVGTextElement} Text element with given styling and content */ var drawSimpleText = function drawSimpleText(elem, textData) { // Remove and ignore br:s var nText = textData.text.replace(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__["default"].lineBreakRegex, ' '); var textElem = elem.append('text'); textElem.attr('x', textData.x); textElem.attr('y', textData.y); textElem.style('text-anchor', textData.anchor); textElem.style('font-family', textData.fontFamily); textElem.style('font-size', textData.fontSize); textElem.style('font-weight', textData.fontWeight); textElem.attr('fill', textData.fill); if (typeof textData.class !== 'undefined') { textElem.attr('class', textData.class); } var span = textElem.append('tspan'); span.attr('x', textData.x + textData.textMargin * 2); span.attr('fill', textData.fill); span.text(nText); return textElem; }; var wrapLabel = memoize(function (label, maxWidth, config) { if (!label) { return label; } config = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: 'Arial', joinWith: '
' }, config); if (_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__["default"].lineBreakRegex.test(label)) { return label; } var words = label.split(' '); var completedLines = []; var nextLine = ''; words.forEach(function (word, index) { var wordLength = calculateTextWidth("".concat(word, " "), config); var nextLineLength = calculateTextWidth(nextLine, config); if (wordLength > maxWidth) { var _breakString = breakString(word, maxWidth, '-', config), hyphenatedStrings = _breakString.hyphenatedStrings, remainingWord = _breakString.remainingWord; completedLines.push.apply(completedLines, [nextLine].concat(_toConsumableArray(hyphenatedStrings))); nextLine = remainingWord; } else if (nextLineLength + wordLength >= maxWidth) { completedLines.push(nextLine); nextLine = word; } else { nextLine = [nextLine, word].filter(Boolean).join(' '); } var currentWord = index + 1; var isLastWord = currentWord === words.length; if (isLastWord) { completedLines.push(nextLine); } }); return completedLines.filter(function (line) { return line !== ''; }).join(config.joinWith); }, function (label, maxWidth, config) { return "".concat(label, "-").concat(maxWidth, "-").concat(config.fontSize, "-").concat(config.fontWeight, "-").concat(config.fontFamily, "-").concat(config.joinWith); }); var breakString = memoize(function (word, maxWidth) { var hyphenCharacter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '-'; var config = arguments.length > 3 ? arguments[3] : undefined; config = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: 'Arial', margin: 0 }, config); var characters = word.split(''); var lines = []; var currentLine = ''; characters.forEach(function (character, index) { var nextLine = "".concat(currentLine).concat(character); var lineWidth = calculateTextWidth(nextLine, config); if (lineWidth >= maxWidth) { var currentCharacter = index + 1; var isLastLine = characters.length === currentCharacter; var hyphenatedNextLine = "".concat(nextLine).concat(hyphenCharacter); lines.push(isLastLine ? nextLine : hyphenatedNextLine); currentLine = ''; } else { currentLine = nextLine; } }); return { hyphenatedStrings: lines, remainingWord: currentLine }; }, function (word, maxWidth) { var hyphenCharacter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '-'; var config = arguments.length > 3 ? arguments[3] : undefined; return "".concat(word, "-").concat(maxWidth, "-").concat(hyphenCharacter, "-").concat(config.fontSize, "-").concat(config.fontWeight, "-").concat(config.fontFamily); }); /** * This calculates the text's height, taking into account the wrap breaks and both the statically * configured height, width, and the length of the text (in pixels). * * If the wrapped text text has greater height, we extend the height, so it's value won't overflow. * * @param {any} text The text to measure * @param {any} config - The config for fontSize, fontFamily, and fontWeight all impacting the resulting size * @returns {any} - The height for the given text */ var calculateTextHeight = function calculateTextHeight(text, config) { config = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: 'Arial', margin: 15 }, config); return calculateTextDimensions(text, config).height; }; /** * This calculates the width of the given text, font size and family. * * @param {any} text - The text to calculate the width of * @param {any} config - The config for fontSize, fontFamily, and fontWeight all impacting the resulting size * @returns {any} - The width for the given text */ var calculateTextWidth = function calculateTextWidth(text, config) { config = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: 'Arial' }, config); return calculateTextDimensions(text, config).width; }; /** * This calculates the dimensions of the given text, font size, font family, font weight, and margins. * * @param {any} text - The text to calculate the width of * @param {any} config - The config for fontSize, fontFamily, fontWeight, and margin all impacting * the resulting size * @returns - The width for the given text */ var calculateTextDimensions = memoize(function (text, config) { config = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: 'Arial' }, config); var _config = config, fontSize = _config.fontSize, fontFamily = _config.fontFamily, fontWeight = _config.fontWeight; if (!text) { return { width: 0, height: 0 }; } // We can't really know if the user supplied font family will render on the user agent; // thus, we'll take the max width between the user supplied font family, and a default // of sans-serif. var fontFamilies = ['sans-serif', fontFamily]; var lines = text.split(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__["default"].lineBreakRegex); var dims = []; var body = (0,d3__WEBPACK_IMPORTED_MODULE_1__.select)('body'); // We don't want to leak DOM elements - if a removal operation isn't available // for any reason, do not continue. if (!body.remove) { return { width: 0, height: 0, lineHeight: 0 }; } var g = body.append('svg'); for (var _i = 0, _fontFamilies = fontFamilies; _i < _fontFamilies.length; _i++) { var _fontFamily = _fontFamilies[_i]; var cheight = 0; var dim = { width: 0, height: 0, lineHeight: 0 }; var _iterator = _createForOfIteratorHelper(lines), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var line = _step.value; var textObj = getTextObj(); textObj.text = line; var textElem = drawSimpleText(g, textObj).style('font-size', fontSize).style('font-weight', fontWeight).style('font-family', _fontFamily); var bBox = (textElem._groups || textElem)[0][0].getBBox(); dim.width = Math.round(Math.max(dim.width, bBox.width)); cheight = Math.round(bBox.height); dim.height += cheight; dim.lineHeight = Math.round(Math.max(dim.lineHeight, cheight)); } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } dims.push(dim); } g.remove(); var index = isNaN(dims[1].height) || isNaN(dims[1].width) || isNaN(dims[1].lineHeight) || dims[0].height > dims[1].height && dims[0].width > dims[1].width && dims[0].lineHeight > dims[1].lineHeight ? 0 : 1; return dims[index]; }, function (text, config) { return "".concat(text, "-").concat(config.fontSize, "-").concat(config.fontWeight, "-").concat(config.fontFamily); }); /** * Applys d3 attributes * * @param {any} d3Elem D3 Element to apply the attributes onto * @param {[string, string][]} attrs Object.keys equivalent format of key to value mapping of attributes */ var d3Attrs = function d3Attrs(d3Elem, attrs) { var _iterator2 = _createForOfIteratorHelper(attrs), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { var attr = _step2.value; d3Elem.attr(attr[0], attr[1]); } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } }; /** * Gives attributes for an SVG's size given arguments * * @param {number} height The height of the SVG * @param {number} width The width of the SVG * @param {boolean} useMaxWidth Whether or not to use max-width and set width to 100% * @returns {Map<'height' | 'width' | 'style', string>} Attributes for the SVG */ var calculateSvgSizeAttrs = function calculateSvgSizeAttrs(height, width, useMaxWidth) { var attrs = new Map(); attrs.set('height', height); if (useMaxWidth) { attrs.set('width', '100%'); attrs.set('style', "max-width: ".concat(width, "px;")); } else { attrs.set('width', width); } return attrs; }; /** * Applies attributes from `calculateSvgSizeAttrs` * * @param {SVGSVGElement} svgElem The SVG Element to configure * @param {number} height The height of the SVG * @param {number} width The width of the SVG * @param {boolean} useMaxWidth Whether or not to use max-width and set width to 100% */ var configureSvgSize = function configureSvgSize(svgElem, height, width, useMaxWidth) { var attrs = calculateSvgSizeAttrs(height, width, useMaxWidth); d3Attrs(svgElem, attrs); }; var initIdGeneratior = /*#__PURE__*/function () { function iterator(deterministic, seed) { _classCallCheck(this, iterator); this.deterministic = deterministic; this.seed = seed; this.count = seed ? seed.length : 0; } _createClass(iterator, [{ key: "next", value: function next() { if (!this.deterministic) return Date.now(); return this.count++; } }]); return iterator; }(); var decoder; /** * Decodes HTML, source: {@link https://github.com/shrpne/entity-decode/blob/v2.0.1/browser.js} * * @param {string} html HTML as a string * @returns Unescaped HTML */ var entityDecode = function entityDecode(html) { decoder = decoder || document.createElement('div'); // Escape HTML before decoding for HTML Entities html = escape(html).replace(/%26/g, '&').replace(/%23/g, '#').replace(/%3B/g, ';'); // decoding decoder.innerHTML = html; return unescape(decoder.textContent); }; /** * Sanitizes directive objects * * @param {object} args Directive's JSON */ var directiveSanitizer = function directiveSanitizer(args) { _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('directiveSanitizer called with', args); if (_typeof(args) === 'object') { // check for array if (args.length) { args.forEach(function (arg) { return directiveSanitizer(arg); }); } else { // This is an object Object.keys(args).forEach(function (key) { _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('Checking key', key); if (key.indexOf('__') === 0) { _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitize deleting __ option', key); delete args[key]; } if (key.indexOf('proto') >= 0) { _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitize deleting proto option', key); delete args[key]; } if (key.indexOf('constr') >= 0) { _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitize deleting constr option', key); delete args[key]; } if (key.indexOf('themeCSS') >= 0) { _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitizing themeCss option'); args[key] = sanitizeCss(args[key]); } if (_defaultConfig__WEBPACK_IMPORTED_MODULE_4__.configKeys.indexOf(key) < 0) { _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitize deleting option', key); delete args[key]; } else { if (_typeof(args[key]) === 'object') { _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitize deleting object', key); directiveSanitizer(args[key]); } } }); } } }; var sanitizeCss = function sanitizeCss(str) { var stringsearch = 'o'; var startCnt = (str.match(/\{/g) || []).length; var endCnt = (str.match(/\}/g) || []).length; if (startCnt !== endCnt) { return '{ /* ERROR: Unbalanced CSS */ }'; } // Todo add more checks here return str; }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ assignWithDepth: assignWithDepth, wrapLabel: wrapLabel, calculateTextHeight: calculateTextHeight, calculateTextWidth: calculateTextWidth, calculateTextDimensions: calculateTextDimensions, calculateSvgSizeAttrs: calculateSvgSizeAttrs, configureSvgSize: configureSvgSize, detectInit: detectInit, detectDirective: detectDirective, detectType: detectType, isSubstringInArray: isSubstringInArray, interpolateToCurve: interpolateToCurve, calcLabelPosition: calcLabelPosition, calcCardinalityPosition: calcCardinalityPosition, calcTerminalLabelPosition: calcTerminalLabelPosition, formatUrl: formatUrl, getStylesFromArray: getStylesFromArray, generateId: generateId, random: random, memoize: memoize, runFunc: runFunc, entityDecode: entityDecode, initIdGeneratior: initIdGeneratior, directiveSanitizer: directiveSanitizer, sanitizeCss: sanitizeCss }); /***/ }), /***/ "./node_modules/path-browserify/index.js": /*!***********************************************!*\ !*** ./node_modules/path-browserify/index.js ***! \***********************************************/ /***/ ((module) => { "use strict"; // 'path' module extracted from Node.js v8.11.1 (only the posix part) // transplited with Babel // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. function assertPath(path) { if (typeof path !== 'string') { throw new TypeError('Path must be a string. Received ' + JSON.stringify(path)); } } // Resolves . and .. elements in a path with directory names function normalizeStringPosix(path, allowAboveRoot) { var res = ''; var lastSegmentLength = 0; var lastSlash = -1; var dots = 0; var code; for (var i = 0; i <= path.length; ++i) { if (i < path.length) code = path.charCodeAt(i); else if (code === 47 /*/*/) break; else code = 47 /*/*/; if (code === 47 /*/*/) { if (lastSlash === i - 1 || dots === 1) { // NOOP } else if (lastSlash !== i - 1 && dots === 2) { if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) { if (res.length > 2) { var lastSlashIndex = res.lastIndexOf('/'); if (lastSlashIndex !== res.length - 1) { if (lastSlashIndex === -1) { res = ''; lastSegmentLength = 0; } else { res = res.slice(0, lastSlashIndex); lastSegmentLength = res.length - 1 - res.lastIndexOf('/'); } lastSlash = i; dots = 0; continue; } } else if (res.length === 2 || res.length === 1) { res = ''; lastSegmentLength = 0; lastSlash = i; dots = 0; continue; } } if (allowAboveRoot) { if (res.length > 0) res += '/..'; else res = '..'; lastSegmentLength = 2; } } else { if (res.length > 0) res += '/' + path.slice(lastSlash + 1, i); else res = path.slice(lastSlash + 1, i); lastSegmentLength = i - lastSlash - 1; } lastSlash = i; dots = 0; } else if (code === 46 /*.*/ && dots !== -1) { ++dots; } else { dots = -1; } } return res; } function _format(sep, pathObject) { var dir = pathObject.dir || pathObject.root; var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || ''); if (!dir) { return base; } if (dir === pathObject.root) { return dir + base; } return dir + sep + base; } var posix = { // path.resolve([from ...], to) resolve: function resolve() { var resolvedPath = ''; var resolvedAbsolute = false; var cwd; for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { var path; if (i >= 0) path = arguments[i]; else { if (cwd === undefined) cwd = process.cwd(); path = cwd; } assertPath(path); // Skip empty entries if (path.length === 0) { continue; } resolvedPath = path + '/' + resolvedPath; resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/; } // At this point the path should be resolved to a full absolute path, but // handle relative paths to be safe (might happen when process.cwd() fails) // Normalize the path resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute); if (resolvedAbsolute) { if (resolvedPath.length > 0) return '/' + resolvedPath; else return '/'; } else if (resolvedPath.length > 0) { return resolvedPath; } else { return '.'; } }, normalize: function normalize(path) { assertPath(path); if (path.length === 0) return '.'; var isAbsolute = path.charCodeAt(0) === 47 /*/*/; var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/; // Normalize the path path = normalizeStringPosix(path, !isAbsolute); if (path.length === 0 && !isAbsolute) path = '.'; if (path.length > 0 && trailingSeparator) path += '/'; if (isAbsolute) return '/' + path; return path; }, isAbsolute: function isAbsolute(path) { assertPath(path); return path.length > 0 && path.charCodeAt(0) === 47 /*/*/; }, join: function join() { if (arguments.length === 0) return '.'; var joined; for (var i = 0; i < arguments.length; ++i) { var arg = arguments[i]; assertPath(arg); if (arg.length > 0) { if (joined === undefined) joined = arg; else joined += '/' + arg; } } if (joined === undefined) return '.'; return posix.normalize(joined); }, relative: function relative(from, to) { assertPath(from); assertPath(to); if (from === to) return ''; from = posix.resolve(from); to = posix.resolve(to); if (from === to) return ''; // Trim any leading backslashes var fromStart = 1; for (; fromStart < from.length; ++fromStart) { if (from.charCodeAt(fromStart) !== 47 /*/*/) break; } var fromEnd = from.length; var fromLen = fromEnd - fromStart; // Trim any leading backslashes var toStart = 1; for (; toStart < to.length; ++toStart) { if (to.charCodeAt(toStart) !== 47 /*/*/) break; } var toEnd = to.length; var toLen = toEnd - toStart; // Compare paths to find the longest common path from root var length = fromLen < toLen ? fromLen : toLen; var lastCommonSep = -1; var i = 0; for (; i <= length; ++i) { if (i === length) { if (toLen > length) { if (to.charCodeAt(toStart + i) === 47 /*/*/) { // We get here if `from` is the exact base path for `to`. // For example: from='/foo/bar'; to='/foo/bar/baz' return to.slice(toStart + i + 1); } else if (i === 0) { // We get here if `from` is the root // For example: from='/'; to='/foo' return to.slice(toStart + i); } } else if (fromLen > length) { if (from.charCodeAt(fromStart + i) === 47 /*/*/) { // We get here if `to` is the exact base path for `from`. // For example: from='/foo/bar/baz'; to='/foo/bar' lastCommonSep = i; } else if (i === 0) { // We get here if `to` is the root. // For example: from='/foo'; to='/' lastCommonSep = 0; } } break; } var fromCode = from.charCodeAt(fromStart + i); var toCode = to.charCodeAt(toStart + i); if (fromCode !== toCode) break; else if (fromCode === 47 /*/*/) lastCommonSep = i; } var out = ''; // Generate the relative path based on the path difference between `to` // and `from` for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) { if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) { if (out.length === 0) out += '..'; else out += '/..'; } } // Lastly, append the rest of the destination (`to`) path that comes after // the common path parts if (out.length > 0) return out + to.slice(toStart + lastCommonSep); else { toStart += lastCommonSep; if (to.charCodeAt(toStart) === 47 /*/*/) ++toStart; return to.slice(toStart); } }, _makeLong: function _makeLong(path) { return path; }, dirname: function dirname(path) { assertPath(path); if (path.length === 0) return '.'; var code = path.charCodeAt(0); var hasRoot = code === 47 /*/*/; var end = -1; var matchedSlash = true; for (var i = path.length - 1; i >= 1; --i) { code = path.charCodeAt(i); if (code === 47 /*/*/) { if (!matchedSlash) { end = i; break; } } else { // We saw the first non-path separator matchedSlash = false; } } if (end === -1) return hasRoot ? '/' : '.'; if (hasRoot && end === 1) return '//'; return path.slice(0, end); }, basename: function basename(path, ext) { if (ext !== undefined && typeof ext !== 'string') throw new TypeError('"ext" argument must be a string'); assertPath(path); var start = 0; var end = -1; var matchedSlash = true; var i; if (ext !== undefined && ext.length > 0 && ext.length <= path.length) { if (ext.length === path.length && ext === path) return ''; var extIdx = ext.length - 1; var firstNonSlashEnd = -1; for (i = path.length - 1; i >= 0; --i) { var code = path.charCodeAt(i); if (code === 47 /*/*/) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now if (!matchedSlash) { start = i + 1; break; } } else { if (firstNonSlashEnd === -1) { // We saw the first non-path separator, remember this index in case // we need it if the extension ends up not matching matchedSlash = false; firstNonSlashEnd = i + 1; } if (extIdx >= 0) { // Try to match the explicit extension if (code === ext.charCodeAt(extIdx)) { if (--extIdx === -1) { // We matched the extension, so mark this as the end of our path // component end = i; } } else { // Extension does not match, so our result is the entire path // component extIdx = -1; end = firstNonSlashEnd; } } } } if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length; return path.slice(start, end); } else { for (i = path.length - 1; i >= 0; --i) { if (path.charCodeAt(i) === 47 /*/*/) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now if (!matchedSlash) { start = i + 1; break; } } else if (end === -1) { // We saw the first non-path separator, mark this as the end of our // path component matchedSlash = false; end = i + 1; } } if (end === -1) return ''; return path.slice(start, end); } }, extname: function extname(path) { assertPath(path); var startDot = -1; var startPart = 0; var end = -1; var matchedSlash = true; // Track the state of characters (if any) we see before our first dot and // after any path separator we find var preDotState = 0; for (var i = path.length - 1; i >= 0; --i) { var code = path.charCodeAt(i); if (code === 47 /*/*/) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now if (!matchedSlash) { startPart = i + 1; break; } continue; } if (end === -1) { // We saw the first non-path separator, mark this as the end of our // extension matchedSlash = false; end = i + 1; } if (code === 46 /*.*/) { // If this is our first dot, mark it as the start of our extension if (startDot === -1) startDot = i; else if (preDotState !== 1) preDotState = 1; } else if (startDot !== -1) { // We saw a non-dot and non-path separator before our dot, so we should // have a good chance at having a non-empty extension preDotState = -1; } } if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot preDotState === 0 || // The (right-most) trimmed path component is exactly '..' preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { return ''; } return path.slice(startDot, end); }, format: function format(pathObject) { if (pathObject === null || typeof pathObject !== 'object') { throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject); } return _format('/', pathObject); }, parse: function parse(path) { assertPath(path); var ret = { root: '', dir: '', base: '', ext: '', name: '' }; if (path.length === 0) return ret; var code = path.charCodeAt(0); var isAbsolute = code === 47 /*/*/; var start; if (isAbsolute) { ret.root = '/'; start = 1; } else { start = 0; } var startDot = -1; var startPart = 0; var end = -1; var matchedSlash = true; var i = path.length - 1; // Track the state of characters (if any) we see before our first dot and // after any path separator we find var preDotState = 0; // Get non-dir info for (; i >= start; --i) { code = path.charCodeAt(i); if (code === 47 /*/*/) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now if (!matchedSlash) { startPart = i + 1; break; } continue; } if (end === -1) { // We saw the first non-path separator, mark this as the end of our // extension matchedSlash = false; end = i + 1; } if (code === 46 /*.*/) { // If this is our first dot, mark it as the start of our extension if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1; } else if (startDot !== -1) { // We saw a non-dot and non-path separator before our dot, so we should // have a good chance at having a non-empty extension preDotState = -1; } } if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot preDotState === 0 || // The (right-most) trimmed path component is exactly '..' preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { if (end !== -1) { if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end); } } else { if (startPart === 0 && isAbsolute) { ret.name = path.slice(1, startDot); ret.base = path.slice(1, end); } else { ret.name = path.slice(startPart, startDot); ret.base = path.slice(startPart, end); } ret.ext = path.slice(startDot, end); } if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/'; return ret; }, sep: '/', delimiter: ':', win32: null, posix: null }; posix.posix = posix; module.exports = posix; /***/ }), /***/ "@braintree/sanitize-url": /*!******************************************!*\ !*** external "@braintree/sanitize-url" ***! \******************************************/ /***/ ((module) => { "use strict"; module.exports = require("@braintree/sanitize-url"); /***/ }), /***/ "d3": /*!*********************!*\ !*** external "d3" ***! \*********************/ /***/ ((module) => { "use strict"; module.exports = require("d3"); /***/ }), /***/ "dagre": /*!************************!*\ !*** external "dagre" ***! \************************/ /***/ ((module) => { "use strict"; module.exports = require("dagre"); /***/ }), /***/ "dagre-d3": /*!***************************!*\ !*** external "dagre-d3" ***! \***************************/ /***/ ((module) => { "use strict"; module.exports = require("dagre-d3"); /***/ }), /***/ "dagre-d3/lib/label/add-html-label.js": /*!*******************************************************!*\ !*** external "dagre-d3/lib/label/add-html-label.js" ***! \*******************************************************/ /***/ ((module) => { "use strict"; module.exports = require("dagre-d3/lib/label/add-html-label.js"); /***/ }), /***/ "dompurify": /*!****************************!*\ !*** external "dompurify" ***! \****************************/ /***/ ((module) => { "use strict"; module.exports = require("dompurify"); /***/ }), /***/ "graphlib": /*!***************************!*\ !*** external "graphlib" ***! \***************************/ /***/ ((module) => { "use strict"; module.exports = require("graphlib"); /***/ }), /***/ "khroma": /*!*************************!*\ !*** external "khroma" ***! \*************************/ /***/ ((module) => { "use strict"; module.exports = require("khroma"); /***/ }), /***/ "moment-mini": /*!******************************!*\ !*** external "moment-mini" ***! \******************************/ /***/ ((module) => { "use strict"; module.exports = require("moment-mini"); /***/ }), /***/ "stylis": /*!*************************!*\ !*** external "stylis" ***! \*************************/ /***/ ((module) => { "use strict"; module.exports = require("stylis"); /***/ }), /***/ "?35ed": /*!********************!*\ !*** fs (ignored) ***! \********************/ /***/ (() => { /* (ignored) */ /***/ }), /***/ "?3c87": /*!********************!*\ !*** fs (ignored) ***! \********************/ /***/ (() => { /* (ignored) */ /***/ }), /***/ "?dbae": /*!********************!*\ !*** fs (ignored) ***! \********************/ /***/ (() => { /* (ignored) */ /***/ }), /***/ "?8ed1": /*!********************!*\ !*** fs (ignored) ***! \********************/ /***/ (() => { /* (ignored) */ /***/ }), /***/ "?2b40": /*!********************!*\ !*** fs (ignored) ***! \********************/ /***/ (() => { /* (ignored) */ /***/ }), /***/ "?c5f1": /*!********************!*\ !*** fs (ignored) ***! \********************/ /***/ (() => { /* (ignored) */ /***/ }), /***/ "?a3fa": /*!********************!*\ !*** fs (ignored) ***! \********************/ /***/ (() => { /* (ignored) */ /***/ }), /***/ "?ebf4": /*!********************!*\ !*** fs (ignored) ***! \********************/ /***/ (() => { /* (ignored) */ /***/ }), /***/ "?e940": /*!********************!*\ !*** fs (ignored) ***! \********************/ /***/ (() => { /* (ignored) */ /***/ }), /***/ "?a3b8": /*!********************!*\ !*** fs (ignored) ***! \********************/ /***/ (() => { /* (ignored) */ /***/ }), /***/ "?0f62": /*!********************!*\ !*** fs (ignored) ***! \********************/ /***/ (() => { /* (ignored) */ /***/ }), /***/ "./package.json": /*!**********************!*\ !*** ./package.json ***! \**********************/ /***/ ((module) => { "use strict"; module.exports = JSON.parse('{"name":"mermaid","version":"9.0.1","description":"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.","main":"dist/mermaid.core.js","module":"dist/mermaid.esm.min.mjs","exports":{".":{"require":"./dist/mermaid.core.js","import":"./dist/mermaid.esm.min.mjs"},"./*":"./*"},"keywords":["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph"],"scripts":{"build:development":"webpack --mode development --progress --color","build:production":"webpack --mode production --progress --color","build":"concurrently \\"yarn build:development\\" \\"yarn build:production\\"","postbuild":"documentation build src/mermaidAPI.js src/config.js src/defaultConfig.js --shallow -f md --markdown-toc false > docs/Setup.md","build:watch":"yarn build:development --watch","release":"yarn build","lint":"eslint ./ --ext js,html","lint:fix":"yarn lint --fix","e2e:depr":"yarn lint && jest e2e --config e2e/jest.config.js","cypress":"cypress run","e2e":"start-server-and-test dev http://localhost:9000/ cypress","e2e-upd":"yarn lint && jest e2e -u --config e2e/jest.config.js","dev":"webpack serve --config ./.webpack/webpack.config.e2e.babel.js","test":"yarn lint && jest src/.*","test:watch":"jest --watch src","prepublishOnly":"yarn build && yarn test","prepare":"husky install && yarn build","pre-commit":"lint-staged"},"repository":{"type":"git","url":"https://github.com/knsv/mermaid"},"author":"Knut Sveidqvist","license":"MIT","standard":{"ignore":["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],"globals":["page"]},"dependencies":{"@braintree/sanitize-url":"^6.0.0","caniuse-lite":"^1.0.30001335","d3":"^7.0.0","dagre":"^0.8.5","dagre-d3":"^0.6.4","dompurify":"2.3.6","graphlib":"^2.1.8","khroma":"^2.0.0","moment-mini":"^2.24.0","stylis":"^4.0.10"},"devDependencies":{"@babel/core":"^7.14.6","@babel/eslint-parser":"^7.14.7","@babel/preset-env":"^7.14.7","@babel/register":"^7.14.5","@commitlint/cli":"^16.0.0","@commitlint/config-conventional":"^16.0.0","babel-jest":"^27.0.6","babel-loader":"^8.2.2","concurrently":"^7.0.0","coveralls":"^3.0.2","css-to-string-loader":"^0.1.3","cypress":"9.5.4","cypress-image-snapshot":"^4.0.1","documentation":"13.2.0","eslint":"^8.2.0","eslint-config-prettier":"^8.3.0","eslint-plugin-cypress":"^2.12.1","eslint-plugin-html":"^6.2.0","eslint-plugin-jest":"^26.0.0","eslint-plugin-jsdoc":"^39.1.0","eslint-plugin-markdown":"^2.2.1","eslint-plugin-prettier":"^4.0.0","husky":"^7.0.1","identity-obj-proxy":"^3.0.0","jest":"^27.0.6","jison":"^0.4.18","js-base64":"3.7.2","lint-staged":"^12.1.2","moment":"^2.23.0","path-browserify":"^1.0.1","prettier":"^2.3.2","prettier-plugin-jsdoc":"^0.3.30","start-server-and-test":"^1.12.6","terser-webpack-plugin":"^5.2.4","webpack":"^5.53.0","webpack-cli":"^4.7.2","webpack-dev-server":"^4.3.0","webpack-merge":"^5.8.0","webpack-node-externals":"^3.0.0"},"files":["dist"],"sideEffects":["**/*.css","**/*.scss"]}'); /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ id: moduleId, /******/ loaded: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ // expose the module cache /******/ __webpack_require__.c = __webpack_module_cache__; /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/node module decorator */ /******/ (() => { /******/ __webpack_require__.nmd = (module) => { /******/ module.paths = []; /******/ if (!module.children) module.children = []; /******/ return module; /******/ }; /******/ })(); /******/ /************************************************************************/ /******/ /******/ // module cache are used so entry inlining is disabled /******/ // startup /******/ // Load entry module and return exports /******/ var __webpack_exports__ = __webpack_require__(__webpack_require__.s = "./src/mermaid.js"); /******/ __webpack_exports__ = __webpack_exports__["default"]; /******/ /******/ return __webpack_exports__; /******/ })() ; }); //# sourceMappingURL=mermaid.core.js.map