UNPKG

408 kBJavaScriptView Raw
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory();
4 else if(typeof define === 'function' && define.amd)
5 define([], factory);
6 else if(typeof exports === 'object')
7 exports["mermaid"] = factory();
8 else
9 root["mermaid"] = factory();
10})(window, function() {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14/******/
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17/******/
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId]) {
20/******/ return installedModules[moduleId].exports;
21/******/ }
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ i: moduleId,
25/******/ l: false,
26/******/ exports: {}
27/******/ };
28/******/
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31/******/
32/******/ // Flag the module as loaded
33/******/ module.l = true;
34/******/
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38/******/
39/******/
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42/******/
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45/******/
46/******/ // define getter function for harmony exports
47/******/ __webpack_require__.d = function(exports, name, getter) {
48/******/ if(!__webpack_require__.o(exports, name)) {
49/******/ Object.defineProperty(exports, name, {
50/******/ configurable: false,
51/******/ enumerable: true,
52/******/ get: getter
53/******/ });
54/******/ }
55/******/ };
56/******/
57/******/ // define __esModule on exports
58/******/ __webpack_require__.r = function(exports) {
59/******/ Object.defineProperty(exports, '__esModule', { value: true });
60/******/ };
61/******/
62/******/ // getDefaultExport function for compatibility with non-harmony modules
63/******/ __webpack_require__.n = function(module) {
64/******/ var getter = module && module.__esModule ?
65/******/ function getDefault() { return module['default']; } :
66/******/ function getModuleExports() { return module; };
67/******/ __webpack_require__.d(getter, 'a', getter);
68/******/ return getter;
69/******/ };
70/******/
71/******/ // Object.prototype.hasOwnProperty.call
72/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
73/******/
74/******/ // __webpack_public_path__
75/******/ __webpack_require__.p = "";
76/******/
77/******/
78/******/ // Load entry module and return exports
79/******/ return __webpack_require__(__webpack_require__.s = "./src/mermaid.js");
80/******/ })
81/************************************************************************/
82/******/ ({
83
84/***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/themes/dark/index.scss":
85/*!*******************************************************************************************************!*\
86 !*** ./node_modules/css-loader!./node_modules/sass-loader/lib/loader.js!./src/themes/dark/index.scss ***!
87 \*******************************************************************************************************/
88/*! no static exports found */
89/***/ (function(module, exports, __webpack_require__) {
90
91exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false);
92// imports
93
94
95// module
96exports.push([module.i, "/* Flowchart variables */\n/* Sequence Diagram variables */\n/* Gantt chart variables */\n.label {\n font-family: 'trebuchet ms', verdana, arial;\n color: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon {\n fill: #BDD5EA;\n stroke: purple;\n stroke-width: 1px; }\n\n.node.clickable {\n cursor: pointer; }\n\n.arrowheadPath {\n fill: lightgrey; }\n\n.edgePath .path {\n stroke: lightgrey;\n stroke-width: 1.5px; }\n\n.edgeLabel {\n background-color: #e8e8e8; }\n\n.cluster rect {\n fill: #6D6D65 !important;\n stroke: rgba(255, 255, 255, 0.25) !important;\n stroke-width: 1px !important; }\n\n.cluster text {\n fill: #F9FFFE; }\n\ndiv.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 12px;\n background: #6D6D65;\n border: 1px solid rgba(255, 255, 255, 0.25);\n border-radius: 2px;\n pointer-events: none;\n z-index: 100; }\n\n.actor {\n stroke: #81B1DB;\n fill: #BDD5EA; }\n\ntext.actor {\n fill: black;\n stroke: none; }\n\n.actor-line {\n stroke: lightgrey; }\n\n.messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n marker-end: 'url(#arrowhead)';\n stroke: lightgrey; }\n\n.messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: lightgrey; }\n\n#arrowhead {\n fill: lightgrey; }\n\n#crosshead path {\n fill: lightgrey !important;\n stroke: lightgrey !important; }\n\n.messageText {\n fill: lightgrey;\n stroke: none; }\n\n.labelBox {\n stroke: #81B1DB;\n fill: #BDD5EA; }\n\n.labelText {\n fill: lightgrey;\n stroke: none; }\n\n.loopText {\n fill: lightgrey;\n stroke: none; }\n\n.loopLine {\n stroke-width: 2;\n stroke-dasharray: '2 2';\n marker-end: 'url(#arrowhead)';\n stroke: #81B1DB; }\n\n.note {\n stroke: rgba(255, 255, 255, 0.25);\n fill: #fff5ad; }\n\n.noteText {\n fill: black;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 14px; }\n\n/** Section styling */\n.section {\n stroke: none;\n opacity: 0.2; }\n\n.section0 {\n fill: rgba(255, 255, 255, 0.3); }\n\n.section2 {\n fill: #EAE8B9; }\n\n.section1,\n.section3 {\n fill: white;\n opacity: 0.2; }\n\n.sectionTitle0 {\n fill: #F9FFFE; }\n\n.sectionTitle1 {\n fill: #F9FFFE; }\n\n.sectionTitle2 {\n fill: #F9FFFE; }\n\n.sectionTitle3 {\n fill: #F9FFFE; }\n\n.sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px; }\n\n/* Grid and axis */\n.grid .tick {\n stroke: lightgrey;\n opacity: 0.3;\n shape-rendering: crispEdges; }\n\n.grid path {\n stroke-width: 0; }\n\n/* Today line */\n.today {\n fill: none;\n stroke: #DB5757;\n stroke-width: 2px; }\n\n/* Task styling */\n/* Default task */\n.task {\n stroke-width: 2; }\n\n.taskText {\n text-anchor: middle;\n font-size: 11px; }\n\n.taskTextOutsideRight {\n fill: #323D47;\n text-anchor: start;\n font-size: 11px; }\n\n.taskTextOutsideLeft {\n fill: #323D47;\n text-anchor: end;\n font-size: 11px; }\n\n/* Specific task settings for the sections*/\n.taskText0,\n.taskText1,\n.taskText2,\n.taskText3 {\n fill: #323D47; }\n\n.task0,\n.task1,\n.task2,\n.task3 {\n fill: #BDD5EA;\n stroke: rgba(255, 255, 255, 0.5); }\n\n.taskTextOutside0,\n.taskTextOutside2 {\n fill: lightgrey; }\n\n.taskTextOutside1,\n.taskTextOutside3 {\n fill: lightgrey; }\n\n/* Active task */\n.active0,\n.active1,\n.active2,\n.active3 {\n fill: #81B1DB;\n stroke: rgba(255, 255, 255, 0.5); }\n\n.activeText0,\n.activeText1,\n.activeText2,\n.activeText3 {\n fill: #323D47 !important; }\n\n/* Completed task */\n.done0,\n.done1,\n.done2,\n.done3 {\n stroke: grey;\n fill: lightgrey;\n stroke-width: 2; }\n\n.doneText0,\n.doneText1,\n.doneText2,\n.doneText3 {\n fill: #323D47 !important; }\n\n/* Tasks on the critical line */\n.crit0,\n.crit1,\n.crit2,\n.crit3 {\n stroke: #E83737;\n fill: #E83737;\n stroke-width: 2; }\n\n.activeCrit0,\n.activeCrit1,\n.activeCrit2,\n.activeCrit3 {\n stroke: #E83737;\n fill: #81B1DB;\n stroke-width: 2; }\n\n.doneCrit0,\n.doneCrit1,\n.doneCrit2,\n.doneCrit3 {\n stroke: #E83737;\n fill: lightgrey;\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges; }\n\n.doneCritText0,\n.doneCritText1,\n.doneCritText2,\n.doneCritText3 {\n fill: #323D47 !important; }\n\n.activeCritText0,\n.activeCritText1,\n.activeCritText2,\n.activeCritText3 {\n fill: #323D47 !important; }\n\n.titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: #323D47; }\n\ng.classGroup text {\n fill: purple;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 10px; }\n\ng.classGroup rect {\n fill: #BDD5EA;\n stroke: purple; }\n\ng.classGroup line {\n stroke: purple;\n stroke-width: 1; }\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #BDD5EA;\n opacity: 0.5; }\n\n.classLabel .label {\n fill: purple;\n font-size: 10px; }\n\n.relation {\n stroke: purple;\n stroke-width: 1;\n fill: none; }\n\n#compositionStart {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#compositionEnd {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#aggregationStart {\n fill: #BDD5EA;\n stroke: purple;\n stroke-width: 1; }\n\n#aggregationEnd {\n fill: #BDD5EA;\n stroke: purple;\n stroke-width: 1; }\n\n#dependencyStart {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#dependencyEnd {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#extensionStart {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#extensionEnd {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n.commit-id,\n.commit-msg,\n.branch-label {\n fill: lightgrey;\n color: lightgrey; }\n", ""]);
97
98// exports
99
100
101/***/ }),
102
103/***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/themes/default/index.scss":
104/*!**********************************************************************************************************!*\
105 !*** ./node_modules/css-loader!./node_modules/sass-loader/lib/loader.js!./src/themes/default/index.scss ***!
106 \**********************************************************************************************************/
107/*! no static exports found */
108/***/ (function(module, exports, __webpack_require__) {
109
110exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false);
111// imports
112
113
114// module
115exports.push([module.i, "/* Flowchart variables */\n/* Sequence Diagram variables */\n/* Gantt chart variables */\n.label {\n font-family: 'trebuchet ms', verdana, arial;\n color: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon {\n fill: #ECECFF;\n stroke: #9370DB;\n stroke-width: 1px; }\n\n.node.clickable {\n cursor: pointer; }\n\n.arrowheadPath {\n fill: #333333; }\n\n.edgePath .path {\n stroke: #333333;\n stroke-width: 1.5px; }\n\n.edgeLabel {\n background-color: #e8e8e8; }\n\n.cluster rect {\n fill: #ffffde !important;\n stroke: #aaaa33 !important;\n stroke-width: 1px !important; }\n\n.cluster text {\n fill: #333; }\n\ndiv.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 12px;\n background: #ffffde;\n border: 1px solid #aaaa33;\n border-radius: 2px;\n pointer-events: none;\n z-index: 100; }\n\n.actor {\n stroke: #CCCCFF;\n fill: #ECECFF; }\n\ntext.actor {\n fill: black;\n stroke: none; }\n\n.actor-line {\n stroke: grey; }\n\n.messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n marker-end: 'url(#arrowhead)';\n stroke: #333; }\n\n.messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n#arrowhead {\n fill: #333; }\n\n#crosshead path {\n fill: #333 !important;\n stroke: #333 !important; }\n\n.messageText {\n fill: #333;\n stroke: none; }\n\n.labelBox {\n stroke: #CCCCFF;\n fill: #ECECFF; }\n\n.labelText {\n fill: black;\n stroke: none; }\n\n.loopText {\n fill: black;\n stroke: none; }\n\n.loopLine {\n stroke-width: 2;\n stroke-dasharray: '2 2';\n marker-end: 'url(#arrowhead)';\n stroke: #CCCCFF; }\n\n.note {\n stroke: #aaaa33;\n fill: #fff5ad; }\n\n.noteText {\n fill: black;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 14px; }\n\n/** Section styling */\n.section {\n stroke: none;\n opacity: 0.2; }\n\n.section0 {\n fill: rgba(102, 102, 255, 0.49); }\n\n.section2 {\n fill: #fff400; }\n\n.section1,\n.section3 {\n fill: white;\n opacity: 0.2; }\n\n.sectionTitle0 {\n fill: #333; }\n\n.sectionTitle1 {\n fill: #333; }\n\n.sectionTitle2 {\n fill: #333; }\n\n.sectionTitle3 {\n fill: #333; }\n\n.sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px; }\n\n/* Grid and axis */\n.grid .tick {\n stroke: lightgrey;\n opacity: 0.3;\n shape-rendering: crispEdges; }\n\n.grid path {\n stroke-width: 0; }\n\n/* Today line */\n.today {\n fill: none;\n stroke: red;\n stroke-width: 2px; }\n\n/* Task styling */\n/* Default task */\n.task {\n stroke-width: 2; }\n\n.taskText {\n text-anchor: middle;\n font-size: 11px; }\n\n.taskTextOutsideRight {\n fill: black;\n text-anchor: start;\n font-size: 11px; }\n\n.taskTextOutsideLeft {\n fill: black;\n text-anchor: end;\n font-size: 11px; }\n\n/* Specific task settings for the sections*/\n.taskText0,\n.taskText1,\n.taskText2,\n.taskText3 {\n fill: white; }\n\n.task0,\n.task1,\n.task2,\n.task3 {\n fill: #8a90dd;\n stroke: #534fbc; }\n\n.taskTextOutside0,\n.taskTextOutside2 {\n fill: black; }\n\n.taskTextOutside1,\n.taskTextOutside3 {\n fill: black; }\n\n/* Active task */\n.active0,\n.active1,\n.active2,\n.active3 {\n fill: #bfc7ff;\n stroke: #534fbc; }\n\n.activeText0,\n.activeText1,\n.activeText2,\n.activeText3 {\n fill: black !important; }\n\n/* Completed task */\n.done0,\n.done1,\n.done2,\n.done3 {\n stroke: grey;\n fill: lightgrey;\n stroke-width: 2; }\n\n.doneText0,\n.doneText1,\n.doneText2,\n.doneText3 {\n fill: black !important; }\n\n/* Tasks on the critical line */\n.crit0,\n.crit1,\n.crit2,\n.crit3 {\n stroke: #ff8888;\n fill: red;\n stroke-width: 2; }\n\n.activeCrit0,\n.activeCrit1,\n.activeCrit2,\n.activeCrit3 {\n stroke: #ff8888;\n fill: #bfc7ff;\n stroke-width: 2; }\n\n.doneCrit0,\n.doneCrit1,\n.doneCrit2,\n.doneCrit3 {\n stroke: #ff8888;\n fill: lightgrey;\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges; }\n\n.doneCritText0,\n.doneCritText1,\n.doneCritText2,\n.doneCritText3 {\n fill: black !important; }\n\n.activeCritText0,\n.activeCritText1,\n.activeCritText2,\n.activeCritText3 {\n fill: black !important; }\n\n.titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: black; }\n\ng.classGroup text {\n fill: #9370DB;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 10px; }\n\ng.classGroup rect {\n fill: #ECECFF;\n stroke: #9370DB; }\n\ng.classGroup line {\n stroke: #9370DB;\n stroke-width: 1; }\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #ECECFF;\n opacity: 0.5; }\n\n.classLabel .label {\n fill: #9370DB;\n font-size: 10px; }\n\n.relation {\n stroke: #9370DB;\n stroke-width: 1;\n fill: none; }\n\n#compositionStart {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#compositionEnd {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#aggregationStart {\n fill: #ECECFF;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#aggregationEnd {\n fill: #ECECFF;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#dependencyStart {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#dependencyEnd {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#extensionStart {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#extensionEnd {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n.commit-id,\n.commit-msg,\n.branch-label {\n fill: lightgrey;\n color: lightgrey; }\n", ""]);
116
117// exports
118
119
120/***/ }),
121
122/***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/themes/forest/index.scss":
123/*!*********************************************************************************************************!*\
124 !*** ./node_modules/css-loader!./node_modules/sass-loader/lib/loader.js!./src/themes/forest/index.scss ***!
125 \*********************************************************************************************************/
126/*! no static exports found */
127/***/ (function(module, exports, __webpack_require__) {
128
129exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false);
130// imports
131
132
133// module
134exports.push([module.i, "/* Flowchart variables */\n/* Sequence Diagram variables */\n/* Gantt chart variables */\n.label {\n font-family: 'trebuchet ms', verdana, arial;\n color: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon {\n fill: #cde498;\n stroke: #13540c;\n stroke-width: 1px; }\n\n.node.clickable {\n cursor: pointer; }\n\n.arrowheadPath {\n fill: green; }\n\n.edgePath .path {\n stroke: green;\n stroke-width: 1.5px; }\n\n.edgeLabel {\n background-color: #e8e8e8; }\n\n.cluster rect {\n fill: #cdffb2 !important;\n stroke: #6eaa49 !important;\n stroke-width: 1px !important; }\n\n.cluster text {\n fill: #333; }\n\ndiv.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 12px;\n background: #cdffb2;\n border: 1px solid #6eaa49;\n border-radius: 2px;\n pointer-events: none;\n z-index: 100; }\n\n.actor {\n stroke: #13540c;\n fill: #cde498; }\n\ntext.actor {\n fill: black;\n stroke: none; }\n\n.actor-line {\n stroke: grey; }\n\n.messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n marker-end: 'url(#arrowhead)';\n stroke: #333; }\n\n.messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n#arrowhead {\n fill: #333; }\n\n#crosshead path {\n fill: #333 !important;\n stroke: #333 !important; }\n\n.messageText {\n fill: #333;\n stroke: none; }\n\n.labelBox {\n stroke: #326932;\n fill: #cde498; }\n\n.labelText {\n fill: black;\n stroke: none; }\n\n.loopText {\n fill: black;\n stroke: none; }\n\n.loopLine {\n stroke-width: 2;\n stroke-dasharray: '2 2';\n marker-end: 'url(#arrowhead)';\n stroke: #326932; }\n\n.note {\n stroke: #6eaa49;\n fill: #fff5ad; }\n\n.noteText {\n fill: black;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 14px; }\n\n/** Section styling */\n.section {\n stroke: none;\n opacity: 0.2; }\n\n.section0 {\n fill: #6eaa49; }\n\n.section2 {\n fill: #6eaa49; }\n\n.section1,\n.section3 {\n fill: white;\n opacity: 0.2; }\n\n.sectionTitle0 {\n fill: #333; }\n\n.sectionTitle1 {\n fill: #333; }\n\n.sectionTitle2 {\n fill: #333; }\n\n.sectionTitle3 {\n fill: #333; }\n\n.sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px; }\n\n/* Grid and axis */\n.grid .tick {\n stroke: lightgrey;\n opacity: 0.3;\n shape-rendering: crispEdges; }\n\n.grid path {\n stroke-width: 0; }\n\n/* Today line */\n.today {\n fill: none;\n stroke: red;\n stroke-width: 2px; }\n\n/* Task styling */\n/* Default task */\n.task {\n stroke-width: 2; }\n\n.taskText {\n text-anchor: middle;\n font-size: 11px; }\n\n.taskTextOutsideRight {\n fill: black;\n text-anchor: start;\n font-size: 11px; }\n\n.taskTextOutsideLeft {\n fill: black;\n text-anchor: end;\n font-size: 11px; }\n\n/* Specific task settings for the sections*/\n.taskText0,\n.taskText1,\n.taskText2,\n.taskText3 {\n fill: white; }\n\n.task0,\n.task1,\n.task2,\n.task3 {\n fill: #487e3a;\n stroke: #13540c; }\n\n.taskTextOutside0,\n.taskTextOutside2 {\n fill: black; }\n\n.taskTextOutside1,\n.taskTextOutside3 {\n fill: black; }\n\n/* Active task */\n.active0,\n.active1,\n.active2,\n.active3 {\n fill: #cde498;\n stroke: #13540c; }\n\n.activeText0,\n.activeText1,\n.activeText2,\n.activeText3 {\n fill: black !important; }\n\n/* Completed task */\n.done0,\n.done1,\n.done2,\n.done3 {\n stroke: grey;\n fill: lightgrey;\n stroke-width: 2; }\n\n.doneText0,\n.doneText1,\n.doneText2,\n.doneText3 {\n fill: black !important; }\n\n/* Tasks on the critical line */\n.crit0,\n.crit1,\n.crit2,\n.crit3 {\n stroke: #ff8888;\n fill: red;\n stroke-width: 2; }\n\n.activeCrit0,\n.activeCrit1,\n.activeCrit2,\n.activeCrit3 {\n stroke: #ff8888;\n fill: #cde498;\n stroke-width: 2; }\n\n.doneCrit0,\n.doneCrit1,\n.doneCrit2,\n.doneCrit3 {\n stroke: #ff8888;\n fill: lightgrey;\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges; }\n\n.doneCritText0,\n.doneCritText1,\n.doneCritText2,\n.doneCritText3 {\n fill: black !important; }\n\n.activeCritText0,\n.activeCritText1,\n.activeCritText2,\n.activeCritText3 {\n fill: black !important; }\n\n.titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: black; }\n\ng.classGroup text {\n fill: #13540c;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 10px; }\n\ng.classGroup rect {\n fill: #cde498;\n stroke: #13540c; }\n\ng.classGroup line {\n stroke: #13540c;\n stroke-width: 1; }\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #cde498;\n opacity: 0.5; }\n\n.classLabel .label {\n fill: #13540c;\n font-size: 10px; }\n\n.relation {\n stroke: #13540c;\n stroke-width: 1;\n fill: none; }\n\n#compositionStart {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#compositionEnd {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#aggregationStart {\n fill: #cde498;\n stroke: #13540c;\n stroke-width: 1; }\n\n#aggregationEnd {\n fill: #cde498;\n stroke: #13540c;\n stroke-width: 1; }\n\n#dependencyStart {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#dependencyEnd {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#extensionStart {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#extensionEnd {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n.commit-id,\n.commit-msg,\n.branch-label {\n fill: lightgrey;\n color: lightgrey; }\n", ""]);
135
136// exports
137
138
139/***/ }),
140
141/***/ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/themes/neutral/index.scss":
142/*!**********************************************************************************************************!*\
143 !*** ./node_modules/css-loader!./node_modules/sass-loader/lib/loader.js!./src/themes/neutral/index.scss ***!
144 \**********************************************************************************************************/
145/*! no static exports found */
146/***/ (function(module, exports, __webpack_require__) {
147
148exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false);
149// imports
150
151
152// module
153exports.push([module.i, "/* Flowchart variables */\n/* Sequence Diagram variables */\n/* Gantt chart variables */\n.label {\n font-family: 'trebuchet ms', verdana, arial;\n color: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon {\n fill: #eee;\n stroke: #999;\n stroke-width: 1px; }\n\n.node.clickable {\n cursor: pointer; }\n\n.arrowheadPath {\n fill: #333333; }\n\n.edgePath .path {\n stroke: #666;\n stroke-width: 1.5px; }\n\n.edgeLabel {\n background-color: white; }\n\n.cluster rect {\n fill: #eaf2fb !important;\n stroke: #26a !important;\n stroke-width: 1px !important; }\n\n.cluster text {\n fill: #333; }\n\ndiv.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 12px;\n background: #eaf2fb;\n border: 1px solid #26a;\n border-radius: 2px;\n pointer-events: none;\n z-index: 100; }\n\n.actor {\n stroke: #999;\n fill: #eee; }\n\ntext.actor {\n fill: #333;\n stroke: none; }\n\n.actor-line {\n stroke: #666; }\n\n.messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n marker-end: 'url(#arrowhead)';\n stroke: #333; }\n\n.messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n#arrowhead {\n fill: #333; }\n\n#crosshead path {\n fill: #333 !important;\n stroke: #333 !important; }\n\n.messageText {\n fill: #333;\n stroke: none; }\n\n.labelBox {\n stroke: #999;\n fill: #eee; }\n\n.labelText {\n fill: white;\n stroke: none; }\n\n.loopText {\n fill: white;\n stroke: none; }\n\n.loopLine {\n stroke-width: 2;\n stroke-dasharray: '2 2';\n marker-end: 'url(#arrowhead)';\n stroke: #999; }\n\n.note {\n stroke: #777700;\n fill: #ffa; }\n\n.noteText {\n fill: black;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 14px; }\n\n/** Section styling */\n.section {\n stroke: none;\n opacity: 0.2; }\n\n.section0 {\n fill: #80b3e6; }\n\n.section2 {\n fill: #80b3e6; }\n\n.section1,\n.section3 {\n fill: white;\n opacity: 0.2; }\n\n.sectionTitle0 {\n fill: #333; }\n\n.sectionTitle1 {\n fill: #333; }\n\n.sectionTitle2 {\n fill: #333; }\n\n.sectionTitle3 {\n fill: #333; }\n\n.sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px; }\n\n/* Grid and axis */\n.grid .tick {\n stroke: #e6e6e6;\n opacity: 0.3;\n shape-rendering: crispEdges; }\n\n.grid path {\n stroke-width: 0; }\n\n/* Today line */\n.today {\n fill: none;\n stroke: #d42;\n stroke-width: 2px; }\n\n/* Task styling */\n/* Default task */\n.task {\n stroke-width: 2; }\n\n.taskText {\n text-anchor: middle;\n font-size: 11px; }\n\n.taskTextOutsideRight {\n fill: #333;\n text-anchor: start;\n font-size: 11px; }\n\n.taskTextOutsideLeft {\n fill: #333;\n text-anchor: end;\n font-size: 11px; }\n\n/* Specific task settings for the sections*/\n.taskText0,\n.taskText1,\n.taskText2,\n.taskText3 {\n fill: white; }\n\n.task0,\n.task1,\n.task2,\n.task3 {\n fill: #26a;\n stroke: #1a4d80; }\n\n.taskTextOutside0,\n.taskTextOutside2 {\n fill: #333; }\n\n.taskTextOutside1,\n.taskTextOutside3 {\n fill: #333; }\n\n/* Active task */\n.active0,\n.active1,\n.active2,\n.active3 {\n fill: #eee;\n stroke: #1a4d80; }\n\n.activeText0,\n.activeText1,\n.activeText2,\n.activeText3 {\n fill: #333 !important; }\n\n/* Completed task */\n.done0,\n.done1,\n.done2,\n.done3 {\n stroke: #666;\n fill: #bbb;\n stroke-width: 2; }\n\n.doneText0,\n.doneText1,\n.doneText2,\n.doneText3 {\n fill: #333 !important; }\n\n/* Tasks on the critical line */\n.crit0,\n.crit1,\n.crit2,\n.crit3 {\n stroke: #b1361b;\n fill: #d42;\n stroke-width: 2; }\n\n.activeCrit0,\n.activeCrit1,\n.activeCrit2,\n.activeCrit3 {\n stroke: #b1361b;\n fill: #eee;\n stroke-width: 2; }\n\n.doneCrit0,\n.doneCrit1,\n.doneCrit2,\n.doneCrit3 {\n stroke: #b1361b;\n fill: #bbb;\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges; }\n\n.doneCritText0,\n.doneCritText1,\n.doneCritText2,\n.doneCritText3 {\n fill: #333 !important; }\n\n.activeCritText0,\n.activeCritText1,\n.activeCritText2,\n.activeCritText3 {\n fill: #333 !important; }\n\n.titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: #333; }\n\ng.classGroup text {\n fill: #999;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 10px; }\n\ng.classGroup rect {\n fill: #eee;\n stroke: #999; }\n\ng.classGroup line {\n stroke: #999;\n stroke-width: 1; }\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #eee;\n opacity: 0.5; }\n\n.classLabel .label {\n fill: #999;\n font-size: 10px; }\n\n.relation {\n stroke: #999;\n stroke-width: 1;\n fill: none; }\n\n#compositionStart {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#compositionEnd {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#aggregationStart {\n fill: #eee;\n stroke: #999;\n stroke-width: 1; }\n\n#aggregationEnd {\n fill: #eee;\n stroke: #999;\n stroke-width: 1; }\n\n#dependencyStart {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#dependencyEnd {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#extensionStart {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#extensionEnd {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n.commit-id,\n.commit-msg,\n.branch-label {\n fill: lightgrey;\n color: lightgrey; }\n", ""]);
154
155// exports
156
157
158/***/ }),
159
160/***/ "./node_modules/css-loader/lib/css-base.js":
161/*!*************************************************!*\
162 !*** ./node_modules/css-loader/lib/css-base.js ***!
163 \*************************************************/
164/*! no static exports found */
165/***/ (function(module, exports) {
166
167/*
168 MIT License http://www.opensource.org/licenses/mit-license.php
169 Author Tobias Koppers @sokra
170*/
171// css base code, injected by the css-loader
172module.exports = function(useSourceMap) {
173 var list = [];
174
175 // return the list of modules as css string
176 list.toString = function toString() {
177 return this.map(function (item) {
178 var content = cssWithMappingToString(item, useSourceMap);
179 if(item[2]) {
180 return "@media " + item[2] + "{" + content + "}";
181 } else {
182 return content;
183 }
184 }).join("");
185 };
186
187 // import a list of modules into the list
188 list.i = function(modules, mediaQuery) {
189 if(typeof modules === "string")
190 modules = [[null, modules, ""]];
191 var alreadyImportedModules = {};
192 for(var i = 0; i < this.length; i++) {
193 var id = this[i][0];
194 if(typeof id === "number")
195 alreadyImportedModules[id] = true;
196 }
197 for(i = 0; i < modules.length; i++) {
198 var item = modules[i];
199 // skip already imported module
200 // this implementation is not 100% perfect for weird media query combinations
201 // when a module is imported multiple times with different media queries.
202 // I hope this will never occur (Hey this way we have smaller bundles)
203 if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
204 if(mediaQuery && !item[2]) {
205 item[2] = mediaQuery;
206 } else if(mediaQuery) {
207 item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
208 }
209 list.push(item);
210 }
211 }
212 };
213 return list;
214};
215
216function cssWithMappingToString(item, useSourceMap) {
217 var content = item[1] || '';
218 var cssMapping = item[3];
219 if (!cssMapping) {
220 return content;
221 }
222
223 if (useSourceMap && typeof btoa === 'function') {
224 var sourceMapping = toComment(cssMapping);
225 var sourceURLs = cssMapping.sources.map(function (source) {
226 return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
227 });
228
229 return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
230 }
231
232 return [content].join('\n');
233}
234
235// Adapted from convert-source-map (MIT)
236function toComment(sourceMap) {
237 // eslint-disable-next-line no-undef
238 var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
239 var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
240
241 return '/*# ' + data + ' */';
242}
243
244
245/***/ }),
246
247/***/ "./node_modules/node-libs-browser/mock/empty.js":
248/*!******************************************************!*\
249 !*** ./node_modules/node-libs-browser/mock/empty.js ***!
250 \******************************************************/
251/*! no static exports found */
252/***/ (function(module, exports) {
253
254
255
256/***/ }),
257
258/***/ "./node_modules/path-browserify/index.js":
259/*!***********************************************!*\
260 !*** ./node_modules/path-browserify/index.js ***!
261 \***********************************************/
262/*! no static exports found */
263/***/ (function(module, exports, __webpack_require__) {
264
265/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.
266//
267// Permission is hereby granted, free of charge, to any person obtaining a
268// copy of this software and associated documentation files (the
269// "Software"), to deal in the Software without restriction, including
270// without limitation the rights to use, copy, modify, merge, publish,
271// distribute, sublicense, and/or sell copies of the Software, and to permit
272// persons to whom the Software is furnished to do so, subject to the
273// following conditions:
274//
275// The above copyright notice and this permission notice shall be included
276// in all copies or substantial portions of the Software.
277//
278// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
279// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
280// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
281// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
282// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
283// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
284// USE OR OTHER DEALINGS IN THE SOFTWARE.
285
286// resolves . and .. elements in a path array with directory names there
287// must be no slashes, empty elements, or device names (c:\) in the array
288// (so also no leading and trailing slashes - it does not distinguish
289// relative and absolute paths)
290function normalizeArray(parts, allowAboveRoot) {
291 // if the path tries to go above the root, `up` ends up > 0
292 var up = 0;
293 for (var i = parts.length - 1; i >= 0; i--) {
294 var last = parts[i];
295 if (last === '.') {
296 parts.splice(i, 1);
297 } else if (last === '..') {
298 parts.splice(i, 1);
299 up++;
300 } else if (up) {
301 parts.splice(i, 1);
302 up--;
303 }
304 }
305
306 // if the path is allowed to go above the root, restore leading ..s
307 if (allowAboveRoot) {
308 for (; up--; up) {
309 parts.unshift('..');
310 }
311 }
312
313 return parts;
314}
315
316// Split a filename into [root, dir, basename, ext], unix version
317// 'root' is just a slash, or nothing.
318var splitPathRe =
319 /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
320var splitPath = function(filename) {
321 return splitPathRe.exec(filename).slice(1);
322};
323
324// path.resolve([from ...], to)
325// posix version
326exports.resolve = function() {
327 var resolvedPath = '',
328 resolvedAbsolute = false;
329
330 for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
331 var path = (i >= 0) ? arguments[i] : process.cwd();
332
333 // Skip empty and invalid entries
334 if (typeof path !== 'string') {
335 throw new TypeError('Arguments to path.resolve must be strings');
336 } else if (!path) {
337 continue;
338 }
339
340 resolvedPath = path + '/' + resolvedPath;
341 resolvedAbsolute = path.charAt(0) === '/';
342 }
343
344 // At this point the path should be resolved to a full absolute path, but
345 // handle relative paths to be safe (might happen when process.cwd() fails)
346
347 // Normalize the path
348 resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
349 return !!p;
350 }), !resolvedAbsolute).join('/');
351
352 return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
353};
354
355// path.normalize(path)
356// posix version
357exports.normalize = function(path) {
358 var isAbsolute = exports.isAbsolute(path),
359 trailingSlash = substr(path, -1) === '/';
360
361 // Normalize the path
362 path = normalizeArray(filter(path.split('/'), function(p) {
363 return !!p;
364 }), !isAbsolute).join('/');
365
366 if (!path && !isAbsolute) {
367 path = '.';
368 }
369 if (path && trailingSlash) {
370 path += '/';
371 }
372
373 return (isAbsolute ? '/' : '') + path;
374};
375
376// posix version
377exports.isAbsolute = function(path) {
378 return path.charAt(0) === '/';
379};
380
381// posix version
382exports.join = function() {
383 var paths = Array.prototype.slice.call(arguments, 0);
384 return exports.normalize(filter(paths, function(p, index) {
385 if (typeof p !== 'string') {
386 throw new TypeError('Arguments to path.join must be strings');
387 }
388 return p;
389 }).join('/'));
390};
391
392
393// path.relative(from, to)
394// posix version
395exports.relative = function(from, to) {
396 from = exports.resolve(from).substr(1);
397 to = exports.resolve(to).substr(1);
398
399 function trim(arr) {
400 var start = 0;
401 for (; start < arr.length; start++) {
402 if (arr[start] !== '') break;
403 }
404
405 var end = arr.length - 1;
406 for (; end >= 0; end--) {
407 if (arr[end] !== '') break;
408 }
409
410 if (start > end) return [];
411 return arr.slice(start, end - start + 1);
412 }
413
414 var fromParts = trim(from.split('/'));
415 var toParts = trim(to.split('/'));
416
417 var length = Math.min(fromParts.length, toParts.length);
418 var samePartsLength = length;
419 for (var i = 0; i < length; i++) {
420 if (fromParts[i] !== toParts[i]) {
421 samePartsLength = i;
422 break;
423 }
424 }
425
426 var outputParts = [];
427 for (var i = samePartsLength; i < fromParts.length; i++) {
428 outputParts.push('..');
429 }
430
431 outputParts = outputParts.concat(toParts.slice(samePartsLength));
432
433 return outputParts.join('/');
434};
435
436exports.sep = '/';
437exports.delimiter = ':';
438
439exports.dirname = function(path) {
440 var result = splitPath(path),
441 root = result[0],
442 dir = result[1];
443
444 if (!root && !dir) {
445 // No dirname whatsoever
446 return '.';
447 }
448
449 if (dir) {
450 // It has a dirname, strip trailing slash
451 dir = dir.substr(0, dir.length - 1);
452 }
453
454 return root + dir;
455};
456
457
458exports.basename = function(path, ext) {
459 var f = splitPath(path)[2];
460 // TODO: make this comparison case-insensitive on windows?
461 if (ext && f.substr(-1 * ext.length) === ext) {
462 f = f.substr(0, f.length - ext.length);
463 }
464 return f;
465};
466
467
468exports.extname = function(path) {
469 return splitPath(path)[3];
470};
471
472function filter (xs, f) {
473 if (xs.filter) return xs.filter(f);
474 var res = [];
475 for (var i = 0; i < xs.length; i++) {
476 if (f(xs[i], i, xs)) res.push(xs[i]);
477 }
478 return res;
479}
480
481// String.prototype.substr - negative index don't work in IE8
482var substr = 'ab'.substr(-1) === 'b'
483 ? function (str, start, len) { return str.substr(start, len) }
484 : function (str, start, len) {
485 if (start < 0) start = str.length + start;
486 return str.substr(start, len);
487 }
488;
489
490/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js")))
491
492/***/ }),
493
494/***/ "./node_modules/process/browser.js":
495/*!*****************************************!*\
496 !*** ./node_modules/process/browser.js ***!
497 \*****************************************/
498/*! no static exports found */
499/***/ (function(module, exports) {
500
501// shim for using process in browser
502var process = module.exports = {};
503
504// cached from whatever global is present so that test runners that stub it
505// don't break things. But we need to wrap it in a try catch in case it is
506// wrapped in strict mode code which doesn't define any globals. It's inside a
507// function because try/catches deoptimize in certain engines.
508
509var cachedSetTimeout;
510var cachedClearTimeout;
511
512function defaultSetTimout() {
513 throw new Error('setTimeout has not been defined');
514}
515function defaultClearTimeout () {
516 throw new Error('clearTimeout has not been defined');
517}
518(function () {
519 try {
520 if (typeof setTimeout === 'function') {
521 cachedSetTimeout = setTimeout;
522 } else {
523 cachedSetTimeout = defaultSetTimout;
524 }
525 } catch (e) {
526 cachedSetTimeout = defaultSetTimout;
527 }
528 try {
529 if (typeof clearTimeout === 'function') {
530 cachedClearTimeout = clearTimeout;
531 } else {
532 cachedClearTimeout = defaultClearTimeout;
533 }
534 } catch (e) {
535 cachedClearTimeout = defaultClearTimeout;
536 }
537} ())
538function runTimeout(fun) {
539 if (cachedSetTimeout === setTimeout) {
540 //normal enviroments in sane situations
541 return setTimeout(fun, 0);
542 }
543 // if setTimeout wasn't available but was latter defined
544 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
545 cachedSetTimeout = setTimeout;
546 return setTimeout(fun, 0);
547 }
548 try {
549 // when when somebody has screwed with setTimeout but no I.E. maddness
550 return cachedSetTimeout(fun, 0);
551 } catch(e){
552 try {
553 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
554 return cachedSetTimeout.call(null, fun, 0);
555 } catch(e){
556 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
557 return cachedSetTimeout.call(this, fun, 0);
558 }
559 }
560
561
562}
563function runClearTimeout(marker) {
564 if (cachedClearTimeout === clearTimeout) {
565 //normal enviroments in sane situations
566 return clearTimeout(marker);
567 }
568 // if clearTimeout wasn't available but was latter defined
569 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
570 cachedClearTimeout = clearTimeout;
571 return clearTimeout(marker);
572 }
573 try {
574 // when when somebody has screwed with setTimeout but no I.E. maddness
575 return cachedClearTimeout(marker);
576 } catch (e){
577 try {
578 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
579 return cachedClearTimeout.call(null, marker);
580 } catch (e){
581 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
582 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
583 return cachedClearTimeout.call(this, marker);
584 }
585 }
586
587
588
589}
590var queue = [];
591var draining = false;
592var currentQueue;
593var queueIndex = -1;
594
595function cleanUpNextTick() {
596 if (!draining || !currentQueue) {
597 return;
598 }
599 draining = false;
600 if (currentQueue.length) {
601 queue = currentQueue.concat(queue);
602 } else {
603 queueIndex = -1;
604 }
605 if (queue.length) {
606 drainQueue();
607 }
608}
609
610function drainQueue() {
611 if (draining) {
612 return;
613 }
614 var timeout = runTimeout(cleanUpNextTick);
615 draining = true;
616
617 var len = queue.length;
618 while(len) {
619 currentQueue = queue;
620 queue = [];
621 while (++queueIndex < len) {
622 if (currentQueue) {
623 currentQueue[queueIndex].run();
624 }
625 }
626 queueIndex = -1;
627 len = queue.length;
628 }
629 currentQueue = null;
630 draining = false;
631 runClearTimeout(timeout);
632}
633
634process.nextTick = function (fun) {
635 var args = new Array(arguments.length - 1);
636 if (arguments.length > 1) {
637 for (var i = 1; i < arguments.length; i++) {
638 args[i - 1] = arguments[i];
639 }
640 }
641 queue.push(new Item(fun, args));
642 if (queue.length === 1 && !draining) {
643 runTimeout(drainQueue);
644 }
645};
646
647// v8 likes predictible objects
648function Item(fun, array) {
649 this.fun = fun;
650 this.array = array;
651}
652Item.prototype.run = function () {
653 this.fun.apply(null, this.array);
654};
655process.title = 'browser';
656process.browser = true;
657process.env = {};
658process.argv = [];
659process.version = ''; // empty string to avoid regexp issues
660process.versions = {};
661
662function noop() {}
663
664process.on = noop;
665process.addListener = noop;
666process.once = noop;
667process.off = noop;
668process.removeListener = noop;
669process.removeAllListeners = noop;
670process.emit = noop;
671process.prependListener = noop;
672process.prependOnceListener = noop;
673
674process.listeners = function (name) { return [] }
675
676process.binding = function (name) {
677 throw new Error('process.binding is not supported');
678};
679
680process.cwd = function () { return '/' };
681process.chdir = function (dir) {
682 throw new Error('process.chdir is not supported');
683};
684process.umask = function() { return 0; };
685
686
687/***/ }),
688
689/***/ "./node_modules/webpack/buildin/module.js":
690/*!***********************************!*\
691 !*** (webpack)/buildin/module.js ***!
692 \***********************************/
693/*! no static exports found */
694/***/ (function(module, exports) {
695
696module.exports = function(module) {
697 if (!module.webpackPolyfill) {
698 module.deprecate = function() {};
699 module.paths = [];
700 // module.parent = undefined by default
701 if (!module.children) module.children = [];
702 Object.defineProperty(module, "loaded", {
703 enumerable: true,
704 get: function() {
705 return module.l;
706 }
707 });
708 Object.defineProperty(module, "id", {
709 enumerable: true,
710 get: function() {
711 return module.i;
712 }
713 });
714 module.webpackPolyfill = 1;
715 }
716 return module;
717};
718
719
720/***/ }),
721
722/***/ "./src/diagrams/class/classDb.js":
723/*!***************************************!*\
724 !*** ./src/diagrams/class/classDb.js ***!
725 \***************************************/
726/*! no static exports found */
727/***/ (function(module, exports, __webpack_require__) {
728
729"use strict";
730
731
732Object.defineProperty(exports, "__esModule", {
733 value: true
734});
735exports.relationType = exports.lineType = exports.cleanupLabel = exports.addMembers = exports.addRelation = exports.getRelations = exports.getClasses = exports.getClass = exports.clear = exports.addClass = undefined;
736
737var _logger = __webpack_require__(/*! ../../logger */ "./src/logger.js");
738
739var relations = [];
740var classes = {};
741
742/**
743 * Function called by parser when a node definition has been found.
744 * @param id
745 * @param text
746 * @param type
747 * @param style
748 */
749var addClass = exports.addClass = function addClass(id) {
750 if (typeof classes[id] === 'undefined') {
751 classes[id] = {
752 id: id,
753 methods: [],
754 members: []
755 };
756 }
757};
758
759var clear = exports.clear = function clear() {
760 relations = [];
761 classes = {};
762};
763
764var getClass = exports.getClass = function getClass(id) {
765 return classes[id];
766};
767var getClasses = exports.getClasses = function getClasses() {
768 return classes;
769};
770
771var getRelations = exports.getRelations = function getRelations() {
772 return relations;
773};
774
775var addRelation = exports.addRelation = function addRelation(relation) {
776 _logger.logger.debug('Adding relation: ' + JSON.stringify(relation));
777 addClass(relation.id1);
778 addClass(relation.id2);
779 relations.push(relation);
780};
781
782var addMembers = exports.addMembers = function addMembers(className, MembersArr) {
783 var theClass = classes[className];
784 if (typeof MembersArr === 'string') {
785 if (MembersArr.substr(-1) === ')') {
786 theClass.methods.push(MembersArr);
787 } else {
788 theClass.members.push(MembersArr);
789 }
790 }
791};
792
793var cleanupLabel = exports.cleanupLabel = function cleanupLabel(label) {
794 if (label.substring(0, 1) === ':') {
795 return label.substr(2).trim();
796 } else {
797 return label.trim();
798 }
799};
800
801var lineType = exports.lineType = {
802 LINE: 0,
803 DOTTED_LINE: 1
804};
805
806var relationType = exports.relationType = {
807 AGGREGATION: 0,
808 EXTENSION: 1,
809 COMPOSITION: 2,
810 DEPENDENCY: 3
811};
812
813exports.default = {
814 addClass: addClass,
815 clear: clear,
816 getClass: getClass,
817 getClasses: getClasses,
818 getRelations: getRelations,
819 addRelation: addRelation,
820 addMembers: addMembers,
821 cleanupLabel: cleanupLabel,
822 lineType: lineType,
823 relationType: relationType
824};
825
826/***/ }),
827
828/***/ "./src/diagrams/class/classRenderer.js":
829/*!*********************************************!*\
830 !*** ./src/diagrams/class/classRenderer.js ***!
831 \*********************************************/
832/*! no static exports found */
833/***/ (function(module, exports, __webpack_require__) {
834
835"use strict";
836
837
838Object.defineProperty(exports, "__esModule", {
839 value: true
840});
841exports.draw = exports.setConf = undefined;
842
843var _dagreLayout = __webpack_require__(/*! dagre-layout */ "dagre-layout");
844
845var _dagreLayout2 = _interopRequireDefault(_dagreLayout);
846
847var _graphlibrary = __webpack_require__(/*! graphlibrary */ "graphlibrary");
848
849var _graphlibrary2 = _interopRequireDefault(_graphlibrary);
850
851var _d = __webpack_require__(/*! d3 */ "d3");
852
853var d3 = _interopRequireWildcard(_d);
854
855var _classDb = __webpack_require__(/*! ./classDb */ "./src/diagrams/class/classDb.js");
856
857var _classDb2 = _interopRequireDefault(_classDb);
858
859var _logger = __webpack_require__(/*! ../../logger */ "./src/logger.js");
860
861var _classDiagram = __webpack_require__(/*! ./parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.js");
862
863function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
864
865function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
866
867_classDiagram.parser.yy = _classDb2.default;
868
869var idCache = {};
870
871var classCnt = 0;
872var conf = {
873 dividerMargin: 10,
874 padding: 5,
875 textHeight: 10
876
877 // Todo optimize
878};var getGraphId = function getGraphId(label) {
879 var keys = Object.keys(idCache);
880
881 for (var i = 0; i < keys.length; i++) {
882 if (idCache[keys[i]].label === label) {
883 return keys[i];
884 }
885 }
886
887 return undefined;
888};
889
890/**
891 * Setup arrow head and define the marker. The result is appended to the svg.
892 */
893var insertMarkers = function insertMarkers(elem) {
894 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');
895
896 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
897
898 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');
899
900 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');
901
902 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');
903
904 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');
905
906 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');
907
908 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');
909};
910
911var edgeCount = 0;
912var drawEdge = function drawEdge(elem, path, relation) {
913 var getRelationType = function getRelationType(type) {
914 switch (type) {
915 case _classDb2.default.relationType.AGGREGATION:
916 return 'aggregation';
917 case _classDb2.default.relationType.EXTENSION:
918 return 'extension';
919 case _classDb2.default.relationType.COMPOSITION:
920 return 'composition';
921 case _classDb2.default.relationType.DEPENDENCY:
922 return 'dependency';
923 }
924 };
925
926 // The data for our line
927 var lineData = path.points;
928
929 // This is the accessor function we talked about above
930 var lineFunction = d3.line().x(function (d) {
931 return d.x;
932 }).y(function (d) {
933 return d.y;
934 }).curve(d3.curveBasis);
935
936 var svgPath = elem.append('path').attr('d', lineFunction(lineData)).attr('id', 'edge' + edgeCount).attr('class', 'relation');
937 var url = '';
938 if (conf.arrowMarkerAbsolute) {
939 url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
940 url = url.replace(/\(/g, '\\(');
941 url = url.replace(/\)/g, '\\)');
942 }
943
944 if (relation.relation.type1 !== 'none') {
945 svgPath.attr('marker-start', 'url(' + url + '#' + getRelationType(relation.relation.type1) + 'Start' + ')');
946 }
947 if (relation.relation.type2 !== 'none') {
948 svgPath.attr('marker-end', 'url(' + url + '#' + getRelationType(relation.relation.type2) + 'End' + ')');
949 }
950
951 var x = void 0,
952 y = void 0;
953 var l = path.points.length;
954 if (l % 2 !== 0) {
955 var p1 = path.points[Math.floor(l / 2)];
956 var p2 = path.points[Math.ceil(l / 2)];
957 x = (p1.x + p2.x) / 2;
958 y = (p1.y + p2.y) / 2;
959 } else {
960 var p = path.points[Math.floor(l / 2)];
961 x = p.x;
962 y = p.y;
963 }
964
965 if (typeof relation.title !== 'undefined') {
966 var g = elem.append('g').attr('class', 'classLabel');
967 var label = g.append('text').attr('class', 'label').attr('x', x).attr('y', y).attr('fill', 'red').attr('text-anchor', 'middle').text(relation.title);
968
969 window.label = label;
970 var bounds = label.node().getBBox();
971
972 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);
973 }
974
975 edgeCount++;
976};
977
978var drawClass = function drawClass(elem, classDef) {
979 _logger.logger.info('Rendering class ' + classDef);
980
981 var addTspan = function addTspan(textEl, txt, isFirst) {
982 var tSpan = textEl.append('tspan').attr('x', conf.padding).text(txt);
983 if (!isFirst) {
984 tSpan.attr('dy', conf.textHeight);
985 }
986 };
987
988 var id = 'classId' + classCnt;
989 var classInfo = {
990 id: id,
991 label: classDef.id,
992 width: 0,
993 height: 0
994 };
995
996 var g = elem.append('g').attr('id', id).attr('class', 'classGroup');
997 var title = g.append('text').attr('x', conf.padding).attr('y', conf.textHeight + conf.padding).text(classDef.id);
998
999 var titleHeight = title.node().getBBox().height;
1000
1001 var membersLine = g.append('line') // text label for the x axis
1002 .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin / 2).attr('y2', conf.padding + titleHeight + conf.dividerMargin / 2);
1003
1004 var members = g.append('text') // text label for the x axis
1005 .attr('x', conf.padding).attr('y', titleHeight + conf.dividerMargin + conf.textHeight).attr('fill', 'white').attr('class', 'classText');
1006
1007 var isFirst = true;
1008 classDef.members.forEach(function (member) {
1009 addTspan(members, member, isFirst);
1010 isFirst = false;
1011 });
1012
1013 var membersBox = members.node().getBBox();
1014
1015 var methodsLine = g.append('line') // text label for the x axis
1016 .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin + membersBox.height).attr('y2', conf.padding + titleHeight + conf.dividerMargin + membersBox.height);
1017
1018 var methods = g.append('text') // text label for the x axis
1019 .attr('x', conf.padding).attr('y', titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight).attr('fill', 'white').attr('class', 'classText');
1020
1021 isFirst = true;
1022
1023 classDef.methods.forEach(function (method) {
1024 addTspan(methods, method, isFirst);
1025 isFirst = false;
1026 });
1027
1028 var classBox = g.node().getBBox();
1029 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);
1030
1031 membersLine.attr('x2', classBox.width + 2 * conf.padding);
1032 methodsLine.attr('x2', classBox.width + 2 * conf.padding);
1033
1034 classInfo.width = classBox.width + 2 * conf.padding;
1035 classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin;
1036
1037 idCache[id] = classInfo;
1038 classCnt++;
1039 return classInfo;
1040};
1041
1042var setConf = exports.setConf = function setConf(cnf) {
1043 var keys = Object.keys(cnf);
1044
1045 keys.forEach(function (key) {
1046 conf[key] = cnf[key];
1047 });
1048};
1049/**
1050 * Draws a flowchart in the tag with id: id based on the graph definition in text.
1051 * @param text
1052 * @param id
1053 */
1054var draw = exports.draw = function draw(text, id) {
1055 _classDiagram.parser.yy.clear();
1056 _classDiagram.parser.parse(text);
1057
1058 _logger.logger.info('Rendering diagram ' + text);
1059
1060 /// / Fetch the default direction, use TD if none was found
1061 var diagram = d3.select('[id="' + id + '"]');
1062 insertMarkers(diagram);
1063
1064 // Layout graph, Create a new directed graph
1065 var g = new _graphlibrary2.default.Graph({
1066 multigraph: true
1067 });
1068
1069 // Set an object for the graph label
1070 g.setGraph({
1071 isMultiGraph: true
1072 });
1073
1074 // Default to assigning a new object as a label for each new edge.
1075 g.setDefaultEdgeLabel(function () {
1076 return {};
1077 });
1078
1079 var classes = _classDb2.default.getClasses();
1080 var keys = Object.keys(classes);
1081 for (var i = 0; i < keys.length; i++) {
1082 var classDef = classes[keys[i]];
1083 var node = drawClass(diagram, classDef);
1084 // Add nodes to the graph. The first argument is the node id. The second is
1085 // metadata about the node. In this case we're going to add labels to each of
1086 // our nodes.
1087 g.setNode(node.id, node);
1088 _logger.logger.info('Org height: ' + node.height);
1089 }
1090
1091 var relations = _classDb2.default.getRelations();
1092 relations.forEach(function (relation) {
1093 _logger.logger.info('tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation));
1094 g.setEdge(getGraphId(relation.id1), getGraphId(relation.id2), { relation: relation });
1095 });
1096 _dagreLayout2.default.layout(g);
1097 g.nodes().forEach(function (v) {
1098 if (typeof v !== 'undefined') {
1099 _logger.logger.debug('Node ' + v + ': ' + JSON.stringify(g.node(v)));
1100 d3.select('#' + v).attr('transform', 'translate(' + (g.node(v).x - g.node(v).width / 2) + ',' + (g.node(v).y - g.node(v).height / 2) + ' )');
1101 }
1102 });
1103 g.edges().forEach(function (e) {
1104 _logger.logger.debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e)));
1105 drawEdge(diagram, g.edge(e), g.edge(e).relation);
1106 });
1107
1108 diagram.attr('height', '100%');
1109 diagram.attr('width', '100%');
1110 diagram.attr('viewBox', '0 0 ' + (g.graph().width + 20) + ' ' + (g.graph().height + 20));
1111};
1112
1113exports.default = {
1114 setConf: setConf,
1115 draw: draw
1116};
1117
1118/***/ }),
1119
1120/***/ "./src/diagrams/class/parser/classDiagram.js":
1121/*!***************************************************!*\
1122 !*** ./src/diagrams/class/parser/classDiagram.js ***!
1123 \***************************************************/
1124/*! no static exports found */
1125/***/ (function(module, exports, __webpack_require__) {
1126
1127"use strict";
1128/* WEBPACK VAR INJECTION */(function(process, module) {
1129
1130/* parser generated by jison 0.4.18 */
1131/*
1132 Returns a Parser object of the following structure:
1133
1134 Parser: {
1135 yy: {}
1136 }
1137
1138 Parser.prototype: {
1139 yy: {},
1140 trace: function(),
1141 symbols_: {associative list: name ==> number},
1142 terminals_: {associative list: number ==> name},
1143 productions_: [...],
1144 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
1145 table: [...],
1146 defaultActions: {...},
1147 parseError: function(str, hash),
1148 parse: function(input),
1149
1150 lexer: {
1151 EOF: 1,
1152 parseError: function(str, hash),
1153 setInput: function(input),
1154 input: function(),
1155 unput: function(str),
1156 more: function(),
1157 less: function(n),
1158 pastInput: function(),
1159 upcomingInput: function(),
1160 showPosition: function(),
1161 test_match: function(regex_match_array, rule_index),
1162 next: function(),
1163 lex: function(),
1164 begin: function(condition),
1165 popState: function(),
1166 _currentRules: function(),
1167 topState: function(),
1168 pushState: function(condition),
1169
1170 options: {
1171 ranges: boolean (optional: true ==> token location info will include a .range[] member)
1172 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
1173 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)
1174 },
1175
1176 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
1177 rules: [...],
1178 conditions: {associative list: name ==> set},
1179 }
1180 }
1181
1182
1183 token location info (@$, _$, etc.): {
1184 first_line: n,
1185 last_line: n,
1186 first_column: n,
1187 last_column: n,
1188 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
1189 }
1190
1191
1192 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
1193 text: (matched text)
1194 token: (the produced terminal token, if any)
1195 line: (yylineno)
1196 }
1197 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
1198 loc: (yylloc)
1199 expected: (string describing the set of expected tokens)
1200 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
1201 }
1202*/
1203var parser = function () {
1204 var o = function o(k, v, _o, l) {
1205 for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
1206 },
1207 $V0 = [1, 11],
1208 $V1 = [1, 12],
1209 $V2 = [1, 13],
1210 $V3 = [1, 15],
1211 $V4 = [1, 16],
1212 $V5 = [1, 17],
1213 $V6 = [6, 8],
1214 $V7 = [1, 26],
1215 $V8 = [1, 27],
1216 $V9 = [1, 28],
1217 $Va = [1, 29],
1218 $Vb = [1, 30],
1219 $Vc = [1, 31],
1220 $Vd = [6, 8, 13, 17, 23, 26, 27, 28, 29, 30, 31],
1221 $Ve = [6, 8, 13, 17, 23, 26, 27, 28, 29, 30, 31, 45, 46, 47],
1222 $Vf = [23, 45, 46, 47],
1223 $Vg = [23, 30, 31, 45, 46, 47],
1224 $Vh = [23, 26, 27, 28, 29, 45, 46, 47],
1225 $Vi = [6, 8, 13],
1226 $Vj = [1, 46];
1227 var parser = { trace: function trace() {},
1228 yy: {},
1229 symbols_: { "error": 2, "mermaidDoc": 3, "graphConfig": 4, "CLASS_DIAGRAM": 5, "NEWLINE": 6, "statements": 7, "EOF": 8, "statement": 9, "className": 10, "alphaNumToken": 11, "relationStatement": 12, "LABEL": 13, "classStatement": 14, "methodStatement": 15, "CLASS": 16, "STRUCT_START": 17, "members": 18, "STRUCT_STOP": 19, "MEMBER": 20, "SEPARATOR": 21, "relation": 22, "STR": 23, "relationType": 24, "lineType": 25, "AGGREGATION": 26, "EXTENSION": 27, "COMPOSITION": 28, "DEPENDENCY": 29, "LINE": 30, "DOTTED_LINE": 31, "commentToken": 32, "textToken": 33, "graphCodeTokens": 34, "textNoTagsToken": 35, "TAGSTART": 36, "TAGEND": 37, "==": 38, "--": 39, "PCT": 40, "DEFAULT": 41, "SPACE": 42, "MINUS": 43, "keywords": 44, "UNICODE_TEXT": 45, "NUM": 46, "ALPHA": 47, "$accept": 0, "$end": 1 },
1230 terminals_: { 2: "error", 5: "CLASS_DIAGRAM", 6: "NEWLINE", 8: "EOF", 13: "LABEL", 16: "CLASS", 17: "STRUCT_START", 19: "STRUCT_STOP", 20: "MEMBER", 21: "SEPARATOR", 23: "STR", 26: "AGGREGATION", 27: "EXTENSION", 28: "COMPOSITION", 29: "DEPENDENCY", 30: "LINE", 31: "DOTTED_LINE", 34: "graphCodeTokens", 36: "TAGSTART", 37: "TAGEND", 38: "==", 39: "--", 40: "PCT", 41: "DEFAULT", 42: "SPACE", 43: "MINUS", 44: "keywords", 45: "UNICODE_TEXT", 46: "NUM", 47: "ALPHA" },
1231 productions_: [0, [3, 1], [4, 4], [7, 1], [7, 3], [10, 2], [10, 1], [9, 1], [9, 2], [9, 1], [9, 1], [14, 2], [14, 5], [18, 1], [18, 2], [15, 1], [15, 2], [15, 1], [15, 1], [12, 3], [12, 4], [12, 4], [12, 5], [22, 3], [22, 2], [22, 2], [22, 1], [24, 1], [24, 1], [24, 1], [24, 1], [25, 1], [25, 1], [32, 1], [32, 1], [33, 1], [33, 1], [33, 1], [33, 1], [33, 1], [33, 1], [33, 1], [35, 1], [35, 1], [35, 1], [35, 1], [11, 1], [11, 1], [11, 1]],
1232 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
1233 /* this == yyval */
1234
1235 var $0 = $$.length - 1;
1236 switch (yystate) {
1237 case 5:
1238 this.$ = $$[$0 - 1] + $$[$0];
1239 break;
1240 case 6:
1241 this.$ = $$[$0];
1242 break;
1243 case 7:
1244 yy.addRelation($$[$0]);
1245 break;
1246 case 8:
1247 $$[$0 - 1].title = yy.cleanupLabel($$[$0]);yy.addRelation($$[$0 - 1]);
1248 break;
1249 case 12:
1250 /*console.log($$[$0-3],JSON.stringify($$[$0-1]));*/yy.addMembers($$[$0 - 3], $$[$0 - 1]);
1251 break;
1252 case 13:
1253 this.$ = [$$[$0]];
1254 break;
1255 case 14:
1256 $$[$0].push($$[$0 - 1]);this.$ = $$[$0];
1257 break;
1258 case 15:
1259 /*console.log('Rel found',$$[$0]);*/
1260 break;
1261 case 16:
1262 yy.addMembers($$[$0 - 1], yy.cleanupLabel($$[$0]));
1263 break;
1264 case 17:
1265 console.warn('Member', $$[$0]);
1266 break;
1267 case 18:
1268 /*console.log('sep found',$$[$0]);*/
1269 break;
1270 case 19:
1271 this.$ = { 'id1': $$[$0 - 2], 'id2': $$[$0], relation: $$[$0 - 1], relationTitle1: 'none', relationTitle2: 'none' };
1272 break;
1273 case 20:
1274 this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 1], relationTitle1: $$[$0 - 2], relationTitle2: 'none' };
1275 break;
1276 case 21:
1277 this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: 'none', relationTitle2: $$[$0 - 1] };
1278 break;
1279 case 22:
1280 this.$ = { id1: $$[$0 - 4], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: $$[$0 - 3], relationTitle2: $$[$0 - 1] };
1281 break;
1282 case 23:
1283 this.$ = { type1: $$[$0 - 2], type2: $$[$0], lineType: $$[$0 - 1] };
1284 break;
1285 case 24:
1286 this.$ = { type1: 'none', type2: $$[$0], lineType: $$[$0 - 1] };
1287 break;
1288 case 25:
1289 this.$ = { type1: $$[$0 - 1], type2: 'none', lineType: $$[$0] };
1290 break;
1291 case 26:
1292 this.$ = { type1: 'none', type2: 'none', lineType: $$[$0] };
1293 break;
1294 case 27:
1295 this.$ = yy.relationType.AGGREGATION;
1296 break;
1297 case 28:
1298 this.$ = yy.relationType.EXTENSION;
1299 break;
1300 case 29:
1301 this.$ = yy.relationType.COMPOSITION;
1302 break;
1303 case 30:
1304 this.$ = yy.relationType.DEPENDENCY;
1305 break;
1306 case 31:
1307 this.$ = yy.lineType.LINE;
1308 break;
1309 case 32:
1310 this.$ = yy.lineType.DOTTED_LINE;
1311 break;
1312 }
1313 },
1314 table: [{ 3: 1, 4: 2, 5: [1, 3] }, { 1: [3] }, { 1: [2, 1] }, { 6: [1, 4] }, { 7: 5, 9: 6, 10: 10, 11: 14, 12: 7, 14: 8, 15: 9, 16: $V0, 20: $V1, 21: $V2, 45: $V3, 46: $V4, 47: $V5 }, { 8: [1, 18] }, { 6: [1, 19], 8: [2, 3] }, o($V6, [2, 7], { 13: [1, 20] }), o($V6, [2, 9]), o($V6, [2, 10]), o($V6, [2, 15], { 22: 21, 24: 24, 25: 25, 13: [1, 23], 23: [1, 22], 26: $V7, 27: $V8, 28: $V9, 29: $Va, 30: $Vb, 31: $Vc }), { 10: 32, 11: 14, 45: $V3, 46: $V4, 47: $V5 }, o($V6, [2, 17]), o($V6, [2, 18]), o($Vd, [2, 6], { 11: 14, 10: 33, 45: $V3, 46: $V4, 47: $V5 }), o($Ve, [2, 46]), o($Ve, [2, 47]), o($Ve, [2, 48]), { 1: [2, 2] }, { 7: 34, 9: 6, 10: 10, 11: 14, 12: 7, 14: 8, 15: 9, 16: $V0, 20: $V1, 21: $V2, 45: $V3, 46: $V4, 47: $V5 }, o($V6, [2, 8]), { 10: 35, 11: 14, 23: [1, 36], 45: $V3, 46: $V4, 47: $V5 }, { 22: 37, 24: 24, 25: 25, 26: $V7, 27: $V8, 28: $V9, 29: $Va, 30: $Vb, 31: $Vc }, o($V6, [2, 16]), { 25: 38, 30: $Vb, 31: $Vc }, o($Vf, [2, 26], { 24: 39, 26: $V7, 27: $V8, 28: $V9, 29: $Va }), o($Vg, [2, 27]), o($Vg, [2, 28]), o($Vg, [2, 29]), o($Vg, [2, 30]), o($Vh, [2, 31]), o($Vh, [2, 32]), o($V6, [2, 11], { 17: [1, 40] }), o($Vd, [2, 5]), { 8: [2, 4] }, o($Vi, [2, 19]), { 10: 41, 11: 14, 45: $V3, 46: $V4, 47: $V5 }, { 10: 42, 11: 14, 23: [1, 43], 45: $V3, 46: $V4, 47: $V5 }, o($Vf, [2, 25], { 24: 44, 26: $V7, 27: $V8, 28: $V9, 29: $Va }), o($Vf, [2, 24]), { 18: 45, 20: $Vj }, o($Vi, [2, 21]), o($Vi, [2, 20]), { 10: 47, 11: 14, 45: $V3, 46: $V4, 47: $V5 }, o($Vf, [2, 23]), { 19: [1, 48] }, { 18: 49, 19: [2, 13], 20: $Vj }, o($Vi, [2, 22]), o($V6, [2, 12]), { 19: [2, 14] }],
1315 defaultActions: { 2: [2, 1], 18: [2, 2], 34: [2, 4], 49: [2, 14] },
1316 parseError: function parseError(str, hash) {
1317 if (hash.recoverable) {
1318 this.trace(str);
1319 } else {
1320 var error = new Error(str);
1321 error.hash = hash;
1322 throw error;
1323 }
1324 },
1325 parse: function parse(input) {
1326 var self = this,
1327 stack = [0],
1328 tstack = [],
1329 vstack = [null],
1330 lstack = [],
1331 table = this.table,
1332 yytext = '',
1333 yylineno = 0,
1334 yyleng = 0,
1335 recovering = 0,
1336 TERROR = 2,
1337 EOF = 1;
1338 var args = lstack.slice.call(arguments, 1);
1339 var lexer = Object.create(this.lexer);
1340 var sharedState = { yy: {} };
1341 for (var k in this.yy) {
1342 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
1343 sharedState.yy[k] = this.yy[k];
1344 }
1345 }
1346 lexer.setInput(input, sharedState.yy);
1347 sharedState.yy.lexer = lexer;
1348 sharedState.yy.parser = this;
1349 if (typeof lexer.yylloc == 'undefined') {
1350 lexer.yylloc = {};
1351 }
1352 var yyloc = lexer.yylloc;
1353 lstack.push(yyloc);
1354 var ranges = lexer.options && lexer.options.ranges;
1355 if (typeof sharedState.yy.parseError === 'function') {
1356 this.parseError = sharedState.yy.parseError;
1357 } else {
1358 this.parseError = Object.getPrototypeOf(this).parseError;
1359 }
1360 function popStack(n) {
1361 stack.length = stack.length - 2 * n;
1362 vstack.length = vstack.length - n;
1363 lstack.length = lstack.length - n;
1364 }
1365 function lex() {
1366 var token;
1367 token = tstack.pop() || lexer.lex() || EOF;
1368 if (typeof token !== 'number') {
1369 if (token instanceof Array) {
1370 tstack = token;
1371 token = tstack.pop();
1372 }
1373 token = self.symbols_[token] || token;
1374 }
1375 return token;
1376 }
1377 var symbol,
1378 preErrorSymbol,
1379 state,
1380 action,
1381 a,
1382 r,
1383 yyval = {},
1384 p,
1385 len,
1386 newState,
1387 expected;
1388 while (true) {
1389 state = stack[stack.length - 1];
1390 if (this.defaultActions[state]) {
1391 action = this.defaultActions[state];
1392 } else {
1393 if (symbol === null || typeof symbol == 'undefined') {
1394 symbol = lex();
1395 }
1396 action = table[state] && table[state][symbol];
1397 }
1398 if (typeof action === 'undefined' || !action.length || !action[0]) {
1399 var errStr = '';
1400 expected = [];
1401 for (p in table[state]) {
1402 if (this.terminals_[p] && p > TERROR) {
1403 expected.push('\'' + this.terminals_[p] + '\'');
1404 }
1405 }
1406 if (lexer.showPosition) {
1407 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
1408 } else {
1409 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
1410 }
1411 this.parseError(errStr, {
1412 text: lexer.match,
1413 token: this.terminals_[symbol] || symbol,
1414 line: lexer.yylineno,
1415 loc: yyloc,
1416 expected: expected
1417 });
1418 }
1419 if (action[0] instanceof Array && action.length > 1) {
1420 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
1421 }
1422 switch (action[0]) {
1423 case 1:
1424 stack.push(symbol);
1425 vstack.push(lexer.yytext);
1426 lstack.push(lexer.yylloc);
1427 stack.push(action[1]);
1428 symbol = null;
1429 if (!preErrorSymbol) {
1430 yyleng = lexer.yyleng;
1431 yytext = lexer.yytext;
1432 yylineno = lexer.yylineno;
1433 yyloc = lexer.yylloc;
1434 if (recovering > 0) {
1435 recovering--;
1436 }
1437 } else {
1438 symbol = preErrorSymbol;
1439 preErrorSymbol = null;
1440 }
1441 break;
1442 case 2:
1443 len = this.productions_[action[1]][1];
1444 yyval.$ = vstack[vstack.length - len];
1445 yyval._$ = {
1446 first_line: lstack[lstack.length - (len || 1)].first_line,
1447 last_line: lstack[lstack.length - 1].last_line,
1448 first_column: lstack[lstack.length - (len || 1)].first_column,
1449 last_column: lstack[lstack.length - 1].last_column
1450 };
1451 if (ranges) {
1452 yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
1453 }
1454 r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
1455 if (typeof r !== 'undefined') {
1456 return r;
1457 }
1458 if (len) {
1459 stack = stack.slice(0, -1 * len * 2);
1460 vstack = vstack.slice(0, -1 * len);
1461 lstack = lstack.slice(0, -1 * len);
1462 }
1463 stack.push(this.productions_[action[1]][0]);
1464 vstack.push(yyval.$);
1465 lstack.push(yyval._$);
1466 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
1467 stack.push(newState);
1468 break;
1469 case 3:
1470 return true;
1471 }
1472 }
1473 return true;
1474 } };
1475
1476 /* generated by jison-lex 0.3.4 */
1477 var lexer = function () {
1478 var lexer = {
1479
1480 EOF: 1,
1481
1482 parseError: function parseError(str, hash) {
1483 if (this.yy.parser) {
1484 this.yy.parser.parseError(str, hash);
1485 } else {
1486 throw new Error(str);
1487 }
1488 },
1489
1490 // resets the lexer, sets new input
1491 setInput: function setInput(input, yy) {
1492 this.yy = yy || this.yy || {};
1493 this._input = input;
1494 this._more = this._backtrack = this.done = false;
1495 this.yylineno = this.yyleng = 0;
1496 this.yytext = this.matched = this.match = '';
1497 this.conditionStack = ['INITIAL'];
1498 this.yylloc = {
1499 first_line: 1,
1500 first_column: 0,
1501 last_line: 1,
1502 last_column: 0
1503 };
1504 if (this.options.ranges) {
1505 this.yylloc.range = [0, 0];
1506 }
1507 this.offset = 0;
1508 return this;
1509 },
1510
1511 // consumes and returns one char from the input
1512 input: function input() {
1513 var ch = this._input[0];
1514 this.yytext += ch;
1515 this.yyleng++;
1516 this.offset++;
1517 this.match += ch;
1518 this.matched += ch;
1519 var lines = ch.match(/(?:\r\n?|\n).*/g);
1520 if (lines) {
1521 this.yylineno++;
1522 this.yylloc.last_line++;
1523 } else {
1524 this.yylloc.last_column++;
1525 }
1526 if (this.options.ranges) {
1527 this.yylloc.range[1]++;
1528 }
1529
1530 this._input = this._input.slice(1);
1531 return ch;
1532 },
1533
1534 // unshifts one char (or a string) into the input
1535 unput: function unput(ch) {
1536 var len = ch.length;
1537 var lines = ch.split(/(?:\r\n?|\n)/g);
1538
1539 this._input = ch + this._input;
1540 this.yytext = this.yytext.substr(0, this.yytext.length - len);
1541 //this.yyleng -= len;
1542 this.offset -= len;
1543 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
1544 this.match = this.match.substr(0, this.match.length - 1);
1545 this.matched = this.matched.substr(0, this.matched.length - 1);
1546
1547 if (lines.length - 1) {
1548 this.yylineno -= lines.length - 1;
1549 }
1550 var r = this.yylloc.range;
1551
1552 this.yylloc = {
1553 first_line: this.yylloc.first_line,
1554 last_line: this.yylineno + 1,
1555 first_column: this.yylloc.first_column,
1556 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
1557 };
1558
1559 if (this.options.ranges) {
1560 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
1561 }
1562 this.yyleng = this.yytext.length;
1563 return this;
1564 },
1565
1566 // When called from action, caches matched text and appends it on next action
1567 more: function more() {
1568 this._more = true;
1569 return this;
1570 },
1571
1572 // 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.
1573 reject: function reject() {
1574 if (this.options.backtrack_lexer) {
1575 this._backtrack = true;
1576 } else {
1577 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(), {
1578 text: "",
1579 token: null,
1580 line: this.yylineno
1581 });
1582 }
1583 return this;
1584 },
1585
1586 // retain first n characters of the match
1587 less: function less(n) {
1588 this.unput(this.match.slice(n));
1589 },
1590
1591 // displays already matched input, i.e. for error messages
1592 pastInput: function pastInput() {
1593 var past = this.matched.substr(0, this.matched.length - this.match.length);
1594 return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
1595 },
1596
1597 // displays upcoming input, i.e. for error messages
1598 upcomingInput: function upcomingInput() {
1599 var next = this.match;
1600 if (next.length < 20) {
1601 next += this._input.substr(0, 20 - next.length);
1602 }
1603 return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
1604 },
1605
1606 // displays the character position where the lexing error occurred, i.e. for error messages
1607 showPosition: function showPosition() {
1608 var pre = this.pastInput();
1609 var c = new Array(pre.length + 1).join("-");
1610 return pre + this.upcomingInput() + "\n" + c + "^";
1611 },
1612
1613 // test the lexed token: return FALSE when not a match, otherwise return token
1614 test_match: function test_match(match, indexed_rule) {
1615 var token, lines, backup;
1616
1617 if (this.options.backtrack_lexer) {
1618 // save context
1619 backup = {
1620 yylineno: this.yylineno,
1621 yylloc: {
1622 first_line: this.yylloc.first_line,
1623 last_line: this.last_line,
1624 first_column: this.yylloc.first_column,
1625 last_column: this.yylloc.last_column
1626 },
1627 yytext: this.yytext,
1628 match: this.match,
1629 matches: this.matches,
1630 matched: this.matched,
1631 yyleng: this.yyleng,
1632 offset: this.offset,
1633 _more: this._more,
1634 _input: this._input,
1635 yy: this.yy,
1636 conditionStack: this.conditionStack.slice(0),
1637 done: this.done
1638 };
1639 if (this.options.ranges) {
1640 backup.yylloc.range = this.yylloc.range.slice(0);
1641 }
1642 }
1643
1644 lines = match[0].match(/(?:\r\n?|\n).*/g);
1645 if (lines) {
1646 this.yylineno += lines.length;
1647 }
1648 this.yylloc = {
1649 first_line: this.yylloc.last_line,
1650 last_line: this.yylineno + 1,
1651 first_column: this.yylloc.last_column,
1652 last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
1653 };
1654 this.yytext += match[0];
1655 this.match += match[0];
1656 this.matches = match;
1657 this.yyleng = this.yytext.length;
1658 if (this.options.ranges) {
1659 this.yylloc.range = [this.offset, this.offset += this.yyleng];
1660 }
1661 this._more = false;
1662 this._backtrack = false;
1663 this._input = this._input.slice(match[0].length);
1664 this.matched += match[0];
1665 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
1666 if (this.done && this._input) {
1667 this.done = false;
1668 }
1669 if (token) {
1670 return token;
1671 } else if (this._backtrack) {
1672 // recover context
1673 for (var k in backup) {
1674 this[k] = backup[k];
1675 }
1676 return false; // rule action called reject() implying the next rule should be tested instead.
1677 }
1678 return false;
1679 },
1680
1681 // return next match in input
1682 next: function next() {
1683 if (this.done) {
1684 return this.EOF;
1685 }
1686 if (!this._input) {
1687 this.done = true;
1688 }
1689
1690 var token, match, tempMatch, index;
1691 if (!this._more) {
1692 this.yytext = '';
1693 this.match = '';
1694 }
1695 var rules = this._currentRules();
1696 for (var i = 0; i < rules.length; i++) {
1697 tempMatch = this._input.match(this.rules[rules[i]]);
1698 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
1699 match = tempMatch;
1700 index = i;
1701 if (this.options.backtrack_lexer) {
1702 token = this.test_match(tempMatch, rules[i]);
1703 if (token !== false) {
1704 return token;
1705 } else if (this._backtrack) {
1706 match = false;
1707 continue; // rule action called reject() implying a rule MISmatch.
1708 } else {
1709 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
1710 return false;
1711 }
1712 } else if (!this.options.flex) {
1713 break;
1714 }
1715 }
1716 }
1717 if (match) {
1718 token = this.test_match(match, rules[index]);
1719 if (token !== false) {
1720 return token;
1721 }
1722 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
1723 return false;
1724 }
1725 if (this._input === "") {
1726 return this.EOF;
1727 } else {
1728 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
1729 text: "",
1730 token: null,
1731 line: this.yylineno
1732 });
1733 }
1734 },
1735
1736 // return next match that has a token
1737 lex: function lex() {
1738 var r = this.next();
1739 if (r) {
1740 return r;
1741 } else {
1742 return this.lex();
1743 }
1744 },
1745
1746 // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
1747 begin: function begin(condition) {
1748 this.conditionStack.push(condition);
1749 },
1750
1751 // pop the previously active lexer condition state off the condition stack
1752 popState: function popState() {
1753 var n = this.conditionStack.length - 1;
1754 if (n > 0) {
1755 return this.conditionStack.pop();
1756 } else {
1757 return this.conditionStack[0];
1758 }
1759 },
1760
1761 // produce the lexer rule set which is active for the currently active lexer condition state
1762 _currentRules: function _currentRules() {
1763 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
1764 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
1765 } else {
1766 return this.conditions["INITIAL"].rules;
1767 }
1768 },
1769
1770 // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
1771 topState: function topState(n) {
1772 n = this.conditionStack.length - 1 - Math.abs(n || 0);
1773 if (n >= 0) {
1774 return this.conditionStack[n];
1775 } else {
1776 return "INITIAL";
1777 }
1778 },
1779
1780 // alias for begin(condition)
1781 pushState: function pushState(condition) {
1782 this.begin(condition);
1783 },
1784
1785 // return the number of states currently on the stack
1786 stateStackSize: function stateStackSize() {
1787 return this.conditionStack.length;
1788 },
1789 options: {},
1790 performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
1791 var YYSTATE = YY_START;
1792 switch ($avoiding_name_collisions) {
1793 case 0:
1794 /* do nothing */
1795 break;
1796 case 1:
1797 return 6;
1798 break;
1799 case 2:
1800 /* skip whitespace */
1801 break;
1802 case 3:
1803 return 5;
1804 break;
1805 case 4:
1806 this.begin("struct"); /*console.log('Starting struct');*/return 17;
1807 break;
1808 case 5:
1809 /*console.log('Ending struct');*/this.popState();return 19;
1810 break;
1811 case 6:
1812 /* nothing */
1813 break;
1814 case 7:
1815 /*console.log('lex-member: ' + yy_.yytext);*/return "MEMBER";
1816 break;
1817 case 8:
1818 return 16;
1819 break;
1820 case 9:
1821 this.begin("string");
1822 break;
1823 case 10:
1824 this.popState();
1825 break;
1826 case 11:
1827 return "STR";
1828 break;
1829 case 12:
1830 return 27;
1831 break;
1832 case 13:
1833 return 27;
1834 break;
1835 case 14:
1836 return 29;
1837 break;
1838 case 15:
1839 return 29;
1840 break;
1841 case 16:
1842 return 28;
1843 break;
1844 case 17:
1845 return 26;
1846 break;
1847 case 18:
1848 return 30;
1849 break;
1850 case 19:
1851 return 31;
1852 break;
1853 case 20:
1854 return 13;
1855 break;
1856 case 21:
1857 return 43;
1858 break;
1859 case 22:
1860 return 'DOT';
1861 break;
1862 case 23:
1863 return 'PLUS';
1864 break;
1865 case 24:
1866 return 40;
1867 break;
1868 case 25:
1869 return 'EQUALS';
1870 break;
1871 case 26:
1872 return 'EQUALS';
1873 break;
1874 case 27:
1875 return 47;
1876 break;
1877 case 28:
1878 return 'PUNCTUATION';
1879 break;
1880 case 29:
1881 return 46;
1882 break;
1883 case 30:
1884 return 45;
1885 break;
1886 case 31:
1887 return 42;
1888 break;
1889 case 32:
1890 return 8;
1891 break;
1892 }
1893 },
1894 rules: [/^(?:%%[^\n]*)/, /^(?:\n+)/, /^(?:\s+)/, /^(?:classDiagram\b)/, /^(?:[\{])/, /^(?:\})/, /^(?:[\n])/, /^(?:[^\{\}\n]*)/, /^(?:class\b)/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:\s*<\|)/, /^(?:\s*\|>)/, /^(?:\s*>)/, /^(?:\s*<)/, /^(?:\s*\*)/, /^(?:\s*o\b)/, /^(?:--)/, /^(?:\.\.)/, /^(?::[^#\n;]+)/, /^(?:-)/, /^(?:\.)/, /^(?:\+)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:[A-Za-z]+)/, /^(?:[!"#$%&'*+,-.`?\\_\/])/, /^(?:[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)/, /^(?:$)/],
1895 conditions: { "string": { "rules": [10, 11], "inclusive": false }, "struct": { "rules": [5, 6, 7], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], "inclusive": true } }
1896 };
1897 return lexer;
1898 }();
1899 parser.lexer = lexer;
1900 function Parser() {
1901 this.yy = {};
1902 }
1903 Parser.prototype = parser;parser.Parser = Parser;
1904 return new Parser();
1905}();
1906
1907if (true) {
1908 exports.parser = parser;
1909 exports.Parser = parser.Parser;
1910 exports.parse = function () {
1911 return parser.parse.apply(parser, arguments);
1912 };
1913 exports.main = function commonjsMain(args) {
1914 if (!args[1]) {
1915 console.log('Usage: ' + args[0] + ' FILE');
1916 process.exit(1);
1917 }
1918 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
1919 return exports.parser.parse(source);
1920 };
1921 if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
1922 exports.main(process.argv.slice(1));
1923 }
1924}
1925/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
1926
1927/***/ }),
1928
1929/***/ "./src/diagrams/flowchart/flowDb.js":
1930/*!******************************************!*\
1931 !*** ./src/diagrams/flowchart/flowDb.js ***!
1932 \******************************************/
1933/*! no static exports found */
1934/***/ (function(module, exports, __webpack_require__) {
1935
1936"use strict";
1937
1938
1939Object.defineProperty(exports, "__esModule", {
1940 value: true
1941});
1942exports.getSubGraphs = exports.indexNodes = exports.getDepthFirstPos = exports.addSubGraph = exports.defaultStyle = exports.clear = exports.getClasses = exports.getEdges = exports.getVertices = exports.getDirection = exports.bindFunctions = exports.setClickEvent = exports.getTooltip = exports.setClass = exports.setDirection = exports.addClass = exports.updateLink = exports.updateLinkInterpolate = exports.addLink = exports.addVertex = undefined;
1943
1944var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1945
1946var _d = __webpack_require__(/*! d3 */ "d3");
1947
1948var d3 = _interopRequireWildcard(_d);
1949
1950var _logger = __webpack_require__(/*! ../../logger */ "./src/logger.js");
1951
1952var _utils = __webpack_require__(/*! ../../utils */ "./src/utils.js");
1953
1954var _utils2 = _interopRequireDefault(_utils);
1955
1956function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1957
1958function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
1959
1960var vertices = {};
1961var edges = [];
1962var classes = [];
1963var subGraphs = [];
1964var tooltips = {};
1965var subCount = 0;
1966var direction = void 0;
1967// Functions to be run after graph rendering
1968var funs = [];
1969/**
1970 * Function called by parser when a node definition has been found
1971 * @param id
1972 * @param text
1973 * @param type
1974 * @param style
1975 */
1976var addVertex = exports.addVertex = function addVertex(id, text, type, style) {
1977 var txt = void 0;
1978
1979 if (typeof id === 'undefined') {
1980 return;
1981 }
1982 if (id.trim().length === 0) {
1983 return;
1984 }
1985
1986 if (typeof vertices[id] === 'undefined') {
1987 vertices[id] = { id: id, styles: [], classes: [] };
1988 }
1989 if (typeof text !== 'undefined') {
1990 txt = text.trim();
1991
1992 // strip quotes if string starts and exnds with a quote
1993 if (txt[0] === '"' && txt[txt.length - 1] === '"') {
1994 txt = txt.substring(1, txt.length - 1);
1995 }
1996
1997 vertices[id].text = txt;
1998 }
1999 if (typeof type !== 'undefined') {
2000 vertices[id].type = type;
2001 }
2002 if (typeof type !== 'undefined') {
2003 vertices[id].type = type;
2004 }
2005 if (typeof style !== 'undefined') {
2006 if (style !== null) {
2007 style.forEach(function (s) {
2008 vertices[id].styles.push(s);
2009 });
2010 }
2011 }
2012};
2013
2014/**
2015 * Function called by parser when a link/edge definition has been found
2016 * @param start
2017 * @param end
2018 * @param type
2019 * @param linktext
2020 */
2021var addLink = exports.addLink = function addLink(start, end, type, linktext) {
2022 _logger.logger.info('Got edge...', start, end);
2023 var edge = { start: start, end: end, type: undefined, text: '' };
2024 linktext = type.text;
2025
2026 if (typeof linktext !== 'undefined') {
2027 edge.text = linktext.trim();
2028
2029 // strip quotes if string starts and exnds with a quote
2030 if (edge.text[0] === '"' && edge.text[edge.text.length - 1] === '"') {
2031 edge.text = edge.text.substring(1, edge.text.length - 1);
2032 }
2033 }
2034
2035 if (typeof type !== 'undefined') {
2036 edge.type = type.type;
2037 edge.stroke = type.stroke;
2038 }
2039 edges.push(edge);
2040};
2041
2042/**
2043 * Updates a link's line interpolation algorithm
2044 * @param pos
2045 * @param interpolate
2046 */
2047var updateLinkInterpolate = exports.updateLinkInterpolate = function updateLinkInterpolate(pos, interp) {
2048 if (pos === 'default') {
2049 edges.defaultInterpolate = interp;
2050 } else {
2051 edges[pos].interpolate = interp;
2052 }
2053};
2054
2055/**
2056 * Updates a link with a style
2057 * @param pos
2058 * @param style
2059 */
2060var updateLink = exports.updateLink = function updateLink(pos, style) {
2061 if (pos === 'default') {
2062 edges.defaultStyle = style;
2063 } else {
2064 if (_utils2.default.isSubstringInArray('fill', style) === -1) {
2065 style.push('fill:none');
2066 }
2067 edges[pos].style = style;
2068 }
2069};
2070
2071var addClass = exports.addClass = function addClass(id, style) {
2072 if (typeof classes[id] === 'undefined') {
2073 classes[id] = { id: id, styles: [] };
2074 }
2075
2076 if (typeof style !== 'undefined') {
2077 if (style !== null) {
2078 style.forEach(function (s) {
2079 classes[id].styles.push(s);
2080 });
2081 }
2082 }
2083};
2084
2085/**
2086 * Called by parser when a graph definition is found, stores the direction of the chart.
2087 * @param dir
2088 */
2089var setDirection = exports.setDirection = function setDirection(dir) {
2090 direction = dir;
2091};
2092
2093/**
2094 * Called by parser when a graph definition is found, stores the direction of the chart.
2095 * @param dir
2096 */
2097var setClass = exports.setClass = function setClass(id, className) {
2098 if (id.indexOf(',') > 0) {
2099 id.split(',').forEach(function (id2) {
2100 if (typeof vertices[id2] !== 'undefined') {
2101 vertices[id2].classes.push(className);
2102 }
2103 });
2104 } else {
2105 if (typeof vertices[id] !== 'undefined') {
2106 vertices[id].classes.push(className);
2107 }
2108 }
2109};
2110
2111var setTooltip = function setTooltip(id, tooltip) {
2112 if (typeof tooltip !== 'undefined') {
2113 tooltips[id] = tooltip;
2114 }
2115};
2116
2117var setClickFun = function setClickFun(id, functionName) {
2118 if (typeof functionName === 'undefined') {
2119 return;
2120 }
2121 if (typeof vertices[id] !== 'undefined') {
2122 funs.push(function (element) {
2123 var elem = d3.select(element).select('[id="' + id + '"]');
2124 if (elem !== null) {
2125 elem.on('click', function () {
2126 window[functionName](id);
2127 });
2128 }
2129 });
2130 }
2131};
2132
2133var setLink = function setLink(id, linkStr) {
2134 if (typeof linkStr === 'undefined') {
2135 return;
2136 }
2137 if (typeof vertices[id] !== 'undefined') {
2138 funs.push(function (element) {
2139 var elem = d3.select(element).select('[id="' + id + '"]');
2140 if (elem !== null) {
2141 elem.on('click', function () {
2142 window.open(linkStr, 'newTab');
2143 });
2144 }
2145 });
2146 }
2147};
2148var getTooltip = exports.getTooltip = function getTooltip(id) {
2149 return tooltips[id];
2150};
2151
2152/**
2153 * Called by parser when a graph definition is found, stores the direction of the chart.
2154 * @param dir
2155 */
2156var setClickEvent = exports.setClickEvent = function setClickEvent(id, functionName, link, tooltip) {
2157 if (id.indexOf(',') > 0) {
2158 id.split(',').forEach(function (id2) {
2159 setTooltip(id2, tooltip);
2160 setClickFun(id2, functionName);
2161 setLink(id2, link);
2162 setClass(id, 'clickable');
2163 });
2164 } else {
2165 setTooltip(id, tooltip);
2166 setClickFun(id, functionName);
2167 setLink(id, link);
2168 setClass(id, 'clickable');
2169 }
2170};
2171
2172var bindFunctions = exports.bindFunctions = function bindFunctions(element) {
2173 funs.forEach(function (fun) {
2174 fun(element);
2175 });
2176};
2177var getDirection = exports.getDirection = function getDirection() {
2178 return direction;
2179};
2180/**
2181 * Retrieval function for fetching the found nodes after parsing has completed.
2182 * @returns {{}|*|vertices}
2183 */
2184var getVertices = exports.getVertices = function getVertices() {
2185 return vertices;
2186};
2187
2188/**
2189 * Retrieval function for fetching the found links after parsing has completed.
2190 * @returns {{}|*|edges}
2191 */
2192var getEdges = exports.getEdges = function getEdges() {
2193 return edges;
2194};
2195
2196/**
2197 * Retrieval function for fetching the found class definitions after parsing has completed.
2198 * @returns {{}|*|classes}
2199 */
2200var getClasses = exports.getClasses = function getClasses() {
2201 return classes;
2202};
2203
2204var setupToolTips = function setupToolTips(element) {
2205 var tooltipElem = d3.select('.mermaidTooltip');
2206 if ((tooltipElem._groups || tooltipElem)[0][0] === null) {
2207 tooltipElem = d3.select('body').append('div').attr('class', 'mermaidTooltip').style('opacity', 0);
2208 }
2209
2210 var svg = d3.select(element).select('svg');
2211
2212 var nodes = svg.selectAll('g.node');
2213 nodes.on('mouseover', function () {
2214 var el = d3.select(this);
2215 var title = el.attr('title');
2216 // Dont try to draw a tooltip if no data is provided
2217 if (title === null) {
2218 return;
2219 }
2220 var rect = this.getBoundingClientRect();
2221
2222 tooltipElem.transition().duration(200).style('opacity', '.9');
2223 tooltipElem.html(el.attr('title')).style('left', rect.left + (rect.right - rect.left) / 2 + 'px').style('top', rect.top - 14 + document.body.scrollTop + 'px');
2224 el.classed('hover', true);
2225 }).on('mouseout', function () {
2226 tooltipElem.transition().duration(500).style('opacity', 0);
2227 var el = d3.select(this);
2228 el.classed('hover', false);
2229 });
2230};
2231funs.push(setupToolTips);
2232
2233/**
2234 * Clears the internal graph db so that a new graph can be parsed.
2235 */
2236var clear = exports.clear = function clear() {
2237 vertices = {};
2238 classes = {};
2239 edges = [];
2240 funs = [];
2241 funs.push(setupToolTips);
2242 subGraphs = [];
2243 subCount = 0;
2244 tooltips = [];
2245};
2246/**
2247 *
2248 * @returns {string}
2249 */
2250var defaultStyle = exports.defaultStyle = function defaultStyle() {
2251 return 'fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;';
2252};
2253
2254/**
2255 * Clears the internal graph db so that a new graph can be parsed.
2256 */
2257var addSubGraph = exports.addSubGraph = function addSubGraph(list, title) {
2258 function uniq(a) {
2259 var prims = { 'boolean': {}, 'number': {}, 'string': {} };
2260 var objs = [];
2261
2262 return a.filter(function (item) {
2263 var type = typeof item === 'undefined' ? 'undefined' : _typeof(item);
2264 if (item.trim() === '') {
2265 return false;
2266 }
2267 if (type in prims) {
2268 return prims[type].hasOwnProperty(item) ? false : prims[type][item] = true;
2269 } else {
2270 return objs.indexOf(item) >= 0 ? false : objs.push(item);
2271 }
2272 });
2273 }
2274
2275 var nodeList = [];
2276
2277 nodeList = uniq(nodeList.concat.apply(nodeList, list));
2278
2279 var subGraph = { id: 'subGraph' + subCount, nodes: nodeList, title: title.trim() };
2280 subGraphs.push(subGraph);
2281 subCount = subCount + 1;
2282 return subGraph.id;
2283};
2284
2285var getPosForId = function getPosForId(id) {
2286 for (var i = 0; i < subGraphs.length; i++) {
2287 if (subGraphs[i].id === id) {
2288 return i;
2289 }
2290 }
2291 return -1;
2292};
2293var secCount = -1;
2294var posCrossRef = [];
2295var indexNodes2 = function indexNodes2(id, pos) {
2296 var nodes = subGraphs[pos].nodes;
2297 secCount = secCount + 1;
2298 if (secCount > 2000) {
2299 return;
2300 }
2301 posCrossRef[secCount] = pos;
2302 // Check if match
2303 if (subGraphs[pos].id === id) {
2304 return {
2305 result: true,
2306 count: 0
2307 };
2308 }
2309
2310 var count = 0;
2311 var posCount = 1;
2312 while (count < nodes.length) {
2313 var childPos = getPosForId(nodes[count]);
2314 // Ignore regular nodes (pos will be -1)
2315 if (childPos >= 0) {
2316 var res = indexNodes2(id, childPos);
2317 if (res.result) {
2318 return {
2319 result: true,
2320 count: posCount + res.count
2321 };
2322 } else {
2323 posCount = posCount + res.count;
2324 }
2325 }
2326 count = count + 1;
2327 }
2328
2329 return {
2330 result: false,
2331 count: posCount
2332 };
2333};
2334
2335var getDepthFirstPos = exports.getDepthFirstPos = function getDepthFirstPos(pos) {
2336 return posCrossRef[pos];
2337};
2338var indexNodes = exports.indexNodes = function indexNodes() {
2339 secCount = -1;
2340 if (subGraphs.length > 0) {
2341 indexNodes2('none', subGraphs.length - 1, 0);
2342 }
2343};
2344
2345var getSubGraphs = exports.getSubGraphs = function getSubGraphs() {
2346 return subGraphs;
2347};
2348
2349exports.default = {
2350 addVertex: addVertex,
2351 addLink: addLink,
2352 updateLinkInterpolate: updateLinkInterpolate,
2353 updateLink: updateLink,
2354 addClass: addClass,
2355 setDirection: setDirection,
2356 setClass: setClass,
2357 getTooltip: getTooltip,
2358 setClickEvent: setClickEvent,
2359 bindFunctions: bindFunctions,
2360 getDirection: getDirection,
2361 getVertices: getVertices,
2362 getEdges: getEdges,
2363 getClasses: getClasses,
2364 clear: clear,
2365 defaultStyle: defaultStyle,
2366 addSubGraph: addSubGraph,
2367 getDepthFirstPos: getDepthFirstPos,
2368 indexNodes: indexNodes,
2369 getSubGraphs: getSubGraphs
2370};
2371
2372/***/ }),
2373
2374/***/ "./src/diagrams/flowchart/flowRenderer.js":
2375/*!************************************************!*\
2376 !*** ./src/diagrams/flowchart/flowRenderer.js ***!
2377 \************************************************/
2378/*! no static exports found */
2379/***/ (function(module, exports, __webpack_require__) {
2380
2381"use strict";
2382
2383
2384Object.defineProperty(exports, "__esModule", {
2385 value: true
2386});
2387exports.draw = exports.getClasses = exports.addEdges = exports.addVertices = exports.setConf = undefined;
2388
2389var _graphlibrary = __webpack_require__(/*! graphlibrary */ "graphlibrary");
2390
2391var _graphlibrary2 = _interopRequireDefault(_graphlibrary);
2392
2393var _d = __webpack_require__(/*! d3 */ "d3");
2394
2395var d3 = _interopRequireWildcard(_d);
2396
2397var _flowDb = __webpack_require__(/*! ./flowDb */ "./src/diagrams/flowchart/flowDb.js");
2398
2399var _flowDb2 = _interopRequireDefault(_flowDb);
2400
2401var _flow = __webpack_require__(/*! ./parser/flow */ "./src/diagrams/flowchart/parser/flow.js");
2402
2403var _flow2 = _interopRequireDefault(_flow);
2404
2405var _dagreD3Renderer = __webpack_require__(/*! dagre-d3-renderer */ "dagre-d3-renderer");
2406
2407var _dagreD3Renderer2 = _interopRequireDefault(_dagreD3Renderer);
2408
2409var _logger = __webpack_require__(/*! ../../logger */ "./src/logger.js");
2410
2411var _utils = __webpack_require__(/*! ../../utils */ "./src/utils.js");
2412
2413function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
2414
2415function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2416
2417var conf = {};
2418var setConf = exports.setConf = function setConf(cnf) {
2419 var keys = Object.keys(cnf);
2420 for (var i = 0; i < keys.length; i++) {
2421 conf[keys[i]] = cnf[keys[i]];
2422 }
2423};
2424
2425/**
2426 * Function that adds the vertices found in the graph definition to the graph to be rendered.
2427 * @param vert Object containing the vertices.
2428 * @param g The graph that is to be drawn.
2429 */
2430var addVertices = exports.addVertices = function addVertices(vert, g) {
2431 var keys = Object.keys(vert);
2432
2433 var styleFromStyleArr = function styleFromStyleArr(styleStr, arr) {
2434 // Create a compound style definition from the style definitions found for the node in the graph definition
2435 for (var i = 0; i < arr.length; i++) {
2436 if (typeof arr[i] !== 'undefined') {
2437 styleStr = styleStr + arr[i] + ';';
2438 }
2439 }
2440
2441 return styleStr;
2442 };
2443
2444 // Iterate through each item in the vertice object (containing all the vertices found) in the graph definition
2445 keys.forEach(function (id) {
2446 var vertice = vert[id];
2447 var verticeText = void 0;
2448
2449 /**
2450 * Variable for storing the classes for the vertice
2451 * @type {string}
2452 */
2453 var classStr = '';
2454 if (vertice.classes.length > 0) {
2455 classStr = vertice.classes.join(' ');
2456 }
2457
2458 /**
2459 * Variable for storing the extracted style for the vertice
2460 * @type {string}
2461 */
2462 var style = '';
2463 // Create a compound style definition from the style definitions found for the node in the graph definition
2464 style = styleFromStyleArr(style, vertice.styles);
2465
2466 // Use vertice id as text in the box if no text is provided by the graph definition
2467 if (typeof vertice.text === 'undefined') {
2468 verticeText = vertice.id;
2469 } else {
2470 verticeText = vertice.text;
2471 }
2472
2473 var labelTypeStr = '';
2474 if (conf.htmlLabels) {
2475 labelTypeStr = 'html';
2476 verticeText = verticeText.replace(/fa:fa[\w-]+/g, function (s) {
2477 return '<i class="fa ' + s.substring(3) + '"></i>';
2478 });
2479 } else {
2480 var svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');
2481
2482 var rows = verticeText.split(/<br>/);
2483
2484 for (var j = 0; j < rows.length; j++) {
2485 var tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');
2486 tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
2487 tspan.setAttribute('dy', '1em');
2488 tspan.setAttribute('x', '1');
2489 tspan.textContent = rows[j];
2490 svgLabel.appendChild(tspan);
2491 }
2492
2493 labelTypeStr = 'svg';
2494 verticeText = svgLabel;
2495 }
2496
2497 var radious = 0;
2498 var _shape = '';
2499 // Set the shape based parameters
2500 switch (vertice.type) {
2501 case 'round':
2502 radious = 5;
2503 _shape = 'rect';
2504 break;
2505 case 'square':
2506 _shape = 'rect';
2507 break;
2508 case 'diamond':
2509 _shape = 'question';
2510 break;
2511 case 'odd':
2512 _shape = 'rect_left_inv_arrow';
2513 break;
2514 case 'odd_right':
2515 _shape = 'rect_left_inv_arrow';
2516 break;
2517 case 'circle':
2518 _shape = 'circle';
2519 break;
2520 case 'ellipse':
2521 _shape = 'ellipse';
2522 break;
2523 case 'group':
2524 _shape = 'rect';
2525 // Need to create a text node if using svg labels, see #367
2526 verticeText = conf.htmlLabels ? '' : document.createElementNS('http://www.w3.org/2000/svg', 'text');
2527 break;
2528 default:
2529 _shape = 'rect';
2530 }
2531 // Add the node
2532 g.setNode(vertice.id, { labelType: labelTypeStr, shape: _shape, label: verticeText, rx: radious, ry: radious, 'class': classStr, style: style, id: vertice.id });
2533 });
2534};
2535
2536/**
2537 * Add edges to graph based on parsed graph defninition
2538 * @param {Object} edges The edges to add to the graph
2539 * @param {Object} g The graph object
2540 */
2541var addEdges = exports.addEdges = function addEdges(edges, g) {
2542 var cnt = 0;
2543
2544 var defaultStyle = void 0;
2545 if (typeof edges.defaultStyle !== 'undefined') {
2546 defaultStyle = edges.defaultStyle.toString().replace(/,/g, ';');
2547 }
2548
2549 edges.forEach(function (edge) {
2550 cnt++;
2551 var edgeData = {};
2552
2553 // Set link type for rendering
2554 if (edge.type === 'arrow_open') {
2555 edgeData.arrowhead = 'none';
2556 } else {
2557 edgeData.arrowhead = 'normal';
2558 }
2559
2560 var style = '';
2561 if (typeof edge.style !== 'undefined') {
2562 edge.style.forEach(function (s) {
2563 style = style + s + ';';
2564 });
2565 } else {
2566 switch (edge.stroke) {
2567 case 'normal':
2568 style = 'fill:none';
2569 if (typeof defaultStyle !== 'undefined') {
2570 style = defaultStyle;
2571 }
2572 break;
2573 case 'dotted':
2574 style = 'stroke: #333; fill:none;stroke-width:2px;stroke-dasharray:3;';
2575 break;
2576 case 'thick':
2577 style = 'stroke: #333; stroke-width: 3.5px;fill:none';
2578 break;
2579 }
2580 }
2581 edgeData.style = style;
2582
2583 if (typeof edge.interpolate !== 'undefined') {
2584 edgeData.curve = (0, _utils.interpolateToCurve)(edge.interpolate, d3.curveLinear);
2585 } else if (typeof edges.defaultInterpolate !== 'undefined') {
2586 edgeData.curve = (0, _utils.interpolateToCurve)(edges.defaultInterpolate, d3.curveLinear);
2587 } else {
2588 edgeData.curve = (0, _utils.interpolateToCurve)(conf.curve, d3.curveLinear);
2589 }
2590
2591 if (typeof edge.text === 'undefined') {
2592 if (typeof edge.style !== 'undefined') {
2593 edgeData.arrowheadStyle = 'fill: #333';
2594 }
2595 } else {
2596 edgeData.arrowheadStyle = 'fill: #333';
2597 if (typeof edge.style === 'undefined') {
2598 edgeData.labelpos = 'c';
2599 if (conf.htmlLabels) {
2600 edgeData.labelType = 'html';
2601 edgeData.label = '<span class="edgeLabel">' + edge.text + '</span>';
2602 } else {
2603 edgeData.labelType = 'text';
2604 edgeData.style = 'stroke: #333; stroke-width: 1.5px;fill:none';
2605 edgeData.label = edge.text.replace(/<br>/g, '\n');
2606 }
2607 } else {
2608 edgeData.label = edge.text.replace(/<br>/g, '\n');
2609 }
2610 }
2611 // Add the edge to the graph
2612 g.setEdge(edge.start, edge.end, edgeData, cnt);
2613 });
2614};
2615
2616/**
2617 * Returns the all the styles from classDef statements in the graph definition.
2618 * @returns {object} classDef styles
2619 */
2620var getClasses = exports.getClasses = function getClasses(text) {
2621 _flowDb2.default.clear();
2622 var parser = _flow2.default.parser;
2623 parser.yy = _flowDb2.default;
2624
2625 // Parse the graph definition
2626 parser.parse(text);
2627 return _flowDb2.default.getClasses();
2628};
2629
2630/**
2631 * Draws a flowchart in the tag with id: id based on the graph definition in text.
2632 * @param text
2633 * @param id
2634 */
2635var draw = exports.draw = function draw(text, id) {
2636 _logger.logger.debug('Drawing flowchart');
2637 _flowDb2.default.clear();
2638 var parser = _flow2.default.parser;
2639 parser.yy = _flowDb2.default;
2640
2641 // Parse the graph definition
2642 try {
2643 parser.parse(text);
2644 } catch (err) {
2645 _logger.logger.debug('Parsing failed');
2646 }
2647
2648 // Fetch the default direction, use TD if none was found
2649 var dir = _flowDb2.default.getDirection();
2650 if (typeof dir === 'undefined') {
2651 dir = 'TD';
2652 }
2653
2654 // Create the input mermaid.graph
2655 var g = new _graphlibrary2.default.Graph({
2656 multigraph: true,
2657 compound: true
2658 }).setGraph({
2659 rankdir: dir,
2660 marginx: 20,
2661 marginy: 20
2662
2663 }).setDefaultEdgeLabel(function () {
2664 return {};
2665 });
2666
2667 var subG = void 0;
2668 var subGraphs = _flowDb2.default.getSubGraphs();
2669 for (var _i = subGraphs.length - 1; _i >= 0; _i--) {
2670 subG = subGraphs[_i];
2671 _flowDb2.default.addVertex(subG.id, subG.title, 'group', undefined);
2672 }
2673
2674 // Fetch the verices/nodes and edges/links from the parsed graph definition
2675 var vert = _flowDb2.default.getVertices();
2676
2677 var edges = _flowDb2.default.getEdges();
2678
2679 var i = 0;
2680 for (i = subGraphs.length - 1; i >= 0; i--) {
2681 subG = subGraphs[i];
2682
2683 d3.selectAll('cluster').append('text');
2684
2685 for (var j = 0; j < subG.nodes.length; j++) {
2686 g.setParent(subG.nodes[j], subG.id);
2687 }
2688 }
2689 addVertices(vert, g);
2690 addEdges(edges, g);
2691
2692 // Create the renderer
2693 var Render = _dagreD3Renderer2.default.render;
2694 var render = new Render();
2695
2696 // Add custom shape for rhombus type of boc (decision)
2697 render.shapes().question = function (parent, bbox, node) {
2698 var w = bbox.width;
2699 var h = bbox.height;
2700 var s = (w + h) * 0.8;
2701 var points = [{ x: s / 2, y: 0 }, { x: s, y: -s / 2 }, { x: s / 2, y: -s }, { x: 0, y: -s / 2 }];
2702 var shapeSvg = parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
2703 return d.x + ',' + d.y;
2704 }).join(' ')).attr('rx', 5).attr('ry', 5).attr('transform', 'translate(' + -s / 2 + ',' + s * 2 / 4 + ')');
2705 node.intersect = function (point) {
2706 return _dagreD3Renderer2.default.intersect.polygon(node, points, point);
2707 };
2708 return shapeSvg;
2709 };
2710
2711 // Add custom shape for box with inverted arrow on left side
2712 render.shapes().rect_left_inv_arrow = function (parent, bbox, node) {
2713 var w = bbox.width;
2714 var h = bbox.height;
2715 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 }];
2716 var shapeSvg = parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
2717 return d.x + ',' + d.y;
2718 }).join(' ')).attr('transform', 'translate(' + -w / 2 + ',' + h * 2 / 4 + ')');
2719 node.intersect = function (point) {
2720 return _dagreD3Renderer2.default.intersect.polygon(node, points, point);
2721 };
2722 return shapeSvg;
2723 };
2724
2725 // Add custom shape for box with inverted arrow on right side
2726 render.shapes().rect_right_inv_arrow = function (parent, bbox, node) {
2727 var w = bbox.width;
2728 var h = bbox.height;
2729 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 }];
2730 var shapeSvg = parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
2731 return d.x + ',' + d.y;
2732 }).join(' ')).attr('transform', 'translate(' + -w / 2 + ',' + h * 2 / 4 + ')');
2733 node.intersect = function (point) {
2734 return _dagreD3Renderer2.default.intersect.polygon(node, points, point);
2735 };
2736 return shapeSvg;
2737 };
2738
2739 // Add our custom arrow - an empty arrowhead
2740 render.arrows().none = function normal(parent, id, edge, type) {
2741 var marker = parent.append('marker').attr('id', id).attr('viewBox', '0 0 10 10').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'strokeWidth').attr('markerWidth', 8).attr('markerHeight', 6).attr('orient', 'auto');
2742
2743 var path = marker.append('path').attr('d', 'M 0 0 L 0 0 L 0 0 z');
2744 _dagreD3Renderer2.default.util.applyStyle(path, edge[type + 'Style']);
2745 };
2746
2747 // Override normal arrowhead defined in d3. Remove style & add class to allow css styling.
2748 render.arrows().normal = function normal(parent, id, edge, type) {
2749 var marker = parent.append('marker').attr('id', id).attr('viewBox', '0 0 10 10').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'strokeWidth').attr('markerWidth', 8).attr('markerHeight', 6).attr('orient', 'auto');
2750
2751 marker.append('path').attr('d', 'M 0 0 L 10 5 L 0 10 z').attr('class', 'arrowheadPath').style('stroke-width', 1).style('stroke-dasharray', '1,0');
2752 };
2753
2754 // Set up an SVG group so that we can translate the final graph.
2755 var svg = d3.select('[id="' + id + '"]');
2756
2757 // Run the renderer. This is what draws the final graph.
2758 var element = d3.select('#' + id + ' g');
2759 render(element, g);
2760
2761 element.selectAll('g.node').attr('title', function () {
2762 return _flowDb2.default.getTooltip(this.id);
2763 });
2764
2765 if (conf.useMaxWidth) {
2766 // Center the graph
2767 svg.attr('height', '100%');
2768 svg.attr('width', conf.width);
2769 svg.attr('viewBox', '0 0 ' + (g.graph().width + 64) + ' ' + (g.graph().height + 64));
2770 svg.attr('style', 'max-width:' + (g.graph().width + 64) + 'px;');
2771 } else {
2772 // Center the graph
2773 svg.attr('height', g.graph().height + 64);
2774 if (typeof conf.width === 'undefined') {
2775 svg.attr('width', g.graph().width + 64);
2776 } else {
2777 svg.attr('width', conf.width);
2778 }
2779 svg.attr('viewBox', '0 0 ' + (g.graph().width + 64) + ' ' + (g.graph().height + 64));
2780 }
2781 svg.select('g').attr('transform', 'translate(32, 32)');
2782
2783 // Index nodes
2784 _flowDb2.default.indexNodes('subGraph' + i);
2785
2786 for (i = 0; i < subGraphs.length; i++) {
2787 subG = subGraphs[i];
2788
2789 if (subG.title !== 'undefined') {
2790 var clusterRects = document.querySelectorAll('#' + id + ' #' + subG.id + ' rect');
2791 var clusterEl = document.querySelectorAll('#' + id + ' #' + subG.id);
2792
2793 var xPos = clusterRects[0].x.baseVal.value;
2794 var yPos = clusterRects[0].y.baseVal.value;
2795 var width = clusterRects[0].width.baseVal.value;
2796 var cluster = d3.select(clusterEl[0]);
2797 var te = cluster.append('text');
2798 te.attr('x', xPos + width / 2);
2799 te.attr('y', yPos + 14);
2800 te.attr('fill', 'black');
2801 te.attr('stroke', 'none');
2802 te.attr('id', id + 'Text');
2803 te.style('text-anchor', 'middle');
2804
2805 if (typeof subG.title === 'undefined') {
2806 te.text('Undef');
2807 } else {
2808 te.text(subG.title);
2809 }
2810 }
2811 }
2812
2813 // Add label rects for non html labels
2814 if (!conf.htmlLabels) {
2815 var labels = document.querySelectorAll('#' + id + ' .edgeLabel .label');
2816 for (var k = 0; k < labels.length; k++) {
2817 var label = labels[k];
2818
2819 // Get dimensions of label
2820 var dim = label.getBBox();
2821
2822 var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
2823 rect.setAttribute('rx', 0);
2824 rect.setAttribute('ry', 0);
2825 rect.setAttribute('width', dim.width);
2826 rect.setAttribute('height', dim.height);
2827 rect.setAttribute('style', 'fill:#e8e8e8;');
2828
2829 label.insertBefore(rect, label.firstChild);
2830 }
2831 }
2832};
2833
2834exports.default = {
2835 setConf: setConf,
2836 addVertices: addVertices,
2837 addEdges: addEdges,
2838 getClasses: getClasses,
2839 draw: draw
2840};
2841
2842/***/ }),
2843
2844/***/ "./src/diagrams/flowchart/parser/flow.js":
2845/*!***********************************************!*\
2846 !*** ./src/diagrams/flowchart/parser/flow.js ***!
2847 \***********************************************/
2848/*! no static exports found */
2849/***/ (function(module, exports, __webpack_require__) {
2850
2851"use strict";
2852/* WEBPACK VAR INJECTION */(function(process, module) {
2853
2854/* parser generated by jison 0.4.18 */
2855/*
2856 Returns a Parser object of the following structure:
2857
2858 Parser: {
2859 yy: {}
2860 }
2861
2862 Parser.prototype: {
2863 yy: {},
2864 trace: function(),
2865 symbols_: {associative list: name ==> number},
2866 terminals_: {associative list: number ==> name},
2867 productions_: [...],
2868 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
2869 table: [...],
2870 defaultActions: {...},
2871 parseError: function(str, hash),
2872 parse: function(input),
2873
2874 lexer: {
2875 EOF: 1,
2876 parseError: function(str, hash),
2877 setInput: function(input),
2878 input: function(),
2879 unput: function(str),
2880 more: function(),
2881 less: function(n),
2882 pastInput: function(),
2883 upcomingInput: function(),
2884 showPosition: function(),
2885 test_match: function(regex_match_array, rule_index),
2886 next: function(),
2887 lex: function(),
2888 begin: function(condition),
2889 popState: function(),
2890 _currentRules: function(),
2891 topState: function(),
2892 pushState: function(condition),
2893
2894 options: {
2895 ranges: boolean (optional: true ==> token location info will include a .range[] member)
2896 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
2897 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)
2898 },
2899
2900 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
2901 rules: [...],
2902 conditions: {associative list: name ==> set},
2903 }
2904 }
2905
2906
2907 token location info (@$, _$, etc.): {
2908 first_line: n,
2909 last_line: n,
2910 first_column: n,
2911 last_column: n,
2912 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
2913 }
2914
2915
2916 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
2917 text: (matched text)
2918 token: (the produced terminal token, if any)
2919 line: (yylineno)
2920 }
2921 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
2922 loc: (yylloc)
2923 expected: (string describing the set of expected tokens)
2924 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
2925 }
2926*/
2927var parser = function () {
2928 var o = function o(k, v, _o, l) {
2929 for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
2930 },
2931 $V0 = [1, 4],
2932 $V1 = [1, 3],
2933 $V2 = [1, 5],
2934 $V3 = [1, 8, 9, 10, 11, 13, 18, 30, 46, 71, 72, 73, 74, 75, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
2935 $V4 = [2, 2],
2936 $V5 = [1, 12],
2937 $V6 = [1, 13],
2938 $V7 = [1, 14],
2939 $V8 = [1, 15],
2940 $V9 = [1, 31],
2941 $Va = [1, 33],
2942 $Vb = [1, 22],
2943 $Vc = [1, 34],
2944 $Vd = [1, 24],
2945 $Ve = [1, 25],
2946 $Vf = [1, 26],
2947 $Vg = [1, 27],
2948 $Vh = [1, 28],
2949 $Vi = [1, 38],
2950 $Vj = [1, 40],
2951 $Vk = [1, 35],
2952 $Vl = [1, 39],
2953 $Vm = [1, 45],
2954 $Vn = [1, 44],
2955 $Vo = [1, 36],
2956 $Vp = [1, 37],
2957 $Vq = [1, 41],
2958 $Vr = [1, 42],
2959 $Vs = [1, 43],
2960 $Vt = [1, 8, 9, 10, 11, 13, 18, 30, 32, 46, 71, 72, 73, 74, 75, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
2961 $Vu = [1, 53],
2962 $Vv = [1, 52],
2963 $Vw = [1, 54],
2964 $Vx = [1, 72],
2965 $Vy = [1, 80],
2966 $Vz = [1, 81],
2967 $VA = [1, 66],
2968 $VB = [1, 65],
2969 $VC = [1, 85],
2970 $VD = [1, 84],
2971 $VE = [1, 82],
2972 $VF = [1, 83],
2973 $VG = [1, 73],
2974 $VH = [1, 68],
2975 $VI = [1, 67],
2976 $VJ = [1, 63],
2977 $VK = [1, 75],
2978 $VL = [1, 76],
2979 $VM = [1, 77],
2980 $VN = [1, 78],
2981 $VO = [1, 79],
2982 $VP = [1, 70],
2983 $VQ = [1, 69],
2984 $VR = [8, 9, 11],
2985 $VS = [8, 9, 11, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64],
2986 $VT = [1, 115],
2987 $VU = [8, 9, 10, 11, 13, 15, 18, 36, 38, 40, 42, 46, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
2988 $VV = [8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 30, 32, 36, 37, 38, 39, 40, 41, 42, 43, 46, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 71, 72, 73, 74, 75, 78, 81, 84, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
2989 $VW = [1, 117],
2990 $VX = [1, 118],
2991 $VY = [8, 9, 10, 11, 13, 18, 30, 32, 46, 71, 72, 73, 74, 75, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
2992 $VZ = [8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 30, 32, 37, 39, 41, 43, 46, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 71, 72, 73, 74, 75, 78, 81, 84, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
2993 $V_ = [13, 18, 46, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
2994 $V$ = [13, 18, 46, 49, 65, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
2995 $V01 = [1, 191],
2996 $V11 = [1, 188],
2997 $V21 = [1, 195],
2998 $V31 = [1, 192],
2999 $V41 = [1, 189],
3000 $V51 = [1, 196],
3001 $V61 = [1, 186],
3002 $V71 = [1, 187],
3003 $V81 = [1, 190],
3004 $V91 = [1, 193],
3005 $Va1 = [1, 194],
3006 $Vb1 = [1, 213],
3007 $Vc1 = [8, 9, 11, 86],
3008 $Vd1 = [8, 9, 10, 11, 46, 71, 80, 81, 84, 86, 88, 89, 90, 91, 92];
3009 var parser = { trace: function trace() {},
3010 yy: {},
3011 symbols_: { "error": 2, "mermaidDoc": 3, "graphConfig": 4, "document": 5, "line": 6, "statement": 7, "SEMI": 8, "NEWLINE": 9, "SPACE": 10, "EOF": 11, "GRAPH": 12, "DIR": 13, "FirstStmtSeperator": 14, "TAGEND": 15, "TAGSTART": 16, "UP": 17, "DOWN": 18, "ending": 19, "endToken": 20, "spaceList": 21, "spaceListNewline": 22, "verticeStatement": 23, "separator": 24, "styleStatement": 25, "linkStyleStatement": 26, "classDefStatement": 27, "classStatement": 28, "clickStatement": 29, "subgraph": 30, "text": 31, "end": 32, "vertex": 33, "link": 34, "alphaNum": 35, "SQS": 36, "SQE": 37, "PS": 38, "PE": 39, "(-": 40, "-)": 41, "DIAMOND_START": 42, "DIAMOND_STOP": 43, "alphaNumStatement": 44, "alphaNumToken": 45, "MINUS": 46, "linkStatement": 47, "arrowText": 48, "TESTSTR": 49, "--": 50, "ARROW_POINT": 51, "ARROW_CIRCLE": 52, "ARROW_CROSS": 53, "ARROW_OPEN": 54, "-.": 55, "DOTTED_ARROW_POINT": 56, "DOTTED_ARROW_CIRCLE": 57, "DOTTED_ARROW_CROSS": 58, "DOTTED_ARROW_OPEN": 59, "==": 60, "THICK_ARROW_POINT": 61, "THICK_ARROW_CIRCLE": 62, "THICK_ARROW_CROSS": 63, "THICK_ARROW_OPEN": 64, "PIPE": 65, "textToken": 66, "STR": 67, "commentText": 68, "commentToken": 69, "keywords": 70, "STYLE": 71, "LINKSTYLE": 72, "CLASSDEF": 73, "CLASS": 74, "CLICK": 75, "textNoTags": 76, "textNoTagsToken": 77, "DEFAULT": 78, "stylesOpt": 79, "HEX": 80, "NUM": 81, "INTERPOLATE": 82, "commentStatement": 83, "PCT": 84, "style": 85, "COMMA": 86, "styleComponent": 87, "ALPHA": 88, "COLON": 89, "UNIT": 90, "BRKT": 91, "DOT": 92, "graphCodeTokens": 93, "PUNCTUATION": 94, "UNICODE_TEXT": 95, "PLUS": 96, "EQUALS": 97, "MULT": 98, "TAG_START": 99, "TAG_END": 100, "QUOTE": 101, "$accept": 0, "$end": 1 },
3012 terminals_: { 2: "error", 8: "SEMI", 9: "NEWLINE", 10: "SPACE", 11: "EOF", 12: "GRAPH", 13: "DIR", 15: "TAGEND", 16: "TAGSTART", 17: "UP", 18: "DOWN", 30: "subgraph", 32: "end", 36: "SQS", 37: "SQE", 38: "PS", 39: "PE", 40: "(-", 41: "-)", 42: "DIAMOND_START", 43: "DIAMOND_STOP", 46: "MINUS", 49: "TESTSTR", 50: "--", 51: "ARROW_POINT", 52: "ARROW_CIRCLE", 53: "ARROW_CROSS", 54: "ARROW_OPEN", 55: "-.", 56: "DOTTED_ARROW_POINT", 57: "DOTTED_ARROW_CIRCLE", 58: "DOTTED_ARROW_CROSS", 59: "DOTTED_ARROW_OPEN", 60: "==", 61: "THICK_ARROW_POINT", 62: "THICK_ARROW_CIRCLE", 63: "THICK_ARROW_CROSS", 64: "THICK_ARROW_OPEN", 65: "PIPE", 67: "STR", 71: "STYLE", 72: "LINKSTYLE", 73: "CLASSDEF", 74: "CLASS", 75: "CLICK", 78: "DEFAULT", 80: "HEX", 81: "NUM", 82: "INTERPOLATE", 84: "PCT", 86: "COMMA", 88: "ALPHA", 89: "COLON", 90: "UNIT", 91: "BRKT", 92: "DOT", 94: "PUNCTUATION", 95: "UNICODE_TEXT", 96: "PLUS", 97: "EQUALS", 98: "MULT", 99: "TAG_START", 100: "TAG_END", 101: "QUOTE" },
3013 productions_: [0, [3, 2], [5, 0], [5, 2], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [4, 2], [4, 2], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [19, 2], [19, 1], [20, 1], [20, 1], [20, 1], [14, 1], [14, 1], [14, 2], [22, 2], [22, 2], [22, 1], [22, 1], [21, 2], [21, 1], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 5], [7, 4], [24, 1], [24, 1], [24, 1], [23, 3], [23, 1], [33, 4], [33, 5], [33, 6], [33, 7], [33, 4], [33, 5], [33, 4], [33, 5], [33, 4], [33, 5], [33, 4], [33, 5], [33, 1], [33, 2], [35, 1], [35, 2], [44, 1], [44, 1], [44, 1], [44, 1], [34, 2], [34, 3], [34, 3], [34, 1], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [48, 3], [31, 1], [31, 2], [31, 1], [68, 1], [68, 2], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [76, 1], [76, 2], [27, 5], [27, 5], [28, 5], [29, 5], [29, 7], [29, 5], [29, 7], [25, 5], [25, 5], [26, 5], [26, 5], [26, 9], [26, 9], [26, 7], [26, 7], [83, 3], [79, 1], [79, 3], [85, 1], [85, 2], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [69, 1], [69, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [77, 1], [77, 1], [77, 1], [77, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1]],
3014 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
3015 /* this == yyval */
3016
3017 var $0 = $$.length - 1;
3018 switch (yystate) {
3019 case 2:
3020 this.$ = [];
3021 break;
3022 case 3:
3023
3024 if ($$[$0] !== []) {
3025 $$[$0 - 1].push($$[$0]);
3026 }
3027 this.$ = $$[$0 - 1];
3028 break;
3029 case 4:case 57:case 59:case 60:case 92:case 94:case 95:case 108:
3030 this.$ = $$[$0];
3031 break;
3032 case 11:
3033 yy.setDirection($$[$0 - 1]);this.$ = $$[$0 - 1];
3034 break;
3035 case 12:
3036 yy.setDirection("LR");this.$ = $$[$0 - 1];
3037 break;
3038 case 13:
3039 yy.setDirection("RL");this.$ = $$[$0 - 1];
3040 break;
3041 case 14:
3042 yy.setDirection("BT");this.$ = $$[$0 - 1];
3043 break;
3044 case 15:
3045 yy.setDirection("TB");this.$ = $$[$0 - 1];
3046 break;
3047 case 30:
3048 this.$ = $$[$0 - 1];
3049 break;
3050 case 31:case 32:case 33:case 34:case 35:
3051 this.$ = [];
3052 break;
3053 case 36:
3054 this.$ = yy.addSubGraph($$[$0 - 1], $$[$0 - 3]);
3055 break;
3056 case 37:
3057 this.$ = yy.addSubGraph($$[$0 - 1], undefined);
3058 break;
3059 case 41:
3060 yy.addLink($$[$0 - 2], $$[$0], $$[$0 - 1]);this.$ = [$$[$0 - 2], $$[$0]];
3061 break;
3062 case 42:
3063 this.$ = [$$[$0]];
3064 break;
3065 case 43:
3066 this.$ = $$[$0 - 3];yy.addVertex($$[$0 - 3], $$[$0 - 1], 'square');
3067 break;
3068 case 44:
3069 this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 4], $$[$0 - 2], 'square');
3070 break;
3071 case 45:
3072 this.$ = $$[$0 - 5];yy.addVertex($$[$0 - 5], $$[$0 - 2], 'circle');
3073 break;
3074 case 46:
3075 this.$ = $$[$0 - 6];yy.addVertex($$[$0 - 6], $$[$0 - 3], 'circle');
3076 break;
3077 case 47:
3078 this.$ = $$[$0 - 3];yy.addVertex($$[$0 - 3], $$[$0 - 1], 'ellipse');
3079 break;
3080 case 48:
3081 this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 4], $$[$0 - 2], 'ellipse');
3082 break;
3083 case 49:
3084 this.$ = $$[$0 - 3];yy.addVertex($$[$0 - 3], $$[$0 - 1], 'round');
3085 break;
3086 case 50:
3087 this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 4], $$[$0 - 2], 'round');
3088 break;
3089 case 51:
3090 this.$ = $$[$0 - 3];yy.addVertex($$[$0 - 3], $$[$0 - 1], 'diamond');
3091 break;
3092 case 52:
3093 this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 4], $$[$0 - 2], 'diamond');
3094 break;
3095 case 53:
3096 this.$ = $$[$0 - 3];yy.addVertex($$[$0 - 3], $$[$0 - 1], 'odd');
3097 break;
3098 case 54:
3099 this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 4], $$[$0 - 2], 'odd');
3100 break;
3101 case 55:
3102 this.$ = $$[$0];yy.addVertex($$[$0]);
3103 break;
3104 case 56:
3105 this.$ = $$[$0 - 1];yy.addVertex($$[$0 - 1]);
3106 break;
3107 case 58:case 93:case 96:case 109:
3108 this.$ = $$[$0 - 1] + '' + $$[$0];
3109 break;
3110 case 61:
3111 this.$ = 'v';
3112 break;
3113 case 62:
3114 this.$ = '-';
3115 break;
3116 case 63:
3117 $$[$0 - 1].text = $$[$0];this.$ = $$[$0 - 1];
3118 break;
3119 case 64:case 65:
3120 $$[$0 - 2].text = $$[$0 - 1];this.$ = $$[$0 - 2];
3121 break;
3122 case 66:
3123 this.$ = $$[$0];
3124 break;
3125 case 67:
3126 this.$ = { "type": "arrow", "stroke": "normal", "text": $$[$0 - 1] };
3127 break;
3128 case 68:
3129 this.$ = { "type": "arrow_circle", "stroke": "normal", "text": $$[$0 - 1] };
3130 break;
3131 case 69:
3132 this.$ = { "type": "arrow_cross", "stroke": "normal", "text": $$[$0 - 1] };
3133 break;
3134 case 70:
3135 this.$ = { "type": "arrow_open", "stroke": "normal", "text": $$[$0 - 1] };
3136 break;
3137 case 71:
3138 this.$ = { "type": "arrow", "stroke": "dotted", "text": $$[$0 - 1] };
3139 break;
3140 case 72:
3141 this.$ = { "type": "arrow_circle", "stroke": "dotted", "text": $$[$0 - 1] };
3142 break;
3143 case 73:
3144 this.$ = { "type": "arrow_cross", "stroke": "dotted", "text": $$[$0 - 1] };
3145 break;
3146 case 74:
3147 this.$ = { "type": "arrow_open", "stroke": "dotted", "text": $$[$0 - 1] };
3148 break;
3149 case 75:
3150 this.$ = { "type": "arrow", "stroke": "thick", "text": $$[$0 - 1] };
3151 break;
3152 case 76:
3153 this.$ = { "type": "arrow_circle", "stroke": "thick", "text": $$[$0 - 1] };
3154 break;
3155 case 77:
3156 this.$ = { "type": "arrow_cross", "stroke": "thick", "text": $$[$0 - 1] };
3157 break;
3158 case 78:
3159 this.$ = { "type": "arrow_open", "stroke": "thick", "text": $$[$0 - 1] };
3160 break;
3161 case 79:
3162 this.$ = { "type": "arrow", "stroke": "normal" };
3163 break;
3164 case 80:
3165 this.$ = { "type": "arrow_circle", "stroke": "normal" };
3166 break;
3167 case 81:
3168 this.$ = { "type": "arrow_cross", "stroke": "normal" };
3169 break;
3170 case 82:
3171 this.$ = { "type": "arrow_open", "stroke": "normal" };
3172 break;
3173 case 83:
3174 this.$ = { "type": "arrow", "stroke": "dotted" };
3175 break;
3176 case 84:
3177 this.$ = { "type": "arrow_circle", "stroke": "dotted" };
3178 break;
3179 case 85:
3180 this.$ = { "type": "arrow_cross", "stroke": "dotted" };
3181 break;
3182 case 86:
3183 this.$ = { "type": "arrow_open", "stroke": "dotted" };
3184 break;
3185 case 87:
3186 this.$ = { "type": "arrow", "stroke": "thick" };
3187 break;
3188 case 88:
3189 this.$ = { "type": "arrow_circle", "stroke": "thick" };
3190 break;
3191 case 89:
3192 this.$ = { "type": "arrow_cross", "stroke": "thick" };
3193 break;
3194 case 90:
3195 this.$ = { "type": "arrow_open", "stroke": "thick" };
3196 break;
3197 case 91:
3198 this.$ = $$[$0 - 1];
3199 break;
3200 case 110:case 111:
3201 this.$ = $$[$0 - 4];yy.addClass($$[$0 - 2], $$[$0]);
3202 break;
3203 case 112:
3204 this.$ = $$[$0 - 4];yy.setClass($$[$0 - 2], $$[$0]);
3205 break;
3206 case 113:
3207 this.$ = $$[$0 - 4];yy.setClickEvent($$[$0 - 2], $$[$0], undefined, undefined);
3208 break;
3209 case 114:
3210 this.$ = $$[$0 - 6];yy.setClickEvent($$[$0 - 4], $$[$0 - 2], undefined, $$[$0]);
3211 break;
3212 case 115:
3213 this.$ = $$[$0 - 4];yy.setClickEvent($$[$0 - 2], undefined, $$[$0], undefined);
3214 break;
3215 case 116:
3216 this.$ = $$[$0 - 6];yy.setClickEvent($$[$0 - 4], undefined, $$[$0 - 2], $$[$0]);
3217 break;
3218 case 117:
3219 this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 2], undefined, undefined, $$[$0]);
3220 break;
3221 case 118:case 119:case 120:
3222 this.$ = $$[$0 - 4];yy.updateLink($$[$0 - 2], $$[$0]);
3223 break;
3224 case 121:case 122:
3225 this.$ = $$[$0 - 8];yy.updateLinkInterpolate($$[$0 - 6], $$[$0 - 2]);yy.updateLink($$[$0 - 6], $$[$0]);
3226 break;
3227 case 123:case 124:
3228 this.$ = $$[$0 - 6];yy.updateLinkInterpolate($$[$0 - 4], $$[$0]);
3229 break;
3230 case 126:
3231 this.$ = [$$[$0]];
3232 break;
3233 case 127:
3234 $$[$0 - 2].push($$[$0]);this.$ = $$[$0 - 2];
3235 break;
3236 case 129:
3237 this.$ = $$[$0 - 1] + $$[$0];
3238 break;
3239 }
3240 },
3241 table: [{ 3: 1, 4: 2, 9: $V0, 10: $V1, 12: $V2 }, { 1: [3] }, o($V3, $V4, { 5: 6 }), { 4: 7, 9: $V0, 10: $V1, 12: $V2 }, { 4: 8, 9: $V0, 10: $V1, 12: $V2 }, { 10: [1, 9] }, { 1: [2, 1], 6: 10, 7: 11, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 13: $V9, 18: $Va, 23: 16, 25: 17, 26: 18, 27: 19, 28: 20, 29: 21, 30: $Vb, 33: 23, 35: 29, 44: 30, 45: 32, 46: $Vc, 71: $Vd, 72: $Ve, 73: $Vf, 74: $Vg, 75: $Vh, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($V3, [2, 9]), o($V3, [2, 10]), { 13: [1, 46], 15: [1, 47], 16: [1, 48], 17: [1, 49], 18: [1, 50] }, o($Vt, [2, 3]), o($Vt, [2, 4]), o($Vt, [2, 5]), o($Vt, [2, 6]), o($Vt, [2, 7]), o($Vt, [2, 8]), { 8: $Vu, 9: $Vv, 11: $Vw, 24: 51 }, { 8: $Vu, 9: $Vv, 11: $Vw, 24: 55 }, { 8: $Vu, 9: $Vv, 11: $Vw, 24: 56 }, { 8: $Vu, 9: $Vv, 11: $Vw, 24: 57 }, { 8: $Vu, 9: $Vv, 11: $Vw, 24: 58 }, { 8: $Vu, 9: $Vv, 11: $Vw, 24: 59 }, { 8: $Vu, 9: $Vv, 10: $Vx, 11: $Vw, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 24: 61, 30: $VE, 31: 60, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VR, [2, 42], { 34: 86, 47: 87, 50: [1, 88], 51: [1, 91], 52: [1, 92], 53: [1, 93], 54: [1, 94], 55: [1, 89], 56: [1, 95], 57: [1, 96], 58: [1, 97], 59: [1, 98], 60: [1, 90], 61: [1, 99], 62: [1, 100], 63: [1, 101], 64: [1, 102] }), { 10: [1, 103] }, { 10: [1, 104] }, { 10: [1, 105] }, { 10: [1, 106] }, { 10: [1, 107] }, o($VS, [2, 55], { 45: 32, 21: 113, 44: 114, 10: $VT, 13: $V9, 15: [1, 112], 18: $Va, 36: [1, 108], 38: [1, 109], 40: [1, 110], 42: [1, 111], 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }), o($VU, [2, 57]), o($VU, [2, 59]), o($VU, [2, 60]), o($VU, [2, 61]), o($VU, [2, 62]), o($VV, [2, 154]), o($VV, [2, 155]), o($VV, [2, 156]), o($VV, [2, 157]), o($VV, [2, 158]), o($VV, [2, 159]), o($VV, [2, 160]), o($VV, [2, 161]), o($VV, [2, 162]), o($VV, [2, 163]), o($VV, [2, 164]), { 8: $VW, 9: $VX, 10: $VT, 14: 116, 21: 119 }, { 8: $VW, 9: $VX, 10: $VT, 14: 120, 21: 119 }, { 8: $VW, 9: $VX, 10: $VT, 14: 121, 21: 119 }, { 8: $VW, 9: $VX, 10: $VT, 14: 122, 21: 119 }, { 8: $VW, 9: $VX, 10: $VT, 14: 123, 21: 119 }, o($Vt, [2, 30]), o($Vt, [2, 38]), o($Vt, [2, 39]), o($Vt, [2, 40]), o($Vt, [2, 31]), o($Vt, [2, 32]), o($Vt, [2, 33]), o($Vt, [2, 34]), o($Vt, [2, 35]), { 8: $Vu, 9: $Vv, 10: $Vx, 11: $Vw, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 24: 124, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VY, $V4, { 5: 126 }), o($VZ, [2, 92]), o($VZ, [2, 94]), o($VZ, [2, 143]), o($VZ, [2, 144]), o($VZ, [2, 145]), o($VZ, [2, 146]), o($VZ, [2, 147]), o($VZ, [2, 148]), o($VZ, [2, 149]), o($VZ, [2, 150]), o($VZ, [2, 151]), o($VZ, [2, 152]), o($VZ, [2, 153]), o($VZ, [2, 97]), o($VZ, [2, 98]), o($VZ, [2, 99]), o($VZ, [2, 100]), o($VZ, [2, 101]), o($VZ, [2, 102]), o($VZ, [2, 103]), o($VZ, [2, 104]), o($VZ, [2, 105]), o($VZ, [2, 106]), o($VZ, [2, 107]), { 13: $V9, 18: $Va, 33: 127, 35: 29, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($V_, [2, 66], { 48: 128, 49: [1, 129], 65: [1, 130] }), { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 131, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 132, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 133, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($V$, [2, 79]), o($V$, [2, 80]), o($V$, [2, 81]), o($V$, [2, 82]), o($V$, [2, 83]), o($V$, [2, 84]), o($V$, [2, 85]), o($V$, [2, 86]), o($V$, [2, 87]), o($V$, [2, 88]), o($V$, [2, 89]), o($V$, [2, 90]), { 13: $V9, 18: $Va, 35: 134, 44: 30, 45: 32, 46: $Vc, 80: [1, 135], 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 78: [1, 136], 81: [1, 137] }, { 13: $V9, 18: $Va, 35: 139, 44: 30, 45: 32, 46: $Vc, 78: [1, 138], 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 13: $V9, 18: $Va, 35: 140, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 13: $V9, 18: $Va, 35: 141, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 142, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 144, 32: $VF, 38: [1, 143], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 145, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 146, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 147, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VS, [2, 56]), o($VU, [2, 58]), o($VS, [2, 29], { 21: 148, 10: $VT }), o($V3, [2, 11]), o($V3, [2, 21]), o($V3, [2, 22]), { 9: [1, 149] }, o($V3, [2, 12]), o($V3, [2, 13]), o($V3, [2, 14]), o($V3, [2, 15]), o($VY, $V4, { 5: 150 }), o($VZ, [2, 93]), { 6: 10, 7: 11, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 13: $V9, 18: $Va, 23: 16, 25: 17, 26: 18, 27: 19, 28: 20, 29: 21, 30: $Vb, 32: [1, 151], 33: 23, 35: 29, 44: 30, 45: 32, 46: $Vc, 71: $Vd, 72: $Ve, 73: $Vf, 74: $Vg, 75: $Vh, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VR, [2, 41]), o($V_, [2, 63], { 10: [1, 152] }), { 10: [1, 153] }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 154, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 51: [1, 155], 52: [1, 156], 53: [1, 157], 54: [1, 158], 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 56: [1, 159], 57: [1, 160], 58: [1, 161], 59: [1, 162], 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 61: [1, 163], 62: [1, 164], 63: [1, 165], 64: [1, 166], 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: [1, 167], 13: $V9, 18: $Va, 44: 114, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: [1, 168] }, { 10: [1, 169] }, { 10: [1, 170] }, { 10: [1, 171] }, { 10: [1, 172], 13: $V9, 18: $Va, 44: 114, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: [1, 173], 13: $V9, 18: $Va, 44: 114, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: [1, 174], 13: $V9, 18: $Va, 44: 114, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 37: [1, 175], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 176, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 39: [1, 177], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 41: [1, 178], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 43: [1, 179], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 37: [1, 180], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VS, [2, 28]), o($V3, [2, 23]), { 6: 10, 7: 11, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 13: $V9, 18: $Va, 23: 16, 25: 17, 26: 18, 27: 19, 28: 20, 29: 21, 30: $Vb, 32: [1, 181], 33: 23, 35: 29, 44: 30, 45: 32, 46: $Vc, 71: $Vd, 72: $Ve, 73: $Vf, 74: $Vg, 75: $Vh, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($Vt, [2, 37]), o($V_, [2, 65]), o($V_, [2, 64]), { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 65: [1, 182], 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($V_, [2, 67]), o($V_, [2, 68]), o($V_, [2, 69]), o($V_, [2, 70]), o($V_, [2, 71]), o($V_, [2, 72]), o($V_, [2, 73]), o($V_, [2, 74]), o($V_, [2, 75]), o($V_, [2, 76]), o($V_, [2, 77]), o($V_, [2, 78]), { 10: $V01, 46: $V11, 71: $V21, 79: 183, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 197, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 198, 80: $V31, 81: $V41, 82: [1, 199], 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 200, 80: $V31, 81: $V41, 82: [1, 201], 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 202, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 203, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 13: $V9, 18: $Va, 35: 204, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 13: $V9, 18: $Va, 35: 205, 44: 30, 45: 32, 46: $Vc, 67: [1, 206], 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VS, [2, 43], { 21: 207, 10: $VT }), { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 39: [1, 208], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VS, [2, 49], { 21: 209, 10: $VT }), o($VS, [2, 47], { 21: 210, 10: $VT }), o($VS, [2, 51], { 21: 211, 10: $VT }), o($VS, [2, 53], { 21: 212, 10: $VT }), o($Vt, [2, 36]), o([10, 13, 18, 46, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98], [2, 91]), o($VR, [2, 117], { 86: $Vb1 }), o($Vc1, [2, 126], { 87: 214, 10: $V01, 46: $V11, 71: $V21, 80: $V31, 81: $V41, 84: $V51, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }), o($Vd1, [2, 128]), o($Vd1, [2, 130]), o($Vd1, [2, 131]), o($Vd1, [2, 132]), o($Vd1, [2, 133]), o($Vd1, [2, 134]), o($Vd1, [2, 135]), o($Vd1, [2, 136]), o($Vd1, [2, 137]), o($Vd1, [2, 138]), o($Vd1, [2, 139]), o($Vd1, [2, 140]), o($VR, [2, 118], { 86: $Vb1 }), o($VR, [2, 119], { 86: $Vb1 }), { 10: [1, 215] }, o($VR, [2, 120], { 86: $Vb1 }), { 10: [1, 216] }, o($VR, [2, 110], { 86: $Vb1 }), o($VR, [2, 111], { 86: $Vb1 }), o($VR, [2, 112], { 45: 32, 44: 114, 13: $V9, 18: $Va, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }), o($VR, [2, 113], { 45: 32, 44: 114, 10: [1, 217], 13: $V9, 18: $Va, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }), o($VR, [2, 115], { 10: [1, 218] }), o($VS, [2, 44]), { 39: [1, 219] }, o($VS, [2, 50]), o($VS, [2, 48]), o($VS, [2, 52]), o($VS, [2, 54]), { 10: $V01, 46: $V11, 71: $V21, 80: $V31, 81: $V41, 84: $V51, 85: 220, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, o($Vd1, [2, 129]), { 13: $V9, 18: $Va, 35: 221, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 13: $V9, 18: $Va, 35: 222, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 67: [1, 223] }, { 67: [1, 224] }, o($VS, [2, 45], { 21: 225, 10: $VT }), o($Vc1, [2, 127], { 87: 214, 10: $V01, 46: $V11, 71: $V21, 80: $V31, 81: $V41, 84: $V51, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }), o($VR, [2, 123], { 45: 32, 44: 114, 10: [1, 226], 13: $V9, 18: $Va, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }), o($VR, [2, 124], { 45: 32, 44: 114, 10: [1, 227], 13: $V9, 18: $Va, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }), o($VR, [2, 114]), o($VR, [2, 116]), o($VS, [2, 46]), { 10: $V01, 46: $V11, 71: $V21, 79: 228, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 229, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, o($VR, [2, 121], { 86: $Vb1 }), o($VR, [2, 122], { 86: $Vb1 })],
3242 defaultActions: {},
3243 parseError: function parseError(str, hash) {
3244 if (hash.recoverable) {
3245 this.trace(str);
3246 } else {
3247 var error = new Error(str);
3248 error.hash = hash;
3249 throw error;
3250 }
3251 },
3252 parse: function parse(input) {
3253 var self = this,
3254 stack = [0],
3255 tstack = [],
3256 vstack = [null],
3257 lstack = [],
3258 table = this.table,
3259 yytext = '',
3260 yylineno = 0,
3261 yyleng = 0,
3262 recovering = 0,
3263 TERROR = 2,
3264 EOF = 1;
3265 var args = lstack.slice.call(arguments, 1);
3266 var lexer = Object.create(this.lexer);
3267 var sharedState = { yy: {} };
3268 for (var k in this.yy) {
3269 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
3270 sharedState.yy[k] = this.yy[k];
3271 }
3272 }
3273 lexer.setInput(input, sharedState.yy);
3274 sharedState.yy.lexer = lexer;
3275 sharedState.yy.parser = this;
3276 if (typeof lexer.yylloc == 'undefined') {
3277 lexer.yylloc = {};
3278 }
3279 var yyloc = lexer.yylloc;
3280 lstack.push(yyloc);
3281 var ranges = lexer.options && lexer.options.ranges;
3282 if (typeof sharedState.yy.parseError === 'function') {
3283 this.parseError = sharedState.yy.parseError;
3284 } else {
3285 this.parseError = Object.getPrototypeOf(this).parseError;
3286 }
3287 function popStack(n) {
3288 stack.length = stack.length - 2 * n;
3289 vstack.length = vstack.length - n;
3290 lstack.length = lstack.length - n;
3291 }
3292 function lex() {
3293 var token;
3294 token = tstack.pop() || lexer.lex() || EOF;
3295 if (typeof token !== 'number') {
3296 if (token instanceof Array) {
3297 tstack = token;
3298 token = tstack.pop();
3299 }
3300 token = self.symbols_[token] || token;
3301 }
3302 return token;
3303 }
3304 var symbol,
3305 preErrorSymbol,
3306 state,
3307 action,
3308 a,
3309 r,
3310 yyval = {},
3311 p,
3312 len,
3313 newState,
3314 expected;
3315 while (true) {
3316 state = stack[stack.length - 1];
3317 if (this.defaultActions[state]) {
3318 action = this.defaultActions[state];
3319 } else {
3320 if (symbol === null || typeof symbol == 'undefined') {
3321 symbol = lex();
3322 }
3323 action = table[state] && table[state][symbol];
3324 }
3325 if (typeof action === 'undefined' || !action.length || !action[0]) {
3326 var errStr = '';
3327 expected = [];
3328 for (p in table[state]) {
3329 if (this.terminals_[p] && p > TERROR) {
3330 expected.push('\'' + this.terminals_[p] + '\'');
3331 }
3332 }
3333 if (lexer.showPosition) {
3334 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
3335 } else {
3336 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
3337 }
3338 this.parseError(errStr, {
3339 text: lexer.match,
3340 token: this.terminals_[symbol] || symbol,
3341 line: lexer.yylineno,
3342 loc: yyloc,
3343 expected: expected
3344 });
3345 }
3346 if (action[0] instanceof Array && action.length > 1) {
3347 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
3348 }
3349 switch (action[0]) {
3350 case 1:
3351 stack.push(symbol);
3352 vstack.push(lexer.yytext);
3353 lstack.push(lexer.yylloc);
3354 stack.push(action[1]);
3355 symbol = null;
3356 if (!preErrorSymbol) {
3357 yyleng = lexer.yyleng;
3358 yytext = lexer.yytext;
3359 yylineno = lexer.yylineno;
3360 yyloc = lexer.yylloc;
3361 if (recovering > 0) {
3362 recovering--;
3363 }
3364 } else {
3365 symbol = preErrorSymbol;
3366 preErrorSymbol = null;
3367 }
3368 break;
3369 case 2:
3370 len = this.productions_[action[1]][1];
3371 yyval.$ = vstack[vstack.length - len];
3372 yyval._$ = {
3373 first_line: lstack[lstack.length - (len || 1)].first_line,
3374 last_line: lstack[lstack.length - 1].last_line,
3375 first_column: lstack[lstack.length - (len || 1)].first_column,
3376 last_column: lstack[lstack.length - 1].last_column
3377 };
3378 if (ranges) {
3379 yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
3380 }
3381 r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
3382 if (typeof r !== 'undefined') {
3383 return r;
3384 }
3385 if (len) {
3386 stack = stack.slice(0, -1 * len * 2);
3387 vstack = vstack.slice(0, -1 * len);
3388 lstack = lstack.slice(0, -1 * len);
3389 }
3390 stack.push(this.productions_[action[1]][0]);
3391 vstack.push(yyval.$);
3392 lstack.push(yyval._$);
3393 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
3394 stack.push(newState);
3395 break;
3396 case 3:
3397 return true;
3398 }
3399 }
3400 return true;
3401 } };
3402
3403 /* generated by jison-lex 0.3.4 */
3404 var lexer = function () {
3405 var lexer = {
3406
3407 EOF: 1,
3408
3409 parseError: function parseError(str, hash) {
3410 if (this.yy.parser) {
3411 this.yy.parser.parseError(str, hash);
3412 } else {
3413 throw new Error(str);
3414 }
3415 },
3416
3417 // resets the lexer, sets new input
3418 setInput: function setInput(input, yy) {
3419 this.yy = yy || this.yy || {};
3420 this._input = input;
3421 this._more = this._backtrack = this.done = false;
3422 this.yylineno = this.yyleng = 0;
3423 this.yytext = this.matched = this.match = '';
3424 this.conditionStack = ['INITIAL'];
3425 this.yylloc = {
3426 first_line: 1,
3427 first_column: 0,
3428 last_line: 1,
3429 last_column: 0
3430 };
3431 if (this.options.ranges) {
3432 this.yylloc.range = [0, 0];
3433 }
3434 this.offset = 0;
3435 return this;
3436 },
3437
3438 // consumes and returns one char from the input
3439 input: function input() {
3440 var ch = this._input[0];
3441 this.yytext += ch;
3442 this.yyleng++;
3443 this.offset++;
3444 this.match += ch;
3445 this.matched += ch;
3446 var lines = ch.match(/(?:\r\n?|\n).*/g);
3447 if (lines) {
3448 this.yylineno++;
3449 this.yylloc.last_line++;
3450 } else {
3451 this.yylloc.last_column++;
3452 }
3453 if (this.options.ranges) {
3454 this.yylloc.range[1]++;
3455 }
3456
3457 this._input = this._input.slice(1);
3458 return ch;
3459 },
3460
3461 // unshifts one char (or a string) into the input
3462 unput: function unput(ch) {
3463 var len = ch.length;
3464 var lines = ch.split(/(?:\r\n?|\n)/g);
3465
3466 this._input = ch + this._input;
3467 this.yytext = this.yytext.substr(0, this.yytext.length - len);
3468 //this.yyleng -= len;
3469 this.offset -= len;
3470 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
3471 this.match = this.match.substr(0, this.match.length - 1);
3472 this.matched = this.matched.substr(0, this.matched.length - 1);
3473
3474 if (lines.length - 1) {
3475 this.yylineno -= lines.length - 1;
3476 }
3477 var r = this.yylloc.range;
3478
3479 this.yylloc = {
3480 first_line: this.yylloc.first_line,
3481 last_line: this.yylineno + 1,
3482 first_column: this.yylloc.first_column,
3483 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
3484 };
3485
3486 if (this.options.ranges) {
3487 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
3488 }
3489 this.yyleng = this.yytext.length;
3490 return this;
3491 },
3492
3493 // When called from action, caches matched text and appends it on next action
3494 more: function more() {
3495 this._more = true;
3496 return this;
3497 },
3498
3499 // 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.
3500 reject: function reject() {
3501 if (this.options.backtrack_lexer) {
3502 this._backtrack = true;
3503 } else {
3504 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(), {
3505 text: "",
3506 token: null,
3507 line: this.yylineno
3508 });
3509 }
3510 return this;
3511 },
3512
3513 // retain first n characters of the match
3514 less: function less(n) {
3515 this.unput(this.match.slice(n));
3516 },
3517
3518 // displays already matched input, i.e. for error messages
3519 pastInput: function pastInput() {
3520 var past = this.matched.substr(0, this.matched.length - this.match.length);
3521 return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
3522 },
3523
3524 // displays upcoming input, i.e. for error messages
3525 upcomingInput: function upcomingInput() {
3526 var next = this.match;
3527 if (next.length < 20) {
3528 next += this._input.substr(0, 20 - next.length);
3529 }
3530 return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
3531 },
3532
3533 // displays the character position where the lexing error occurred, i.e. for error messages
3534 showPosition: function showPosition() {
3535 var pre = this.pastInput();
3536 var c = new Array(pre.length + 1).join("-");
3537 return pre + this.upcomingInput() + "\n" + c + "^";
3538 },
3539
3540 // test the lexed token: return FALSE when not a match, otherwise return token
3541 test_match: function test_match(match, indexed_rule) {
3542 var token, lines, backup;
3543
3544 if (this.options.backtrack_lexer) {
3545 // save context
3546 backup = {
3547 yylineno: this.yylineno,
3548 yylloc: {
3549 first_line: this.yylloc.first_line,
3550 last_line: this.last_line,
3551 first_column: this.yylloc.first_column,
3552 last_column: this.yylloc.last_column
3553 },
3554 yytext: this.yytext,
3555 match: this.match,
3556 matches: this.matches,
3557 matched: this.matched,
3558 yyleng: this.yyleng,
3559 offset: this.offset,
3560 _more: this._more,
3561 _input: this._input,
3562 yy: this.yy,
3563 conditionStack: this.conditionStack.slice(0),
3564 done: this.done
3565 };
3566 if (this.options.ranges) {
3567 backup.yylloc.range = this.yylloc.range.slice(0);
3568 }
3569 }
3570
3571 lines = match[0].match(/(?:\r\n?|\n).*/g);
3572 if (lines) {
3573 this.yylineno += lines.length;
3574 }
3575 this.yylloc = {
3576 first_line: this.yylloc.last_line,
3577 last_line: this.yylineno + 1,
3578 first_column: this.yylloc.last_column,
3579 last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
3580 };
3581 this.yytext += match[0];
3582 this.match += match[0];
3583 this.matches = match;
3584 this.yyleng = this.yytext.length;
3585 if (this.options.ranges) {
3586 this.yylloc.range = [this.offset, this.offset += this.yyleng];
3587 }
3588 this._more = false;
3589 this._backtrack = false;
3590 this._input = this._input.slice(match[0].length);
3591 this.matched += match[0];
3592 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
3593 if (this.done && this._input) {
3594 this.done = false;
3595 }
3596 if (token) {
3597 return token;
3598 } else if (this._backtrack) {
3599 // recover context
3600 for (var k in backup) {
3601 this[k] = backup[k];
3602 }
3603 return false; // rule action called reject() implying the next rule should be tested instead.
3604 }
3605 return false;
3606 },
3607
3608 // return next match in input
3609 next: function next() {
3610 if (this.done) {
3611 return this.EOF;
3612 }
3613 if (!this._input) {
3614 this.done = true;
3615 }
3616
3617 var token, match, tempMatch, index;
3618 if (!this._more) {
3619 this.yytext = '';
3620 this.match = '';
3621 }
3622 var rules = this._currentRules();
3623 for (var i = 0; i < rules.length; i++) {
3624 tempMatch = this._input.match(this.rules[rules[i]]);
3625 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
3626 match = tempMatch;
3627 index = i;
3628 if (this.options.backtrack_lexer) {
3629 token = this.test_match(tempMatch, rules[i]);
3630 if (token !== false) {
3631 return token;
3632 } else if (this._backtrack) {
3633 match = false;
3634 continue; // rule action called reject() implying a rule MISmatch.
3635 } else {
3636 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
3637 return false;
3638 }
3639 } else if (!this.options.flex) {
3640 break;
3641 }
3642 }
3643 }
3644 if (match) {
3645 token = this.test_match(match, rules[index]);
3646 if (token !== false) {
3647 return token;
3648 }
3649 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
3650 return false;
3651 }
3652 if (this._input === "") {
3653 return this.EOF;
3654 } else {
3655 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
3656 text: "",
3657 token: null,
3658 line: this.yylineno
3659 });
3660 }
3661 },
3662
3663 // return next match that has a token
3664 lex: function lex() {
3665 var r = this.next();
3666 if (r) {
3667 return r;
3668 } else {
3669 return this.lex();
3670 }
3671 },
3672
3673 // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
3674 begin: function begin(condition) {
3675 this.conditionStack.push(condition);
3676 },
3677
3678 // pop the previously active lexer condition state off the condition stack
3679 popState: function popState() {
3680 var n = this.conditionStack.length - 1;
3681 if (n > 0) {
3682 return this.conditionStack.pop();
3683 } else {
3684 return this.conditionStack[0];
3685 }
3686 },
3687
3688 // produce the lexer rule set which is active for the currently active lexer condition state
3689 _currentRules: function _currentRules() {
3690 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
3691 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
3692 } else {
3693 return this.conditions["INITIAL"].rules;
3694 }
3695 },
3696
3697 // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
3698 topState: function topState(n) {
3699 n = this.conditionStack.length - 1 - Math.abs(n || 0);
3700 if (n >= 0) {
3701 return this.conditionStack[n];
3702 } else {
3703 return "INITIAL";
3704 }
3705 },
3706
3707 // alias for begin(condition)
3708 pushState: function pushState(condition) {
3709 this.begin(condition);
3710 },
3711
3712 // return the number of states currently on the stack
3713 stateStackSize: function stateStackSize() {
3714 return this.conditionStack.length;
3715 },
3716 options: {},
3717 performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
3718 var YYSTATE = YY_START;
3719 switch ($avoiding_name_collisions) {
3720 case 0:
3721 /* do nothing */
3722 break;
3723 case 1:
3724 this.begin("string");
3725 break;
3726 case 2:
3727 this.popState();
3728 break;
3729 case 3:
3730 return "STR";
3731 break;
3732 case 4:
3733 return 71;
3734 break;
3735 case 5:
3736 return 78;
3737 break;
3738 case 6:
3739 return 72;
3740 break;
3741 case 7:
3742 return 82;
3743 break;
3744 case 8:
3745 return 73;
3746 break;
3747 case 9:
3748 return 74;
3749 break;
3750 case 10:
3751 return 75;
3752 break;
3753 case 11:
3754 return 12;
3755 break;
3756 case 12:
3757 return 30;
3758 break;
3759 case 13:
3760 return 32;
3761 break;
3762 case 14:
3763 return 13;
3764 break;
3765 case 15:
3766 return 13;
3767 break;
3768 case 16:
3769 return 13;
3770 break;
3771 case 17:
3772 return 13;
3773 break;
3774 case 18:
3775 return 13;
3776 break;
3777 case 19:
3778 return 13;
3779 break;
3780 case 20:
3781 return 81;
3782 break;
3783 case 21:
3784 return 91;
3785 break;
3786 case 22:
3787 return 89;
3788 break;
3789 case 23:
3790 return 8;
3791 break;
3792 case 24:
3793 return 86;
3794 break;
3795 case 25:
3796 return 98;
3797 break;
3798 case 26:
3799 return 16;
3800 break;
3801 case 27:
3802 return 15;
3803 break;
3804 case 28:
3805 return 17;
3806 break;
3807 case 29:
3808 return 18;
3809 break;
3810 case 30:
3811 return 53;
3812 break;
3813 case 31:
3814 return 51;
3815 break;
3816 case 32:
3817 return 52;
3818 break;
3819 case 33:
3820 return 54;
3821 break;
3822 case 34:
3823 return 58;
3824 break;
3825 case 35:
3826 return 56;
3827 break;
3828 case 36:
3829 return 57;
3830 break;
3831 case 37:
3832 return 59;
3833 break;
3834 case 38:
3835 return 58;
3836 break;
3837 case 39:
3838 return 56;
3839 break;
3840 case 40:
3841 return 57;
3842 break;
3843 case 41:
3844 return 59;
3845 break;
3846 case 42:
3847 return 63;
3848 break;
3849 case 43:
3850 return 61;
3851 break;
3852 case 44:
3853 return 62;
3854 break;
3855 case 45:
3856 return 64;
3857 break;
3858 case 46:
3859 return 50;
3860 break;
3861 case 47:
3862 return 55;
3863 break;
3864 case 48:
3865 return 60;
3866 break;
3867 case 49:
3868 return 40;
3869 break;
3870 case 50:
3871 return 41;
3872 break;
3873 case 51:
3874 return 46;
3875 break;
3876 case 52:
3877 return 92;
3878 break;
3879 case 53:
3880 return 96;
3881 break;
3882 case 54:
3883 return 84;
3884 break;
3885 case 55:
3886 return 97;
3887 break;
3888 case 56:
3889 return 97;
3890 break;
3891 case 57:
3892 return 88;
3893 break;
3894 case 58:
3895 return 94;
3896 break;
3897 case 59:
3898 return 95;
3899 break;
3900 case 60:
3901 return 65;
3902 break;
3903 case 61:
3904 return 38;
3905 break;
3906 case 62:
3907 return 39;
3908 break;
3909 case 63:
3910 return 36;
3911 break;
3912 case 64:
3913 return 37;
3914 break;
3915 case 65:
3916 return 42;
3917 break;
3918 case 66:
3919 return 43;
3920 break;
3921 case 67:
3922 return 101;
3923 break;
3924 case 68:
3925 return 9;
3926 break;
3927 case 69:
3928 return 10;
3929 break;
3930 case 70:
3931 return 11;
3932 break;
3933 }
3934 },
3935 rules: [/^(?:%%[^\n]*)/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:style\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\b)/, /^(?:class\b)/, /^(?:click\b)/, /^(?:graph\b)/, /^(?:subgraph\b)/, /^(?:end\b\s*)/, /^(?:LR\b)/, /^(?:RL\b)/, /^(?:TB\b)/, /^(?:BT\b)/, /^(?:TD\b)/, /^(?:BR\b)/, /^(?:[0-9]+)/, /^(?:#)/, /^(?::)/, /^(?:;)/, /^(?:,)/, /^(?:\*)/, /^(?:<)/, /^(?:>)/, /^(?:\^)/, /^(?:v\b)/, /^(?:\s*--[x]\s*)/, /^(?:\s*-->\s*)/, /^(?:\s*--[o]\s*)/, /^(?:\s*---\s*)/, /^(?:\s*-\.-[x]\s*)/, /^(?:\s*-\.->\s*)/, /^(?:\s*-\.-[o]\s*)/, /^(?:\s*-\.-\s*)/, /^(?:\s*.-[x]\s*)/, /^(?:\s*\.->\s*)/, /^(?:\s*\.-[o]\s*)/, /^(?:\s*\.-\s*)/, /^(?:\s*==[x]\s*)/, /^(?:\s*==>\s*)/, /^(?:\s*==[o]\s*)/, /^(?:\s*==[\=]\s*)/, /^(?:\s*--\s*)/, /^(?:\s*-\.\s*)/, /^(?:\s*==\s*)/, /^(?:\(-)/, /^(?:-\))/, /^(?:-)/, /^(?:\.)/, /^(?:\+)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:[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])/, /^(?:\|)/, /^(?:\()/, /^(?:\))/, /^(?:\[)/, /^(?:\])/, /^(?:\{)/, /^(?:\})/, /^(?:")/, /^(?:\n+)/, /^(?:\s)/, /^(?:$)/],
3936 conditions: { "string": { "rules": [2, 3], "inclusive": false }, "INITIAL": { "rules": [0, 1, 4, 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, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70], "inclusive": true } }
3937 };
3938 return lexer;
3939 }();
3940 parser.lexer = lexer;
3941 function Parser() {
3942 this.yy = {};
3943 }
3944 Parser.prototype = parser;parser.Parser = Parser;
3945 return new Parser();
3946}();
3947
3948if (true) {
3949 exports.parser = parser;
3950 exports.Parser = parser.Parser;
3951 exports.parse = function () {
3952 return parser.parse.apply(parser, arguments);
3953 };
3954 exports.main = function commonjsMain(args) {
3955 if (!args[1]) {
3956 console.log('Usage: ' + args[0] + ' FILE');
3957 process.exit(1);
3958 }
3959 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
3960 return exports.parser.parse(source);
3961 };
3962 if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
3963 exports.main(process.argv.slice(1));
3964 }
3965}
3966/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
3967
3968/***/ }),
3969
3970/***/ "./src/diagrams/gantt/ganttDb.js":
3971/*!***************************************!*\
3972 !*** ./src/diagrams/gantt/ganttDb.js ***!
3973 \***************************************/
3974/*! no static exports found */
3975/***/ (function(module, exports, __webpack_require__) {
3976
3977"use strict";
3978
3979
3980Object.defineProperty(exports, "__esModule", {
3981 value: true
3982});
3983exports.addTaskOrg = exports.findTaskById = exports.addTask = exports.getTasks = exports.addSection = exports.getTitle = exports.setTitle = exports.setDateFormat = exports.getAxisFormat = exports.setAxisFormat = exports.clear = undefined;
3984
3985var _moment = __webpack_require__(/*! moment */ "moment");
3986
3987var _moment2 = _interopRequireDefault(_moment);
3988
3989var _logger = __webpack_require__(/*! ../../logger */ "./src/logger.js");
3990
3991function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3992
3993var dateFormat = '';
3994var axisFormat = '';
3995var title = '';
3996var sections = [];
3997var tasks = [];
3998var currentSection = '';
3999
4000var clear = exports.clear = function clear() {
4001 sections = [];
4002 tasks = [];
4003 currentSection = '';
4004 title = '';
4005 taskCnt = 0;
4006 lastTask = undefined;
4007 lastTaskID = undefined;
4008 rawTasks = [];
4009};
4010
4011var setAxisFormat = exports.setAxisFormat = function setAxisFormat(txt) {
4012 axisFormat = txt;
4013};
4014
4015var getAxisFormat = exports.getAxisFormat = function getAxisFormat() {
4016 return axisFormat;
4017};
4018
4019var setDateFormat = exports.setDateFormat = function setDateFormat(txt) {
4020 dateFormat = txt;
4021};
4022
4023var setTitle = exports.setTitle = function setTitle(txt) {
4024 title = txt;
4025};
4026
4027var getTitle = exports.getTitle = function getTitle() {
4028 return title;
4029};
4030
4031var addSection = exports.addSection = function addSection(txt) {
4032 currentSection = txt;
4033 sections.push(txt);
4034};
4035
4036var getTasks = exports.getTasks = function getTasks() {
4037 var allItemsPricessed = compileTasks();
4038 var maxDepth = 10;
4039 var iterationCount = 0;
4040 while (!allItemsPricessed && iterationCount < maxDepth) {
4041 allItemsPricessed = compileTasks();
4042 iterationCount++;
4043 }
4044
4045 tasks = rawTasks;
4046
4047 return tasks;
4048};
4049
4050var getStartDate = function getStartDate(prevTime, dateFormat, str) {
4051 str = str.trim();
4052
4053 // Test for after
4054 var re = /^after\s+([\d\w-]+)/;
4055 var afterStatement = re.exec(str.trim());
4056
4057 if (afterStatement !== null) {
4058 var task = findTaskById(afterStatement[1]);
4059
4060 if (typeof task === 'undefined') {
4061 var dt = new Date();
4062 dt.setHours(0, 0, 0, 0);
4063 return dt;
4064 }
4065 return task.endTime;
4066 }
4067
4068 // Check for actual date set
4069 if ((0, _moment2.default)(str, dateFormat.trim(), true).isValid()) {
4070 return (0, _moment2.default)(str, dateFormat.trim(), true).toDate();
4071 } else {
4072 _logger.logger.debug('Invalid date:' + str);
4073 _logger.logger.debug('With date format:' + dateFormat.trim());
4074 }
4075
4076 // Default date - now
4077 return new Date();
4078};
4079
4080var getEndDate = function getEndDate(prevTime, dateFormat, str) {
4081 str = str.trim();
4082
4083 // Check for actual date
4084 if ((0, _moment2.default)(str, dateFormat.trim(), true).isValid()) {
4085 return (0, _moment2.default)(str, dateFormat.trim()).toDate();
4086 }
4087
4088 var d = (0, _moment2.default)(prevTime);
4089 // Check for length
4090 var re = /^([\d]+)([wdhms])/;
4091 var durationStatement = re.exec(str.trim());
4092
4093 if (durationStatement !== null) {
4094 switch (durationStatement[2]) {
4095 case 's':
4096 d.add(durationStatement[1], 'seconds');
4097 break;
4098 case 'm':
4099 d.add(durationStatement[1], 'minutes');
4100 break;
4101 case 'h':
4102 d.add(durationStatement[1], 'hours');
4103 break;
4104 case 'd':
4105 d.add(durationStatement[1], 'days');
4106 break;
4107 case 'w':
4108 d.add(durationStatement[1], 'weeks');
4109 break;
4110 }
4111 return d.toDate();
4112 }
4113 // Default date - now
4114 return d.toDate();
4115};
4116
4117var taskCnt = 0;
4118var parseId = function parseId(idStr) {
4119 if (typeof idStr === 'undefined') {
4120 taskCnt = taskCnt + 1;
4121 return 'task' + taskCnt;
4122 }
4123 return idStr;
4124};
4125// id, startDate, endDate
4126// id, startDate, length
4127// id, after x, endDate
4128// id, after x, length
4129// startDate, endDate
4130// startDate, length
4131// after x, endDate
4132// after x, length
4133// endDate
4134// length
4135
4136var compileData = function compileData(prevTask, dataStr) {
4137 var ds = void 0;
4138
4139 if (dataStr.substr(0, 1) === ':') {
4140 ds = dataStr.substr(1, dataStr.length);
4141 } else {
4142 ds = dataStr;
4143 }
4144
4145 var data = ds.split(',');
4146
4147 var task = {};
4148
4149 // Get tags like active, done cand crit
4150 var matchFound = true;
4151 while (matchFound) {
4152 matchFound = false;
4153 if (data[0].match(/^\s*active\s*$/)) {
4154 task.active = true;
4155 data.shift(1);
4156 matchFound = true;
4157 }
4158 if (data[0].match(/^\s*done\s*$/)) {
4159 task.done = true;
4160 data.shift(1);
4161 matchFound = true;
4162 }
4163 if (data[0].match(/^\s*crit\s*$/)) {
4164 task.crit = true;
4165 data.shift(1);
4166 matchFound = true;
4167 }
4168 }
4169 for (var i = 0; i < data.length; i++) {
4170 data[i] = data[i].trim();
4171 }
4172
4173 switch (data.length) {
4174 case 1:
4175 task.id = parseId();
4176 task.startTime = prevTask.endTime;
4177 task.endTime = getEndDate(task.startTime, dateFormat, data[0]);
4178 break;
4179 case 2:
4180 task.id = parseId();
4181 task.startTime = getStartDate(undefined, dateFormat, data[0]);
4182 task.endTime = getEndDate(task.startTime, dateFormat, data[1]);
4183 break;
4184 case 3:
4185 task.id = parseId(data[0]);
4186 task.startTime = getStartDate(undefined, dateFormat, data[1]);
4187 task.endTime = getEndDate(task.startTime, dateFormat, data[2]);
4188 break;
4189 default:
4190 }
4191
4192 return task;
4193};
4194
4195var parseData = function parseData(prevTaskId, dataStr) {
4196 var ds = void 0;
4197 if (dataStr.substr(0, 1) === ':') {
4198 ds = dataStr.substr(1, dataStr.length);
4199 } else {
4200 ds = dataStr;
4201 }
4202
4203 var data = ds.split(',');
4204
4205 var task = {};
4206
4207 // Get tags like active, done cand crit
4208 var matchFound = true;
4209 while (matchFound) {
4210 matchFound = false;
4211 if (data[0].match(/^\s*active\s*$/)) {
4212 task.active = true;
4213 data.shift(1);
4214 matchFound = true;
4215 }
4216 if (data[0].match(/^\s*done\s*$/)) {
4217 task.done = true;
4218 data.shift(1);
4219 matchFound = true;
4220 }
4221 if (data[0].match(/^\s*crit\s*$/)) {
4222 task.crit = true;
4223 data.shift(1);
4224 matchFound = true;
4225 }
4226 }
4227 for (var i = 0; i < data.length; i++) {
4228 data[i] = data[i].trim();
4229 }
4230
4231 switch (data.length) {
4232 case 1:
4233 task.id = parseId();
4234 task.startTime = { type: 'prevTaskEnd', id: prevTaskId };
4235 task.endTime = { data: data[0] };
4236 break;
4237 case 2:
4238 task.id = parseId();
4239 task.startTime = { type: 'getStartDate', startData: data[0] };
4240 task.endTime = { data: data[1] };
4241 break;
4242 case 3:
4243 task.id = parseId(data[0]);
4244 task.startTime = { type: 'getStartDate', startData: data[1] };
4245 task.endTime = { data: data[2] };
4246 break;
4247 default:
4248 }
4249
4250 return task;
4251};
4252
4253var lastTask = void 0;
4254var lastTaskID = void 0;
4255var rawTasks = [];
4256var taskDb = {};
4257var addTask = exports.addTask = function addTask(descr, data) {
4258 var rawTask = {
4259 section: currentSection,
4260 type: currentSection,
4261 processed: false,
4262 raw: { data: data },
4263 task: descr
4264 };
4265 var taskInfo = parseData(lastTaskID, data);
4266 rawTask.raw.startTime = taskInfo.startTime;
4267 rawTask.raw.endTime = taskInfo.endTime;
4268 rawTask.id = taskInfo.id;
4269 rawTask.prevTaskId = lastTaskID;
4270 rawTask.active = taskInfo.active;
4271 rawTask.done = taskInfo.done;
4272 rawTask.crit = taskInfo.crit;
4273
4274 var pos = rawTasks.push(rawTask);
4275
4276 lastTaskID = rawTask.id;
4277 // Store cross ref
4278 taskDb[rawTask.id] = pos - 1;
4279};
4280
4281var findTaskById = exports.findTaskById = function findTaskById(id) {
4282 var pos = taskDb[id];
4283 return rawTasks[pos];
4284};
4285
4286var addTaskOrg = exports.addTaskOrg = function addTaskOrg(descr, data) {
4287 var newTask = {
4288 section: currentSection,
4289 type: currentSection,
4290 description: descr,
4291 task: descr
4292 };
4293 var taskInfo = compileData(lastTask, data);
4294 newTask.startTime = taskInfo.startTime;
4295 newTask.endTime = taskInfo.endTime;
4296 newTask.id = taskInfo.id;
4297 newTask.active = taskInfo.active;
4298 newTask.done = taskInfo.done;
4299 newTask.crit = taskInfo.crit;
4300 lastTask = newTask;
4301 tasks.push(newTask);
4302};
4303
4304var compileTasks = function compileTasks() {
4305 var compileTask = function compileTask(pos) {
4306 var task = rawTasks[pos];
4307 var startTime = '';
4308 switch (rawTasks[pos].raw.startTime.type) {
4309 case 'prevTaskEnd':
4310 var prevTask = findTaskById(task.prevTaskId);
4311 task.startTime = prevTask.endTime;
4312 break;
4313 case 'getStartDate':
4314 startTime = getStartDate(undefined, dateFormat, rawTasks[pos].raw.startTime.startData);
4315 if (startTime) {
4316 rawTasks[pos].startTime = startTime;
4317 }
4318 break;
4319 }
4320
4321 if (rawTasks[pos].startTime) {
4322 rawTasks[pos].endTime = getEndDate(rawTasks[pos].startTime, dateFormat, rawTasks[pos].raw.endTime.data);
4323 if (rawTasks[pos].endTime) {
4324 rawTasks[pos].processed = true;
4325 }
4326 }
4327
4328 return rawTasks[pos].processed;
4329 };
4330
4331 var allProcessed = true;
4332 for (var i = 0; i < rawTasks.length; i++) {
4333 compileTask(i);
4334
4335 allProcessed = allProcessed && rawTasks[i].processed;
4336 }
4337 return allProcessed;
4338};
4339
4340exports.default = {
4341 clear: clear,
4342 setDateFormat: setDateFormat,
4343 setAxisFormat: setAxisFormat,
4344 getAxisFormat: getAxisFormat,
4345 setTitle: setTitle,
4346 getTitle: getTitle,
4347 addSection: addSection,
4348 getTasks: getTasks,
4349 addTask: addTask,
4350 findTaskById: findTaskById,
4351 addTaskOrg: addTaskOrg
4352};
4353
4354/***/ }),
4355
4356/***/ "./src/diagrams/gantt/ganttRenderer.js":
4357/*!*********************************************!*\
4358 !*** ./src/diagrams/gantt/ganttRenderer.js ***!
4359 \*********************************************/
4360/*! no static exports found */
4361/***/ (function(module, exports, __webpack_require__) {
4362
4363"use strict";
4364
4365
4366Object.defineProperty(exports, "__esModule", {
4367 value: true
4368});
4369exports.draw = exports.setConf = undefined;
4370
4371var _d = __webpack_require__(/*! d3 */ "d3");
4372
4373var d3 = _interopRequireWildcard(_d);
4374
4375var _gantt = __webpack_require__(/*! ./parser/gantt */ "./src/diagrams/gantt/parser/gantt.js");
4376
4377var _ganttDb = __webpack_require__(/*! ./ganttDb */ "./src/diagrams/gantt/ganttDb.js");
4378
4379var _ganttDb2 = _interopRequireDefault(_ganttDb);
4380
4381function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4382
4383function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
4384
4385_gantt.parser.yy = _ganttDb2.default;
4386
4387var conf = {
4388 titleTopMargin: 25,
4389 barHeight: 20,
4390 barGap: 4,
4391 topPadding: 50,
4392 rightPadding: 75,
4393 leftPadding: 75,
4394 gridLineStartPadding: 35,
4395 fontSize: 11,
4396 fontFamily: '"Open-Sans", "sans-serif"'
4397};
4398var setConf = exports.setConf = function setConf(cnf) {
4399 var keys = Object.keys(cnf);
4400
4401 keys.forEach(function (key) {
4402 conf[key] = cnf[key];
4403 });
4404};
4405var w = void 0;
4406var draw = exports.draw = function draw(text, id) {
4407 _gantt.parser.yy.clear();
4408 _gantt.parser.parse(text);
4409
4410 var elem = document.getElementById(id);
4411 w = elem.parentElement.offsetWidth;
4412
4413 if (typeof w === 'undefined') {
4414 w = 1200;
4415 }
4416
4417 if (typeof conf.useWidth !== 'undefined') {
4418 w = conf.useWidth;
4419 }
4420
4421 var taskArray = _gantt.parser.yy.getTasks();
4422
4423 // Set height based on number of tasks
4424 var h = taskArray.length * (conf.barHeight + conf.barGap) + 2 * conf.topPadding;
4425
4426 elem.setAttribute('height', '100%');
4427 // Set viewBox
4428 elem.setAttribute('viewBox', '0 0 ' + w + ' ' + h);
4429 var svg = d3.select('[id="' + id + '"]');
4430
4431 // Set timescale
4432 var timeScale = d3.scaleTime().domain([d3.min(taskArray, function (d) {
4433 return d.startTime;
4434 }), d3.max(taskArray, function (d) {
4435 return d.endTime;
4436 })]).rangeRound([0, w - conf.leftPadding - conf.rightPadding]);
4437
4438 var categories = [];
4439
4440 for (var i = 0; i < taskArray.length; i++) {
4441 categories.push(taskArray[i].type);
4442 }
4443
4444 var catsUnfiltered = categories; // for vert labels
4445
4446 categories = checkUnique(categories);
4447
4448 makeGant(taskArray, w, h);
4449 if (typeof conf.useWidth !== 'undefined') {
4450 elem.setAttribute('width', w);
4451 }
4452
4453 svg.append('text').text(_gantt.parser.yy.getTitle()).attr('x', w / 2).attr('y', conf.titleTopMargin).attr('class', 'titleText');
4454
4455 function makeGant(tasks, pageWidth, pageHeight) {
4456 var barHeight = conf.barHeight;
4457 var gap = barHeight + conf.barGap;
4458 var topPadding = conf.topPadding;
4459 var leftPadding = conf.leftPadding;
4460
4461 var colorScale = d3.scaleLinear().domain([0, categories.length]).range(['#00B9FA', '#F95002']).interpolate(d3.interpolateHcl);
4462
4463 makeGrid(leftPadding, topPadding, pageWidth, pageHeight);
4464 drawRects(tasks, gap, topPadding, leftPadding, barHeight, colorScale, pageWidth, pageHeight);
4465 vertLabels(gap, topPadding, leftPadding, barHeight, colorScale);
4466 drawToday(leftPadding, topPadding, pageWidth, pageHeight);
4467 }
4468
4469 function drawRects(theArray, theGap, theTopPad, theSidePad, theBarHeight, theColorScale, w, h) {
4470 svg.append('g').selectAll('rect').data(theArray).enter().append('rect').attr('x', 0).attr('y', function (d, i) {
4471 return i * theGap + theTopPad - 2;
4472 }).attr('width', function () {
4473 return w - conf.rightPadding / 2;
4474 }).attr('height', theGap).attr('class', function (d) {
4475 for (var _i = 0; _i < categories.length; _i++) {
4476 if (d.type === categories[_i]) {
4477 return 'section section' + _i % conf.numberSectionStyles;
4478 }
4479 }
4480 return 'section section0';
4481 });
4482
4483 var rectangles = svg.append('g').selectAll('rect').data(theArray).enter();
4484
4485 rectangles.append('rect').attr('rx', 3).attr('ry', 3).attr('x', function (d) {
4486 return timeScale(d.startTime) + theSidePad;
4487 }).attr('y', function (d, i) {
4488 return i * theGap + theTopPad;
4489 }).attr('width', function (d) {
4490 return timeScale(d.endTime) - timeScale(d.startTime);
4491 }).attr('height', theBarHeight).attr('class', function (d) {
4492 var res = 'task ';
4493
4494 var secNum = 0;
4495 for (var _i2 = 0; _i2 < categories.length; _i2++) {
4496 if (d.type === categories[_i2]) {
4497 secNum = _i2 % conf.numberSectionStyles;
4498 }
4499 }
4500
4501 if (d.active) {
4502 if (d.crit) {
4503 return res + ' activeCrit' + secNum;
4504 } else {
4505 return res + ' active' + secNum;
4506 }
4507 }
4508
4509 if (d.done) {
4510 if (d.crit) {
4511 return res + ' doneCrit' + secNum;
4512 } else {
4513 return res + ' done' + secNum;
4514 }
4515 }
4516
4517 if (d.crit) {
4518 return res + ' crit' + secNum;
4519 }
4520
4521 return res + ' task' + secNum;
4522 });
4523
4524 rectangles.append('text').text(function (d) {
4525 return d.task;
4526 }).attr('font-size', conf.fontSize).attr('x', function (d) {
4527 var startX = timeScale(d.startTime);
4528 var endX = timeScale(d.endTime);
4529 var textWidth = this.getBBox().width;
4530
4531 // Check id text width > width of rectangle
4532 if (textWidth > endX - startX) {
4533 if (endX + textWidth + 1.5 * conf.leftPadding > w) {
4534 return startX + theSidePad - 5;
4535 } else {
4536 return endX + theSidePad + 5;
4537 }
4538 } else {
4539 return (endX - startX) / 2 + startX + theSidePad;
4540 }
4541 }).attr('y', function (d, i) {
4542 return i * theGap + conf.barHeight / 2 + (conf.fontSize / 2 - 2) + theTopPad;
4543 }).attr('text-height', theBarHeight).attr('class', function (d) {
4544 var startX = timeScale(d.startTime);
4545 var endX = timeScale(d.endTime);
4546 var textWidth = this.getBBox().width;
4547 var secNum = 0;
4548 for (var _i3 = 0; _i3 < categories.length; _i3++) {
4549 if (d.type === categories[_i3]) {
4550 secNum = _i3 % conf.numberSectionStyles;
4551 }
4552 }
4553
4554 var taskType = '';
4555 if (d.active) {
4556 if (d.crit) {
4557 taskType = 'activeCritText' + secNum;
4558 } else {
4559 taskType = 'activeText' + secNum;
4560 }
4561 }
4562
4563 if (d.done) {
4564 if (d.crit) {
4565 taskType = taskType + ' doneCritText' + secNum;
4566 } else {
4567 taskType = taskType + ' doneText' + secNum;
4568 }
4569 } else {
4570 if (d.crit) {
4571 taskType = taskType + ' critText' + secNum;
4572 }
4573 }
4574
4575 // Check id text width > width of rectangle
4576 if (textWidth > endX - startX) {
4577 if (endX + textWidth + 1.5 * conf.leftPadding > w) {
4578 return 'taskTextOutsideLeft taskTextOutside' + secNum + ' ' + taskType;
4579 } else {
4580 return 'taskTextOutsideRight taskTextOutside' + secNum + ' ' + taskType;
4581 }
4582 } else {
4583 return 'taskText taskText' + secNum + ' ' + taskType;
4584 }
4585 });
4586 }
4587
4588 function makeGrid(theSidePad, theTopPad, w, h) {
4589 var xAxis = d3.axisBottom(timeScale).tickSize(-h + theTopPad + conf.gridLineStartPadding).tickFormat(d3.timeFormat(_gantt.parser.yy.getAxisFormat() || conf.axisFormat || '%Y-%m-%d'));
4590
4591 svg.append('g').attr('class', 'grid').attr('transform', 'translate(' + theSidePad + ', ' + (h - 50) + ')').call(xAxis).selectAll('text').style('text-anchor', 'middle').attr('fill', '#000').attr('stroke', 'none').attr('font-size', 10).attr('dy', '1em');
4592 }
4593
4594 function vertLabels(theGap, theTopPad) {
4595 var numOccurances = [];
4596 var prevGap = 0;
4597
4598 for (var _i4 = 0; _i4 < categories.length; _i4++) {
4599 numOccurances[_i4] = [categories[_i4], getCount(categories[_i4], catsUnfiltered)];
4600 }
4601
4602 svg.append('g') // without doing this, impossible to put grid lines behind text
4603 .selectAll('text').data(numOccurances).enter().append('text').text(function (d) {
4604 return d[0];
4605 }).attr('x', 10).attr('y', function (d, i) {
4606 if (i > 0) {
4607 for (var j = 0; j < i; j++) {
4608 prevGap += numOccurances[i - 1][1];
4609 return d[1] * theGap / 2 + prevGap * theGap + theTopPad;
4610 }
4611 } else {
4612 return d[1] * theGap / 2 + theTopPad;
4613 }
4614 }).attr('class', function (d) {
4615 for (var _i5 = 0; _i5 < categories.length; _i5++) {
4616 if (d[0] === categories[_i5]) {
4617 return 'sectionTitle sectionTitle' + _i5 % conf.numberSectionStyles;
4618 }
4619 }
4620 return 'sectionTitle';
4621 });
4622 }
4623
4624 function drawToday(theSidePad, theTopPad, w, h) {
4625 var todayG = svg.append('g').attr('class', 'today');
4626
4627 var today = new Date();
4628
4629 todayG.append('line').attr('x1', timeScale(today) + theSidePad).attr('x2', timeScale(today) + theSidePad).attr('y1', conf.titleTopMargin).attr('y2', h - conf.titleTopMargin).attr('class', 'today');
4630 }
4631
4632 // from this stackexchange question: http://stackoverflow.com/questions/1890203/unique-for-arrays-in-javascript
4633 function checkUnique(arr) {
4634 var hash = {};
4635 var result = [];
4636 for (var _i6 = 0, l = arr.length; _i6 < l; ++_i6) {
4637 if (!hash.hasOwnProperty(arr[_i6])) {
4638 // it works with objects! in FF, at least
4639 hash[arr[_i6]] = true;
4640 result.push(arr[_i6]);
4641 }
4642 }
4643 return result;
4644 }
4645
4646 // from this stackexchange question: http://stackoverflow.com/questions/14227981/count-how-many-strings-in-an-array-have-duplicates-in-the-same-array
4647 function getCounts(arr) {
4648 var i = arr.length; // const to loop over
4649 var obj = {}; // obj to store results
4650 while (i) {
4651 obj[arr[--i]] = (obj[arr[i]] || 0) + 1; // count occurrences
4652 }
4653 return obj;
4654 }
4655
4656 // get specific from everything
4657 function getCount(word, arr) {
4658 return getCounts(arr)[word] || 0;
4659 }
4660};
4661
4662exports.default = {
4663 setConf: setConf,
4664 draw: draw
4665};
4666
4667/***/ }),
4668
4669/***/ "./src/diagrams/gantt/parser/gantt.js":
4670/*!********************************************!*\
4671 !*** ./src/diagrams/gantt/parser/gantt.js ***!
4672 \********************************************/
4673/*! no static exports found */
4674/***/ (function(module, exports, __webpack_require__) {
4675
4676"use strict";
4677/* WEBPACK VAR INJECTION */(function(process, module) {
4678
4679/* parser generated by jison 0.4.18 */
4680/*
4681 Returns a Parser object of the following structure:
4682
4683 Parser: {
4684 yy: {}
4685 }
4686
4687 Parser.prototype: {
4688 yy: {},
4689 trace: function(),
4690 symbols_: {associative list: name ==> number},
4691 terminals_: {associative list: number ==> name},
4692 productions_: [...],
4693 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
4694 table: [...],
4695 defaultActions: {...},
4696 parseError: function(str, hash),
4697 parse: function(input),
4698
4699 lexer: {
4700 EOF: 1,
4701 parseError: function(str, hash),
4702 setInput: function(input),
4703 input: function(),
4704 unput: function(str),
4705 more: function(),
4706 less: function(n),
4707 pastInput: function(),
4708 upcomingInput: function(),
4709 showPosition: function(),
4710 test_match: function(regex_match_array, rule_index),
4711 next: function(),
4712 lex: function(),
4713 begin: function(condition),
4714 popState: function(),
4715 _currentRules: function(),
4716 topState: function(),
4717 pushState: function(condition),
4718
4719 options: {
4720 ranges: boolean (optional: true ==> token location info will include a .range[] member)
4721 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
4722 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)
4723 },
4724
4725 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
4726 rules: [...],
4727 conditions: {associative list: name ==> set},
4728 }
4729 }
4730
4731
4732 token location info (@$, _$, etc.): {
4733 first_line: n,
4734 last_line: n,
4735 first_column: n,
4736 last_column: n,
4737 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
4738 }
4739
4740
4741 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
4742 text: (matched text)
4743 token: (the produced terminal token, if any)
4744 line: (yylineno)
4745 }
4746 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
4747 loc: (yylloc)
4748 expected: (string describing the set of expected tokens)
4749 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
4750 }
4751*/
4752var parser = function () {
4753 var o = function o(k, v, _o, l) {
4754 for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
4755 },
4756 $V0 = [6, 8, 10, 11, 12, 13, 14, 15],
4757 $V1 = [1, 9],
4758 $V2 = [1, 10],
4759 $V3 = [1, 11],
4760 $V4 = [1, 12],
4761 $V5 = [1, 13];
4762 var parser = { trace: function trace() {},
4763 yy: {},
4764 symbols_: { "error": 2, "start": 3, "gantt": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NL": 10, "dateFormat": 11, "axisFormat": 12, "title": 13, "section": 14, "taskTxt": 15, "taskData": 16, "$accept": 0, "$end": 1 },
4765 terminals_: { 2: "error", 4: "gantt", 6: "EOF", 8: "SPACE", 10: "NL", 11: "dateFormat", 12: "axisFormat", 13: "title", 14: "section", 15: "taskTxt", 16: "taskData" },
4766 productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 2]],
4767 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
4768 /* this == yyval */
4769
4770 var $0 = $$.length - 1;
4771 switch (yystate) {
4772 case 1:
4773 return $$[$0 - 1];
4774 break;
4775 case 2:
4776 this.$ = [];
4777 break;
4778 case 3:
4779 $$[$0 - 1].push($$[$0]);this.$ = $$[$0 - 1];
4780 break;
4781 case 4:case 5:
4782 this.$ = $$[$0];
4783 break;
4784 case 6:case 7:
4785 this.$ = [];
4786 break;
4787 case 8:
4788 yy.setDateFormat($$[$0].substr(11));this.$ = $$[$0].substr(11);
4789 break;
4790 case 9:
4791 yy.setAxisFormat($$[$0].substr(11));this.$ = $$[$0].substr(11);
4792 break;
4793 case 10:
4794 yy.setTitle($$[$0].substr(6));this.$ = $$[$0].substr(6);
4795 break;
4796 case 11:
4797 yy.addSection($$[$0].substr(8));this.$ = $$[$0].substr(8);
4798 break;
4799 case 12:
4800 yy.addTask($$[$0 - 1], $$[$0]);this.$ = 'task';
4801 break;
4802 }
4803 },
4804 table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: $V1, 12: $V2, 13: $V3, 14: $V4, 15: $V5 }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 14, 11: $V1, 12: $V2, 13: $V3, 14: $V4, 15: $V5 }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 8]), o($V0, [2, 9]), o($V0, [2, 10]), o($V0, [2, 11]), { 16: [1, 15] }, o($V0, [2, 4]), o($V0, [2, 12])],
4805 defaultActions: {},
4806 parseError: function parseError(str, hash) {
4807 if (hash.recoverable) {
4808 this.trace(str);
4809 } else {
4810 var error = new Error(str);
4811 error.hash = hash;
4812 throw error;
4813 }
4814 },
4815 parse: function parse(input) {
4816 var self = this,
4817 stack = [0],
4818 tstack = [],
4819 vstack = [null],
4820 lstack = [],
4821 table = this.table,
4822 yytext = '',
4823 yylineno = 0,
4824 yyleng = 0,
4825 recovering = 0,
4826 TERROR = 2,
4827 EOF = 1;
4828 var args = lstack.slice.call(arguments, 1);
4829 var lexer = Object.create(this.lexer);
4830 var sharedState = { yy: {} };
4831 for (var k in this.yy) {
4832 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
4833 sharedState.yy[k] = this.yy[k];
4834 }
4835 }
4836 lexer.setInput(input, sharedState.yy);
4837 sharedState.yy.lexer = lexer;
4838 sharedState.yy.parser = this;
4839 if (typeof lexer.yylloc == 'undefined') {
4840 lexer.yylloc = {};
4841 }
4842 var yyloc = lexer.yylloc;
4843 lstack.push(yyloc);
4844 var ranges = lexer.options && lexer.options.ranges;
4845 if (typeof sharedState.yy.parseError === 'function') {
4846 this.parseError = sharedState.yy.parseError;
4847 } else {
4848 this.parseError = Object.getPrototypeOf(this).parseError;
4849 }
4850 function popStack(n) {
4851 stack.length = stack.length - 2 * n;
4852 vstack.length = vstack.length - n;
4853 lstack.length = lstack.length - n;
4854 }
4855 function lex() {
4856 var token;
4857 token = tstack.pop() || lexer.lex() || EOF;
4858 if (typeof token !== 'number') {
4859 if (token instanceof Array) {
4860 tstack = token;
4861 token = tstack.pop();
4862 }
4863 token = self.symbols_[token] || token;
4864 }
4865 return token;
4866 }
4867 var symbol,
4868 preErrorSymbol,
4869 state,
4870 action,
4871 a,
4872 r,
4873 yyval = {},
4874 p,
4875 len,
4876 newState,
4877 expected;
4878 while (true) {
4879 state = stack[stack.length - 1];
4880 if (this.defaultActions[state]) {
4881 action = this.defaultActions[state];
4882 } else {
4883 if (symbol === null || typeof symbol == 'undefined') {
4884 symbol = lex();
4885 }
4886 action = table[state] && table[state][symbol];
4887 }
4888 if (typeof action === 'undefined' || !action.length || !action[0]) {
4889 var errStr = '';
4890 expected = [];
4891 for (p in table[state]) {
4892 if (this.terminals_[p] && p > TERROR) {
4893 expected.push('\'' + this.terminals_[p] + '\'');
4894 }
4895 }
4896 if (lexer.showPosition) {
4897 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
4898 } else {
4899 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
4900 }
4901 this.parseError(errStr, {
4902 text: lexer.match,
4903 token: this.terminals_[symbol] || symbol,
4904 line: lexer.yylineno,
4905 loc: yyloc,
4906 expected: expected
4907 });
4908 }
4909 if (action[0] instanceof Array && action.length > 1) {
4910 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
4911 }
4912 switch (action[0]) {
4913 case 1:
4914 stack.push(symbol);
4915 vstack.push(lexer.yytext);
4916 lstack.push(lexer.yylloc);
4917 stack.push(action[1]);
4918 symbol = null;
4919 if (!preErrorSymbol) {
4920 yyleng = lexer.yyleng;
4921 yytext = lexer.yytext;
4922 yylineno = lexer.yylineno;
4923 yyloc = lexer.yylloc;
4924 if (recovering > 0) {
4925 recovering--;
4926 }
4927 } else {
4928 symbol = preErrorSymbol;
4929 preErrorSymbol = null;
4930 }
4931 break;
4932 case 2:
4933 len = this.productions_[action[1]][1];
4934 yyval.$ = vstack[vstack.length - len];
4935 yyval._$ = {
4936 first_line: lstack[lstack.length - (len || 1)].first_line,
4937 last_line: lstack[lstack.length - 1].last_line,
4938 first_column: lstack[lstack.length - (len || 1)].first_column,
4939 last_column: lstack[lstack.length - 1].last_column
4940 };
4941 if (ranges) {
4942 yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
4943 }
4944 r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
4945 if (typeof r !== 'undefined') {
4946 return r;
4947 }
4948 if (len) {
4949 stack = stack.slice(0, -1 * len * 2);
4950 vstack = vstack.slice(0, -1 * len);
4951 lstack = lstack.slice(0, -1 * len);
4952 }
4953 stack.push(this.productions_[action[1]][0]);
4954 vstack.push(yyval.$);
4955 lstack.push(yyval._$);
4956 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
4957 stack.push(newState);
4958 break;
4959 case 3:
4960 return true;
4961 }
4962 }
4963 return true;
4964 } };
4965
4966 /* generated by jison-lex 0.3.4 */
4967 var lexer = function () {
4968 var lexer = {
4969
4970 EOF: 1,
4971
4972 parseError: function parseError(str, hash) {
4973 if (this.yy.parser) {
4974 this.yy.parser.parseError(str, hash);
4975 } else {
4976 throw new Error(str);
4977 }
4978 },
4979
4980 // resets the lexer, sets new input
4981 setInput: function setInput(input, yy) {
4982 this.yy = yy || this.yy || {};
4983 this._input = input;
4984 this._more = this._backtrack = this.done = false;
4985 this.yylineno = this.yyleng = 0;
4986 this.yytext = this.matched = this.match = '';
4987 this.conditionStack = ['INITIAL'];
4988 this.yylloc = {
4989 first_line: 1,
4990 first_column: 0,
4991 last_line: 1,
4992 last_column: 0
4993 };
4994 if (this.options.ranges) {
4995 this.yylloc.range = [0, 0];
4996 }
4997 this.offset = 0;
4998 return this;
4999 },
5000
5001 // consumes and returns one char from the input
5002 input: function input() {
5003 var ch = this._input[0];
5004 this.yytext += ch;
5005 this.yyleng++;
5006 this.offset++;
5007 this.match += ch;
5008 this.matched += ch;
5009 var lines = ch.match(/(?:\r\n?|\n).*/g);
5010 if (lines) {
5011 this.yylineno++;
5012 this.yylloc.last_line++;
5013 } else {
5014 this.yylloc.last_column++;
5015 }
5016 if (this.options.ranges) {
5017 this.yylloc.range[1]++;
5018 }
5019
5020 this._input = this._input.slice(1);
5021 return ch;
5022 },
5023
5024 // unshifts one char (or a string) into the input
5025 unput: function unput(ch) {
5026 var len = ch.length;
5027 var lines = ch.split(/(?:\r\n?|\n)/g);
5028
5029 this._input = ch + this._input;
5030 this.yytext = this.yytext.substr(0, this.yytext.length - len);
5031 //this.yyleng -= len;
5032 this.offset -= len;
5033 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
5034 this.match = this.match.substr(0, this.match.length - 1);
5035 this.matched = this.matched.substr(0, this.matched.length - 1);
5036
5037 if (lines.length - 1) {
5038 this.yylineno -= lines.length - 1;
5039 }
5040 var r = this.yylloc.range;
5041
5042 this.yylloc = {
5043 first_line: this.yylloc.first_line,
5044 last_line: this.yylineno + 1,
5045 first_column: this.yylloc.first_column,
5046 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
5047 };
5048
5049 if (this.options.ranges) {
5050 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
5051 }
5052 this.yyleng = this.yytext.length;
5053 return this;
5054 },
5055
5056 // When called from action, caches matched text and appends it on next action
5057 more: function more() {
5058 this._more = true;
5059 return this;
5060 },
5061
5062 // 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.
5063 reject: function reject() {
5064 if (this.options.backtrack_lexer) {
5065 this._backtrack = true;
5066 } else {
5067 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(), {
5068 text: "",
5069 token: null,
5070 line: this.yylineno
5071 });
5072 }
5073 return this;
5074 },
5075
5076 // retain first n characters of the match
5077 less: function less(n) {
5078 this.unput(this.match.slice(n));
5079 },
5080
5081 // displays already matched input, i.e. for error messages
5082 pastInput: function pastInput() {
5083 var past = this.matched.substr(0, this.matched.length - this.match.length);
5084 return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
5085 },
5086
5087 // displays upcoming input, i.e. for error messages
5088 upcomingInput: function upcomingInput() {
5089 var next = this.match;
5090 if (next.length < 20) {
5091 next += this._input.substr(0, 20 - next.length);
5092 }
5093 return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
5094 },
5095
5096 // displays the character position where the lexing error occurred, i.e. for error messages
5097 showPosition: function showPosition() {
5098 var pre = this.pastInput();
5099 var c = new Array(pre.length + 1).join("-");
5100 return pre + this.upcomingInput() + "\n" + c + "^";
5101 },
5102
5103 // test the lexed token: return FALSE when not a match, otherwise return token
5104 test_match: function test_match(match, indexed_rule) {
5105 var token, lines, backup;
5106
5107 if (this.options.backtrack_lexer) {
5108 // save context
5109 backup = {
5110 yylineno: this.yylineno,
5111 yylloc: {
5112 first_line: this.yylloc.first_line,
5113 last_line: this.last_line,
5114 first_column: this.yylloc.first_column,
5115 last_column: this.yylloc.last_column
5116 },
5117 yytext: this.yytext,
5118 match: this.match,
5119 matches: this.matches,
5120 matched: this.matched,
5121 yyleng: this.yyleng,
5122 offset: this.offset,
5123 _more: this._more,
5124 _input: this._input,
5125 yy: this.yy,
5126 conditionStack: this.conditionStack.slice(0),
5127 done: this.done
5128 };
5129 if (this.options.ranges) {
5130 backup.yylloc.range = this.yylloc.range.slice(0);
5131 }
5132 }
5133
5134 lines = match[0].match(/(?:\r\n?|\n).*/g);
5135 if (lines) {
5136 this.yylineno += lines.length;
5137 }
5138 this.yylloc = {
5139 first_line: this.yylloc.last_line,
5140 last_line: this.yylineno + 1,
5141 first_column: this.yylloc.last_column,
5142 last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
5143 };
5144 this.yytext += match[0];
5145 this.match += match[0];
5146 this.matches = match;
5147 this.yyleng = this.yytext.length;
5148 if (this.options.ranges) {
5149 this.yylloc.range = [this.offset, this.offset += this.yyleng];
5150 }
5151 this._more = false;
5152 this._backtrack = false;
5153 this._input = this._input.slice(match[0].length);
5154 this.matched += match[0];
5155 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
5156 if (this.done && this._input) {
5157 this.done = false;
5158 }
5159 if (token) {
5160 return token;
5161 } else if (this._backtrack) {
5162 // recover context
5163 for (var k in backup) {
5164 this[k] = backup[k];
5165 }
5166 return false; // rule action called reject() implying the next rule should be tested instead.
5167 }
5168 return false;
5169 },
5170
5171 // return next match in input
5172 next: function next() {
5173 if (this.done) {
5174 return this.EOF;
5175 }
5176 if (!this._input) {
5177 this.done = true;
5178 }
5179
5180 var token, match, tempMatch, index;
5181 if (!this._more) {
5182 this.yytext = '';
5183 this.match = '';
5184 }
5185 var rules = this._currentRules();
5186 for (var i = 0; i < rules.length; i++) {
5187 tempMatch = this._input.match(this.rules[rules[i]]);
5188 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
5189 match = tempMatch;
5190 index = i;
5191 if (this.options.backtrack_lexer) {
5192 token = this.test_match(tempMatch, rules[i]);
5193 if (token !== false) {
5194 return token;
5195 } else if (this._backtrack) {
5196 match = false;
5197 continue; // rule action called reject() implying a rule MISmatch.
5198 } else {
5199 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
5200 return false;
5201 }
5202 } else if (!this.options.flex) {
5203 break;
5204 }
5205 }
5206 }
5207 if (match) {
5208 token = this.test_match(match, rules[index]);
5209 if (token !== false) {
5210 return token;
5211 }
5212 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
5213 return false;
5214 }
5215 if (this._input === "") {
5216 return this.EOF;
5217 } else {
5218 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
5219 text: "",
5220 token: null,
5221 line: this.yylineno
5222 });
5223 }
5224 },
5225
5226 // return next match that has a token
5227 lex: function lex() {
5228 var r = this.next();
5229 if (r) {
5230 return r;
5231 } else {
5232 return this.lex();
5233 }
5234 },
5235
5236 // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
5237 begin: function begin(condition) {
5238 this.conditionStack.push(condition);
5239 },
5240
5241 // pop the previously active lexer condition state off the condition stack
5242 popState: function popState() {
5243 var n = this.conditionStack.length - 1;
5244 if (n > 0) {
5245 return this.conditionStack.pop();
5246 } else {
5247 return this.conditionStack[0];
5248 }
5249 },
5250
5251 // produce the lexer rule set which is active for the currently active lexer condition state
5252 _currentRules: function _currentRules() {
5253 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
5254 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
5255 } else {
5256 return this.conditions["INITIAL"].rules;
5257 }
5258 },
5259
5260 // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
5261 topState: function topState(n) {
5262 n = this.conditionStack.length - 1 - Math.abs(n || 0);
5263 if (n >= 0) {
5264 return this.conditionStack[n];
5265 } else {
5266 return "INITIAL";
5267 }
5268 },
5269
5270 // alias for begin(condition)
5271 pushState: function pushState(condition) {
5272 this.begin(condition);
5273 },
5274
5275 // return the number of states currently on the stack
5276 stateStackSize: function stateStackSize() {
5277 return this.conditionStack.length;
5278 },
5279 options: { "case-insensitive": true },
5280 performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
5281 // Pre-lexer code can go here
5282
5283 var YYSTATE = YY_START;
5284 switch ($avoiding_name_collisions) {
5285 case 0:
5286 return 10;
5287 break;
5288 case 1:
5289 /* skip whitespace */
5290 break;
5291 case 2:
5292 /* skip comments */
5293 break;
5294 case 3:
5295 /* skip comments */
5296 break;
5297 case 4:
5298 return 4;
5299 break;
5300 case 5:
5301 return 11;
5302 break;
5303 case 6:
5304 return 12;
5305 break;
5306 case 7:
5307 return 'date';
5308 break;
5309 case 8:
5310 return 13;
5311 break;
5312 case 9:
5313 return 14;
5314 break;
5315 case 10:
5316 return 15;
5317 break;
5318 case 11:
5319 return 16;
5320 break;
5321 case 12:
5322 return ':';
5323 break;
5324 case 13:
5325 return 6;
5326 break;
5327 case 14:
5328 return 'INVALID';
5329 break;
5330 }
5331 },
5332 rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:gantt\b)/i, /^(?:dateFormat\s[^#\n;]+)/i, /^(?:axisFormat\s[^#\n;]+)/i, /^(?:\d\d\d\d-\d\d-\d\d\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:section\s[^#:\n;]+)/i, /^(?:[^#:\n;]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i],
5333 conditions: { "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "inclusive": true } }
5334 };
5335 return lexer;
5336 }();
5337 parser.lexer = lexer;
5338 function Parser() {
5339 this.yy = {};
5340 }
5341 Parser.prototype = parser;parser.Parser = Parser;
5342 return new Parser();
5343}();
5344
5345if (true) {
5346 exports.parser = parser;
5347 exports.Parser = parser.Parser;
5348 exports.parse = function () {
5349 return parser.parse.apply(parser, arguments);
5350 };
5351 exports.main = function commonjsMain(args) {
5352 if (!args[1]) {
5353 console.log('Usage: ' + args[0] + ' FILE');
5354 process.exit(1);
5355 }
5356 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
5357 return exports.parser.parse(source);
5358 };
5359 if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
5360 exports.main(process.argv.slice(1));
5361 }
5362}
5363/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
5364
5365/***/ }),
5366
5367/***/ "./src/diagrams/git/gitGraphAst.js":
5368/*!*****************************************!*\
5369 !*** ./src/diagrams/git/gitGraphAst.js ***!
5370 \*****************************************/
5371/*! no static exports found */
5372/***/ (function(module, exports, __webpack_require__) {
5373
5374"use strict";
5375
5376
5377Object.defineProperty(exports, "__esModule", {
5378 value: true
5379});
5380exports.getHead = exports.getDirection = exports.getCurrentBranch = exports.getCommitsArray = exports.getCommits = exports.getBranches = exports.getBranchesAsObjArray = exports.clear = exports.prettyPrint = exports.reset = exports.checkout = exports.merge = exports.branch = exports.commit = exports.getOptions = exports.setOptions = exports.setDirection = undefined;
5381
5382var _lodash = __webpack_require__(/*! lodash */ "lodash");
5383
5384var _lodash2 = _interopRequireDefault(_lodash);
5385
5386var _logger = __webpack_require__(/*! ../../logger */ "./src/logger.js");
5387
5388function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5389
5390var commits = {};
5391var head = null;
5392var branches = { 'master': head };
5393var curBranch = 'master';
5394var direction = 'LR';
5395var seq = 0;
5396
5397function getRandomInt(min, max) {
5398 return Math.floor(Math.random() * (max - min)) + min;
5399}
5400
5401function getId() {
5402 var pool = '0123456789abcdef';
5403 var id = '';
5404 for (var i = 0; i < 7; i++) {
5405 id += pool[getRandomInt(0, 16)];
5406 }
5407 return id;
5408}
5409
5410function isfastforwardable(currentCommit, otherCommit) {
5411 _logger.logger.debug('Entering isfastforwardable:', currentCommit.id, otherCommit.id);
5412 while (currentCommit.seq <= otherCommit.seq && currentCommit !== otherCommit) {
5413 // only if other branch has more commits
5414 if (otherCommit.parent == null) break;
5415 if (Array.isArray(otherCommit.parent)) {
5416 _logger.logger.debug('In merge commit:', otherCommit.parent);
5417 return isfastforwardable(currentCommit, commits[otherCommit.parent[0]]) || isfastforwardable(currentCommit, commits[otherCommit.parent[1]]);
5418 } else {
5419 otherCommit = commits[otherCommit.parent];
5420 }
5421 }
5422 _logger.logger.debug(currentCommit.id, otherCommit.id);
5423 return currentCommit.id === otherCommit.id;
5424}
5425
5426function isReachableFrom(currentCommit, otherCommit) {
5427 var currentSeq = currentCommit.seq;
5428 var otherSeq = otherCommit.seq;
5429 if (currentSeq > otherSeq) return isfastforwardable(otherCommit, currentCommit);
5430 return false;
5431}
5432
5433var setDirection = exports.setDirection = function setDirection(dir) {
5434 direction = dir;
5435};
5436var options = {};
5437var setOptions = exports.setOptions = function setOptions(rawOptString) {
5438 _logger.logger.debug('options str', rawOptString);
5439 rawOptString = rawOptString && rawOptString.trim();
5440 rawOptString = rawOptString || '{}';
5441 try {
5442 options = JSON.parse(rawOptString);
5443 } catch (e) {
5444 _logger.logger.error('error while parsing gitGraph options', e.message);
5445 }
5446};
5447
5448var getOptions = exports.getOptions = function getOptions() {
5449 return options;
5450};
5451
5452var commit = exports.commit = function commit(msg) {
5453 var commit = {
5454 id: getId(),
5455 message: msg,
5456 seq: seq++,
5457 parent: head == null ? null : head.id
5458 };
5459 head = commit;
5460 commits[commit.id] = commit;
5461 branches[curBranch] = commit.id;
5462 _logger.logger.debug('in pushCommit ' + commit.id);
5463};
5464
5465var branch = exports.branch = function branch(name) {
5466 branches[name] = head != null ? head.id : null;
5467 _logger.logger.debug('in createBranch');
5468};
5469
5470var merge = exports.merge = function merge(otherBranch) {
5471 var currentCommit = commits[branches[curBranch]];
5472 var otherCommit = commits[branches[otherBranch]];
5473 if (isReachableFrom(currentCommit, otherCommit)) {
5474 _logger.logger.debug('Already merged');
5475 return;
5476 }
5477 if (isfastforwardable(currentCommit, otherCommit)) {
5478 branches[curBranch] = branches[otherBranch];
5479 head = commits[branches[curBranch]];
5480 } else {
5481 // create merge commit
5482 var _commit = {
5483 id: getId(),
5484 message: 'merged branch ' + otherBranch + ' into ' + curBranch,
5485 seq: seq++,
5486 parent: [head == null ? null : head.id, branches[otherBranch]]
5487 };
5488 head = _commit;
5489 commits[_commit.id] = _commit;
5490 branches[curBranch] = _commit.id;
5491 }
5492 _logger.logger.debug(branches);
5493 _logger.logger.debug('in mergeBranch');
5494};
5495
5496var checkout = exports.checkout = function checkout(branch) {
5497 _logger.logger.debug('in checkout');
5498 curBranch = branch;
5499 var id = branches[curBranch];
5500 head = commits[id];
5501};
5502
5503var reset = exports.reset = function reset(commitRef) {
5504 _logger.logger.debug('in reset', commitRef);
5505 var ref = commitRef.split(':')[0];
5506 var parentCount = parseInt(commitRef.split(':')[1]);
5507 var commit = ref === 'HEAD' ? head : commits[branches[ref]];
5508 _logger.logger.debug(commit, parentCount);
5509 while (parentCount > 0) {
5510 commit = commits[commit.parent];
5511 parentCount--;
5512 if (!commit) {
5513 var err = 'Critical error - unique parent commit not found during reset';
5514 _logger.logger.error(err);
5515 throw err;
5516 }
5517 }
5518 head = commit;
5519 branches[curBranch] = commit.id;
5520};
5521
5522function upsert(arr, key, newval) {
5523 var index = arr.indexOf(key);
5524 if (index === -1) {
5525 arr.push(newval);
5526 } else {
5527 arr.splice(index, 1, newval);
5528 }
5529}
5530
5531function prettyPrintCommitHistory(commitArr) {
5532 var commit = _lodash2.default.maxBy(commitArr, 'seq');
5533 var line = '';
5534 commitArr.forEach(function (c) {
5535 if (c === commit) {
5536 line += '\t*';
5537 } else {
5538 line += '\t|';
5539 }
5540 });
5541 var label = [line, commit.id, commit.seq];
5542 _lodash2.default.each(branches, function (value, key) {
5543 if (value === commit.id) label.push(key);
5544 });
5545 _logger.logger.debug(label.join(' '));
5546 if (Array.isArray(commit.parent)) {
5547 var newCommit = commits[commit.parent[0]];
5548 upsert(commitArr, commit, newCommit);
5549 commitArr.push(commits[commit.parent[1]]);
5550 } else if (commit.parent == null) {
5551 return;
5552 } else {
5553 var nextCommit = commits[commit.parent];
5554 upsert(commitArr, commit, nextCommit);
5555 }
5556 commitArr = _lodash2.default.uniqBy(commitArr, 'id');
5557 prettyPrintCommitHistory(commitArr);
5558}
5559
5560var prettyPrint = exports.prettyPrint = function prettyPrint() {
5561 _logger.logger.debug(commits);
5562 var node = getCommitsArray()[0];
5563 prettyPrintCommitHistory([node]);
5564};
5565
5566var clear = exports.clear = function clear() {
5567 commits = {};
5568 head = null;
5569 branches = { 'master': head };
5570 curBranch = 'master';
5571 seq = 0;
5572};
5573
5574var getBranchesAsObjArray = exports.getBranchesAsObjArray = function getBranchesAsObjArray() {
5575 var branchArr = _lodash2.default.map(branches, function (value, key) {
5576 return { 'name': key, 'commit': commits[value] };
5577 });
5578 return branchArr;
5579};
5580
5581var getBranches = exports.getBranches = function getBranches() {
5582 return branches;
5583};
5584var getCommits = exports.getCommits = function getCommits() {
5585 return commits;
5586};
5587var getCommitsArray = exports.getCommitsArray = function getCommitsArray() {
5588 var commitArr = Object.keys(commits).map(function (key) {
5589 return commits[key];
5590 });
5591 commitArr.forEach(function (o) {
5592 _logger.logger.debug(o.id);
5593 });
5594 return _lodash2.default.orderBy(commitArr, ['seq'], ['desc']);
5595};
5596var getCurrentBranch = exports.getCurrentBranch = function getCurrentBranch() {
5597 return curBranch;
5598};
5599var getDirection = exports.getDirection = function getDirection() {
5600 return direction;
5601};
5602var getHead = exports.getHead = function getHead() {
5603 return head;
5604};
5605
5606exports.default = {
5607 setDirection: setDirection,
5608 setOptions: setOptions,
5609 getOptions: getOptions,
5610 commit: commit,
5611 branch: branch,
5612 merge: merge,
5613 checkout: checkout,
5614 reset: reset,
5615 prettyPrint: prettyPrint,
5616 clear: clear,
5617 getBranchesAsObjArray: getBranchesAsObjArray,
5618 getBranches: getBranches,
5619 getCommits: getCommits,
5620 getCommitsArray: getCommitsArray,
5621 getCurrentBranch: getCurrentBranch,
5622 getDirection: getDirection,
5623 getHead: getHead
5624};
5625
5626/***/ }),
5627
5628/***/ "./src/diagrams/git/gitGraphRenderer.js":
5629/*!**********************************************!*\
5630 !*** ./src/diagrams/git/gitGraphRenderer.js ***!
5631 \**********************************************/
5632/*! no static exports found */
5633/***/ (function(module, exports, __webpack_require__) {
5634
5635"use strict";
5636
5637
5638Object.defineProperty(exports, "__esModule", {
5639 value: true
5640});
5641exports.draw = exports.setConf = undefined;
5642
5643var _lodash = __webpack_require__(/*! lodash */ "lodash");
5644
5645var _lodash2 = _interopRequireDefault(_lodash);
5646
5647var _d = __webpack_require__(/*! d3 */ "d3");
5648
5649var d3 = _interopRequireWildcard(_d);
5650
5651var _gitGraphAst = __webpack_require__(/*! ./gitGraphAst */ "./src/diagrams/git/gitGraphAst.js");
5652
5653var _gitGraphAst2 = _interopRequireDefault(_gitGraphAst);
5654
5655var _gitGraph = __webpack_require__(/*! ./parser/gitGraph */ "./src/diagrams/git/parser/gitGraph.js");
5656
5657var _gitGraph2 = _interopRequireDefault(_gitGraph);
5658
5659var _logger = __webpack_require__(/*! ../../logger */ "./src/logger.js");
5660
5661var _utils = __webpack_require__(/*! ../../utils */ "./src/utils.js");
5662
5663function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
5664
5665function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5666
5667var allCommitsDict = {};
5668var branchNum = void 0;
5669var config = {
5670 nodeSpacing: 150,
5671 nodeFillColor: 'yellow',
5672 nodeStrokeWidth: 2,
5673 nodeStrokeColor: 'grey',
5674 lineStrokeWidth: 4,
5675 branchOffset: 50,
5676 lineColor: 'grey',
5677 leftMargin: 50,
5678 branchColors: ['#442f74', '#983351', '#609732', '#AA9A39'],
5679 nodeRadius: 10,
5680 nodeLabel: {
5681 width: 75,
5682 height: 100,
5683 x: -25,
5684 y: 0
5685 }
5686};
5687var apiConfig = {};
5688var setConf = exports.setConf = function setConf(c) {
5689 apiConfig = c;
5690};
5691
5692function svgCreateDefs(svg) {
5693 svg.append('defs').append('g').attr('id', 'def-commit').append('circle').attr('r', config.nodeRadius).attr('cx', 0).attr('cy', 0);
5694 svg.select('#def-commit').append('foreignObject').attr('width', config.nodeLabel.width).attr('height', config.nodeLabel.height).attr('x', config.nodeLabel.x).attr('y', config.nodeLabel.y).attr('class', 'node-label').attr('requiredFeatures', 'http://www.w3.org/TR/SVG11/feature#Extensibility').append('p').html('');
5695}
5696
5697function svgDrawLine(svg, points, colorIdx, interpolate) {
5698 var curve = (0, _utils.interpolateToCurve)(interpolate, d3.curveBasis);
5699 var color = config.branchColors[colorIdx % config.branchColors.length];
5700 var lineGen = d3.line().x(function (d) {
5701 return Math.round(d.x);
5702 }).y(function (d) {
5703 return Math.round(d.y);
5704 }).curve(curve);
5705
5706 svg.append('svg:path').attr('d', lineGen(points)).style('stroke', color).style('stroke-width', config.lineStrokeWidth).style('fill', 'none');
5707}
5708
5709// Pass in the element and its pre-transform coords
5710function getElementCoords(element, coords) {
5711 coords = coords || element.node().getBBox();
5712 var ctm = element.node().getCTM();
5713 var xn = ctm.e + coords.x * ctm.a;
5714 var yn = ctm.f + coords.y * ctm.d;
5715 return {
5716 left: xn,
5717 top: yn,
5718 width: coords.width,
5719 height: coords.height
5720 };
5721}
5722
5723function svgDrawLineForCommits(svg, fromId, toId, direction, color) {
5724 _logger.logger.debug('svgDrawLineForCommits: ', fromId, toId);
5725 var fromBbox = getElementCoords(svg.select('#node-' + fromId + ' circle'));
5726 var toBbox = getElementCoords(svg.select('#node-' + toId + ' circle'));
5727 switch (direction) {
5728 case 'LR':
5729 // (toBbox)
5730 // +--------
5731 // + (fromBbox)
5732 if (fromBbox.left - toBbox.left > config.nodeSpacing) {
5733 var lineStart = { x: fromBbox.left - config.nodeSpacing, y: toBbox.top + toBbox.height / 2 };
5734 var lineEnd = { x: toBbox.left + toBbox.width, y: toBbox.top + toBbox.height / 2 };
5735 svgDrawLine(svg, [lineStart, lineEnd], color, 'linear');
5736 svgDrawLine(svg, [{ x: fromBbox.left, y: fromBbox.top + fromBbox.height / 2 }, { x: fromBbox.left - config.nodeSpacing / 2, y: fromBbox.top + fromBbox.height / 2 }, { x: fromBbox.left - config.nodeSpacing / 2, y: lineStart.y }, lineStart], color);
5737 } else {
5738 svgDrawLine(svg, [{
5739 'x': fromBbox.left,
5740 'y': fromBbox.top + fromBbox.height / 2
5741 }, {
5742 'x': fromBbox.left - config.nodeSpacing / 2,
5743 'y': fromBbox.top + fromBbox.height / 2
5744 }, {
5745 'x': fromBbox.left - config.nodeSpacing / 2,
5746 'y': toBbox.top + toBbox.height / 2
5747 }, {
5748 'x': toBbox.left + toBbox.width,
5749 'y': toBbox.top + toBbox.height / 2
5750 }], color);
5751 }
5752 break;
5753 case 'BT':
5754 // + (fromBbox)
5755 // |
5756 // |
5757 // + (toBbox)
5758 if (toBbox.top - fromBbox.top > config.nodeSpacing) {
5759 var _lineStart = { x: toBbox.left + toBbox.width / 2, y: fromBbox.top + fromBbox.height + config.nodeSpacing };
5760 var _lineEnd = { x: toBbox.left + toBbox.width / 2, y: toBbox.top };
5761 svgDrawLine(svg, [_lineStart, _lineEnd], color, 'linear');
5762 svgDrawLine(svg, [{ x: fromBbox.left + fromBbox.width / 2, y: fromBbox.top + fromBbox.height }, { x: fromBbox.left + fromBbox.width / 2, y: fromBbox.top + fromBbox.height + config.nodeSpacing / 2 }, { x: toBbox.left + toBbox.width / 2, y: _lineStart.y - config.nodeSpacing / 2 }, _lineStart], color);
5763 } else {
5764 svgDrawLine(svg, [{
5765 'x': fromBbox.left + fromBbox.width / 2,
5766 'y': fromBbox.top + fromBbox.height
5767 }, {
5768 'x': fromBbox.left + fromBbox.width / 2,
5769 'y': fromBbox.top + config.nodeSpacing / 2
5770 }, {
5771 'x': toBbox.left + toBbox.width / 2,
5772 'y': toBbox.top - config.nodeSpacing / 2
5773 }, {
5774 'x': toBbox.left + toBbox.width / 2,
5775 'y': toBbox.top
5776 }], color);
5777 }
5778 break;
5779 }
5780}
5781
5782function cloneNode(svg, selector) {
5783 return svg.select(selector).node().cloneNode(true);
5784}
5785
5786function renderCommitHistory(svg, commitid, branches, direction) {
5787 var commit = void 0;
5788 var numCommits = Object.keys(allCommitsDict).length;
5789 if (_lodash2.default.isString(commitid)) {
5790 do {
5791 commit = allCommitsDict[commitid];
5792 _logger.logger.debug('in renderCommitHistory', commit.id, commit.seq);
5793 if (svg.select('#node-' + commitid).size() > 0) {
5794 return;
5795 }
5796 svg.append(function () {
5797 return cloneNode(svg, '#def-commit');
5798 }).attr('class', 'commit').attr('id', function () {
5799 return 'node-' + commit.id;
5800 }).attr('transform', function () {
5801 switch (direction) {
5802 case 'LR':
5803 return 'translate(' + (commit.seq * config.nodeSpacing + config.leftMargin) + ', ' + branchNum * config.branchOffset + ')';
5804 case 'BT':
5805 return 'translate(' + (branchNum * config.branchOffset + config.leftMargin) + ', ' + (numCommits - commit.seq) * config.nodeSpacing + ')';
5806 }
5807 }).attr('fill', config.nodeFillColor).attr('stroke', config.nodeStrokeColor).attr('stroke-width', config.nodeStrokeWidth);
5808
5809 var branch = _lodash2.default.find(branches, ['commit', commit]);
5810 if (branch) {
5811 _logger.logger.debug('found branch ', branch.name);
5812 svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'branch-label').text(branch.name + ', ');
5813 }
5814 svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'commit-id').text(commit.id);
5815 if (commit.message !== '' && direction === 'BT') {
5816 svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'commit-msg').text(', ' + commit.message);
5817 }
5818 commitid = commit.parent;
5819 } while (commitid && allCommitsDict[commitid]);
5820 }
5821
5822 if (_lodash2.default.isArray(commitid)) {
5823 _logger.logger.debug('found merge commmit', commitid);
5824 renderCommitHistory(svg, commitid[0], branches, direction);
5825 branchNum++;
5826 renderCommitHistory(svg, commitid[1], branches, direction);
5827 branchNum--;
5828 }
5829}
5830
5831function renderLines(svg, commit, direction, branchColor) {
5832 branchColor = branchColor || 0;
5833 while (commit.seq > 0 && !commit.lineDrawn) {
5834 if (_lodash2.default.isString(commit.parent)) {
5835 svgDrawLineForCommits(svg, commit.id, commit.parent, direction, branchColor);
5836 commit.lineDrawn = true;
5837 commit = allCommitsDict[commit.parent];
5838 } else if (_lodash2.default.isArray(commit.parent)) {
5839 svgDrawLineForCommits(svg, commit.id, commit.parent[0], direction, branchColor);
5840 svgDrawLineForCommits(svg, commit.id, commit.parent[1], direction, branchColor + 1);
5841 renderLines(svg, allCommitsDict[commit.parent[1]], direction, branchColor + 1);
5842 commit.lineDrawn = true;
5843 commit = allCommitsDict[commit.parent[0]];
5844 }
5845 }
5846}
5847
5848var draw = exports.draw = function draw(txt, id, ver) {
5849 try {
5850 var parser = _gitGraph2.default.parser;
5851 parser.yy = _gitGraphAst2.default;
5852
5853 _logger.logger.debug('in gitgraph renderer', txt, id, ver);
5854 // Parse the graph definition
5855 parser.parse(txt + '\n');
5856
5857 config = _lodash2.default.extend(config, apiConfig, _gitGraphAst2.default.getOptions());
5858 _logger.logger.debug('effective options', config);
5859 var direction = _gitGraphAst2.default.getDirection();
5860 allCommitsDict = _gitGraphAst2.default.getCommits();
5861 var branches = _gitGraphAst2.default.getBranchesAsObjArray();
5862 if (direction === 'BT') {
5863 config.nodeLabel.x = branches.length * config.branchOffset;
5864 config.nodeLabel.width = '100%';
5865 config.nodeLabel.y = -1 * 2 * config.nodeRadius;
5866 }
5867 var svg = d3.select('[id="' + id + '"]');
5868 svgCreateDefs(svg);
5869 branchNum = 1;
5870 _lodash2.default.each(branches, function (v) {
5871 renderCommitHistory(svg, v.commit.id, branches, direction);
5872 renderLines(svg, v.commit, direction);
5873 branchNum++;
5874 });
5875 svg.attr('height', function () {
5876 if (direction === 'BT') return Object.keys(allCommitsDict).length * config.nodeSpacing;
5877 return (branches.length + 1) * config.branchOffset;
5878 });
5879 } catch (e) {
5880 _logger.logger.error('Error while rendering gitgraph');
5881 _logger.logger.error(e.message);
5882 }
5883};
5884
5885exports.default = {
5886 setConf: setConf,
5887 draw: draw
5888};
5889
5890/***/ }),
5891
5892/***/ "./src/diagrams/git/parser/gitGraph.js":
5893/*!*********************************************!*\
5894 !*** ./src/diagrams/git/parser/gitGraph.js ***!
5895 \*********************************************/
5896/*! no static exports found */
5897/***/ (function(module, exports, __webpack_require__) {
5898
5899"use strict";
5900/* WEBPACK VAR INJECTION */(function(process, module) {
5901
5902/* parser generated by jison 0.4.18 */
5903/*
5904 Returns a Parser object of the following structure:
5905
5906 Parser: {
5907 yy: {}
5908 }
5909
5910 Parser.prototype: {
5911 yy: {},
5912 trace: function(),
5913 symbols_: {associative list: name ==> number},
5914 terminals_: {associative list: number ==> name},
5915 productions_: [...],
5916 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
5917 table: [...],
5918 defaultActions: {...},
5919 parseError: function(str, hash),
5920 parse: function(input),
5921
5922 lexer: {
5923 EOF: 1,
5924 parseError: function(str, hash),
5925 setInput: function(input),
5926 input: function(),
5927 unput: function(str),
5928 more: function(),
5929 less: function(n),
5930 pastInput: function(),
5931 upcomingInput: function(),
5932 showPosition: function(),
5933 test_match: function(regex_match_array, rule_index),
5934 next: function(),
5935 lex: function(),
5936 begin: function(condition),
5937 popState: function(),
5938 _currentRules: function(),
5939 topState: function(),
5940 pushState: function(condition),
5941
5942 options: {
5943 ranges: boolean (optional: true ==> token location info will include a .range[] member)
5944 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
5945 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)
5946 },
5947
5948 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
5949 rules: [...],
5950 conditions: {associative list: name ==> set},
5951 }
5952 }
5953
5954
5955 token location info (@$, _$, etc.): {
5956 first_line: n,
5957 last_line: n,
5958 first_column: n,
5959 last_column: n,
5960 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
5961 }
5962
5963
5964 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
5965 text: (matched text)
5966 token: (the produced terminal token, if any)
5967 line: (yylineno)
5968 }
5969 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
5970 loc: (yylloc)
5971 expected: (string describing the set of expected tokens)
5972 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
5973 }
5974*/
5975var parser = function () {
5976 var o = function o(k, v, _o, l) {
5977 for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
5978 },
5979 $V0 = [2, 3],
5980 $V1 = [1, 7],
5981 $V2 = [7, 12, 15, 17, 19, 20, 21],
5982 $V3 = [7, 11, 12, 15, 17, 19, 20, 21],
5983 $V4 = [2, 20],
5984 $V5 = [1, 32];
5985 var parser = { trace: function trace() {},
5986 yy: {},
5987 symbols_: { "error": 2, "start": 3, "GG": 4, ":": 5, "document": 6, "EOF": 7, "DIR": 8, "options": 9, "body": 10, "OPT": 11, "NL": 12, "line": 13, "statement": 14, "COMMIT": 15, "commit_arg": 16, "BRANCH": 17, "ID": 18, "CHECKOUT": 19, "MERGE": 20, "RESET": 21, "reset_arg": 22, "STR": 23, "HEAD": 24, "reset_parents": 25, "CARET": 26, "$accept": 0, "$end": 1 },
5988 terminals_: { 2: "error", 4: "GG", 5: ":", 7: "EOF", 8: "DIR", 11: "OPT", 12: "NL", 15: "COMMIT", 17: "BRANCH", 18: "ID", 19: "CHECKOUT", 20: "MERGE", 21: "RESET", 23: "STR", 24: "HEAD", 26: "CARET" },
5989 productions_: [0, [3, 4], [3, 5], [6, 0], [6, 2], [9, 2], [9, 1], [10, 0], [10, 2], [13, 2], [13, 1], [14, 2], [14, 2], [14, 2], [14, 2], [14, 2], [16, 0], [16, 1], [22, 2], [22, 2], [25, 0], [25, 2]],
5990 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
5991 /* this == yyval */
5992
5993 var $0 = $$.length - 1;
5994 switch (yystate) {
5995 case 1:
5996 return $$[$0 - 1];
5997 break;
5998 case 2:
5999 yy.setDirection($$[$0 - 3]);return $$[$0 - 1];
6000 break;
6001 case 4:
6002 yy.setOptions($$[$0 - 1]);this.$ = $$[$0];
6003 break;
6004 case 5:
6005 $$[$0 - 1] += $$[$0];this.$ = $$[$0 - 1];
6006 break;
6007 case 7:
6008 this.$ = [];
6009 break;
6010 case 8:
6011 $$[$0 - 1].push($$[$0]);this.$ = $$[$0 - 1];
6012 break;
6013 case 9:
6014 this.$ = $$[$0 - 1];
6015 break;
6016 case 11:
6017 yy.commit($$[$0]);
6018 break;
6019 case 12:
6020 yy.branch($$[$0]);
6021 break;
6022 case 13:
6023 yy.checkout($$[$0]);
6024 break;
6025 case 14:
6026 yy.merge($$[$0]);
6027 break;
6028 case 15:
6029 yy.reset($$[$0]);
6030 break;
6031 case 16:
6032 this.$ = "";
6033 break;
6034 case 17:
6035 this.$ = $$[$0];
6036 break;
6037 case 18:
6038 this.$ = $$[$0 - 1] + ":" + $$[$0];
6039 break;
6040 case 19:
6041 this.$ = $$[$0 - 1] + ":" + yy.count;yy.count = 0;
6042 break;
6043 case 20:
6044 yy.count = 0;
6045 break;
6046 case 21:
6047 yy.count += 1;
6048 break;
6049 }
6050 },
6051 table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, { 5: [1, 3], 8: [1, 4] }, { 6: 5, 7: $V0, 9: 6, 12: $V1 }, { 5: [1, 8] }, { 7: [1, 9] }, o($V2, [2, 7], { 10: 10, 11: [1, 11] }), o($V3, [2, 6]), { 6: 12, 7: $V0, 9: 6, 12: $V1 }, { 1: [2, 1] }, { 7: [2, 4], 12: [1, 15], 13: 13, 14: 14, 15: [1, 16], 17: [1, 17], 19: [1, 18], 20: [1, 19], 21: [1, 20] }, o($V3, [2, 5]), { 7: [1, 21] }, o($V2, [2, 8]), { 12: [1, 22] }, o($V2, [2, 10]), { 12: [2, 16], 16: 23, 23: [1, 24] }, { 18: [1, 25] }, { 18: [1, 26] }, { 18: [1, 27] }, { 18: [1, 30], 22: 28, 24: [1, 29] }, { 1: [2, 2] }, o($V2, [2, 9]), { 12: [2, 11] }, { 12: [2, 17] }, { 12: [2, 12] }, { 12: [2, 13] }, { 12: [2, 14] }, { 12: [2, 15] }, { 12: $V4, 25: 31, 26: $V5 }, { 12: $V4, 25: 33, 26: $V5 }, { 12: [2, 18] }, { 12: $V4, 25: 34, 26: $V5 }, { 12: [2, 19] }, { 12: [2, 21] }],
6052 defaultActions: { 9: [2, 1], 21: [2, 2], 23: [2, 11], 24: [2, 17], 25: [2, 12], 26: [2, 13], 27: [2, 14], 28: [2, 15], 31: [2, 18], 33: [2, 19], 34: [2, 21] },
6053 parseError: function parseError(str, hash) {
6054 if (hash.recoverable) {
6055 this.trace(str);
6056 } else {
6057 var error = new Error(str);
6058 error.hash = hash;
6059 throw error;
6060 }
6061 },
6062 parse: function parse(input) {
6063 var self = this,
6064 stack = [0],
6065 tstack = [],
6066 vstack = [null],
6067 lstack = [],
6068 table = this.table,
6069 yytext = '',
6070 yylineno = 0,
6071 yyleng = 0,
6072 recovering = 0,
6073 TERROR = 2,
6074 EOF = 1;
6075 var args = lstack.slice.call(arguments, 1);
6076 var lexer = Object.create(this.lexer);
6077 var sharedState = { yy: {} };
6078 for (var k in this.yy) {
6079 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
6080 sharedState.yy[k] = this.yy[k];
6081 }
6082 }
6083 lexer.setInput(input, sharedState.yy);
6084 sharedState.yy.lexer = lexer;
6085 sharedState.yy.parser = this;
6086 if (typeof lexer.yylloc == 'undefined') {
6087 lexer.yylloc = {};
6088 }
6089 var yyloc = lexer.yylloc;
6090 lstack.push(yyloc);
6091 var ranges = lexer.options && lexer.options.ranges;
6092 if (typeof sharedState.yy.parseError === 'function') {
6093 this.parseError = sharedState.yy.parseError;
6094 } else {
6095 this.parseError = Object.getPrototypeOf(this).parseError;
6096 }
6097 function popStack(n) {
6098 stack.length = stack.length - 2 * n;
6099 vstack.length = vstack.length - n;
6100 lstack.length = lstack.length - n;
6101 }
6102 function lex() {
6103 var token;
6104 token = tstack.pop() || lexer.lex() || EOF;
6105 if (typeof token !== 'number') {
6106 if (token instanceof Array) {
6107 tstack = token;
6108 token = tstack.pop();
6109 }
6110 token = self.symbols_[token] || token;
6111 }
6112 return token;
6113 }
6114 var symbol,
6115 preErrorSymbol,
6116 state,
6117 action,
6118 a,
6119 r,
6120 yyval = {},
6121 p,
6122 len,
6123 newState,
6124 expected;
6125 while (true) {
6126 state = stack[stack.length - 1];
6127 if (this.defaultActions[state]) {
6128 action = this.defaultActions[state];
6129 } else {
6130 if (symbol === null || typeof symbol == 'undefined') {
6131 symbol = lex();
6132 }
6133 action = table[state] && table[state][symbol];
6134 }
6135 if (typeof action === 'undefined' || !action.length || !action[0]) {
6136 var errStr = '';
6137 expected = [];
6138 for (p in table[state]) {
6139 if (this.terminals_[p] && p > TERROR) {
6140 expected.push('\'' + this.terminals_[p] + '\'');
6141 }
6142 }
6143 if (lexer.showPosition) {
6144 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
6145 } else {
6146 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
6147 }
6148 this.parseError(errStr, {
6149 text: lexer.match,
6150 token: this.terminals_[symbol] || symbol,
6151 line: lexer.yylineno,
6152 loc: yyloc,
6153 expected: expected
6154 });
6155 }
6156 if (action[0] instanceof Array && action.length > 1) {
6157 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
6158 }
6159 switch (action[0]) {
6160 case 1:
6161 stack.push(symbol);
6162 vstack.push(lexer.yytext);
6163 lstack.push(lexer.yylloc);
6164 stack.push(action[1]);
6165 symbol = null;
6166 if (!preErrorSymbol) {
6167 yyleng = lexer.yyleng;
6168 yytext = lexer.yytext;
6169 yylineno = lexer.yylineno;
6170 yyloc = lexer.yylloc;
6171 if (recovering > 0) {
6172 recovering--;
6173 }
6174 } else {
6175 symbol = preErrorSymbol;
6176 preErrorSymbol = null;
6177 }
6178 break;
6179 case 2:
6180 len = this.productions_[action[1]][1];
6181 yyval.$ = vstack[vstack.length - len];
6182 yyval._$ = {
6183 first_line: lstack[lstack.length - (len || 1)].first_line,
6184 last_line: lstack[lstack.length - 1].last_line,
6185 first_column: lstack[lstack.length - (len || 1)].first_column,
6186 last_column: lstack[lstack.length - 1].last_column
6187 };
6188 if (ranges) {
6189 yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
6190 }
6191 r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
6192 if (typeof r !== 'undefined') {
6193 return r;
6194 }
6195 if (len) {
6196 stack = stack.slice(0, -1 * len * 2);
6197 vstack = vstack.slice(0, -1 * len);
6198 lstack = lstack.slice(0, -1 * len);
6199 }
6200 stack.push(this.productions_[action[1]][0]);
6201 vstack.push(yyval.$);
6202 lstack.push(yyval._$);
6203 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
6204 stack.push(newState);
6205 break;
6206 case 3:
6207 return true;
6208 }
6209 }
6210 return true;
6211 } };
6212 /* generated by jison-lex 0.3.4 */
6213 var lexer = function () {
6214 var lexer = {
6215
6216 EOF: 1,
6217
6218 parseError: function parseError(str, hash) {
6219 if (this.yy.parser) {
6220 this.yy.parser.parseError(str, hash);
6221 } else {
6222 throw new Error(str);
6223 }
6224 },
6225
6226 // resets the lexer, sets new input
6227 setInput: function setInput(input, yy) {
6228 this.yy = yy || this.yy || {};
6229 this._input = input;
6230 this._more = this._backtrack = this.done = false;
6231 this.yylineno = this.yyleng = 0;
6232 this.yytext = this.matched = this.match = '';
6233 this.conditionStack = ['INITIAL'];
6234 this.yylloc = {
6235 first_line: 1,
6236 first_column: 0,
6237 last_line: 1,
6238 last_column: 0
6239 };
6240 if (this.options.ranges) {
6241 this.yylloc.range = [0, 0];
6242 }
6243 this.offset = 0;
6244 return this;
6245 },
6246
6247 // consumes and returns one char from the input
6248 input: function input() {
6249 var ch = this._input[0];
6250 this.yytext += ch;
6251 this.yyleng++;
6252 this.offset++;
6253 this.match += ch;
6254 this.matched += ch;
6255 var lines = ch.match(/(?:\r\n?|\n).*/g);
6256 if (lines) {
6257 this.yylineno++;
6258 this.yylloc.last_line++;
6259 } else {
6260 this.yylloc.last_column++;
6261 }
6262 if (this.options.ranges) {
6263 this.yylloc.range[1]++;
6264 }
6265
6266 this._input = this._input.slice(1);
6267 return ch;
6268 },
6269
6270 // unshifts one char (or a string) into the input
6271 unput: function unput(ch) {
6272 var len = ch.length;
6273 var lines = ch.split(/(?:\r\n?|\n)/g);
6274
6275 this._input = ch + this._input;
6276 this.yytext = this.yytext.substr(0, this.yytext.length - len);
6277 //this.yyleng -= len;
6278 this.offset -= len;
6279 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
6280 this.match = this.match.substr(0, this.match.length - 1);
6281 this.matched = this.matched.substr(0, this.matched.length - 1);
6282
6283 if (lines.length - 1) {
6284 this.yylineno -= lines.length - 1;
6285 }
6286 var r = this.yylloc.range;
6287
6288 this.yylloc = {
6289 first_line: this.yylloc.first_line,
6290 last_line: this.yylineno + 1,
6291 first_column: this.yylloc.first_column,
6292 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
6293 };
6294
6295 if (this.options.ranges) {
6296 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
6297 }
6298 this.yyleng = this.yytext.length;
6299 return this;
6300 },
6301
6302 // When called from action, caches matched text and appends it on next action
6303 more: function more() {
6304 this._more = true;
6305 return this;
6306 },
6307
6308 // 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.
6309 reject: function reject() {
6310 if (this.options.backtrack_lexer) {
6311 this._backtrack = true;
6312 } else {
6313 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(), {
6314 text: "",
6315 token: null,
6316 line: this.yylineno
6317 });
6318 }
6319 return this;
6320 },
6321
6322 // retain first n characters of the match
6323 less: function less(n) {
6324 this.unput(this.match.slice(n));
6325 },
6326
6327 // displays already matched input, i.e. for error messages
6328 pastInput: function pastInput() {
6329 var past = this.matched.substr(0, this.matched.length - this.match.length);
6330 return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
6331 },
6332
6333 // displays upcoming input, i.e. for error messages
6334 upcomingInput: function upcomingInput() {
6335 var next = this.match;
6336 if (next.length < 20) {
6337 next += this._input.substr(0, 20 - next.length);
6338 }
6339 return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
6340 },
6341
6342 // displays the character position where the lexing error occurred, i.e. for error messages
6343 showPosition: function showPosition() {
6344 var pre = this.pastInput();
6345 var c = new Array(pre.length + 1).join("-");
6346 return pre + this.upcomingInput() + "\n" + c + "^";
6347 },
6348
6349 // test the lexed token: return FALSE when not a match, otherwise return token
6350 test_match: function test_match(match, indexed_rule) {
6351 var token, lines, backup;
6352
6353 if (this.options.backtrack_lexer) {
6354 // save context
6355 backup = {
6356 yylineno: this.yylineno,
6357 yylloc: {
6358 first_line: this.yylloc.first_line,
6359 last_line: this.last_line,
6360 first_column: this.yylloc.first_column,
6361 last_column: this.yylloc.last_column
6362 },
6363 yytext: this.yytext,
6364 match: this.match,
6365 matches: this.matches,
6366 matched: this.matched,
6367 yyleng: this.yyleng,
6368 offset: this.offset,
6369 _more: this._more,
6370 _input: this._input,
6371 yy: this.yy,
6372 conditionStack: this.conditionStack.slice(0),
6373 done: this.done
6374 };
6375 if (this.options.ranges) {
6376 backup.yylloc.range = this.yylloc.range.slice(0);
6377 }
6378 }
6379
6380 lines = match[0].match(/(?:\r\n?|\n).*/g);
6381 if (lines) {
6382 this.yylineno += lines.length;
6383 }
6384 this.yylloc = {
6385 first_line: this.yylloc.last_line,
6386 last_line: this.yylineno + 1,
6387 first_column: this.yylloc.last_column,
6388 last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
6389 };
6390 this.yytext += match[0];
6391 this.match += match[0];
6392 this.matches = match;
6393 this.yyleng = this.yytext.length;
6394 if (this.options.ranges) {
6395 this.yylloc.range = [this.offset, this.offset += this.yyleng];
6396 }
6397 this._more = false;
6398 this._backtrack = false;
6399 this._input = this._input.slice(match[0].length);
6400 this.matched += match[0];
6401 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
6402 if (this.done && this._input) {
6403 this.done = false;
6404 }
6405 if (token) {
6406 return token;
6407 } else if (this._backtrack) {
6408 // recover context
6409 for (var k in backup) {
6410 this[k] = backup[k];
6411 }
6412 return false; // rule action called reject() implying the next rule should be tested instead.
6413 }
6414 return false;
6415 },
6416
6417 // return next match in input
6418 next: function next() {
6419 if (this.done) {
6420 return this.EOF;
6421 }
6422 if (!this._input) {
6423 this.done = true;
6424 }
6425
6426 var token, match, tempMatch, index;
6427 if (!this._more) {
6428 this.yytext = '';
6429 this.match = '';
6430 }
6431 var rules = this._currentRules();
6432 for (var i = 0; i < rules.length; i++) {
6433 tempMatch = this._input.match(this.rules[rules[i]]);
6434 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
6435 match = tempMatch;
6436 index = i;
6437 if (this.options.backtrack_lexer) {
6438 token = this.test_match(tempMatch, rules[i]);
6439 if (token !== false) {
6440 return token;
6441 } else if (this._backtrack) {
6442 match = false;
6443 continue; // rule action called reject() implying a rule MISmatch.
6444 } else {
6445 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
6446 return false;
6447 }
6448 } else if (!this.options.flex) {
6449 break;
6450 }
6451 }
6452 }
6453 if (match) {
6454 token = this.test_match(match, rules[index]);
6455 if (token !== false) {
6456 return token;
6457 }
6458 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
6459 return false;
6460 }
6461 if (this._input === "") {
6462 return this.EOF;
6463 } else {
6464 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
6465 text: "",
6466 token: null,
6467 line: this.yylineno
6468 });
6469 }
6470 },
6471
6472 // return next match that has a token
6473 lex: function lex() {
6474 var r = this.next();
6475 if (r) {
6476 return r;
6477 } else {
6478 return this.lex();
6479 }
6480 },
6481
6482 // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
6483 begin: function begin(condition) {
6484 this.conditionStack.push(condition);
6485 },
6486
6487 // pop the previously active lexer condition state off the condition stack
6488 popState: function popState() {
6489 var n = this.conditionStack.length - 1;
6490 if (n > 0) {
6491 return this.conditionStack.pop();
6492 } else {
6493 return this.conditionStack[0];
6494 }
6495 },
6496
6497 // produce the lexer rule set which is active for the currently active lexer condition state
6498 _currentRules: function _currentRules() {
6499 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
6500 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
6501 } else {
6502 return this.conditions["INITIAL"].rules;
6503 }
6504 },
6505
6506 // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
6507 topState: function topState(n) {
6508 n = this.conditionStack.length - 1 - Math.abs(n || 0);
6509 if (n >= 0) {
6510 return this.conditionStack[n];
6511 } else {
6512 return "INITIAL";
6513 }
6514 },
6515
6516 // alias for begin(condition)
6517 pushState: function pushState(condition) {
6518 this.begin(condition);
6519 },
6520
6521 // return the number of states currently on the stack
6522 stateStackSize: function stateStackSize() {
6523 return this.conditionStack.length;
6524 },
6525 options: { "case-insensitive": true },
6526 performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
6527 var YYSTATE = YY_START;
6528 switch ($avoiding_name_collisions) {
6529 case 0:
6530 return 12;
6531 break;
6532 case 1:
6533 /* skip all whitespace */
6534 break;
6535 case 2:
6536 /* skip comments */
6537 break;
6538 case 3:
6539 /* skip comments */
6540 break;
6541 case 4:
6542 return 4;
6543 break;
6544 case 5:
6545 return 15;
6546 break;
6547 case 6:
6548 return 17;
6549 break;
6550 case 7:
6551 return 20;
6552 break;
6553 case 8:
6554 return 21;
6555 break;
6556 case 9:
6557 return 19;
6558 break;
6559 case 10:
6560 return 8;
6561 break;
6562 case 11:
6563 return 8;
6564 break;
6565 case 12:
6566 return 5;
6567 break;
6568 case 13:
6569 return 26;
6570 break;
6571 case 14:
6572 this.begin("options");
6573 break;
6574 case 15:
6575 this.popState();
6576 break;
6577 case 16:
6578 return 11;
6579 break;
6580 case 17:
6581 this.begin("string");
6582 break;
6583 case 18:
6584 this.popState();
6585 break;
6586 case 19:
6587 return 23;
6588 break;
6589 case 20:
6590 return 18;
6591 break;
6592 case 21:
6593 return 7;
6594 break;
6595 }
6596 },
6597 rules: [/^(?:(\r?\n)+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:gitGraph\b)/i, /^(?:commit\b)/i, /^(?:branch\b)/i, /^(?:merge\b)/i, /^(?:reset\b)/i, /^(?:checkout\b)/i, /^(?:LR\b)/i, /^(?:BT\b)/i, /^(?::)/i, /^(?:\^)/i, /^(?:options\r?\n)/i, /^(?:end\r?\n)/i, /^(?:[^\n]+\r?\n)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[a-zA-Z][a-zA-Z0-9_]+)/i, /^(?:$)/i],
6598 conditions: { "options": { "rules": [15, 16], "inclusive": false }, "string": { "rules": [18, 19], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 20, 21], "inclusive": true } }
6599 };
6600 return lexer;
6601 }();
6602 parser.lexer = lexer;
6603 function Parser() {
6604 this.yy = {};
6605 }
6606 Parser.prototype = parser;parser.Parser = Parser;
6607 return new Parser();
6608}();
6609
6610if (true) {
6611 exports.parser = parser;
6612 exports.Parser = parser.Parser;
6613 exports.parse = function () {
6614 return parser.parse.apply(parser, arguments);
6615 };
6616 exports.main = function commonjsMain(args) {
6617 if (!args[1]) {
6618 console.log('Usage: ' + args[0] + ' FILE');
6619 process.exit(1);
6620 }
6621 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
6622 return exports.parser.parse(source);
6623 };
6624 if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
6625 exports.main(process.argv.slice(1));
6626 }
6627}
6628/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
6629
6630/***/ }),
6631
6632/***/ "./src/diagrams/sequence/parser/sequenceDiagram.js":
6633/*!*********************************************************!*\
6634 !*** ./src/diagrams/sequence/parser/sequenceDiagram.js ***!
6635 \*********************************************************/
6636/*! no static exports found */
6637/***/ (function(module, exports, __webpack_require__) {
6638
6639"use strict";
6640/* WEBPACK VAR INJECTION */(function(process, module) {
6641
6642/* parser generated by jison 0.4.18 */
6643/*
6644 Returns a Parser object of the following structure:
6645
6646 Parser: {
6647 yy: {}
6648 }
6649
6650 Parser.prototype: {
6651 yy: {},
6652 trace: function(),
6653 symbols_: {associative list: name ==> number},
6654 terminals_: {associative list: number ==> name},
6655 productions_: [...],
6656 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
6657 table: [...],
6658 defaultActions: {...},
6659 parseError: function(str, hash),
6660 parse: function(input),
6661
6662 lexer: {
6663 EOF: 1,
6664 parseError: function(str, hash),
6665 setInput: function(input),
6666 input: function(),
6667 unput: function(str),
6668 more: function(),
6669 less: function(n),
6670 pastInput: function(),
6671 upcomingInput: function(),
6672 showPosition: function(),
6673 test_match: function(regex_match_array, rule_index),
6674 next: function(),
6675 lex: function(),
6676 begin: function(condition),
6677 popState: function(),
6678 _currentRules: function(),
6679 topState: function(),
6680 pushState: function(condition),
6681
6682 options: {
6683 ranges: boolean (optional: true ==> token location info will include a .range[] member)
6684 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
6685 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)
6686 },
6687
6688 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
6689 rules: [...],
6690 conditions: {associative list: name ==> set},
6691 }
6692 }
6693
6694
6695 token location info (@$, _$, etc.): {
6696 first_line: n,
6697 last_line: n,
6698 first_column: n,
6699 last_column: n,
6700 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
6701 }
6702
6703
6704 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
6705 text: (matched text)
6706 token: (the produced terminal token, if any)
6707 line: (yylineno)
6708 }
6709 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
6710 loc: (yylloc)
6711 expected: (string describing the set of expected tokens)
6712 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
6713 }
6714*/
6715var parser = function () {
6716 var o = function o(k, v, _o, l) {
6717 for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
6718 },
6719 $V0 = [1, 2],
6720 $V1 = [1, 3],
6721 $V2 = [1, 4],
6722 $V3 = [2, 4],
6723 $V4 = [1, 9],
6724 $V5 = [1, 11],
6725 $V6 = [1, 12],
6726 $V7 = [1, 14],
6727 $V8 = [1, 15],
6728 $V9 = [1, 17],
6729 $Va = [1, 18],
6730 $Vb = [1, 19],
6731 $Vc = [1, 20],
6732 $Vd = [1, 21],
6733 $Ve = [1, 23],
6734 $Vf = [1, 24],
6735 $Vg = [1, 4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 25, 27, 28, 29, 40],
6736 $Vh = [1, 32],
6737 $Vi = [4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 25, 29, 40],
6738 $Vj = [4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 25, 28, 29, 40],
6739 $Vk = [4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 25, 27, 29, 40],
6740 $Vl = [38, 39, 40];
6741 var parser = { trace: function trace() {},
6742 yy: {},
6743 symbols_: { "error": 2, "start": 3, "SPACE": 4, "NL": 5, "SD": 6, "document": 7, "line": 8, "statement": 9, "participant": 10, "actor": 11, "AS": 12, "restOfLine": 13, "signal": 14, "activate": 15, "deactivate": 16, "note_statement": 17, "title": 18, "text2": 19, "loop": 20, "end": 21, "opt": 22, "alt": 23, "else_sections": 24, "par": 25, "par_sections": 26, "and": 27, "else": 28, "note": 29, "placement": 30, "over": 31, "actor_pair": 32, "spaceList": 33, ",": 34, "left_of": 35, "right_of": 36, "signaltype": 37, "+": 38, "-": 39, "ACTOR": 40, "SOLID_OPEN_ARROW": 41, "DOTTED_OPEN_ARROW": 42, "SOLID_ARROW": 43, "DOTTED_ARROW": 44, "SOLID_CROSS": 45, "DOTTED_CROSS": 46, "TXT": 47, "$accept": 0, "$end": 1 },
6744 terminals_: { 2: "error", 4: "SPACE", 5: "NL", 6: "SD", 10: "participant", 12: "AS", 13: "restOfLine", 15: "activate", 16: "deactivate", 18: "title", 20: "loop", 21: "end", 22: "opt", 23: "alt", 25: "par", 27: "and", 28: "else", 29: "note", 31: "over", 34: ",", 35: "left_of", 36: "right_of", 38: "+", 39: "-", 40: "ACTOR", 41: "SOLID_OPEN_ARROW", 42: "DOTTED_OPEN_ARROW", 43: "SOLID_ARROW", 44: "DOTTED_ARROW", 45: "SOLID_CROSS", 46: "DOTTED_CROSS", 47: "TXT" },
6745 productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [9, 5], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 3], [9, 4], [9, 4], [9, 4], [9, 4], [26, 1], [26, 4], [24, 1], [24, 4], [17, 4], [17, 4], [33, 2], [33, 1], [32, 3], [32, 1], [30, 1], [30, 1], [14, 5], [14, 5], [14, 4], [11, 1], [37, 1], [37, 1], [37, 1], [37, 1], [37, 1], [37, 1], [19, 1]],
6746 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
6747 /* this == yyval */
6748
6749 var $0 = $$.length - 1;
6750 switch (yystate) {
6751 case 3:
6752 yy.apply($$[$0]);return $$[$0];
6753 break;
6754 case 4:
6755 this.$ = [];
6756 break;
6757 case 5:
6758 $$[$0 - 1].push($$[$0]);this.$ = $$[$0 - 1];
6759 break;
6760 case 6:case 7:
6761 this.$ = $$[$0];
6762 break;
6763 case 8:
6764 this.$ = [];
6765 break;
6766 case 9:
6767 $$[$0 - 3].description = $$[$0 - 1];this.$ = $$[$0 - 3];
6768 break;
6769 case 10:
6770 this.$ = $$[$0 - 1];
6771 break;
6772 case 12:
6773 this.$ = { type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] };
6774 break;
6775 case 13:
6776 this.$ = { type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 1] };
6777 break;
6778 case 15:
6779 this.$ = [{ type: 'setTitle', text: $$[$0 - 1] }];
6780 break;
6781 case 16:
6782
6783 $$[$0 - 1].unshift({ type: 'loopStart', loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_START });
6784 $$[$0 - 1].push({ type: 'loopEnd', loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_END });
6785 this.$ = $$[$0 - 1];
6786 break;
6787 case 17:
6788
6789 $$[$0 - 1].unshift({ type: 'optStart', optText: $$[$0 - 2], signalType: yy.LINETYPE.OPT_START });
6790 $$[$0 - 1].push({ type: 'optEnd', optText: $$[$0 - 2], signalType: yy.LINETYPE.OPT_END });
6791 this.$ = $$[$0 - 1];
6792 break;
6793 case 18:
6794
6795 // Alt start
6796 $$[$0 - 1].unshift({ type: 'altStart', altText: $$[$0 - 2], signalType: yy.LINETYPE.ALT_START });
6797 // Content in alt is already in $$[$0-1]
6798 // End
6799 $$[$0 - 1].push({ type: 'altEnd', signalType: yy.LINETYPE.ALT_END });
6800 this.$ = $$[$0 - 1];
6801 break;
6802 case 19:
6803
6804 // Parallel start
6805 $$[$0 - 1].unshift({ type: 'parStart', parText: $$[$0 - 2], signalType: yy.LINETYPE.PAR_START });
6806 // Content in par is already in $$[$0-1]
6807 // End
6808 $$[$0 - 1].push({ type: 'parEnd', signalType: yy.LINETYPE.PAR_END });
6809 this.$ = $$[$0 - 1];
6810 break;
6811 case 21:
6812 this.$ = $$[$0 - 3].concat([{ type: 'and', parText: $$[$0 - 1], signalType: yy.LINETYPE.PAR_AND }, $$[$0]]);
6813 break;
6814 case 23:
6815 this.$ = $$[$0 - 3].concat([{ type: 'else', altText: $$[$0 - 1], signalType: yy.LINETYPE.ALT_ELSE }, $$[$0]]);
6816 break;
6817 case 24:
6818
6819 this.$ = [$$[$0 - 1], { type: 'addNote', placement: $$[$0 - 2], actor: $$[$0 - 1].actor, text: $$[$0] }];
6820 break;
6821 case 25:
6822
6823 // Coerce actor_pair into a [to, from, ...] array
6824 $$[$0 - 2] = [].concat($$[$0 - 1], $$[$0 - 1]).slice(0, 2);
6825 $$[$0 - 2][0] = $$[$0 - 2][0].actor;
6826 $$[$0 - 2][1] = $$[$0 - 2][1].actor;
6827 this.$ = [$$[$0 - 1], { type: 'addNote', placement: yy.PLACEMENT.OVER, actor: $$[$0 - 2].slice(0, 2), text: $$[$0] }];
6828 break;
6829 case 28:
6830 this.$ = [$$[$0 - 2], $$[$0]];
6831 break;
6832 case 29:
6833 this.$ = $$[$0];
6834 break;
6835 case 30:
6836 this.$ = yy.PLACEMENT.LEFTOF;
6837 break;
6838 case 31:
6839 this.$ = yy.PLACEMENT.RIGHTOF;
6840 break;
6841 case 32:
6842 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] }];
6843 break;
6844 case 33:
6845 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] }];
6846 break;
6847 case 34:
6848 this.$ = [$$[$0 - 3], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }];
6849 break;
6850 case 35:
6851 this.$ = { type: 'addActor', actor: $$[$0] };
6852 break;
6853 case 36:
6854 this.$ = yy.LINETYPE.SOLID_OPEN;
6855 break;
6856 case 37:
6857 this.$ = yy.LINETYPE.DOTTED_OPEN;
6858 break;
6859 case 38:
6860 this.$ = yy.LINETYPE.SOLID;
6861 break;
6862 case 39:
6863 this.$ = yy.LINETYPE.DOTTED;
6864 break;
6865 case 40:
6866 this.$ = yy.LINETYPE.SOLID_CROSS;
6867 break;
6868 case 41:
6869 this.$ = yy.LINETYPE.DOTTED_CROSS;
6870 break;
6871 case 42:
6872 this.$ = $$[$0].substring(1).trim().replace(/\\n/gm, "\n");
6873 break;
6874 }
6875 },
6876 table: [{ 3: 1, 4: $V0, 5: $V1, 6: $V2 }, { 1: [3] }, { 3: 5, 4: $V0, 5: $V1, 6: $V2 }, { 3: 6, 4: $V0, 5: $V1, 6: $V2 }, o([1, 4, 5, 10, 15, 16, 18, 20, 22, 23, 25, 29, 40], $V3, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 25: $Vd, 29: $Ve, 40: $Vf }, o($Vg, [2, 5]), { 9: 25, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 25: $Vd, 29: $Ve, 40: $Vf }, o($Vg, [2, 7]), o($Vg, [2, 8]), { 11: 26, 40: $Vf }, { 5: [1, 27] }, { 11: 28, 40: $Vf }, { 11: 29, 40: $Vf }, { 5: [1, 30] }, { 19: 31, 47: $Vh }, { 13: [1, 33] }, { 13: [1, 34] }, { 13: [1, 35] }, { 13: [1, 36] }, { 37: 37, 41: [1, 38], 42: [1, 39], 43: [1, 40], 44: [1, 41], 45: [1, 42], 46: [1, 43] }, { 30: 44, 31: [1, 45], 35: [1, 46], 36: [1, 47] }, o([5, 12, 34, 41, 42, 43, 44, 45, 46, 47], [2, 35]), o($Vg, [2, 6]), { 5: [1, 49], 12: [1, 48] }, o($Vg, [2, 11]), { 5: [1, 50] }, { 5: [1, 51] }, o($Vg, [2, 14]), { 5: [1, 52] }, { 5: [2, 42] }, o($Vi, $V3, { 7: 53 }), o($Vi, $V3, { 7: 54 }), o($Vj, $V3, { 24: 55, 7: 56 }), o($Vk, $V3, { 26: 57, 7: 58 }), { 11: 61, 38: [1, 59], 39: [1, 60], 40: $Vf }, o($Vl, [2, 36]), o($Vl, [2, 37]), o($Vl, [2, 38]), o($Vl, [2, 39]), o($Vl, [2, 40]), o($Vl, [2, 41]), { 11: 62, 40: $Vf }, { 11: 64, 32: 63, 40: $Vf }, { 40: [2, 30] }, { 40: [2, 31] }, { 13: [1, 65] }, o($Vg, [2, 10]), o($Vg, [2, 12]), o($Vg, [2, 13]), o($Vg, [2, 15]), { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 66], 22: $Vb, 23: $Vc, 25: $Vd, 29: $Ve, 40: $Vf }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 67], 22: $Vb, 23: $Vc, 25: $Vd, 29: $Ve, 40: $Vf }, { 21: [1, 68] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [2, 22], 22: $Vb, 23: $Vc, 25: $Vd, 28: [1, 69], 29: $Ve, 40: $Vf }, { 21: [1, 70] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [2, 20], 22: $Vb, 23: $Vc, 25: $Vd, 27: [1, 71], 29: $Ve, 40: $Vf }, { 11: 72, 40: $Vf }, { 11: 73, 40: $Vf }, { 19: 74, 47: $Vh }, { 19: 75, 47: $Vh }, { 19: 76, 47: $Vh }, { 34: [1, 77], 47: [2, 29] }, { 5: [1, 78] }, o($Vg, [2, 16]), o($Vg, [2, 17]), o($Vg, [2, 18]), { 13: [1, 79] }, o($Vg, [2, 19]), { 13: [1, 80] }, { 19: 81, 47: $Vh }, { 19: 82, 47: $Vh }, { 5: [2, 34] }, { 5: [2, 24] }, { 5: [2, 25] }, { 11: 83, 40: $Vf }, o($Vg, [2, 9]), o($Vj, $V3, { 7: 56, 24: 84 }), o($Vk, $V3, { 7: 58, 26: 85 }), { 5: [2, 32] }, { 5: [2, 33] }, { 47: [2, 28] }, { 21: [2, 23] }, { 21: [2, 21] }],
6877 defaultActions: { 5: [2, 1], 6: [2, 2], 32: [2, 42], 46: [2, 30], 47: [2, 31], 74: [2, 34], 75: [2, 24], 76: [2, 25], 81: [2, 32], 82: [2, 33], 83: [2, 28], 84: [2, 23], 85: [2, 21] },
6878 parseError: function parseError(str, hash) {
6879 if (hash.recoverable) {
6880 this.trace(str);
6881 } else {
6882 var error = new Error(str);
6883 error.hash = hash;
6884 throw error;
6885 }
6886 },
6887 parse: function parse(input) {
6888 var self = this,
6889 stack = [0],
6890 tstack = [],
6891 vstack = [null],
6892 lstack = [],
6893 table = this.table,
6894 yytext = '',
6895 yylineno = 0,
6896 yyleng = 0,
6897 recovering = 0,
6898 TERROR = 2,
6899 EOF = 1;
6900 var args = lstack.slice.call(arguments, 1);
6901 var lexer = Object.create(this.lexer);
6902 var sharedState = { yy: {} };
6903 for (var k in this.yy) {
6904 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
6905 sharedState.yy[k] = this.yy[k];
6906 }
6907 }
6908 lexer.setInput(input, sharedState.yy);
6909 sharedState.yy.lexer = lexer;
6910 sharedState.yy.parser = this;
6911 if (typeof lexer.yylloc == 'undefined') {
6912 lexer.yylloc = {};
6913 }
6914 var yyloc = lexer.yylloc;
6915 lstack.push(yyloc);
6916 var ranges = lexer.options && lexer.options.ranges;
6917 if (typeof sharedState.yy.parseError === 'function') {
6918 this.parseError = sharedState.yy.parseError;
6919 } else {
6920 this.parseError = Object.getPrototypeOf(this).parseError;
6921 }
6922 function popStack(n) {
6923 stack.length = stack.length - 2 * n;
6924 vstack.length = vstack.length - n;
6925 lstack.length = lstack.length - n;
6926 }
6927 function lex() {
6928 var token;
6929 token = tstack.pop() || lexer.lex() || EOF;
6930 if (typeof token !== 'number') {
6931 if (token instanceof Array) {
6932 tstack = token;
6933 token = tstack.pop();
6934 }
6935 token = self.symbols_[token] || token;
6936 }
6937 return token;
6938 }
6939 var symbol,
6940 preErrorSymbol,
6941 state,
6942 action,
6943 a,
6944 r,
6945 yyval = {},
6946 p,
6947 len,
6948 newState,
6949 expected;
6950 while (true) {
6951 state = stack[stack.length - 1];
6952 if (this.defaultActions[state]) {
6953 action = this.defaultActions[state];
6954 } else {
6955 if (symbol === null || typeof symbol == 'undefined') {
6956 symbol = lex();
6957 }
6958 action = table[state] && table[state][symbol];
6959 }
6960 if (typeof action === 'undefined' || !action.length || !action[0]) {
6961 var errStr = '';
6962 expected = [];
6963 for (p in table[state]) {
6964 if (this.terminals_[p] && p > TERROR) {
6965 expected.push('\'' + this.terminals_[p] + '\'');
6966 }
6967 }
6968 if (lexer.showPosition) {
6969 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
6970 } else {
6971 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
6972 }
6973 this.parseError(errStr, {
6974 text: lexer.match,
6975 token: this.terminals_[symbol] || symbol,
6976 line: lexer.yylineno,
6977 loc: yyloc,
6978 expected: expected
6979 });
6980 }
6981 if (action[0] instanceof Array && action.length > 1) {
6982 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
6983 }
6984 switch (action[0]) {
6985 case 1:
6986 stack.push(symbol);
6987 vstack.push(lexer.yytext);
6988 lstack.push(lexer.yylloc);
6989 stack.push(action[1]);
6990 symbol = null;
6991 if (!preErrorSymbol) {
6992 yyleng = lexer.yyleng;
6993 yytext = lexer.yytext;
6994 yylineno = lexer.yylineno;
6995 yyloc = lexer.yylloc;
6996 if (recovering > 0) {
6997 recovering--;
6998 }
6999 } else {
7000 symbol = preErrorSymbol;
7001 preErrorSymbol = null;
7002 }
7003 break;
7004 case 2:
7005 len = this.productions_[action[1]][1];
7006 yyval.$ = vstack[vstack.length - len];
7007 yyval._$ = {
7008 first_line: lstack[lstack.length - (len || 1)].first_line,
7009 last_line: lstack[lstack.length - 1].last_line,
7010 first_column: lstack[lstack.length - (len || 1)].first_column,
7011 last_column: lstack[lstack.length - 1].last_column
7012 };
7013 if (ranges) {
7014 yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
7015 }
7016 r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
7017 if (typeof r !== 'undefined') {
7018 return r;
7019 }
7020 if (len) {
7021 stack = stack.slice(0, -1 * len * 2);
7022 vstack = vstack.slice(0, -1 * len);
7023 lstack = lstack.slice(0, -1 * len);
7024 }
7025 stack.push(this.productions_[action[1]][0]);
7026 vstack.push(yyval.$);
7027 lstack.push(yyval._$);
7028 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
7029 stack.push(newState);
7030 break;
7031 case 3:
7032 return true;
7033 }
7034 }
7035 return true;
7036 } };
7037
7038 /* generated by jison-lex 0.3.4 */
7039 var lexer = function () {
7040 var lexer = {
7041
7042 EOF: 1,
7043
7044 parseError: function parseError(str, hash) {
7045 if (this.yy.parser) {
7046 this.yy.parser.parseError(str, hash);
7047 } else {
7048 throw new Error(str);
7049 }
7050 },
7051
7052 // resets the lexer, sets new input
7053 setInput: function setInput(input, yy) {
7054 this.yy = yy || this.yy || {};
7055 this._input = input;
7056 this._more = this._backtrack = this.done = false;
7057 this.yylineno = this.yyleng = 0;
7058 this.yytext = this.matched = this.match = '';
7059 this.conditionStack = ['INITIAL'];
7060 this.yylloc = {
7061 first_line: 1,
7062 first_column: 0,
7063 last_line: 1,
7064 last_column: 0
7065 };
7066 if (this.options.ranges) {
7067 this.yylloc.range = [0, 0];
7068 }
7069 this.offset = 0;
7070 return this;
7071 },
7072
7073 // consumes and returns one char from the input
7074 input: function input() {
7075 var ch = this._input[0];
7076 this.yytext += ch;
7077 this.yyleng++;
7078 this.offset++;
7079 this.match += ch;
7080 this.matched += ch;
7081 var lines = ch.match(/(?:\r\n?|\n).*/g);
7082 if (lines) {
7083 this.yylineno++;
7084 this.yylloc.last_line++;
7085 } else {
7086 this.yylloc.last_column++;
7087 }
7088 if (this.options.ranges) {
7089 this.yylloc.range[1]++;
7090 }
7091
7092 this._input = this._input.slice(1);
7093 return ch;
7094 },
7095
7096 // unshifts one char (or a string) into the input
7097 unput: function unput(ch) {
7098 var len = ch.length;
7099 var lines = ch.split(/(?:\r\n?|\n)/g);
7100
7101 this._input = ch + this._input;
7102 this.yytext = this.yytext.substr(0, this.yytext.length - len);
7103 //this.yyleng -= len;
7104 this.offset -= len;
7105 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
7106 this.match = this.match.substr(0, this.match.length - 1);
7107 this.matched = this.matched.substr(0, this.matched.length - 1);
7108
7109 if (lines.length - 1) {
7110 this.yylineno -= lines.length - 1;
7111 }
7112 var r = this.yylloc.range;
7113
7114 this.yylloc = {
7115 first_line: this.yylloc.first_line,
7116 last_line: this.yylineno + 1,
7117 first_column: this.yylloc.first_column,
7118 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
7119 };
7120
7121 if (this.options.ranges) {
7122 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
7123 }
7124 this.yyleng = this.yytext.length;
7125 return this;
7126 },
7127
7128 // When called from action, caches matched text and appends it on next action
7129 more: function more() {
7130 this._more = true;
7131 return this;
7132 },
7133
7134 // 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.
7135 reject: function reject() {
7136 if (this.options.backtrack_lexer) {
7137 this._backtrack = true;
7138 } else {
7139 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(), {
7140 text: "",
7141 token: null,
7142 line: this.yylineno
7143 });
7144 }
7145 return this;
7146 },
7147
7148 // retain first n characters of the match
7149 less: function less(n) {
7150 this.unput(this.match.slice(n));
7151 },
7152
7153 // displays already matched input, i.e. for error messages
7154 pastInput: function pastInput() {
7155 var past = this.matched.substr(0, this.matched.length - this.match.length);
7156 return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
7157 },
7158
7159 // displays upcoming input, i.e. for error messages
7160 upcomingInput: function upcomingInput() {
7161 var next = this.match;
7162 if (next.length < 20) {
7163 next += this._input.substr(0, 20 - next.length);
7164 }
7165 return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
7166 },
7167
7168 // displays the character position where the lexing error occurred, i.e. for error messages
7169 showPosition: function showPosition() {
7170 var pre = this.pastInput();
7171 var c = new Array(pre.length + 1).join("-");
7172 return pre + this.upcomingInput() + "\n" + c + "^";
7173 },
7174
7175 // test the lexed token: return FALSE when not a match, otherwise return token
7176 test_match: function test_match(match, indexed_rule) {
7177 var token, lines, backup;
7178
7179 if (this.options.backtrack_lexer) {
7180 // save context
7181 backup = {
7182 yylineno: this.yylineno,
7183 yylloc: {
7184 first_line: this.yylloc.first_line,
7185 last_line: this.last_line,
7186 first_column: this.yylloc.first_column,
7187 last_column: this.yylloc.last_column
7188 },
7189 yytext: this.yytext,
7190 match: this.match,
7191 matches: this.matches,
7192 matched: this.matched,
7193 yyleng: this.yyleng,
7194 offset: this.offset,
7195 _more: this._more,
7196 _input: this._input,
7197 yy: this.yy,
7198 conditionStack: this.conditionStack.slice(0),
7199 done: this.done
7200 };
7201 if (this.options.ranges) {
7202 backup.yylloc.range = this.yylloc.range.slice(0);
7203 }
7204 }
7205
7206 lines = match[0].match(/(?:\r\n?|\n).*/g);
7207 if (lines) {
7208 this.yylineno += lines.length;
7209 }
7210 this.yylloc = {
7211 first_line: this.yylloc.last_line,
7212 last_line: this.yylineno + 1,
7213 first_column: this.yylloc.last_column,
7214 last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
7215 };
7216 this.yytext += match[0];
7217 this.match += match[0];
7218 this.matches = match;
7219 this.yyleng = this.yytext.length;
7220 if (this.options.ranges) {
7221 this.yylloc.range = [this.offset, this.offset += this.yyleng];
7222 }
7223 this._more = false;
7224 this._backtrack = false;
7225 this._input = this._input.slice(match[0].length);
7226 this.matched += match[0];
7227 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
7228 if (this.done && this._input) {
7229 this.done = false;
7230 }
7231 if (token) {
7232 return token;
7233 } else if (this._backtrack) {
7234 // recover context
7235 for (var k in backup) {
7236 this[k] = backup[k];
7237 }
7238 return false; // rule action called reject() implying the next rule should be tested instead.
7239 }
7240 return false;
7241 },
7242
7243 // return next match in input
7244 next: function next() {
7245 if (this.done) {
7246 return this.EOF;
7247 }
7248 if (!this._input) {
7249 this.done = true;
7250 }
7251
7252 var token, match, tempMatch, index;
7253 if (!this._more) {
7254 this.yytext = '';
7255 this.match = '';
7256 }
7257 var rules = this._currentRules();
7258 for (var i = 0; i < rules.length; i++) {
7259 tempMatch = this._input.match(this.rules[rules[i]]);
7260 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
7261 match = tempMatch;
7262 index = i;
7263 if (this.options.backtrack_lexer) {
7264 token = this.test_match(tempMatch, rules[i]);
7265 if (token !== false) {
7266 return token;
7267 } else if (this._backtrack) {
7268 match = false;
7269 continue; // rule action called reject() implying a rule MISmatch.
7270 } else {
7271 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
7272 return false;
7273 }
7274 } else if (!this.options.flex) {
7275 break;
7276 }
7277 }
7278 }
7279 if (match) {
7280 token = this.test_match(match, rules[index]);
7281 if (token !== false) {
7282 return token;
7283 }
7284 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
7285 return false;
7286 }
7287 if (this._input === "") {
7288 return this.EOF;
7289 } else {
7290 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
7291 text: "",
7292 token: null,
7293 line: this.yylineno
7294 });
7295 }
7296 },
7297
7298 // return next match that has a token
7299 lex: function lex() {
7300 var r = this.next();
7301 if (r) {
7302 return r;
7303 } else {
7304 return this.lex();
7305 }
7306 },
7307
7308 // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
7309 begin: function begin(condition) {
7310 this.conditionStack.push(condition);
7311 },
7312
7313 // pop the previously active lexer condition state off the condition stack
7314 popState: function popState() {
7315 var n = this.conditionStack.length - 1;
7316 if (n > 0) {
7317 return this.conditionStack.pop();
7318 } else {
7319 return this.conditionStack[0];
7320 }
7321 },
7322
7323 // produce the lexer rule set which is active for the currently active lexer condition state
7324 _currentRules: function _currentRules() {
7325 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
7326 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
7327 } else {
7328 return this.conditions["INITIAL"].rules;
7329 }
7330 },
7331
7332 // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
7333 topState: function topState(n) {
7334 n = this.conditionStack.length - 1 - Math.abs(n || 0);
7335 if (n >= 0) {
7336 return this.conditionStack[n];
7337 } else {
7338 return "INITIAL";
7339 }
7340 },
7341
7342 // alias for begin(condition)
7343 pushState: function pushState(condition) {
7344 this.begin(condition);
7345 },
7346
7347 // return the number of states currently on the stack
7348 stateStackSize: function stateStackSize() {
7349 return this.conditionStack.length;
7350 },
7351 options: { "case-insensitive": true },
7352 performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
7353 var YYSTATE = YY_START;
7354 switch ($avoiding_name_collisions) {
7355 case 0:
7356 return 5;
7357 break;
7358 case 1:
7359 /* skip all whitespace */
7360 break;
7361 case 2:
7362 /* skip same-line whitespace */
7363 break;
7364 case 3:
7365 /* skip comments */
7366 break;
7367 case 4:
7368 /* skip comments */
7369 break;
7370 case 5:
7371 this.begin('ID');return 10;
7372 break;
7373 case 6:
7374 this.begin('ALIAS');return 40;
7375 break;
7376 case 7:
7377 this.popState();this.popState();this.begin('LINE');return 12;
7378 break;
7379 case 8:
7380 this.popState();this.popState();return 5;
7381 break;
7382 case 9:
7383 this.begin('LINE');return 20;
7384 break;
7385 case 10:
7386 this.begin('LINE');return 22;
7387 break;
7388 case 11:
7389 this.begin('LINE');return 23;
7390 break;
7391 case 12:
7392 this.begin('LINE');return 28;
7393 break;
7394 case 13:
7395 this.begin('LINE');return 25;
7396 break;
7397 case 14:
7398 this.begin('LINE');return 27;
7399 break;
7400 case 15:
7401 this.popState();return 13;
7402 break;
7403 case 16:
7404 return 21;
7405 break;
7406 case 17:
7407 return 35;
7408 break;
7409 case 18:
7410 return 36;
7411 break;
7412 case 19:
7413 return 31;
7414 break;
7415 case 20:
7416 return 29;
7417 break;
7418 case 21:
7419 this.begin('ID');return 15;
7420 break;
7421 case 22:
7422 this.begin('ID');return 16;
7423 break;
7424 case 23:
7425 return 18;
7426 break;
7427 case 24:
7428 return 6;
7429 break;
7430 case 25:
7431 return 34;
7432 break;
7433 case 26:
7434 return 5;
7435 break;
7436 case 27:
7437 yy_.yytext = yy_.yytext.trim();return 40;
7438 break;
7439 case 28:
7440 return 43;
7441 break;
7442 case 29:
7443 return 44;
7444 break;
7445 case 30:
7446 return 41;
7447 break;
7448 case 31:
7449 return 42;
7450 break;
7451 case 32:
7452 return 45;
7453 break;
7454 case 33:
7455 return 46;
7456 break;
7457 case 34:
7458 return 47;
7459 break;
7460 case 35:
7461 return 38;
7462 break;
7463 case 36:
7464 return 39;
7465 break;
7466 case 37:
7467 return 5;
7468 break;
7469 case 38:
7470 return 'INVALID';
7471 break;
7472 }
7473 },
7474 rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:participant\b)/i, /^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:and\b)/i, /^(?:[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\b)/i, /^(?:sequenceDiagram\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\+\->:\n,;]+)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?::[^#\n;]+)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
7475 conditions: { "LINE": { "rules": [2, 3, 15], "inclusive": false }, "ALIAS": { "rules": [2, 3, 7, 8], "inclusive": false }, "ID": { "rules": [2, 3, 6], "inclusive": false }, "INITIAL": { "rules": [0, 1, 3, 4, 5, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38], "inclusive": true } }
7476 };
7477 return lexer;
7478 }();
7479 parser.lexer = lexer;
7480 function Parser() {
7481 this.yy = {};
7482 }
7483 Parser.prototype = parser;parser.Parser = Parser;
7484 return new Parser();
7485}();
7486
7487if (true) {
7488 exports.parser = parser;
7489 exports.Parser = parser.Parser;
7490 exports.parse = function () {
7491 return parser.parse.apply(parser, arguments);
7492 };
7493 exports.main = function commonjsMain(args) {
7494 if (!args[1]) {
7495 console.log('Usage: ' + args[0] + ' FILE');
7496 process.exit(1);
7497 }
7498 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
7499 return exports.parser.parse(source);
7500 };
7501 if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
7502 exports.main(process.argv.slice(1));
7503 }
7504}
7505/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
7506
7507/***/ }),
7508
7509/***/ "./src/diagrams/sequence/sequenceDb.js":
7510/*!*********************************************!*\
7511 !*** ./src/diagrams/sequence/sequenceDb.js ***!
7512 \*********************************************/
7513/*! no static exports found */
7514/***/ (function(module, exports, __webpack_require__) {
7515
7516"use strict";
7517
7518
7519Object.defineProperty(exports, "__esModule", {
7520 value: true
7521});
7522exports.apply = exports.setTitle = exports.addNote = exports.PLACEMENT = exports.ARROWTYPE = exports.LINETYPE = exports.clear = exports.getTitle = exports.getActorKeys = exports.getActor = exports.getActors = exports.getMessages = exports.addSignal = exports.addMessage = exports.addActor = undefined;
7523
7524var _logger = __webpack_require__(/*! ../../logger */ "./src/logger.js");
7525
7526var actors = {};
7527var messages = [];
7528var notes = [];
7529var title = '';
7530
7531var addActor = exports.addActor = function addActor(id, name, description) {
7532 // Don't allow description nulling
7533 var old = actors[id];
7534 if (old && name === old.name && description == null) return;
7535
7536 // Don't allow null descriptions, either
7537 if (description == null) description = name;
7538
7539 actors[id] = { name: name, description: description };
7540};
7541
7542var addMessage = exports.addMessage = function addMessage(idFrom, idTo, message, answer) {
7543 messages.push({ from: idFrom, to: idTo, message: message, answer: answer });
7544};
7545
7546var addSignal = exports.addSignal = function addSignal(idFrom, idTo, message, messageType) {
7547 _logger.logger.debug('Adding message from=' + idFrom + ' to=' + idTo + ' message=' + message + ' type=' + messageType);
7548 messages.push({ from: idFrom, to: idTo, message: message, type: messageType });
7549};
7550
7551var getMessages = exports.getMessages = function getMessages() {
7552 return messages;
7553};
7554
7555var getActors = exports.getActors = function getActors() {
7556 return actors;
7557};
7558var getActor = exports.getActor = function getActor(id) {
7559 return actors[id];
7560};
7561var getActorKeys = exports.getActorKeys = function getActorKeys() {
7562 return Object.keys(actors);
7563};
7564var getTitle = exports.getTitle = function getTitle() {
7565 return title;
7566};
7567
7568var clear = exports.clear = function clear() {
7569 actors = {};
7570 messages = [];
7571};
7572
7573var LINETYPE = exports.LINETYPE = {
7574 SOLID: 0,
7575 DOTTED: 1,
7576 NOTE: 2,
7577 SOLID_CROSS: 3,
7578 DOTTED_CROSS: 4,
7579 SOLID_OPEN: 5,
7580 DOTTED_OPEN: 6,
7581 LOOP_START: 10,
7582 LOOP_END: 11,
7583 ALT_START: 12,
7584 ALT_ELSE: 13,
7585 ALT_END: 14,
7586 OPT_START: 15,
7587 OPT_END: 16,
7588 ACTIVE_START: 17,
7589 ACTIVE_END: 18,
7590 PAR_START: 19,
7591 PAR_AND: 20,
7592 PAR_END: 21
7593};
7594
7595var ARROWTYPE = exports.ARROWTYPE = {
7596 FILLED: 0,
7597 OPEN: 1
7598};
7599
7600var PLACEMENT = exports.PLACEMENT = {
7601 LEFTOF: 0,
7602 RIGHTOF: 1,
7603 OVER: 2
7604};
7605
7606var addNote = exports.addNote = function addNote(actor, placement, message) {
7607 var note = { actor: actor, placement: placement, message: message
7608
7609 // Coerce actor into a [to, from, ...] array
7610 };var actors = [].concat(actor, actor);
7611
7612 notes.push(note);
7613 messages.push({ from: actors[0], to: actors[1], message: message, type: LINETYPE.NOTE, placement: placement });
7614};
7615
7616var setTitle = exports.setTitle = function setTitle(titleText) {
7617 title = titleText;
7618};
7619
7620var apply = exports.apply = function apply(param) {
7621 if (param instanceof Array) {
7622 param.forEach(function (item) {
7623 apply(item);
7624 });
7625 } else {
7626 switch (param.type) {
7627 case 'addActor':
7628 addActor(param.actor, param.actor, param.description);
7629 break;
7630 case 'activeStart':
7631 addSignal(param.actor, undefined, undefined, param.signalType);
7632 break;
7633 case 'activeEnd':
7634 addSignal(param.actor, undefined, undefined, param.signalType);
7635 break;
7636 case 'addNote':
7637 addNote(param.actor, param.placement, param.text);
7638 break;
7639 case 'addMessage':
7640 addSignal(param.from, param.to, param.msg, param.signalType);
7641 break;
7642 case 'loopStart':
7643 addSignal(undefined, undefined, param.loopText, param.signalType);
7644 break;
7645 case 'loopEnd':
7646 addSignal(undefined, undefined, undefined, param.signalType);
7647 break;
7648 case 'optStart':
7649 addSignal(undefined, undefined, param.optText, param.signalType);
7650 break;
7651 case 'optEnd':
7652 addSignal(undefined, undefined, undefined, param.signalType);
7653 break;
7654 case 'altStart':
7655 addSignal(undefined, undefined, param.altText, param.signalType);
7656 break;
7657 case 'else':
7658 addSignal(undefined, undefined, param.altText, param.signalType);
7659 break;
7660 case 'altEnd':
7661 addSignal(undefined, undefined, undefined, param.signalType);
7662 break;
7663 case 'setTitle':
7664 setTitle(param.text);
7665 break;
7666 case 'parStart':
7667 addSignal(undefined, undefined, param.parText, param.signalType);
7668 break;
7669 case 'and':
7670 addSignal(undefined, undefined, param.parText, param.signalType);
7671 break;
7672 case 'parEnd':
7673 addSignal(undefined, undefined, undefined, param.signalType);
7674 break;
7675 }
7676 }
7677};
7678
7679exports.default = {
7680 addActor: addActor,
7681 addMessage: addMessage,
7682 addSignal: addSignal,
7683 getMessages: getMessages,
7684 getActors: getActors,
7685 getActor: getActor,
7686 getActorKeys: getActorKeys,
7687 getTitle: getTitle,
7688 clear: clear,
7689 LINETYPE: LINETYPE,
7690 ARROWTYPE: ARROWTYPE,
7691 PLACEMENT: PLACEMENT,
7692 addNote: addNote,
7693 setTitle: setTitle,
7694 apply: apply
7695};
7696
7697/***/ }),
7698
7699/***/ "./src/diagrams/sequence/sequenceRenderer.js":
7700/*!***************************************************!*\
7701 !*** ./src/diagrams/sequence/sequenceRenderer.js ***!
7702 \***************************************************/
7703/*! no static exports found */
7704/***/ (function(module, exports, __webpack_require__) {
7705
7706"use strict";
7707
7708
7709Object.defineProperty(exports, "__esModule", {
7710 value: true
7711});
7712exports.draw = exports.setConf = exports.drawActors = exports.bounds = undefined;
7713
7714var _d = __webpack_require__(/*! d3 */ "d3");
7715
7716var d3 = _interopRequireWildcard(_d);
7717
7718var _svgDraw = __webpack_require__(/*! ./svgDraw */ "./src/diagrams/sequence/svgDraw.js");
7719
7720var _svgDraw2 = _interopRequireDefault(_svgDraw);
7721
7722var _logger = __webpack_require__(/*! ../../logger */ "./src/logger.js");
7723
7724var _sequenceDiagram = __webpack_require__(/*! ./parser/sequenceDiagram */ "./src/diagrams/sequence/parser/sequenceDiagram.js");
7725
7726var _sequenceDb = __webpack_require__(/*! ./sequenceDb */ "./src/diagrams/sequence/sequenceDb.js");
7727
7728var _sequenceDb2 = _interopRequireDefault(_sequenceDb);
7729
7730function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7731
7732function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
7733
7734_sequenceDiagram.parser.yy = _sequenceDb2.default;
7735
7736var conf = {
7737
7738 diagramMarginX: 50,
7739 diagramMarginY: 30,
7740 // Margin between actors
7741 actorMargin: 50,
7742 // Width of actor boxes
7743 width: 150,
7744 // Height of actor boxes
7745 height: 65,
7746 // Margin around loop boxes
7747 boxMargin: 10,
7748 boxTextMargin: 5,
7749 noteMargin: 10,
7750 // Space between messages
7751 messageMargin: 35,
7752 // mirror actors under diagram
7753 mirrorActors: false,
7754 // Depending on css styling this might need adjustment
7755 // Prolongs the edge of the diagram downwards
7756 bottomMarginAdj: 1,
7757
7758 // width of activation box
7759 activationWidth: 10,
7760
7761 // text placement as: tspan | fo | old only text as before
7762 textPlacement: 'tspan'
7763};
7764
7765var bounds = exports.bounds = {
7766 data: {
7767 startx: undefined,
7768 stopx: undefined,
7769 starty: undefined,
7770 stopy: undefined
7771 },
7772 verticalPos: 0,
7773
7774 sequenceItems: [],
7775 activations: [],
7776 init: function init() {
7777 this.sequenceItems = [];
7778 this.activations = [];
7779 this.data = {
7780 startx: undefined,
7781 stopx: undefined,
7782 starty: undefined,
7783 stopy: undefined
7784 };
7785 this.verticalPos = 0;
7786 },
7787 updateVal: function updateVal(obj, key, val, fun) {
7788 if (typeof obj[key] === 'undefined') {
7789 obj[key] = val;
7790 } else {
7791 obj[key] = fun(val, obj[key]);
7792 }
7793 },
7794 updateBounds: function updateBounds(startx, starty, stopx, stopy) {
7795 var _self = this;
7796 var cnt = 0;
7797 function updateFn(type) {
7798 return function updateItemBounds(item) {
7799 cnt++;
7800 // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems
7801 var n = _self.sequenceItems.length - cnt + 1;
7802
7803 _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min);
7804 _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max);
7805
7806 _self.updateVal(bounds.data, 'startx', startx - n * conf.boxMargin, Math.min);
7807 _self.updateVal(bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max);
7808
7809 if (!(type === 'activation')) {
7810 _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min);
7811 _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max);
7812
7813 _self.updateVal(bounds.data, 'starty', starty - n * conf.boxMargin, Math.min);
7814 _self.updateVal(bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max);
7815 }
7816 };
7817 }
7818
7819 this.sequenceItems.forEach(updateFn());
7820 this.activations.forEach(updateFn('activation'));
7821 },
7822 insert: function insert(startx, starty, stopx, stopy) {
7823 var _startx = Math.min(startx, stopx);
7824 var _stopx = Math.max(startx, stopx);
7825 var _starty = Math.min(starty, stopy);
7826 var _stopy = Math.max(starty, stopy);
7827
7828 this.updateVal(bounds.data, 'startx', _startx, Math.min);
7829 this.updateVal(bounds.data, 'starty', _starty, Math.min);
7830 this.updateVal(bounds.data, 'stopx', _stopx, Math.max);
7831 this.updateVal(bounds.data, 'stopy', _stopy, Math.max);
7832
7833 this.updateBounds(_startx, _starty, _stopx, _stopy);
7834 },
7835 newActivation: function newActivation(message, diagram) {
7836 var actorRect = _sequenceDiagram.parser.yy.getActors()[message.from.actor];
7837 var stackedSize = actorActivations(message.from.actor).length;
7838 var x = actorRect.x + conf.width / 2 + (stackedSize - 1) * conf.activationWidth / 2;
7839 this.activations.push({
7840 startx: x,
7841 starty: this.verticalPos + 2,
7842 stopx: x + conf.activationWidth,
7843 stopy: undefined,
7844 actor: message.from.actor,
7845 anchored: _svgDraw2.default.anchorElement(diagram)
7846 });
7847 },
7848 endActivation: function endActivation(message) {
7849 // find most recent activation for given actor
7850 var lastActorActivationIdx = this.activations.map(function (activation) {
7851 return activation.actor;
7852 }).lastIndexOf(message.from.actor);
7853 var activation = this.activations.splice(lastActorActivationIdx, 1)[0];
7854 return activation;
7855 },
7856 newLoop: function newLoop(title) {
7857 this.sequenceItems.push({ startx: undefined, starty: this.verticalPos, stopx: undefined, stopy: undefined, title: title });
7858 },
7859 endLoop: function endLoop() {
7860 var loop = this.sequenceItems.pop();
7861 return loop;
7862 },
7863 addSectionToLoop: function addSectionToLoop(message) {
7864 var loop = this.sequenceItems.pop();
7865 loop.sections = loop.sections || [];
7866 loop.sectionTitles = loop.sectionTitles || [];
7867 loop.sections.push(bounds.getVerticalPos());
7868 loop.sectionTitles.push(message);
7869 this.sequenceItems.push(loop);
7870 },
7871 bumpVerticalPos: function bumpVerticalPos(bump) {
7872 this.verticalPos = this.verticalPos + bump;
7873 this.data.stopy = this.verticalPos;
7874 },
7875 getVerticalPos: function getVerticalPos() {
7876 return this.verticalPos;
7877 },
7878 getBounds: function getBounds() {
7879 return this.data;
7880 }
7881};
7882
7883var _drawLongText = function _drawLongText(text, x, y, g, width) {
7884 var textHeight = 0;
7885 var lines = text.split(/<br\/?>/ig);
7886 var _iteratorNormalCompletion = true;
7887 var _didIteratorError = false;
7888 var _iteratorError = undefined;
7889
7890 try {
7891 for (var _iterator = lines[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
7892 var line = _step.value;
7893
7894 var textObj = _svgDraw2.default.getTextObj();
7895 textObj.x = x;
7896 textObj.y = y + textHeight;
7897 textObj.textMargin = conf.noteMargin;
7898 textObj.dy = '1em';
7899 textObj.text = line;
7900 textObj.class = 'noteText';
7901 var textElem = _svgDraw2.default.drawText(g, textObj, width);
7902 textHeight += (textElem._groups || textElem)[0][0].getBBox().height;
7903 }
7904 } catch (err) {
7905 _didIteratorError = true;
7906 _iteratorError = err;
7907 } finally {
7908 try {
7909 if (!_iteratorNormalCompletion && _iterator.return) {
7910 _iterator.return();
7911 }
7912 } finally {
7913 if (_didIteratorError) {
7914 throw _iteratorError;
7915 }
7916 }
7917 }
7918
7919 return textHeight;
7920};
7921
7922/**
7923 * Draws an actor in the diagram with the attaced line
7924 * @param center - The center of the the actor
7925 * @param pos The position if the actor in the liost of actors
7926 * @param description The text in the box
7927 */
7928var drawNote = function drawNote(elem, startx, verticalPos, msg, forceWidth) {
7929 var rect = _svgDraw2.default.getNoteRect();
7930 rect.x = startx;
7931 rect.y = verticalPos;
7932 rect.width = forceWidth || conf.width;
7933 rect.class = 'note';
7934
7935 var g = elem.append('g');
7936 var rectElem = _svgDraw2.default.drawRect(g, rect);
7937
7938 var textHeight = _drawLongText(msg.message, startx - 4, verticalPos + 24, g, rect.width - conf.noteMargin);
7939
7940 bounds.insert(startx, verticalPos, startx + rect.width, verticalPos + 2 * conf.noteMargin + textHeight);
7941 rectElem.attr('height', textHeight + 2 * conf.noteMargin);
7942 bounds.bumpVerticalPos(textHeight + 2 * conf.noteMargin);
7943};
7944
7945/**
7946 * Draws a message
7947 * @param elem
7948 * @param startx
7949 * @param stopx
7950 * @param verticalPos
7951 * @param txtCenter
7952 * @param msg
7953 */
7954var drawMessage = function drawMessage(elem, startx, stopx, verticalPos, msg) {
7955 var g = elem.append('g');
7956 var txtCenter = startx + (stopx - startx) / 2;
7957
7958 var textElem = g.append('text') // text label for the x axis
7959 .attr('x', txtCenter).attr('y', verticalPos - 7).style('text-anchor', 'middle').attr('class', 'messageText').text(msg.message);
7960
7961 var textWidth = (textElem._groups || textElem)[0][0].getBBox().width;
7962
7963 var line = void 0;
7964 if (startx === stopx) {
7965 line = g.append('path').attr('d', 'M ' + startx + ',' + verticalPos + ' C ' + (startx + 60) + ',' + (verticalPos - 10) + ' ' + (startx + 60) + ',' + (verticalPos + 30) + ' ' + startx + ',' + (verticalPos + 20));
7966
7967 bounds.bumpVerticalPos(30);
7968 var dx = Math.max(textWidth / 2, 100);
7969 bounds.insert(startx - dx, bounds.getVerticalPos() - 10, stopx + dx, bounds.getVerticalPos());
7970 } else {
7971 line = g.append('line');
7972 line.attr('x1', startx);
7973 line.attr('y1', verticalPos);
7974 line.attr('x2', stopx);
7975 line.attr('y2', verticalPos);
7976 bounds.insert(startx, bounds.getVerticalPos() - 10, stopx, bounds.getVerticalPos());
7977 }
7978 // Make an SVG Container
7979 // Draw the line
7980 if (msg.type === _sequenceDiagram.parser.yy.LINETYPE.DOTTED || msg.type === _sequenceDiagram.parser.yy.LINETYPE.DOTTED_CROSS || msg.type === _sequenceDiagram.parser.yy.LINETYPE.DOTTED_OPEN) {
7981 line.style('stroke-dasharray', '3, 3');
7982 line.attr('class', 'messageLine1');
7983 } else {
7984 line.attr('class', 'messageLine0');
7985 }
7986
7987 var url = '';
7988 if (conf.arrowMarkerAbsolute) {
7989 url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
7990 url = url.replace(/\(/g, '\\(');
7991 url = url.replace(/\)/g, '\\)');
7992 }
7993
7994 line.attr('stroke-width', 2);
7995 line.attr('stroke', 'black');
7996 line.style('fill', 'none'); // remove any fill colour
7997 if (msg.type === _sequenceDiagram.parser.yy.LINETYPE.SOLID || msg.type === _sequenceDiagram.parser.yy.LINETYPE.DOTTED) {
7998 line.attr('marker-end', 'url(' + url + '#arrowhead)');
7999 }
8000
8001 if (msg.type === _sequenceDiagram.parser.yy.LINETYPE.SOLID_CROSS || msg.type === _sequenceDiagram.parser.yy.LINETYPE.DOTTED_CROSS) {
8002 line.attr('marker-end', 'url(' + url + '#crosshead)');
8003 }
8004};
8005
8006var drawActors = exports.drawActors = function drawActors(diagram, actors, actorKeys, verticalPos) {
8007 // Draw the actors
8008 for (var i = 0; i < actorKeys.length; i++) {
8009 var key = actorKeys[i];
8010
8011 // Add some rendering data to the object
8012 actors[key].x = i * conf.actorMargin + i * conf.width;
8013 actors[key].y = verticalPos;
8014 actors[key].width = conf.diagramMarginX;
8015 actors[key].height = conf.diagramMarginY;
8016
8017 // Draw the box with the attached line
8018 _svgDraw2.default.drawActor(diagram, actors[key].x, verticalPos, actors[key].description, conf);
8019 bounds.insert(actors[key].x, verticalPos, actors[key].x + conf.width, conf.height);
8020 }
8021
8022 // Add a margin between the actor boxes and the first arrow
8023 bounds.bumpVerticalPos(conf.height);
8024};
8025
8026var setConf = exports.setConf = function setConf(cnf) {
8027 var keys = Object.keys(cnf);
8028
8029 keys.forEach(function (key) {
8030 conf[key] = cnf[key];
8031 });
8032};
8033
8034var actorActivations = function actorActivations(actor) {
8035 return bounds.activations.filter(function (activation) {
8036 return activation.actor === actor;
8037 });
8038};
8039
8040var actorFlowVerticaBounds = function actorFlowVerticaBounds(actor) {
8041 // handle multiple stacked activations for same actor
8042 var actors = _sequenceDiagram.parser.yy.getActors();
8043 var activations = actorActivations(actor);
8044
8045 var left = activations.reduce(function (acc, activation) {
8046 return Math.min(acc, activation.startx);
8047 }, actors[actor].x + conf.width / 2);
8048 var right = activations.reduce(function (acc, activation) {
8049 return Math.max(acc, activation.stopx);
8050 }, actors[actor].x + conf.width / 2);
8051 return [left, right];
8052};
8053
8054/**
8055 * Draws a flowchart in the tag with id: id based on the graph definition in text.
8056 * @param text
8057 * @param id
8058 */
8059var draw = exports.draw = function draw(text, id) {
8060 _sequenceDiagram.parser.yy.clear();
8061 _sequenceDiagram.parser.parse(text + '\n');
8062
8063 bounds.init();
8064 var diagram = d3.select('[id="' + id + '"]');
8065
8066 var startx = void 0;
8067 var stopx = void 0;
8068 var forceWidth = void 0;
8069
8070 // Fetch data from the parsing
8071 var actors = _sequenceDiagram.parser.yy.getActors();
8072 var actorKeys = _sequenceDiagram.parser.yy.getActorKeys();
8073 var messages = _sequenceDiagram.parser.yy.getMessages();
8074 var title = _sequenceDiagram.parser.yy.getTitle();
8075 drawActors(diagram, actors, actorKeys, 0);
8076
8077 // The arrow head definition is attached to the svg once
8078 _svgDraw2.default.insertArrowHead(diagram);
8079 _svgDraw2.default.insertArrowCrossHead(diagram);
8080
8081 function activeEnd(msg, verticalPos) {
8082 var activationData = bounds.endActivation(msg);
8083 if (activationData.starty + 18 > verticalPos) {
8084 activationData.starty = verticalPos - 6;
8085 verticalPos += 12;
8086 }
8087 _svgDraw2.default.drawActivation(diagram, activationData, verticalPos, conf);
8088
8089 bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos);
8090 }
8091
8092 // const lastMsg
8093
8094 // Draw the messages/signals
8095 messages.forEach(function (msg) {
8096 var loopData = void 0;
8097 switch (msg.type) {
8098 case _sequenceDiagram.parser.yy.LINETYPE.NOTE:
8099 bounds.bumpVerticalPos(conf.boxMargin);
8100
8101 startx = actors[msg.from].x;
8102 stopx = actors[msg.to].x;
8103
8104 if (msg.placement === _sequenceDiagram.parser.yy.PLACEMENT.RIGHTOF) {
8105 drawNote(diagram, startx + (conf.width + conf.actorMargin) / 2, bounds.getVerticalPos(), msg);
8106 } else if (msg.placement === _sequenceDiagram.parser.yy.PLACEMENT.LEFTOF) {
8107 drawNote(diagram, startx - (conf.width + conf.actorMargin) / 2, bounds.getVerticalPos(), msg);
8108 } else if (msg.to === msg.from) {
8109 // Single-actor over
8110 drawNote(diagram, startx, bounds.getVerticalPos(), msg);
8111 } else {
8112 // Multi-actor over
8113 forceWidth = Math.abs(startx - stopx) + conf.actorMargin;
8114 drawNote(diagram, (startx + stopx + conf.width - forceWidth) / 2, bounds.getVerticalPos(), msg, forceWidth);
8115 }
8116 break;
8117 case _sequenceDiagram.parser.yy.LINETYPE.ACTIVE_START:
8118 bounds.newActivation(msg, diagram);
8119 break;
8120 case _sequenceDiagram.parser.yy.LINETYPE.ACTIVE_END:
8121 activeEnd(msg, bounds.getVerticalPos());
8122 break;
8123 case _sequenceDiagram.parser.yy.LINETYPE.LOOP_START:
8124 bounds.bumpVerticalPos(conf.boxMargin);
8125 bounds.newLoop(msg.message);
8126 bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
8127 break;
8128 case _sequenceDiagram.parser.yy.LINETYPE.LOOP_END:
8129 loopData = bounds.endLoop();
8130
8131 _svgDraw2.default.drawLoop(diagram, loopData, 'loop', conf);
8132 bounds.bumpVerticalPos(conf.boxMargin);
8133 break;
8134 case _sequenceDiagram.parser.yy.LINETYPE.OPT_START:
8135 bounds.bumpVerticalPos(conf.boxMargin);
8136 bounds.newLoop(msg.message);
8137 bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
8138 break;
8139 case _sequenceDiagram.parser.yy.LINETYPE.OPT_END:
8140 loopData = bounds.endLoop();
8141
8142 _svgDraw2.default.drawLoop(diagram, loopData, 'opt', conf);
8143 bounds.bumpVerticalPos(conf.boxMargin);
8144 break;
8145 case _sequenceDiagram.parser.yy.LINETYPE.ALT_START:
8146 bounds.bumpVerticalPos(conf.boxMargin);
8147 bounds.newLoop(msg.message);
8148 bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
8149 break;
8150 case _sequenceDiagram.parser.yy.LINETYPE.ALT_ELSE:
8151 bounds.bumpVerticalPos(conf.boxMargin);
8152 loopData = bounds.addSectionToLoop(msg.message);
8153 bounds.bumpVerticalPos(conf.boxMargin);
8154 break;
8155 case _sequenceDiagram.parser.yy.LINETYPE.ALT_END:
8156 loopData = bounds.endLoop();
8157
8158 _svgDraw2.default.drawLoop(diagram, loopData, 'alt', conf);
8159 bounds.bumpVerticalPos(conf.boxMargin);
8160 break;
8161 case _sequenceDiagram.parser.yy.LINETYPE.PAR_START:
8162 bounds.bumpVerticalPos(conf.boxMargin);
8163 bounds.newLoop(msg.message);
8164 bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
8165 break;
8166 case _sequenceDiagram.parser.yy.LINETYPE.PAR_AND:
8167 bounds.bumpVerticalPos(conf.boxMargin);
8168 loopData = bounds.addSectionToLoop(msg.message);
8169 bounds.bumpVerticalPos(conf.boxMargin);
8170 break;
8171 case _sequenceDiagram.parser.yy.LINETYPE.PAR_END:
8172 loopData = bounds.endLoop();
8173 _svgDraw2.default.drawLoop(diagram, loopData, 'par', conf);
8174 bounds.bumpVerticalPos(conf.boxMargin);
8175 break;
8176 default:
8177 try {
8178 // lastMsg = msg
8179 bounds.bumpVerticalPos(conf.messageMargin);
8180 var fromBounds = actorFlowVerticaBounds(msg.from);
8181 var toBounds = actorFlowVerticaBounds(msg.to);
8182 var fromIdx = fromBounds[0] <= toBounds[0] ? 1 : 0;
8183 var toIdx = fromBounds[0] < toBounds[0] ? 0 : 1;
8184 startx = fromBounds[fromIdx];
8185 stopx = toBounds[toIdx];
8186
8187 var verticalPos = bounds.getVerticalPos();
8188 drawMessage(diagram, startx, stopx, verticalPos, msg);
8189 var allBounds = fromBounds.concat(toBounds);
8190 bounds.insert(Math.min.apply(null, allBounds), verticalPos, Math.max.apply(null, allBounds), verticalPos);
8191 } catch (e) {
8192 _logger.logger.error('error while drawing message', e);
8193 }
8194 }
8195 });
8196
8197 if (conf.mirrorActors) {
8198 // Draw actors below diagram
8199 bounds.bumpVerticalPos(conf.boxMargin * 2);
8200 drawActors(diagram, actors, actorKeys, bounds.getVerticalPos());
8201 }
8202
8203 var box = bounds.getBounds();
8204
8205 // Adjust line height of actor lines now that the height of the diagram is known
8206 _logger.logger.debug('For line height fix Querying: #' + id + ' .actor-line');
8207 var actorLines = d3.selectAll('#' + id + ' .actor-line');
8208 actorLines.attr('y2', box.stopy);
8209
8210 var height = box.stopy - box.starty + 2 * conf.diagramMarginY;
8211 if (conf.mirrorActors) {
8212 height = height - conf.boxMargin + conf.bottomMarginAdj;
8213 }
8214
8215 var width = box.stopx - box.startx + 2 * conf.diagramMarginX;
8216
8217 if (title) {
8218 diagram.append('text').text(title).attr('x', (box.stopx - box.startx) / 2 - 2 * conf.diagramMarginX).attr('y', -25);
8219 }
8220
8221 if (conf.useMaxWidth) {
8222 diagram.attr('height', '100%');
8223 diagram.attr('width', '100%');
8224 diagram.attr('style', 'max-width:' + width + 'px;');
8225 } else {
8226 diagram.attr('height', height);
8227 diagram.attr('width', width);
8228 }
8229 var extraVertForTitle = title ? 40 : 0;
8230 diagram.attr('viewBox', box.startx - conf.diagramMarginX + ' -' + (conf.diagramMarginY + extraVertForTitle) + ' ' + width + ' ' + (height + extraVertForTitle));
8231};
8232
8233exports.default = {
8234 bounds: bounds,
8235 drawActors: drawActors,
8236 setConf: setConf,
8237 draw: draw
8238};
8239
8240/***/ }),
8241
8242/***/ "./src/diagrams/sequence/svgDraw.js":
8243/*!******************************************!*\
8244 !*** ./src/diagrams/sequence/svgDraw.js ***!
8245 \******************************************/
8246/*! no static exports found */
8247/***/ (function(module, exports, __webpack_require__) {
8248
8249"use strict";
8250
8251
8252Object.defineProperty(exports, "__esModule", {
8253 value: true
8254});
8255var drawRect = exports.drawRect = function drawRect(elem, rectData) {
8256 var rectElem = elem.append('rect');
8257 rectElem.attr('x', rectData.x);
8258 rectElem.attr('y', rectData.y);
8259 rectElem.attr('fill', rectData.fill);
8260 rectElem.attr('stroke', rectData.stroke);
8261 rectElem.attr('width', rectData.width);
8262 rectElem.attr('height', rectData.height);
8263 rectElem.attr('rx', rectData.rx);
8264 rectElem.attr('ry', rectData.ry);
8265
8266 if (typeof rectData.class !== 'undefined') {
8267 rectElem.attr('class', rectData.class);
8268 }
8269
8270 return rectElem;
8271};
8272
8273var drawText = exports.drawText = function drawText(elem, textData, width) {
8274 // Remove and ignore br:s
8275 var nText = textData.text.replace(/<br\/?>/ig, ' ');
8276
8277 var textElem = elem.append('text');
8278 textElem.attr('x', textData.x);
8279 textElem.attr('y', textData.y);
8280 textElem.style('text-anchor', textData.anchor);
8281 textElem.attr('fill', textData.fill);
8282 if (typeof textData.class !== 'undefined') {
8283 textElem.attr('class', textData.class);
8284 }
8285
8286 var span = textElem.append('tspan');
8287 span.attr('x', textData.x + textData.textMargin * 2);
8288 span.attr('fill', textData.fill);
8289 span.text(nText);
8290
8291 return textElem;
8292};
8293
8294var drawLabel = exports.drawLabel = function drawLabel(elem, txtObject) {
8295 function genPoints(x, y, width, height, cut) {
8296 return x + ',' + y + ' ' + (x + width) + ',' + y + ' ' + (x + width) + ',' + (y + height - cut) + ' ' + (x + width - cut * 1.2) + ',' + (y + height) + ' ' + x + ',' + (y + height);
8297 }
8298 var polygon = elem.append('polygon');
8299 polygon.attr('points', genPoints(txtObject.x, txtObject.y, 50, 20, 7));
8300 polygon.attr('class', 'labelBox');
8301
8302 txtObject.y = txtObject.y + txtObject.labelMargin;
8303 txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;
8304 drawText(elem, txtObject);
8305};
8306
8307var actorCnt = -1;
8308/**
8309 * Draws an actor in the diagram with the attaced line
8310 * @param center - The center of the the actor
8311 * @param pos The position if the actor in the liost of actors
8312 * @param description The text in the box
8313 */
8314var drawActor = exports.drawActor = function drawActor(elem, left, verticalPos, description, conf) {
8315 var center = left + conf.width / 2;
8316 var g = elem.append('g');
8317 if (verticalPos === 0) {
8318 actorCnt++;
8319 g.append('line').attr('id', 'actor' + actorCnt).attr('x1', center).attr('y1', 5).attr('x2', center).attr('y2', 2000).attr('class', 'actor-line').attr('stroke-width', '0.5px').attr('stroke', '#999');
8320 }
8321
8322 var rect = getNoteRect();
8323 rect.x = left;
8324 rect.y = verticalPos;
8325 rect.fill = '#eaeaea';
8326 rect.width = conf.width;
8327 rect.height = conf.height;
8328 rect.class = 'actor';
8329 rect.rx = 3;
8330 rect.ry = 3;
8331 drawRect(g, rect);
8332
8333 _drawTextCandidateFunc(conf)(description, g, rect.x, rect.y, rect.width, rect.height, { 'class': 'actor' });
8334};
8335
8336var anchorElement = exports.anchorElement = function anchorElement(elem) {
8337 return elem.append('g');
8338};
8339/**
8340 * Draws an actor in the diagram with the attaced line
8341 * @param elem - element to append activation rect
8342 * @param bounds - activation box bounds
8343 * @param verticalPos - precise y cooridnate of bottom activation box edge
8344 */
8345var drawActivation = exports.drawActivation = function drawActivation(elem, bounds, verticalPos) {
8346 var rect = getNoteRect();
8347 var g = bounds.anchored;
8348 rect.x = bounds.startx;
8349 rect.y = bounds.starty;
8350 rect.fill = '#f4f4f4';
8351 rect.width = bounds.stopx - bounds.startx;
8352 rect.height = verticalPos - bounds.starty;
8353 drawRect(g, rect);
8354};
8355
8356/**
8357 * Draws an actor in the diagram with the attaced line
8358 * @param center - The center of the the actor
8359 * @param pos The position if the actor in the list of actors
8360 * @param description The text in the box
8361 */
8362var drawLoop = exports.drawLoop = function drawLoop(elem, bounds, labelText, conf) {
8363 var g = elem.append('g');
8364 var drawLoopLine = function drawLoopLine(startx, starty, stopx, stopy) {
8365 return g.append('line').attr('x1', startx).attr('y1', starty).attr('x2', stopx).attr('y2', stopy).attr('class', 'loopLine');
8366 };
8367 drawLoopLine(bounds.startx, bounds.starty, bounds.stopx, bounds.starty);
8368 drawLoopLine(bounds.stopx, bounds.starty, bounds.stopx, bounds.stopy);
8369 drawLoopLine(bounds.startx, bounds.stopy, bounds.stopx, bounds.stopy);
8370 drawLoopLine(bounds.startx, bounds.starty, bounds.startx, bounds.stopy);
8371 if (typeof bounds.sections !== 'undefined') {
8372 bounds.sections.forEach(function (item) {
8373 drawLoopLine(bounds.startx, item, bounds.stopx, item).style('stroke-dasharray', '3, 3');
8374 });
8375 }
8376
8377 var txt = getTextObj();
8378 txt.text = labelText;
8379 txt.x = bounds.startx;
8380 txt.y = bounds.starty;
8381 txt.labelMargin = 1.5 * 10; // This is the small box that says "loop"
8382 txt.class = 'labelText'; // Its size & position are fixed.
8383
8384 drawLabel(g, txt);
8385
8386 txt = getTextObj();
8387 txt.text = '[ ' + bounds.title + ' ]';
8388 txt.x = bounds.startx + (bounds.stopx - bounds.startx) / 2;
8389 txt.y = bounds.starty + 1.5 * conf.boxMargin;
8390 txt.anchor = 'middle';
8391 txt.class = 'loopText';
8392
8393 drawText(g, txt);
8394
8395 if (typeof bounds.sectionTitles !== 'undefined') {
8396 bounds.sectionTitles.forEach(function (item, idx) {
8397 if (item !== '') {
8398 txt.text = '[ ' + item + ' ]';
8399 txt.y = bounds.sections[idx] + 1.5 * conf.boxMargin;
8400 drawText(g, txt);
8401 }
8402 });
8403 }
8404};
8405
8406/**
8407 * Setup arrow head and define the marker. The result is appended to the svg.
8408 */
8409var insertArrowHead = exports.insertArrowHead = function insertArrowHead(elem) {
8410 elem.append('defs').append('marker').attr('id', 'arrowhead').attr('refX', 5).attr('refY', 2).attr('markerWidth', 6).attr('markerHeight', 4).attr('orient', 'auto').append('path').attr('d', 'M 0,0 V 4 L6,2 Z'); // this is actual shape for arrowhead
8411};
8412/**
8413 * Setup arrow head and define the marker. The result is appended to the svg.
8414 */
8415var insertArrowCrossHead = exports.insertArrowCrossHead = function insertArrowCrossHead(elem) {
8416 var defs = elem.append('defs');
8417 var marker = defs.append('marker').attr('id', 'crosshead').attr('markerWidth', 15).attr('markerHeight', 8).attr('orient', 'auto').attr('refX', 16).attr('refY', 4);
8418
8419 // The arrow
8420 marker.append('path').attr('fill', 'black').attr('stroke', '#000000').style('stroke-dasharray', '0, 0').attr('stroke-width', '1px').attr('d', 'M 9,2 V 6 L16,4 Z');
8421
8422 // The cross
8423 marker.append('path').attr('fill', 'none').attr('stroke', '#000000').style('stroke-dasharray', '0, 0').attr('stroke-width', '1px').attr('d', 'M 0,1 L 6,7 M 6,1 L 0,7');
8424 // this is actual shape for arrowhead
8425};
8426
8427var getTextObj = exports.getTextObj = function getTextObj() {
8428 var txt = {
8429 x: 0,
8430 y: 0,
8431 'fill': 'black',
8432 'text-anchor': 'start',
8433 style: '#666',
8434 width: 100,
8435 height: 100,
8436 textMargin: 0,
8437 rx: 0,
8438 ry: 0
8439 };
8440 return txt;
8441};
8442
8443var getNoteRect = exports.getNoteRect = function getNoteRect() {
8444 var rect = {
8445 x: 0,
8446 y: 0,
8447 fill: '#EDF2AE',
8448 stroke: '#666',
8449 width: 100,
8450 anchor: 'start',
8451 height: 100,
8452 rx: 0,
8453 ry: 0
8454 };
8455 return rect;
8456};
8457
8458var _drawTextCandidateFunc = function () {
8459 function byText(content, g, x, y, width, height, textAttrs) {
8460 var text = g.append('text').attr('x', x + width / 2).attr('y', y + height / 2 + 5).style('text-anchor', 'middle').text(content);
8461 _setTextAttrs(text, textAttrs);
8462 }
8463
8464 function byTspan(content, g, x, y, width, height, textAttrs) {
8465 var text = g.append('text').attr('x', x + width / 2).attr('y', y).style('text-anchor', 'middle');
8466 text.append('tspan').attr('x', x + width / 2).attr('dy', '0').text(content);
8467
8468 text.attr('y', y + height / 2.0).attr('dominant-baseline', 'central').attr('alignment-baseline', 'central');
8469
8470 _setTextAttrs(text, textAttrs);
8471 }
8472
8473 function byFo(content, g, x, y, width, height, textAttrs) {
8474 var s = g.append('switch');
8475 var f = s.append('foreignObject').attr('x', x).attr('y', y).attr('width', width).attr('height', height);
8476
8477 var text = f.append('div').style('display', 'table').style('height', '100%').style('width', '100%');
8478
8479 text.append('div').style('display', 'table-cell').style('text-align', 'center').style('vertical-align', 'middle').text(content);
8480
8481 byTspan(content, s, x, y, width, height, textAttrs);
8482 _setTextAttrs(text, textAttrs);
8483 }
8484
8485 function _setTextAttrs(toText, fromTextAttrsDict) {
8486 for (var key in fromTextAttrsDict) {
8487 if (fromTextAttrsDict.hasOwnProperty(key)) {
8488 toText.attr(key, fromTextAttrsDict[key]);
8489 }
8490 }
8491 }
8492
8493 return function (conf) {
8494 return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan;
8495 };
8496}();
8497
8498exports.default = {
8499 drawRect: drawRect,
8500 drawText: drawText,
8501 drawLabel: drawLabel,
8502 drawActor: drawActor,
8503 anchorElement: anchorElement,
8504 drawActivation: drawActivation,
8505 drawLoop: drawLoop,
8506 insertArrowHead: insertArrowHead,
8507 insertArrowCrossHead: insertArrowCrossHead,
8508 getTextObj: getTextObj,
8509 getNoteRect: getNoteRect
8510};
8511
8512/***/ }),
8513
8514/***/ "./src/logger.js":
8515/*!***********************!*\
8516 !*** ./src/logger.js ***!
8517 \***********************/
8518/*! no static exports found */
8519/***/ (function(module, exports, __webpack_require__) {
8520
8521"use strict";
8522
8523
8524Object.defineProperty(exports, "__esModule", {
8525 value: true
8526});
8527exports.setLogLevel = exports.logger = exports.LEVELS = undefined;
8528
8529var _moment = __webpack_require__(/*! moment */ "moment");
8530
8531var _moment2 = _interopRequireDefault(_moment);
8532
8533function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8534
8535var LEVELS = exports.LEVELS = {
8536 debug: 1,
8537 info: 2,
8538 warn: 3,
8539 error: 4,
8540 fatal: 5
8541};
8542
8543var logger = exports.logger = {
8544 debug: function debug() {},
8545 info: function info() {},
8546 warn: function warn() {},
8547 error: function error() {},
8548 fatal: function fatal() {}
8549};
8550
8551var setLogLevel = exports.setLogLevel = function setLogLevel(level) {
8552 logger.debug = function () {};
8553 logger.info = function () {};
8554 logger.warn = function () {};
8555 logger.error = function () {};
8556 logger.fatal = function () {};
8557 if (level <= LEVELS.fatal) {
8558 logger.fatal = console.log.bind(console, '\x1b[35m', format('FATAL'));
8559 }
8560 if (level <= LEVELS.error) {
8561 logger.error = console.log.bind(console, '\x1b[31m', format('ERROR'));
8562 }
8563 if (level <= LEVELS.warn) {
8564 logger.warn = console.log.bind(console, '\x1B[33m', format('WARN'));
8565 }
8566 if (level <= LEVELS.info) {
8567 logger.info = console.log.bind(console, '\x1b[34m', format('INFO'));
8568 }
8569 if (level <= LEVELS.debug) {
8570 logger.debug = console.log.bind(console, '\x1b[32m', format('DEBUG'));
8571 }
8572};
8573
8574var format = function format(level) {
8575 var time = (0, _moment2.default)().format('HH:mm:ss.SSS');
8576 return time + ' : ' + level + ' : ';
8577};
8578
8579/***/ }),
8580
8581/***/ "./src/mermaid.js":
8582/*!************************!*\
8583 !*** ./src/mermaid.js ***!
8584 \************************/
8585/*! no static exports found */
8586/***/ (function(module, exports, __webpack_require__) {
8587
8588"use strict";
8589
8590
8591Object.defineProperty(exports, "__esModule", {
8592 value: true
8593});
8594
8595var _he = __webpack_require__(/*! he */ "he");
8596
8597var _he2 = _interopRequireDefault(_he);
8598
8599var _mermaidAPI = __webpack_require__(/*! ./mermaidAPI */ "./src/mermaidAPI.js");
8600
8601var _mermaidAPI2 = _interopRequireDefault(_mermaidAPI);
8602
8603var _logger = __webpack_require__(/*! ./logger */ "./src/logger.js");
8604
8605function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8606
8607/**
8608 * ## init
8609 * Function that goes through the document to find the chart definitions in there and render them.
8610 *
8611 * The function tags the processed attributes with the attribute data-processed and ignores found elements with the
8612 * attribute already set. This way the init function can be triggered several times.
8613 *
8614 * Optionally, `init` can accept in the second argument one of the following:
8615 * - a DOM Node
8616 * - an array of DOM nodes (as would come from a jQuery selector)
8617 * - a W3C selector, a la `.mermaid`
8618 *
8619 * ```mermaid
8620 * graph LR;
8621 * a(Find elements)-->b{Processed}
8622 * b-->|Yes|c(Leave element)
8623 * b-->|No |d(Transform)
8624 * ```
8625 * Renders the mermaid diagrams
8626 * @param nodes a css selector or an array of nodes
8627 */
8628var init = function init() {
8629 var conf = _mermaidAPI2.default.getConfig();
8630 _logger.logger.debug('Starting rendering diagrams');
8631 var nodes = void 0;
8632 if (arguments.length >= 2) {
8633 /*! sequence config was passed as #1 */
8634 if (typeof arguments[0] !== 'undefined') {
8635 mermaid.sequenceConfig = arguments[0];
8636 }
8637
8638 nodes = arguments[1];
8639 } else {
8640 nodes = arguments[0];
8641 }
8642
8643 // if last argument is a function this is the callback function
8644 var callback = void 0;
8645 if (typeof arguments[arguments.length - 1] === 'function') {
8646 callback = arguments[arguments.length - 1];
8647 _logger.logger.debug('Callback function found');
8648 } else {
8649 if (typeof conf.mermaid !== 'undefined') {
8650 if (typeof conf.mermaid.callback === 'function') {
8651 callback = conf.mermaid.callback;
8652 _logger.logger.debug('Callback function found');
8653 } else {
8654 _logger.logger.debug('No Callback function found');
8655 }
8656 }
8657 }
8658 nodes = nodes === undefined ? document.querySelectorAll('.mermaid') : typeof nodes === 'string' ? document.querySelectorAll(nodes) : nodes instanceof window.Node ? [nodes] : nodes; // Last case - sequence config was passed pick next
8659
8660 _logger.logger.debug('Start On Load before: ' + mermaid.startOnLoad);
8661 if (typeof mermaid.startOnLoad !== 'undefined') {
8662 _logger.logger.debug('Start On Load inner: ' + mermaid.startOnLoad);
8663 _mermaidAPI2.default.initialize({ startOnLoad: mermaid.startOnLoad });
8664 }
8665
8666 if (typeof mermaid.ganttConfig !== 'undefined') {
8667 _mermaidAPI2.default.initialize({ gantt: mermaid.ganttConfig });
8668 }
8669
8670 var txt = void 0;
8671
8672 var _loop = function _loop(i) {
8673 var element = nodes[i];
8674
8675 /*! Check if previously processed */
8676 if (!element.getAttribute('data-processed')) {
8677 element.setAttribute('data-processed', true);
8678 } else {
8679 return 'continue';
8680 }
8681
8682 var id = 'mermaid-' + Date.now();
8683
8684 // Fetch the graph definition including tags
8685 txt = element.innerHTML;
8686
8687 // transforms the html to pure text
8688 txt = _he2.default.decode(txt).trim().replace(/<br>/ig, '<br/>');
8689
8690 _mermaidAPI2.default.render(id, txt, function (svgCode, bindFunctions) {
8691 element.innerHTML = svgCode;
8692 if (typeof callback !== 'undefined') {
8693 callback(id);
8694 }
8695 bindFunctions(element);
8696 }, element);
8697 };
8698
8699 for (var i = 0; i < nodes.length; i++) {
8700 var _ret = _loop(i);
8701
8702 if (_ret === 'continue') continue;
8703 }
8704}; /**
8705 * Web page integration module for the mermaid framework. It uses the mermaidAPI for mermaid functionality and to render
8706 * the diagrams to svg code.
8707 */
8708
8709
8710var initialize = function initialize(config) {
8711 _logger.logger.debug('Initializing mermaid');
8712 if (typeof config.mermaid !== 'undefined') {
8713 if (typeof config.mermaid.startOnLoad !== 'undefined') {
8714 mermaid.startOnLoad = config.mermaid.startOnLoad;
8715 }
8716 if (typeof config.mermaid.htmlLabels !== 'undefined') {
8717 mermaid.htmlLabels = config.mermaid.htmlLabels;
8718 }
8719 }
8720 _mermaidAPI2.default.initialize(config);
8721};
8722
8723/**
8724 * ##contentLoaded
8725 * Callback function that is called when page is loaded. This functions fetches configuration for mermaid rendering and
8726 * calls init for rendering the mermaid diagrams on the page.
8727 */
8728var contentLoaded = function contentLoaded() {
8729 var config = void 0;
8730
8731 if (mermaid.startOnLoad) {
8732 // No config found, do check API config
8733 config = _mermaidAPI2.default.getConfig();
8734 if (config.startOnLoad) {
8735 mermaid.init();
8736 }
8737 } else {
8738 if (typeof mermaid.startOnLoad === 'undefined') {
8739 _logger.logger.debug('In start, no config');
8740 config = _mermaidAPI2.default.getConfig();
8741 if (config.startOnLoad) {
8742 mermaid.init();
8743 }
8744 }
8745 }
8746};
8747
8748if (typeof document !== 'undefined') {
8749 /*!
8750 * Wait for document loaded before starting the execution
8751 */
8752 window.addEventListener('load', function () {
8753 contentLoaded();
8754 }, false);
8755}
8756
8757var mermaid = {
8758 startOnLoad: true,
8759 htmlLabels: true,
8760
8761 mermaidAPI: _mermaidAPI2.default,
8762 parse: _mermaidAPI2.default.parse,
8763 render: _mermaidAPI2.default.render,
8764
8765 init: init,
8766 initialize: initialize,
8767
8768 contentLoaded: contentLoaded
8769};
8770
8771exports.default = mermaid;
8772
8773/***/ }),
8774
8775/***/ "./src/mermaidAPI.js":
8776/*!***************************!*\
8777 !*** ./src/mermaidAPI.js ***!
8778 \***************************/
8779/*! no static exports found */
8780/***/ (function(module, exports, __webpack_require__) {
8781
8782"use strict";
8783
8784
8785Object.defineProperty(exports, "__esModule", {
8786 value: true
8787});
8788exports.decodeEntities = exports.encodeEntities = undefined;
8789
8790var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /**
8791 * ---
8792 * title: mermaidAPI
8793 * order: 5
8794 * ---
8795 * # mermaidAPI
8796 * This is the api to be used when handling the integration with the web page instead of using the default integration
8797 * (mermaid.js).
8798 *
8799 * The core of this api is the **render** function that given a graph definitionas text renders the graph/diagram and
8800 * returns a svg element for the graph. It is is then up to the user of the API to make use of the svg, either insert it
8801 * somewhere in the page or something completely different.
8802 */
8803
8804
8805var _d = __webpack_require__(/*! d3 */ "d3");
8806
8807var d3 = _interopRequireWildcard(_d);
8808
8809var _scopeCss = __webpack_require__(/*! scope-css */ "scope-css");
8810
8811var _scopeCss2 = _interopRequireDefault(_scopeCss);
8812
8813var _logger = __webpack_require__(/*! ./logger */ "./src/logger.js");
8814
8815var _utils = __webpack_require__(/*! ./utils */ "./src/utils.js");
8816
8817var _utils2 = _interopRequireDefault(_utils);
8818
8819var _flowRenderer = __webpack_require__(/*! ./diagrams/flowchart/flowRenderer */ "./src/diagrams/flowchart/flowRenderer.js");
8820
8821var _flowRenderer2 = _interopRequireDefault(_flowRenderer);
8822
8823var _flow = __webpack_require__(/*! ./diagrams/flowchart/parser/flow */ "./src/diagrams/flowchart/parser/flow.js");
8824
8825var _flow2 = _interopRequireDefault(_flow);
8826
8827var _flowDb = __webpack_require__(/*! ./diagrams/flowchart/flowDb */ "./src/diagrams/flowchart/flowDb.js");
8828
8829var _flowDb2 = _interopRequireDefault(_flowDb);
8830
8831var _sequenceRenderer = __webpack_require__(/*! ./diagrams/sequence/sequenceRenderer */ "./src/diagrams/sequence/sequenceRenderer.js");
8832
8833var _sequenceRenderer2 = _interopRequireDefault(_sequenceRenderer);
8834
8835var _sequenceDiagram = __webpack_require__(/*! ./diagrams/sequence/parser/sequenceDiagram */ "./src/diagrams/sequence/parser/sequenceDiagram.js");
8836
8837var _sequenceDiagram2 = _interopRequireDefault(_sequenceDiagram);
8838
8839var _sequenceDb = __webpack_require__(/*! ./diagrams/sequence/sequenceDb */ "./src/diagrams/sequence/sequenceDb.js");
8840
8841var _sequenceDb2 = _interopRequireDefault(_sequenceDb);
8842
8843var _ganttRenderer = __webpack_require__(/*! ./diagrams/gantt/ganttRenderer */ "./src/diagrams/gantt/ganttRenderer.js");
8844
8845var _ganttRenderer2 = _interopRequireDefault(_ganttRenderer);
8846
8847var _gantt = __webpack_require__(/*! ./diagrams/gantt/parser/gantt */ "./src/diagrams/gantt/parser/gantt.js");
8848
8849var _gantt2 = _interopRequireDefault(_gantt);
8850
8851var _ganttDb = __webpack_require__(/*! ./diagrams/gantt/ganttDb */ "./src/diagrams/gantt/ganttDb.js");
8852
8853var _ganttDb2 = _interopRequireDefault(_ganttDb);
8854
8855var _classRenderer = __webpack_require__(/*! ./diagrams/class/classRenderer */ "./src/diagrams/class/classRenderer.js");
8856
8857var _classRenderer2 = _interopRequireDefault(_classRenderer);
8858
8859var _classDiagram = __webpack_require__(/*! ./diagrams/class/parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.js");
8860
8861var _classDiagram2 = _interopRequireDefault(_classDiagram);
8862
8863var _classDb = __webpack_require__(/*! ./diagrams/class/classDb */ "./src/diagrams/class/classDb.js");
8864
8865var _classDb2 = _interopRequireDefault(_classDb);
8866
8867var _gitGraphRenderer = __webpack_require__(/*! ./diagrams/git/gitGraphRenderer */ "./src/diagrams/git/gitGraphRenderer.js");
8868
8869var _gitGraphRenderer2 = _interopRequireDefault(_gitGraphRenderer);
8870
8871var _gitGraph = __webpack_require__(/*! ./diagrams/git/parser/gitGraph */ "./src/diagrams/git/parser/gitGraph.js");
8872
8873var _gitGraph2 = _interopRequireDefault(_gitGraph);
8874
8875var _gitGraphAst = __webpack_require__(/*! ./diagrams/git/gitGraphAst */ "./src/diagrams/git/gitGraphAst.js");
8876
8877var _gitGraphAst2 = _interopRequireDefault(_gitGraphAst);
8878
8879function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8880
8881function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
8882
8883var themes = {};
8884var _arr = ['default', 'forest', 'dark', 'neutral'];
8885for (var _i = 0; _i < _arr.length; _i++) {
8886 var themeName = _arr[_i];
8887 themes[themeName] = __webpack_require__("./src/themes sync recursive ^\\.\\/.*\\/index\\.scss$")("./" + themeName + '/index.scss');
8888}
8889
8890/**
8891 * ## Configuration
8892 * These are the default options which can be overridden with the initialization call as in the example below:
8893 * ```
8894 * mermaid.initialize({
8895 * flowchart:{
8896 * htmlLabels: false
8897 * }
8898 * });
8899 * ```
8900 */
8901var config = {
8902 theme: 'default',
8903 themeCSS: undefined,
8904
8905 /**
8906 * logLevel , decides the amount of logging to be used.
8907 * * debug: 1
8908 * * info: 2
8909 * * warn: 3
8910 * * error: 4
8911 * * fatal: 5
8912 */
8913 logLevel: 5,
8914
8915 /**
8916 * **startOnLoad** - This options controls whether or mermaid starts when the page loads
8917 */
8918 startOnLoad: true,
8919
8920 /**
8921 * **arrowMarkerAbsolute** - This options controls whether or arrow markers in html code will be absolute paths or
8922 * an anchor, #. This matters if you are using base tag settings.
8923 */
8924 arrowMarkerAbsolute: false,
8925
8926 /**
8927 * ### flowchart
8928 * *The object containing configurations specific for flowcharts*
8929 */
8930 flowchart: {
8931 /**
8932 * **htmlLabels** - Flag for setting whether or not a html tag should be used for rendering labels
8933 * on the edges
8934 */
8935 htmlLabels: true,
8936 /**
8937 * **useMaxWidth** - Flag for setting whether or not a all available width should be used for
8938 * the diagram.
8939 */
8940 useMaxWidth: true,
8941
8942 curve: 'linear'
8943 },
8944
8945 /**
8946 * ### sequenceDiagram
8947 * The object containing configurations specific for sequence diagrams
8948 */
8949 sequence: {
8950
8951 /**
8952 * **diagramMarginX** - margin to the right and left of the sequence diagram
8953 */
8954 diagramMarginX: 50,
8955
8956 /**
8957 * **diagramMarginY** - margin to the over and under the sequence diagram
8958 */
8959 diagramMarginY: 10,
8960
8961 /**
8962 * **actorMargin** - Margin between actors
8963 */
8964 actorMargin: 50,
8965
8966 /**
8967 * **width** - Width of actor boxes
8968 */
8969 width: 150,
8970
8971 /**
8972 * **height** - Height of actor boxes
8973 */
8974 height: 65,
8975
8976 /**
8977 * **boxMargin** - Margin around loop boxes
8978 */
8979 boxMargin: 10,
8980
8981 /**
8982 * **boxTextMargin** - margin around the text in loop/alt/opt boxes
8983 */
8984 boxTextMargin: 5,
8985
8986 /**
8987 * **noteMargin** - margin around notes
8988 */
8989 noteMargin: 10,
8990
8991 /**
8992 * **messageMargin** - Space between messages
8993 */
8994 messageMargin: 35,
8995
8996 /**
8997 * **mirrorActors** - mirror actors under diagram
8998 */
8999 mirrorActors: true,
9000
9001 /**
9002 * **bottomMarginAdj** - Depending on css styling this might need adjustment.
9003 * Prolongs the edge of the diagram downwards
9004 */
9005 bottomMarginAdj: 1,
9006
9007 /**
9008 * **useMaxWidth** - when this flag is set the height and width is set to 100% and is then scaling with the
9009 * available space if not the absolute space required is used
9010 */
9011 useMaxWidth: true
9012 },
9013
9014 /** ### gantt
9015 * The object containing configurations specific for gantt diagrams*
9016 */
9017 gantt: {
9018 /**
9019 * **titleTopMargin** - margin top for the text over the gantt diagram
9020 */
9021 titleTopMargin: 25,
9022
9023 /**
9024 * **barHeight** - the height of the bars in the graph
9025 */
9026 barHeight: 20,
9027
9028 /**
9029 * **barGap** - the margin between the different activities in the gantt diagram
9030 */
9031 barGap: 4,
9032
9033 /**
9034 * **topPadding** - margin between title and gantt diagram and between axis and gantt diagram.
9035 */
9036 topPadding: 50,
9037
9038 /**
9039 * **leftPadding** - the space allocated for the section name to the left of the activities.
9040 */
9041 leftPadding: 75,
9042
9043 /**
9044 * **gridLineStartPadding** - Vertical starting position of the grid lines
9045 */
9046 gridLineStartPadding: 35,
9047
9048 /**
9049 * **fontSize** - font size ...
9050 */
9051 fontSize: 11,
9052
9053 /**
9054 * **fontFamily** - font family ...
9055 */
9056 fontFamily: '"Open-Sans", "sans-serif"',
9057
9058 /**
9059 * **numberSectionStyles** - the number of alternating section styles
9060 */
9061 numberSectionStyles: 4,
9062
9063 /**
9064 * **axisFormat** - datetime format of the axis, this might need adjustment to match your locale and preferences
9065 */
9066 axisFormat: '%Y-%m-%d'
9067 },
9068 class: {},
9069 git: {}
9070};
9071
9072(0, _logger.setLogLevel)(config.logLevel);
9073
9074function parse(text) {
9075 var graphType = _utils2.default.detectType(text);
9076 var parser = void 0;
9077
9078 switch (graphType) {
9079 case 'git':
9080 parser = _gitGraph2.default;
9081 parser.parser.yy = _gitGraphAst2.default;
9082 break;
9083 case 'flowchart':
9084 parser = _flow2.default;
9085 parser.parser.yy = _flowDb2.default;
9086 break;
9087 case 'sequence':
9088 parser = _sequenceDiagram2.default;
9089 parser.parser.yy = _sequenceDb2.default;
9090 break;
9091 case 'gantt':
9092 parser = _gantt2.default;
9093 parser.parser.yy = _ganttDb2.default;
9094 break;
9095 case 'class':
9096 parser = _classDiagram2.default;
9097 parser.parser.yy = _classDb2.default;
9098 break;
9099 }
9100
9101 parser.parser.yy.parseError = function (str, hash) {
9102 var error = { str: str, hash: hash };
9103 throw error;
9104 };
9105
9106 parser.parse(text);
9107}
9108
9109var encodeEntities = exports.encodeEntities = function encodeEntities(text) {
9110 var txt = text;
9111
9112 txt = txt.replace(/style.*:\S*#.*;/g, function (s) {
9113 var innerTxt = s.substring(0, s.length - 1);
9114 return innerTxt;
9115 });
9116 txt = txt.replace(/classDef.*:\S*#.*;/g, function (s) {
9117 var innerTxt = s.substring(0, s.length - 1);
9118 return innerTxt;
9119 });
9120
9121 txt = txt.replace(/#\w+;/g, function (s) {
9122 var innerTxt = s.substring(1, s.length - 1);
9123
9124 var isInt = /^\+?\d+$/.test(innerTxt);
9125 if (isInt) {
9126 return 'fl°°' + innerTxt + '¶ß';
9127 } else {
9128 return 'fl°' + innerTxt + '¶ß';
9129 }
9130 });
9131
9132 return txt;
9133};
9134
9135var decodeEntities = exports.decodeEntities = function decodeEntities(text) {
9136 var txt = text;
9137
9138 txt = txt.replace(/fl°°/g, function () {
9139 return '&#';
9140 });
9141 txt = txt.replace(/fl°/g, function () {
9142 return '&';
9143 });
9144 txt = txt.replace(/¶ß/g, function () {
9145 return ';';
9146 });
9147
9148 return txt;
9149};
9150/**
9151 * ##render
9152 * Function that renders an svg with a graph from a chart definition. Usage example below.
9153 *
9154 * ```
9155 * mermaidAPI.initialize({
9156 * startOnLoad:true
9157 * });
9158 * $(function(){
9159 * const graphDefinition = 'graph TB\na-->b';
9160 * const cb = function(svgGraph){
9161 * console.log(svgGraph);
9162 * };
9163 * mermaidAPI.render('id1',graphDefinition,cb);
9164 * });
9165 *```
9166 * @param id the id of the element to be rendered
9167 * @param txt the graph definition
9168 * @param cb callback which is called after rendering is finished with the svg code as inparam.
9169 * @param container selector to element in which a div with the graph temporarily will be inserted. In one is
9170 * provided a hidden div will be inserted in the body of the page instead. The element will be removed when rendering is
9171 * completed.
9172 */
9173var render = function render(id, txt, cb, container) {
9174 if (typeof container !== 'undefined') {
9175 container.innerHTML = '';
9176
9177 d3.select(container).append('div').attr('id', 'd' + id).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g');
9178 } else {
9179 var _element = document.querySelector('#' + 'd' + id);
9180 if (_element) {
9181 _element.innerHTML = '';
9182 }
9183
9184 d3.select('body').append('div').attr('id', 'd' + id).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g');
9185 }
9186
9187 window.txt = txt;
9188 txt = encodeEntities(txt);
9189
9190 var element = d3.select('#d' + id).node();
9191 var graphType = _utils2.default.detectType(txt);
9192
9193 // insert inline style into svg
9194 var svg = element.firstChild;
9195 var firstChild = svg.firstChild;
9196
9197 // pre-defined theme
9198 var style = themes[config.theme];
9199 if (style === undefined) {
9200 style = '';
9201 }
9202
9203 // user provided theme CSS
9204 if (config.themeCSS !== undefined) {
9205 style += '\n' + config.themeCSS;
9206 }
9207
9208 // classDef
9209 if (graphType === 'flowchart') {
9210 var classes = _flowRenderer2.default.getClasses(txt);
9211 for (var className in classes) {
9212 style += '\n.' + className + ' > * { ' + classes[className].styles.join(' !important; ') + ' !important; }';
9213 }
9214 }
9215
9216 var style1 = document.createElement('style');
9217 style1.innerHTML = (0, _scopeCss2.default)(style, '#' + id);
9218 svg.insertBefore(style1, firstChild);
9219
9220 var style2 = document.createElement('style');
9221 var cs = window.getComputedStyle(svg);
9222 style2.innerHTML = '#' + id + ' {\n color: ' + cs.color + ';\n font: ' + cs.font + ';\n }';
9223 svg.insertBefore(style2, firstChild);
9224
9225 switch (graphType) {
9226 case 'git':
9227 config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
9228 _gitGraphRenderer2.default.setConf(config.git);
9229 _gitGraphRenderer2.default.draw(txt, id, false);
9230 break;
9231 case 'flowchart':
9232 config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
9233 _flowRenderer2.default.setConf(config.flowchart);
9234 _flowRenderer2.default.draw(txt, id, false);
9235 break;
9236 case 'sequence':
9237 config.sequence.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
9238 if (config.sequenceDiagram) {
9239 // backwards compatibility
9240 _sequenceRenderer2.default.setConf(Object.assign(config.sequence, config.sequenceDiagram));
9241 console.error('`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.');
9242 } else {
9243 _sequenceRenderer2.default.setConf(config.sequence);
9244 }
9245 _sequenceRenderer2.default.draw(txt, id);
9246 break;
9247 case 'gantt':
9248 config.gantt.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
9249 _ganttRenderer2.default.setConf(config.gantt);
9250 _ganttRenderer2.default.draw(txt, id);
9251 break;
9252 case 'class':
9253 config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
9254 _classRenderer2.default.setConf(config.class);
9255 _classRenderer2.default.draw(txt, id);
9256 break;
9257 }
9258
9259 d3.select('[id="' + id + '"]').selectAll('foreignobject > *').attr('xmlns', 'http://www.w3.org/1999/xhtml');
9260
9261 var url = '';
9262 if (config.arrowMarkerAbsolute) {
9263 url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
9264 url = url.replace(/\(/g, '\\(');
9265 url = url.replace(/\)/g, '\\)');
9266 }
9267
9268 // Fix for when the base tag is used
9269 var svgCode = d3.select('#d' + id).node().innerHTML.replace(/url\(#arrowhead/g, 'url(' + url + '#arrowhead', 'g');
9270
9271 svgCode = decodeEntities(svgCode);
9272
9273 if (typeof cb !== 'undefined') {
9274 cb(svgCode, _flowDb2.default.bindFunctions);
9275 } else {
9276 _logger.logger.warn('CB = undefined!');
9277 }
9278
9279 var node = d3.select('#d' + id).node();
9280 if (node !== null && typeof node.remove === 'function') {
9281 d3.select('#d' + id).node().remove();
9282 }
9283
9284 return svgCode;
9285};
9286
9287var setConf = function setConf(cnf) {
9288 // Top level initially mermaid, gflow, sequenceDiagram and gantt
9289 var lvl1Keys = Object.keys(cnf);
9290 for (var i = 0; i < lvl1Keys.length; i++) {
9291 if (_typeof(cnf[lvl1Keys[i]]) === 'object' && cnf[lvl1Keys[i]] != null) {
9292 var lvl2Keys = Object.keys(cnf[lvl1Keys[i]]);
9293
9294 for (var j = 0; j < lvl2Keys.length; j++) {
9295 _logger.logger.debug('Setting conf ', lvl1Keys[i], '-', lvl2Keys[j]);
9296 if (typeof config[lvl1Keys[i]] === 'undefined') {
9297 config[lvl1Keys[i]] = {};
9298 }
9299 _logger.logger.debug('Setting config: ' + lvl1Keys[i] + ' ' + lvl2Keys[j] + ' to ' + cnf[lvl1Keys[i]][lvl2Keys[j]]);
9300 config[lvl1Keys[i]][lvl2Keys[j]] = cnf[lvl1Keys[i]][lvl2Keys[j]];
9301 }
9302 } else {
9303 config[lvl1Keys[i]] = cnf[lvl1Keys[i]];
9304 }
9305 }
9306};
9307
9308function initialize(options) {
9309 _logger.logger.debug('Initializing mermaidAPI');
9310 // Update default config with options supplied at initialization
9311 if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {
9312 setConf(options);
9313 }
9314 (0, _logger.setLogLevel)(config.logLevel);
9315}
9316
9317function getConfig() {
9318 return config;
9319}
9320
9321var mermaidAPI = {
9322 render: render,
9323 parse: parse,
9324 initialize: initialize,
9325 getConfig: getConfig
9326};
9327
9328exports.default = mermaidAPI;
9329
9330/***/ }),
9331
9332/***/ "./src/themes sync recursive ^\\.\\/.*\\/index\\.scss$":
9333/*!***********************************************!*\
9334 !*** ./src/themes sync ^\.\/.*\/index\.scss$ ***!
9335 \***********************************************/
9336/*! no static exports found */
9337/***/ (function(module, exports, __webpack_require__) {
9338
9339var map = {
9340 "./dark/index.scss": "./src/themes/dark/index.scss",
9341 "./default/index.scss": "./src/themes/default/index.scss",
9342 "./forest/index.scss": "./src/themes/forest/index.scss",
9343 "./neutral/index.scss": "./src/themes/neutral/index.scss"
9344};
9345
9346
9347function webpackContext(req) {
9348 var id = webpackContextResolve(req);
9349 var module = __webpack_require__(id);
9350 return module;
9351}
9352function webpackContextResolve(req) {
9353 var id = map[req];
9354 if(!(id + 1)) { // check for number or string
9355 var e = new Error('Cannot find module "' + req + '".');
9356 e.code = 'MODULE_NOT_FOUND';
9357 throw e;
9358 }
9359 return id;
9360}
9361webpackContext.keys = function webpackContextKeys() {
9362 return Object.keys(map);
9363};
9364webpackContext.resolve = webpackContextResolve;
9365module.exports = webpackContext;
9366webpackContext.id = "./src/themes sync recursive ^\\.\\/.*\\/index\\.scss$";
9367
9368/***/ }),
9369
9370/***/ "./src/themes/dark/index.scss":
9371/*!************************************!*\
9372 !*** ./src/themes/dark/index.scss ***!
9373 \************************************/
9374/*! no static exports found */
9375/***/ (function(module, exports, __webpack_require__) {
9376
9377// css-to-string-loader: transforms styles from css-loader to a string output
9378
9379// Get the styles
9380var styles = __webpack_require__(/*! !../../../node_modules/css-loader!../../../node_modules/sass-loader/lib/loader.js!./index.scss */ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/themes/dark/index.scss");
9381
9382if (typeof styles === 'string') {
9383 // Return an existing string
9384 module.exports = styles;
9385} else {
9386 // Call the custom toString method from css-loader module
9387 module.exports = styles.toString();
9388}
9389
9390/***/ }),
9391
9392/***/ "./src/themes/default/index.scss":
9393/*!***************************************!*\
9394 !*** ./src/themes/default/index.scss ***!
9395 \***************************************/
9396/*! no static exports found */
9397/***/ (function(module, exports, __webpack_require__) {
9398
9399// css-to-string-loader: transforms styles from css-loader to a string output
9400
9401// Get the styles
9402var styles = __webpack_require__(/*! !../../../node_modules/css-loader!../../../node_modules/sass-loader/lib/loader.js!./index.scss */ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/themes/default/index.scss");
9403
9404if (typeof styles === 'string') {
9405 // Return an existing string
9406 module.exports = styles;
9407} else {
9408 // Call the custom toString method from css-loader module
9409 module.exports = styles.toString();
9410}
9411
9412/***/ }),
9413
9414/***/ "./src/themes/forest/index.scss":
9415/*!**************************************!*\
9416 !*** ./src/themes/forest/index.scss ***!
9417 \**************************************/
9418/*! no static exports found */
9419/***/ (function(module, exports, __webpack_require__) {
9420
9421// css-to-string-loader: transforms styles from css-loader to a string output
9422
9423// Get the styles
9424var styles = __webpack_require__(/*! !../../../node_modules/css-loader!../../../node_modules/sass-loader/lib/loader.js!./index.scss */ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/themes/forest/index.scss");
9425
9426if (typeof styles === 'string') {
9427 // Return an existing string
9428 module.exports = styles;
9429} else {
9430 // Call the custom toString method from css-loader module
9431 module.exports = styles.toString();
9432}
9433
9434/***/ }),
9435
9436/***/ "./src/themes/neutral/index.scss":
9437/*!***************************************!*\
9438 !*** ./src/themes/neutral/index.scss ***!
9439 \***************************************/
9440/*! no static exports found */
9441/***/ (function(module, exports, __webpack_require__) {
9442
9443// css-to-string-loader: transforms styles from css-loader to a string output
9444
9445// Get the styles
9446var styles = __webpack_require__(/*! !../../../node_modules/css-loader!../../../node_modules/sass-loader/lib/loader.js!./index.scss */ "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/themes/neutral/index.scss");
9447
9448if (typeof styles === 'string') {
9449 // Return an existing string
9450 module.exports = styles;
9451} else {
9452 // Call the custom toString method from css-loader module
9453 module.exports = styles.toString();
9454}
9455
9456/***/ }),
9457
9458/***/ "./src/utils.js":
9459/*!**********************!*\
9460 !*** ./src/utils.js ***!
9461 \**********************/
9462/*! no static exports found */
9463/***/ (function(module, exports, __webpack_require__) {
9464
9465"use strict";
9466
9467
9468Object.defineProperty(exports, "__esModule", {
9469 value: true
9470});
9471exports.interpolateToCurve = exports.isSubstringInArray = exports.detectType = undefined;
9472
9473var _d = __webpack_require__(/*! d3 */ "d3");
9474
9475var d3 = _interopRequireWildcard(_d);
9476
9477function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
9478
9479/**
9480 * @function detectType
9481 * Detects the type of the graph text.
9482 * ```mermaid
9483 * graph LR
9484 * a-->b
9485 * b-->c
9486 * c-->d
9487 * d-->e
9488 * e-->f
9489 * f-->g
9490 * g-->h
9491 * ```
9492 *
9493 * @param {string} text The text defining the graph
9494 * @returns {string} A graph definition key
9495 */
9496var detectType = exports.detectType = function detectType(text) {
9497 text = text.replace(/^\s*%%.*\n/g, '\n');
9498 if (text.match(/^\s*sequenceDiagram/)) {
9499 return 'sequence';
9500 }
9501
9502 if (text.match(/^\s*gantt/)) {
9503 return 'gantt';
9504 }
9505
9506 if (text.match(/^\s*classDiagram/)) {
9507 return 'class';
9508 }
9509
9510 if (text.match(/^\s*gitGraph/)) {
9511 return 'git';
9512 }
9513 return 'flowchart';
9514};
9515
9516/**
9517 * @function isSubstringInArray
9518 * Detects whether a substring in present in a given array
9519 * @param {string} str The substring to detect
9520 * @param {array} arr The array to search
9521 * @returns {number} the array index containing the substring or -1 if not present
9522 **/
9523var isSubstringInArray = exports.isSubstringInArray = function isSubstringInArray(str, arr) {
9524 for (var i = 0; i < arr.length; i++) {
9525 if (arr[i].match(str)) return i;
9526 }
9527 return -1;
9528};
9529
9530var interpolateToCurve = exports.interpolateToCurve = function interpolateToCurve(interpolate, defaultCurve) {
9531 if (!interpolate) {
9532 return defaultCurve;
9533 }
9534 var curveName = 'curve' + (interpolate.charAt(0).toUpperCase() + interpolate.slice(1));
9535 return d3[curveName] || defaultCurve;
9536};
9537
9538exports.default = {
9539 detectType: detectType,
9540 isSubstringInArray: isSubstringInArray,
9541 interpolateToCurve: interpolateToCurve
9542};
9543
9544/***/ }),
9545
9546/***/ "d3":
9547/*!*********************!*\
9548 !*** external "d3" ***!
9549 \*********************/
9550/*! no static exports found */
9551/***/ (function(module, exports) {
9552
9553module.exports = require("d3");
9554
9555/***/ }),
9556
9557/***/ "dagre-d3-renderer":
9558/*!************************************!*\
9559 !*** external "dagre-d3-renderer" ***!
9560 \************************************/
9561/*! no static exports found */
9562/***/ (function(module, exports) {
9563
9564module.exports = require("dagre-d3-renderer");
9565
9566/***/ }),
9567
9568/***/ "dagre-layout":
9569/*!*******************************!*\
9570 !*** external "dagre-layout" ***!
9571 \*******************************/
9572/*! no static exports found */
9573/***/ (function(module, exports) {
9574
9575module.exports = require("dagre-layout");
9576
9577/***/ }),
9578
9579/***/ "graphlibrary":
9580/*!*******************************!*\
9581 !*** external "graphlibrary" ***!
9582 \*******************************/
9583/*! no static exports found */
9584/***/ (function(module, exports) {
9585
9586module.exports = require("graphlibrary");
9587
9588/***/ }),
9589
9590/***/ "he":
9591/*!*********************!*\
9592 !*** external "he" ***!
9593 \*********************/
9594/*! no static exports found */
9595/***/ (function(module, exports) {
9596
9597module.exports = require("he");
9598
9599/***/ }),
9600
9601/***/ "lodash":
9602/*!*************************!*\
9603 !*** external "lodash" ***!
9604 \*************************/
9605/*! no static exports found */
9606/***/ (function(module, exports) {
9607
9608module.exports = require("lodash");
9609
9610/***/ }),
9611
9612/***/ "moment":
9613/*!*************************!*\
9614 !*** external "moment" ***!
9615 \*************************/
9616/*! no static exports found */
9617/***/ (function(module, exports) {
9618
9619module.exports = require("moment");
9620
9621/***/ }),
9622
9623/***/ "scope-css":
9624/*!****************************!*\
9625 !*** external "scope-css" ***!
9626 \****************************/
9627/*! no static exports found */
9628/***/ (function(module, exports) {
9629
9630module.exports = require("scope-css");
9631
9632/***/ })
9633
9634/******/ })["default"];
9635});
9636//# sourceMappingURL=mermaid.core.js.map
\No newline at end of file