diff --git a/dist/mermaid.js b/dist/mermaid.js index 8b25ccb11..8e315ec28 100644 --- a/dist/mermaid.js +++ b/dist/mermaid.js @@ -1,322 +1,6 @@ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.mermaid=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0 - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift('..'); - } - } - - return parts; -} - -// Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; -var splitPath = function(filename) { - return splitPathRe.exec(filename).slice(1); -}; - -// path.resolve([from ...], to) -// posix version -exports.resolve = function() { - var resolvedPath = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) ? arguments[i] : process.cwd(); - - // Skip empty and invalid entries - if (typeof path !== 'string') { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - continue; - } - - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; - } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path - resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { - return !!p; - }), !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; -}; - -// path.normalize(path) -// posix version -exports.normalize = function(path) { - var isAbsolute = exports.isAbsolute(path), - trailingSlash = substr(path, -1) === '/'; - - // Normalize the path - path = normalizeArray(filter(path.split('/'), function(p) { - return !!p; - }), !isAbsolute).join('/'); - - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - - return (isAbsolute ? '/' : '') + path; -}; - -// posix version -exports.isAbsolute = function(path) { - return path.charAt(0) === '/'; -}; - -// posix version -exports.join = function() { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(filter(paths, function(p, index) { - if (typeof p !== 'string') { - throw new TypeError('Arguments to path.join must be strings'); - } - return p; - }).join('/')); -}; - - -// path.relative(from, to) -// posix version -exports.relative = function(from, to) { - from = exports.resolve(from).substr(1); - to = exports.resolve(to).substr(1); - - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') break; - } - - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') break; - } - - if (start > end) return []; - return arr.slice(start, end - start + 1); - } - - var fromParts = trim(from.split('/')); - var toParts = trim(to.split('/')); - - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('/'); -}; - -exports.sep = '/'; -exports.delimiter = ':'; - -exports.dirname = function(path) { - var result = splitPath(path), - root = result[0], - dir = result[1]; - - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } - - return root + dir; -}; - - -exports.basename = function(path, ext) { - var f = splitPath(path)[2]; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -exports.extname = function(path) { - return splitPath(path)[3]; -}; - -function filter (xs, f) { - if (xs.filter) return xs.filter(f); - var res = []; - for (var i = 0; i < xs.length; i++) { - if (f(xs[i], i, xs)) res.push(xs[i]); - } - return res; -} - -// String.prototype.substr - negative index don't work in IE8 -var substr = 'ab'.substr(-1) === 'b' - ? function (str, start, len) { return str.substr(start, len) } - : function (str, start, len) { - if (start < 0) start = str.length + start; - return str.substr(start, len); - } -; - -}).call(this,require('_process')) -},{"_process":3}],3:[function(require,module,exports){ -// shim for using process in browser - -var process = module.exports = {}; - -process.nextTick = (function () { - var canSetImmediate = typeof window !== 'undefined' - && window.setImmediate; - var canMutationObserver = typeof window !== 'undefined' - && window.MutationObserver; - var canPost = typeof window !== 'undefined' - && window.postMessage && window.addEventListener - ; - - if (canSetImmediate) { - return function (f) { return window.setImmediate(f) }; - } - - var queue = []; - - if (canMutationObserver) { - var hiddenDiv = document.createElement("div"); - var observer = new MutationObserver(function () { - var queueList = queue.slice(); - queue.length = 0; - queueList.forEach(function (fn) { - fn(); - }); - }); - - observer.observe(hiddenDiv, { attributes: true }); - - return function nextTick(fn) { - if (!queue.length) { - hiddenDiv.setAttribute('yes', 'no'); - } - queue.push(fn); - }; - } - - if (canPost) { - window.addEventListener('message', function (ev) { - var source = ev.source; - if ((source === window || source === null) && ev.data === 'process-tick') { - ev.stopPropagation(); - if (queue.length > 0) { - var fn = queue.shift(); - fn(); - } - } - }, true); - - return function nextTick(fn) { - queue.push(fn); - window.postMessage('process-tick', '*'); - }; - } - - return function nextTick(fn) { - setTimeout(fn, 0); - }; -})(); - -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -// TODO(shtylman) -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; - -},{}],4:[function(require,module,exports){ !function() { var d3 = { version: "3.5.6" @@ -9821,7 +9505,7 @@ process.chdir = function (dir) { if (typeof define === "function" && define.amd) define(d3); else if (typeof module === "object" && module.exports) module.exports = d3; this.d3 = d3; }(); -},{}],5:[function(require,module,exports){ +},{}],3:[function(require,module,exports){ /** * @license * Copyright (c) 2012-2013 Chris Pettitt @@ -9853,7 +9537,7 @@ module.exports = { version: require("./lib/version") }; -},{"./lib/dagre":12,"./lib/graphlib":13,"./lib/intersect":14,"./lib/render":29,"./lib/util":31,"./lib/version":32}],6:[function(require,module,exports){ +},{"./lib/dagre":10,"./lib/graphlib":11,"./lib/intersect":12,"./lib/render":27,"./lib/util":29,"./lib/version":30}],4:[function(require,module,exports){ var util = require("./util"); module.exports = { @@ -9917,7 +9601,7 @@ function undirected(parent, id, edge, type) { util.applyStyle(path, edge[type + "Style"]); } -},{"./util":31}],7:[function(require,module,exports){ +},{"./util":29}],5:[function(require,module,exports){ var util = require("./util"), addLabel = require("./label/add-label"); @@ -9962,7 +9646,7 @@ function createClusters(selection, g) { return svgClusters; } -},{"./label/add-label":22,"./util":31}],8:[function(require,module,exports){ +},{"./label/add-label":20,"./util":29}],6:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -9999,7 +9683,7 @@ function createEdgeLabels(selection, g) { return svgEdgeLabels; } -},{"./d3":11,"./label/add-label":22,"./lodash":25,"./util":31}],9:[function(require,module,exports){ +},{"./d3":9,"./label/add-label":20,"./lodash":23,"./util":29}],7:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -10131,7 +9815,7 @@ function exit(svgPaths, g) { }); } -},{"./d3":11,"./intersect/intersect-node":18,"./lodash":25,"./util":31}],10:[function(require,module,exports){ +},{"./d3":9,"./intersect/intersect-node":16,"./lodash":23,"./util":29}],8:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -10191,11 +9875,11 @@ function createNodes(selection, g, shapes) { return svgNodes; } -},{"./d3":11,"./label/add-label":22,"./lodash":25,"./util":31}],11:[function(require,module,exports){ +},{"./d3":9,"./label/add-label":20,"./lodash":23,"./util":29}],9:[function(require,module,exports){ // Stub to get D3 either via NPM or from the global object module.exports = window.d3; -},{}],12:[function(require,module,exports){ +},{}],10:[function(require,module,exports){ /* global window */ var dagre; @@ -10212,7 +9896,7 @@ if (!dagre) { module.exports = dagre; -},{"dagre":54}],13:[function(require,module,exports){ +},{"dagre":31}],11:[function(require,module,exports){ /* global window */ var graphlib; @@ -10229,7 +9913,7 @@ if (!graphlib) { module.exports = graphlib; -},{"graphlib":33}],14:[function(require,module,exports){ +},{"graphlib":61}],12:[function(require,module,exports){ module.exports = { node: require("./intersect-node"), circle: require("./intersect-circle"), @@ -10238,7 +9922,7 @@ module.exports = { rect: require("./intersect-rect") }; -},{"./intersect-circle":15,"./intersect-ellipse":16,"./intersect-node":18,"./intersect-polygon":19,"./intersect-rect":20}],15:[function(require,module,exports){ +},{"./intersect-circle":13,"./intersect-ellipse":14,"./intersect-node":16,"./intersect-polygon":17,"./intersect-rect":18}],13:[function(require,module,exports){ var intersectEllipse = require("./intersect-ellipse"); module.exports = intersectCircle; @@ -10247,7 +9931,7 @@ function intersectCircle(node, rx, point) { return intersectEllipse(node, rx, rx, point); } -},{"./intersect-ellipse":16}],16:[function(require,module,exports){ +},{"./intersect-ellipse":14}],14:[function(require,module,exports){ module.exports = intersectEllipse; function intersectEllipse(node, rx, ry, point) { @@ -10274,7 +9958,7 @@ function intersectEllipse(node, rx, ry, point) { } -},{}],17:[function(require,module,exports){ +},{}],15:[function(require,module,exports){ module.exports = intersectLine; /* @@ -10346,14 +10030,14 @@ function sameSign(r1, r2) { return r1 * r2 > 0; } -},{}],18:[function(require,module,exports){ +},{}],16:[function(require,module,exports){ module.exports = intersectNode; function intersectNode(node, point) { return node.intersect(point); } -},{}],19:[function(require,module,exports){ +},{}],17:[function(require,module,exports){ var intersectLine = require("./intersect-line"); module.exports = intersectPolygon; @@ -10410,7 +10094,7 @@ function intersectPolygon(node, polyPoints, point) { return intersections[0]; } -},{"./intersect-line":17}],20:[function(require,module,exports){ +},{"./intersect-line":15}],18:[function(require,module,exports){ module.exports = intersectRect; function intersectRect(node, point) { @@ -10444,7 +10128,7 @@ function intersectRect(node, point) { return {x: x + sx, y: y + sy}; } -},{}],21:[function(require,module,exports){ +},{}],19:[function(require,module,exports){ var util = require("../util"); module.exports = addHtmlLabel; @@ -10489,7 +10173,7 @@ function addHtmlLabel(root, node) { return fo; } -},{"../util":31}],22:[function(require,module,exports){ +},{"../util":29}],20:[function(require,module,exports){ var addTextLabel = require("./add-text-label"), addHtmlLabel = require("./add-html-label"), addSVGLabel = require("./add-svg-label"); @@ -10528,7 +10212,7 @@ function addLabel(root, node, location) { return labelSvg; } -},{"./add-html-label":21,"./add-svg-label":23,"./add-text-label":24}],23:[function(require,module,exports){ +},{"./add-html-label":19,"./add-svg-label":21,"./add-text-label":22}],21:[function(require,module,exports){ var util = require("../util"); module.exports = addSVGLabel; @@ -10543,7 +10227,7 @@ function addSVGLabel(root, node) { return domNode; } -},{"../util":31}],24:[function(require,module,exports){ +},{"../util":29}],22:[function(require,module,exports){ var util = require("../util"); module.exports = addTextLabel; @@ -10590,7 +10274,7 @@ function processEscapeSequences(text) { return newText; } -},{"../util":31}],25:[function(require,module,exports){ +},{"../util":29}],23:[function(require,module,exports){ /* global window */ var lodash; @@ -10607,7 +10291,7 @@ if (!lodash) { module.exports = lodash; -},{"lodash":53}],26:[function(require,module,exports){ +},{"lodash":82}],24:[function(require,module,exports){ "use strict"; var util = require("./util"), @@ -10643,7 +10327,7 @@ function positionClusters(selection, g) { } -},{"./d3":11,"./util":31}],27:[function(require,module,exports){ +},{"./d3":9,"./util":29}],25:[function(require,module,exports){ "use strict"; var util = require("./util"), @@ -10667,7 +10351,7 @@ function positionEdgeLabels(selection, g) { .attr("transform", translate); } -},{"./d3":11,"./lodash":25,"./util":31}],28:[function(require,module,exports){ +},{"./d3":9,"./lodash":23,"./util":29}],26:[function(require,module,exports){ "use strict"; var util = require("./util"), @@ -10690,7 +10374,7 @@ function positionNodes(selection, g) { .attr("transform", translate); } -},{"./d3":11,"./util":31}],29:[function(require,module,exports){ +},{"./d3":9,"./util":29}],27:[function(require,module,exports){ var _ = require("./lodash"), layout = require("./dagre").layout; @@ -10859,7 +10543,7 @@ function createOrSelectGroup(root, name) { return selection; } -},{"./arrows":6,"./create-clusters":7,"./create-edge-labels":8,"./create-edge-paths":9,"./create-nodes":10,"./dagre":12,"./lodash":25,"./position-clusters":26,"./position-edge-labels":27,"./position-nodes":28,"./shapes":30}],30:[function(require,module,exports){ +},{"./arrows":4,"./create-clusters":5,"./create-edge-labels":6,"./create-edge-paths":7,"./create-nodes":8,"./dagre":10,"./lodash":23,"./position-clusters":24,"./position-edge-labels":25,"./position-nodes":26,"./shapes":28}],28:[function(require,module,exports){ "use strict"; var intersectRect = require("./intersect/intersect-rect"), @@ -10942,7 +10626,7 @@ function diamond(parent, bbox, node) { return shapeSvg; } -},{"./intersect/intersect-circle":15,"./intersect/intersect-ellipse":16,"./intersect/intersect-polygon":19,"./intersect/intersect-rect":20}],31:[function(require,module,exports){ +},{"./intersect/intersect-circle":13,"./intersect/intersect-ellipse":14,"./intersect/intersect-polygon":17,"./intersect/intersect-rect":18}],29:[function(require,module,exports){ var _ = require("./lodash"); // Public utility functions @@ -10998,10 +10682,2912 @@ function applyTransition(selection, g) { return selection; } -},{"./lodash":25}],32:[function(require,module,exports){ +},{"./lodash":23}],30:[function(require,module,exports){ module.exports = "0.4.10"; -},{}],33:[function(require,module,exports){ +},{}],31:[function(require,module,exports){ +/* +Copyright (c) 2012-2014 Chris Pettitt + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +module.exports = { + graphlib: require("./lib/graphlib"), + + layout: require("./lib/layout"), + debug: require("./lib/debug"), + util: { + time: require("./lib/util").time, + notime: require("./lib/util").notime + }, + version: require("./lib/version") +}; + +},{"./lib/debug":36,"./lib/graphlib":37,"./lib/layout":39,"./lib/util":59,"./lib/version":60}],32:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"), + greedyFAS = require("./greedy-fas"); + +module.exports = { + run: run, + undo: undo +}; + +function run(g) { + var fas = (g.graph().acyclicer === "greedy" + ? greedyFAS(g, weightFn(g)) + : dfsFAS(g)); + _.each(fas, function(e) { + var label = g.edge(e); + g.removeEdge(e); + label.forwardName = e.name; + label.reversed = true; + g.setEdge(e.w, e.v, label, _.uniqueId("rev")); + }); + + function weightFn(g) { + return function(e) { + return g.edge(e).weight; + }; + } +} + +function dfsFAS(g) { + var fas = [], + stack = {}, + visited = {}; + + function dfs(v) { + if (_.has(visited, v)) { + return; + } + visited[v] = true; + stack[v] = true; + _.each(g.outEdges(v), function(e) { + if (_.has(stack, e.w)) { + fas.push(e); + } else { + dfs(e.w); + } + }); + delete stack[v]; + } + + _.each(g.nodes(), dfs); + return fas; +} + +function undo(g) { + _.each(g.edges(), function(e) { + var label = g.edge(e); + if (label.reversed) { + g.removeEdge(e); + + var forwardName = label.forwardName; + delete label.reversed; + delete label.forwardName; + g.setEdge(e.w, e.v, label, forwardName); + } + }); +} + +},{"./greedy-fas":38,"./lodash":40}],33:[function(require,module,exports){ +var _ = require("./lodash"), + util = require("./util"); + +module.exports = addBorderSegments; + +function addBorderSegments(g) { + function dfs(v) { + var children = g.children(v), + node = g.node(v); + if (children.length) { + _.each(children, dfs); + } + + if (_.has(node, "minRank")) { + node.borderLeft = []; + node.borderRight = []; + for (var rank = node.minRank, maxRank = node.maxRank + 1; + rank < maxRank; + ++rank) { + addBorderNode(g, "borderLeft", "_bl", v, node, rank); + addBorderNode(g, "borderRight", "_br", v, node, rank); + } + } + } + + _.each(g.children(), dfs); +} + +function addBorderNode(g, prop, prefix, sg, sgNode, rank) { + var label = { width: 0, height: 0, rank: rank, borderType: prop }, + prev = sgNode[prop][rank - 1], + curr = util.addDummyNode(g, "border", label, prefix); + sgNode[prop][rank] = curr; + g.setParent(curr, sg); + if (prev) { + g.setEdge(prev, curr, { weight: 1 }); + } +} + +},{"./lodash":40,"./util":59}],34:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"); + +module.exports = { + adjust: adjust, + undo: undo +}; + +function adjust(g) { + var rankDir = g.graph().rankdir.toLowerCase(); + if (rankDir === "lr" || rankDir === "rl") { + swapWidthHeight(g); + } +} + +function undo(g) { + var rankDir = g.graph().rankdir.toLowerCase(); + if (rankDir === "bt" || rankDir === "rl") { + reverseY(g); + } + + if (rankDir === "lr" || rankDir === "rl") { + swapXY(g); + swapWidthHeight(g); + } +} + +function swapWidthHeight(g) { + _.each(g.nodes(), function(v) { swapWidthHeightOne(g.node(v)); }); + _.each(g.edges(), function(e) { swapWidthHeightOne(g.edge(e)); }); +} + +function swapWidthHeightOne(attrs) { + var w = attrs.width; + attrs.width = attrs.height; + attrs.height = w; +} + +function reverseY(g) { + _.each(g.nodes(), function(v) { reverseYOne(g.node(v)); }); + + _.each(g.edges(), function(e) { + var edge = g.edge(e); + _.each(edge.points, reverseYOne); + if (_.has(edge, "y")) { + reverseYOne(edge); + } + }); +} + +function reverseYOne(attrs) { + attrs.y = -attrs.y; +} + +function swapXY(g) { + _.each(g.nodes(), function(v) { swapXYOne(g.node(v)); }); + + _.each(g.edges(), function(e) { + var edge = g.edge(e); + _.each(edge.points, swapXYOne); + if (_.has(edge, "x")) { + swapXYOne(edge); + } + }); +} + +function swapXYOne(attrs) { + var x = attrs.x; + attrs.x = attrs.y; + attrs.y = x; +} + +},{"./lodash":40}],35:[function(require,module,exports){ +/* + * Simple doubly linked list implementation derived from Cormen, et al., + * "Introduction to Algorithms". + */ + +module.exports = List; + +function List() { + var sentinel = {}; + sentinel._next = sentinel._prev = sentinel; + this._sentinel = sentinel; +} + +List.prototype.dequeue = function() { + var sentinel = this._sentinel, + entry = sentinel._prev; + if (entry !== sentinel) { + unlink(entry); + return entry; + } +}; + +List.prototype.enqueue = function(entry) { + var sentinel = this._sentinel; + if (entry._prev && entry._next) { + unlink(entry); + } + entry._next = sentinel._next; + sentinel._next._prev = entry; + sentinel._next = entry; + entry._prev = sentinel; +}; + +List.prototype.toString = function() { + var strs = [], + sentinel = this._sentinel, + curr = sentinel._prev; + while (curr !== sentinel) { + strs.push(JSON.stringify(curr, filterOutLinks)); + curr = curr._prev; + } + return "[" + strs.join(", ") + "]"; +}; + +function unlink(entry) { + entry._prev._next = entry._next; + entry._next._prev = entry._prev; + delete entry._next; + delete entry._prev; +} + +function filterOutLinks(k, v) { + if (k !== "_next" && k !== "_prev") { + return v; + } +} + +},{}],36:[function(require,module,exports){ +var _ = require("./lodash"), + util = require("./util"), + Graph = require("./graphlib").Graph; + +module.exports = { + debugOrdering: debugOrdering +}; + +/* istanbul ignore next */ +function debugOrdering(g) { + var layerMatrix = util.buildLayerMatrix(g); + + var h = new Graph({ compound: true, multigraph: true }).setGraph({}); + + _.each(g.nodes(), function(v) { + h.setNode(v, { label: v }); + h.setParent(v, "layer" + g.node(v).rank); + }); + + _.each(g.edges(), function(e) { + h.setEdge(e.v, e.w, {}, e.name); + }); + + _.each(layerMatrix, function(layer, i) { + var layerV = "layer" + i; + h.setNode(layerV, { rank: "same" }); + _.reduce(layer, function(u, v) { + h.setEdge(u, v, { style: "invis" }); + return v; + }); + }); + + return h; +} + +},{"./graphlib":37,"./lodash":40,"./util":59}],37:[function(require,module,exports){ +/* global window */ + +var graphlib; + +if (typeof require === "function") { + try { + graphlib = require("graphlib"); + } catch (e) {} +} + +if (!graphlib) { + graphlib = window.graphlib; +} + +module.exports = graphlib; + +},{"graphlib":61}],38:[function(require,module,exports){ +var _ = require("./lodash"), + Graph = require("./graphlib").Graph, + List = require("./data/list"); + +/* + * A greedy heuristic for finding a feedback arc set for a graph. A feedback + * arc set is a set of edges that can be removed to make a graph acyclic. + * The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, "A fast and + * effective heuristic for the feedback arc set problem." This implementation + * adjusts that from the paper to allow for weighted edges. + */ +module.exports = greedyFAS; + +var DEFAULT_WEIGHT_FN = _.constant(1); + +function greedyFAS(g, weightFn) { + if (g.nodeCount() <= 1) { + return []; + } + var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN); + var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx); + + // Expand multi-edges + return _.flatten(_.map(results, function(e) { + return g.outEdges(e.v, e.w); + }), true); +} + +function doGreedyFAS(g, buckets, zeroIdx) { + var results = [], + sources = buckets[buckets.length - 1], + sinks = buckets[0]; + + var entry; + while (g.nodeCount()) { + while ((entry = sinks.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } + while ((entry = sources.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } + if (g.nodeCount()) { + for (var i = buckets.length - 2; i > 0; --i) { + entry = buckets[i].dequeue(); + if (entry) { + results = results.concat(removeNode(g, buckets, zeroIdx, entry, true)); + break; + } + } + } + } + + return results; +} + +function removeNode(g, buckets, zeroIdx, entry, collectPredecessors) { + var results = collectPredecessors ? [] : undefined; + + _.each(g.inEdges(entry.v), function(edge) { + var weight = g.edge(edge), + uEntry = g.node(edge.v); + + if (collectPredecessors) { + results.push({ v: edge.v, w: edge.w }); + } + + uEntry.out -= weight; + assignBucket(buckets, zeroIdx, uEntry); + }); + + _.each(g.outEdges(entry.v), function(edge) { + var weight = g.edge(edge), + w = edge.w, + wEntry = g.node(w); + wEntry["in"] -= weight; + assignBucket(buckets, zeroIdx, wEntry); + }); + + g.removeNode(entry.v); + + return results; +} + +function buildState(g, weightFn) { + var fasGraph = new Graph(), + maxIn = 0, + maxOut = 0; + + _.each(g.nodes(), function(v) { + fasGraph.setNode(v, { v: v, "in": 0, out: 0 }); + }); + + // Aggregate weights on nodes, but also sum the weights across multi-edges + // into a single edge for the fasGraph. + _.each(g.edges(), function(e) { + var prevWeight = fasGraph.edge(e.v, e.w) || 0, + weight = weightFn(e), + edgeWeight = prevWeight + weight; + fasGraph.setEdge(e.v, e.w, edgeWeight); + maxOut = Math.max(maxOut, fasGraph.node(e.v).out += weight); + maxIn = Math.max(maxIn, fasGraph.node(e.w)["in"] += weight); + }); + + var buckets = _.range(maxOut + maxIn + 3).map(function() { return new List(); }); + var zeroIdx = maxIn + 1; + + _.each(fasGraph.nodes(), function(v) { + assignBucket(buckets, zeroIdx, fasGraph.node(v)); + }); + + return { graph: fasGraph, buckets: buckets, zeroIdx: zeroIdx }; +} + +function assignBucket(buckets, zeroIdx, entry) { + if (!entry.out) { + buckets[0].enqueue(entry); + } else if (!entry["in"]) { + buckets[buckets.length - 1].enqueue(entry); + } else { + buckets[entry.out - entry["in"] + zeroIdx].enqueue(entry); + } +} + +},{"./data/list":35,"./graphlib":37,"./lodash":40}],39:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"), + acyclic = require("./acyclic"), + normalize = require("./normalize"), + rank = require("./rank"), + normalizeRanks = require("./util").normalizeRanks, + parentDummyChains = require("./parent-dummy-chains"), + removeEmptyRanks = require("./util").removeEmptyRanks, + nestingGraph = require("./nesting-graph"), + addBorderSegments = require("./add-border-segments"), + coordinateSystem = require("./coordinate-system"), + order = require("./order"), + position = require("./position"), + util = require("./util"), + Graph = require("./graphlib").Graph; + +module.exports = layout; + +function layout(g, opts) { + var time = opts && opts.debugTiming ? util.time : util.notime; + time("layout", function() { + var layoutGraph = time(" buildLayoutGraph", + function() { return buildLayoutGraph(g); }); + time(" runLayout", function() { runLayout(layoutGraph, time); }); + time(" updateInputGraph", function() { updateInputGraph(g, layoutGraph); }); + }); +} + +function runLayout(g, time) { + time(" makeSpaceForEdgeLabels", function() { makeSpaceForEdgeLabels(g); }); + time(" removeSelfEdges", function() { removeSelfEdges(g); }); + time(" acyclic", function() { acyclic.run(g); }); + time(" nestingGraph.run", function() { nestingGraph.run(g); }); + time(" rank", function() { rank(util.asNonCompoundGraph(g)); }); + time(" injectEdgeLabelProxies", function() { injectEdgeLabelProxies(g); }); + time(" removeEmptyRanks", function() { removeEmptyRanks(g); }); + time(" nestingGraph.cleanup", function() { nestingGraph.cleanup(g); }); + time(" normalizeRanks", function() { normalizeRanks(g); }); + time(" assignRankMinMax", function() { assignRankMinMax(g); }); + time(" removeEdgeLabelProxies", function() { removeEdgeLabelProxies(g); }); + time(" normalize.run", function() { normalize.run(g); }); + time(" parentDummyChains", function() { parentDummyChains(g); }); + time(" addBorderSegments", function() { addBorderSegments(g); }); + time(" order", function() { order(g); }); + time(" insertSelfEdges", function() { insertSelfEdges(g); }); + time(" adjustCoordinateSystem", function() { coordinateSystem.adjust(g); }); + time(" position", function() { position(g); }); + time(" positionSelfEdges", function() { positionSelfEdges(g); }); + time(" removeBorderNodes", function() { removeBorderNodes(g); }); + time(" normalize.undo", function() { normalize.undo(g); }); + time(" fixupEdgeLabelCoords", function() { fixupEdgeLabelCoords(g); }); + time(" undoCoordinateSystem", function() { coordinateSystem.undo(g); }); + time(" translateGraph", function() { translateGraph(g); }); + time(" assignNodeIntersects", function() { assignNodeIntersects(g); }); + time(" reversePoints", function() { reversePointsForReversedEdges(g); }); + time(" acyclic.undo", function() { acyclic.undo(g); }); +} + +/* + * Copies final layout information from the layout graph back to the input + * graph. This process only copies whitelisted attributes from the layout graph + * to the input graph, so it serves as a good place to determine what + * attributes can influence layout. + */ +function updateInputGraph(inputGraph, layoutGraph) { + _.each(inputGraph.nodes(), function(v) { + var inputLabel = inputGraph.node(v), + layoutLabel = layoutGraph.node(v); + + if (inputLabel) { + inputLabel.x = layoutLabel.x; + inputLabel.y = layoutLabel.y; + + if (layoutGraph.children(v).length) { + inputLabel.width = layoutLabel.width; + inputLabel.height = layoutLabel.height; + } + } + }); + + _.each(inputGraph.edges(), function(e) { + var inputLabel = inputGraph.edge(e), + layoutLabel = layoutGraph.edge(e); + + inputLabel.points = layoutLabel.points; + if (_.has(layoutLabel, "x")) { + inputLabel.x = layoutLabel.x; + inputLabel.y = layoutLabel.y; + } + }); + + inputGraph.graph().width = layoutGraph.graph().width; + inputGraph.graph().height = layoutGraph.graph().height; +} + +var graphNumAttrs = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], + graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, + graphAttrs = ["acyclicer", "ranker", "rankdir", "align"], + nodeNumAttrs = ["width", "height"], + nodeDefaults = { width: 0, height: 0 }, + edgeNumAttrs = ["minlen", "weight", "width", "height", "labeloffset"], + edgeDefaults = { + minlen: 1, weight: 1, width: 0, height: 0, + labeloffset: 10, labelpos: "r" + }, + edgeAttrs = ["labelpos"]; + +/* + * Constructs a new graph from the input graph, which can be used for layout. + * This process copies only whitelisted attributes from the input graph to the + * layout graph. Thus this function serves as a good place to determine what + * attributes can influence layout. + */ +function buildLayoutGraph(inputGraph) { + var g = new Graph({ multigraph: true, compound: true }), + graph = canonicalize(inputGraph.graph()); + + g.setGraph(_.merge({}, + graphDefaults, + selectNumberAttrs(graph, graphNumAttrs), + _.pick(graph, graphAttrs))); + + _.each(inputGraph.nodes(), function(v) { + var node = canonicalize(inputGraph.node(v)); + g.setNode(v, _.defaults(selectNumberAttrs(node, nodeNumAttrs), nodeDefaults)); + g.setParent(v, inputGraph.parent(v)); + }); + + _.each(inputGraph.edges(), function(e) { + var edge = canonicalize(inputGraph.edge(e)); + g.setEdge(e, _.merge({}, + edgeDefaults, + selectNumberAttrs(edge, edgeNumAttrs), + _.pick(edge, edgeAttrs))); + }); + + return g; +} + +/* + * This idea comes from the Gansner paper: to account for edge labels in our + * layout we split each rank in half by doubling minlen and halving ranksep. + * Then we can place labels at these mid-points between nodes. + * + * We also add some minimal padding to the width to push the label for the edge + * away from the edge itself a bit. + */ +function makeSpaceForEdgeLabels(g) { + var graph = g.graph(); + graph.ranksep /= 2; + _.each(g.edges(), function(e) { + var edge = g.edge(e); + edge.minlen *= 2; + if (edge.labelpos.toLowerCase() !== "c") { + if (graph.rankdir === "TB" || graph.rankdir === "BT") { + edge.width += edge.labeloffset; + } else { + edge.height += edge.labeloffset; + } + } + }); +} + +/* + * Creates temporary dummy nodes that capture the rank in which each edge's + * label is going to, if it has one of non-zero width and height. We do this + * so that we can safely remove empty ranks while preserving balance for the + * label's position. + */ +function injectEdgeLabelProxies(g) { + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (edge.width && edge.height) { + var v = g.node(e.v), + w = g.node(e.w), + label = { rank: (w.rank - v.rank) / 2 + v.rank, e: e }; + util.addDummyNode(g, "edge-proxy", label, "_ep"); + } + }); +} + +function assignRankMinMax(g) { + var maxRank = 0; + _.each(g.nodes(), function(v) { + var node = g.node(v); + if (node.borderTop) { + node.minRank = g.node(node.borderTop).rank; + node.maxRank = g.node(node.borderBottom).rank; + maxRank = _.max(maxRank, node.maxRank); + } + }); + g.graph().maxRank = maxRank; +} + +function removeEdgeLabelProxies(g) { + _.each(g.nodes(), function(v) { + var node = g.node(v); + if (node.dummy === "edge-proxy") { + g.edge(node.e).labelRank = node.rank; + g.removeNode(v); + } + }); +} + +function translateGraph(g) { + var minX = Number.POSITIVE_INFINITY, + maxX = 0, + minY = Number.POSITIVE_INFINITY, + maxY = 0, + graphLabel = g.graph(), + marginX = graphLabel.marginx || 0, + marginY = graphLabel.marginy || 0; + + function getExtremes(attrs) { + var x = attrs.x, + y = attrs.y, + w = attrs.width, + h = attrs.height; + minX = Math.min(minX, x - w / 2); + maxX = Math.max(maxX, x + w / 2); + minY = Math.min(minY, y - h / 2); + maxY = Math.max(maxY, y + h / 2); + } + + _.each(g.nodes(), function(v) { getExtremes(g.node(v)); }); + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (_.has(edge, "x")) { + getExtremes(edge); + } + }); + + minX -= marginX; + minY -= marginY; + + _.each(g.nodes(), function(v) { + var node = g.node(v); + node.x -= minX; + node.y -= minY; + }); + + _.each(g.edges(), function(e) { + var edge = g.edge(e); + _.each(edge.points, function(p) { + p.x -= minX; + p.y -= minY; + }); + if (_.has(edge, "x")) { edge.x -= minX; } + if (_.has(edge, "y")) { edge.y -= minY; } + }); + + graphLabel.width = maxX - minX + marginX; + graphLabel.height = maxY - minY + marginY; +} + +function assignNodeIntersects(g) { + _.each(g.edges(), function(e) { + var edge = g.edge(e), + nodeV = g.node(e.v), + nodeW = g.node(e.w), + p1, p2; + if (!edge.points) { + edge.points = []; + p1 = nodeW; + p2 = nodeV; + } else { + p1 = edge.points[0]; + p2 = edge.points[edge.points.length - 1]; + } + edge.points.unshift(util.intersectRect(nodeV, p1)); + edge.points.push(util.intersectRect(nodeW, p2)); + }); +} + +function fixupEdgeLabelCoords(g) { + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (_.has(edge, "x")) { + if (edge.labelpos === "l" || edge.labelpos === "r") { + edge.width -= edge.labeloffset; + } + switch (edge.labelpos) { + case "l": edge.x -= edge.width / 2 + edge.labeloffset; break; + case "r": edge.x += edge.width / 2 + edge.labeloffset; break; + } + } + }); +} + +function reversePointsForReversedEdges(g) { + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (edge.reversed) { + edge.points.reverse(); + } + }); +} + +function removeBorderNodes(g) { + _.each(g.nodes(), function(v) { + if (g.children(v).length) { + var node = g.node(v), + t = g.node(node.borderTop), + b = g.node(node.borderBottom), + l = g.node(_.last(node.borderLeft)), + r = g.node(_.last(node.borderRight)); + + node.width = Math.abs(r.x - l.x); + node.height = Math.abs(b.y - t.y); + node.x = l.x + node.width / 2; + node.y = t.y + node.height / 2; + } + }); + + _.each(g.nodes(), function(v) { + if (g.node(v).dummy === "border") { + g.removeNode(v); + } + }); +} + +function removeSelfEdges(g) { + _.each(g.edges(), function(e) { + if (e.v === e.w) { + var node = g.node(e.v); + if (!node.selfEdges) { + node.selfEdges = []; + } + node.selfEdges.push({ e: e, label: g.edge(e) }); + g.removeEdge(e); + } + }); +} + +function insertSelfEdges(g) { + var layers = util.buildLayerMatrix(g); + _.each(layers, function(layer) { + var orderShift = 0; + _.each(layer, function(v, i) { + var node = g.node(v); + node.order = i + orderShift; + _.each(node.selfEdges, function(selfEdge) { + util.addDummyNode(g, "selfedge", { + width: selfEdge.label.width, + height: selfEdge.label.height, + rank: node.rank, + order: i + (++orderShift), + e: selfEdge.e, + label: selfEdge.label + }, "_se"); + }); + delete node.selfEdges; + }); + }); +} + +function positionSelfEdges(g) { + _.each(g.nodes(), function(v) { + var node = g.node(v); + if (node.dummy === "selfedge") { + var selfNode = g.node(node.e.v), + x = selfNode.x + selfNode.width / 2, + y = selfNode.y, + dx = node.x - x, + dy = selfNode.height / 2; + g.setEdge(node.e, node.label); + g.removeNode(v); + node.label.points = [ + { x: x + 2 * dx / 3, y: y - dy }, + { x: x + 5 * dx / 6, y: y - dy }, + { x: x + dx , y: y }, + { x: x + 5 * dx / 6, y: y + dy }, + { x: x + 2 * dx / 3, y: y + dy }, + ]; + node.label.x = node.x; + node.label.y = node.y; + } + }); +} + +function selectNumberAttrs(obj, attrs) { + return _.mapValues(_.pick(obj, attrs), Number); +} + +function canonicalize(attrs) { + var newAttrs = {}; + _.each(attrs, function(v, k) { + newAttrs[k.toLowerCase()] = v; + }); + return newAttrs; +} + +},{"./acyclic":32,"./add-border-segments":33,"./coordinate-system":34,"./graphlib":37,"./lodash":40,"./nesting-graph":41,"./normalize":42,"./order":47,"./parent-dummy-chains":52,"./position":54,"./rank":56,"./util":59}],40:[function(require,module,exports){ +/* global window */ + +var lodash; + +if (typeof require === "function") { + try { + lodash = require("lodash"); + } catch (e) {} +} + +if (!lodash) { + lodash = window._; +} + +module.exports = lodash; + +},{"lodash":82}],41:[function(require,module,exports){ +var _ = require("./lodash"), + util = require("./util"); + +module.exports = { + run: run, + cleanup: cleanup +}; + +/* + * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs, + * adds appropriate edges to ensure that all cluster nodes are placed between + * these boundries, and ensures that the graph is connected. + * + * In addition we ensure, through the use of the minlen property, that nodes + * and subgraph border nodes to not end up on the same rank. + * + * Preconditions: + * + * 1. Input graph is a DAG + * 2. Nodes in the input graph has a minlen attribute + * + * Postconditions: + * + * 1. Input graph is connected. + * 2. Dummy nodes are added for the tops and bottoms of subgraphs. + * 3. The minlen attribute for nodes is adjusted to ensure nodes do not + * get placed on the same rank as subgraph border nodes. + * + * The nesting graph idea comes from Sander, "Layout of Compound Directed + * Graphs." + */ +function run(g) { + var root = util.addDummyNode(g, "root", {}, "_root"), + depths = treeDepths(g), + height = _.max(depths) - 1, + nodeSep = 2 * height + 1; + + g.graph().nestingRoot = root; + + // Multiply minlen by nodeSep to align nodes on non-border ranks. + _.each(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; }); + + // Calculate a weight that is sufficient to keep subgraphs vertically compact + var weight = sumWeights(g) + 1; + + // Create border nodes and link them up + _.each(g.children(), function(child) { + dfs(g, root, nodeSep, weight, height, depths, child); + }); + + // Save the multiplier for node layers for later removal of empty border + // layers. + g.graph().nodeRankFactor = nodeSep; +} + +function dfs(g, root, nodeSep, weight, height, depths, v) { + var children = g.children(v); + if (!children.length) { + if (v !== root) { + g.setEdge(root, v, { weight: 0, minlen: nodeSep }); + } + return; + } + + var top = util.addBorderNode(g, "_bt"), + bottom = util.addBorderNode(g, "_bb"), + label = g.node(v); + + g.setParent(top, v); + label.borderTop = top; + g.setParent(bottom, v); + label.borderBottom = bottom; + + _.each(children, function(child) { + dfs(g, root, nodeSep, weight, height, depths, child); + + var childNode = g.node(child), + childTop = childNode.borderTop ? childNode.borderTop : child, + childBottom = childNode.borderBottom ? childNode.borderBottom : child, + thisWeight = childNode.borderTop ? weight : 2 * weight, + minlen = childTop !== childBottom ? 1 : height - depths[v] + 1; + + g.setEdge(top, childTop, { + weight: thisWeight, + minlen: minlen, + nestingEdge: true + }); + + g.setEdge(childBottom, bottom, { + weight: thisWeight, + minlen: minlen, + nestingEdge: true + }); + }); + + if (!g.parent(v)) { + g.setEdge(root, top, { weight: 0, minlen: height + depths[v] }); + } +} + +function treeDepths(g) { + var depths = {}; + function dfs(v, depth) { + var children = g.children(v); + if (children && children.length) { + _.each(children, function(child) { + dfs(child, depth + 1); + }); + } + depths[v] = depth; + } + _.each(g.children(), function(v) { dfs(v, 1); }); + return depths; +} + +function sumWeights(g) { + return _.reduce(g.edges(), function(acc, e) { + return acc + g.edge(e).weight; + }, 0); +} + +function cleanup(g) { + var graphLabel = g.graph(); + g.removeNode(graphLabel.nestingRoot); + delete graphLabel.nestingRoot; + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (edge.nestingEdge) { + g.removeEdge(e); + } + }); +} + +},{"./lodash":40,"./util":59}],42:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"), + util = require("./util"); + +module.exports = { + run: run, + undo: undo +}; + +/* + * Breaks any long edges in the graph into short segments that span 1 layer + * each. This operation is undoable with the denormalize function. + * + * Pre-conditions: + * + * 1. The input graph is a DAG. + * 2. Each node in the graph has a "rank" property. + * + * Post-condition: + * + * 1. All edges in the graph have a length of 1. + * 2. Dummy nodes are added where edges have been split into segments. + * 3. The graph is augmented with a "dummyChains" attribute which contains + * the first dummy in each chain of dummy nodes produced. + */ +function run(g) { + g.graph().dummyChains = []; + _.each(g.edges(), function(edge) { normalizeEdge(g, edge); }); +} + +function normalizeEdge(g, e) { + var v = e.v, + vRank = g.node(v).rank, + w = e.w, + wRank = g.node(w).rank, + name = e.name, + edgeLabel = g.edge(e), + labelRank = edgeLabel.labelRank; + + if (wRank === vRank + 1) return; + + g.removeEdge(e); + + var dummy, attrs, i; + for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) { + edgeLabel.points = []; + attrs = { + width: 0, height: 0, + edgeLabel: edgeLabel, edgeObj: e, + rank: vRank + }; + dummy = util.addDummyNode(g, "edge", attrs, "_d"); + if (vRank === labelRank) { + attrs.width = edgeLabel.width; + attrs.height = edgeLabel.height; + attrs.dummy = "edge-label"; + attrs.labelpos = edgeLabel.labelpos; + } + g.setEdge(v, dummy, { weight: edgeLabel.weight }, name); + if (i === 0) { + g.graph().dummyChains.push(dummy); + } + v = dummy; + } + + g.setEdge(v, w, { weight: edgeLabel.weight }, name); +} + +function undo(g) { + _.each(g.graph().dummyChains, function(v) { + var node = g.node(v), + origLabel = node.edgeLabel, + w; + g.setEdge(node.edgeObj, origLabel); + while (node.dummy) { + w = g.successors(v)[0]; + g.removeNode(v); + origLabel.points.push({ x: node.x, y: node.y }); + if (node.dummy === "edge-label") { + origLabel.x = node.x; + origLabel.y = node.y; + origLabel.width = node.width; + origLabel.height = node.height; + } + v = w; + node = g.node(v); + } + }); +} + +},{"./lodash":40,"./util":59}],43:[function(require,module,exports){ +var _ = require("../lodash"); + +module.exports = addSubgraphConstraints; + +function addSubgraphConstraints(g, cg, vs) { + var prev = {}, + rootPrev; + + _.each(vs, function(v) { + var child = g.parent(v), + parent, + prevChild; + while (child) { + parent = g.parent(child); + if (parent) { + prevChild = prev[parent]; + prev[parent] = child; + } else { + prevChild = rootPrev; + rootPrev = child; + } + if (prevChild && prevChild !== child) { + cg.setEdge(prevChild, child); + return; + } + child = parent; + } + }); + + /* + function dfs(v) { + var children = v ? g.children(v) : g.children(); + if (children.length) { + var min = Number.POSITIVE_INFINITY, + subgraphs = []; + _.each(children, function(child) { + var childMin = dfs(child); + if (g.children(child).length) { + subgraphs.push({ v: child, order: childMin }); + } + min = Math.min(min, childMin); + }); + _.reduce(_.sortBy(subgraphs, "order"), function(prev, curr) { + cg.setEdge(prev.v, curr.v); + return curr; + }); + return min; + } + return g.node(v).order; + } + dfs(undefined); + */ +} + +},{"../lodash":40}],44:[function(require,module,exports){ +var _ = require("../lodash"); + +module.exports = barycenter; + +function barycenter(g, movable) { + return _.map(movable, function(v) { + var inV = g.inEdges(v); + if (!inV.length) { + return { v: v }; + } else { + var result = _.reduce(inV, function(acc, e) { + var edge = g.edge(e), + nodeU = g.node(e.v); + return { + sum: acc.sum + (edge.weight * nodeU.order), + weight: acc.weight + edge.weight + }; + }, { sum: 0, weight: 0 }); + + return { + v: v, + barycenter: result.sum / result.weight, + weight: result.weight + }; + } + }); +} + + +},{"../lodash":40}],45:[function(require,module,exports){ +var _ = require("../lodash"), + Graph = require("../graphlib").Graph; + +module.exports = buildLayerGraph; + +/* + * Constructs a graph that can be used to sort a layer of nodes. The graph will + * contain all base and subgraph nodes from the request layer in their original + * hierarchy and any edges that are incident on these nodes and are of the type + * requested by the "relationship" parameter. + * + * Nodes from the requested rank that do not have parents are assigned a root + * node in the output graph, which is set in the root graph attribute. This + * makes it easy to walk the hierarchy of movable nodes during ordering. + * + * Pre-conditions: + * + * 1. Input graph is a DAG + * 2. Base nodes in the input graph have a rank attribute + * 3. Subgraph nodes in the input graph has minRank and maxRank attributes + * 4. Edges have an assigned weight + * + * Post-conditions: + * + * 1. Output graph has all nodes in the movable rank with preserved + * hierarchy. + * 2. Root nodes in the movable layer are made children of the node + * indicated by the root attribute of the graph. + * 3. Non-movable nodes incident on movable nodes, selected by the + * relationship parameter, are included in the graph (without hierarchy). + * 4. Edges incident on movable nodes, selected by the relationship + * parameter, are added to the output graph. + * 5. The weights for copied edges are aggregated as need, since the output + * graph is not a multi-graph. + */ +function buildLayerGraph(g, rank, relationship) { + var root = createRootNode(g), + result = new Graph({ compound: true }).setGraph({ root: root }) + .setDefaultNodeLabel(function(v) { return g.node(v); }); + + _.each(g.nodes(), function(v) { + var node = g.node(v), + parent = g.parent(v); + + if (node.rank === rank || node.minRank <= rank && rank <= node.maxRank) { + result.setNode(v); + result.setParent(v, parent || root); + + // This assumes we have only short edges! + _.each(g[relationship](v), function(e) { + var u = e.v === v ? e.w : e.v, + edge = result.edge(u, v), + weight = !_.isUndefined(edge) ? edge.weight : 0; + result.setEdge(u, v, { weight: g.edge(e).weight + weight }); + }); + + if (_.has(node, "minRank")) { + result.setNode(v, { + borderLeft: node.borderLeft[rank], + borderRight: node.borderRight[rank] + }); + } + } + }); + + return result; +} + +function createRootNode(g) { + var v; + while (g.hasNode((v = _.uniqueId("_root")))); + return v; +} + +},{"../graphlib":37,"../lodash":40}],46:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"); + +module.exports = crossCount; + +/* + * A function that takes a layering (an array of layers, each with an array of + * ordererd nodes) and a graph and returns a weighted crossing count. + * + * Pre-conditions: + * + * 1. Input graph must be simple (not a multigraph), directed, and include + * only simple edges. + * 2. Edges in the input graph must have assigned weights. + * + * Post-conditions: + * + * 1. The graph and layering matrix are left unchanged. + * + * This algorithm is derived from Barth, et al., "Bilayer Cross Counting." + */ +function crossCount(g, layering) { + var cc = 0; + for (var i = 1; i < layering.length; ++i) { + cc += twoLayerCrossCount(g, layering[i-1], layering[i]); + } + return cc; +} + +function twoLayerCrossCount(g, northLayer, southLayer) { + // Sort all of the edges between the north and south layers by their position + // in the north layer and then the south. Map these edges to the position of + // their head in the south layer. + var southPos = _.zipObject(southLayer, + _.map(southLayer, function (v, i) { return i; })); + var southEntries = _.flatten(_.map(northLayer, function(v) { + return _.chain(g.outEdges(v)) + .map(function(e) { + return { pos: southPos[e.w], weight: g.edge(e).weight }; + }) + .sortBy("pos") + .value(); + }), true); + + // Build the accumulator tree + var firstIndex = 1; + while (firstIndex < southLayer.length) firstIndex <<= 1; + var treeSize = 2 * firstIndex - 1; + firstIndex -= 1; + var tree = _.map(new Array(treeSize), function() { return 0; }); + + // Calculate the weighted crossings + var cc = 0; + _.each(southEntries.forEach(function(entry) { + var index = entry.pos + firstIndex; + tree[index] += entry.weight; + var weightSum = 0; + while (index > 0) { + if (index % 2) { + weightSum += tree[index + 1]; + } + index = (index - 1) >> 1; + tree[index] += entry.weight; + } + cc += entry.weight * weightSum; + })); + + return cc; +} + +},{"../lodash":40}],47:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + initOrder = require("./init-order"), + crossCount = require("./cross-count"), + sortSubgraph = require("./sort-subgraph"), + buildLayerGraph = require("./build-layer-graph"), + addSubgraphConstraints = require("./add-subgraph-constraints"), + Graph = require("../graphlib").Graph, + util = require("../util"); + +module.exports = order; + +/* + * Applies heuristics to minimize edge crossings in the graph and sets the best + * order solution as an order attribute on each node. + * + * Pre-conditions: + * + * 1. Graph must be DAG + * 2. Graph nodes must be objects with a "rank" attribute + * 3. Graph edges must have the "weight" attribute + * + * Post-conditions: + * + * 1. Graph nodes will have an "order" attribute based on the results of the + * algorithm. + */ +function order(g) { + var maxRank = util.maxRank(g), + downLayerGraphs = buildLayerGraphs(g, _.range(1, maxRank + 1), "inEdges"), + upLayerGraphs = buildLayerGraphs(g, _.range(maxRank - 1, -1, -1), "outEdges"); + + var layering = initOrder(g); + assignOrder(g, layering); + + var bestCC = Number.POSITIVE_INFINITY, + best; + + for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) { + sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2); + + layering = util.buildLayerMatrix(g); + var cc = crossCount(g, layering); + if (cc < bestCC) { + lastBest = 0; + best = _.cloneDeep(layering); + bestCC = cc; + } + } + + assignOrder(g, best); +} + +function buildLayerGraphs(g, ranks, relationship) { + return _.map(ranks, function(rank) { + return buildLayerGraph(g, rank, relationship); + }); +} + +function sweepLayerGraphs(layerGraphs, biasRight) { + var cg = new Graph(); + _.each(layerGraphs, function(lg) { + var root = lg.graph().root; + var sorted = sortSubgraph(lg, root, cg, biasRight); + _.each(sorted.vs, function(v, i) { + lg.node(v).order = i; + }); + addSubgraphConstraints(lg, cg, sorted.vs); + }); +} + +function assignOrder(g, layering) { + _.each(layering, function(layer) { + _.each(layer, function(v, i) { + g.node(v).order = i; + }); + }); +} + +},{"../graphlib":37,"../lodash":40,"../util":59,"./add-subgraph-constraints":43,"./build-layer-graph":45,"./cross-count":46,"./init-order":48,"./sort-subgraph":50}],48:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"); + +module.exports = initOrder; + +/* + * Assigns an initial order value for each node by performing a DFS search + * starting from nodes in the first rank. Nodes are assigned an order in their + * rank as they are first visited. + * + * This approach comes from Gansner, et al., "A Technique for Drawing Directed + * Graphs." + * + * Returns a layering matrix with an array per layer and each layer sorted by + * the order of its nodes. + */ +function initOrder(g) { + var visited = {}, + simpleNodes = _.filter(g.nodes(), function(v) { + return !g.children(v).length; + }), + maxRank = _.max(_.map(simpleNodes, function(v) { return g.node(v).rank; })), + layers = _.map(_.range(maxRank + 1), function() { return []; }); + + function dfs(v) { + if (_.has(visited, v)) return; + visited[v] = true; + var node = g.node(v); + layers[node.rank].push(v); + _.each(g.successors(v), dfs); + } + + var orderedVs = _.sortBy(simpleNodes, function(v) { return g.node(v).rank; }); + _.each(orderedVs, dfs); + + return layers; +} + +},{"../lodash":40}],49:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"); + +module.exports = resolveConflicts; + +/* + * Given a list of entries of the form {v, barycenter, weight} and a + * constraint graph this function will resolve any conflicts between the + * constraint graph and the barycenters for the entries. If the barycenters for + * an entry would violate a constraint in the constraint graph then we coalesce + * the nodes in the conflict into a new node that respects the contraint and + * aggregates barycenter and weight information. + * + * This implementation is based on the description in Forster, "A Fast and + * Simple Hueristic for Constrained Two-Level Crossing Reduction," thought it + * differs in some specific details. + * + * Pre-conditions: + * + * 1. Each entry has the form {v, barycenter, weight}, or if the node has + * no barycenter, then {v}. + * + * Returns: + * + * A new list of entries of the form {vs, i, barycenter, weight}. The list + * `vs` may either be a singleton or it may be an aggregation of nodes + * ordered such that they do not violate constraints from the constraint + * graph. The property `i` is the lowest original index of any of the + * elements in `vs`. + */ +function resolveConflicts(entries, cg) { + var mappedEntries = {}; + _.each(entries, function(entry, i) { + var tmp = mappedEntries[entry.v] = { + indegree: 0, + "in": [], + out: [], + vs: [entry.v], + i: i + }; + if (!_.isUndefined(entry.barycenter)) { + tmp.barycenter = entry.barycenter; + tmp.weight = entry.weight; + } + }); + + _.each(cg.edges(), function(e) { + var entryV = mappedEntries[e.v], + entryW = mappedEntries[e.w]; + if (!_.isUndefined(entryV) && !_.isUndefined(entryW)) { + entryW.indegree++; + entryV.out.push(mappedEntries[e.w]); + } + }); + + var sourceSet = _.filter(mappedEntries, function(entry) { + return !entry.indegree; + }); + + return doResolveConflicts(sourceSet); +} + +function doResolveConflicts(sourceSet) { + var entries = []; + + function handleIn(vEntry) { + return function(uEntry) { + if (uEntry.merged) { + return; + } + if (_.isUndefined(uEntry.barycenter) || + _.isUndefined(vEntry.barycenter) || + uEntry.barycenter >= vEntry.barycenter) { + mergeEntries(vEntry, uEntry); + } + }; + } + + function handleOut(vEntry) { + return function(wEntry) { + wEntry["in"].push(vEntry); + if (--wEntry.indegree === 0) { + sourceSet.push(wEntry); + } + }; + } + + while (sourceSet.length) { + var entry = sourceSet.pop(); + entries.push(entry); + _.each(entry["in"].reverse(), handleIn(entry)); + _.each(entry.out, handleOut(entry)); + } + + return _.chain(entries) + .filter(function(entry) { return !entry.merged; }) + .map(function(entry) { + return _.pick(entry, ["vs", "i", "barycenter", "weight"]); + }) + .value(); +} + +function mergeEntries(target, source) { + var sum = 0, + weight = 0; + + if (target.weight) { + sum += target.barycenter * target.weight; + weight += target.weight; + } + + if (source.weight) { + sum += source.barycenter * source.weight; + weight += source.weight; + } + + target.vs = source.vs.concat(target.vs); + target.barycenter = sum / weight; + target.weight = weight; + target.i = Math.min(source.i, target.i); + source.merged = true; +} + +},{"../lodash":40}],50:[function(require,module,exports){ +var _ = require("../lodash"), + barycenter = require("./barycenter"), + resolveConflicts = require("./resolve-conflicts"), + sort = require("./sort"); + +module.exports = sortSubgraph; + +function sortSubgraph(g, v, cg, biasRight) { + var movable = g.children(v), + node = g.node(v), + bl = node ? node.borderLeft : undefined, + br = node ? node.borderRight: undefined, + subgraphs = {}; + + if (bl) { + movable = _.filter(movable, function(w) { + return w !== bl && w !== br; + }); + } + + var barycenters = barycenter(g, movable); + _.each(barycenters, function(entry) { + if (g.children(entry.v).length) { + var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight); + subgraphs[entry.v] = subgraphResult; + if (_.has(subgraphResult, "barycenter")) { + mergeBarycenters(entry, subgraphResult); + } + } + }); + + var entries = resolveConflicts(barycenters, cg); + expandSubgraphs(entries, subgraphs); + + var result = sort(entries, biasRight); + + if (bl) { + result.vs = _.flatten([bl, result.vs, br], true); + if (g.predecessors(bl).length) { + var blPred = g.node(g.predecessors(bl)[0]), + brPred = g.node(g.predecessors(br)[0]); + if (!_.has(result, "barycenter")) { + result.barycenter = 0; + result.weight = 0; + } + result.barycenter = (result.barycenter * result.weight + + blPred.order + brPred.order) / (result.weight + 2); + result.weight += 2; + } + } + + return result; +} + +function expandSubgraphs(entries, subgraphs) { + _.each(entries, function(entry) { + entry.vs = _.flatten(entry.vs.map(function(v) { + if (subgraphs[v]) { + return subgraphs[v].vs; + } + return v; + }), true); + }); +} + +function mergeBarycenters(target, other) { + if (!_.isUndefined(target.barycenter)) { + target.barycenter = (target.barycenter * target.weight + + other.barycenter * other.weight) / + (target.weight + other.weight); + target.weight += other.weight; + } else { + target.barycenter = other.barycenter; + target.weight = other.weight; + } +} + +},{"../lodash":40,"./barycenter":44,"./resolve-conflicts":49,"./sort":51}],51:[function(require,module,exports){ +var _ = require("../lodash"), + util = require("../util"); + +module.exports = sort; + +function sort(entries, biasRight) { + var parts = util.partition(entries, function(entry) { + return _.has(entry, "barycenter"); + }); + var sortable = parts.lhs, + unsortable = _.sortBy(parts.rhs, function(entry) { return -entry.i; }), + vs = [], + sum = 0, + weight = 0, + vsIndex = 0; + + sortable.sort(compareWithBias(!!biasRight)); + + vsIndex = consumeUnsortable(vs, unsortable, vsIndex); + + _.each(sortable, function (entry) { + vsIndex += entry.vs.length; + vs.push(entry.vs); + sum += entry.barycenter * entry.weight; + weight += entry.weight; + vsIndex = consumeUnsortable(vs, unsortable, vsIndex); + }); + + var result = { vs: _.flatten(vs, true) }; + if (weight) { + result.barycenter = sum / weight; + result.weight = weight; + } + return result; +} + +function consumeUnsortable(vs, unsortable, index) { + var last; + while (unsortable.length && (last = _.last(unsortable)).i <= index) { + unsortable.pop(); + vs.push(last.vs); + index++; + } + return index; +} + +function compareWithBias(bias) { + return function(entryV, entryW) { + if (entryV.barycenter < entryW.barycenter) { + return -1; + } else if (entryV.barycenter > entryW.barycenter) { + return 1; + } + + return !bias ? entryV.i - entryW.i : entryW.i - entryV.i; + }; +} + +},{"../lodash":40,"../util":59}],52:[function(require,module,exports){ +var _ = require("./lodash"); + +module.exports = parentDummyChains; + +function parentDummyChains(g) { + var postorderNums = postorder(g); + + _.each(g.graph().dummyChains, function(v) { + var node = g.node(v), + edgeObj = node.edgeObj, + pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w), + path = pathData.path, + lca = pathData.lca, + pathIdx = 0, + pathV = path[pathIdx], + ascending = true; + + while (v !== edgeObj.w) { + node = g.node(v); + + if (ascending) { + while ((pathV = path[pathIdx]) !== lca && + g.node(pathV).maxRank < node.rank) { + pathIdx++; + } + + if (pathV === lca) { + ascending = false; + } + } + + if (!ascending) { + while (pathIdx < path.length - 1 && + g.node(pathV = path[pathIdx + 1]).minRank <= node.rank) { + pathIdx++; + } + pathV = path[pathIdx]; + } + + g.setParent(v, pathV); + v = g.successors(v)[0]; + } + }); +} + +// Find a path from v to w through the lowest common ancestor (LCA). Return the +// full path and the LCA. +function findPath(g, postorderNums, v, w) { + var vPath = [], + wPath = [], + low = Math.min(postorderNums[v].low, postorderNums[w].low), + lim = Math.max(postorderNums[v].lim, postorderNums[w].lim), + parent, + lca; + + // Traverse up from v to find the LCA + parent = v; + do { + parent = g.parent(parent); + vPath.push(parent); + } while (parent && + (postorderNums[parent].low > low || lim > postorderNums[parent].lim)); + lca = parent; + + // Traverse from w to LCA + parent = w; + while ((parent = g.parent(parent)) !== lca) { + wPath.push(parent); + } + + return { path: vPath.concat(wPath.reverse()), lca: lca }; +} + +function postorder(g) { + var result = {}, + lim = 0; + + function dfs(v) { + var low = lim; + _.each(g.children(v), dfs); + result[v] = { low: low, lim: lim++ }; + } + _.each(g.children(), dfs); + + return result; +} + +},{"./lodash":40}],53:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + Graph = require("../graphlib").Graph, + util = require("../util"); + +/* + * This module provides coordinate assignment based on Brandes and Köpf, "Fast + * and Simple Horizontal Coordinate Assignment." + */ + +module.exports = { + positionX: positionX, + findType1Conflicts: findType1Conflicts, + findType2Conflicts: findType2Conflicts, + addConflict: addConflict, + hasConflict: hasConflict, + verticalAlignment: verticalAlignment, + horizontalCompaction: horizontalCompaction, + alignCoordinates: alignCoordinates, + findSmallestWidthAlignment: findSmallestWidthAlignment, + balance: balance +}; + +/* + * Marks all edges in the graph with a type-1 conflict with the "type1Conflict" + * property. A type-1 conflict is one where a non-inner segment crosses an + * inner segment. An inner segment is an edge with both incident nodes marked + * with the "dummy" property. + * + * This algorithm scans layer by layer, starting with the second, for type-1 + * conflicts between the current layer and the previous layer. For each layer + * it scans the nodes from left to right until it reaches one that is incident + * on an inner segment. It then scans predecessors to determine if they have + * edges that cross that inner segment. At the end a final scan is done for all + * nodes on the current rank to see if they cross the last visited inner + * segment. + * + * This algorithm (safely) assumes that a dummy node will only be incident on a + * single node in the layers being scanned. + */ +function findType1Conflicts(g, layering) { + var conflicts = {}; + + function visitLayer(prevLayer, layer) { + var + // last visited node in the previous layer that is incident on an inner + // segment. + k0 = 0, + // Tracks the last node in this layer scanned for crossings with a type-1 + // segment. + scanPos = 0, + prevLayerLength = prevLayer.length, + lastNode = _.last(layer); + + _.each(layer, function(v, i) { + var w = findOtherInnerSegmentNode(g, v), + k1 = w ? g.node(w).order : prevLayerLength; + + if (w || v === lastNode) { + _.each(layer.slice(scanPos, i +1), function(scanNode) { + _.each(g.predecessors(scanNode), function(u) { + var uLabel = g.node(u), + uPos = uLabel.order; + if ((uPos < k0 || k1 < uPos) && + !(uLabel.dummy && g.node(scanNode).dummy)) { + addConflict(conflicts, u, scanNode); + } + }); + }); + scanPos = i + 1; + k0 = k1; + } + }); + + return layer; + } + + _.reduce(layering, visitLayer); + return conflicts; +} + +function findType2Conflicts(g, layering) { + var conflicts = {}; + + function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) { + var v; + _.each(_.range(southPos, southEnd), function(i) { + v = south[i]; + if (g.node(v).dummy) { + _.each(g.predecessors(v), function(u) { + var uNode = g.node(u); + if (uNode.dummy && + (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) { + addConflict(conflicts, u, v); + } + }); + } + }); + } + + + function visitLayer(north, south) { + var prevNorthPos = -1, + nextNorthPos, + southPos = 0; + + _.each(south, function(v, southLookahead) { + if (g.node(v).dummy === "border") { + var predecessors = g.predecessors(v); + if (predecessors.length) { + nextNorthPos = g.node(predecessors[0]).order; + scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos); + southPos = southLookahead; + prevNorthPos = nextNorthPos; + } + } + scan(south, southPos, south.length, nextNorthPos, north.length); + }); + + return south; + } + + _.reduce(layering, visitLayer); + return conflicts; +} + +function findOtherInnerSegmentNode(g, v) { + if (g.node(v).dummy) { + return _.find(g.predecessors(v), function(u) { + return g.node(u).dummy; + }); + } +} + +function addConflict(conflicts, v, w) { + if (v > w) { + var tmp = v; + v = w; + w = tmp; + } + + var conflictsV = conflicts[v]; + if (!conflictsV) { + conflicts[v] = conflictsV = {}; + } + conflictsV[w] = true; +} + +function hasConflict(conflicts, v, w) { + if (v > w) { + var tmp = v; + v = w; + w = tmp; + } + return _.has(conflicts[v], w); +} + +/* + * Try to align nodes into vertical "blocks" where possible. This algorithm + * attempts to align a node with one of its median neighbors. If the edge + * connecting a neighbor is a type-1 conflict then we ignore that possibility. + * If a previous node has already formed a block with a node after the node + * we're trying to form a block with, we also ignore that possibility - our + * blocks would be split in that scenario. + */ +function verticalAlignment(g, layering, conflicts, neighborFn) { + var root = {}, + align = {}, + pos = {}; + + // We cache the position here based on the layering because the graph and + // layering may be out of sync. The layering matrix is manipulated to + // generate different extreme alignments. + _.each(layering, function(layer) { + _.each(layer, function(v, order) { + root[v] = v; + align[v] = v; + pos[v] = order; + }); + }); + + _.each(layering, function(layer) { + var prevIdx = -1; + _.each(layer, function(v) { + var ws = neighborFn(v); + if (ws.length) { + ws = _.sortBy(ws, function(w) { return pos[w]; }); + var mp = (ws.length - 1) / 2; + for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) { + var w = ws[i]; + if (align[v] === v && + prevIdx < pos[w] && + !hasConflict(conflicts, v, w)) { + align[w] = v; + align[v] = root[v] = root[w]; + prevIdx = pos[w]; + } + } + } + }); + }); + + return { root: root, align: align }; +} + +function horizontalCompaction(g, layering, root, align, reverseSep) { + // This portion of the algorithm differs from BK due to a number of problems. + // Instead of their algorithm we construct a new block graph and do two + // sweeps. The first sweep places blocks with the smallest possible + // coordinates. The second sweep removes unused space by moving blocks to the + // greatest coordinates without violating separation. + var xs = {}, + blockG = buildBlockGraph(g, layering, root, reverseSep); + + // First pass, assign smallest coordinates via DFS + var visited = {}; + function pass1(v) { + if (!_.has(visited, v)) { + visited[v] = true; + xs[v] = _.reduce(blockG.inEdges(v), function(max, e) { + pass1(e.v); + return Math.max(max, xs[e.v] + blockG.edge(e)); + }, 0); + } + } + _.each(blockG.nodes(), pass1); + + var borderType = reverseSep ? "borderLeft" : "borderRight"; + function pass2(v) { + if (visited[v] !== 2) { + visited[v]++; + var node = g.node(v); + var min = _.reduce(blockG.outEdges(v), function(min, e) { + pass2(e.w); + return Math.min(min, xs[e.w] - blockG.edge(e)); + }, Number.POSITIVE_INFINITY); + if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) { + xs[v] = Math.max(xs[v], min); + } + } + } + _.each(blockG.nodes(), pass2); + + // Assign x coordinates to all nodes + _.each(align, function(v) { + xs[v] = xs[root[v]]; + }); + + return xs; +} + + +function buildBlockGraph(g, layering, root, reverseSep) { + var blockGraph = new Graph(), + graphLabel = g.graph(), + sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep); + + _.each(layering, function(layer) { + var u; + _.each(layer, function(v) { + var vRoot = root[v]; + blockGraph.setNode(vRoot); + if (u) { + var uRoot = root[u], + prevMax = blockGraph.edge(uRoot, vRoot); + blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0)); + } + u = v; + }); + }); + + return blockGraph; +} + +/* + * Returns the alignment that has the smallest width of the given alignments. + */ +function findSmallestWidthAlignment(g, xss) { + return _.min(xss, function(xs) { + var min = _.min(xs, function(x, v) { return x - width(g, v) / 2; }), + max = _.max(xs, function(x, v) { return x + width(g, v) / 2; }); + return max - min; + }); +} + +/* + * Align the coordinates of each of the layout alignments such that + * left-biased alignments have their minimum coordinate at the same point as + * the minimum coordinate of the smallest width alignment and right-biased + * alignments have their maximum coordinate at the same point as the maximum + * coordinate of the smallest width alignment. + */ +function alignCoordinates(xss, alignTo) { + var alignToMin = _.min(alignTo), + alignToMax = _.max(alignTo); + + _.each(["u", "d"], function(vert) { + _.each(["l", "r"], function(horiz) { + var alignment = vert + horiz, + xs = xss[alignment], + delta; + if (xs === alignTo) return; + + delta = horiz === "l" ? alignToMin - _.min(xs) : alignToMax - _.max(xs); + + if (delta) { + xss[alignment] = _.mapValues(xs, function(x) { return x + delta; }); + } + }); + }); +} + +function balance(xss, align) { + return _.mapValues(xss.ul, function(ignore, v) { + if (align) { + return xss[align.toLowerCase()][v]; + } else { + var xs = _.sortBy(_.pluck(xss, v)); + return (xs[1] + xs[2]) / 2; + } + }); +} + +function positionX(g) { + var layering = util.buildLayerMatrix(g), + conflicts = _.merge(findType1Conflicts(g, layering), + findType2Conflicts(g, layering)); + + var xss = {}, + adjustedLayering; + _.each(["u", "d"], function(vert) { + adjustedLayering = vert === "u" ? layering : _.values(layering).reverse(); + _.each(["l", "r"], function(horiz) { + if (horiz === "r") { + adjustedLayering = _.map(adjustedLayering, function(inner) { + return _.values(inner).reverse(); + }); + } + + var neighborFn = _.bind(vert === "u" ? g.predecessors : g.successors, g); + var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn); + var xs = horizontalCompaction(g, adjustedLayering, + align.root, align.align, + horiz === "r"); + if (horiz === "r") { + xs = _.mapValues(xs, function(x) { return -x; }); + } + xss[vert + horiz] = xs; + }); + }); + + var smallestWidth = findSmallestWidthAlignment(g, xss); + alignCoordinates(xss, smallestWidth); + return balance(xss, g.graph().align); +} + +function sep(nodeSep, edgeSep, reverseSep) { + return function(g, v, w) { + var vLabel = g.node(v), + wLabel = g.node(w), + sum = 0, + delta; + + sum += vLabel.width / 2; + if (_.has(vLabel, "labelpos")) { + switch (vLabel.labelpos.toLowerCase()) { + case "l": delta = -vLabel.width / 2; break; + case "r": delta = vLabel.width / 2; break; + } + } + if (delta) { + sum += reverseSep ? delta : -delta; + } + delta = 0; + + sum += (vLabel.dummy ? edgeSep : nodeSep) / 2; + sum += (wLabel.dummy ? edgeSep : nodeSep) / 2; + + sum += wLabel.width / 2; + if (_.has(wLabel, "labelpos")) { + switch (wLabel.labelpos.toLowerCase()) { + case "l": delta = wLabel.width / 2; break; + case "r": delta = -wLabel.width / 2; break; + } + } + if (delta) { + sum += reverseSep ? delta : -delta; + } + delta = 0; + + return sum; + }; +} + +function width(g, v) { + return g.node(v).width; +} + +},{"../graphlib":37,"../lodash":40,"../util":59}],54:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + util = require("../util"), + positionX = require("./bk").positionX; + +module.exports = position; + +function position(g) { + g = util.asNonCompoundGraph(g); + + positionY(g); + _.each(positionX(g), function(x, v) { + g.node(v).x = x; + }); +} + +function positionY(g) { + var layering = util.buildLayerMatrix(g), + rankSep = g.graph().ranksep, + prevY = 0; + _.each(layering, function(layer) { + var maxHeight = _.max(_.map(layer, function(v) { return g.node(v).height; })); + _.each(layer, function(v) { + g.node(v).y = prevY + maxHeight / 2; + }); + prevY += maxHeight + rankSep; + }); +} + + +},{"../lodash":40,"../util":59,"./bk":53}],55:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + Graph = require("../graphlib").Graph, + slack = require("./util").slack; + +module.exports = feasibleTree; + +/* + * Constructs a spanning tree with tight edges and adjusted the input node's + * ranks to achieve this. A tight edge is one that is has a length that matches + * its "minlen" attribute. + * + * The basic structure for this function is derived from Gansner, et al., "A + * Technique for Drawing Directed Graphs." + * + * Pre-conditions: + * + * 1. Graph must be a DAG. + * 2. Graph must be connected. + * 3. Graph must have at least one node. + * 5. Graph nodes must have been previously assigned a "rank" property that + * respects the "minlen" property of incident edges. + * 6. Graph edges must have a "minlen" property. + * + * Post-conditions: + * + * - Graph nodes will have their rank adjusted to ensure that all edges are + * tight. + * + * Returns a tree (undirected graph) that is constructed using only "tight" + * edges. + */ +function feasibleTree(g) { + var t = new Graph({ directed: false }); + + // Choose arbitrary node from which to start our tree + var start = g.nodes()[0], + size = g.nodeCount(); + t.setNode(start, {}); + + var edge, delta; + while (tightTree(t, g) < size) { + edge = findMinSlackEdge(t, g); + delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge); + shiftRanks(t, g, delta); + } + + return t; +} + +/* + * Finds a maximal tree of tight edges and returns the number of nodes in the + * tree. + */ +function tightTree(t, g) { + function dfs(v) { + _.each(g.nodeEdges(v), function(e) { + var edgeV = e.v, + w = (v === edgeV) ? e.w : edgeV; + if (!t.hasNode(w) && !slack(g, e)) { + t.setNode(w, {}); + t.setEdge(v, w, {}); + dfs(w); + } + }); + } + + _.each(t.nodes(), dfs); + return t.nodeCount(); +} + +/* + * Finds the edge with the smallest slack that is incident on tree and returns + * it. + */ +function findMinSlackEdge(t, g) { + return _.min(g.edges(), function(e) { + if (t.hasNode(e.v) !== t.hasNode(e.w)) { + return slack(g, e); + } + }); +} + +function shiftRanks(t, g, delta) { + _.each(t.nodes(), function(v) { + g.node(v).rank += delta; + }); +} + +},{"../graphlib":37,"../lodash":40,"./util":58}],56:[function(require,module,exports){ +"use strict"; + +var rankUtil = require("./util"), + longestPath = rankUtil.longestPath, + feasibleTree = require("./feasible-tree"), + networkSimplex = require("./network-simplex"); + +module.exports = rank; + +/* + * Assigns a rank to each node in the input graph that respects the "minlen" + * constraint specified on edges between nodes. + * + * This basic structure is derived from Gansner, et al., "A Technique for + * Drawing Directed Graphs." + * + * Pre-conditions: + * + * 1. Graph must be a connected DAG + * 2. Graph nodes must be objects + * 3. Graph edges must have "weight" and "minlen" attributes + * + * Post-conditions: + * + * 1. Graph nodes will have a "rank" attribute based on the results of the + * algorithm. Ranks can start at any index (including negative), we'll + * fix them up later. + */ +function rank(g) { + switch(g.graph().ranker) { + case "network-simplex": networkSimplexRanker(g); break; + case "tight-tree": tightTreeRanker(g); break; + case "longest-path": longestPathRanker(g); break; + default: networkSimplexRanker(g); + } +} + +// A fast and simple ranker, but results are far from optimal. +var longestPathRanker = longestPath; + +function tightTreeRanker(g) { + longestPath(g); + feasibleTree(g); +} + +function networkSimplexRanker(g) { + networkSimplex(g); +} + +},{"./feasible-tree":55,"./network-simplex":57,"./util":58}],57:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + feasibleTree = require("./feasible-tree"), + slack = require("./util").slack, + initRank = require("./util").longestPath, + preorder = require("../graphlib").alg.preorder, + postorder = require("../graphlib").alg.postorder, + simplify = require("../util").simplify; + +module.exports = networkSimplex; + +// Expose some internals for testing purposes +networkSimplex.initLowLimValues = initLowLimValues; +networkSimplex.initCutValues = initCutValues; +networkSimplex.calcCutValue = calcCutValue; +networkSimplex.leaveEdge = leaveEdge; +networkSimplex.enterEdge = enterEdge; +networkSimplex.exchangeEdges = exchangeEdges; + +/* + * The network simplex algorithm assigns ranks to each node in the input graph + * and iteratively improves the ranking to reduce the length of edges. + * + * Preconditions: + * + * 1. The input graph must be a DAG. + * 2. All nodes in the graph must have an object value. + * 3. All edges in the graph must have "minlen" and "weight" attributes. + * + * Postconditions: + * + * 1. All nodes in the graph will have an assigned "rank" attribute that has + * been optimized by the network simplex algorithm. Ranks start at 0. + * + * + * A rough sketch of the algorithm is as follows: + * + * 1. Assign initial ranks to each node. We use the longest path algorithm, + * which assigns ranks to the lowest position possible. In general this + * leads to very wide bottom ranks and unnecessarily long edges. + * 2. Construct a feasible tight tree. A tight tree is one such that all + * edges in the tree have no slack (difference between length of edge + * and minlen for the edge). This by itself greatly improves the assigned + * rankings by shorting edges. + * 3. Iteratively find edges that have negative cut values. Generally a + * negative cut value indicates that the edge could be removed and a new + * tree edge could be added to produce a more compact graph. + * + * Much of the algorithms here are derived from Gansner, et al., "A Technique + * for Drawing Directed Graphs." The structure of the file roughly follows the + * structure of the overall algorithm. + */ +function networkSimplex(g) { + g = simplify(g); + initRank(g); + var t = feasibleTree(g); + initLowLimValues(t); + initCutValues(t, g); + + var e, f; + while ((e = leaveEdge(t))) { + f = enterEdge(t, g, e); + exchangeEdges(t, g, e, f); + } +} + +/* + * Initializes cut values for all edges in the tree. + */ +function initCutValues(t, g) { + var vs = postorder(t, t.nodes()); + vs = vs.slice(0, vs.length - 1); + _.each(vs, function(v) { + assignCutValue(t, g, v); + }); +} + +function assignCutValue(t, g, child) { + var childLab = t.node(child), + parent = childLab.parent; + t.edge(child, parent).cutvalue = calcCutValue(t, g, child); +} + +/* + * Given the tight tree, its graph, and a child in the graph calculate and + * return the cut value for the edge between the child and its parent. + */ +function calcCutValue(t, g, child) { + var childLab = t.node(child), + parent = childLab.parent, + // True if the child is on the tail end of the edge in the directed graph + childIsTail = true, + // The graph's view of the tree edge we're inspecting + graphEdge = g.edge(child, parent), + // The accumulated cut value for the edge between this node and its parent + cutValue = 0; + + if (!graphEdge) { + childIsTail = false; + graphEdge = g.edge(parent, child); + } + + cutValue = graphEdge.weight; + + _.each(g.nodeEdges(child), function(e) { + var isOutEdge = e.v === child, + other = isOutEdge ? e.w : e.v; + + if (other !== parent) { + var pointsToHead = isOutEdge === childIsTail, + otherWeight = g.edge(e).weight; + + cutValue += pointsToHead ? otherWeight : -otherWeight; + if (isTreeEdge(t, child, other)) { + var otherCutValue = t.edge(child, other).cutvalue; + cutValue += pointsToHead ? -otherCutValue : otherCutValue; + } + } + }); + + return cutValue; +} + +function initLowLimValues(tree, root) { + if (arguments.length < 2) { + root = tree.nodes()[0]; + } + dfsAssignLowLim(tree, {}, 1, root); +} + +function dfsAssignLowLim(tree, visited, nextLim, v, parent) { + var low = nextLim, + label = tree.node(v); + + visited[v] = true; + _.each(tree.neighbors(v), function(w) { + if (!_.has(visited, w)) { + nextLim = dfsAssignLowLim(tree, visited, nextLim, w, v); + } + }); + + label.low = low; + label.lim = nextLim++; + if (parent) { + label.parent = parent; + } else { + // TODO should be able to remove this when we incrementally update low lim + delete label.parent; + } + + return nextLim; +} + +function leaveEdge(tree) { + return _.find(tree.edges(), function(e) { + return tree.edge(e).cutvalue < 0; + }); +} + +function enterEdge(t, g, edge) { + var v = edge.v, + w = edge.w; + + // For the rest of this function we assume that v is the tail and w is the + // head, so if we don't have this edge in the graph we should flip it to + // match the correct orientation. + if (!g.hasEdge(v, w)) { + v = edge.w; + w = edge.v; + } + + var vLabel = t.node(v), + wLabel = t.node(w), + tailLabel = vLabel, + flip = false; + + // If the root is in the tail of the edge then we need to flip the logic that + // checks for the head and tail nodes in the candidates function below. + if (vLabel.lim > wLabel.lim) { + tailLabel = wLabel; + flip = true; + } + + var candidates = _.filter(g.edges(), function(edge) { + return flip === isDescendant(t, t.node(edge.v), tailLabel) && + flip !== isDescendant(t, t.node(edge.w), tailLabel); + }); + + return _.min(candidates, function(edge) { return slack(g, edge); }); +} + +function exchangeEdges(t, g, e, f) { + var v = e.v, + w = e.w; + t.removeEdge(v, w); + t.setEdge(f.v, f.w, {}); + initLowLimValues(t); + initCutValues(t, g); + updateRanks(t, g); +} + +function updateRanks(t, g) { + var root = _.find(t.nodes(), function(v) { return !g.node(v).parent; }), + vs = preorder(t, root); + vs = vs.slice(1); + _.each(vs, function(v) { + var parent = t.node(v).parent, + edge = g.edge(v, parent), + flipped = false; + + if (!edge) { + edge = g.edge(parent, v); + flipped = true; + } + + g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen); + }); +} + +/* + * Returns true if the edge is in the tree. + */ +function isTreeEdge(tree, u, v) { + return tree.hasEdge(u, v); +} + +/* + * Returns true if the specified node is descendant of the root node per the + * assigned low and lim attributes in the tree. + */ +function isDescendant(tree, vLabel, rootLabel) { + return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim; +} + +},{"../graphlib":37,"../lodash":40,"../util":59,"./feasible-tree":55,"./util":58}],58:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"); + +module.exports = { + longestPath: longestPath, + slack: slack +}; + +/* + * Initializes ranks for the input graph using the longest path algorithm. This + * algorithm scales well and is fast in practice, it yields rather poor + * solutions. Nodes are pushed to the lowest layer possible, leaving the bottom + * ranks wide and leaving edges longer than necessary. However, due to its + * speed, this algorithm is good for getting an initial ranking that can be fed + * into other algorithms. + * + * This algorithm does not normalize layers because it will be used by other + * algorithms in most cases. If using this algorithm directly, be sure to + * run normalize at the end. + * + * Pre-conditions: + * + * 1. Input graph is a DAG. + * 2. Input graph node labels can be assigned properties. + * + * Post-conditions: + * + * 1. Each node will be assign an (unnormalized) "rank" property. + */ +function longestPath(g) { + var visited = {}; + + function dfs(v) { + var label = g.node(v); + if (_.has(visited, v)) { + return label.rank; + } + visited[v] = true; + + var rank = _.min(_.map(g.outEdges(v), function(e) { + return dfs(e.w) - g.edge(e).minlen; + })); + + if (rank === Number.POSITIVE_INFINITY) { + rank = 0; + } + + return (label.rank = rank); + } + + _.each(g.sources(), dfs); +} + +/* + * Returns the amount of slack for the given edge. The slack is defined as the + * difference between the length of the edge and its minimum length. + */ +function slack(g, e) { + return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen; +} + +},{"../lodash":40}],59:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"), + Graph = require("./graphlib").Graph; + +module.exports = { + addDummyNode: addDummyNode, + simplify: simplify, + asNonCompoundGraph: asNonCompoundGraph, + successorWeights: successorWeights, + predecessorWeights: predecessorWeights, + intersectRect: intersectRect, + buildLayerMatrix: buildLayerMatrix, + normalizeRanks: normalizeRanks, + removeEmptyRanks: removeEmptyRanks, + addBorderNode: addBorderNode, + maxRank: maxRank, + partition: partition, + time: time, + notime: notime +}; + +/* + * Adds a dummy node to the graph and return v. + */ +function addDummyNode(g, type, attrs, name) { + var v; + do { + v = _.uniqueId(name); + } while (g.hasNode(v)); + + attrs.dummy = type; + g.setNode(v, attrs); + return v; +} + +/* + * Returns a new graph with only simple edges. Handles aggregation of data + * associated with multi-edges. + */ +function simplify(g) { + var simplified = new Graph().setGraph(g.graph()); + _.each(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); }); + _.each(g.edges(), function(e) { + var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 }, + label = g.edge(e); + simplified.setEdge(e.v, e.w, { + weight: simpleLabel.weight + label.weight, + minlen: Math.max(simpleLabel.minlen, label.minlen) + }); + }); + return simplified; +} + +function asNonCompoundGraph(g) { + var simplified = new Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph()); + _.each(g.nodes(), function(v) { + if (!g.children(v).length) { + simplified.setNode(v, g.node(v)); + } + }); + _.each(g.edges(), function(e) { + simplified.setEdge(e, g.edge(e)); + }); + return simplified; +} + +function successorWeights(g) { + var weightMap = _.map(g.nodes(), function(v) { + var sucs = {}; + _.each(g.outEdges(v), function(e) { + sucs[e.w] = (sucs[e.w] || 0) + g.edge(e).weight; + }); + return sucs; + }); + return _.zipObject(g.nodes(), weightMap); +} + +function predecessorWeights(g) { + var weightMap = _.map(g.nodes(), function(v) { + var preds = {}; + _.each(g.inEdges(v), function(e) { + preds[e.v] = (preds[e.v] || 0) + g.edge(e).weight; + }); + return preds; + }); + return _.zipObject(g.nodes(), weightMap); +} + +/* + * Finds where a line starting at point ({x, y}) would intersect a rectangle + * ({x, y, width, height}) if it were pointing at the rectangle's center. + */ +function intersectRect(rect, point) { + var x = rect.x; + var y = rect.y; + + // Rectangle intersection algorithm from: + // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes + var dx = point.x - x; + var dy = point.y - y; + var w = rect.width / 2; + var h = rect.height / 2; + + if (!dx && !dy) { + throw new Error("Not possible to find intersection inside of the rectangle"); + } + + var sx, sy; + if (Math.abs(dy) * w > Math.abs(dx) * h) { + // Intersection is top or bottom of rect. + if (dy < 0) { + h = -h; + } + sx = h * dx / dy; + sy = h; + } else { + // Intersection is left or right of rect. + if (dx < 0) { + w = -w; + } + sx = w; + sy = w * dy / dx; + } + + return { x: x + sx, y: y + sy }; +} + +/* + * Given a DAG with each node assigned "rank" and "order" properties, this + * function will produce a matrix with the ids of each node. + */ +function buildLayerMatrix(g) { + var layering = _.map(_.range(maxRank(g) + 1), function() { return []; }); + _.each(g.nodes(), function(v) { + var node = g.node(v), + rank = node.rank; + if (!_.isUndefined(rank)) { + layering[rank][node.order] = v; + } + }); + return layering; +} + +/* + * Adjusts the ranks for all nodes in the graph such that all nodes v have + * rank(v) >= 0 and at least one node w has rank(w) = 0. + */ +function normalizeRanks(g) { + var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); + _.each(g.nodes(), function(v) { + var node = g.node(v); + if (_.has(node, "rank")) { + node.rank -= min; + } + }); +} + +function removeEmptyRanks(g) { + // Ranks may not start at 0, so we need to offset them + var offset = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); + + var layers = []; + _.each(g.nodes(), function(v) { + var rank = g.node(v).rank - offset; + if (!layers[rank]) { + layers[rank] = []; + } + layers[rank].push(v); + }); + + var delta = 0, + nodeRankFactor = g.graph().nodeRankFactor; + _.each(layers, function(vs, i) { + if (_.isUndefined(vs) && i % nodeRankFactor !== 0) { + --delta; + } else if (delta) { + _.each(vs, function(v) { g.node(v).rank += delta; }); + } + }); +} + +function addBorderNode(g, prefix, rank, order) { + var node = { + width: 0, + height: 0 + }; + if (arguments.length >= 4) { + node.rank = rank; + node.order = order; + } + return addDummyNode(g, "border", node, prefix); +} + +function maxRank(g) { + return _.max(_.map(g.nodes(), function(v) { + var rank = g.node(v).rank; + if (!_.isUndefined(rank)) { + return rank; + } + })); +} + +/* + * Partition a collection into two groups: `lhs` and `rhs`. If the supplied + * function returns true for an entry it goes into `lhs`. Otherwise it goes + * into `rhs. + */ +function partition(collection, fn) { + var result = { lhs: [], rhs: [] }; + _.each(collection, function(value) { + if (fn(value)) { + result.lhs.push(value); + } else { + result.rhs.push(value); + } + }); + return result; +} + +/* + * Returns a new function that wraps `fn` with a timer. The wrapper logs the + * time it takes to execute the function. + */ +function time(name, fn) { + var start = _.now(); + try { + return fn(); + } finally { + console.log(name + " time: " + (_.now() - start) + "ms"); + } +} + +function notime(name, fn) { + return fn(); +} + +},{"./graphlib":37,"./lodash":40}],60:[function(require,module,exports){ +module.exports = "0.7.4"; + +},{}],61:[function(require,module,exports){ /** * Copyright (c) 2014, Chris Pettitt * All rights reserved. @@ -11041,7 +13627,7 @@ module.exports = { version: lib.version }; -},{"./lib":49,"./lib/alg":40,"./lib/json":50}],34:[function(require,module,exports){ +},{"./lib":77,"./lib/alg":68,"./lib/json":78}],62:[function(require,module,exports){ var _ = require("../lodash"); module.exports = components; @@ -11070,7 +13656,7 @@ function components(g) { return cmpts; } -},{"../lodash":51}],35:[function(require,module,exports){ +},{"../lodash":79}],63:[function(require,module,exports){ var _ = require("../lodash"); module.exports = dfs; @@ -11111,7 +13697,7 @@ function doDfs(g, v, postorder, visited, acc) { } } -},{"../lodash":51}],36:[function(require,module,exports){ +},{"../lodash":79}],64:[function(require,module,exports){ var dijkstra = require("./dijkstra"), _ = require("../lodash"); @@ -11123,7 +13709,7 @@ function dijkstraAll(g, weightFunc, edgeFunc) { }, {}); } -},{"../lodash":51,"./dijkstra":37}],37:[function(require,module,exports){ +},{"../lodash":79,"./dijkstra":65}],65:[function(require,module,exports){ var _ = require("../lodash"), PriorityQueue = require("../data/priority-queue"); @@ -11179,7 +13765,7 @@ function runDijkstra(g, source, weightFn, edgeFn) { return results; } -},{"../data/priority-queue":47,"../lodash":51}],38:[function(require,module,exports){ +},{"../data/priority-queue":75,"../lodash":79}],66:[function(require,module,exports){ var _ = require("../lodash"), tarjan = require("./tarjan"); @@ -11191,7 +13777,7 @@ function findCycles(g) { }); } -},{"../lodash":51,"./tarjan":45}],39:[function(require,module,exports){ +},{"../lodash":79,"./tarjan":73}],67:[function(require,module,exports){ var _ = require("../lodash"); module.exports = floydWarshall; @@ -11243,7 +13829,7 @@ function runFloydWarshall(g, weightFn, edgeFn) { return results; } -},{"../lodash":51}],40:[function(require,module,exports){ +},{"../lodash":79}],68:[function(require,module,exports){ module.exports = { components: require("./components"), dijkstra: require("./dijkstra"), @@ -11258,7 +13844,7 @@ module.exports = { topsort: require("./topsort") }; -},{"./components":34,"./dijkstra":37,"./dijkstra-all":36,"./find-cycles":38,"./floyd-warshall":39,"./is-acyclic":41,"./postorder":42,"./preorder":43,"./prim":44,"./tarjan":45,"./topsort":46}],41:[function(require,module,exports){ +},{"./components":62,"./dijkstra":65,"./dijkstra-all":64,"./find-cycles":66,"./floyd-warshall":67,"./is-acyclic":69,"./postorder":70,"./preorder":71,"./prim":72,"./tarjan":73,"./topsort":74}],69:[function(require,module,exports){ var topsort = require("./topsort"); module.exports = isAcyclic; @@ -11275,7 +13861,7 @@ function isAcyclic(g) { return true; } -},{"./topsort":46}],42:[function(require,module,exports){ +},{"./topsort":74}],70:[function(require,module,exports){ var dfs = require("./dfs"); module.exports = postorder; @@ -11284,7 +13870,7 @@ function postorder(g, vs) { return dfs(g, vs, "post"); } -},{"./dfs":35}],43:[function(require,module,exports){ +},{"./dfs":63}],71:[function(require,module,exports){ var dfs = require("./dfs"); module.exports = preorder; @@ -11293,7 +13879,7 @@ function preorder(g, vs) { return dfs(g, vs, "pre"); } -},{"./dfs":35}],44:[function(require,module,exports){ +},{"./dfs":63}],72:[function(require,module,exports){ var _ = require("../lodash"), Graph = require("../graph"), PriorityQueue = require("../data/priority-queue"); @@ -11347,7 +13933,7 @@ function prim(g, weightFunc) { return result; } -},{"../data/priority-queue":47,"../graph":48,"../lodash":51}],45:[function(require,module,exports){ +},{"../data/priority-queue":75,"../graph":76,"../lodash":79}],73:[function(require,module,exports){ var _ = require("../lodash"); module.exports = tarjan; @@ -11396,7 +13982,7 @@ function tarjan(g) { return results; } -},{"../lodash":51}],46:[function(require,module,exports){ +},{"../lodash":79}],74:[function(require,module,exports){ var _ = require("../lodash"); module.exports = topsort; @@ -11432,7 +14018,7 @@ function topsort(g) { function CycleException() {} -},{"../lodash":51}],47:[function(require,module,exports){ +},{"../lodash":79}],75:[function(require,module,exports){ var _ = require("../lodash"); module.exports = PriorityQueue; @@ -11586,7 +14172,7 @@ PriorityQueue.prototype._swap = function(i, j) { keyIndices[origArrI.key] = j; }; -},{"../lodash":51}],48:[function(require,module,exports){ +},{"../lodash":79}],76:[function(require,module,exports){ "use strict"; var _ = require("./lodash"); @@ -12107,14 +14693,14 @@ function edgeObjToId(isDirected, edgeObj) { return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name); } -},{"./lodash":51}],49:[function(require,module,exports){ +},{"./lodash":79}],77:[function(require,module,exports){ // Includes only the "core" of graphlib module.exports = { Graph: require("./graph"), version: require("./version") }; -},{"./graph":48,"./version":52}],50:[function(require,module,exports){ +},{"./graph":76,"./version":80}],78:[function(require,module,exports){ var _ = require("./lodash"), Graph = require("./graph"); @@ -12182,27 +14768,345 @@ function read(json) { return g; } -},{"./graph":48,"./lodash":51}],51:[function(require,module,exports){ -/* global window */ - -var lodash; - -if (typeof require === "function") { - try { - lodash = require("lodash"); - } catch (e) {} -} - -if (!lodash) { - lodash = window._; -} - -module.exports = lodash; - -},{"lodash":53}],52:[function(require,module,exports){ +},{"./graph":76,"./lodash":79}],79:[function(require,module,exports){ +module.exports=require(40) +},{"/Users/knut/source/mermaid/node_modules/dagre/lib/lodash.js":40,"lodash":82}],80:[function(require,module,exports){ module.exports = '1.0.7'; -},{}],53:[function(require,module,exports){ +},{}],81:[function(require,module,exports){ +(function (global){ +/*! http://mths.be/he v0.5.0 by @mathias | MIT license */ +;(function(root) { + + // Detect free variables `exports`. + var freeExports = typeof exports == 'object' && exports; + + // Detect free variable `module`. + var freeModule = typeof module == 'object' && module && + module.exports == freeExports && module; + + // Detect free variable `global`, from Node.js or Browserified code, + // and use it as `root`. + var freeGlobal = typeof global == 'object' && global; + if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { + root = freeGlobal; + } + + /*--------------------------------------------------------------------------*/ + + // All astral symbols. + var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; + // All ASCII symbols (not just printable ASCII) except those listed in the + // first column of the overrides table. + // http://whatwg.org/html/tokenization.html#table-charref-overrides + var regexAsciiWhitelist = /[\x01-\x7F]/g; + // All BMP symbols that are not ASCII newlines, printable ASCII symbols, or + // code points listed in the first column of the overrides table on + // http://whatwg.org/html/tokenization.html#table-charref-overrides. + var regexBmpWhitelist = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g; + + var regexEncodeNonAscii = /<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g; + var encodeMap = {'\xC1':'Aacute','\xE1':'aacute','\u0102':'Abreve','\u0103':'abreve','\u223E':'ac','\u223F':'acd','\u223E\u0333':'acE','\xC2':'Acirc','\xE2':'acirc','\xB4':'acute','\u0410':'Acy','\u0430':'acy','\xC6':'AElig','\xE6':'aelig','\u2061':'af','\uD835\uDD04':'Afr','\uD835\uDD1E':'afr','\xC0':'Agrave','\xE0':'agrave','\u2135':'aleph','\u0391':'Alpha','\u03B1':'alpha','\u0100':'Amacr','\u0101':'amacr','\u2A3F':'amalg','&':'amp','\u2A55':'andand','\u2A53':'And','\u2227':'and','\u2A5C':'andd','\u2A58':'andslope','\u2A5A':'andv','\u2220':'ang','\u29A4':'ange','\u29A8':'angmsdaa','\u29A9':'angmsdab','\u29AA':'angmsdac','\u29AB':'angmsdad','\u29AC':'angmsdae','\u29AD':'angmsdaf','\u29AE':'angmsdag','\u29AF':'angmsdah','\u2221':'angmsd','\u221F':'angrt','\u22BE':'angrtvb','\u299D':'angrtvbd','\u2222':'angsph','\xC5':'angst','\u237C':'angzarr','\u0104':'Aogon','\u0105':'aogon','\uD835\uDD38':'Aopf','\uD835\uDD52':'aopf','\u2A6F':'apacir','\u2248':'ap','\u2A70':'apE','\u224A':'ape','\u224B':'apid','\'':'apos','\xE5':'aring','\uD835\uDC9C':'Ascr','\uD835\uDCB6':'ascr','\u2254':'colone','*':'ast','\u224D':'CupCap','\xC3':'Atilde','\xE3':'atilde','\xC4':'Auml','\xE4':'auml','\u2233':'awconint','\u2A11':'awint','\u224C':'bcong','\u03F6':'bepsi','\u2035':'bprime','\u223D':'bsim','\u22CD':'bsime','\u2216':'setmn','\u2AE7':'Barv','\u22BD':'barvee','\u2305':'barwed','\u2306':'Barwed','\u23B5':'bbrk','\u23B6':'bbrktbrk','\u0411':'Bcy','\u0431':'bcy','\u201E':'bdquo','\u2235':'becaus','\u29B0':'bemptyv','\u212C':'Bscr','\u0392':'Beta','\u03B2':'beta','\u2136':'beth','\u226C':'twixt','\uD835\uDD05':'Bfr','\uD835\uDD1F':'bfr','\u22C2':'xcap','\u25EF':'xcirc','\u22C3':'xcup','\u2A00':'xodot','\u2A01':'xoplus','\u2A02':'xotime','\u2A06':'xsqcup','\u2605':'starf','\u25BD':'xdtri','\u25B3':'xutri','\u2A04':'xuplus','\u22C1':'Vee','\u22C0':'Wedge','\u290D':'rbarr','\u29EB':'lozf','\u25AA':'squf','\u25B4':'utrif','\u25BE':'dtrif','\u25C2':'ltrif','\u25B8':'rtrif','\u2423':'blank','\u2592':'blk12','\u2591':'blk14','\u2593':'blk34','\u2588':'block','=\u20E5':'bne','\u2261\u20E5':'bnequiv','\u2AED':'bNot','\u2310':'bnot','\uD835\uDD39':'Bopf','\uD835\uDD53':'bopf','\u22A5':'bot','\u22C8':'bowtie','\u29C9':'boxbox','\u2510':'boxdl','\u2555':'boxdL','\u2556':'boxDl','\u2557':'boxDL','\u250C':'boxdr','\u2552':'boxdR','\u2553':'boxDr','\u2554':'boxDR','\u2500':'boxh','\u2550':'boxH','\u252C':'boxhd','\u2564':'boxHd','\u2565':'boxhD','\u2566':'boxHD','\u2534':'boxhu','\u2567':'boxHu','\u2568':'boxhU','\u2569':'boxHU','\u229F':'minusb','\u229E':'plusb','\u22A0':'timesb','\u2518':'boxul','\u255B':'boxuL','\u255C':'boxUl','\u255D':'boxUL','\u2514':'boxur','\u2558':'boxuR','\u2559':'boxUr','\u255A':'boxUR','\u2502':'boxv','\u2551':'boxV','\u253C':'boxvh','\u256A':'boxvH','\u256B':'boxVh','\u256C':'boxVH','\u2524':'boxvl','\u2561':'boxvL','\u2562':'boxVl','\u2563':'boxVL','\u251C':'boxvr','\u255E':'boxvR','\u255F':'boxVr','\u2560':'boxVR','\u02D8':'breve','\xA6':'brvbar','\uD835\uDCB7':'bscr','\u204F':'bsemi','\u29C5':'bsolb','\\':'bsol','\u27C8':'bsolhsub','\u2022':'bull','\u224E':'bump','\u2AAE':'bumpE','\u224F':'bumpe','\u0106':'Cacute','\u0107':'cacute','\u2A44':'capand','\u2A49':'capbrcup','\u2A4B':'capcap','\u2229':'cap','\u22D2':'Cap','\u2A47':'capcup','\u2A40':'capdot','\u2145':'DD','\u2229\uFE00':'caps','\u2041':'caret','\u02C7':'caron','\u212D':'Cfr','\u2A4D':'ccaps','\u010C':'Ccaron','\u010D':'ccaron','\xC7':'Ccedil','\xE7':'ccedil','\u0108':'Ccirc','\u0109':'ccirc','\u2230':'Cconint','\u2A4C':'ccups','\u2A50':'ccupssm','\u010A':'Cdot','\u010B':'cdot','\xB8':'cedil','\u29B2':'cemptyv','\xA2':'cent','\xB7':'middot','\uD835\uDD20':'cfr','\u0427':'CHcy','\u0447':'chcy','\u2713':'check','\u03A7':'Chi','\u03C7':'chi','\u02C6':'circ','\u2257':'cire','\u21BA':'olarr','\u21BB':'orarr','\u229B':'oast','\u229A':'ocir','\u229D':'odash','\u2299':'odot','\xAE':'reg','\u24C8':'oS','\u2296':'ominus','\u2295':'oplus','\u2297':'otimes','\u25CB':'cir','\u29C3':'cirE','\u2A10':'cirfnint','\u2AEF':'cirmid','\u29C2':'cirscir','\u2232':'cwconint','\u201D':'rdquo','\u2019':'rsquo','\u2663':'clubs',':':'colon','\u2237':'Colon','\u2A74':'Colone',',':'comma','@':'commat','\u2201':'comp','\u2218':'compfn','\u2102':'Copf','\u2245':'cong','\u2A6D':'congdot','\u2261':'equiv','\u222E':'oint','\u222F':'Conint','\uD835\uDD54':'copf','\u2210':'coprod','\xA9':'copy','\u2117':'copysr','\u21B5':'crarr','\u2717':'cross','\u2A2F':'Cross','\uD835\uDC9E':'Cscr','\uD835\uDCB8':'cscr','\u2ACF':'csub','\u2AD1':'csube','\u2AD0':'csup','\u2AD2':'csupe','\u22EF':'ctdot','\u2938':'cudarrl','\u2935':'cudarrr','\u22DE':'cuepr','\u22DF':'cuesc','\u21B6':'cularr','\u293D':'cularrp','\u2A48':'cupbrcap','\u2A46':'cupcap','\u222A':'cup','\u22D3':'Cup','\u2A4A':'cupcup','\u228D':'cupdot','\u2A45':'cupor','\u222A\uFE00':'cups','\u21B7':'curarr','\u293C':'curarrm','\u22CE':'cuvee','\u22CF':'cuwed','\xA4':'curren','\u2231':'cwint','\u232D':'cylcty','\u2020':'dagger','\u2021':'Dagger','\u2138':'daleth','\u2193':'darr','\u21A1':'Darr','\u21D3':'dArr','\u2010':'dash','\u2AE4':'Dashv','\u22A3':'dashv','\u290F':'rBarr','\u02DD':'dblac','\u010E':'Dcaron','\u010F':'dcaron','\u0414':'Dcy','\u0434':'dcy','\u21CA':'ddarr','\u2146':'dd','\u2911':'DDotrahd','\u2A77':'eDDot','\xB0':'deg','\u2207':'Del','\u0394':'Delta','\u03B4':'delta','\u29B1':'demptyv','\u297F':'dfisht','\uD835\uDD07':'Dfr','\uD835\uDD21':'dfr','\u2965':'dHar','\u21C3':'dharl','\u21C2':'dharr','\u02D9':'dot','`':'grave','\u02DC':'tilde','\u22C4':'diam','\u2666':'diams','\xA8':'die','\u03DD':'gammad','\u22F2':'disin','\xF7':'div','\u22C7':'divonx','\u0402':'DJcy','\u0452':'djcy','\u231E':'dlcorn','\u230D':'dlcrop','$':'dollar','\uD835\uDD3B':'Dopf','\uD835\uDD55':'dopf','\u20DC':'DotDot','\u2250':'doteq','\u2251':'eDot','\u2238':'minusd','\u2214':'plusdo','\u22A1':'sdotb','\u21D0':'lArr','\u21D4':'iff','\u27F8':'xlArr','\u27FA':'xhArr','\u27F9':'xrArr','\u21D2':'rArr','\u22A8':'vDash','\u21D1':'uArr','\u21D5':'vArr','\u2225':'par','\u2913':'DownArrowBar','\u21F5':'duarr','\u0311':'DownBreve','\u2950':'DownLeftRightVector','\u295E':'DownLeftTeeVector','\u2956':'DownLeftVectorBar','\u21BD':'lhard','\u295F':'DownRightTeeVector','\u2957':'DownRightVectorBar','\u21C1':'rhard','\u21A7':'mapstodown','\u22A4':'top','\u2910':'RBarr','\u231F':'drcorn','\u230C':'drcrop','\uD835\uDC9F':'Dscr','\uD835\uDCB9':'dscr','\u0405':'DScy','\u0455':'dscy','\u29F6':'dsol','\u0110':'Dstrok','\u0111':'dstrok','\u22F1':'dtdot','\u25BF':'dtri','\u296F':'duhar','\u29A6':'dwangle','\u040F':'DZcy','\u045F':'dzcy','\u27FF':'dzigrarr','\xC9':'Eacute','\xE9':'eacute','\u2A6E':'easter','\u011A':'Ecaron','\u011B':'ecaron','\xCA':'Ecirc','\xEA':'ecirc','\u2256':'ecir','\u2255':'ecolon','\u042D':'Ecy','\u044D':'ecy','\u0116':'Edot','\u0117':'edot','\u2147':'ee','\u2252':'efDot','\uD835\uDD08':'Efr','\uD835\uDD22':'efr','\u2A9A':'eg','\xC8':'Egrave','\xE8':'egrave','\u2A96':'egs','\u2A98':'egsdot','\u2A99':'el','\u2208':'in','\u23E7':'elinters','\u2113':'ell','\u2A95':'els','\u2A97':'elsdot','\u0112':'Emacr','\u0113':'emacr','\u2205':'empty','\u25FB':'EmptySmallSquare','\u25AB':'EmptyVerySmallSquare','\u2004':'emsp13','\u2005':'emsp14','\u2003':'emsp','\u014A':'ENG','\u014B':'eng','\u2002':'ensp','\u0118':'Eogon','\u0119':'eogon','\uD835\uDD3C':'Eopf','\uD835\uDD56':'eopf','\u22D5':'epar','\u29E3':'eparsl','\u2A71':'eplus','\u03B5':'epsi','\u0395':'Epsilon','\u03F5':'epsiv','\u2242':'esim','\u2A75':'Equal','=':'equals','\u225F':'equest','\u21CC':'rlhar','\u2A78':'equivDD','\u29E5':'eqvparsl','\u2971':'erarr','\u2253':'erDot','\u212F':'escr','\u2130':'Escr','\u2A73':'Esim','\u0397':'Eta','\u03B7':'eta','\xD0':'ETH','\xF0':'eth','\xCB':'Euml','\xEB':'euml','\u20AC':'euro','!':'excl','\u2203':'exist','\u0424':'Fcy','\u0444':'fcy','\u2640':'female','\uFB03':'ffilig','\uFB00':'fflig','\uFB04':'ffllig','\uD835\uDD09':'Ffr','\uD835\uDD23':'ffr','\uFB01':'filig','\u25FC':'FilledSmallSquare','fj':'fjlig','\u266D':'flat','\uFB02':'fllig','\u25B1':'fltns','\u0192':'fnof','\uD835\uDD3D':'Fopf','\uD835\uDD57':'fopf','\u2200':'forall','\u22D4':'fork','\u2AD9':'forkv','\u2131':'Fscr','\u2A0D':'fpartint','\xBD':'half','\u2153':'frac13','\xBC':'frac14','\u2155':'frac15','\u2159':'frac16','\u215B':'frac18','\u2154':'frac23','\u2156':'frac25','\xBE':'frac34','\u2157':'frac35','\u215C':'frac38','\u2158':'frac45','\u215A':'frac56','\u215D':'frac58','\u215E':'frac78','\u2044':'frasl','\u2322':'frown','\uD835\uDCBB':'fscr','\u01F5':'gacute','\u0393':'Gamma','\u03B3':'gamma','\u03DC':'Gammad','\u2A86':'gap','\u011E':'Gbreve','\u011F':'gbreve','\u0122':'Gcedil','\u011C':'Gcirc','\u011D':'gcirc','\u0413':'Gcy','\u0433':'gcy','\u0120':'Gdot','\u0121':'gdot','\u2265':'ge','\u2267':'gE','\u2A8C':'gEl','\u22DB':'gel','\u2A7E':'ges','\u2AA9':'gescc','\u2A80':'gesdot','\u2A82':'gesdoto','\u2A84':'gesdotol','\u22DB\uFE00':'gesl','\u2A94':'gesles','\uD835\uDD0A':'Gfr','\uD835\uDD24':'gfr','\u226B':'gg','\u22D9':'Gg','\u2137':'gimel','\u0403':'GJcy','\u0453':'gjcy','\u2AA5':'gla','\u2277':'gl','\u2A92':'glE','\u2AA4':'glj','\u2A8A':'gnap','\u2A88':'gne','\u2269':'gnE','\u22E7':'gnsim','\uD835\uDD3E':'Gopf','\uD835\uDD58':'gopf','\u2AA2':'GreaterGreater','\u2273':'gsim','\uD835\uDCA2':'Gscr','\u210A':'gscr','\u2A8E':'gsime','\u2A90':'gsiml','\u2AA7':'gtcc','\u2A7A':'gtcir','>':'gt','\u22D7':'gtdot','\u2995':'gtlPar','\u2A7C':'gtquest','\u2978':'gtrarr','\u2269\uFE00':'gvnE','\u200A':'hairsp','\u210B':'Hscr','\u042A':'HARDcy','\u044A':'hardcy','\u2948':'harrcir','\u2194':'harr','\u21AD':'harrw','^':'Hat','\u210F':'hbar','\u0124':'Hcirc','\u0125':'hcirc','\u2665':'hearts','\u2026':'mldr','\u22B9':'hercon','\uD835\uDD25':'hfr','\u210C':'Hfr','\u2925':'searhk','\u2926':'swarhk','\u21FF':'hoarr','\u223B':'homtht','\u21A9':'larrhk','\u21AA':'rarrhk','\uD835\uDD59':'hopf','\u210D':'Hopf','\u2015':'horbar','\uD835\uDCBD':'hscr','\u0126':'Hstrok','\u0127':'hstrok','\u2043':'hybull','\xCD':'Iacute','\xED':'iacute','\u2063':'ic','\xCE':'Icirc','\xEE':'icirc','\u0418':'Icy','\u0438':'icy','\u0130':'Idot','\u0415':'IEcy','\u0435':'iecy','\xA1':'iexcl','\uD835\uDD26':'ifr','\u2111':'Im','\xCC':'Igrave','\xEC':'igrave','\u2148':'ii','\u2A0C':'qint','\u222D':'tint','\u29DC':'iinfin','\u2129':'iiota','\u0132':'IJlig','\u0133':'ijlig','\u012A':'Imacr','\u012B':'imacr','\u2110':'Iscr','\u0131':'imath','\u22B7':'imof','\u01B5':'imped','\u2105':'incare','\u221E':'infin','\u29DD':'infintie','\u22BA':'intcal','\u222B':'int','\u222C':'Int','\u2124':'Zopf','\u2A17':'intlarhk','\u2A3C':'iprod','\u2062':'it','\u0401':'IOcy','\u0451':'iocy','\u012E':'Iogon','\u012F':'iogon','\uD835\uDD40':'Iopf','\uD835\uDD5A':'iopf','\u0399':'Iota','\u03B9':'iota','\xBF':'iquest','\uD835\uDCBE':'iscr','\u22F5':'isindot','\u22F9':'isinE','\u22F4':'isins','\u22F3':'isinsv','\u0128':'Itilde','\u0129':'itilde','\u0406':'Iukcy','\u0456':'iukcy','\xCF':'Iuml','\xEF':'iuml','\u0134':'Jcirc','\u0135':'jcirc','\u0419':'Jcy','\u0439':'jcy','\uD835\uDD0D':'Jfr','\uD835\uDD27':'jfr','\u0237':'jmath','\uD835\uDD41':'Jopf','\uD835\uDD5B':'jopf','\uD835\uDCA5':'Jscr','\uD835\uDCBF':'jscr','\u0408':'Jsercy','\u0458':'jsercy','\u0404':'Jukcy','\u0454':'jukcy','\u039A':'Kappa','\u03BA':'kappa','\u03F0':'kappav','\u0136':'Kcedil','\u0137':'kcedil','\u041A':'Kcy','\u043A':'kcy','\uD835\uDD0E':'Kfr','\uD835\uDD28':'kfr','\u0138':'kgreen','\u0425':'KHcy','\u0445':'khcy','\u040C':'KJcy','\u045C':'kjcy','\uD835\uDD42':'Kopf','\uD835\uDD5C':'kopf','\uD835\uDCA6':'Kscr','\uD835\uDCC0':'kscr','\u21DA':'lAarr','\u0139':'Lacute','\u013A':'lacute','\u29B4':'laemptyv','\u2112':'Lscr','\u039B':'Lambda','\u03BB':'lambda','\u27E8':'lang','\u27EA':'Lang','\u2991':'langd','\u2A85':'lap','\xAB':'laquo','\u21E4':'larrb','\u291F':'larrbfs','\u2190':'larr','\u219E':'Larr','\u291D':'larrfs','\u21AB':'larrlp','\u2939':'larrpl','\u2973':'larrsim','\u21A2':'larrtl','\u2919':'latail','\u291B':'lAtail','\u2AAB':'lat','\u2AAD':'late','\u2AAD\uFE00':'lates','\u290C':'lbarr','\u290E':'lBarr','\u2772':'lbbrk','{':'lcub','[':'lsqb','\u298B':'lbrke','\u298F':'lbrksld','\u298D':'lbrkslu','\u013D':'Lcaron','\u013E':'lcaron','\u013B':'Lcedil','\u013C':'lcedil','\u2308':'lceil','\u041B':'Lcy','\u043B':'lcy','\u2936':'ldca','\u201C':'ldquo','\u2967':'ldrdhar','\u294B':'ldrushar','\u21B2':'ldsh','\u2264':'le','\u2266':'lE','\u21C6':'lrarr','\u27E6':'lobrk','\u2961':'LeftDownTeeVector','\u2959':'LeftDownVectorBar','\u230A':'lfloor','\u21BC':'lharu','\u21C7':'llarr','\u21CB':'lrhar','\u294E':'LeftRightVector','\u21A4':'mapstoleft','\u295A':'LeftTeeVector','\u22CB':'lthree','\u29CF':'LeftTriangleBar','\u22B2':'vltri','\u22B4':'ltrie','\u2951':'LeftUpDownVector','\u2960':'LeftUpTeeVector','\u2958':'LeftUpVectorBar','\u21BF':'uharl','\u2952':'LeftVectorBar','\u2A8B':'lEg','\u22DA':'leg','\u2A7D':'les','\u2AA8':'lescc','\u2A7F':'lesdot','\u2A81':'lesdoto','\u2A83':'lesdotor','\u22DA\uFE00':'lesg','\u2A93':'lesges','\u22D6':'ltdot','\u2276':'lg','\u2AA1':'LessLess','\u2272':'lsim','\u297C':'lfisht','\uD835\uDD0F':'Lfr','\uD835\uDD29':'lfr','\u2A91':'lgE','\u2962':'lHar','\u296A':'lharul','\u2584':'lhblk','\u0409':'LJcy','\u0459':'ljcy','\u226A':'ll','\u22D8':'Ll','\u296B':'llhard','\u25FA':'lltri','\u013F':'Lmidot','\u0140':'lmidot','\u23B0':'lmoust','\u2A89':'lnap','\u2A87':'lne','\u2268':'lnE','\u22E6':'lnsim','\u27EC':'loang','\u21FD':'loarr','\u27F5':'xlarr','\u27F7':'xharr','\u27FC':'xmap','\u27F6':'xrarr','\u21AC':'rarrlp','\u2985':'lopar','\uD835\uDD43':'Lopf','\uD835\uDD5D':'lopf','\u2A2D':'loplus','\u2A34':'lotimes','\u2217':'lowast','_':'lowbar','\u2199':'swarr','\u2198':'searr','\u25CA':'loz','(':'lpar','\u2993':'lparlt','\u296D':'lrhard','\u200E':'lrm','\u22BF':'lrtri','\u2039':'lsaquo','\uD835\uDCC1':'lscr','\u21B0':'lsh','\u2A8D':'lsime','\u2A8F':'lsimg','\u2018':'lsquo','\u201A':'sbquo','\u0141':'Lstrok','\u0142':'lstrok','\u2AA6':'ltcc','\u2A79':'ltcir','<':'lt','\u22C9':'ltimes','\u2976':'ltlarr','\u2A7B':'ltquest','\u25C3':'ltri','\u2996':'ltrPar','\u294A':'lurdshar','\u2966':'luruhar','\u2268\uFE00':'lvnE','\xAF':'macr','\u2642':'male','\u2720':'malt','\u2905':'Map','\u21A6':'map','\u21A5':'mapstoup','\u25AE':'marker','\u2A29':'mcomma','\u041C':'Mcy','\u043C':'mcy','\u2014':'mdash','\u223A':'mDDot','\u205F':'MediumSpace','\u2133':'Mscr','\uD835\uDD10':'Mfr','\uD835\uDD2A':'mfr','\u2127':'mho','\xB5':'micro','\u2AF0':'midcir','\u2223':'mid','\u2212':'minus','\u2A2A':'minusdu','\u2213':'mp','\u2ADB':'mlcp','\u22A7':'models','\uD835\uDD44':'Mopf','\uD835\uDD5E':'mopf','\uD835\uDCC2':'mscr','\u039C':'Mu','\u03BC':'mu','\u22B8':'mumap','\u0143':'Nacute','\u0144':'nacute','\u2220\u20D2':'nang','\u2249':'nap','\u2A70\u0338':'napE','\u224B\u0338':'napid','\u0149':'napos','\u266E':'natur','\u2115':'Nopf','\xA0':'nbsp','\u224E\u0338':'nbump','\u224F\u0338':'nbumpe','\u2A43':'ncap','\u0147':'Ncaron','\u0148':'ncaron','\u0145':'Ncedil','\u0146':'ncedil','\u2247':'ncong','\u2A6D\u0338':'ncongdot','\u2A42':'ncup','\u041D':'Ncy','\u043D':'ncy','\u2013':'ndash','\u2924':'nearhk','\u2197':'nearr','\u21D7':'neArr','\u2260':'ne','\u2250\u0338':'nedot','\u200B':'ZeroWidthSpace','\u2262':'nequiv','\u2928':'toea','\u2242\u0338':'nesim','\n':'NewLine','\u2204':'nexist','\uD835\uDD11':'Nfr','\uD835\uDD2B':'nfr','\u2267\u0338':'ngE','\u2271':'nge','\u2A7E\u0338':'nges','\u22D9\u0338':'nGg','\u2275':'ngsim','\u226B\u20D2':'nGt','\u226F':'ngt','\u226B\u0338':'nGtv','\u21AE':'nharr','\u21CE':'nhArr','\u2AF2':'nhpar','\u220B':'ni','\u22FC':'nis','\u22FA':'nisd','\u040A':'NJcy','\u045A':'njcy','\u219A':'nlarr','\u21CD':'nlArr','\u2025':'nldr','\u2266\u0338':'nlE','\u2270':'nle','\u2A7D\u0338':'nles','\u226E':'nlt','\u22D8\u0338':'nLl','\u2274':'nlsim','\u226A\u20D2':'nLt','\u22EA':'nltri','\u22EC':'nltrie','\u226A\u0338':'nLtv','\u2224':'nmid','\u2060':'NoBreak','\uD835\uDD5F':'nopf','\u2AEC':'Not','\xAC':'not','\u226D':'NotCupCap','\u2226':'npar','\u2209':'notin','\u2279':'ntgl','\u22F5\u0338':'notindot','\u22F9\u0338':'notinE','\u22F7':'notinvb','\u22F6':'notinvc','\u29CF\u0338':'NotLeftTriangleBar','\u2278':'ntlg','\u2AA2\u0338':'NotNestedGreaterGreater','\u2AA1\u0338':'NotNestedLessLess','\u220C':'notni','\u22FE':'notnivb','\u22FD':'notnivc','\u2280':'npr','\u2AAF\u0338':'npre','\u22E0':'nprcue','\u29D0\u0338':'NotRightTriangleBar','\u22EB':'nrtri','\u22ED':'nrtrie','\u228F\u0338':'NotSquareSubset','\u22E2':'nsqsube','\u2290\u0338':'NotSquareSuperset','\u22E3':'nsqsupe','\u2282\u20D2':'vnsub','\u2288':'nsube','\u2281':'nsc','\u2AB0\u0338':'nsce','\u22E1':'nsccue','\u227F\u0338':'NotSucceedsTilde','\u2283\u20D2':'vnsup','\u2289':'nsupe','\u2241':'nsim','\u2244':'nsime','\u2AFD\u20E5':'nparsl','\u2202\u0338':'npart','\u2A14':'npolint','\u2933\u0338':'nrarrc','\u219B':'nrarr','\u21CF':'nrArr','\u219D\u0338':'nrarrw','\uD835\uDCA9':'Nscr','\uD835\uDCC3':'nscr','\u2284':'nsub','\u2AC5\u0338':'nsubE','\u2285':'nsup','\u2AC6\u0338':'nsupE','\xD1':'Ntilde','\xF1':'ntilde','\u039D':'Nu','\u03BD':'nu','#':'num','\u2116':'numero','\u2007':'numsp','\u224D\u20D2':'nvap','\u22AC':'nvdash','\u22AD':'nvDash','\u22AE':'nVdash','\u22AF':'nVDash','\u2265\u20D2':'nvge','>\u20D2':'nvgt','\u2904':'nvHarr','\u29DE':'nvinfin','\u2902':'nvlArr','\u2264\u20D2':'nvle','<\u20D2':'nvlt','\u22B4\u20D2':'nvltrie','\u2903':'nvrArr','\u22B5\u20D2':'nvrtrie','\u223C\u20D2':'nvsim','\u2923':'nwarhk','\u2196':'nwarr','\u21D6':'nwArr','\u2927':'nwnear','\xD3':'Oacute','\xF3':'oacute','\xD4':'Ocirc','\xF4':'ocirc','\u041E':'Ocy','\u043E':'ocy','\u0150':'Odblac','\u0151':'odblac','\u2A38':'odiv','\u29BC':'odsold','\u0152':'OElig','\u0153':'oelig','\u29BF':'ofcir','\uD835\uDD12':'Ofr','\uD835\uDD2C':'ofr','\u02DB':'ogon','\xD2':'Ograve','\xF2':'ograve','\u29C1':'ogt','\u29B5':'ohbar','\u03A9':'ohm','\u29BE':'olcir','\u29BB':'olcross','\u203E':'oline','\u29C0':'olt','\u014C':'Omacr','\u014D':'omacr','\u03C9':'omega','\u039F':'Omicron','\u03BF':'omicron','\u29B6':'omid','\uD835\uDD46':'Oopf','\uD835\uDD60':'oopf','\u29B7':'opar','\u29B9':'operp','\u2A54':'Or','\u2228':'or','\u2A5D':'ord','\u2134':'oscr','\xAA':'ordf','\xBA':'ordm','\u22B6':'origof','\u2A56':'oror','\u2A57':'orslope','\u2A5B':'orv','\uD835\uDCAA':'Oscr','\xD8':'Oslash','\xF8':'oslash','\u2298':'osol','\xD5':'Otilde','\xF5':'otilde','\u2A36':'otimesas','\u2A37':'Otimes','\xD6':'Ouml','\xF6':'ouml','\u233D':'ovbar','\u23DE':'OverBrace','\u23B4':'tbrk','\u23DC':'OverParenthesis','\xB6':'para','\u2AF3':'parsim','\u2AFD':'parsl','\u2202':'part','\u041F':'Pcy','\u043F':'pcy','%':'percnt','.':'period','\u2030':'permil','\u2031':'pertenk','\uD835\uDD13':'Pfr','\uD835\uDD2D':'pfr','\u03A6':'Phi','\u03C6':'phi','\u03D5':'phiv','\u260E':'phone','\u03A0':'Pi','\u03C0':'pi','\u03D6':'piv','\u210E':'planckh','\u2A23':'plusacir','\u2A22':'pluscir','+':'plus','\u2A25':'plusdu','\u2A72':'pluse','\xB1':'pm','\u2A26':'plussim','\u2A27':'plustwo','\u2A15':'pointint','\uD835\uDD61':'popf','\u2119':'Popf','\xA3':'pound','\u2AB7':'prap','\u2ABB':'Pr','\u227A':'pr','\u227C':'prcue','\u2AAF':'pre','\u227E':'prsim','\u2AB9':'prnap','\u2AB5':'prnE','\u22E8':'prnsim','\u2AB3':'prE','\u2032':'prime','\u2033':'Prime','\u220F':'prod','\u232E':'profalar','\u2312':'profline','\u2313':'profsurf','\u221D':'prop','\u22B0':'prurel','\uD835\uDCAB':'Pscr','\uD835\uDCC5':'pscr','\u03A8':'Psi','\u03C8':'psi','\u2008':'puncsp','\uD835\uDD14':'Qfr','\uD835\uDD2E':'qfr','\uD835\uDD62':'qopf','\u211A':'Qopf','\u2057':'qprime','\uD835\uDCAC':'Qscr','\uD835\uDCC6':'qscr','\u2A16':'quatint','?':'quest','"':'quot','\u21DB':'rAarr','\u223D\u0331':'race','\u0154':'Racute','\u0155':'racute','\u221A':'Sqrt','\u29B3':'raemptyv','\u27E9':'rang','\u27EB':'Rang','\u2992':'rangd','\u29A5':'range','\xBB':'raquo','\u2975':'rarrap','\u21E5':'rarrb','\u2920':'rarrbfs','\u2933':'rarrc','\u2192':'rarr','\u21A0':'Rarr','\u291E':'rarrfs','\u2945':'rarrpl','\u2974':'rarrsim','\u2916':'Rarrtl','\u21A3':'rarrtl','\u219D':'rarrw','\u291A':'ratail','\u291C':'rAtail','\u2236':'ratio','\u2773':'rbbrk','}':'rcub',']':'rsqb','\u298C':'rbrke','\u298E':'rbrksld','\u2990':'rbrkslu','\u0158':'Rcaron','\u0159':'rcaron','\u0156':'Rcedil','\u0157':'rcedil','\u2309':'rceil','\u0420':'Rcy','\u0440':'rcy','\u2937':'rdca','\u2969':'rdldhar','\u21B3':'rdsh','\u211C':'Re','\u211B':'Rscr','\u211D':'Ropf','\u25AD':'rect','\u297D':'rfisht','\u230B':'rfloor','\uD835\uDD2F':'rfr','\u2964':'rHar','\u21C0':'rharu','\u296C':'rharul','\u03A1':'Rho','\u03C1':'rho','\u03F1':'rhov','\u21C4':'rlarr','\u27E7':'robrk','\u295D':'RightDownTeeVector','\u2955':'RightDownVectorBar','\u21C9':'rrarr','\u22A2':'vdash','\u295B':'RightTeeVector','\u22CC':'rthree','\u29D0':'RightTriangleBar','\u22B3':'vrtri','\u22B5':'rtrie','\u294F':'RightUpDownVector','\u295C':'RightUpTeeVector','\u2954':'RightUpVectorBar','\u21BE':'uharr','\u2953':'RightVectorBar','\u02DA':'ring','\u200F':'rlm','\u23B1':'rmoust','\u2AEE':'rnmid','\u27ED':'roang','\u21FE':'roarr','\u2986':'ropar','\uD835\uDD63':'ropf','\u2A2E':'roplus','\u2A35':'rotimes','\u2970':'RoundImplies',')':'rpar','\u2994':'rpargt','\u2A12':'rppolint','\u203A':'rsaquo','\uD835\uDCC7':'rscr','\u21B1':'rsh','\u22CA':'rtimes','\u25B9':'rtri','\u29CE':'rtriltri','\u29F4':'RuleDelayed','\u2968':'ruluhar','\u211E':'rx','\u015A':'Sacute','\u015B':'sacute','\u2AB8':'scap','\u0160':'Scaron','\u0161':'scaron','\u2ABC':'Sc','\u227B':'sc','\u227D':'sccue','\u2AB0':'sce','\u2AB4':'scE','\u015E':'Scedil','\u015F':'scedil','\u015C':'Scirc','\u015D':'scirc','\u2ABA':'scnap','\u2AB6':'scnE','\u22E9':'scnsim','\u2A13':'scpolint','\u227F':'scsim','\u0421':'Scy','\u0441':'scy','\u22C5':'sdot','\u2A66':'sdote','\u21D8':'seArr','\xA7':'sect',';':'semi','\u2929':'tosa','\u2736':'sext','\uD835\uDD16':'Sfr','\uD835\uDD30':'sfr','\u266F':'sharp','\u0429':'SHCHcy','\u0449':'shchcy','\u0428':'SHcy','\u0448':'shcy','\u2191':'uarr','\xAD':'shy','\u03A3':'Sigma','\u03C3':'sigma','\u03C2':'sigmaf','\u223C':'sim','\u2A6A':'simdot','\u2243':'sime','\u2A9E':'simg','\u2AA0':'simgE','\u2A9D':'siml','\u2A9F':'simlE','\u2246':'simne','\u2A24':'simplus','\u2972':'simrarr','\u2A33':'smashp','\u29E4':'smeparsl','\u2323':'smile','\u2AAA':'smt','\u2AAC':'smte','\u2AAC\uFE00':'smtes','\u042C':'SOFTcy','\u044C':'softcy','\u233F':'solbar','\u29C4':'solb','/':'sol','\uD835\uDD4A':'Sopf','\uD835\uDD64':'sopf','\u2660':'spades','\u2293':'sqcap','\u2293\uFE00':'sqcaps','\u2294':'sqcup','\u2294\uFE00':'sqcups','\u228F':'sqsub','\u2291':'sqsube','\u2290':'sqsup','\u2292':'sqsupe','\u25A1':'squ','\uD835\uDCAE':'Sscr','\uD835\uDCC8':'sscr','\u22C6':'Star','\u2606':'star','\u2282':'sub','\u22D0':'Sub','\u2ABD':'subdot','\u2AC5':'subE','\u2286':'sube','\u2AC3':'subedot','\u2AC1':'submult','\u2ACB':'subnE','\u228A':'subne','\u2ABF':'subplus','\u2979':'subrarr','\u2AC7':'subsim','\u2AD5':'subsub','\u2AD3':'subsup','\u2211':'sum','\u266A':'sung','\xB9':'sup1','\xB2':'sup2','\xB3':'sup3','\u2283':'sup','\u22D1':'Sup','\u2ABE':'supdot','\u2AD8':'supdsub','\u2AC6':'supE','\u2287':'supe','\u2AC4':'supedot','\u27C9':'suphsol','\u2AD7':'suphsub','\u297B':'suplarr','\u2AC2':'supmult','\u2ACC':'supnE','\u228B':'supne','\u2AC0':'supplus','\u2AC8':'supsim','\u2AD4':'supsub','\u2AD6':'supsup','\u21D9':'swArr','\u292A':'swnwar','\xDF':'szlig','\t':'Tab','\u2316':'target','\u03A4':'Tau','\u03C4':'tau','\u0164':'Tcaron','\u0165':'tcaron','\u0162':'Tcedil','\u0163':'tcedil','\u0422':'Tcy','\u0442':'tcy','\u20DB':'tdot','\u2315':'telrec','\uD835\uDD17':'Tfr','\uD835\uDD31':'tfr','\u2234':'there4','\u0398':'Theta','\u03B8':'theta','\u03D1':'thetav','\u205F\u200A':'ThickSpace','\u2009':'thinsp','\xDE':'THORN','\xFE':'thorn','\u2A31':'timesbar','\xD7':'times','\u2A30':'timesd','\u2336':'topbot','\u2AF1':'topcir','\uD835\uDD4B':'Topf','\uD835\uDD65':'topf','\u2ADA':'topfork','\u2034':'tprime','\u2122':'trade','\u25B5':'utri','\u225C':'trie','\u25EC':'tridot','\u2A3A':'triminus','\u2A39':'triplus','\u29CD':'trisb','\u2A3B':'tritime','\u23E2':'trpezium','\uD835\uDCAF':'Tscr','\uD835\uDCC9':'tscr','\u0426':'TScy','\u0446':'tscy','\u040B':'TSHcy','\u045B':'tshcy','\u0166':'Tstrok','\u0167':'tstrok','\xDA':'Uacute','\xFA':'uacute','\u219F':'Uarr','\u2949':'Uarrocir','\u040E':'Ubrcy','\u045E':'ubrcy','\u016C':'Ubreve','\u016D':'ubreve','\xDB':'Ucirc','\xFB':'ucirc','\u0423':'Ucy','\u0443':'ucy','\u21C5':'udarr','\u0170':'Udblac','\u0171':'udblac','\u296E':'udhar','\u297E':'ufisht','\uD835\uDD18':'Ufr','\uD835\uDD32':'ufr','\xD9':'Ugrave','\xF9':'ugrave','\u2963':'uHar','\u2580':'uhblk','\u231C':'ulcorn','\u230F':'ulcrop','\u25F8':'ultri','\u016A':'Umacr','\u016B':'umacr','\u23DF':'UnderBrace','\u23DD':'UnderParenthesis','\u228E':'uplus','\u0172':'Uogon','\u0173':'uogon','\uD835\uDD4C':'Uopf','\uD835\uDD66':'uopf','\u2912':'UpArrowBar','\u2195':'varr','\u03C5':'upsi','\u03D2':'Upsi','\u03A5':'Upsilon','\u21C8':'uuarr','\u231D':'urcorn','\u230E':'urcrop','\u016E':'Uring','\u016F':'uring','\u25F9':'urtri','\uD835\uDCB0':'Uscr','\uD835\uDCCA':'uscr','\u22F0':'utdot','\u0168':'Utilde','\u0169':'utilde','\xDC':'Uuml','\xFC':'uuml','\u29A7':'uwangle','\u299C':'vangrt','\u228A\uFE00':'vsubne','\u2ACB\uFE00':'vsubnE','\u228B\uFE00':'vsupne','\u2ACC\uFE00':'vsupnE','\u2AE8':'vBar','\u2AEB':'Vbar','\u2AE9':'vBarv','\u0412':'Vcy','\u0432':'vcy','\u22A9':'Vdash','\u22AB':'VDash','\u2AE6':'Vdashl','\u22BB':'veebar','\u225A':'veeeq','\u22EE':'vellip','|':'vert','\u2016':'Vert','\u2758':'VerticalSeparator','\u2240':'wr','\uD835\uDD19':'Vfr','\uD835\uDD33':'vfr','\uD835\uDD4D':'Vopf','\uD835\uDD67':'vopf','\uD835\uDCB1':'Vscr','\uD835\uDCCB':'vscr','\u22AA':'Vvdash','\u299A':'vzigzag','\u0174':'Wcirc','\u0175':'wcirc','\u2A5F':'wedbar','\u2259':'wedgeq','\u2118':'wp','\uD835\uDD1A':'Wfr','\uD835\uDD34':'wfr','\uD835\uDD4E':'Wopf','\uD835\uDD68':'wopf','\uD835\uDCB2':'Wscr','\uD835\uDCCC':'wscr','\uD835\uDD1B':'Xfr','\uD835\uDD35':'xfr','\u039E':'Xi','\u03BE':'xi','\u22FB':'xnis','\uD835\uDD4F':'Xopf','\uD835\uDD69':'xopf','\uD835\uDCB3':'Xscr','\uD835\uDCCD':'xscr','\xDD':'Yacute','\xFD':'yacute','\u042F':'YAcy','\u044F':'yacy','\u0176':'Ycirc','\u0177':'ycirc','\u042B':'Ycy','\u044B':'ycy','\xA5':'yen','\uD835\uDD1C':'Yfr','\uD835\uDD36':'yfr','\u0407':'YIcy','\u0457':'yicy','\uD835\uDD50':'Yopf','\uD835\uDD6A':'yopf','\uD835\uDCB4':'Yscr','\uD835\uDCCE':'yscr','\u042E':'YUcy','\u044E':'yucy','\xFF':'yuml','\u0178':'Yuml','\u0179':'Zacute','\u017A':'zacute','\u017D':'Zcaron','\u017E':'zcaron','\u0417':'Zcy','\u0437':'zcy','\u017B':'Zdot','\u017C':'zdot','\u2128':'Zfr','\u0396':'Zeta','\u03B6':'zeta','\uD835\uDD37':'zfr','\u0416':'ZHcy','\u0436':'zhcy','\u21DD':'zigrarr','\uD835\uDD6B':'zopf','\uD835\uDCB5':'Zscr','\uD835\uDCCF':'zscr','\u200D':'zwj','\u200C':'zwnj'}; + + var regexEscape = /["&'<>`]/g; + var escapeMap = { + '"': '"', + '&': '&', + '\'': ''', + '<': '<', + // See https://mathiasbynens.be/notes/ambiguous-ampersands: in HTML, the + // following is not strictly necessary unless it’s part of a tag or an + // unquoted attribute value. We’re only escaping it to support those + // situations, and for XML support. + '>': '>', + // In Internet Explorer ≤ 8, the backtick character can be used + // to break out of (un)quoted attribute values or HTML comments. + // See http://html5sec.org/#102, http://html5sec.org/#108, and + // http://html5sec.org/#133. + '`': '`' + }; + + var regexInvalidEntity = /&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/; + var regexInvalidRawCodePoint = /[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + var regexDecode = /&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|iacute|Uacute|plusmn|otilde|Otilde|Agrave|agrave|yacute|Yacute|oslash|Oslash|Atilde|atilde|brvbar|Ccedil|ccedil|ograve|curren|divide|Eacute|eacute|Ograve|oacute|Egrave|egrave|ugrave|frac12|frac14|frac34|Ugrave|Oacute|Iacute|ntilde|Ntilde|uacute|middot|Igrave|igrave|iquest|aacute|laquo|THORN|micro|iexcl|icirc|Icirc|Acirc|ucirc|ecirc|Ocirc|ocirc|Ecirc|Ucirc|aring|Aring|aelig|AElig|acute|pound|raquo|acirc|times|thorn|szlig|cedil|COPY|Auml|ordf|ordm|uuml|macr|Uuml|auml|Ouml|ouml|para|nbsp|Euml|quot|QUOT|euml|yuml|cent|sect|copy|sup1|sup2|sup3|Iuml|iuml|shy|eth|reg|not|yen|amp|AMP|REG|uml|ETH|deg|gt|GT|LT|lt)([=a-zA-Z0-9])?/g; + var decodeMap = {'Aacute':'\xC1','aacute':'\xE1','Abreve':'\u0102','abreve':'\u0103','ac':'\u223E','acd':'\u223F','acE':'\u223E\u0333','Acirc':'\xC2','acirc':'\xE2','acute':'\xB4','Acy':'\u0410','acy':'\u0430','AElig':'\xC6','aelig':'\xE6','af':'\u2061','Afr':'\uD835\uDD04','afr':'\uD835\uDD1E','Agrave':'\xC0','agrave':'\xE0','alefsym':'\u2135','aleph':'\u2135','Alpha':'\u0391','alpha':'\u03B1','Amacr':'\u0100','amacr':'\u0101','amalg':'\u2A3F','amp':'&','AMP':'&','andand':'\u2A55','And':'\u2A53','and':'\u2227','andd':'\u2A5C','andslope':'\u2A58','andv':'\u2A5A','ang':'\u2220','ange':'\u29A4','angle':'\u2220','angmsdaa':'\u29A8','angmsdab':'\u29A9','angmsdac':'\u29AA','angmsdad':'\u29AB','angmsdae':'\u29AC','angmsdaf':'\u29AD','angmsdag':'\u29AE','angmsdah':'\u29AF','angmsd':'\u2221','angrt':'\u221F','angrtvb':'\u22BE','angrtvbd':'\u299D','angsph':'\u2222','angst':'\xC5','angzarr':'\u237C','Aogon':'\u0104','aogon':'\u0105','Aopf':'\uD835\uDD38','aopf':'\uD835\uDD52','apacir':'\u2A6F','ap':'\u2248','apE':'\u2A70','ape':'\u224A','apid':'\u224B','apos':'\'','ApplyFunction':'\u2061','approx':'\u2248','approxeq':'\u224A','Aring':'\xC5','aring':'\xE5','Ascr':'\uD835\uDC9C','ascr':'\uD835\uDCB6','Assign':'\u2254','ast':'*','asymp':'\u2248','asympeq':'\u224D','Atilde':'\xC3','atilde':'\xE3','Auml':'\xC4','auml':'\xE4','awconint':'\u2233','awint':'\u2A11','backcong':'\u224C','backepsilon':'\u03F6','backprime':'\u2035','backsim':'\u223D','backsimeq':'\u22CD','Backslash':'\u2216','Barv':'\u2AE7','barvee':'\u22BD','barwed':'\u2305','Barwed':'\u2306','barwedge':'\u2305','bbrk':'\u23B5','bbrktbrk':'\u23B6','bcong':'\u224C','Bcy':'\u0411','bcy':'\u0431','bdquo':'\u201E','becaus':'\u2235','because':'\u2235','Because':'\u2235','bemptyv':'\u29B0','bepsi':'\u03F6','bernou':'\u212C','Bernoullis':'\u212C','Beta':'\u0392','beta':'\u03B2','beth':'\u2136','between':'\u226C','Bfr':'\uD835\uDD05','bfr':'\uD835\uDD1F','bigcap':'\u22C2','bigcirc':'\u25EF','bigcup':'\u22C3','bigodot':'\u2A00','bigoplus':'\u2A01','bigotimes':'\u2A02','bigsqcup':'\u2A06','bigstar':'\u2605','bigtriangledown':'\u25BD','bigtriangleup':'\u25B3','biguplus':'\u2A04','bigvee':'\u22C1','bigwedge':'\u22C0','bkarow':'\u290D','blacklozenge':'\u29EB','blacksquare':'\u25AA','blacktriangle':'\u25B4','blacktriangledown':'\u25BE','blacktriangleleft':'\u25C2','blacktriangleright':'\u25B8','blank':'\u2423','blk12':'\u2592','blk14':'\u2591','blk34':'\u2593','block':'\u2588','bne':'=\u20E5','bnequiv':'\u2261\u20E5','bNot':'\u2AED','bnot':'\u2310','Bopf':'\uD835\uDD39','bopf':'\uD835\uDD53','bot':'\u22A5','bottom':'\u22A5','bowtie':'\u22C8','boxbox':'\u29C9','boxdl':'\u2510','boxdL':'\u2555','boxDl':'\u2556','boxDL':'\u2557','boxdr':'\u250C','boxdR':'\u2552','boxDr':'\u2553','boxDR':'\u2554','boxh':'\u2500','boxH':'\u2550','boxhd':'\u252C','boxHd':'\u2564','boxhD':'\u2565','boxHD':'\u2566','boxhu':'\u2534','boxHu':'\u2567','boxhU':'\u2568','boxHU':'\u2569','boxminus':'\u229F','boxplus':'\u229E','boxtimes':'\u22A0','boxul':'\u2518','boxuL':'\u255B','boxUl':'\u255C','boxUL':'\u255D','boxur':'\u2514','boxuR':'\u2558','boxUr':'\u2559','boxUR':'\u255A','boxv':'\u2502','boxV':'\u2551','boxvh':'\u253C','boxvH':'\u256A','boxVh':'\u256B','boxVH':'\u256C','boxvl':'\u2524','boxvL':'\u2561','boxVl':'\u2562','boxVL':'\u2563','boxvr':'\u251C','boxvR':'\u255E','boxVr':'\u255F','boxVR':'\u2560','bprime':'\u2035','breve':'\u02D8','Breve':'\u02D8','brvbar':'\xA6','bscr':'\uD835\uDCB7','Bscr':'\u212C','bsemi':'\u204F','bsim':'\u223D','bsime':'\u22CD','bsolb':'\u29C5','bsol':'\\','bsolhsub':'\u27C8','bull':'\u2022','bullet':'\u2022','bump':'\u224E','bumpE':'\u2AAE','bumpe':'\u224F','Bumpeq':'\u224E','bumpeq':'\u224F','Cacute':'\u0106','cacute':'\u0107','capand':'\u2A44','capbrcup':'\u2A49','capcap':'\u2A4B','cap':'\u2229','Cap':'\u22D2','capcup':'\u2A47','capdot':'\u2A40','CapitalDifferentialD':'\u2145','caps':'\u2229\uFE00','caret':'\u2041','caron':'\u02C7','Cayleys':'\u212D','ccaps':'\u2A4D','Ccaron':'\u010C','ccaron':'\u010D','Ccedil':'\xC7','ccedil':'\xE7','Ccirc':'\u0108','ccirc':'\u0109','Cconint':'\u2230','ccups':'\u2A4C','ccupssm':'\u2A50','Cdot':'\u010A','cdot':'\u010B','cedil':'\xB8','Cedilla':'\xB8','cemptyv':'\u29B2','cent':'\xA2','centerdot':'\xB7','CenterDot':'\xB7','cfr':'\uD835\uDD20','Cfr':'\u212D','CHcy':'\u0427','chcy':'\u0447','check':'\u2713','checkmark':'\u2713','Chi':'\u03A7','chi':'\u03C7','circ':'\u02C6','circeq':'\u2257','circlearrowleft':'\u21BA','circlearrowright':'\u21BB','circledast':'\u229B','circledcirc':'\u229A','circleddash':'\u229D','CircleDot':'\u2299','circledR':'\xAE','circledS':'\u24C8','CircleMinus':'\u2296','CirclePlus':'\u2295','CircleTimes':'\u2297','cir':'\u25CB','cirE':'\u29C3','cire':'\u2257','cirfnint':'\u2A10','cirmid':'\u2AEF','cirscir':'\u29C2','ClockwiseContourIntegral':'\u2232','CloseCurlyDoubleQuote':'\u201D','CloseCurlyQuote':'\u2019','clubs':'\u2663','clubsuit':'\u2663','colon':':','Colon':'\u2237','Colone':'\u2A74','colone':'\u2254','coloneq':'\u2254','comma':',','commat':'@','comp':'\u2201','compfn':'\u2218','complement':'\u2201','complexes':'\u2102','cong':'\u2245','congdot':'\u2A6D','Congruent':'\u2261','conint':'\u222E','Conint':'\u222F','ContourIntegral':'\u222E','copf':'\uD835\uDD54','Copf':'\u2102','coprod':'\u2210','Coproduct':'\u2210','copy':'\xA9','COPY':'\xA9','copysr':'\u2117','CounterClockwiseContourIntegral':'\u2233','crarr':'\u21B5','cross':'\u2717','Cross':'\u2A2F','Cscr':'\uD835\uDC9E','cscr':'\uD835\uDCB8','csub':'\u2ACF','csube':'\u2AD1','csup':'\u2AD0','csupe':'\u2AD2','ctdot':'\u22EF','cudarrl':'\u2938','cudarrr':'\u2935','cuepr':'\u22DE','cuesc':'\u22DF','cularr':'\u21B6','cularrp':'\u293D','cupbrcap':'\u2A48','cupcap':'\u2A46','CupCap':'\u224D','cup':'\u222A','Cup':'\u22D3','cupcup':'\u2A4A','cupdot':'\u228D','cupor':'\u2A45','cups':'\u222A\uFE00','curarr':'\u21B7','curarrm':'\u293C','curlyeqprec':'\u22DE','curlyeqsucc':'\u22DF','curlyvee':'\u22CE','curlywedge':'\u22CF','curren':'\xA4','curvearrowleft':'\u21B6','curvearrowright':'\u21B7','cuvee':'\u22CE','cuwed':'\u22CF','cwconint':'\u2232','cwint':'\u2231','cylcty':'\u232D','dagger':'\u2020','Dagger':'\u2021','daleth':'\u2138','darr':'\u2193','Darr':'\u21A1','dArr':'\u21D3','dash':'\u2010','Dashv':'\u2AE4','dashv':'\u22A3','dbkarow':'\u290F','dblac':'\u02DD','Dcaron':'\u010E','dcaron':'\u010F','Dcy':'\u0414','dcy':'\u0434','ddagger':'\u2021','ddarr':'\u21CA','DD':'\u2145','dd':'\u2146','DDotrahd':'\u2911','ddotseq':'\u2A77','deg':'\xB0','Del':'\u2207','Delta':'\u0394','delta':'\u03B4','demptyv':'\u29B1','dfisht':'\u297F','Dfr':'\uD835\uDD07','dfr':'\uD835\uDD21','dHar':'\u2965','dharl':'\u21C3','dharr':'\u21C2','DiacriticalAcute':'\xB4','DiacriticalDot':'\u02D9','DiacriticalDoubleAcute':'\u02DD','DiacriticalGrave':'`','DiacriticalTilde':'\u02DC','diam':'\u22C4','diamond':'\u22C4','Diamond':'\u22C4','diamondsuit':'\u2666','diams':'\u2666','die':'\xA8','DifferentialD':'\u2146','digamma':'\u03DD','disin':'\u22F2','div':'\xF7','divide':'\xF7','divideontimes':'\u22C7','divonx':'\u22C7','DJcy':'\u0402','djcy':'\u0452','dlcorn':'\u231E','dlcrop':'\u230D','dollar':'$','Dopf':'\uD835\uDD3B','dopf':'\uD835\uDD55','Dot':'\xA8','dot':'\u02D9','DotDot':'\u20DC','doteq':'\u2250','doteqdot':'\u2251','DotEqual':'\u2250','dotminus':'\u2238','dotplus':'\u2214','dotsquare':'\u22A1','doublebarwedge':'\u2306','DoubleContourIntegral':'\u222F','DoubleDot':'\xA8','DoubleDownArrow':'\u21D3','DoubleLeftArrow':'\u21D0','DoubleLeftRightArrow':'\u21D4','DoubleLeftTee':'\u2AE4','DoubleLongLeftArrow':'\u27F8','DoubleLongLeftRightArrow':'\u27FA','DoubleLongRightArrow':'\u27F9','DoubleRightArrow':'\u21D2','DoubleRightTee':'\u22A8','DoubleUpArrow':'\u21D1','DoubleUpDownArrow':'\u21D5','DoubleVerticalBar':'\u2225','DownArrowBar':'\u2913','downarrow':'\u2193','DownArrow':'\u2193','Downarrow':'\u21D3','DownArrowUpArrow':'\u21F5','DownBreve':'\u0311','downdownarrows':'\u21CA','downharpoonleft':'\u21C3','downharpoonright':'\u21C2','DownLeftRightVector':'\u2950','DownLeftTeeVector':'\u295E','DownLeftVectorBar':'\u2956','DownLeftVector':'\u21BD','DownRightTeeVector':'\u295F','DownRightVectorBar':'\u2957','DownRightVector':'\u21C1','DownTeeArrow':'\u21A7','DownTee':'\u22A4','drbkarow':'\u2910','drcorn':'\u231F','drcrop':'\u230C','Dscr':'\uD835\uDC9F','dscr':'\uD835\uDCB9','DScy':'\u0405','dscy':'\u0455','dsol':'\u29F6','Dstrok':'\u0110','dstrok':'\u0111','dtdot':'\u22F1','dtri':'\u25BF','dtrif':'\u25BE','duarr':'\u21F5','duhar':'\u296F','dwangle':'\u29A6','DZcy':'\u040F','dzcy':'\u045F','dzigrarr':'\u27FF','Eacute':'\xC9','eacute':'\xE9','easter':'\u2A6E','Ecaron':'\u011A','ecaron':'\u011B','Ecirc':'\xCA','ecirc':'\xEA','ecir':'\u2256','ecolon':'\u2255','Ecy':'\u042D','ecy':'\u044D','eDDot':'\u2A77','Edot':'\u0116','edot':'\u0117','eDot':'\u2251','ee':'\u2147','efDot':'\u2252','Efr':'\uD835\uDD08','efr':'\uD835\uDD22','eg':'\u2A9A','Egrave':'\xC8','egrave':'\xE8','egs':'\u2A96','egsdot':'\u2A98','el':'\u2A99','Element':'\u2208','elinters':'\u23E7','ell':'\u2113','els':'\u2A95','elsdot':'\u2A97','Emacr':'\u0112','emacr':'\u0113','empty':'\u2205','emptyset':'\u2205','EmptySmallSquare':'\u25FB','emptyv':'\u2205','EmptyVerySmallSquare':'\u25AB','emsp13':'\u2004','emsp14':'\u2005','emsp':'\u2003','ENG':'\u014A','eng':'\u014B','ensp':'\u2002','Eogon':'\u0118','eogon':'\u0119','Eopf':'\uD835\uDD3C','eopf':'\uD835\uDD56','epar':'\u22D5','eparsl':'\u29E3','eplus':'\u2A71','epsi':'\u03B5','Epsilon':'\u0395','epsilon':'\u03B5','epsiv':'\u03F5','eqcirc':'\u2256','eqcolon':'\u2255','eqsim':'\u2242','eqslantgtr':'\u2A96','eqslantless':'\u2A95','Equal':'\u2A75','equals':'=','EqualTilde':'\u2242','equest':'\u225F','Equilibrium':'\u21CC','equiv':'\u2261','equivDD':'\u2A78','eqvparsl':'\u29E5','erarr':'\u2971','erDot':'\u2253','escr':'\u212F','Escr':'\u2130','esdot':'\u2250','Esim':'\u2A73','esim':'\u2242','Eta':'\u0397','eta':'\u03B7','ETH':'\xD0','eth':'\xF0','Euml':'\xCB','euml':'\xEB','euro':'\u20AC','excl':'!','exist':'\u2203','Exists':'\u2203','expectation':'\u2130','exponentiale':'\u2147','ExponentialE':'\u2147','fallingdotseq':'\u2252','Fcy':'\u0424','fcy':'\u0444','female':'\u2640','ffilig':'\uFB03','fflig':'\uFB00','ffllig':'\uFB04','Ffr':'\uD835\uDD09','ffr':'\uD835\uDD23','filig':'\uFB01','FilledSmallSquare':'\u25FC','FilledVerySmallSquare':'\u25AA','fjlig':'fj','flat':'\u266D','fllig':'\uFB02','fltns':'\u25B1','fnof':'\u0192','Fopf':'\uD835\uDD3D','fopf':'\uD835\uDD57','forall':'\u2200','ForAll':'\u2200','fork':'\u22D4','forkv':'\u2AD9','Fouriertrf':'\u2131','fpartint':'\u2A0D','frac12':'\xBD','frac13':'\u2153','frac14':'\xBC','frac15':'\u2155','frac16':'\u2159','frac18':'\u215B','frac23':'\u2154','frac25':'\u2156','frac34':'\xBE','frac35':'\u2157','frac38':'\u215C','frac45':'\u2158','frac56':'\u215A','frac58':'\u215D','frac78':'\u215E','frasl':'\u2044','frown':'\u2322','fscr':'\uD835\uDCBB','Fscr':'\u2131','gacute':'\u01F5','Gamma':'\u0393','gamma':'\u03B3','Gammad':'\u03DC','gammad':'\u03DD','gap':'\u2A86','Gbreve':'\u011E','gbreve':'\u011F','Gcedil':'\u0122','Gcirc':'\u011C','gcirc':'\u011D','Gcy':'\u0413','gcy':'\u0433','Gdot':'\u0120','gdot':'\u0121','ge':'\u2265','gE':'\u2267','gEl':'\u2A8C','gel':'\u22DB','geq':'\u2265','geqq':'\u2267','geqslant':'\u2A7E','gescc':'\u2AA9','ges':'\u2A7E','gesdot':'\u2A80','gesdoto':'\u2A82','gesdotol':'\u2A84','gesl':'\u22DB\uFE00','gesles':'\u2A94','Gfr':'\uD835\uDD0A','gfr':'\uD835\uDD24','gg':'\u226B','Gg':'\u22D9','ggg':'\u22D9','gimel':'\u2137','GJcy':'\u0403','gjcy':'\u0453','gla':'\u2AA5','gl':'\u2277','glE':'\u2A92','glj':'\u2AA4','gnap':'\u2A8A','gnapprox':'\u2A8A','gne':'\u2A88','gnE':'\u2269','gneq':'\u2A88','gneqq':'\u2269','gnsim':'\u22E7','Gopf':'\uD835\uDD3E','gopf':'\uD835\uDD58','grave':'`','GreaterEqual':'\u2265','GreaterEqualLess':'\u22DB','GreaterFullEqual':'\u2267','GreaterGreater':'\u2AA2','GreaterLess':'\u2277','GreaterSlantEqual':'\u2A7E','GreaterTilde':'\u2273','Gscr':'\uD835\uDCA2','gscr':'\u210A','gsim':'\u2273','gsime':'\u2A8E','gsiml':'\u2A90','gtcc':'\u2AA7','gtcir':'\u2A7A','gt':'>','GT':'>','Gt':'\u226B','gtdot':'\u22D7','gtlPar':'\u2995','gtquest':'\u2A7C','gtrapprox':'\u2A86','gtrarr':'\u2978','gtrdot':'\u22D7','gtreqless':'\u22DB','gtreqqless':'\u2A8C','gtrless':'\u2277','gtrsim':'\u2273','gvertneqq':'\u2269\uFE00','gvnE':'\u2269\uFE00','Hacek':'\u02C7','hairsp':'\u200A','half':'\xBD','hamilt':'\u210B','HARDcy':'\u042A','hardcy':'\u044A','harrcir':'\u2948','harr':'\u2194','hArr':'\u21D4','harrw':'\u21AD','Hat':'^','hbar':'\u210F','Hcirc':'\u0124','hcirc':'\u0125','hearts':'\u2665','heartsuit':'\u2665','hellip':'\u2026','hercon':'\u22B9','hfr':'\uD835\uDD25','Hfr':'\u210C','HilbertSpace':'\u210B','hksearow':'\u2925','hkswarow':'\u2926','hoarr':'\u21FF','homtht':'\u223B','hookleftarrow':'\u21A9','hookrightarrow':'\u21AA','hopf':'\uD835\uDD59','Hopf':'\u210D','horbar':'\u2015','HorizontalLine':'\u2500','hscr':'\uD835\uDCBD','Hscr':'\u210B','hslash':'\u210F','Hstrok':'\u0126','hstrok':'\u0127','HumpDownHump':'\u224E','HumpEqual':'\u224F','hybull':'\u2043','hyphen':'\u2010','Iacute':'\xCD','iacute':'\xED','ic':'\u2063','Icirc':'\xCE','icirc':'\xEE','Icy':'\u0418','icy':'\u0438','Idot':'\u0130','IEcy':'\u0415','iecy':'\u0435','iexcl':'\xA1','iff':'\u21D4','ifr':'\uD835\uDD26','Ifr':'\u2111','Igrave':'\xCC','igrave':'\xEC','ii':'\u2148','iiiint':'\u2A0C','iiint':'\u222D','iinfin':'\u29DC','iiota':'\u2129','IJlig':'\u0132','ijlig':'\u0133','Imacr':'\u012A','imacr':'\u012B','image':'\u2111','ImaginaryI':'\u2148','imagline':'\u2110','imagpart':'\u2111','imath':'\u0131','Im':'\u2111','imof':'\u22B7','imped':'\u01B5','Implies':'\u21D2','incare':'\u2105','in':'\u2208','infin':'\u221E','infintie':'\u29DD','inodot':'\u0131','intcal':'\u22BA','int':'\u222B','Int':'\u222C','integers':'\u2124','Integral':'\u222B','intercal':'\u22BA','Intersection':'\u22C2','intlarhk':'\u2A17','intprod':'\u2A3C','InvisibleComma':'\u2063','InvisibleTimes':'\u2062','IOcy':'\u0401','iocy':'\u0451','Iogon':'\u012E','iogon':'\u012F','Iopf':'\uD835\uDD40','iopf':'\uD835\uDD5A','Iota':'\u0399','iota':'\u03B9','iprod':'\u2A3C','iquest':'\xBF','iscr':'\uD835\uDCBE','Iscr':'\u2110','isin':'\u2208','isindot':'\u22F5','isinE':'\u22F9','isins':'\u22F4','isinsv':'\u22F3','isinv':'\u2208','it':'\u2062','Itilde':'\u0128','itilde':'\u0129','Iukcy':'\u0406','iukcy':'\u0456','Iuml':'\xCF','iuml':'\xEF','Jcirc':'\u0134','jcirc':'\u0135','Jcy':'\u0419','jcy':'\u0439','Jfr':'\uD835\uDD0D','jfr':'\uD835\uDD27','jmath':'\u0237','Jopf':'\uD835\uDD41','jopf':'\uD835\uDD5B','Jscr':'\uD835\uDCA5','jscr':'\uD835\uDCBF','Jsercy':'\u0408','jsercy':'\u0458','Jukcy':'\u0404','jukcy':'\u0454','Kappa':'\u039A','kappa':'\u03BA','kappav':'\u03F0','Kcedil':'\u0136','kcedil':'\u0137','Kcy':'\u041A','kcy':'\u043A','Kfr':'\uD835\uDD0E','kfr':'\uD835\uDD28','kgreen':'\u0138','KHcy':'\u0425','khcy':'\u0445','KJcy':'\u040C','kjcy':'\u045C','Kopf':'\uD835\uDD42','kopf':'\uD835\uDD5C','Kscr':'\uD835\uDCA6','kscr':'\uD835\uDCC0','lAarr':'\u21DA','Lacute':'\u0139','lacute':'\u013A','laemptyv':'\u29B4','lagran':'\u2112','Lambda':'\u039B','lambda':'\u03BB','lang':'\u27E8','Lang':'\u27EA','langd':'\u2991','langle':'\u27E8','lap':'\u2A85','Laplacetrf':'\u2112','laquo':'\xAB','larrb':'\u21E4','larrbfs':'\u291F','larr':'\u2190','Larr':'\u219E','lArr':'\u21D0','larrfs':'\u291D','larrhk':'\u21A9','larrlp':'\u21AB','larrpl':'\u2939','larrsim':'\u2973','larrtl':'\u21A2','latail':'\u2919','lAtail':'\u291B','lat':'\u2AAB','late':'\u2AAD','lates':'\u2AAD\uFE00','lbarr':'\u290C','lBarr':'\u290E','lbbrk':'\u2772','lbrace':'{','lbrack':'[','lbrke':'\u298B','lbrksld':'\u298F','lbrkslu':'\u298D','Lcaron':'\u013D','lcaron':'\u013E','Lcedil':'\u013B','lcedil':'\u013C','lceil':'\u2308','lcub':'{','Lcy':'\u041B','lcy':'\u043B','ldca':'\u2936','ldquo':'\u201C','ldquor':'\u201E','ldrdhar':'\u2967','ldrushar':'\u294B','ldsh':'\u21B2','le':'\u2264','lE':'\u2266','LeftAngleBracket':'\u27E8','LeftArrowBar':'\u21E4','leftarrow':'\u2190','LeftArrow':'\u2190','Leftarrow':'\u21D0','LeftArrowRightArrow':'\u21C6','leftarrowtail':'\u21A2','LeftCeiling':'\u2308','LeftDoubleBracket':'\u27E6','LeftDownTeeVector':'\u2961','LeftDownVectorBar':'\u2959','LeftDownVector':'\u21C3','LeftFloor':'\u230A','leftharpoondown':'\u21BD','leftharpoonup':'\u21BC','leftleftarrows':'\u21C7','leftrightarrow':'\u2194','LeftRightArrow':'\u2194','Leftrightarrow':'\u21D4','leftrightarrows':'\u21C6','leftrightharpoons':'\u21CB','leftrightsquigarrow':'\u21AD','LeftRightVector':'\u294E','LeftTeeArrow':'\u21A4','LeftTee':'\u22A3','LeftTeeVector':'\u295A','leftthreetimes':'\u22CB','LeftTriangleBar':'\u29CF','LeftTriangle':'\u22B2','LeftTriangleEqual':'\u22B4','LeftUpDownVector':'\u2951','LeftUpTeeVector':'\u2960','LeftUpVectorBar':'\u2958','LeftUpVector':'\u21BF','LeftVectorBar':'\u2952','LeftVector':'\u21BC','lEg':'\u2A8B','leg':'\u22DA','leq':'\u2264','leqq':'\u2266','leqslant':'\u2A7D','lescc':'\u2AA8','les':'\u2A7D','lesdot':'\u2A7F','lesdoto':'\u2A81','lesdotor':'\u2A83','lesg':'\u22DA\uFE00','lesges':'\u2A93','lessapprox':'\u2A85','lessdot':'\u22D6','lesseqgtr':'\u22DA','lesseqqgtr':'\u2A8B','LessEqualGreater':'\u22DA','LessFullEqual':'\u2266','LessGreater':'\u2276','lessgtr':'\u2276','LessLess':'\u2AA1','lesssim':'\u2272','LessSlantEqual':'\u2A7D','LessTilde':'\u2272','lfisht':'\u297C','lfloor':'\u230A','Lfr':'\uD835\uDD0F','lfr':'\uD835\uDD29','lg':'\u2276','lgE':'\u2A91','lHar':'\u2962','lhard':'\u21BD','lharu':'\u21BC','lharul':'\u296A','lhblk':'\u2584','LJcy':'\u0409','ljcy':'\u0459','llarr':'\u21C7','ll':'\u226A','Ll':'\u22D8','llcorner':'\u231E','Lleftarrow':'\u21DA','llhard':'\u296B','lltri':'\u25FA','Lmidot':'\u013F','lmidot':'\u0140','lmoustache':'\u23B0','lmoust':'\u23B0','lnap':'\u2A89','lnapprox':'\u2A89','lne':'\u2A87','lnE':'\u2268','lneq':'\u2A87','lneqq':'\u2268','lnsim':'\u22E6','loang':'\u27EC','loarr':'\u21FD','lobrk':'\u27E6','longleftarrow':'\u27F5','LongLeftArrow':'\u27F5','Longleftarrow':'\u27F8','longleftrightarrow':'\u27F7','LongLeftRightArrow':'\u27F7','Longleftrightarrow':'\u27FA','longmapsto':'\u27FC','longrightarrow':'\u27F6','LongRightArrow':'\u27F6','Longrightarrow':'\u27F9','looparrowleft':'\u21AB','looparrowright':'\u21AC','lopar':'\u2985','Lopf':'\uD835\uDD43','lopf':'\uD835\uDD5D','loplus':'\u2A2D','lotimes':'\u2A34','lowast':'\u2217','lowbar':'_','LowerLeftArrow':'\u2199','LowerRightArrow':'\u2198','loz':'\u25CA','lozenge':'\u25CA','lozf':'\u29EB','lpar':'(','lparlt':'\u2993','lrarr':'\u21C6','lrcorner':'\u231F','lrhar':'\u21CB','lrhard':'\u296D','lrm':'\u200E','lrtri':'\u22BF','lsaquo':'\u2039','lscr':'\uD835\uDCC1','Lscr':'\u2112','lsh':'\u21B0','Lsh':'\u21B0','lsim':'\u2272','lsime':'\u2A8D','lsimg':'\u2A8F','lsqb':'[','lsquo':'\u2018','lsquor':'\u201A','Lstrok':'\u0141','lstrok':'\u0142','ltcc':'\u2AA6','ltcir':'\u2A79','lt':'<','LT':'<','Lt':'\u226A','ltdot':'\u22D6','lthree':'\u22CB','ltimes':'\u22C9','ltlarr':'\u2976','ltquest':'\u2A7B','ltri':'\u25C3','ltrie':'\u22B4','ltrif':'\u25C2','ltrPar':'\u2996','lurdshar':'\u294A','luruhar':'\u2966','lvertneqq':'\u2268\uFE00','lvnE':'\u2268\uFE00','macr':'\xAF','male':'\u2642','malt':'\u2720','maltese':'\u2720','Map':'\u2905','map':'\u21A6','mapsto':'\u21A6','mapstodown':'\u21A7','mapstoleft':'\u21A4','mapstoup':'\u21A5','marker':'\u25AE','mcomma':'\u2A29','Mcy':'\u041C','mcy':'\u043C','mdash':'\u2014','mDDot':'\u223A','measuredangle':'\u2221','MediumSpace':'\u205F','Mellintrf':'\u2133','Mfr':'\uD835\uDD10','mfr':'\uD835\uDD2A','mho':'\u2127','micro':'\xB5','midast':'*','midcir':'\u2AF0','mid':'\u2223','middot':'\xB7','minusb':'\u229F','minus':'\u2212','minusd':'\u2238','minusdu':'\u2A2A','MinusPlus':'\u2213','mlcp':'\u2ADB','mldr':'\u2026','mnplus':'\u2213','models':'\u22A7','Mopf':'\uD835\uDD44','mopf':'\uD835\uDD5E','mp':'\u2213','mscr':'\uD835\uDCC2','Mscr':'\u2133','mstpos':'\u223E','Mu':'\u039C','mu':'\u03BC','multimap':'\u22B8','mumap':'\u22B8','nabla':'\u2207','Nacute':'\u0143','nacute':'\u0144','nang':'\u2220\u20D2','nap':'\u2249','napE':'\u2A70\u0338','napid':'\u224B\u0338','napos':'\u0149','napprox':'\u2249','natural':'\u266E','naturals':'\u2115','natur':'\u266E','nbsp':'\xA0','nbump':'\u224E\u0338','nbumpe':'\u224F\u0338','ncap':'\u2A43','Ncaron':'\u0147','ncaron':'\u0148','Ncedil':'\u0145','ncedil':'\u0146','ncong':'\u2247','ncongdot':'\u2A6D\u0338','ncup':'\u2A42','Ncy':'\u041D','ncy':'\u043D','ndash':'\u2013','nearhk':'\u2924','nearr':'\u2197','neArr':'\u21D7','nearrow':'\u2197','ne':'\u2260','nedot':'\u2250\u0338','NegativeMediumSpace':'\u200B','NegativeThickSpace':'\u200B','NegativeThinSpace':'\u200B','NegativeVeryThinSpace':'\u200B','nequiv':'\u2262','nesear':'\u2928','nesim':'\u2242\u0338','NestedGreaterGreater':'\u226B','NestedLessLess':'\u226A','NewLine':'\n','nexist':'\u2204','nexists':'\u2204','Nfr':'\uD835\uDD11','nfr':'\uD835\uDD2B','ngE':'\u2267\u0338','nge':'\u2271','ngeq':'\u2271','ngeqq':'\u2267\u0338','ngeqslant':'\u2A7E\u0338','nges':'\u2A7E\u0338','nGg':'\u22D9\u0338','ngsim':'\u2275','nGt':'\u226B\u20D2','ngt':'\u226F','ngtr':'\u226F','nGtv':'\u226B\u0338','nharr':'\u21AE','nhArr':'\u21CE','nhpar':'\u2AF2','ni':'\u220B','nis':'\u22FC','nisd':'\u22FA','niv':'\u220B','NJcy':'\u040A','njcy':'\u045A','nlarr':'\u219A','nlArr':'\u21CD','nldr':'\u2025','nlE':'\u2266\u0338','nle':'\u2270','nleftarrow':'\u219A','nLeftarrow':'\u21CD','nleftrightarrow':'\u21AE','nLeftrightarrow':'\u21CE','nleq':'\u2270','nleqq':'\u2266\u0338','nleqslant':'\u2A7D\u0338','nles':'\u2A7D\u0338','nless':'\u226E','nLl':'\u22D8\u0338','nlsim':'\u2274','nLt':'\u226A\u20D2','nlt':'\u226E','nltri':'\u22EA','nltrie':'\u22EC','nLtv':'\u226A\u0338','nmid':'\u2224','NoBreak':'\u2060','NonBreakingSpace':'\xA0','nopf':'\uD835\uDD5F','Nopf':'\u2115','Not':'\u2AEC','not':'\xAC','NotCongruent':'\u2262','NotCupCap':'\u226D','NotDoubleVerticalBar':'\u2226','NotElement':'\u2209','NotEqual':'\u2260','NotEqualTilde':'\u2242\u0338','NotExists':'\u2204','NotGreater':'\u226F','NotGreaterEqual':'\u2271','NotGreaterFullEqual':'\u2267\u0338','NotGreaterGreater':'\u226B\u0338','NotGreaterLess':'\u2279','NotGreaterSlantEqual':'\u2A7E\u0338','NotGreaterTilde':'\u2275','NotHumpDownHump':'\u224E\u0338','NotHumpEqual':'\u224F\u0338','notin':'\u2209','notindot':'\u22F5\u0338','notinE':'\u22F9\u0338','notinva':'\u2209','notinvb':'\u22F7','notinvc':'\u22F6','NotLeftTriangleBar':'\u29CF\u0338','NotLeftTriangle':'\u22EA','NotLeftTriangleEqual':'\u22EC','NotLess':'\u226E','NotLessEqual':'\u2270','NotLessGreater':'\u2278','NotLessLess':'\u226A\u0338','NotLessSlantEqual':'\u2A7D\u0338','NotLessTilde':'\u2274','NotNestedGreaterGreater':'\u2AA2\u0338','NotNestedLessLess':'\u2AA1\u0338','notni':'\u220C','notniva':'\u220C','notnivb':'\u22FE','notnivc':'\u22FD','NotPrecedes':'\u2280','NotPrecedesEqual':'\u2AAF\u0338','NotPrecedesSlantEqual':'\u22E0','NotReverseElement':'\u220C','NotRightTriangleBar':'\u29D0\u0338','NotRightTriangle':'\u22EB','NotRightTriangleEqual':'\u22ED','NotSquareSubset':'\u228F\u0338','NotSquareSubsetEqual':'\u22E2','NotSquareSuperset':'\u2290\u0338','NotSquareSupersetEqual':'\u22E3','NotSubset':'\u2282\u20D2','NotSubsetEqual':'\u2288','NotSucceeds':'\u2281','NotSucceedsEqual':'\u2AB0\u0338','NotSucceedsSlantEqual':'\u22E1','NotSucceedsTilde':'\u227F\u0338','NotSuperset':'\u2283\u20D2','NotSupersetEqual':'\u2289','NotTilde':'\u2241','NotTildeEqual':'\u2244','NotTildeFullEqual':'\u2247','NotTildeTilde':'\u2249','NotVerticalBar':'\u2224','nparallel':'\u2226','npar':'\u2226','nparsl':'\u2AFD\u20E5','npart':'\u2202\u0338','npolint':'\u2A14','npr':'\u2280','nprcue':'\u22E0','nprec':'\u2280','npreceq':'\u2AAF\u0338','npre':'\u2AAF\u0338','nrarrc':'\u2933\u0338','nrarr':'\u219B','nrArr':'\u21CF','nrarrw':'\u219D\u0338','nrightarrow':'\u219B','nRightarrow':'\u21CF','nrtri':'\u22EB','nrtrie':'\u22ED','nsc':'\u2281','nsccue':'\u22E1','nsce':'\u2AB0\u0338','Nscr':'\uD835\uDCA9','nscr':'\uD835\uDCC3','nshortmid':'\u2224','nshortparallel':'\u2226','nsim':'\u2241','nsime':'\u2244','nsimeq':'\u2244','nsmid':'\u2224','nspar':'\u2226','nsqsube':'\u22E2','nsqsupe':'\u22E3','nsub':'\u2284','nsubE':'\u2AC5\u0338','nsube':'\u2288','nsubset':'\u2282\u20D2','nsubseteq':'\u2288','nsubseteqq':'\u2AC5\u0338','nsucc':'\u2281','nsucceq':'\u2AB0\u0338','nsup':'\u2285','nsupE':'\u2AC6\u0338','nsupe':'\u2289','nsupset':'\u2283\u20D2','nsupseteq':'\u2289','nsupseteqq':'\u2AC6\u0338','ntgl':'\u2279','Ntilde':'\xD1','ntilde':'\xF1','ntlg':'\u2278','ntriangleleft':'\u22EA','ntrianglelefteq':'\u22EC','ntriangleright':'\u22EB','ntrianglerighteq':'\u22ED','Nu':'\u039D','nu':'\u03BD','num':'#','numero':'\u2116','numsp':'\u2007','nvap':'\u224D\u20D2','nvdash':'\u22AC','nvDash':'\u22AD','nVdash':'\u22AE','nVDash':'\u22AF','nvge':'\u2265\u20D2','nvgt':'>\u20D2','nvHarr':'\u2904','nvinfin':'\u29DE','nvlArr':'\u2902','nvle':'\u2264\u20D2','nvlt':'<\u20D2','nvltrie':'\u22B4\u20D2','nvrArr':'\u2903','nvrtrie':'\u22B5\u20D2','nvsim':'\u223C\u20D2','nwarhk':'\u2923','nwarr':'\u2196','nwArr':'\u21D6','nwarrow':'\u2196','nwnear':'\u2927','Oacute':'\xD3','oacute':'\xF3','oast':'\u229B','Ocirc':'\xD4','ocirc':'\xF4','ocir':'\u229A','Ocy':'\u041E','ocy':'\u043E','odash':'\u229D','Odblac':'\u0150','odblac':'\u0151','odiv':'\u2A38','odot':'\u2299','odsold':'\u29BC','OElig':'\u0152','oelig':'\u0153','ofcir':'\u29BF','Ofr':'\uD835\uDD12','ofr':'\uD835\uDD2C','ogon':'\u02DB','Ograve':'\xD2','ograve':'\xF2','ogt':'\u29C1','ohbar':'\u29B5','ohm':'\u03A9','oint':'\u222E','olarr':'\u21BA','olcir':'\u29BE','olcross':'\u29BB','oline':'\u203E','olt':'\u29C0','Omacr':'\u014C','omacr':'\u014D','Omega':'\u03A9','omega':'\u03C9','Omicron':'\u039F','omicron':'\u03BF','omid':'\u29B6','ominus':'\u2296','Oopf':'\uD835\uDD46','oopf':'\uD835\uDD60','opar':'\u29B7','OpenCurlyDoubleQuote':'\u201C','OpenCurlyQuote':'\u2018','operp':'\u29B9','oplus':'\u2295','orarr':'\u21BB','Or':'\u2A54','or':'\u2228','ord':'\u2A5D','order':'\u2134','orderof':'\u2134','ordf':'\xAA','ordm':'\xBA','origof':'\u22B6','oror':'\u2A56','orslope':'\u2A57','orv':'\u2A5B','oS':'\u24C8','Oscr':'\uD835\uDCAA','oscr':'\u2134','Oslash':'\xD8','oslash':'\xF8','osol':'\u2298','Otilde':'\xD5','otilde':'\xF5','otimesas':'\u2A36','Otimes':'\u2A37','otimes':'\u2297','Ouml':'\xD6','ouml':'\xF6','ovbar':'\u233D','OverBar':'\u203E','OverBrace':'\u23DE','OverBracket':'\u23B4','OverParenthesis':'\u23DC','para':'\xB6','parallel':'\u2225','par':'\u2225','parsim':'\u2AF3','parsl':'\u2AFD','part':'\u2202','PartialD':'\u2202','Pcy':'\u041F','pcy':'\u043F','percnt':'%','period':'.','permil':'\u2030','perp':'\u22A5','pertenk':'\u2031','Pfr':'\uD835\uDD13','pfr':'\uD835\uDD2D','Phi':'\u03A6','phi':'\u03C6','phiv':'\u03D5','phmmat':'\u2133','phone':'\u260E','Pi':'\u03A0','pi':'\u03C0','pitchfork':'\u22D4','piv':'\u03D6','planck':'\u210F','planckh':'\u210E','plankv':'\u210F','plusacir':'\u2A23','plusb':'\u229E','pluscir':'\u2A22','plus':'+','plusdo':'\u2214','plusdu':'\u2A25','pluse':'\u2A72','PlusMinus':'\xB1','plusmn':'\xB1','plussim':'\u2A26','plustwo':'\u2A27','pm':'\xB1','Poincareplane':'\u210C','pointint':'\u2A15','popf':'\uD835\uDD61','Popf':'\u2119','pound':'\xA3','prap':'\u2AB7','Pr':'\u2ABB','pr':'\u227A','prcue':'\u227C','precapprox':'\u2AB7','prec':'\u227A','preccurlyeq':'\u227C','Precedes':'\u227A','PrecedesEqual':'\u2AAF','PrecedesSlantEqual':'\u227C','PrecedesTilde':'\u227E','preceq':'\u2AAF','precnapprox':'\u2AB9','precneqq':'\u2AB5','precnsim':'\u22E8','pre':'\u2AAF','prE':'\u2AB3','precsim':'\u227E','prime':'\u2032','Prime':'\u2033','primes':'\u2119','prnap':'\u2AB9','prnE':'\u2AB5','prnsim':'\u22E8','prod':'\u220F','Product':'\u220F','profalar':'\u232E','profline':'\u2312','profsurf':'\u2313','prop':'\u221D','Proportional':'\u221D','Proportion':'\u2237','propto':'\u221D','prsim':'\u227E','prurel':'\u22B0','Pscr':'\uD835\uDCAB','pscr':'\uD835\uDCC5','Psi':'\u03A8','psi':'\u03C8','puncsp':'\u2008','Qfr':'\uD835\uDD14','qfr':'\uD835\uDD2E','qint':'\u2A0C','qopf':'\uD835\uDD62','Qopf':'\u211A','qprime':'\u2057','Qscr':'\uD835\uDCAC','qscr':'\uD835\uDCC6','quaternions':'\u210D','quatint':'\u2A16','quest':'?','questeq':'\u225F','quot':'"','QUOT':'"','rAarr':'\u21DB','race':'\u223D\u0331','Racute':'\u0154','racute':'\u0155','radic':'\u221A','raemptyv':'\u29B3','rang':'\u27E9','Rang':'\u27EB','rangd':'\u2992','range':'\u29A5','rangle':'\u27E9','raquo':'\xBB','rarrap':'\u2975','rarrb':'\u21E5','rarrbfs':'\u2920','rarrc':'\u2933','rarr':'\u2192','Rarr':'\u21A0','rArr':'\u21D2','rarrfs':'\u291E','rarrhk':'\u21AA','rarrlp':'\u21AC','rarrpl':'\u2945','rarrsim':'\u2974','Rarrtl':'\u2916','rarrtl':'\u21A3','rarrw':'\u219D','ratail':'\u291A','rAtail':'\u291C','ratio':'\u2236','rationals':'\u211A','rbarr':'\u290D','rBarr':'\u290F','RBarr':'\u2910','rbbrk':'\u2773','rbrace':'}','rbrack':']','rbrke':'\u298C','rbrksld':'\u298E','rbrkslu':'\u2990','Rcaron':'\u0158','rcaron':'\u0159','Rcedil':'\u0156','rcedil':'\u0157','rceil':'\u2309','rcub':'}','Rcy':'\u0420','rcy':'\u0440','rdca':'\u2937','rdldhar':'\u2969','rdquo':'\u201D','rdquor':'\u201D','rdsh':'\u21B3','real':'\u211C','realine':'\u211B','realpart':'\u211C','reals':'\u211D','Re':'\u211C','rect':'\u25AD','reg':'\xAE','REG':'\xAE','ReverseElement':'\u220B','ReverseEquilibrium':'\u21CB','ReverseUpEquilibrium':'\u296F','rfisht':'\u297D','rfloor':'\u230B','rfr':'\uD835\uDD2F','Rfr':'\u211C','rHar':'\u2964','rhard':'\u21C1','rharu':'\u21C0','rharul':'\u296C','Rho':'\u03A1','rho':'\u03C1','rhov':'\u03F1','RightAngleBracket':'\u27E9','RightArrowBar':'\u21E5','rightarrow':'\u2192','RightArrow':'\u2192','Rightarrow':'\u21D2','RightArrowLeftArrow':'\u21C4','rightarrowtail':'\u21A3','RightCeiling':'\u2309','RightDoubleBracket':'\u27E7','RightDownTeeVector':'\u295D','RightDownVectorBar':'\u2955','RightDownVector':'\u21C2','RightFloor':'\u230B','rightharpoondown':'\u21C1','rightharpoonup':'\u21C0','rightleftarrows':'\u21C4','rightleftharpoons':'\u21CC','rightrightarrows':'\u21C9','rightsquigarrow':'\u219D','RightTeeArrow':'\u21A6','RightTee':'\u22A2','RightTeeVector':'\u295B','rightthreetimes':'\u22CC','RightTriangleBar':'\u29D0','RightTriangle':'\u22B3','RightTriangleEqual':'\u22B5','RightUpDownVector':'\u294F','RightUpTeeVector':'\u295C','RightUpVectorBar':'\u2954','RightUpVector':'\u21BE','RightVectorBar':'\u2953','RightVector':'\u21C0','ring':'\u02DA','risingdotseq':'\u2253','rlarr':'\u21C4','rlhar':'\u21CC','rlm':'\u200F','rmoustache':'\u23B1','rmoust':'\u23B1','rnmid':'\u2AEE','roang':'\u27ED','roarr':'\u21FE','robrk':'\u27E7','ropar':'\u2986','ropf':'\uD835\uDD63','Ropf':'\u211D','roplus':'\u2A2E','rotimes':'\u2A35','RoundImplies':'\u2970','rpar':')','rpargt':'\u2994','rppolint':'\u2A12','rrarr':'\u21C9','Rrightarrow':'\u21DB','rsaquo':'\u203A','rscr':'\uD835\uDCC7','Rscr':'\u211B','rsh':'\u21B1','Rsh':'\u21B1','rsqb':']','rsquo':'\u2019','rsquor':'\u2019','rthree':'\u22CC','rtimes':'\u22CA','rtri':'\u25B9','rtrie':'\u22B5','rtrif':'\u25B8','rtriltri':'\u29CE','RuleDelayed':'\u29F4','ruluhar':'\u2968','rx':'\u211E','Sacute':'\u015A','sacute':'\u015B','sbquo':'\u201A','scap':'\u2AB8','Scaron':'\u0160','scaron':'\u0161','Sc':'\u2ABC','sc':'\u227B','sccue':'\u227D','sce':'\u2AB0','scE':'\u2AB4','Scedil':'\u015E','scedil':'\u015F','Scirc':'\u015C','scirc':'\u015D','scnap':'\u2ABA','scnE':'\u2AB6','scnsim':'\u22E9','scpolint':'\u2A13','scsim':'\u227F','Scy':'\u0421','scy':'\u0441','sdotb':'\u22A1','sdot':'\u22C5','sdote':'\u2A66','searhk':'\u2925','searr':'\u2198','seArr':'\u21D8','searrow':'\u2198','sect':'\xA7','semi':';','seswar':'\u2929','setminus':'\u2216','setmn':'\u2216','sext':'\u2736','Sfr':'\uD835\uDD16','sfr':'\uD835\uDD30','sfrown':'\u2322','sharp':'\u266F','SHCHcy':'\u0429','shchcy':'\u0449','SHcy':'\u0428','shcy':'\u0448','ShortDownArrow':'\u2193','ShortLeftArrow':'\u2190','shortmid':'\u2223','shortparallel':'\u2225','ShortRightArrow':'\u2192','ShortUpArrow':'\u2191','shy':'\xAD','Sigma':'\u03A3','sigma':'\u03C3','sigmaf':'\u03C2','sigmav':'\u03C2','sim':'\u223C','simdot':'\u2A6A','sime':'\u2243','simeq':'\u2243','simg':'\u2A9E','simgE':'\u2AA0','siml':'\u2A9D','simlE':'\u2A9F','simne':'\u2246','simplus':'\u2A24','simrarr':'\u2972','slarr':'\u2190','SmallCircle':'\u2218','smallsetminus':'\u2216','smashp':'\u2A33','smeparsl':'\u29E4','smid':'\u2223','smile':'\u2323','smt':'\u2AAA','smte':'\u2AAC','smtes':'\u2AAC\uFE00','SOFTcy':'\u042C','softcy':'\u044C','solbar':'\u233F','solb':'\u29C4','sol':'/','Sopf':'\uD835\uDD4A','sopf':'\uD835\uDD64','spades':'\u2660','spadesuit':'\u2660','spar':'\u2225','sqcap':'\u2293','sqcaps':'\u2293\uFE00','sqcup':'\u2294','sqcups':'\u2294\uFE00','Sqrt':'\u221A','sqsub':'\u228F','sqsube':'\u2291','sqsubset':'\u228F','sqsubseteq':'\u2291','sqsup':'\u2290','sqsupe':'\u2292','sqsupset':'\u2290','sqsupseteq':'\u2292','square':'\u25A1','Square':'\u25A1','SquareIntersection':'\u2293','SquareSubset':'\u228F','SquareSubsetEqual':'\u2291','SquareSuperset':'\u2290','SquareSupersetEqual':'\u2292','SquareUnion':'\u2294','squarf':'\u25AA','squ':'\u25A1','squf':'\u25AA','srarr':'\u2192','Sscr':'\uD835\uDCAE','sscr':'\uD835\uDCC8','ssetmn':'\u2216','ssmile':'\u2323','sstarf':'\u22C6','Star':'\u22C6','star':'\u2606','starf':'\u2605','straightepsilon':'\u03F5','straightphi':'\u03D5','strns':'\xAF','sub':'\u2282','Sub':'\u22D0','subdot':'\u2ABD','subE':'\u2AC5','sube':'\u2286','subedot':'\u2AC3','submult':'\u2AC1','subnE':'\u2ACB','subne':'\u228A','subplus':'\u2ABF','subrarr':'\u2979','subset':'\u2282','Subset':'\u22D0','subseteq':'\u2286','subseteqq':'\u2AC5','SubsetEqual':'\u2286','subsetneq':'\u228A','subsetneqq':'\u2ACB','subsim':'\u2AC7','subsub':'\u2AD5','subsup':'\u2AD3','succapprox':'\u2AB8','succ':'\u227B','succcurlyeq':'\u227D','Succeeds':'\u227B','SucceedsEqual':'\u2AB0','SucceedsSlantEqual':'\u227D','SucceedsTilde':'\u227F','succeq':'\u2AB0','succnapprox':'\u2ABA','succneqq':'\u2AB6','succnsim':'\u22E9','succsim':'\u227F','SuchThat':'\u220B','sum':'\u2211','Sum':'\u2211','sung':'\u266A','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','sup':'\u2283','Sup':'\u22D1','supdot':'\u2ABE','supdsub':'\u2AD8','supE':'\u2AC6','supe':'\u2287','supedot':'\u2AC4','Superset':'\u2283','SupersetEqual':'\u2287','suphsol':'\u27C9','suphsub':'\u2AD7','suplarr':'\u297B','supmult':'\u2AC2','supnE':'\u2ACC','supne':'\u228B','supplus':'\u2AC0','supset':'\u2283','Supset':'\u22D1','supseteq':'\u2287','supseteqq':'\u2AC6','supsetneq':'\u228B','supsetneqq':'\u2ACC','supsim':'\u2AC8','supsub':'\u2AD4','supsup':'\u2AD6','swarhk':'\u2926','swarr':'\u2199','swArr':'\u21D9','swarrow':'\u2199','swnwar':'\u292A','szlig':'\xDF','Tab':'\t','target':'\u2316','Tau':'\u03A4','tau':'\u03C4','tbrk':'\u23B4','Tcaron':'\u0164','tcaron':'\u0165','Tcedil':'\u0162','tcedil':'\u0163','Tcy':'\u0422','tcy':'\u0442','tdot':'\u20DB','telrec':'\u2315','Tfr':'\uD835\uDD17','tfr':'\uD835\uDD31','there4':'\u2234','therefore':'\u2234','Therefore':'\u2234','Theta':'\u0398','theta':'\u03B8','thetasym':'\u03D1','thetav':'\u03D1','thickapprox':'\u2248','thicksim':'\u223C','ThickSpace':'\u205F\u200A','ThinSpace':'\u2009','thinsp':'\u2009','thkap':'\u2248','thksim':'\u223C','THORN':'\xDE','thorn':'\xFE','tilde':'\u02DC','Tilde':'\u223C','TildeEqual':'\u2243','TildeFullEqual':'\u2245','TildeTilde':'\u2248','timesbar':'\u2A31','timesb':'\u22A0','times':'\xD7','timesd':'\u2A30','tint':'\u222D','toea':'\u2928','topbot':'\u2336','topcir':'\u2AF1','top':'\u22A4','Topf':'\uD835\uDD4B','topf':'\uD835\uDD65','topfork':'\u2ADA','tosa':'\u2929','tprime':'\u2034','trade':'\u2122','TRADE':'\u2122','triangle':'\u25B5','triangledown':'\u25BF','triangleleft':'\u25C3','trianglelefteq':'\u22B4','triangleq':'\u225C','triangleright':'\u25B9','trianglerighteq':'\u22B5','tridot':'\u25EC','trie':'\u225C','triminus':'\u2A3A','TripleDot':'\u20DB','triplus':'\u2A39','trisb':'\u29CD','tritime':'\u2A3B','trpezium':'\u23E2','Tscr':'\uD835\uDCAF','tscr':'\uD835\uDCC9','TScy':'\u0426','tscy':'\u0446','TSHcy':'\u040B','tshcy':'\u045B','Tstrok':'\u0166','tstrok':'\u0167','twixt':'\u226C','twoheadleftarrow':'\u219E','twoheadrightarrow':'\u21A0','Uacute':'\xDA','uacute':'\xFA','uarr':'\u2191','Uarr':'\u219F','uArr':'\u21D1','Uarrocir':'\u2949','Ubrcy':'\u040E','ubrcy':'\u045E','Ubreve':'\u016C','ubreve':'\u016D','Ucirc':'\xDB','ucirc':'\xFB','Ucy':'\u0423','ucy':'\u0443','udarr':'\u21C5','Udblac':'\u0170','udblac':'\u0171','udhar':'\u296E','ufisht':'\u297E','Ufr':'\uD835\uDD18','ufr':'\uD835\uDD32','Ugrave':'\xD9','ugrave':'\xF9','uHar':'\u2963','uharl':'\u21BF','uharr':'\u21BE','uhblk':'\u2580','ulcorn':'\u231C','ulcorner':'\u231C','ulcrop':'\u230F','ultri':'\u25F8','Umacr':'\u016A','umacr':'\u016B','uml':'\xA8','UnderBar':'_','UnderBrace':'\u23DF','UnderBracket':'\u23B5','UnderParenthesis':'\u23DD','Union':'\u22C3','UnionPlus':'\u228E','Uogon':'\u0172','uogon':'\u0173','Uopf':'\uD835\uDD4C','uopf':'\uD835\uDD66','UpArrowBar':'\u2912','uparrow':'\u2191','UpArrow':'\u2191','Uparrow':'\u21D1','UpArrowDownArrow':'\u21C5','updownarrow':'\u2195','UpDownArrow':'\u2195','Updownarrow':'\u21D5','UpEquilibrium':'\u296E','upharpoonleft':'\u21BF','upharpoonright':'\u21BE','uplus':'\u228E','UpperLeftArrow':'\u2196','UpperRightArrow':'\u2197','upsi':'\u03C5','Upsi':'\u03D2','upsih':'\u03D2','Upsilon':'\u03A5','upsilon':'\u03C5','UpTeeArrow':'\u21A5','UpTee':'\u22A5','upuparrows':'\u21C8','urcorn':'\u231D','urcorner':'\u231D','urcrop':'\u230E','Uring':'\u016E','uring':'\u016F','urtri':'\u25F9','Uscr':'\uD835\uDCB0','uscr':'\uD835\uDCCA','utdot':'\u22F0','Utilde':'\u0168','utilde':'\u0169','utri':'\u25B5','utrif':'\u25B4','uuarr':'\u21C8','Uuml':'\xDC','uuml':'\xFC','uwangle':'\u29A7','vangrt':'\u299C','varepsilon':'\u03F5','varkappa':'\u03F0','varnothing':'\u2205','varphi':'\u03D5','varpi':'\u03D6','varpropto':'\u221D','varr':'\u2195','vArr':'\u21D5','varrho':'\u03F1','varsigma':'\u03C2','varsubsetneq':'\u228A\uFE00','varsubsetneqq':'\u2ACB\uFE00','varsupsetneq':'\u228B\uFE00','varsupsetneqq':'\u2ACC\uFE00','vartheta':'\u03D1','vartriangleleft':'\u22B2','vartriangleright':'\u22B3','vBar':'\u2AE8','Vbar':'\u2AEB','vBarv':'\u2AE9','Vcy':'\u0412','vcy':'\u0432','vdash':'\u22A2','vDash':'\u22A8','Vdash':'\u22A9','VDash':'\u22AB','Vdashl':'\u2AE6','veebar':'\u22BB','vee':'\u2228','Vee':'\u22C1','veeeq':'\u225A','vellip':'\u22EE','verbar':'|','Verbar':'\u2016','vert':'|','Vert':'\u2016','VerticalBar':'\u2223','VerticalLine':'|','VerticalSeparator':'\u2758','VerticalTilde':'\u2240','VeryThinSpace':'\u200A','Vfr':'\uD835\uDD19','vfr':'\uD835\uDD33','vltri':'\u22B2','vnsub':'\u2282\u20D2','vnsup':'\u2283\u20D2','Vopf':'\uD835\uDD4D','vopf':'\uD835\uDD67','vprop':'\u221D','vrtri':'\u22B3','Vscr':'\uD835\uDCB1','vscr':'\uD835\uDCCB','vsubnE':'\u2ACB\uFE00','vsubne':'\u228A\uFE00','vsupnE':'\u2ACC\uFE00','vsupne':'\u228B\uFE00','Vvdash':'\u22AA','vzigzag':'\u299A','Wcirc':'\u0174','wcirc':'\u0175','wedbar':'\u2A5F','wedge':'\u2227','Wedge':'\u22C0','wedgeq':'\u2259','weierp':'\u2118','Wfr':'\uD835\uDD1A','wfr':'\uD835\uDD34','Wopf':'\uD835\uDD4E','wopf':'\uD835\uDD68','wp':'\u2118','wr':'\u2240','wreath':'\u2240','Wscr':'\uD835\uDCB2','wscr':'\uD835\uDCCC','xcap':'\u22C2','xcirc':'\u25EF','xcup':'\u22C3','xdtri':'\u25BD','Xfr':'\uD835\uDD1B','xfr':'\uD835\uDD35','xharr':'\u27F7','xhArr':'\u27FA','Xi':'\u039E','xi':'\u03BE','xlarr':'\u27F5','xlArr':'\u27F8','xmap':'\u27FC','xnis':'\u22FB','xodot':'\u2A00','Xopf':'\uD835\uDD4F','xopf':'\uD835\uDD69','xoplus':'\u2A01','xotime':'\u2A02','xrarr':'\u27F6','xrArr':'\u27F9','Xscr':'\uD835\uDCB3','xscr':'\uD835\uDCCD','xsqcup':'\u2A06','xuplus':'\u2A04','xutri':'\u25B3','xvee':'\u22C1','xwedge':'\u22C0','Yacute':'\xDD','yacute':'\xFD','YAcy':'\u042F','yacy':'\u044F','Ycirc':'\u0176','ycirc':'\u0177','Ycy':'\u042B','ycy':'\u044B','yen':'\xA5','Yfr':'\uD835\uDD1C','yfr':'\uD835\uDD36','YIcy':'\u0407','yicy':'\u0457','Yopf':'\uD835\uDD50','yopf':'\uD835\uDD6A','Yscr':'\uD835\uDCB4','yscr':'\uD835\uDCCE','YUcy':'\u042E','yucy':'\u044E','yuml':'\xFF','Yuml':'\u0178','Zacute':'\u0179','zacute':'\u017A','Zcaron':'\u017D','zcaron':'\u017E','Zcy':'\u0417','zcy':'\u0437','Zdot':'\u017B','zdot':'\u017C','zeetrf':'\u2128','ZeroWidthSpace':'\u200B','Zeta':'\u0396','zeta':'\u03B6','zfr':'\uD835\uDD37','Zfr':'\u2128','ZHcy':'\u0416','zhcy':'\u0436','zigrarr':'\u21DD','zopf':'\uD835\uDD6B','Zopf':'\u2124','Zscr':'\uD835\uDCB5','zscr':'\uD835\uDCCF','zwj':'\u200D','zwnj':'\u200C'}; + var decodeMapLegacy = {'Aacute':'\xC1','aacute':'\xE1','Acirc':'\xC2','acirc':'\xE2','acute':'\xB4','AElig':'\xC6','aelig':'\xE6','Agrave':'\xC0','agrave':'\xE0','amp':'&','AMP':'&','Aring':'\xC5','aring':'\xE5','Atilde':'\xC3','atilde':'\xE3','Auml':'\xC4','auml':'\xE4','brvbar':'\xA6','Ccedil':'\xC7','ccedil':'\xE7','cedil':'\xB8','cent':'\xA2','copy':'\xA9','COPY':'\xA9','curren':'\xA4','deg':'\xB0','divide':'\xF7','Eacute':'\xC9','eacute':'\xE9','Ecirc':'\xCA','ecirc':'\xEA','Egrave':'\xC8','egrave':'\xE8','ETH':'\xD0','eth':'\xF0','Euml':'\xCB','euml':'\xEB','frac12':'\xBD','frac14':'\xBC','frac34':'\xBE','gt':'>','GT':'>','Iacute':'\xCD','iacute':'\xED','Icirc':'\xCE','icirc':'\xEE','iexcl':'\xA1','Igrave':'\xCC','igrave':'\xEC','iquest':'\xBF','Iuml':'\xCF','iuml':'\xEF','laquo':'\xAB','lt':'<','LT':'<','macr':'\xAF','micro':'\xB5','middot':'\xB7','nbsp':'\xA0','not':'\xAC','Ntilde':'\xD1','ntilde':'\xF1','Oacute':'\xD3','oacute':'\xF3','Ocirc':'\xD4','ocirc':'\xF4','Ograve':'\xD2','ograve':'\xF2','ordf':'\xAA','ordm':'\xBA','Oslash':'\xD8','oslash':'\xF8','Otilde':'\xD5','otilde':'\xF5','Ouml':'\xD6','ouml':'\xF6','para':'\xB6','plusmn':'\xB1','pound':'\xA3','quot':'"','QUOT':'"','raquo':'\xBB','reg':'\xAE','REG':'\xAE','sect':'\xA7','shy':'\xAD','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','szlig':'\xDF','THORN':'\xDE','thorn':'\xFE','times':'\xD7','Uacute':'\xDA','uacute':'\xFA','Ucirc':'\xDB','ucirc':'\xFB','Ugrave':'\xD9','ugrave':'\xF9','uml':'\xA8','Uuml':'\xDC','uuml':'\xFC','Yacute':'\xDD','yacute':'\xFD','yen':'\xA5','yuml':'\xFF'}; + var decodeMapNumeric = {'0':'\uFFFD','128':'\u20AC','130':'\u201A','131':'\u0192','132':'\u201E','133':'\u2026','134':'\u2020','135':'\u2021','136':'\u02C6','137':'\u2030','138':'\u0160','139':'\u2039','140':'\u0152','142':'\u017D','145':'\u2018','146':'\u2019','147':'\u201C','148':'\u201D','149':'\u2022','150':'\u2013','151':'\u2014','152':'\u02DC','153':'\u2122','154':'\u0161','155':'\u203A','156':'\u0153','158':'\u017E','159':'\u0178'}; + var invalidReferenceCodePoints = [1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65000,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]; + + /*--------------------------------------------------------------------------*/ + + var stringFromCharCode = String.fromCharCode; + + var object = {}; + var hasOwnProperty = object.hasOwnProperty; + var has = function(object, propertyName) { + return hasOwnProperty.call(object, propertyName); + }; + + var contains = function(array, value) { + var index = -1; + var length = array.length; + while (++index < length) { + if (array[index] == value) { + return true; + } + } + return false; + }; + + var merge = function(options, defaults) { + if (!options) { + return defaults; + } + var result = {}; + var key; + for (key in defaults) { + // A `hasOwnProperty` check is not needed here, since only recognized + // option names are used anyway. Any others are ignored. + result[key] = has(options, key) ? options[key] : defaults[key]; + } + return result; + }; + + // Modified version of `ucs2encode`; see http://mths.be/punycode. + var codePointToSymbol = function(codePoint, strict) { + var output = ''; + if ((codePoint >= 0xD800 && codePoint <= 0xDFFF) || codePoint > 0x10FFFF) { + // See issue #4: + // “Otherwise, if the number is in the range 0xD800 to 0xDFFF or is + // greater than 0x10FFFF, then this is a parse error. Return a U+FFFD + // REPLACEMENT CHARACTER.” + if (strict) { + parseError('character reference outside the permissible Unicode range'); + } + return '\uFFFD'; + } + if (has(decodeMapNumeric, codePoint)) { + if (strict) { + parseError('disallowed character reference'); + } + return decodeMapNumeric[codePoint]; + } + if (strict && contains(invalidReferenceCodePoints, codePoint)) { + parseError('disallowed character reference'); + } + if (codePoint > 0xFFFF) { + codePoint -= 0x10000; + output += stringFromCharCode(codePoint >>> 10 & 0x3FF | 0xD800); + codePoint = 0xDC00 | codePoint & 0x3FF; + } + output += stringFromCharCode(codePoint); + return output; + }; + + var hexEscape = function(symbol) { + return '&#x' + symbol.charCodeAt(0).toString(16).toUpperCase() + ';'; + }; + + var parseError = function(message) { + throw Error('Parse error: ' + message); + }; + + /*--------------------------------------------------------------------------*/ + + var encode = function(string, options) { + options = merge(options, encode.options); + var strict = options.strict; + if (strict && regexInvalidRawCodePoint.test(string)) { + parseError('forbidden code point'); + } + var encodeEverything = options.encodeEverything; + var useNamedReferences = options.useNamedReferences; + var allowUnsafeSymbols = options.allowUnsafeSymbols; + if (encodeEverything) { + // Encode ASCII symbols. + string = string.replace(regexAsciiWhitelist, function(symbol) { + // Use named references if requested & possible. + if (useNamedReferences && has(encodeMap, symbol)) { + return '&' + encodeMap[symbol] + ';'; + } + return hexEscape(symbol); + }); + // Shorten a few escapes that represent two symbols, of which at least one + // is within the ASCII range. + if (useNamedReferences) { + string = string + .replace(/>\u20D2/g, '>⃒') + .replace(/<\u20D2/g, '<⃒') + .replace(/fj/g, 'fj'); + } + // Encode non-ASCII symbols. + if (useNamedReferences) { + // Encode non-ASCII symbols that can be replaced with a named reference. + string = string.replace(regexEncodeNonAscii, function(string) { + // Note: there is no need to check `has(encodeMap, string)` here. + return '&' + encodeMap[string] + ';'; + }); + } + // Note: any remaining non-ASCII symbols are handled outside of the `if`. + } else if (useNamedReferences) { + // Apply named character references. + // Encode `<>"'&` using named character references. + if (!allowUnsafeSymbols) { + string = string.replace(regexEscape, function(string) { + return '&' + encodeMap[string] + ';'; // no need to check `has()` here + }); + } + // Shorten escapes that represent two symbols, of which at least one is + // `<>"'&`. + string = string + .replace(/>\u20D2/g, '>⃒') + .replace(/<\u20D2/g, '<⃒'); + // Encode non-ASCII symbols that can be replaced with a named reference. + string = string.replace(regexEncodeNonAscii, function(string) { + // Note: there is no need to check `has(encodeMap, string)` here. + return '&' + encodeMap[string] + ';'; + }); + } else if (!allowUnsafeSymbols) { + // Encode `<>"'&` using hexadecimal escapes, now that they’re not handled + // using named character references. + string = string.replace(regexEscape, hexEscape); + } + return string + // Encode astral symbols. + .replace(regexAstralSymbols, function($0) { + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + var high = $0.charCodeAt(0); + var low = $0.charCodeAt(1); + var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000; + return '&#x' + codePoint.toString(16).toUpperCase() + ';'; + }) + // Encode any remaining BMP symbols that are not printable ASCII symbols + // using a hexadecimal escape. + .replace(regexBmpWhitelist, hexEscape); + }; + // Expose default options (so they can be overridden globally). + encode.options = { + 'allowUnsafeSymbols': false, + 'encodeEverything': false, + 'strict': false, + 'useNamedReferences': false + }; + + var decode = function(html, options) { + options = merge(options, decode.options); + var strict = options.strict; + if (strict && regexInvalidEntity.test(html)) { + parseError('malformed character reference'); + } + return html.replace(regexDecode, function($0, $1, $2, $3, $4, $5, $6, $7) { + var codePoint; + var semicolon; + var hexDigits; + var reference; + var next; + if ($1) { + // Decode decimal escapes, e.g. `𝌆`. + codePoint = $1; + semicolon = $2; + if (strict && !semicolon) { + parseError('character reference was not terminated by a semicolon'); + } + return codePointToSymbol(codePoint, strict); + } + if ($3) { + // Decode hexadecimal escapes, e.g. `𝌆`. + hexDigits = $3; + semicolon = $4; + if (strict && !semicolon) { + parseError('character reference was not terminated by a semicolon'); + } + codePoint = parseInt(hexDigits, 16); + return codePointToSymbol(codePoint, strict); + } + if ($5) { + // Decode named character references with trailing `;`, e.g. `©`. + reference = $5; + if (has(decodeMap, reference)) { + return decodeMap[reference]; + } else { + // Ambiguous ampersand; see http://mths.be/notes/ambiguous-ampersands. + if (strict) { + parseError( + 'named character reference was not terminated by a semicolon' + ); + } + return $0; + } + } + // If we’re still here, it’s a legacy reference for sure. No need for an + // extra `if` check. + // Decode named character references without trailing `;`, e.g. `&` + // This is only a parse error if it gets converted to `&`, or if it is + // followed by `=` in an attribute context. + reference = $6; + next = $7; + if (next && options.isAttributeValue) { + if (strict && next == '=') { + parseError('`&` did not start a character reference'); + } + return $0; + } else { + if (strict) { + parseError( + 'named character reference was not terminated by a semicolon' + ); + } + // Note: there is no need to check `has(decodeMapLegacy, reference)`. + return decodeMapLegacy[reference] + (next || ''); + } + }); + }; + // Expose default options (so they can be overridden globally). + decode.options = { + 'isAttributeValue': false, + 'strict': false + }; + + var escape = function(string) { + return string.replace(regexEscape, function($0) { + // Note: there is no need to check `has(escapeMap, $0)` here. + return escapeMap[$0]; + }); + }; + + /*--------------------------------------------------------------------------*/ + + var he = { + 'version': '0.5.0', + 'encode': encode, + 'decode': decode, + 'escape': escape, + 'unescape': decode + }; + + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define(function() { + return he; + }); + } else if (freeExports && !freeExports.nodeType) { + if (freeModule) { // in Node.js or RingoJS v0.8.0+ + freeModule.exports = he; + } else { // in Narwhal or RingoJS v0.7.0- + for (var key in he) { + has(he, key) && (freeExports[key] = he[key]); + } + } + } else { // in Rhino or a web browser + root.he = he; + } + +}(this)); + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],82:[function(require,module,exports){ (function (global){ /** * @license @@ -24557,3276 +27461,14 @@ module.exports = '1.0.7'; }.call(this)); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],54:[function(require,module,exports){ -/* -Copyright (c) 2012-2014 Chris Pettitt - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -module.exports = { - graphlib: require("./lib/graphlib"), - - layout: require("./lib/layout"), - debug: require("./lib/debug"), - util: { - time: require("./lib/util").time, - notime: require("./lib/util").notime - }, - version: require("./lib/version") -}; - -},{"./lib/debug":59,"./lib/graphlib":60,"./lib/layout":62,"./lib/util":82,"./lib/version":83}],55:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"), - greedyFAS = require("./greedy-fas"); - -module.exports = { - run: run, - undo: undo -}; - -function run(g) { - var fas = (g.graph().acyclicer === "greedy" - ? greedyFAS(g, weightFn(g)) - : dfsFAS(g)); - _.each(fas, function(e) { - var label = g.edge(e); - g.removeEdge(e); - label.forwardName = e.name; - label.reversed = true; - g.setEdge(e.w, e.v, label, _.uniqueId("rev")); - }); - - function weightFn(g) { - return function(e) { - return g.edge(e).weight; - }; - } -} - -function dfsFAS(g) { - var fas = [], - stack = {}, - visited = {}; - - function dfs(v) { - if (_.has(visited, v)) { - return; - } - visited[v] = true; - stack[v] = true; - _.each(g.outEdges(v), function(e) { - if (_.has(stack, e.w)) { - fas.push(e); - } else { - dfs(e.w); - } - }); - delete stack[v]; - } - - _.each(g.nodes(), dfs); - return fas; -} - -function undo(g) { - _.each(g.edges(), function(e) { - var label = g.edge(e); - if (label.reversed) { - g.removeEdge(e); - - var forwardName = label.forwardName; - delete label.reversed; - delete label.forwardName; - g.setEdge(e.w, e.v, label, forwardName); - } - }); -} - -},{"./greedy-fas":61,"./lodash":63}],56:[function(require,module,exports){ -var _ = require("./lodash"), - util = require("./util"); - -module.exports = addBorderSegments; - -function addBorderSegments(g) { - function dfs(v) { - var children = g.children(v), - node = g.node(v); - if (children.length) { - _.each(children, dfs); - } - - if (_.has(node, "minRank")) { - node.borderLeft = []; - node.borderRight = []; - for (var rank = node.minRank, maxRank = node.maxRank + 1; - rank < maxRank; - ++rank) { - addBorderNode(g, "borderLeft", "_bl", v, node, rank); - addBorderNode(g, "borderRight", "_br", v, node, rank); - } - } - } - - _.each(g.children(), dfs); -} - -function addBorderNode(g, prop, prefix, sg, sgNode, rank) { - var label = { width: 0, height: 0, rank: rank, borderType: prop }, - prev = sgNode[prop][rank - 1], - curr = util.addDummyNode(g, "border", label, prefix); - sgNode[prop][rank] = curr; - g.setParent(curr, sg); - if (prev) { - g.setEdge(prev, curr, { weight: 1 }); - } -} - -},{"./lodash":63,"./util":82}],57:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"); - -module.exports = { - adjust: adjust, - undo: undo -}; - -function adjust(g) { - var rankDir = g.graph().rankdir.toLowerCase(); - if (rankDir === "lr" || rankDir === "rl") { - swapWidthHeight(g); - } -} - -function undo(g) { - var rankDir = g.graph().rankdir.toLowerCase(); - if (rankDir === "bt" || rankDir === "rl") { - reverseY(g); - } - - if (rankDir === "lr" || rankDir === "rl") { - swapXY(g); - swapWidthHeight(g); - } -} - -function swapWidthHeight(g) { - _.each(g.nodes(), function(v) { swapWidthHeightOne(g.node(v)); }); - _.each(g.edges(), function(e) { swapWidthHeightOne(g.edge(e)); }); -} - -function swapWidthHeightOne(attrs) { - var w = attrs.width; - attrs.width = attrs.height; - attrs.height = w; -} - -function reverseY(g) { - _.each(g.nodes(), function(v) { reverseYOne(g.node(v)); }); - - _.each(g.edges(), function(e) { - var edge = g.edge(e); - _.each(edge.points, reverseYOne); - if (_.has(edge, "y")) { - reverseYOne(edge); - } - }); -} - -function reverseYOne(attrs) { - attrs.y = -attrs.y; -} - -function swapXY(g) { - _.each(g.nodes(), function(v) { swapXYOne(g.node(v)); }); - - _.each(g.edges(), function(e) { - var edge = g.edge(e); - _.each(edge.points, swapXYOne); - if (_.has(edge, "x")) { - swapXYOne(edge); - } - }); -} - -function swapXYOne(attrs) { - var x = attrs.x; - attrs.x = attrs.y; - attrs.y = x; -} - -},{"./lodash":63}],58:[function(require,module,exports){ -/* - * Simple doubly linked list implementation derived from Cormen, et al., - * "Introduction to Algorithms". - */ - -module.exports = List; - -function List() { - var sentinel = {}; - sentinel._next = sentinel._prev = sentinel; - this._sentinel = sentinel; -} - -List.prototype.dequeue = function() { - var sentinel = this._sentinel, - entry = sentinel._prev; - if (entry !== sentinel) { - unlink(entry); - return entry; - } -}; - -List.prototype.enqueue = function(entry) { - var sentinel = this._sentinel; - if (entry._prev && entry._next) { - unlink(entry); - } - entry._next = sentinel._next; - sentinel._next._prev = entry; - sentinel._next = entry; - entry._prev = sentinel; -}; - -List.prototype.toString = function() { - var strs = [], - sentinel = this._sentinel, - curr = sentinel._prev; - while (curr !== sentinel) { - strs.push(JSON.stringify(curr, filterOutLinks)); - curr = curr._prev; - } - return "[" + strs.join(", ") + "]"; -}; - -function unlink(entry) { - entry._prev._next = entry._next; - entry._next._prev = entry._prev; - delete entry._next; - delete entry._prev; -} - -function filterOutLinks(k, v) { - if (k !== "_next" && k !== "_prev") { - return v; - } -} - -},{}],59:[function(require,module,exports){ -var _ = require("./lodash"), - util = require("./util"), - Graph = require("./graphlib").Graph; - -module.exports = { - debugOrdering: debugOrdering -}; - -/* istanbul ignore next */ -function debugOrdering(g) { - var layerMatrix = util.buildLayerMatrix(g); - - var h = new Graph({ compound: true, multigraph: true }).setGraph({}); - - _.each(g.nodes(), function(v) { - h.setNode(v, { label: v }); - h.setParent(v, "layer" + g.node(v).rank); - }); - - _.each(g.edges(), function(e) { - h.setEdge(e.v, e.w, {}, e.name); - }); - - _.each(layerMatrix, function(layer, i) { - var layerV = "layer" + i; - h.setNode(layerV, { rank: "same" }); - _.reduce(layer, function(u, v) { - h.setEdge(u, v, { style: "invis" }); - return v; - }); - }); - - return h; -} - -},{"./graphlib":60,"./lodash":63,"./util":82}],60:[function(require,module,exports){ -/* global window */ - -var graphlib; - -if (typeof require === "function") { - try { - graphlib = require("graphlib"); - } catch (e) {} -} - -if (!graphlib) { - graphlib = window.graphlib; -} - -module.exports = graphlib; - -},{"graphlib":84}],61:[function(require,module,exports){ -var _ = require("./lodash"), - Graph = require("./graphlib").Graph, - List = require("./data/list"); - -/* - * A greedy heuristic for finding a feedback arc set for a graph. A feedback - * arc set is a set of edges that can be removed to make a graph acyclic. - * The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, "A fast and - * effective heuristic for the feedback arc set problem." This implementation - * adjusts that from the paper to allow for weighted edges. - */ -module.exports = greedyFAS; - -var DEFAULT_WEIGHT_FN = _.constant(1); - -function greedyFAS(g, weightFn) { - if (g.nodeCount() <= 1) { - return []; - } - var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN); - var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx); - - // Expand multi-edges - return _.flatten(_.map(results, function(e) { - return g.outEdges(e.v, e.w); - }), true); -} - -function doGreedyFAS(g, buckets, zeroIdx) { - var results = [], - sources = buckets[buckets.length - 1], - sinks = buckets[0]; - - var entry; - while (g.nodeCount()) { - while ((entry = sinks.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } - while ((entry = sources.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } - if (g.nodeCount()) { - for (var i = buckets.length - 2; i > 0; --i) { - entry = buckets[i].dequeue(); - if (entry) { - results = results.concat(removeNode(g, buckets, zeroIdx, entry, true)); - break; - } - } - } - } - - return results; -} - -function removeNode(g, buckets, zeroIdx, entry, collectPredecessors) { - var results = collectPredecessors ? [] : undefined; - - _.each(g.inEdges(entry.v), function(edge) { - var weight = g.edge(edge), - uEntry = g.node(edge.v); - - if (collectPredecessors) { - results.push({ v: edge.v, w: edge.w }); - } - - uEntry.out -= weight; - assignBucket(buckets, zeroIdx, uEntry); - }); - - _.each(g.outEdges(entry.v), function(edge) { - var weight = g.edge(edge), - w = edge.w, - wEntry = g.node(w); - wEntry["in"] -= weight; - assignBucket(buckets, zeroIdx, wEntry); - }); - - g.removeNode(entry.v); - - return results; -} - -function buildState(g, weightFn) { - var fasGraph = new Graph(), - maxIn = 0, - maxOut = 0; - - _.each(g.nodes(), function(v) { - fasGraph.setNode(v, { v: v, "in": 0, out: 0 }); - }); - - // Aggregate weights on nodes, but also sum the weights across multi-edges - // into a single edge for the fasGraph. - _.each(g.edges(), function(e) { - var prevWeight = fasGraph.edge(e.v, e.w) || 0, - weight = weightFn(e), - edgeWeight = prevWeight + weight; - fasGraph.setEdge(e.v, e.w, edgeWeight); - maxOut = Math.max(maxOut, fasGraph.node(e.v).out += weight); - maxIn = Math.max(maxIn, fasGraph.node(e.w)["in"] += weight); - }); - - var buckets = _.range(maxOut + maxIn + 3).map(function() { return new List(); }); - var zeroIdx = maxIn + 1; - - _.each(fasGraph.nodes(), function(v) { - assignBucket(buckets, zeroIdx, fasGraph.node(v)); - }); - - return { graph: fasGraph, buckets: buckets, zeroIdx: zeroIdx }; -} - -function assignBucket(buckets, zeroIdx, entry) { - if (!entry.out) { - buckets[0].enqueue(entry); - } else if (!entry["in"]) { - buckets[buckets.length - 1].enqueue(entry); - } else { - buckets[entry.out - entry["in"] + zeroIdx].enqueue(entry); - } -} - -},{"./data/list":58,"./graphlib":60,"./lodash":63}],62:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"), - acyclic = require("./acyclic"), - normalize = require("./normalize"), - rank = require("./rank"), - normalizeRanks = require("./util").normalizeRanks, - parentDummyChains = require("./parent-dummy-chains"), - removeEmptyRanks = require("./util").removeEmptyRanks, - nestingGraph = require("./nesting-graph"), - addBorderSegments = require("./add-border-segments"), - coordinateSystem = require("./coordinate-system"), - order = require("./order"), - position = require("./position"), - util = require("./util"), - Graph = require("./graphlib").Graph; - -module.exports = layout; - -function layout(g, opts) { - var time = opts && opts.debugTiming ? util.time : util.notime; - time("layout", function() { - var layoutGraph = time(" buildLayoutGraph", - function() { return buildLayoutGraph(g); }); - time(" runLayout", function() { runLayout(layoutGraph, time); }); - time(" updateInputGraph", function() { updateInputGraph(g, layoutGraph); }); - }); -} - -function runLayout(g, time) { - time(" makeSpaceForEdgeLabels", function() { makeSpaceForEdgeLabels(g); }); - time(" removeSelfEdges", function() { removeSelfEdges(g); }); - time(" acyclic", function() { acyclic.run(g); }); - time(" nestingGraph.run", function() { nestingGraph.run(g); }); - time(" rank", function() { rank(util.asNonCompoundGraph(g)); }); - time(" injectEdgeLabelProxies", function() { injectEdgeLabelProxies(g); }); - time(" removeEmptyRanks", function() { removeEmptyRanks(g); }); - time(" nestingGraph.cleanup", function() { nestingGraph.cleanup(g); }); - time(" normalizeRanks", function() { normalizeRanks(g); }); - time(" assignRankMinMax", function() { assignRankMinMax(g); }); - time(" removeEdgeLabelProxies", function() { removeEdgeLabelProxies(g); }); - time(" normalize.run", function() { normalize.run(g); }); - time(" parentDummyChains", function() { parentDummyChains(g); }); - time(" addBorderSegments", function() { addBorderSegments(g); }); - time(" order", function() { order(g); }); - time(" insertSelfEdges", function() { insertSelfEdges(g); }); - time(" adjustCoordinateSystem", function() { coordinateSystem.adjust(g); }); - time(" position", function() { position(g); }); - time(" positionSelfEdges", function() { positionSelfEdges(g); }); - time(" removeBorderNodes", function() { removeBorderNodes(g); }); - time(" normalize.undo", function() { normalize.undo(g); }); - time(" fixupEdgeLabelCoords", function() { fixupEdgeLabelCoords(g); }); - time(" undoCoordinateSystem", function() { coordinateSystem.undo(g); }); - time(" translateGraph", function() { translateGraph(g); }); - time(" assignNodeIntersects", function() { assignNodeIntersects(g); }); - time(" reversePoints", function() { reversePointsForReversedEdges(g); }); - time(" acyclic.undo", function() { acyclic.undo(g); }); -} - -/* - * Copies final layout information from the layout graph back to the input - * graph. This process only copies whitelisted attributes from the layout graph - * to the input graph, so it serves as a good place to determine what - * attributes can influence layout. - */ -function updateInputGraph(inputGraph, layoutGraph) { - _.each(inputGraph.nodes(), function(v) { - var inputLabel = inputGraph.node(v), - layoutLabel = layoutGraph.node(v); - - if (inputLabel) { - inputLabel.x = layoutLabel.x; - inputLabel.y = layoutLabel.y; - - if (layoutGraph.children(v).length) { - inputLabel.width = layoutLabel.width; - inputLabel.height = layoutLabel.height; - } - } - }); - - _.each(inputGraph.edges(), function(e) { - var inputLabel = inputGraph.edge(e), - layoutLabel = layoutGraph.edge(e); - - inputLabel.points = layoutLabel.points; - if (_.has(layoutLabel, "x")) { - inputLabel.x = layoutLabel.x; - inputLabel.y = layoutLabel.y; - } - }); - - inputGraph.graph().width = layoutGraph.graph().width; - inputGraph.graph().height = layoutGraph.graph().height; -} - -var graphNumAttrs = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], - graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, - graphAttrs = ["acyclicer", "ranker", "rankdir", "align"], - nodeNumAttrs = ["width", "height"], - nodeDefaults = { width: 0, height: 0 }, - edgeNumAttrs = ["minlen", "weight", "width", "height", "labeloffset"], - edgeDefaults = { - minlen: 1, weight: 1, width: 0, height: 0, - labeloffset: 10, labelpos: "r" - }, - edgeAttrs = ["labelpos"]; - -/* - * Constructs a new graph from the input graph, which can be used for layout. - * This process copies only whitelisted attributes from the input graph to the - * layout graph. Thus this function serves as a good place to determine what - * attributes can influence layout. - */ -function buildLayoutGraph(inputGraph) { - var g = new Graph({ multigraph: true, compound: true }), - graph = canonicalize(inputGraph.graph()); - - g.setGraph(_.merge({}, - graphDefaults, - selectNumberAttrs(graph, graphNumAttrs), - _.pick(graph, graphAttrs))); - - _.each(inputGraph.nodes(), function(v) { - var node = canonicalize(inputGraph.node(v)); - g.setNode(v, _.defaults(selectNumberAttrs(node, nodeNumAttrs), nodeDefaults)); - g.setParent(v, inputGraph.parent(v)); - }); - - _.each(inputGraph.edges(), function(e) { - var edge = canonicalize(inputGraph.edge(e)); - g.setEdge(e, _.merge({}, - edgeDefaults, - selectNumberAttrs(edge, edgeNumAttrs), - _.pick(edge, edgeAttrs))); - }); - - return g; -} - -/* - * This idea comes from the Gansner paper: to account for edge labels in our - * layout we split each rank in half by doubling minlen and halving ranksep. - * Then we can place labels at these mid-points between nodes. - * - * We also add some minimal padding to the width to push the label for the edge - * away from the edge itself a bit. - */ -function makeSpaceForEdgeLabels(g) { - var graph = g.graph(); - graph.ranksep /= 2; - _.each(g.edges(), function(e) { - var edge = g.edge(e); - edge.minlen *= 2; - if (edge.labelpos.toLowerCase() !== "c") { - if (graph.rankdir === "TB" || graph.rankdir === "BT") { - edge.width += edge.labeloffset; - } else { - edge.height += edge.labeloffset; - } - } - }); -} - -/* - * Creates temporary dummy nodes that capture the rank in which each edge's - * label is going to, if it has one of non-zero width and height. We do this - * so that we can safely remove empty ranks while preserving balance for the - * label's position. - */ -function injectEdgeLabelProxies(g) { - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (edge.width && edge.height) { - var v = g.node(e.v), - w = g.node(e.w), - label = { rank: (w.rank - v.rank) / 2 + v.rank, e: e }; - util.addDummyNode(g, "edge-proxy", label, "_ep"); - } - }); -} - -function assignRankMinMax(g) { - var maxRank = 0; - _.each(g.nodes(), function(v) { - var node = g.node(v); - if (node.borderTop) { - node.minRank = g.node(node.borderTop).rank; - node.maxRank = g.node(node.borderBottom).rank; - maxRank = _.max(maxRank, node.maxRank); - } - }); - g.graph().maxRank = maxRank; -} - -function removeEdgeLabelProxies(g) { - _.each(g.nodes(), function(v) { - var node = g.node(v); - if (node.dummy === "edge-proxy") { - g.edge(node.e).labelRank = node.rank; - g.removeNode(v); - } - }); -} - -function translateGraph(g) { - var minX = Number.POSITIVE_INFINITY, - maxX = 0, - minY = Number.POSITIVE_INFINITY, - maxY = 0, - graphLabel = g.graph(), - marginX = graphLabel.marginx || 0, - marginY = graphLabel.marginy || 0; - - function getExtremes(attrs) { - var x = attrs.x, - y = attrs.y, - w = attrs.width, - h = attrs.height; - minX = Math.min(minX, x - w / 2); - maxX = Math.max(maxX, x + w / 2); - minY = Math.min(minY, y - h / 2); - maxY = Math.max(maxY, y + h / 2); - } - - _.each(g.nodes(), function(v) { getExtremes(g.node(v)); }); - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (_.has(edge, "x")) { - getExtremes(edge); - } - }); - - minX -= marginX; - minY -= marginY; - - _.each(g.nodes(), function(v) { - var node = g.node(v); - node.x -= minX; - node.y -= minY; - }); - - _.each(g.edges(), function(e) { - var edge = g.edge(e); - _.each(edge.points, function(p) { - p.x -= minX; - p.y -= minY; - }); - if (_.has(edge, "x")) { edge.x -= minX; } - if (_.has(edge, "y")) { edge.y -= minY; } - }); - - graphLabel.width = maxX - minX + marginX; - graphLabel.height = maxY - minY + marginY; -} - -function assignNodeIntersects(g) { - _.each(g.edges(), function(e) { - var edge = g.edge(e), - nodeV = g.node(e.v), - nodeW = g.node(e.w), - p1, p2; - if (!edge.points) { - edge.points = []; - p1 = nodeW; - p2 = nodeV; - } else { - p1 = edge.points[0]; - p2 = edge.points[edge.points.length - 1]; - } - edge.points.unshift(util.intersectRect(nodeV, p1)); - edge.points.push(util.intersectRect(nodeW, p2)); - }); -} - -function fixupEdgeLabelCoords(g) { - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (_.has(edge, "x")) { - if (edge.labelpos === "l" || edge.labelpos === "r") { - edge.width -= edge.labeloffset; - } - switch (edge.labelpos) { - case "l": edge.x -= edge.width / 2 + edge.labeloffset; break; - case "r": edge.x += edge.width / 2 + edge.labeloffset; break; - } - } - }); -} - -function reversePointsForReversedEdges(g) { - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (edge.reversed) { - edge.points.reverse(); - } - }); -} - -function removeBorderNodes(g) { - _.each(g.nodes(), function(v) { - if (g.children(v).length) { - var node = g.node(v), - t = g.node(node.borderTop), - b = g.node(node.borderBottom), - l = g.node(_.last(node.borderLeft)), - r = g.node(_.last(node.borderRight)); - - node.width = Math.abs(r.x - l.x); - node.height = Math.abs(b.y - t.y); - node.x = l.x + node.width / 2; - node.y = t.y + node.height / 2; - } - }); - - _.each(g.nodes(), function(v) { - if (g.node(v).dummy === "border") { - g.removeNode(v); - } - }); -} - -function removeSelfEdges(g) { - _.each(g.edges(), function(e) { - if (e.v === e.w) { - var node = g.node(e.v); - if (!node.selfEdges) { - node.selfEdges = []; - } - node.selfEdges.push({ e: e, label: g.edge(e) }); - g.removeEdge(e); - } - }); -} - -function insertSelfEdges(g) { - var layers = util.buildLayerMatrix(g); - _.each(layers, function(layer) { - var orderShift = 0; - _.each(layer, function(v, i) { - var node = g.node(v); - node.order = i + orderShift; - _.each(node.selfEdges, function(selfEdge) { - util.addDummyNode(g, "selfedge", { - width: selfEdge.label.width, - height: selfEdge.label.height, - rank: node.rank, - order: i + (++orderShift), - e: selfEdge.e, - label: selfEdge.label - }, "_se"); - }); - delete node.selfEdges; - }); - }); -} - -function positionSelfEdges(g) { - _.each(g.nodes(), function(v) { - var node = g.node(v); - if (node.dummy === "selfedge") { - var selfNode = g.node(node.e.v), - x = selfNode.x + selfNode.width / 2, - y = selfNode.y, - dx = node.x - x, - dy = selfNode.height / 2; - g.setEdge(node.e, node.label); - g.removeNode(v); - node.label.points = [ - { x: x + 2 * dx / 3, y: y - dy }, - { x: x + 5 * dx / 6, y: y - dy }, - { x: x + dx , y: y }, - { x: x + 5 * dx / 6, y: y + dy }, - { x: x + 2 * dx / 3, y: y + dy }, - ]; - node.label.x = node.x; - node.label.y = node.y; - } - }); -} - -function selectNumberAttrs(obj, attrs) { - return _.mapValues(_.pick(obj, attrs), Number); -} - -function canonicalize(attrs) { - var newAttrs = {}; - _.each(attrs, function(v, k) { - newAttrs[k.toLowerCase()] = v; - }); - return newAttrs; -} - -},{"./acyclic":55,"./add-border-segments":56,"./coordinate-system":57,"./graphlib":60,"./lodash":63,"./nesting-graph":64,"./normalize":65,"./order":70,"./parent-dummy-chains":75,"./position":77,"./rank":79,"./util":82}],63:[function(require,module,exports){ -module.exports=require(51) -},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\lodash.js":51,"lodash":104}],64:[function(require,module,exports){ -var _ = require("./lodash"), - util = require("./util"); - -module.exports = { - run: run, - cleanup: cleanup -}; - -/* - * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs, - * adds appropriate edges to ensure that all cluster nodes are placed between - * these boundries, and ensures that the graph is connected. - * - * In addition we ensure, through the use of the minlen property, that nodes - * and subgraph border nodes to not end up on the same rank. - * - * Preconditions: - * - * 1. Input graph is a DAG - * 2. Nodes in the input graph has a minlen attribute - * - * Postconditions: - * - * 1. Input graph is connected. - * 2. Dummy nodes are added for the tops and bottoms of subgraphs. - * 3. The minlen attribute for nodes is adjusted to ensure nodes do not - * get placed on the same rank as subgraph border nodes. - * - * The nesting graph idea comes from Sander, "Layout of Compound Directed - * Graphs." - */ -function run(g) { - var root = util.addDummyNode(g, "root", {}, "_root"), - depths = treeDepths(g), - height = _.max(depths) - 1, - nodeSep = 2 * height + 1; - - g.graph().nestingRoot = root; - - // Multiply minlen by nodeSep to align nodes on non-border ranks. - _.each(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; }); - - // Calculate a weight that is sufficient to keep subgraphs vertically compact - var weight = sumWeights(g) + 1; - - // Create border nodes and link them up - _.each(g.children(), function(child) { - dfs(g, root, nodeSep, weight, height, depths, child); - }); - - // Save the multiplier for node layers for later removal of empty border - // layers. - g.graph().nodeRankFactor = nodeSep; -} - -function dfs(g, root, nodeSep, weight, height, depths, v) { - var children = g.children(v); - if (!children.length) { - if (v !== root) { - g.setEdge(root, v, { weight: 0, minlen: nodeSep }); - } - return; - } - - var top = util.addBorderNode(g, "_bt"), - bottom = util.addBorderNode(g, "_bb"), - label = g.node(v); - - g.setParent(top, v); - label.borderTop = top; - g.setParent(bottom, v); - label.borderBottom = bottom; - - _.each(children, function(child) { - dfs(g, root, nodeSep, weight, height, depths, child); - - var childNode = g.node(child), - childTop = childNode.borderTop ? childNode.borderTop : child, - childBottom = childNode.borderBottom ? childNode.borderBottom : child, - thisWeight = childNode.borderTop ? weight : 2 * weight, - minlen = childTop !== childBottom ? 1 : height - depths[v] + 1; - - g.setEdge(top, childTop, { - weight: thisWeight, - minlen: minlen, - nestingEdge: true - }); - - g.setEdge(childBottom, bottom, { - weight: thisWeight, - minlen: minlen, - nestingEdge: true - }); - }); - - if (!g.parent(v)) { - g.setEdge(root, top, { weight: 0, minlen: height + depths[v] }); - } -} - -function treeDepths(g) { - var depths = {}; - function dfs(v, depth) { - var children = g.children(v); - if (children && children.length) { - _.each(children, function(child) { - dfs(child, depth + 1); - }); - } - depths[v] = depth; - } - _.each(g.children(), function(v) { dfs(v, 1); }); - return depths; -} - -function sumWeights(g) { - return _.reduce(g.edges(), function(acc, e) { - return acc + g.edge(e).weight; - }, 0); -} - -function cleanup(g) { - var graphLabel = g.graph(); - g.removeNode(graphLabel.nestingRoot); - delete graphLabel.nestingRoot; - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (edge.nestingEdge) { - g.removeEdge(e); - } - }); -} - -},{"./lodash":63,"./util":82}],65:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"), - util = require("./util"); - -module.exports = { - run: run, - undo: undo -}; - -/* - * Breaks any long edges in the graph into short segments that span 1 layer - * each. This operation is undoable with the denormalize function. - * - * Pre-conditions: - * - * 1. The input graph is a DAG. - * 2. Each node in the graph has a "rank" property. - * - * Post-condition: - * - * 1. All edges in the graph have a length of 1. - * 2. Dummy nodes are added where edges have been split into segments. - * 3. The graph is augmented with a "dummyChains" attribute which contains - * the first dummy in each chain of dummy nodes produced. - */ -function run(g) { - g.graph().dummyChains = []; - _.each(g.edges(), function(edge) { normalizeEdge(g, edge); }); -} - -function normalizeEdge(g, e) { - var v = e.v, - vRank = g.node(v).rank, - w = e.w, - wRank = g.node(w).rank, - name = e.name, - edgeLabel = g.edge(e), - labelRank = edgeLabel.labelRank; - - if (wRank === vRank + 1) return; - - g.removeEdge(e); - - var dummy, attrs, i; - for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) { - edgeLabel.points = []; - attrs = { - width: 0, height: 0, - edgeLabel: edgeLabel, edgeObj: e, - rank: vRank - }; - dummy = util.addDummyNode(g, "edge", attrs, "_d"); - if (vRank === labelRank) { - attrs.width = edgeLabel.width; - attrs.height = edgeLabel.height; - attrs.dummy = "edge-label"; - attrs.labelpos = edgeLabel.labelpos; - } - g.setEdge(v, dummy, { weight: edgeLabel.weight }, name); - if (i === 0) { - g.graph().dummyChains.push(dummy); - } - v = dummy; - } - - g.setEdge(v, w, { weight: edgeLabel.weight }, name); -} - -function undo(g) { - _.each(g.graph().dummyChains, function(v) { - var node = g.node(v), - origLabel = node.edgeLabel, - w; - g.setEdge(node.edgeObj, origLabel); - while (node.dummy) { - w = g.successors(v)[0]; - g.removeNode(v); - origLabel.points.push({ x: node.x, y: node.y }); - if (node.dummy === "edge-label") { - origLabel.x = node.x; - origLabel.y = node.y; - origLabel.width = node.width; - origLabel.height = node.height; - } - v = w; - node = g.node(v); - } - }); -} - -},{"./lodash":63,"./util":82}],66:[function(require,module,exports){ -var _ = require("../lodash"); - -module.exports = addSubgraphConstraints; - -function addSubgraphConstraints(g, cg, vs) { - var prev = {}, - rootPrev; - - _.each(vs, function(v) { - var child = g.parent(v), - parent, - prevChild; - while (child) { - parent = g.parent(child); - if (parent) { - prevChild = prev[parent]; - prev[parent] = child; - } else { - prevChild = rootPrev; - rootPrev = child; - } - if (prevChild && prevChild !== child) { - cg.setEdge(prevChild, child); - return; - } - child = parent; - } - }); - - /* - function dfs(v) { - var children = v ? g.children(v) : g.children(); - if (children.length) { - var min = Number.POSITIVE_INFINITY, - subgraphs = []; - _.each(children, function(child) { - var childMin = dfs(child); - if (g.children(child).length) { - subgraphs.push({ v: child, order: childMin }); - } - min = Math.min(min, childMin); - }); - _.reduce(_.sortBy(subgraphs, "order"), function(prev, curr) { - cg.setEdge(prev.v, curr.v); - return curr; - }); - return min; - } - return g.node(v).order; - } - dfs(undefined); - */ -} - -},{"../lodash":63}],67:[function(require,module,exports){ -var _ = require("../lodash"); - -module.exports = barycenter; - -function barycenter(g, movable) { - return _.map(movable, function(v) { - var inV = g.inEdges(v); - if (!inV.length) { - return { v: v }; - } else { - var result = _.reduce(inV, function(acc, e) { - var edge = g.edge(e), - nodeU = g.node(e.v); - return { - sum: acc.sum + (edge.weight * nodeU.order), - weight: acc.weight + edge.weight - }; - }, { sum: 0, weight: 0 }); - - return { - v: v, - barycenter: result.sum / result.weight, - weight: result.weight - }; - } - }); -} - - -},{"../lodash":63}],68:[function(require,module,exports){ -var _ = require("../lodash"), - Graph = require("../graphlib").Graph; - -module.exports = buildLayerGraph; - -/* - * Constructs a graph that can be used to sort a layer of nodes. The graph will - * contain all base and subgraph nodes from the request layer in their original - * hierarchy and any edges that are incident on these nodes and are of the type - * requested by the "relationship" parameter. - * - * Nodes from the requested rank that do not have parents are assigned a root - * node in the output graph, which is set in the root graph attribute. This - * makes it easy to walk the hierarchy of movable nodes during ordering. - * - * Pre-conditions: - * - * 1. Input graph is a DAG - * 2. Base nodes in the input graph have a rank attribute - * 3. Subgraph nodes in the input graph has minRank and maxRank attributes - * 4. Edges have an assigned weight - * - * Post-conditions: - * - * 1. Output graph has all nodes in the movable rank with preserved - * hierarchy. - * 2. Root nodes in the movable layer are made children of the node - * indicated by the root attribute of the graph. - * 3. Non-movable nodes incident on movable nodes, selected by the - * relationship parameter, are included in the graph (without hierarchy). - * 4. Edges incident on movable nodes, selected by the relationship - * parameter, are added to the output graph. - * 5. The weights for copied edges are aggregated as need, since the output - * graph is not a multi-graph. - */ -function buildLayerGraph(g, rank, relationship) { - var root = createRootNode(g), - result = new Graph({ compound: true }).setGraph({ root: root }) - .setDefaultNodeLabel(function(v) { return g.node(v); }); - - _.each(g.nodes(), function(v) { - var node = g.node(v), - parent = g.parent(v); - - if (node.rank === rank || node.minRank <= rank && rank <= node.maxRank) { - result.setNode(v); - result.setParent(v, parent || root); - - // This assumes we have only short edges! - _.each(g[relationship](v), function(e) { - var u = e.v === v ? e.w : e.v, - edge = result.edge(u, v), - weight = !_.isUndefined(edge) ? edge.weight : 0; - result.setEdge(u, v, { weight: g.edge(e).weight + weight }); - }); - - if (_.has(node, "minRank")) { - result.setNode(v, { - borderLeft: node.borderLeft[rank], - borderRight: node.borderRight[rank] - }); - } - } - }); - - return result; -} - -function createRootNode(g) { - var v; - while (g.hasNode((v = _.uniqueId("_root")))); - return v; -} - -},{"../graphlib":60,"../lodash":63}],69:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"); - -module.exports = crossCount; - -/* - * A function that takes a layering (an array of layers, each with an array of - * ordererd nodes) and a graph and returns a weighted crossing count. - * - * Pre-conditions: - * - * 1. Input graph must be simple (not a multigraph), directed, and include - * only simple edges. - * 2. Edges in the input graph must have assigned weights. - * - * Post-conditions: - * - * 1. The graph and layering matrix are left unchanged. - * - * This algorithm is derived from Barth, et al., "Bilayer Cross Counting." - */ -function crossCount(g, layering) { - var cc = 0; - for (var i = 1; i < layering.length; ++i) { - cc += twoLayerCrossCount(g, layering[i-1], layering[i]); - } - return cc; -} - -function twoLayerCrossCount(g, northLayer, southLayer) { - // Sort all of the edges between the north and south layers by their position - // in the north layer and then the south. Map these edges to the position of - // their head in the south layer. - var southPos = _.zipObject(southLayer, - _.map(southLayer, function (v, i) { return i; })); - var southEntries = _.flatten(_.map(northLayer, function(v) { - return _.chain(g.outEdges(v)) - .map(function(e) { - return { pos: southPos[e.w], weight: g.edge(e).weight }; - }) - .sortBy("pos") - .value(); - }), true); - - // Build the accumulator tree - var firstIndex = 1; - while (firstIndex < southLayer.length) firstIndex <<= 1; - var treeSize = 2 * firstIndex - 1; - firstIndex -= 1; - var tree = _.map(new Array(treeSize), function() { return 0; }); - - // Calculate the weighted crossings - var cc = 0; - _.each(southEntries.forEach(function(entry) { - var index = entry.pos + firstIndex; - tree[index] += entry.weight; - var weightSum = 0; - while (index > 0) { - if (index % 2) { - weightSum += tree[index + 1]; - } - index = (index - 1) >> 1; - tree[index] += entry.weight; - } - cc += entry.weight * weightSum; - })); - - return cc; -} - -},{"../lodash":63}],70:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - initOrder = require("./init-order"), - crossCount = require("./cross-count"), - sortSubgraph = require("./sort-subgraph"), - buildLayerGraph = require("./build-layer-graph"), - addSubgraphConstraints = require("./add-subgraph-constraints"), - Graph = require("../graphlib").Graph, - util = require("../util"); - -module.exports = order; - -/* - * Applies heuristics to minimize edge crossings in the graph and sets the best - * order solution as an order attribute on each node. - * - * Pre-conditions: - * - * 1. Graph must be DAG - * 2. Graph nodes must be objects with a "rank" attribute - * 3. Graph edges must have the "weight" attribute - * - * Post-conditions: - * - * 1. Graph nodes will have an "order" attribute based on the results of the - * algorithm. - */ -function order(g) { - var maxRank = util.maxRank(g), - downLayerGraphs = buildLayerGraphs(g, _.range(1, maxRank + 1), "inEdges"), - upLayerGraphs = buildLayerGraphs(g, _.range(maxRank - 1, -1, -1), "outEdges"); - - var layering = initOrder(g); - assignOrder(g, layering); - - var bestCC = Number.POSITIVE_INFINITY, - best; - - for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) { - sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2); - - layering = util.buildLayerMatrix(g); - var cc = crossCount(g, layering); - if (cc < bestCC) { - lastBest = 0; - best = _.cloneDeep(layering); - bestCC = cc; - } - } - - assignOrder(g, best); -} - -function buildLayerGraphs(g, ranks, relationship) { - return _.map(ranks, function(rank) { - return buildLayerGraph(g, rank, relationship); - }); -} - -function sweepLayerGraphs(layerGraphs, biasRight) { - var cg = new Graph(); - _.each(layerGraphs, function(lg) { - var root = lg.graph().root; - var sorted = sortSubgraph(lg, root, cg, biasRight); - _.each(sorted.vs, function(v, i) { - lg.node(v).order = i; - }); - addSubgraphConstraints(lg, cg, sorted.vs); - }); -} - -function assignOrder(g, layering) { - _.each(layering, function(layer) { - _.each(layer, function(v, i) { - g.node(v).order = i; - }); - }); -} - -},{"../graphlib":60,"../lodash":63,"../util":82,"./add-subgraph-constraints":66,"./build-layer-graph":68,"./cross-count":69,"./init-order":71,"./sort-subgraph":73}],71:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"); - -module.exports = initOrder; - -/* - * Assigns an initial order value for each node by performing a DFS search - * starting from nodes in the first rank. Nodes are assigned an order in their - * rank as they are first visited. - * - * This approach comes from Gansner, et al., "A Technique for Drawing Directed - * Graphs." - * - * Returns a layering matrix with an array per layer and each layer sorted by - * the order of its nodes. - */ -function initOrder(g) { - var visited = {}, - simpleNodes = _.filter(g.nodes(), function(v) { - return !g.children(v).length; - }), - maxRank = _.max(_.map(simpleNodes, function(v) { return g.node(v).rank; })), - layers = _.map(_.range(maxRank + 1), function() { return []; }); - - function dfs(v) { - if (_.has(visited, v)) return; - visited[v] = true; - var node = g.node(v); - layers[node.rank].push(v); - _.each(g.successors(v), dfs); - } - - var orderedVs = _.sortBy(simpleNodes, function(v) { return g.node(v).rank; }); - _.each(orderedVs, dfs); - - return layers; -} - -},{"../lodash":63}],72:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"); - -module.exports = resolveConflicts; - -/* - * Given a list of entries of the form {v, barycenter, weight} and a - * constraint graph this function will resolve any conflicts between the - * constraint graph and the barycenters for the entries. If the barycenters for - * an entry would violate a constraint in the constraint graph then we coalesce - * the nodes in the conflict into a new node that respects the contraint and - * aggregates barycenter and weight information. - * - * This implementation is based on the description in Forster, "A Fast and - * Simple Hueristic for Constrained Two-Level Crossing Reduction," thought it - * differs in some specific details. - * - * Pre-conditions: - * - * 1. Each entry has the form {v, barycenter, weight}, or if the node has - * no barycenter, then {v}. - * - * Returns: - * - * A new list of entries of the form {vs, i, barycenter, weight}. The list - * `vs` may either be a singleton or it may be an aggregation of nodes - * ordered such that they do not violate constraints from the constraint - * graph. The property `i` is the lowest original index of any of the - * elements in `vs`. - */ -function resolveConflicts(entries, cg) { - var mappedEntries = {}; - _.each(entries, function(entry, i) { - var tmp = mappedEntries[entry.v] = { - indegree: 0, - "in": [], - out: [], - vs: [entry.v], - i: i - }; - if (!_.isUndefined(entry.barycenter)) { - tmp.barycenter = entry.barycenter; - tmp.weight = entry.weight; - } - }); - - _.each(cg.edges(), function(e) { - var entryV = mappedEntries[e.v], - entryW = mappedEntries[e.w]; - if (!_.isUndefined(entryV) && !_.isUndefined(entryW)) { - entryW.indegree++; - entryV.out.push(mappedEntries[e.w]); - } - }); - - var sourceSet = _.filter(mappedEntries, function(entry) { - return !entry.indegree; - }); - - return doResolveConflicts(sourceSet); -} - -function doResolveConflicts(sourceSet) { - var entries = []; - - function handleIn(vEntry) { - return function(uEntry) { - if (uEntry.merged) { - return; - } - if (_.isUndefined(uEntry.barycenter) || - _.isUndefined(vEntry.barycenter) || - uEntry.barycenter >= vEntry.barycenter) { - mergeEntries(vEntry, uEntry); - } - }; - } - - function handleOut(vEntry) { - return function(wEntry) { - wEntry["in"].push(vEntry); - if (--wEntry.indegree === 0) { - sourceSet.push(wEntry); - } - }; - } - - while (sourceSet.length) { - var entry = sourceSet.pop(); - entries.push(entry); - _.each(entry["in"].reverse(), handleIn(entry)); - _.each(entry.out, handleOut(entry)); - } - - return _.chain(entries) - .filter(function(entry) { return !entry.merged; }) - .map(function(entry) { - return _.pick(entry, ["vs", "i", "barycenter", "weight"]); - }) - .value(); -} - -function mergeEntries(target, source) { - var sum = 0, - weight = 0; - - if (target.weight) { - sum += target.barycenter * target.weight; - weight += target.weight; - } - - if (source.weight) { - sum += source.barycenter * source.weight; - weight += source.weight; - } - - target.vs = source.vs.concat(target.vs); - target.barycenter = sum / weight; - target.weight = weight; - target.i = Math.min(source.i, target.i); - source.merged = true; -} - -},{"../lodash":63}],73:[function(require,module,exports){ -var _ = require("../lodash"), - barycenter = require("./barycenter"), - resolveConflicts = require("./resolve-conflicts"), - sort = require("./sort"); - -module.exports = sortSubgraph; - -function sortSubgraph(g, v, cg, biasRight) { - var movable = g.children(v), - node = g.node(v), - bl = node ? node.borderLeft : undefined, - br = node ? node.borderRight: undefined, - subgraphs = {}; - - if (bl) { - movable = _.filter(movable, function(w) { - return w !== bl && w !== br; - }); - } - - var barycenters = barycenter(g, movable); - _.each(barycenters, function(entry) { - if (g.children(entry.v).length) { - var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight); - subgraphs[entry.v] = subgraphResult; - if (_.has(subgraphResult, "barycenter")) { - mergeBarycenters(entry, subgraphResult); - } - } - }); - - var entries = resolveConflicts(barycenters, cg); - expandSubgraphs(entries, subgraphs); - - var result = sort(entries, biasRight); - - if (bl) { - result.vs = _.flatten([bl, result.vs, br], true); - if (g.predecessors(bl).length) { - var blPred = g.node(g.predecessors(bl)[0]), - brPred = g.node(g.predecessors(br)[0]); - if (!_.has(result, "barycenter")) { - result.barycenter = 0; - result.weight = 0; - } - result.barycenter = (result.barycenter * result.weight + - blPred.order + brPred.order) / (result.weight + 2); - result.weight += 2; - } - } - - return result; -} - -function expandSubgraphs(entries, subgraphs) { - _.each(entries, function(entry) { - entry.vs = _.flatten(entry.vs.map(function(v) { - if (subgraphs[v]) { - return subgraphs[v].vs; - } - return v; - }), true); - }); -} - -function mergeBarycenters(target, other) { - if (!_.isUndefined(target.barycenter)) { - target.barycenter = (target.barycenter * target.weight + - other.barycenter * other.weight) / - (target.weight + other.weight); - target.weight += other.weight; - } else { - target.barycenter = other.barycenter; - target.weight = other.weight; - } -} - -},{"../lodash":63,"./barycenter":67,"./resolve-conflicts":72,"./sort":74}],74:[function(require,module,exports){ -var _ = require("../lodash"), - util = require("../util"); - -module.exports = sort; - -function sort(entries, biasRight) { - var parts = util.partition(entries, function(entry) { - return _.has(entry, "barycenter"); - }); - var sortable = parts.lhs, - unsortable = _.sortBy(parts.rhs, function(entry) { return -entry.i; }), - vs = [], - sum = 0, - weight = 0, - vsIndex = 0; - - sortable.sort(compareWithBias(!!biasRight)); - - vsIndex = consumeUnsortable(vs, unsortable, vsIndex); - - _.each(sortable, function (entry) { - vsIndex += entry.vs.length; - vs.push(entry.vs); - sum += entry.barycenter * entry.weight; - weight += entry.weight; - vsIndex = consumeUnsortable(vs, unsortable, vsIndex); - }); - - var result = { vs: _.flatten(vs, true) }; - if (weight) { - result.barycenter = sum / weight; - result.weight = weight; - } - return result; -} - -function consumeUnsortable(vs, unsortable, index) { - var last; - while (unsortable.length && (last = _.last(unsortable)).i <= index) { - unsortable.pop(); - vs.push(last.vs); - index++; - } - return index; -} - -function compareWithBias(bias) { - return function(entryV, entryW) { - if (entryV.barycenter < entryW.barycenter) { - return -1; - } else if (entryV.barycenter > entryW.barycenter) { - return 1; - } - - return !bias ? entryV.i - entryW.i : entryW.i - entryV.i; - }; -} - -},{"../lodash":63,"../util":82}],75:[function(require,module,exports){ -var _ = require("./lodash"); - -module.exports = parentDummyChains; - -function parentDummyChains(g) { - var postorderNums = postorder(g); - - _.each(g.graph().dummyChains, function(v) { - var node = g.node(v), - edgeObj = node.edgeObj, - pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w), - path = pathData.path, - lca = pathData.lca, - pathIdx = 0, - pathV = path[pathIdx], - ascending = true; - - while (v !== edgeObj.w) { - node = g.node(v); - - if (ascending) { - while ((pathV = path[pathIdx]) !== lca && - g.node(pathV).maxRank < node.rank) { - pathIdx++; - } - - if (pathV === lca) { - ascending = false; - } - } - - if (!ascending) { - while (pathIdx < path.length - 1 && - g.node(pathV = path[pathIdx + 1]).minRank <= node.rank) { - pathIdx++; - } - pathV = path[pathIdx]; - } - - g.setParent(v, pathV); - v = g.successors(v)[0]; - } - }); -} - -// Find a path from v to w through the lowest common ancestor (LCA). Return the -// full path and the LCA. -function findPath(g, postorderNums, v, w) { - var vPath = [], - wPath = [], - low = Math.min(postorderNums[v].low, postorderNums[w].low), - lim = Math.max(postorderNums[v].lim, postorderNums[w].lim), - parent, - lca; - - // Traverse up from v to find the LCA - parent = v; - do { - parent = g.parent(parent); - vPath.push(parent); - } while (parent && - (postorderNums[parent].low > low || lim > postorderNums[parent].lim)); - lca = parent; - - // Traverse from w to LCA - parent = w; - while ((parent = g.parent(parent)) !== lca) { - wPath.push(parent); - } - - return { path: vPath.concat(wPath.reverse()), lca: lca }; -} - -function postorder(g) { - var result = {}, - lim = 0; - - function dfs(v) { - var low = lim; - _.each(g.children(v), dfs); - result[v] = { low: low, lim: lim++ }; - } - _.each(g.children(), dfs); - - return result; -} - -},{"./lodash":63}],76:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - Graph = require("../graphlib").Graph, - util = require("../util"); - -/* - * This module provides coordinate assignment based on Brandes and Köpf, "Fast - * and Simple Horizontal Coordinate Assignment." - */ - -module.exports = { - positionX: positionX, - findType1Conflicts: findType1Conflicts, - findType2Conflicts: findType2Conflicts, - addConflict: addConflict, - hasConflict: hasConflict, - verticalAlignment: verticalAlignment, - horizontalCompaction: horizontalCompaction, - alignCoordinates: alignCoordinates, - findSmallestWidthAlignment: findSmallestWidthAlignment, - balance: balance -}; - -/* - * Marks all edges in the graph with a type-1 conflict with the "type1Conflict" - * property. A type-1 conflict is one where a non-inner segment crosses an - * inner segment. An inner segment is an edge with both incident nodes marked - * with the "dummy" property. - * - * This algorithm scans layer by layer, starting with the second, for type-1 - * conflicts between the current layer and the previous layer. For each layer - * it scans the nodes from left to right until it reaches one that is incident - * on an inner segment. It then scans predecessors to determine if they have - * edges that cross that inner segment. At the end a final scan is done for all - * nodes on the current rank to see if they cross the last visited inner - * segment. - * - * This algorithm (safely) assumes that a dummy node will only be incident on a - * single node in the layers being scanned. - */ -function findType1Conflicts(g, layering) { - var conflicts = {}; - - function visitLayer(prevLayer, layer) { - var - // last visited node in the previous layer that is incident on an inner - // segment. - k0 = 0, - // Tracks the last node in this layer scanned for crossings with a type-1 - // segment. - scanPos = 0, - prevLayerLength = prevLayer.length, - lastNode = _.last(layer); - - _.each(layer, function(v, i) { - var w = findOtherInnerSegmentNode(g, v), - k1 = w ? g.node(w).order : prevLayerLength; - - if (w || v === lastNode) { - _.each(layer.slice(scanPos, i +1), function(scanNode) { - _.each(g.predecessors(scanNode), function(u) { - var uLabel = g.node(u), - uPos = uLabel.order; - if ((uPos < k0 || k1 < uPos) && - !(uLabel.dummy && g.node(scanNode).dummy)) { - addConflict(conflicts, u, scanNode); - } - }); - }); - scanPos = i + 1; - k0 = k1; - } - }); - - return layer; - } - - _.reduce(layering, visitLayer); - return conflicts; -} - -function findType2Conflicts(g, layering) { - var conflicts = {}; - - function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) { - var v; - _.each(_.range(southPos, southEnd), function(i) { - v = south[i]; - if (g.node(v).dummy) { - _.each(g.predecessors(v), function(u) { - var uNode = g.node(u); - if (uNode.dummy && - (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) { - addConflict(conflicts, u, v); - } - }); - } - }); - } - - - function visitLayer(north, south) { - var prevNorthPos = -1, - nextNorthPos, - southPos = 0; - - _.each(south, function(v, southLookahead) { - if (g.node(v).dummy === "border") { - var predecessors = g.predecessors(v); - if (predecessors.length) { - nextNorthPos = g.node(predecessors[0]).order; - scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos); - southPos = southLookahead; - prevNorthPos = nextNorthPos; - } - } - scan(south, southPos, south.length, nextNorthPos, north.length); - }); - - return south; - } - - _.reduce(layering, visitLayer); - return conflicts; -} - -function findOtherInnerSegmentNode(g, v) { - if (g.node(v).dummy) { - return _.find(g.predecessors(v), function(u) { - return g.node(u).dummy; - }); - } -} - -function addConflict(conflicts, v, w) { - if (v > w) { - var tmp = v; - v = w; - w = tmp; - } - - var conflictsV = conflicts[v]; - if (!conflictsV) { - conflicts[v] = conflictsV = {}; - } - conflictsV[w] = true; -} - -function hasConflict(conflicts, v, w) { - if (v > w) { - var tmp = v; - v = w; - w = tmp; - } - return _.has(conflicts[v], w); -} - -/* - * Try to align nodes into vertical "blocks" where possible. This algorithm - * attempts to align a node with one of its median neighbors. If the edge - * connecting a neighbor is a type-1 conflict then we ignore that possibility. - * If a previous node has already formed a block with a node after the node - * we're trying to form a block with, we also ignore that possibility - our - * blocks would be split in that scenario. - */ -function verticalAlignment(g, layering, conflicts, neighborFn) { - var root = {}, - align = {}, - pos = {}; - - // We cache the position here based on the layering because the graph and - // layering may be out of sync. The layering matrix is manipulated to - // generate different extreme alignments. - _.each(layering, function(layer) { - _.each(layer, function(v, order) { - root[v] = v; - align[v] = v; - pos[v] = order; - }); - }); - - _.each(layering, function(layer) { - var prevIdx = -1; - _.each(layer, function(v) { - var ws = neighborFn(v); - if (ws.length) { - ws = _.sortBy(ws, function(w) { return pos[w]; }); - var mp = (ws.length - 1) / 2; - for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) { - var w = ws[i]; - if (align[v] === v && - prevIdx < pos[w] && - !hasConflict(conflicts, v, w)) { - align[w] = v; - align[v] = root[v] = root[w]; - prevIdx = pos[w]; - } - } - } - }); - }); - - return { root: root, align: align }; -} - -function horizontalCompaction(g, layering, root, align, reverseSep) { - // This portion of the algorithm differs from BK due to a number of problems. - // Instead of their algorithm we construct a new block graph and do two - // sweeps. The first sweep places blocks with the smallest possible - // coordinates. The second sweep removes unused space by moving blocks to the - // greatest coordinates without violating separation. - var xs = {}, - blockG = buildBlockGraph(g, layering, root, reverseSep); - - // First pass, assign smallest coordinates via DFS - var visited = {}; - function pass1(v) { - if (!_.has(visited, v)) { - visited[v] = true; - xs[v] = _.reduce(blockG.inEdges(v), function(max, e) { - pass1(e.v); - return Math.max(max, xs[e.v] + blockG.edge(e)); - }, 0); - } - } - _.each(blockG.nodes(), pass1); - - var borderType = reverseSep ? "borderLeft" : "borderRight"; - function pass2(v) { - if (visited[v] !== 2) { - visited[v]++; - var node = g.node(v); - var min = _.reduce(blockG.outEdges(v), function(min, e) { - pass2(e.w); - return Math.min(min, xs[e.w] - blockG.edge(e)); - }, Number.POSITIVE_INFINITY); - if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) { - xs[v] = Math.max(xs[v], min); - } - } - } - _.each(blockG.nodes(), pass2); - - // Assign x coordinates to all nodes - _.each(align, function(v) { - xs[v] = xs[root[v]]; - }); - - return xs; -} - - -function buildBlockGraph(g, layering, root, reverseSep) { - var blockGraph = new Graph(), - graphLabel = g.graph(), - sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep); - - _.each(layering, function(layer) { - var u; - _.each(layer, function(v) { - var vRoot = root[v]; - blockGraph.setNode(vRoot); - if (u) { - var uRoot = root[u], - prevMax = blockGraph.edge(uRoot, vRoot); - blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0)); - } - u = v; - }); - }); - - return blockGraph; -} - -/* - * Returns the alignment that has the smallest width of the given alignments. - */ -function findSmallestWidthAlignment(g, xss) { - return _.min(xss, function(xs) { - var min = _.min(xs, function(x, v) { return x - width(g, v) / 2; }), - max = _.max(xs, function(x, v) { return x + width(g, v) / 2; }); - return max - min; - }); -} - -/* - * Align the coordinates of each of the layout alignments such that - * left-biased alignments have their minimum coordinate at the same point as - * the minimum coordinate of the smallest width alignment and right-biased - * alignments have their maximum coordinate at the same point as the maximum - * coordinate of the smallest width alignment. - */ -function alignCoordinates(xss, alignTo) { - var alignToMin = _.min(alignTo), - alignToMax = _.max(alignTo); - - _.each(["u", "d"], function(vert) { - _.each(["l", "r"], function(horiz) { - var alignment = vert + horiz, - xs = xss[alignment], - delta; - if (xs === alignTo) return; - - delta = horiz === "l" ? alignToMin - _.min(xs) : alignToMax - _.max(xs); - - if (delta) { - xss[alignment] = _.mapValues(xs, function(x) { return x + delta; }); - } - }); - }); -} - -function balance(xss, align) { - return _.mapValues(xss.ul, function(ignore, v) { - if (align) { - return xss[align.toLowerCase()][v]; - } else { - var xs = _.sortBy(_.pluck(xss, v)); - return (xs[1] + xs[2]) / 2; - } - }); -} - -function positionX(g) { - var layering = util.buildLayerMatrix(g), - conflicts = _.merge(findType1Conflicts(g, layering), - findType2Conflicts(g, layering)); - - var xss = {}, - adjustedLayering; - _.each(["u", "d"], function(vert) { - adjustedLayering = vert === "u" ? layering : _.values(layering).reverse(); - _.each(["l", "r"], function(horiz) { - if (horiz === "r") { - adjustedLayering = _.map(adjustedLayering, function(inner) { - return _.values(inner).reverse(); - }); - } - - var neighborFn = _.bind(vert === "u" ? g.predecessors : g.successors, g); - var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn); - var xs = horizontalCompaction(g, adjustedLayering, - align.root, align.align, - horiz === "r"); - if (horiz === "r") { - xs = _.mapValues(xs, function(x) { return -x; }); - } - xss[vert + horiz] = xs; - }); - }); - - var smallestWidth = findSmallestWidthAlignment(g, xss); - alignCoordinates(xss, smallestWidth); - return balance(xss, g.graph().align); -} - -function sep(nodeSep, edgeSep, reverseSep) { - return function(g, v, w) { - var vLabel = g.node(v), - wLabel = g.node(w), - sum = 0, - delta; - - sum += vLabel.width / 2; - if (_.has(vLabel, "labelpos")) { - switch (vLabel.labelpos.toLowerCase()) { - case "l": delta = -vLabel.width / 2; break; - case "r": delta = vLabel.width / 2; break; - } - } - if (delta) { - sum += reverseSep ? delta : -delta; - } - delta = 0; - - sum += (vLabel.dummy ? edgeSep : nodeSep) / 2; - sum += (wLabel.dummy ? edgeSep : nodeSep) / 2; - - sum += wLabel.width / 2; - if (_.has(wLabel, "labelpos")) { - switch (wLabel.labelpos.toLowerCase()) { - case "l": delta = wLabel.width / 2; break; - case "r": delta = -wLabel.width / 2; break; - } - } - if (delta) { - sum += reverseSep ? delta : -delta; - } - delta = 0; - - return sum; - }; -} - -function width(g, v) { - return g.node(v).width; -} - -},{"../graphlib":60,"../lodash":63,"../util":82}],77:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - util = require("../util"), - positionX = require("./bk").positionX; - -module.exports = position; - -function position(g) { - g = util.asNonCompoundGraph(g); - - positionY(g); - _.each(positionX(g), function(x, v) { - g.node(v).x = x; - }); -} - -function positionY(g) { - var layering = util.buildLayerMatrix(g), - rankSep = g.graph().ranksep, - prevY = 0; - _.each(layering, function(layer) { - var maxHeight = _.max(_.map(layer, function(v) { return g.node(v).height; })); - _.each(layer, function(v) { - g.node(v).y = prevY + maxHeight / 2; - }); - prevY += maxHeight + rankSep; - }); -} - - -},{"../lodash":63,"../util":82,"./bk":76}],78:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - Graph = require("../graphlib").Graph, - slack = require("./util").slack; - -module.exports = feasibleTree; - -/* - * Constructs a spanning tree with tight edges and adjusted the input node's - * ranks to achieve this. A tight edge is one that is has a length that matches - * its "minlen" attribute. - * - * The basic structure for this function is derived from Gansner, et al., "A - * Technique for Drawing Directed Graphs." - * - * Pre-conditions: - * - * 1. Graph must be a DAG. - * 2. Graph must be connected. - * 3. Graph must have at least one node. - * 5. Graph nodes must have been previously assigned a "rank" property that - * respects the "minlen" property of incident edges. - * 6. Graph edges must have a "minlen" property. - * - * Post-conditions: - * - * - Graph nodes will have their rank adjusted to ensure that all edges are - * tight. - * - * Returns a tree (undirected graph) that is constructed using only "tight" - * edges. - */ -function feasibleTree(g) { - var t = new Graph({ directed: false }); - - // Choose arbitrary node from which to start our tree - var start = g.nodes()[0], - size = g.nodeCount(); - t.setNode(start, {}); - - var edge, delta; - while (tightTree(t, g) < size) { - edge = findMinSlackEdge(t, g); - delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge); - shiftRanks(t, g, delta); - } - - return t; -} - -/* - * Finds a maximal tree of tight edges and returns the number of nodes in the - * tree. - */ -function tightTree(t, g) { - function dfs(v) { - _.each(g.nodeEdges(v), function(e) { - var edgeV = e.v, - w = (v === edgeV) ? e.w : edgeV; - if (!t.hasNode(w) && !slack(g, e)) { - t.setNode(w, {}); - t.setEdge(v, w, {}); - dfs(w); - } - }); - } - - _.each(t.nodes(), dfs); - return t.nodeCount(); -} - -/* - * Finds the edge with the smallest slack that is incident on tree and returns - * it. - */ -function findMinSlackEdge(t, g) { - return _.min(g.edges(), function(e) { - if (t.hasNode(e.v) !== t.hasNode(e.w)) { - return slack(g, e); - } - }); -} - -function shiftRanks(t, g, delta) { - _.each(t.nodes(), function(v) { - g.node(v).rank += delta; - }); -} - -},{"../graphlib":60,"../lodash":63,"./util":81}],79:[function(require,module,exports){ -"use strict"; - -var rankUtil = require("./util"), - longestPath = rankUtil.longestPath, - feasibleTree = require("./feasible-tree"), - networkSimplex = require("./network-simplex"); - -module.exports = rank; - -/* - * Assigns a rank to each node in the input graph that respects the "minlen" - * constraint specified on edges between nodes. - * - * This basic structure is derived from Gansner, et al., "A Technique for - * Drawing Directed Graphs." - * - * Pre-conditions: - * - * 1. Graph must be a connected DAG - * 2. Graph nodes must be objects - * 3. Graph edges must have "weight" and "minlen" attributes - * - * Post-conditions: - * - * 1. Graph nodes will have a "rank" attribute based on the results of the - * algorithm. Ranks can start at any index (including negative), we'll - * fix them up later. - */ -function rank(g) { - switch(g.graph().ranker) { - case "network-simplex": networkSimplexRanker(g); break; - case "tight-tree": tightTreeRanker(g); break; - case "longest-path": longestPathRanker(g); break; - default: networkSimplexRanker(g); - } -} - -// A fast and simple ranker, but results are far from optimal. -var longestPathRanker = longestPath; - -function tightTreeRanker(g) { - longestPath(g); - feasibleTree(g); -} - -function networkSimplexRanker(g) { - networkSimplex(g); -} - -},{"./feasible-tree":78,"./network-simplex":80,"./util":81}],80:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - feasibleTree = require("./feasible-tree"), - slack = require("./util").slack, - initRank = require("./util").longestPath, - preorder = require("../graphlib").alg.preorder, - postorder = require("../graphlib").alg.postorder, - simplify = require("../util").simplify; - -module.exports = networkSimplex; - -// Expose some internals for testing purposes -networkSimplex.initLowLimValues = initLowLimValues; -networkSimplex.initCutValues = initCutValues; -networkSimplex.calcCutValue = calcCutValue; -networkSimplex.leaveEdge = leaveEdge; -networkSimplex.enterEdge = enterEdge; -networkSimplex.exchangeEdges = exchangeEdges; - -/* - * The network simplex algorithm assigns ranks to each node in the input graph - * and iteratively improves the ranking to reduce the length of edges. - * - * Preconditions: - * - * 1. The input graph must be a DAG. - * 2. All nodes in the graph must have an object value. - * 3. All edges in the graph must have "minlen" and "weight" attributes. - * - * Postconditions: - * - * 1. All nodes in the graph will have an assigned "rank" attribute that has - * been optimized by the network simplex algorithm. Ranks start at 0. - * - * - * A rough sketch of the algorithm is as follows: - * - * 1. Assign initial ranks to each node. We use the longest path algorithm, - * which assigns ranks to the lowest position possible. In general this - * leads to very wide bottom ranks and unnecessarily long edges. - * 2. Construct a feasible tight tree. A tight tree is one such that all - * edges in the tree have no slack (difference between length of edge - * and minlen for the edge). This by itself greatly improves the assigned - * rankings by shorting edges. - * 3. Iteratively find edges that have negative cut values. Generally a - * negative cut value indicates that the edge could be removed and a new - * tree edge could be added to produce a more compact graph. - * - * Much of the algorithms here are derived from Gansner, et al., "A Technique - * for Drawing Directed Graphs." The structure of the file roughly follows the - * structure of the overall algorithm. - */ -function networkSimplex(g) { - g = simplify(g); - initRank(g); - var t = feasibleTree(g); - initLowLimValues(t); - initCutValues(t, g); - - var e, f; - while ((e = leaveEdge(t))) { - f = enterEdge(t, g, e); - exchangeEdges(t, g, e, f); - } -} - -/* - * Initializes cut values for all edges in the tree. - */ -function initCutValues(t, g) { - var vs = postorder(t, t.nodes()); - vs = vs.slice(0, vs.length - 1); - _.each(vs, function(v) { - assignCutValue(t, g, v); - }); -} - -function assignCutValue(t, g, child) { - var childLab = t.node(child), - parent = childLab.parent; - t.edge(child, parent).cutvalue = calcCutValue(t, g, child); -} - -/* - * Given the tight tree, its graph, and a child in the graph calculate and - * return the cut value for the edge between the child and its parent. - */ -function calcCutValue(t, g, child) { - var childLab = t.node(child), - parent = childLab.parent, - // True if the child is on the tail end of the edge in the directed graph - childIsTail = true, - // The graph's view of the tree edge we're inspecting - graphEdge = g.edge(child, parent), - // The accumulated cut value for the edge between this node and its parent - cutValue = 0; - - if (!graphEdge) { - childIsTail = false; - graphEdge = g.edge(parent, child); - } - - cutValue = graphEdge.weight; - - _.each(g.nodeEdges(child), function(e) { - var isOutEdge = e.v === child, - other = isOutEdge ? e.w : e.v; - - if (other !== parent) { - var pointsToHead = isOutEdge === childIsTail, - otherWeight = g.edge(e).weight; - - cutValue += pointsToHead ? otherWeight : -otherWeight; - if (isTreeEdge(t, child, other)) { - var otherCutValue = t.edge(child, other).cutvalue; - cutValue += pointsToHead ? -otherCutValue : otherCutValue; - } - } - }); - - return cutValue; -} - -function initLowLimValues(tree, root) { - if (arguments.length < 2) { - root = tree.nodes()[0]; - } - dfsAssignLowLim(tree, {}, 1, root); -} - -function dfsAssignLowLim(tree, visited, nextLim, v, parent) { - var low = nextLim, - label = tree.node(v); - - visited[v] = true; - _.each(tree.neighbors(v), function(w) { - if (!_.has(visited, w)) { - nextLim = dfsAssignLowLim(tree, visited, nextLim, w, v); - } - }); - - label.low = low; - label.lim = nextLim++; - if (parent) { - label.parent = parent; - } else { - // TODO should be able to remove this when we incrementally update low lim - delete label.parent; - } - - return nextLim; -} - -function leaveEdge(tree) { - return _.find(tree.edges(), function(e) { - return tree.edge(e).cutvalue < 0; - }); -} - -function enterEdge(t, g, edge) { - var v = edge.v, - w = edge.w; - - // For the rest of this function we assume that v is the tail and w is the - // head, so if we don't have this edge in the graph we should flip it to - // match the correct orientation. - if (!g.hasEdge(v, w)) { - v = edge.w; - w = edge.v; - } - - var vLabel = t.node(v), - wLabel = t.node(w), - tailLabel = vLabel, - flip = false; - - // If the root is in the tail of the edge then we need to flip the logic that - // checks for the head and tail nodes in the candidates function below. - if (vLabel.lim > wLabel.lim) { - tailLabel = wLabel; - flip = true; - } - - var candidates = _.filter(g.edges(), function(edge) { - return flip === isDescendant(t, t.node(edge.v), tailLabel) && - flip !== isDescendant(t, t.node(edge.w), tailLabel); - }); - - return _.min(candidates, function(edge) { return slack(g, edge); }); -} - -function exchangeEdges(t, g, e, f) { - var v = e.v, - w = e.w; - t.removeEdge(v, w); - t.setEdge(f.v, f.w, {}); - initLowLimValues(t); - initCutValues(t, g); - updateRanks(t, g); -} - -function updateRanks(t, g) { - var root = _.find(t.nodes(), function(v) { return !g.node(v).parent; }), - vs = preorder(t, root); - vs = vs.slice(1); - _.each(vs, function(v) { - var parent = t.node(v).parent, - edge = g.edge(v, parent), - flipped = false; - - if (!edge) { - edge = g.edge(parent, v); - flipped = true; - } - - g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen); - }); -} - -/* - * Returns true if the edge is in the tree. - */ -function isTreeEdge(tree, u, v) { - return tree.hasEdge(u, v); -} - -/* - * Returns true if the specified node is descendant of the root node per the - * assigned low and lim attributes in the tree. - */ -function isDescendant(tree, vLabel, rootLabel) { - return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim; -} - -},{"../graphlib":60,"../lodash":63,"../util":82,"./feasible-tree":78,"./util":81}],81:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"); - -module.exports = { - longestPath: longestPath, - slack: slack -}; - -/* - * Initializes ranks for the input graph using the longest path algorithm. This - * algorithm scales well and is fast in practice, it yields rather poor - * solutions. Nodes are pushed to the lowest layer possible, leaving the bottom - * ranks wide and leaving edges longer than necessary. However, due to its - * speed, this algorithm is good for getting an initial ranking that can be fed - * into other algorithms. - * - * This algorithm does not normalize layers because it will be used by other - * algorithms in most cases. If using this algorithm directly, be sure to - * run normalize at the end. - * - * Pre-conditions: - * - * 1. Input graph is a DAG. - * 2. Input graph node labels can be assigned properties. - * - * Post-conditions: - * - * 1. Each node will be assign an (unnormalized) "rank" property. - */ -function longestPath(g) { - var visited = {}; - - function dfs(v) { - var label = g.node(v); - if (_.has(visited, v)) { - return label.rank; - } - visited[v] = true; - - var rank = _.min(_.map(g.outEdges(v), function(e) { - return dfs(e.w) - g.edge(e).minlen; - })); - - if (rank === Number.POSITIVE_INFINITY) { - rank = 0; - } - - return (label.rank = rank); - } - - _.each(g.sources(), dfs); -} - -/* - * Returns the amount of slack for the given edge. The slack is defined as the - * difference between the length of the edge and its minimum length. - */ -function slack(g, e) { - return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen; -} - -},{"../lodash":63}],82:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"), - Graph = require("./graphlib").Graph; - -module.exports = { - addDummyNode: addDummyNode, - simplify: simplify, - asNonCompoundGraph: asNonCompoundGraph, - successorWeights: successorWeights, - predecessorWeights: predecessorWeights, - intersectRect: intersectRect, - buildLayerMatrix: buildLayerMatrix, - normalizeRanks: normalizeRanks, - removeEmptyRanks: removeEmptyRanks, - addBorderNode: addBorderNode, - maxRank: maxRank, - partition: partition, - time: time, - notime: notime -}; - -/* - * Adds a dummy node to the graph and return v. - */ -function addDummyNode(g, type, attrs, name) { - var v; - do { - v = _.uniqueId(name); - } while (g.hasNode(v)); - - attrs.dummy = type; - g.setNode(v, attrs); - return v; -} - -/* - * Returns a new graph with only simple edges. Handles aggregation of data - * associated with multi-edges. - */ -function simplify(g) { - var simplified = new Graph().setGraph(g.graph()); - _.each(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); }); - _.each(g.edges(), function(e) { - var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 }, - label = g.edge(e); - simplified.setEdge(e.v, e.w, { - weight: simpleLabel.weight + label.weight, - minlen: Math.max(simpleLabel.minlen, label.minlen) - }); - }); - return simplified; -} - -function asNonCompoundGraph(g) { - var simplified = new Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph()); - _.each(g.nodes(), function(v) { - if (!g.children(v).length) { - simplified.setNode(v, g.node(v)); - } - }); - _.each(g.edges(), function(e) { - simplified.setEdge(e, g.edge(e)); - }); - return simplified; -} - -function successorWeights(g) { - var weightMap = _.map(g.nodes(), function(v) { - var sucs = {}; - _.each(g.outEdges(v), function(e) { - sucs[e.w] = (sucs[e.w] || 0) + g.edge(e).weight; - }); - return sucs; - }); - return _.zipObject(g.nodes(), weightMap); -} - -function predecessorWeights(g) { - var weightMap = _.map(g.nodes(), function(v) { - var preds = {}; - _.each(g.inEdges(v), function(e) { - preds[e.v] = (preds[e.v] || 0) + g.edge(e).weight; - }); - return preds; - }); - return _.zipObject(g.nodes(), weightMap); -} - -/* - * Finds where a line starting at point ({x, y}) would intersect a rectangle - * ({x, y, width, height}) if it were pointing at the rectangle's center. - */ -function intersectRect(rect, point) { - var x = rect.x; - var y = rect.y; - - // Rectangle intersection algorithm from: - // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes - var dx = point.x - x; - var dy = point.y - y; - var w = rect.width / 2; - var h = rect.height / 2; - - if (!dx && !dy) { - throw new Error("Not possible to find intersection inside of the rectangle"); - } - - var sx, sy; - if (Math.abs(dy) * w > Math.abs(dx) * h) { - // Intersection is top or bottom of rect. - if (dy < 0) { - h = -h; - } - sx = h * dx / dy; - sy = h; - } else { - // Intersection is left or right of rect. - if (dx < 0) { - w = -w; - } - sx = w; - sy = w * dy / dx; - } - - return { x: x + sx, y: y + sy }; -} - -/* - * Given a DAG with each node assigned "rank" and "order" properties, this - * function will produce a matrix with the ids of each node. - */ -function buildLayerMatrix(g) { - var layering = _.map(_.range(maxRank(g) + 1), function() { return []; }); - _.each(g.nodes(), function(v) { - var node = g.node(v), - rank = node.rank; - if (!_.isUndefined(rank)) { - layering[rank][node.order] = v; - } - }); - return layering; -} - -/* - * Adjusts the ranks for all nodes in the graph such that all nodes v have - * rank(v) >= 0 and at least one node w has rank(w) = 0. - */ -function normalizeRanks(g) { - var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); - _.each(g.nodes(), function(v) { - var node = g.node(v); - if (_.has(node, "rank")) { - node.rank -= min; - } - }); -} - -function removeEmptyRanks(g) { - // Ranks may not start at 0, so we need to offset them - var offset = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); - - var layers = []; - _.each(g.nodes(), function(v) { - var rank = g.node(v).rank - offset; - if (!layers[rank]) { - layers[rank] = []; - } - layers[rank].push(v); - }); - - var delta = 0, - nodeRankFactor = g.graph().nodeRankFactor; - _.each(layers, function(vs, i) { - if (_.isUndefined(vs) && i % nodeRankFactor !== 0) { - --delta; - } else if (delta) { - _.each(vs, function(v) { g.node(v).rank += delta; }); - } - }); -} - -function addBorderNode(g, prefix, rank, order) { - var node = { - width: 0, - height: 0 - }; - if (arguments.length >= 4) { - node.rank = rank; - node.order = order; - } - return addDummyNode(g, "border", node, prefix); -} - -function maxRank(g) { - return _.max(_.map(g.nodes(), function(v) { - var rank = g.node(v).rank; - if (!_.isUndefined(rank)) { - return rank; - } - })); -} - -/* - * Partition a collection into two groups: `lhs` and `rhs`. If the supplied - * function returns true for an entry it goes into `lhs`. Otherwise it goes - * into `rhs. - */ -function partition(collection, fn) { - var result = { lhs: [], rhs: [] }; - _.each(collection, function(value) { - if (fn(value)) { - result.lhs.push(value); - } else { - result.rhs.push(value); - } - }); - return result; -} - -/* - * Returns a new function that wraps `fn` with a timer. The wrapper logs the - * time it takes to execute the function. - */ -function time(name, fn) { - var start = _.now(); - try { - return fn(); - } finally { - console.log(name + " time: " + (_.now() - start) + "ms"); - } -} - -function notime(name, fn) { - return fn(); -} - -},{"./graphlib":60,"./lodash":63}],83:[function(require,module,exports){ -module.exports = "0.7.4"; - -},{}],84:[function(require,module,exports){ -module.exports=require(33) -},{"./lib":100,"./lib/alg":91,"./lib/json":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\index.js":33}],85:[function(require,module,exports){ -module.exports=require(34) -},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\components.js":34}],86:[function(require,module,exports){ -module.exports=require(35) -},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dfs.js":35}],87:[function(require,module,exports){ -module.exports=require(36) -},{"../lodash":102,"./dijkstra":88,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dijkstra-all.js":36}],88:[function(require,module,exports){ -module.exports=require(37) -},{"../data/priority-queue":98,"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dijkstra.js":37}],89:[function(require,module,exports){ -module.exports=require(38) -},{"../lodash":102,"./tarjan":96,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\find-cycles.js":38}],90:[function(require,module,exports){ -module.exports=require(39) -},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\floyd-warshall.js":39}],91:[function(require,module,exports){ -module.exports=require(40) -},{"./components":85,"./dijkstra":88,"./dijkstra-all":87,"./find-cycles":89,"./floyd-warshall":90,"./is-acyclic":92,"./postorder":93,"./preorder":94,"./prim":95,"./tarjan":96,"./topsort":97,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\index.js":40}],92:[function(require,module,exports){ -module.exports=require(41) -},{"./topsort":97,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\is-acyclic.js":41}],93:[function(require,module,exports){ -module.exports=require(42) -},{"./dfs":86,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\postorder.js":42}],94:[function(require,module,exports){ -module.exports=require(43) -},{"./dfs":86,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\preorder.js":43}],95:[function(require,module,exports){ -module.exports=require(44) -},{"../data/priority-queue":98,"../graph":99,"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\prim.js":44}],96:[function(require,module,exports){ -module.exports=require(45) -},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\tarjan.js":45}],97:[function(require,module,exports){ -module.exports=require(46) -},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\topsort.js":46}],98:[function(require,module,exports){ -module.exports=require(47) -},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\data\\priority-queue.js":47}],99:[function(require,module,exports){ -module.exports=require(48) -},{"./lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\graph.js":48}],100:[function(require,module,exports){ -module.exports=require(49) -},{"./graph":99,"./version":103,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\index.js":49}],101:[function(require,module,exports){ -module.exports=require(50) -},{"./graph":99,"./lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\json.js":50}],102:[function(require,module,exports){ -module.exports=require(51) -},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\lodash.js":51,"lodash":104}],103:[function(require,module,exports){ -module.exports=require(52) -},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\version.js":52}],104:[function(require,module,exports){ -module.exports=require(53) -},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\lodash\\index.js":53}],105:[function(require,module,exports){ -(function (global){ -/*! http://mths.be/he v0.5.0 by @mathias | MIT license */ -;(function(root) { - - // Detect free variables `exports`. - var freeExports = typeof exports == 'object' && exports; - - // Detect free variable `module`. - var freeModule = typeof module == 'object' && module && - module.exports == freeExports && module; - - // Detect free variable `global`, from Node.js or Browserified code, - // and use it as `root`. - var freeGlobal = typeof global == 'object' && global; - if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { - root = freeGlobal; - } - - /*--------------------------------------------------------------------------*/ - - // All astral symbols. - var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; - // All ASCII symbols (not just printable ASCII) except those listed in the - // first column of the overrides table. - // http://whatwg.org/html/tokenization.html#table-charref-overrides - var regexAsciiWhitelist = /[\x01-\x7F]/g; - // All BMP symbols that are not ASCII newlines, printable ASCII symbols, or - // code points listed in the first column of the overrides table on - // http://whatwg.org/html/tokenization.html#table-charref-overrides. - var regexBmpWhitelist = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g; - - var regexEncodeNonAscii = /<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g; - var encodeMap = {'\xC1':'Aacute','\xE1':'aacute','\u0102':'Abreve','\u0103':'abreve','\u223E':'ac','\u223F':'acd','\u223E\u0333':'acE','\xC2':'Acirc','\xE2':'acirc','\xB4':'acute','\u0410':'Acy','\u0430':'acy','\xC6':'AElig','\xE6':'aelig','\u2061':'af','\uD835\uDD04':'Afr','\uD835\uDD1E':'afr','\xC0':'Agrave','\xE0':'agrave','\u2135':'aleph','\u0391':'Alpha','\u03B1':'alpha','\u0100':'Amacr','\u0101':'amacr','\u2A3F':'amalg','&':'amp','\u2A55':'andand','\u2A53':'And','\u2227':'and','\u2A5C':'andd','\u2A58':'andslope','\u2A5A':'andv','\u2220':'ang','\u29A4':'ange','\u29A8':'angmsdaa','\u29A9':'angmsdab','\u29AA':'angmsdac','\u29AB':'angmsdad','\u29AC':'angmsdae','\u29AD':'angmsdaf','\u29AE':'angmsdag','\u29AF':'angmsdah','\u2221':'angmsd','\u221F':'angrt','\u22BE':'angrtvb','\u299D':'angrtvbd','\u2222':'angsph','\xC5':'angst','\u237C':'angzarr','\u0104':'Aogon','\u0105':'aogon','\uD835\uDD38':'Aopf','\uD835\uDD52':'aopf','\u2A6F':'apacir','\u2248':'ap','\u2A70':'apE','\u224A':'ape','\u224B':'apid','\'':'apos','\xE5':'aring','\uD835\uDC9C':'Ascr','\uD835\uDCB6':'ascr','\u2254':'colone','*':'ast','\u224D':'CupCap','\xC3':'Atilde','\xE3':'atilde','\xC4':'Auml','\xE4':'auml','\u2233':'awconint','\u2A11':'awint','\u224C':'bcong','\u03F6':'bepsi','\u2035':'bprime','\u223D':'bsim','\u22CD':'bsime','\u2216':'setmn','\u2AE7':'Barv','\u22BD':'barvee','\u2305':'barwed','\u2306':'Barwed','\u23B5':'bbrk','\u23B6':'bbrktbrk','\u0411':'Bcy','\u0431':'bcy','\u201E':'bdquo','\u2235':'becaus','\u29B0':'bemptyv','\u212C':'Bscr','\u0392':'Beta','\u03B2':'beta','\u2136':'beth','\u226C':'twixt','\uD835\uDD05':'Bfr','\uD835\uDD1F':'bfr','\u22C2':'xcap','\u25EF':'xcirc','\u22C3':'xcup','\u2A00':'xodot','\u2A01':'xoplus','\u2A02':'xotime','\u2A06':'xsqcup','\u2605':'starf','\u25BD':'xdtri','\u25B3':'xutri','\u2A04':'xuplus','\u22C1':'Vee','\u22C0':'Wedge','\u290D':'rbarr','\u29EB':'lozf','\u25AA':'squf','\u25B4':'utrif','\u25BE':'dtrif','\u25C2':'ltrif','\u25B8':'rtrif','\u2423':'blank','\u2592':'blk12','\u2591':'blk14','\u2593':'blk34','\u2588':'block','=\u20E5':'bne','\u2261\u20E5':'bnequiv','\u2AED':'bNot','\u2310':'bnot','\uD835\uDD39':'Bopf','\uD835\uDD53':'bopf','\u22A5':'bot','\u22C8':'bowtie','\u29C9':'boxbox','\u2510':'boxdl','\u2555':'boxdL','\u2556':'boxDl','\u2557':'boxDL','\u250C':'boxdr','\u2552':'boxdR','\u2553':'boxDr','\u2554':'boxDR','\u2500':'boxh','\u2550':'boxH','\u252C':'boxhd','\u2564':'boxHd','\u2565':'boxhD','\u2566':'boxHD','\u2534':'boxhu','\u2567':'boxHu','\u2568':'boxhU','\u2569':'boxHU','\u229F':'minusb','\u229E':'plusb','\u22A0':'timesb','\u2518':'boxul','\u255B':'boxuL','\u255C':'boxUl','\u255D':'boxUL','\u2514':'boxur','\u2558':'boxuR','\u2559':'boxUr','\u255A':'boxUR','\u2502':'boxv','\u2551':'boxV','\u253C':'boxvh','\u256A':'boxvH','\u256B':'boxVh','\u256C':'boxVH','\u2524':'boxvl','\u2561':'boxvL','\u2562':'boxVl','\u2563':'boxVL','\u251C':'boxvr','\u255E':'boxvR','\u255F':'boxVr','\u2560':'boxVR','\u02D8':'breve','\xA6':'brvbar','\uD835\uDCB7':'bscr','\u204F':'bsemi','\u29C5':'bsolb','\\':'bsol','\u27C8':'bsolhsub','\u2022':'bull','\u224E':'bump','\u2AAE':'bumpE','\u224F':'bumpe','\u0106':'Cacute','\u0107':'cacute','\u2A44':'capand','\u2A49':'capbrcup','\u2A4B':'capcap','\u2229':'cap','\u22D2':'Cap','\u2A47':'capcup','\u2A40':'capdot','\u2145':'DD','\u2229\uFE00':'caps','\u2041':'caret','\u02C7':'caron','\u212D':'Cfr','\u2A4D':'ccaps','\u010C':'Ccaron','\u010D':'ccaron','\xC7':'Ccedil','\xE7':'ccedil','\u0108':'Ccirc','\u0109':'ccirc','\u2230':'Cconint','\u2A4C':'ccups','\u2A50':'ccupssm','\u010A':'Cdot','\u010B':'cdot','\xB8':'cedil','\u29B2':'cemptyv','\xA2':'cent','\xB7':'middot','\uD835\uDD20':'cfr','\u0427':'CHcy','\u0447':'chcy','\u2713':'check','\u03A7':'Chi','\u03C7':'chi','\u02C6':'circ','\u2257':'cire','\u21BA':'olarr','\u21BB':'orarr','\u229B':'oast','\u229A':'ocir','\u229D':'odash','\u2299':'odot','\xAE':'reg','\u24C8':'oS','\u2296':'ominus','\u2295':'oplus','\u2297':'otimes','\u25CB':'cir','\u29C3':'cirE','\u2A10':'cirfnint','\u2AEF':'cirmid','\u29C2':'cirscir','\u2232':'cwconint','\u201D':'rdquo','\u2019':'rsquo','\u2663':'clubs',':':'colon','\u2237':'Colon','\u2A74':'Colone',',':'comma','@':'commat','\u2201':'comp','\u2218':'compfn','\u2102':'Copf','\u2245':'cong','\u2A6D':'congdot','\u2261':'equiv','\u222E':'oint','\u222F':'Conint','\uD835\uDD54':'copf','\u2210':'coprod','\xA9':'copy','\u2117':'copysr','\u21B5':'crarr','\u2717':'cross','\u2A2F':'Cross','\uD835\uDC9E':'Cscr','\uD835\uDCB8':'cscr','\u2ACF':'csub','\u2AD1':'csube','\u2AD0':'csup','\u2AD2':'csupe','\u22EF':'ctdot','\u2938':'cudarrl','\u2935':'cudarrr','\u22DE':'cuepr','\u22DF':'cuesc','\u21B6':'cularr','\u293D':'cularrp','\u2A48':'cupbrcap','\u2A46':'cupcap','\u222A':'cup','\u22D3':'Cup','\u2A4A':'cupcup','\u228D':'cupdot','\u2A45':'cupor','\u222A\uFE00':'cups','\u21B7':'curarr','\u293C':'curarrm','\u22CE':'cuvee','\u22CF':'cuwed','\xA4':'curren','\u2231':'cwint','\u232D':'cylcty','\u2020':'dagger','\u2021':'Dagger','\u2138':'daleth','\u2193':'darr','\u21A1':'Darr','\u21D3':'dArr','\u2010':'dash','\u2AE4':'Dashv','\u22A3':'dashv','\u290F':'rBarr','\u02DD':'dblac','\u010E':'Dcaron','\u010F':'dcaron','\u0414':'Dcy','\u0434':'dcy','\u21CA':'ddarr','\u2146':'dd','\u2911':'DDotrahd','\u2A77':'eDDot','\xB0':'deg','\u2207':'Del','\u0394':'Delta','\u03B4':'delta','\u29B1':'demptyv','\u297F':'dfisht','\uD835\uDD07':'Dfr','\uD835\uDD21':'dfr','\u2965':'dHar','\u21C3':'dharl','\u21C2':'dharr','\u02D9':'dot','`':'grave','\u02DC':'tilde','\u22C4':'diam','\u2666':'diams','\xA8':'die','\u03DD':'gammad','\u22F2':'disin','\xF7':'div','\u22C7':'divonx','\u0402':'DJcy','\u0452':'djcy','\u231E':'dlcorn','\u230D':'dlcrop','$':'dollar','\uD835\uDD3B':'Dopf','\uD835\uDD55':'dopf','\u20DC':'DotDot','\u2250':'doteq','\u2251':'eDot','\u2238':'minusd','\u2214':'plusdo','\u22A1':'sdotb','\u21D0':'lArr','\u21D4':'iff','\u27F8':'xlArr','\u27FA':'xhArr','\u27F9':'xrArr','\u21D2':'rArr','\u22A8':'vDash','\u21D1':'uArr','\u21D5':'vArr','\u2225':'par','\u2913':'DownArrowBar','\u21F5':'duarr','\u0311':'DownBreve','\u2950':'DownLeftRightVector','\u295E':'DownLeftTeeVector','\u2956':'DownLeftVectorBar','\u21BD':'lhard','\u295F':'DownRightTeeVector','\u2957':'DownRightVectorBar','\u21C1':'rhard','\u21A7':'mapstodown','\u22A4':'top','\u2910':'RBarr','\u231F':'drcorn','\u230C':'drcrop','\uD835\uDC9F':'Dscr','\uD835\uDCB9':'dscr','\u0405':'DScy','\u0455':'dscy','\u29F6':'dsol','\u0110':'Dstrok','\u0111':'dstrok','\u22F1':'dtdot','\u25BF':'dtri','\u296F':'duhar','\u29A6':'dwangle','\u040F':'DZcy','\u045F':'dzcy','\u27FF':'dzigrarr','\xC9':'Eacute','\xE9':'eacute','\u2A6E':'easter','\u011A':'Ecaron','\u011B':'ecaron','\xCA':'Ecirc','\xEA':'ecirc','\u2256':'ecir','\u2255':'ecolon','\u042D':'Ecy','\u044D':'ecy','\u0116':'Edot','\u0117':'edot','\u2147':'ee','\u2252':'efDot','\uD835\uDD08':'Efr','\uD835\uDD22':'efr','\u2A9A':'eg','\xC8':'Egrave','\xE8':'egrave','\u2A96':'egs','\u2A98':'egsdot','\u2A99':'el','\u2208':'in','\u23E7':'elinters','\u2113':'ell','\u2A95':'els','\u2A97':'elsdot','\u0112':'Emacr','\u0113':'emacr','\u2205':'empty','\u25FB':'EmptySmallSquare','\u25AB':'EmptyVerySmallSquare','\u2004':'emsp13','\u2005':'emsp14','\u2003':'emsp','\u014A':'ENG','\u014B':'eng','\u2002':'ensp','\u0118':'Eogon','\u0119':'eogon','\uD835\uDD3C':'Eopf','\uD835\uDD56':'eopf','\u22D5':'epar','\u29E3':'eparsl','\u2A71':'eplus','\u03B5':'epsi','\u0395':'Epsilon','\u03F5':'epsiv','\u2242':'esim','\u2A75':'Equal','=':'equals','\u225F':'equest','\u21CC':'rlhar','\u2A78':'equivDD','\u29E5':'eqvparsl','\u2971':'erarr','\u2253':'erDot','\u212F':'escr','\u2130':'Escr','\u2A73':'Esim','\u0397':'Eta','\u03B7':'eta','\xD0':'ETH','\xF0':'eth','\xCB':'Euml','\xEB':'euml','\u20AC':'euro','!':'excl','\u2203':'exist','\u0424':'Fcy','\u0444':'fcy','\u2640':'female','\uFB03':'ffilig','\uFB00':'fflig','\uFB04':'ffllig','\uD835\uDD09':'Ffr','\uD835\uDD23':'ffr','\uFB01':'filig','\u25FC':'FilledSmallSquare','fj':'fjlig','\u266D':'flat','\uFB02':'fllig','\u25B1':'fltns','\u0192':'fnof','\uD835\uDD3D':'Fopf','\uD835\uDD57':'fopf','\u2200':'forall','\u22D4':'fork','\u2AD9':'forkv','\u2131':'Fscr','\u2A0D':'fpartint','\xBD':'half','\u2153':'frac13','\xBC':'frac14','\u2155':'frac15','\u2159':'frac16','\u215B':'frac18','\u2154':'frac23','\u2156':'frac25','\xBE':'frac34','\u2157':'frac35','\u215C':'frac38','\u2158':'frac45','\u215A':'frac56','\u215D':'frac58','\u215E':'frac78','\u2044':'frasl','\u2322':'frown','\uD835\uDCBB':'fscr','\u01F5':'gacute','\u0393':'Gamma','\u03B3':'gamma','\u03DC':'Gammad','\u2A86':'gap','\u011E':'Gbreve','\u011F':'gbreve','\u0122':'Gcedil','\u011C':'Gcirc','\u011D':'gcirc','\u0413':'Gcy','\u0433':'gcy','\u0120':'Gdot','\u0121':'gdot','\u2265':'ge','\u2267':'gE','\u2A8C':'gEl','\u22DB':'gel','\u2A7E':'ges','\u2AA9':'gescc','\u2A80':'gesdot','\u2A82':'gesdoto','\u2A84':'gesdotol','\u22DB\uFE00':'gesl','\u2A94':'gesles','\uD835\uDD0A':'Gfr','\uD835\uDD24':'gfr','\u226B':'gg','\u22D9':'Gg','\u2137':'gimel','\u0403':'GJcy','\u0453':'gjcy','\u2AA5':'gla','\u2277':'gl','\u2A92':'glE','\u2AA4':'glj','\u2A8A':'gnap','\u2A88':'gne','\u2269':'gnE','\u22E7':'gnsim','\uD835\uDD3E':'Gopf','\uD835\uDD58':'gopf','\u2AA2':'GreaterGreater','\u2273':'gsim','\uD835\uDCA2':'Gscr','\u210A':'gscr','\u2A8E':'gsime','\u2A90':'gsiml','\u2AA7':'gtcc','\u2A7A':'gtcir','>':'gt','\u22D7':'gtdot','\u2995':'gtlPar','\u2A7C':'gtquest','\u2978':'gtrarr','\u2269\uFE00':'gvnE','\u200A':'hairsp','\u210B':'Hscr','\u042A':'HARDcy','\u044A':'hardcy','\u2948':'harrcir','\u2194':'harr','\u21AD':'harrw','^':'Hat','\u210F':'hbar','\u0124':'Hcirc','\u0125':'hcirc','\u2665':'hearts','\u2026':'mldr','\u22B9':'hercon','\uD835\uDD25':'hfr','\u210C':'Hfr','\u2925':'searhk','\u2926':'swarhk','\u21FF':'hoarr','\u223B':'homtht','\u21A9':'larrhk','\u21AA':'rarrhk','\uD835\uDD59':'hopf','\u210D':'Hopf','\u2015':'horbar','\uD835\uDCBD':'hscr','\u0126':'Hstrok','\u0127':'hstrok','\u2043':'hybull','\xCD':'Iacute','\xED':'iacute','\u2063':'ic','\xCE':'Icirc','\xEE':'icirc','\u0418':'Icy','\u0438':'icy','\u0130':'Idot','\u0415':'IEcy','\u0435':'iecy','\xA1':'iexcl','\uD835\uDD26':'ifr','\u2111':'Im','\xCC':'Igrave','\xEC':'igrave','\u2148':'ii','\u2A0C':'qint','\u222D':'tint','\u29DC':'iinfin','\u2129':'iiota','\u0132':'IJlig','\u0133':'ijlig','\u012A':'Imacr','\u012B':'imacr','\u2110':'Iscr','\u0131':'imath','\u22B7':'imof','\u01B5':'imped','\u2105':'incare','\u221E':'infin','\u29DD':'infintie','\u22BA':'intcal','\u222B':'int','\u222C':'Int','\u2124':'Zopf','\u2A17':'intlarhk','\u2A3C':'iprod','\u2062':'it','\u0401':'IOcy','\u0451':'iocy','\u012E':'Iogon','\u012F':'iogon','\uD835\uDD40':'Iopf','\uD835\uDD5A':'iopf','\u0399':'Iota','\u03B9':'iota','\xBF':'iquest','\uD835\uDCBE':'iscr','\u22F5':'isindot','\u22F9':'isinE','\u22F4':'isins','\u22F3':'isinsv','\u0128':'Itilde','\u0129':'itilde','\u0406':'Iukcy','\u0456':'iukcy','\xCF':'Iuml','\xEF':'iuml','\u0134':'Jcirc','\u0135':'jcirc','\u0419':'Jcy','\u0439':'jcy','\uD835\uDD0D':'Jfr','\uD835\uDD27':'jfr','\u0237':'jmath','\uD835\uDD41':'Jopf','\uD835\uDD5B':'jopf','\uD835\uDCA5':'Jscr','\uD835\uDCBF':'jscr','\u0408':'Jsercy','\u0458':'jsercy','\u0404':'Jukcy','\u0454':'jukcy','\u039A':'Kappa','\u03BA':'kappa','\u03F0':'kappav','\u0136':'Kcedil','\u0137':'kcedil','\u041A':'Kcy','\u043A':'kcy','\uD835\uDD0E':'Kfr','\uD835\uDD28':'kfr','\u0138':'kgreen','\u0425':'KHcy','\u0445':'khcy','\u040C':'KJcy','\u045C':'kjcy','\uD835\uDD42':'Kopf','\uD835\uDD5C':'kopf','\uD835\uDCA6':'Kscr','\uD835\uDCC0':'kscr','\u21DA':'lAarr','\u0139':'Lacute','\u013A':'lacute','\u29B4':'laemptyv','\u2112':'Lscr','\u039B':'Lambda','\u03BB':'lambda','\u27E8':'lang','\u27EA':'Lang','\u2991':'langd','\u2A85':'lap','\xAB':'laquo','\u21E4':'larrb','\u291F':'larrbfs','\u2190':'larr','\u219E':'Larr','\u291D':'larrfs','\u21AB':'larrlp','\u2939':'larrpl','\u2973':'larrsim','\u21A2':'larrtl','\u2919':'latail','\u291B':'lAtail','\u2AAB':'lat','\u2AAD':'late','\u2AAD\uFE00':'lates','\u290C':'lbarr','\u290E':'lBarr','\u2772':'lbbrk','{':'lcub','[':'lsqb','\u298B':'lbrke','\u298F':'lbrksld','\u298D':'lbrkslu','\u013D':'Lcaron','\u013E':'lcaron','\u013B':'Lcedil','\u013C':'lcedil','\u2308':'lceil','\u041B':'Lcy','\u043B':'lcy','\u2936':'ldca','\u201C':'ldquo','\u2967':'ldrdhar','\u294B':'ldrushar','\u21B2':'ldsh','\u2264':'le','\u2266':'lE','\u21C6':'lrarr','\u27E6':'lobrk','\u2961':'LeftDownTeeVector','\u2959':'LeftDownVectorBar','\u230A':'lfloor','\u21BC':'lharu','\u21C7':'llarr','\u21CB':'lrhar','\u294E':'LeftRightVector','\u21A4':'mapstoleft','\u295A':'LeftTeeVector','\u22CB':'lthree','\u29CF':'LeftTriangleBar','\u22B2':'vltri','\u22B4':'ltrie','\u2951':'LeftUpDownVector','\u2960':'LeftUpTeeVector','\u2958':'LeftUpVectorBar','\u21BF':'uharl','\u2952':'LeftVectorBar','\u2A8B':'lEg','\u22DA':'leg','\u2A7D':'les','\u2AA8':'lescc','\u2A7F':'lesdot','\u2A81':'lesdoto','\u2A83':'lesdotor','\u22DA\uFE00':'lesg','\u2A93':'lesges','\u22D6':'ltdot','\u2276':'lg','\u2AA1':'LessLess','\u2272':'lsim','\u297C':'lfisht','\uD835\uDD0F':'Lfr','\uD835\uDD29':'lfr','\u2A91':'lgE','\u2962':'lHar','\u296A':'lharul','\u2584':'lhblk','\u0409':'LJcy','\u0459':'ljcy','\u226A':'ll','\u22D8':'Ll','\u296B':'llhard','\u25FA':'lltri','\u013F':'Lmidot','\u0140':'lmidot','\u23B0':'lmoust','\u2A89':'lnap','\u2A87':'lne','\u2268':'lnE','\u22E6':'lnsim','\u27EC':'loang','\u21FD':'loarr','\u27F5':'xlarr','\u27F7':'xharr','\u27FC':'xmap','\u27F6':'xrarr','\u21AC':'rarrlp','\u2985':'lopar','\uD835\uDD43':'Lopf','\uD835\uDD5D':'lopf','\u2A2D':'loplus','\u2A34':'lotimes','\u2217':'lowast','_':'lowbar','\u2199':'swarr','\u2198':'searr','\u25CA':'loz','(':'lpar','\u2993':'lparlt','\u296D':'lrhard','\u200E':'lrm','\u22BF':'lrtri','\u2039':'lsaquo','\uD835\uDCC1':'lscr','\u21B0':'lsh','\u2A8D':'lsime','\u2A8F':'lsimg','\u2018':'lsquo','\u201A':'sbquo','\u0141':'Lstrok','\u0142':'lstrok','\u2AA6':'ltcc','\u2A79':'ltcir','<':'lt','\u22C9':'ltimes','\u2976':'ltlarr','\u2A7B':'ltquest','\u25C3':'ltri','\u2996':'ltrPar','\u294A':'lurdshar','\u2966':'luruhar','\u2268\uFE00':'lvnE','\xAF':'macr','\u2642':'male','\u2720':'malt','\u2905':'Map','\u21A6':'map','\u21A5':'mapstoup','\u25AE':'marker','\u2A29':'mcomma','\u041C':'Mcy','\u043C':'mcy','\u2014':'mdash','\u223A':'mDDot','\u205F':'MediumSpace','\u2133':'Mscr','\uD835\uDD10':'Mfr','\uD835\uDD2A':'mfr','\u2127':'mho','\xB5':'micro','\u2AF0':'midcir','\u2223':'mid','\u2212':'minus','\u2A2A':'minusdu','\u2213':'mp','\u2ADB':'mlcp','\u22A7':'models','\uD835\uDD44':'Mopf','\uD835\uDD5E':'mopf','\uD835\uDCC2':'mscr','\u039C':'Mu','\u03BC':'mu','\u22B8':'mumap','\u0143':'Nacute','\u0144':'nacute','\u2220\u20D2':'nang','\u2249':'nap','\u2A70\u0338':'napE','\u224B\u0338':'napid','\u0149':'napos','\u266E':'natur','\u2115':'Nopf','\xA0':'nbsp','\u224E\u0338':'nbump','\u224F\u0338':'nbumpe','\u2A43':'ncap','\u0147':'Ncaron','\u0148':'ncaron','\u0145':'Ncedil','\u0146':'ncedil','\u2247':'ncong','\u2A6D\u0338':'ncongdot','\u2A42':'ncup','\u041D':'Ncy','\u043D':'ncy','\u2013':'ndash','\u2924':'nearhk','\u2197':'nearr','\u21D7':'neArr','\u2260':'ne','\u2250\u0338':'nedot','\u200B':'ZeroWidthSpace','\u2262':'nequiv','\u2928':'toea','\u2242\u0338':'nesim','\n':'NewLine','\u2204':'nexist','\uD835\uDD11':'Nfr','\uD835\uDD2B':'nfr','\u2267\u0338':'ngE','\u2271':'nge','\u2A7E\u0338':'nges','\u22D9\u0338':'nGg','\u2275':'ngsim','\u226B\u20D2':'nGt','\u226F':'ngt','\u226B\u0338':'nGtv','\u21AE':'nharr','\u21CE':'nhArr','\u2AF2':'nhpar','\u220B':'ni','\u22FC':'nis','\u22FA':'nisd','\u040A':'NJcy','\u045A':'njcy','\u219A':'nlarr','\u21CD':'nlArr','\u2025':'nldr','\u2266\u0338':'nlE','\u2270':'nle','\u2A7D\u0338':'nles','\u226E':'nlt','\u22D8\u0338':'nLl','\u2274':'nlsim','\u226A\u20D2':'nLt','\u22EA':'nltri','\u22EC':'nltrie','\u226A\u0338':'nLtv','\u2224':'nmid','\u2060':'NoBreak','\uD835\uDD5F':'nopf','\u2AEC':'Not','\xAC':'not','\u226D':'NotCupCap','\u2226':'npar','\u2209':'notin','\u2279':'ntgl','\u22F5\u0338':'notindot','\u22F9\u0338':'notinE','\u22F7':'notinvb','\u22F6':'notinvc','\u29CF\u0338':'NotLeftTriangleBar','\u2278':'ntlg','\u2AA2\u0338':'NotNestedGreaterGreater','\u2AA1\u0338':'NotNestedLessLess','\u220C':'notni','\u22FE':'notnivb','\u22FD':'notnivc','\u2280':'npr','\u2AAF\u0338':'npre','\u22E0':'nprcue','\u29D0\u0338':'NotRightTriangleBar','\u22EB':'nrtri','\u22ED':'nrtrie','\u228F\u0338':'NotSquareSubset','\u22E2':'nsqsube','\u2290\u0338':'NotSquareSuperset','\u22E3':'nsqsupe','\u2282\u20D2':'vnsub','\u2288':'nsube','\u2281':'nsc','\u2AB0\u0338':'nsce','\u22E1':'nsccue','\u227F\u0338':'NotSucceedsTilde','\u2283\u20D2':'vnsup','\u2289':'nsupe','\u2241':'nsim','\u2244':'nsime','\u2AFD\u20E5':'nparsl','\u2202\u0338':'npart','\u2A14':'npolint','\u2933\u0338':'nrarrc','\u219B':'nrarr','\u21CF':'nrArr','\u219D\u0338':'nrarrw','\uD835\uDCA9':'Nscr','\uD835\uDCC3':'nscr','\u2284':'nsub','\u2AC5\u0338':'nsubE','\u2285':'nsup','\u2AC6\u0338':'nsupE','\xD1':'Ntilde','\xF1':'ntilde','\u039D':'Nu','\u03BD':'nu','#':'num','\u2116':'numero','\u2007':'numsp','\u224D\u20D2':'nvap','\u22AC':'nvdash','\u22AD':'nvDash','\u22AE':'nVdash','\u22AF':'nVDash','\u2265\u20D2':'nvge','>\u20D2':'nvgt','\u2904':'nvHarr','\u29DE':'nvinfin','\u2902':'nvlArr','\u2264\u20D2':'nvle','<\u20D2':'nvlt','\u22B4\u20D2':'nvltrie','\u2903':'nvrArr','\u22B5\u20D2':'nvrtrie','\u223C\u20D2':'nvsim','\u2923':'nwarhk','\u2196':'nwarr','\u21D6':'nwArr','\u2927':'nwnear','\xD3':'Oacute','\xF3':'oacute','\xD4':'Ocirc','\xF4':'ocirc','\u041E':'Ocy','\u043E':'ocy','\u0150':'Odblac','\u0151':'odblac','\u2A38':'odiv','\u29BC':'odsold','\u0152':'OElig','\u0153':'oelig','\u29BF':'ofcir','\uD835\uDD12':'Ofr','\uD835\uDD2C':'ofr','\u02DB':'ogon','\xD2':'Ograve','\xF2':'ograve','\u29C1':'ogt','\u29B5':'ohbar','\u03A9':'ohm','\u29BE':'olcir','\u29BB':'olcross','\u203E':'oline','\u29C0':'olt','\u014C':'Omacr','\u014D':'omacr','\u03C9':'omega','\u039F':'Omicron','\u03BF':'omicron','\u29B6':'omid','\uD835\uDD46':'Oopf','\uD835\uDD60':'oopf','\u29B7':'opar','\u29B9':'operp','\u2A54':'Or','\u2228':'or','\u2A5D':'ord','\u2134':'oscr','\xAA':'ordf','\xBA':'ordm','\u22B6':'origof','\u2A56':'oror','\u2A57':'orslope','\u2A5B':'orv','\uD835\uDCAA':'Oscr','\xD8':'Oslash','\xF8':'oslash','\u2298':'osol','\xD5':'Otilde','\xF5':'otilde','\u2A36':'otimesas','\u2A37':'Otimes','\xD6':'Ouml','\xF6':'ouml','\u233D':'ovbar','\u23DE':'OverBrace','\u23B4':'tbrk','\u23DC':'OverParenthesis','\xB6':'para','\u2AF3':'parsim','\u2AFD':'parsl','\u2202':'part','\u041F':'Pcy','\u043F':'pcy','%':'percnt','.':'period','\u2030':'permil','\u2031':'pertenk','\uD835\uDD13':'Pfr','\uD835\uDD2D':'pfr','\u03A6':'Phi','\u03C6':'phi','\u03D5':'phiv','\u260E':'phone','\u03A0':'Pi','\u03C0':'pi','\u03D6':'piv','\u210E':'planckh','\u2A23':'plusacir','\u2A22':'pluscir','+':'plus','\u2A25':'plusdu','\u2A72':'pluse','\xB1':'pm','\u2A26':'plussim','\u2A27':'plustwo','\u2A15':'pointint','\uD835\uDD61':'popf','\u2119':'Popf','\xA3':'pound','\u2AB7':'prap','\u2ABB':'Pr','\u227A':'pr','\u227C':'prcue','\u2AAF':'pre','\u227E':'prsim','\u2AB9':'prnap','\u2AB5':'prnE','\u22E8':'prnsim','\u2AB3':'prE','\u2032':'prime','\u2033':'Prime','\u220F':'prod','\u232E':'profalar','\u2312':'profline','\u2313':'profsurf','\u221D':'prop','\u22B0':'prurel','\uD835\uDCAB':'Pscr','\uD835\uDCC5':'pscr','\u03A8':'Psi','\u03C8':'psi','\u2008':'puncsp','\uD835\uDD14':'Qfr','\uD835\uDD2E':'qfr','\uD835\uDD62':'qopf','\u211A':'Qopf','\u2057':'qprime','\uD835\uDCAC':'Qscr','\uD835\uDCC6':'qscr','\u2A16':'quatint','?':'quest','"':'quot','\u21DB':'rAarr','\u223D\u0331':'race','\u0154':'Racute','\u0155':'racute','\u221A':'Sqrt','\u29B3':'raemptyv','\u27E9':'rang','\u27EB':'Rang','\u2992':'rangd','\u29A5':'range','\xBB':'raquo','\u2975':'rarrap','\u21E5':'rarrb','\u2920':'rarrbfs','\u2933':'rarrc','\u2192':'rarr','\u21A0':'Rarr','\u291E':'rarrfs','\u2945':'rarrpl','\u2974':'rarrsim','\u2916':'Rarrtl','\u21A3':'rarrtl','\u219D':'rarrw','\u291A':'ratail','\u291C':'rAtail','\u2236':'ratio','\u2773':'rbbrk','}':'rcub',']':'rsqb','\u298C':'rbrke','\u298E':'rbrksld','\u2990':'rbrkslu','\u0158':'Rcaron','\u0159':'rcaron','\u0156':'Rcedil','\u0157':'rcedil','\u2309':'rceil','\u0420':'Rcy','\u0440':'rcy','\u2937':'rdca','\u2969':'rdldhar','\u21B3':'rdsh','\u211C':'Re','\u211B':'Rscr','\u211D':'Ropf','\u25AD':'rect','\u297D':'rfisht','\u230B':'rfloor','\uD835\uDD2F':'rfr','\u2964':'rHar','\u21C0':'rharu','\u296C':'rharul','\u03A1':'Rho','\u03C1':'rho','\u03F1':'rhov','\u21C4':'rlarr','\u27E7':'robrk','\u295D':'RightDownTeeVector','\u2955':'RightDownVectorBar','\u21C9':'rrarr','\u22A2':'vdash','\u295B':'RightTeeVector','\u22CC':'rthree','\u29D0':'RightTriangleBar','\u22B3':'vrtri','\u22B5':'rtrie','\u294F':'RightUpDownVector','\u295C':'RightUpTeeVector','\u2954':'RightUpVectorBar','\u21BE':'uharr','\u2953':'RightVectorBar','\u02DA':'ring','\u200F':'rlm','\u23B1':'rmoust','\u2AEE':'rnmid','\u27ED':'roang','\u21FE':'roarr','\u2986':'ropar','\uD835\uDD63':'ropf','\u2A2E':'roplus','\u2A35':'rotimes','\u2970':'RoundImplies',')':'rpar','\u2994':'rpargt','\u2A12':'rppolint','\u203A':'rsaquo','\uD835\uDCC7':'rscr','\u21B1':'rsh','\u22CA':'rtimes','\u25B9':'rtri','\u29CE':'rtriltri','\u29F4':'RuleDelayed','\u2968':'ruluhar','\u211E':'rx','\u015A':'Sacute','\u015B':'sacute','\u2AB8':'scap','\u0160':'Scaron','\u0161':'scaron','\u2ABC':'Sc','\u227B':'sc','\u227D':'sccue','\u2AB0':'sce','\u2AB4':'scE','\u015E':'Scedil','\u015F':'scedil','\u015C':'Scirc','\u015D':'scirc','\u2ABA':'scnap','\u2AB6':'scnE','\u22E9':'scnsim','\u2A13':'scpolint','\u227F':'scsim','\u0421':'Scy','\u0441':'scy','\u22C5':'sdot','\u2A66':'sdote','\u21D8':'seArr','\xA7':'sect',';':'semi','\u2929':'tosa','\u2736':'sext','\uD835\uDD16':'Sfr','\uD835\uDD30':'sfr','\u266F':'sharp','\u0429':'SHCHcy','\u0449':'shchcy','\u0428':'SHcy','\u0448':'shcy','\u2191':'uarr','\xAD':'shy','\u03A3':'Sigma','\u03C3':'sigma','\u03C2':'sigmaf','\u223C':'sim','\u2A6A':'simdot','\u2243':'sime','\u2A9E':'simg','\u2AA0':'simgE','\u2A9D':'siml','\u2A9F':'simlE','\u2246':'simne','\u2A24':'simplus','\u2972':'simrarr','\u2A33':'smashp','\u29E4':'smeparsl','\u2323':'smile','\u2AAA':'smt','\u2AAC':'smte','\u2AAC\uFE00':'smtes','\u042C':'SOFTcy','\u044C':'softcy','\u233F':'solbar','\u29C4':'solb','/':'sol','\uD835\uDD4A':'Sopf','\uD835\uDD64':'sopf','\u2660':'spades','\u2293':'sqcap','\u2293\uFE00':'sqcaps','\u2294':'sqcup','\u2294\uFE00':'sqcups','\u228F':'sqsub','\u2291':'sqsube','\u2290':'sqsup','\u2292':'sqsupe','\u25A1':'squ','\uD835\uDCAE':'Sscr','\uD835\uDCC8':'sscr','\u22C6':'Star','\u2606':'star','\u2282':'sub','\u22D0':'Sub','\u2ABD':'subdot','\u2AC5':'subE','\u2286':'sube','\u2AC3':'subedot','\u2AC1':'submult','\u2ACB':'subnE','\u228A':'subne','\u2ABF':'subplus','\u2979':'subrarr','\u2AC7':'subsim','\u2AD5':'subsub','\u2AD3':'subsup','\u2211':'sum','\u266A':'sung','\xB9':'sup1','\xB2':'sup2','\xB3':'sup3','\u2283':'sup','\u22D1':'Sup','\u2ABE':'supdot','\u2AD8':'supdsub','\u2AC6':'supE','\u2287':'supe','\u2AC4':'supedot','\u27C9':'suphsol','\u2AD7':'suphsub','\u297B':'suplarr','\u2AC2':'supmult','\u2ACC':'supnE','\u228B':'supne','\u2AC0':'supplus','\u2AC8':'supsim','\u2AD4':'supsub','\u2AD6':'supsup','\u21D9':'swArr','\u292A':'swnwar','\xDF':'szlig','\t':'Tab','\u2316':'target','\u03A4':'Tau','\u03C4':'tau','\u0164':'Tcaron','\u0165':'tcaron','\u0162':'Tcedil','\u0163':'tcedil','\u0422':'Tcy','\u0442':'tcy','\u20DB':'tdot','\u2315':'telrec','\uD835\uDD17':'Tfr','\uD835\uDD31':'tfr','\u2234':'there4','\u0398':'Theta','\u03B8':'theta','\u03D1':'thetav','\u205F\u200A':'ThickSpace','\u2009':'thinsp','\xDE':'THORN','\xFE':'thorn','\u2A31':'timesbar','\xD7':'times','\u2A30':'timesd','\u2336':'topbot','\u2AF1':'topcir','\uD835\uDD4B':'Topf','\uD835\uDD65':'topf','\u2ADA':'topfork','\u2034':'tprime','\u2122':'trade','\u25B5':'utri','\u225C':'trie','\u25EC':'tridot','\u2A3A':'triminus','\u2A39':'triplus','\u29CD':'trisb','\u2A3B':'tritime','\u23E2':'trpezium','\uD835\uDCAF':'Tscr','\uD835\uDCC9':'tscr','\u0426':'TScy','\u0446':'tscy','\u040B':'TSHcy','\u045B':'tshcy','\u0166':'Tstrok','\u0167':'tstrok','\xDA':'Uacute','\xFA':'uacute','\u219F':'Uarr','\u2949':'Uarrocir','\u040E':'Ubrcy','\u045E':'ubrcy','\u016C':'Ubreve','\u016D':'ubreve','\xDB':'Ucirc','\xFB':'ucirc','\u0423':'Ucy','\u0443':'ucy','\u21C5':'udarr','\u0170':'Udblac','\u0171':'udblac','\u296E':'udhar','\u297E':'ufisht','\uD835\uDD18':'Ufr','\uD835\uDD32':'ufr','\xD9':'Ugrave','\xF9':'ugrave','\u2963':'uHar','\u2580':'uhblk','\u231C':'ulcorn','\u230F':'ulcrop','\u25F8':'ultri','\u016A':'Umacr','\u016B':'umacr','\u23DF':'UnderBrace','\u23DD':'UnderParenthesis','\u228E':'uplus','\u0172':'Uogon','\u0173':'uogon','\uD835\uDD4C':'Uopf','\uD835\uDD66':'uopf','\u2912':'UpArrowBar','\u2195':'varr','\u03C5':'upsi','\u03D2':'Upsi','\u03A5':'Upsilon','\u21C8':'uuarr','\u231D':'urcorn','\u230E':'urcrop','\u016E':'Uring','\u016F':'uring','\u25F9':'urtri','\uD835\uDCB0':'Uscr','\uD835\uDCCA':'uscr','\u22F0':'utdot','\u0168':'Utilde','\u0169':'utilde','\xDC':'Uuml','\xFC':'uuml','\u29A7':'uwangle','\u299C':'vangrt','\u228A\uFE00':'vsubne','\u2ACB\uFE00':'vsubnE','\u228B\uFE00':'vsupne','\u2ACC\uFE00':'vsupnE','\u2AE8':'vBar','\u2AEB':'Vbar','\u2AE9':'vBarv','\u0412':'Vcy','\u0432':'vcy','\u22A9':'Vdash','\u22AB':'VDash','\u2AE6':'Vdashl','\u22BB':'veebar','\u225A':'veeeq','\u22EE':'vellip','|':'vert','\u2016':'Vert','\u2758':'VerticalSeparator','\u2240':'wr','\uD835\uDD19':'Vfr','\uD835\uDD33':'vfr','\uD835\uDD4D':'Vopf','\uD835\uDD67':'vopf','\uD835\uDCB1':'Vscr','\uD835\uDCCB':'vscr','\u22AA':'Vvdash','\u299A':'vzigzag','\u0174':'Wcirc','\u0175':'wcirc','\u2A5F':'wedbar','\u2259':'wedgeq','\u2118':'wp','\uD835\uDD1A':'Wfr','\uD835\uDD34':'wfr','\uD835\uDD4E':'Wopf','\uD835\uDD68':'wopf','\uD835\uDCB2':'Wscr','\uD835\uDCCC':'wscr','\uD835\uDD1B':'Xfr','\uD835\uDD35':'xfr','\u039E':'Xi','\u03BE':'xi','\u22FB':'xnis','\uD835\uDD4F':'Xopf','\uD835\uDD69':'xopf','\uD835\uDCB3':'Xscr','\uD835\uDCCD':'xscr','\xDD':'Yacute','\xFD':'yacute','\u042F':'YAcy','\u044F':'yacy','\u0176':'Ycirc','\u0177':'ycirc','\u042B':'Ycy','\u044B':'ycy','\xA5':'yen','\uD835\uDD1C':'Yfr','\uD835\uDD36':'yfr','\u0407':'YIcy','\u0457':'yicy','\uD835\uDD50':'Yopf','\uD835\uDD6A':'yopf','\uD835\uDCB4':'Yscr','\uD835\uDCCE':'yscr','\u042E':'YUcy','\u044E':'yucy','\xFF':'yuml','\u0178':'Yuml','\u0179':'Zacute','\u017A':'zacute','\u017D':'Zcaron','\u017E':'zcaron','\u0417':'Zcy','\u0437':'zcy','\u017B':'Zdot','\u017C':'zdot','\u2128':'Zfr','\u0396':'Zeta','\u03B6':'zeta','\uD835\uDD37':'zfr','\u0416':'ZHcy','\u0436':'zhcy','\u21DD':'zigrarr','\uD835\uDD6B':'zopf','\uD835\uDCB5':'Zscr','\uD835\uDCCF':'zscr','\u200D':'zwj','\u200C':'zwnj'}; - - var regexEscape = /["&'<>`]/g; - var escapeMap = { - '"': '"', - '&': '&', - '\'': ''', - '<': '<', - // See https://mathiasbynens.be/notes/ambiguous-ampersands: in HTML, the - // following is not strictly necessary unless it’s part of a tag or an - // unquoted attribute value. We’re only escaping it to support those - // situations, and for XML support. - '>': '>', - // In Internet Explorer ≤ 8, the backtick character can be used - // to break out of (un)quoted attribute values or HTML comments. - // See http://html5sec.org/#102, http://html5sec.org/#108, and - // http://html5sec.org/#133. - '`': '`' - }; - - var regexInvalidEntity = /&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/; - var regexInvalidRawCodePoint = /[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; - var regexDecode = /&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|iacute|Uacute|plusmn|otilde|Otilde|Agrave|agrave|yacute|Yacute|oslash|Oslash|Atilde|atilde|brvbar|Ccedil|ccedil|ograve|curren|divide|Eacute|eacute|Ograve|oacute|Egrave|egrave|ugrave|frac12|frac14|frac34|Ugrave|Oacute|Iacute|ntilde|Ntilde|uacute|middot|Igrave|igrave|iquest|aacute|laquo|THORN|micro|iexcl|icirc|Icirc|Acirc|ucirc|ecirc|Ocirc|ocirc|Ecirc|Ucirc|aring|Aring|aelig|AElig|acute|pound|raquo|acirc|times|thorn|szlig|cedil|COPY|Auml|ordf|ordm|uuml|macr|Uuml|auml|Ouml|ouml|para|nbsp|Euml|quot|QUOT|euml|yuml|cent|sect|copy|sup1|sup2|sup3|Iuml|iuml|shy|eth|reg|not|yen|amp|AMP|REG|uml|ETH|deg|gt|GT|LT|lt)([=a-zA-Z0-9])?/g; - var decodeMap = {'Aacute':'\xC1','aacute':'\xE1','Abreve':'\u0102','abreve':'\u0103','ac':'\u223E','acd':'\u223F','acE':'\u223E\u0333','Acirc':'\xC2','acirc':'\xE2','acute':'\xB4','Acy':'\u0410','acy':'\u0430','AElig':'\xC6','aelig':'\xE6','af':'\u2061','Afr':'\uD835\uDD04','afr':'\uD835\uDD1E','Agrave':'\xC0','agrave':'\xE0','alefsym':'\u2135','aleph':'\u2135','Alpha':'\u0391','alpha':'\u03B1','Amacr':'\u0100','amacr':'\u0101','amalg':'\u2A3F','amp':'&','AMP':'&','andand':'\u2A55','And':'\u2A53','and':'\u2227','andd':'\u2A5C','andslope':'\u2A58','andv':'\u2A5A','ang':'\u2220','ange':'\u29A4','angle':'\u2220','angmsdaa':'\u29A8','angmsdab':'\u29A9','angmsdac':'\u29AA','angmsdad':'\u29AB','angmsdae':'\u29AC','angmsdaf':'\u29AD','angmsdag':'\u29AE','angmsdah':'\u29AF','angmsd':'\u2221','angrt':'\u221F','angrtvb':'\u22BE','angrtvbd':'\u299D','angsph':'\u2222','angst':'\xC5','angzarr':'\u237C','Aogon':'\u0104','aogon':'\u0105','Aopf':'\uD835\uDD38','aopf':'\uD835\uDD52','apacir':'\u2A6F','ap':'\u2248','apE':'\u2A70','ape':'\u224A','apid':'\u224B','apos':'\'','ApplyFunction':'\u2061','approx':'\u2248','approxeq':'\u224A','Aring':'\xC5','aring':'\xE5','Ascr':'\uD835\uDC9C','ascr':'\uD835\uDCB6','Assign':'\u2254','ast':'*','asymp':'\u2248','asympeq':'\u224D','Atilde':'\xC3','atilde':'\xE3','Auml':'\xC4','auml':'\xE4','awconint':'\u2233','awint':'\u2A11','backcong':'\u224C','backepsilon':'\u03F6','backprime':'\u2035','backsim':'\u223D','backsimeq':'\u22CD','Backslash':'\u2216','Barv':'\u2AE7','barvee':'\u22BD','barwed':'\u2305','Barwed':'\u2306','barwedge':'\u2305','bbrk':'\u23B5','bbrktbrk':'\u23B6','bcong':'\u224C','Bcy':'\u0411','bcy':'\u0431','bdquo':'\u201E','becaus':'\u2235','because':'\u2235','Because':'\u2235','bemptyv':'\u29B0','bepsi':'\u03F6','bernou':'\u212C','Bernoullis':'\u212C','Beta':'\u0392','beta':'\u03B2','beth':'\u2136','between':'\u226C','Bfr':'\uD835\uDD05','bfr':'\uD835\uDD1F','bigcap':'\u22C2','bigcirc':'\u25EF','bigcup':'\u22C3','bigodot':'\u2A00','bigoplus':'\u2A01','bigotimes':'\u2A02','bigsqcup':'\u2A06','bigstar':'\u2605','bigtriangledown':'\u25BD','bigtriangleup':'\u25B3','biguplus':'\u2A04','bigvee':'\u22C1','bigwedge':'\u22C0','bkarow':'\u290D','blacklozenge':'\u29EB','blacksquare':'\u25AA','blacktriangle':'\u25B4','blacktriangledown':'\u25BE','blacktriangleleft':'\u25C2','blacktriangleright':'\u25B8','blank':'\u2423','blk12':'\u2592','blk14':'\u2591','blk34':'\u2593','block':'\u2588','bne':'=\u20E5','bnequiv':'\u2261\u20E5','bNot':'\u2AED','bnot':'\u2310','Bopf':'\uD835\uDD39','bopf':'\uD835\uDD53','bot':'\u22A5','bottom':'\u22A5','bowtie':'\u22C8','boxbox':'\u29C9','boxdl':'\u2510','boxdL':'\u2555','boxDl':'\u2556','boxDL':'\u2557','boxdr':'\u250C','boxdR':'\u2552','boxDr':'\u2553','boxDR':'\u2554','boxh':'\u2500','boxH':'\u2550','boxhd':'\u252C','boxHd':'\u2564','boxhD':'\u2565','boxHD':'\u2566','boxhu':'\u2534','boxHu':'\u2567','boxhU':'\u2568','boxHU':'\u2569','boxminus':'\u229F','boxplus':'\u229E','boxtimes':'\u22A0','boxul':'\u2518','boxuL':'\u255B','boxUl':'\u255C','boxUL':'\u255D','boxur':'\u2514','boxuR':'\u2558','boxUr':'\u2559','boxUR':'\u255A','boxv':'\u2502','boxV':'\u2551','boxvh':'\u253C','boxvH':'\u256A','boxVh':'\u256B','boxVH':'\u256C','boxvl':'\u2524','boxvL':'\u2561','boxVl':'\u2562','boxVL':'\u2563','boxvr':'\u251C','boxvR':'\u255E','boxVr':'\u255F','boxVR':'\u2560','bprime':'\u2035','breve':'\u02D8','Breve':'\u02D8','brvbar':'\xA6','bscr':'\uD835\uDCB7','Bscr':'\u212C','bsemi':'\u204F','bsim':'\u223D','bsime':'\u22CD','bsolb':'\u29C5','bsol':'\\','bsolhsub':'\u27C8','bull':'\u2022','bullet':'\u2022','bump':'\u224E','bumpE':'\u2AAE','bumpe':'\u224F','Bumpeq':'\u224E','bumpeq':'\u224F','Cacute':'\u0106','cacute':'\u0107','capand':'\u2A44','capbrcup':'\u2A49','capcap':'\u2A4B','cap':'\u2229','Cap':'\u22D2','capcup':'\u2A47','capdot':'\u2A40','CapitalDifferentialD':'\u2145','caps':'\u2229\uFE00','caret':'\u2041','caron':'\u02C7','Cayleys':'\u212D','ccaps':'\u2A4D','Ccaron':'\u010C','ccaron':'\u010D','Ccedil':'\xC7','ccedil':'\xE7','Ccirc':'\u0108','ccirc':'\u0109','Cconint':'\u2230','ccups':'\u2A4C','ccupssm':'\u2A50','Cdot':'\u010A','cdot':'\u010B','cedil':'\xB8','Cedilla':'\xB8','cemptyv':'\u29B2','cent':'\xA2','centerdot':'\xB7','CenterDot':'\xB7','cfr':'\uD835\uDD20','Cfr':'\u212D','CHcy':'\u0427','chcy':'\u0447','check':'\u2713','checkmark':'\u2713','Chi':'\u03A7','chi':'\u03C7','circ':'\u02C6','circeq':'\u2257','circlearrowleft':'\u21BA','circlearrowright':'\u21BB','circledast':'\u229B','circledcirc':'\u229A','circleddash':'\u229D','CircleDot':'\u2299','circledR':'\xAE','circledS':'\u24C8','CircleMinus':'\u2296','CirclePlus':'\u2295','CircleTimes':'\u2297','cir':'\u25CB','cirE':'\u29C3','cire':'\u2257','cirfnint':'\u2A10','cirmid':'\u2AEF','cirscir':'\u29C2','ClockwiseContourIntegral':'\u2232','CloseCurlyDoubleQuote':'\u201D','CloseCurlyQuote':'\u2019','clubs':'\u2663','clubsuit':'\u2663','colon':':','Colon':'\u2237','Colone':'\u2A74','colone':'\u2254','coloneq':'\u2254','comma':',','commat':'@','comp':'\u2201','compfn':'\u2218','complement':'\u2201','complexes':'\u2102','cong':'\u2245','congdot':'\u2A6D','Congruent':'\u2261','conint':'\u222E','Conint':'\u222F','ContourIntegral':'\u222E','copf':'\uD835\uDD54','Copf':'\u2102','coprod':'\u2210','Coproduct':'\u2210','copy':'\xA9','COPY':'\xA9','copysr':'\u2117','CounterClockwiseContourIntegral':'\u2233','crarr':'\u21B5','cross':'\u2717','Cross':'\u2A2F','Cscr':'\uD835\uDC9E','cscr':'\uD835\uDCB8','csub':'\u2ACF','csube':'\u2AD1','csup':'\u2AD0','csupe':'\u2AD2','ctdot':'\u22EF','cudarrl':'\u2938','cudarrr':'\u2935','cuepr':'\u22DE','cuesc':'\u22DF','cularr':'\u21B6','cularrp':'\u293D','cupbrcap':'\u2A48','cupcap':'\u2A46','CupCap':'\u224D','cup':'\u222A','Cup':'\u22D3','cupcup':'\u2A4A','cupdot':'\u228D','cupor':'\u2A45','cups':'\u222A\uFE00','curarr':'\u21B7','curarrm':'\u293C','curlyeqprec':'\u22DE','curlyeqsucc':'\u22DF','curlyvee':'\u22CE','curlywedge':'\u22CF','curren':'\xA4','curvearrowleft':'\u21B6','curvearrowright':'\u21B7','cuvee':'\u22CE','cuwed':'\u22CF','cwconint':'\u2232','cwint':'\u2231','cylcty':'\u232D','dagger':'\u2020','Dagger':'\u2021','daleth':'\u2138','darr':'\u2193','Darr':'\u21A1','dArr':'\u21D3','dash':'\u2010','Dashv':'\u2AE4','dashv':'\u22A3','dbkarow':'\u290F','dblac':'\u02DD','Dcaron':'\u010E','dcaron':'\u010F','Dcy':'\u0414','dcy':'\u0434','ddagger':'\u2021','ddarr':'\u21CA','DD':'\u2145','dd':'\u2146','DDotrahd':'\u2911','ddotseq':'\u2A77','deg':'\xB0','Del':'\u2207','Delta':'\u0394','delta':'\u03B4','demptyv':'\u29B1','dfisht':'\u297F','Dfr':'\uD835\uDD07','dfr':'\uD835\uDD21','dHar':'\u2965','dharl':'\u21C3','dharr':'\u21C2','DiacriticalAcute':'\xB4','DiacriticalDot':'\u02D9','DiacriticalDoubleAcute':'\u02DD','DiacriticalGrave':'`','DiacriticalTilde':'\u02DC','diam':'\u22C4','diamond':'\u22C4','Diamond':'\u22C4','diamondsuit':'\u2666','diams':'\u2666','die':'\xA8','DifferentialD':'\u2146','digamma':'\u03DD','disin':'\u22F2','div':'\xF7','divide':'\xF7','divideontimes':'\u22C7','divonx':'\u22C7','DJcy':'\u0402','djcy':'\u0452','dlcorn':'\u231E','dlcrop':'\u230D','dollar':'$','Dopf':'\uD835\uDD3B','dopf':'\uD835\uDD55','Dot':'\xA8','dot':'\u02D9','DotDot':'\u20DC','doteq':'\u2250','doteqdot':'\u2251','DotEqual':'\u2250','dotminus':'\u2238','dotplus':'\u2214','dotsquare':'\u22A1','doublebarwedge':'\u2306','DoubleContourIntegral':'\u222F','DoubleDot':'\xA8','DoubleDownArrow':'\u21D3','DoubleLeftArrow':'\u21D0','DoubleLeftRightArrow':'\u21D4','DoubleLeftTee':'\u2AE4','DoubleLongLeftArrow':'\u27F8','DoubleLongLeftRightArrow':'\u27FA','DoubleLongRightArrow':'\u27F9','DoubleRightArrow':'\u21D2','DoubleRightTee':'\u22A8','DoubleUpArrow':'\u21D1','DoubleUpDownArrow':'\u21D5','DoubleVerticalBar':'\u2225','DownArrowBar':'\u2913','downarrow':'\u2193','DownArrow':'\u2193','Downarrow':'\u21D3','DownArrowUpArrow':'\u21F5','DownBreve':'\u0311','downdownarrows':'\u21CA','downharpoonleft':'\u21C3','downharpoonright':'\u21C2','DownLeftRightVector':'\u2950','DownLeftTeeVector':'\u295E','DownLeftVectorBar':'\u2956','DownLeftVector':'\u21BD','DownRightTeeVector':'\u295F','DownRightVectorBar':'\u2957','DownRightVector':'\u21C1','DownTeeArrow':'\u21A7','DownTee':'\u22A4','drbkarow':'\u2910','drcorn':'\u231F','drcrop':'\u230C','Dscr':'\uD835\uDC9F','dscr':'\uD835\uDCB9','DScy':'\u0405','dscy':'\u0455','dsol':'\u29F6','Dstrok':'\u0110','dstrok':'\u0111','dtdot':'\u22F1','dtri':'\u25BF','dtrif':'\u25BE','duarr':'\u21F5','duhar':'\u296F','dwangle':'\u29A6','DZcy':'\u040F','dzcy':'\u045F','dzigrarr':'\u27FF','Eacute':'\xC9','eacute':'\xE9','easter':'\u2A6E','Ecaron':'\u011A','ecaron':'\u011B','Ecirc':'\xCA','ecirc':'\xEA','ecir':'\u2256','ecolon':'\u2255','Ecy':'\u042D','ecy':'\u044D','eDDot':'\u2A77','Edot':'\u0116','edot':'\u0117','eDot':'\u2251','ee':'\u2147','efDot':'\u2252','Efr':'\uD835\uDD08','efr':'\uD835\uDD22','eg':'\u2A9A','Egrave':'\xC8','egrave':'\xE8','egs':'\u2A96','egsdot':'\u2A98','el':'\u2A99','Element':'\u2208','elinters':'\u23E7','ell':'\u2113','els':'\u2A95','elsdot':'\u2A97','Emacr':'\u0112','emacr':'\u0113','empty':'\u2205','emptyset':'\u2205','EmptySmallSquare':'\u25FB','emptyv':'\u2205','EmptyVerySmallSquare':'\u25AB','emsp13':'\u2004','emsp14':'\u2005','emsp':'\u2003','ENG':'\u014A','eng':'\u014B','ensp':'\u2002','Eogon':'\u0118','eogon':'\u0119','Eopf':'\uD835\uDD3C','eopf':'\uD835\uDD56','epar':'\u22D5','eparsl':'\u29E3','eplus':'\u2A71','epsi':'\u03B5','Epsilon':'\u0395','epsilon':'\u03B5','epsiv':'\u03F5','eqcirc':'\u2256','eqcolon':'\u2255','eqsim':'\u2242','eqslantgtr':'\u2A96','eqslantless':'\u2A95','Equal':'\u2A75','equals':'=','EqualTilde':'\u2242','equest':'\u225F','Equilibrium':'\u21CC','equiv':'\u2261','equivDD':'\u2A78','eqvparsl':'\u29E5','erarr':'\u2971','erDot':'\u2253','escr':'\u212F','Escr':'\u2130','esdot':'\u2250','Esim':'\u2A73','esim':'\u2242','Eta':'\u0397','eta':'\u03B7','ETH':'\xD0','eth':'\xF0','Euml':'\xCB','euml':'\xEB','euro':'\u20AC','excl':'!','exist':'\u2203','Exists':'\u2203','expectation':'\u2130','exponentiale':'\u2147','ExponentialE':'\u2147','fallingdotseq':'\u2252','Fcy':'\u0424','fcy':'\u0444','female':'\u2640','ffilig':'\uFB03','fflig':'\uFB00','ffllig':'\uFB04','Ffr':'\uD835\uDD09','ffr':'\uD835\uDD23','filig':'\uFB01','FilledSmallSquare':'\u25FC','FilledVerySmallSquare':'\u25AA','fjlig':'fj','flat':'\u266D','fllig':'\uFB02','fltns':'\u25B1','fnof':'\u0192','Fopf':'\uD835\uDD3D','fopf':'\uD835\uDD57','forall':'\u2200','ForAll':'\u2200','fork':'\u22D4','forkv':'\u2AD9','Fouriertrf':'\u2131','fpartint':'\u2A0D','frac12':'\xBD','frac13':'\u2153','frac14':'\xBC','frac15':'\u2155','frac16':'\u2159','frac18':'\u215B','frac23':'\u2154','frac25':'\u2156','frac34':'\xBE','frac35':'\u2157','frac38':'\u215C','frac45':'\u2158','frac56':'\u215A','frac58':'\u215D','frac78':'\u215E','frasl':'\u2044','frown':'\u2322','fscr':'\uD835\uDCBB','Fscr':'\u2131','gacute':'\u01F5','Gamma':'\u0393','gamma':'\u03B3','Gammad':'\u03DC','gammad':'\u03DD','gap':'\u2A86','Gbreve':'\u011E','gbreve':'\u011F','Gcedil':'\u0122','Gcirc':'\u011C','gcirc':'\u011D','Gcy':'\u0413','gcy':'\u0433','Gdot':'\u0120','gdot':'\u0121','ge':'\u2265','gE':'\u2267','gEl':'\u2A8C','gel':'\u22DB','geq':'\u2265','geqq':'\u2267','geqslant':'\u2A7E','gescc':'\u2AA9','ges':'\u2A7E','gesdot':'\u2A80','gesdoto':'\u2A82','gesdotol':'\u2A84','gesl':'\u22DB\uFE00','gesles':'\u2A94','Gfr':'\uD835\uDD0A','gfr':'\uD835\uDD24','gg':'\u226B','Gg':'\u22D9','ggg':'\u22D9','gimel':'\u2137','GJcy':'\u0403','gjcy':'\u0453','gla':'\u2AA5','gl':'\u2277','glE':'\u2A92','glj':'\u2AA4','gnap':'\u2A8A','gnapprox':'\u2A8A','gne':'\u2A88','gnE':'\u2269','gneq':'\u2A88','gneqq':'\u2269','gnsim':'\u22E7','Gopf':'\uD835\uDD3E','gopf':'\uD835\uDD58','grave':'`','GreaterEqual':'\u2265','GreaterEqualLess':'\u22DB','GreaterFullEqual':'\u2267','GreaterGreater':'\u2AA2','GreaterLess':'\u2277','GreaterSlantEqual':'\u2A7E','GreaterTilde':'\u2273','Gscr':'\uD835\uDCA2','gscr':'\u210A','gsim':'\u2273','gsime':'\u2A8E','gsiml':'\u2A90','gtcc':'\u2AA7','gtcir':'\u2A7A','gt':'>','GT':'>','Gt':'\u226B','gtdot':'\u22D7','gtlPar':'\u2995','gtquest':'\u2A7C','gtrapprox':'\u2A86','gtrarr':'\u2978','gtrdot':'\u22D7','gtreqless':'\u22DB','gtreqqless':'\u2A8C','gtrless':'\u2277','gtrsim':'\u2273','gvertneqq':'\u2269\uFE00','gvnE':'\u2269\uFE00','Hacek':'\u02C7','hairsp':'\u200A','half':'\xBD','hamilt':'\u210B','HARDcy':'\u042A','hardcy':'\u044A','harrcir':'\u2948','harr':'\u2194','hArr':'\u21D4','harrw':'\u21AD','Hat':'^','hbar':'\u210F','Hcirc':'\u0124','hcirc':'\u0125','hearts':'\u2665','heartsuit':'\u2665','hellip':'\u2026','hercon':'\u22B9','hfr':'\uD835\uDD25','Hfr':'\u210C','HilbertSpace':'\u210B','hksearow':'\u2925','hkswarow':'\u2926','hoarr':'\u21FF','homtht':'\u223B','hookleftarrow':'\u21A9','hookrightarrow':'\u21AA','hopf':'\uD835\uDD59','Hopf':'\u210D','horbar':'\u2015','HorizontalLine':'\u2500','hscr':'\uD835\uDCBD','Hscr':'\u210B','hslash':'\u210F','Hstrok':'\u0126','hstrok':'\u0127','HumpDownHump':'\u224E','HumpEqual':'\u224F','hybull':'\u2043','hyphen':'\u2010','Iacute':'\xCD','iacute':'\xED','ic':'\u2063','Icirc':'\xCE','icirc':'\xEE','Icy':'\u0418','icy':'\u0438','Idot':'\u0130','IEcy':'\u0415','iecy':'\u0435','iexcl':'\xA1','iff':'\u21D4','ifr':'\uD835\uDD26','Ifr':'\u2111','Igrave':'\xCC','igrave':'\xEC','ii':'\u2148','iiiint':'\u2A0C','iiint':'\u222D','iinfin':'\u29DC','iiota':'\u2129','IJlig':'\u0132','ijlig':'\u0133','Imacr':'\u012A','imacr':'\u012B','image':'\u2111','ImaginaryI':'\u2148','imagline':'\u2110','imagpart':'\u2111','imath':'\u0131','Im':'\u2111','imof':'\u22B7','imped':'\u01B5','Implies':'\u21D2','incare':'\u2105','in':'\u2208','infin':'\u221E','infintie':'\u29DD','inodot':'\u0131','intcal':'\u22BA','int':'\u222B','Int':'\u222C','integers':'\u2124','Integral':'\u222B','intercal':'\u22BA','Intersection':'\u22C2','intlarhk':'\u2A17','intprod':'\u2A3C','InvisibleComma':'\u2063','InvisibleTimes':'\u2062','IOcy':'\u0401','iocy':'\u0451','Iogon':'\u012E','iogon':'\u012F','Iopf':'\uD835\uDD40','iopf':'\uD835\uDD5A','Iota':'\u0399','iota':'\u03B9','iprod':'\u2A3C','iquest':'\xBF','iscr':'\uD835\uDCBE','Iscr':'\u2110','isin':'\u2208','isindot':'\u22F5','isinE':'\u22F9','isins':'\u22F4','isinsv':'\u22F3','isinv':'\u2208','it':'\u2062','Itilde':'\u0128','itilde':'\u0129','Iukcy':'\u0406','iukcy':'\u0456','Iuml':'\xCF','iuml':'\xEF','Jcirc':'\u0134','jcirc':'\u0135','Jcy':'\u0419','jcy':'\u0439','Jfr':'\uD835\uDD0D','jfr':'\uD835\uDD27','jmath':'\u0237','Jopf':'\uD835\uDD41','jopf':'\uD835\uDD5B','Jscr':'\uD835\uDCA5','jscr':'\uD835\uDCBF','Jsercy':'\u0408','jsercy':'\u0458','Jukcy':'\u0404','jukcy':'\u0454','Kappa':'\u039A','kappa':'\u03BA','kappav':'\u03F0','Kcedil':'\u0136','kcedil':'\u0137','Kcy':'\u041A','kcy':'\u043A','Kfr':'\uD835\uDD0E','kfr':'\uD835\uDD28','kgreen':'\u0138','KHcy':'\u0425','khcy':'\u0445','KJcy':'\u040C','kjcy':'\u045C','Kopf':'\uD835\uDD42','kopf':'\uD835\uDD5C','Kscr':'\uD835\uDCA6','kscr':'\uD835\uDCC0','lAarr':'\u21DA','Lacute':'\u0139','lacute':'\u013A','laemptyv':'\u29B4','lagran':'\u2112','Lambda':'\u039B','lambda':'\u03BB','lang':'\u27E8','Lang':'\u27EA','langd':'\u2991','langle':'\u27E8','lap':'\u2A85','Laplacetrf':'\u2112','laquo':'\xAB','larrb':'\u21E4','larrbfs':'\u291F','larr':'\u2190','Larr':'\u219E','lArr':'\u21D0','larrfs':'\u291D','larrhk':'\u21A9','larrlp':'\u21AB','larrpl':'\u2939','larrsim':'\u2973','larrtl':'\u21A2','latail':'\u2919','lAtail':'\u291B','lat':'\u2AAB','late':'\u2AAD','lates':'\u2AAD\uFE00','lbarr':'\u290C','lBarr':'\u290E','lbbrk':'\u2772','lbrace':'{','lbrack':'[','lbrke':'\u298B','lbrksld':'\u298F','lbrkslu':'\u298D','Lcaron':'\u013D','lcaron':'\u013E','Lcedil':'\u013B','lcedil':'\u013C','lceil':'\u2308','lcub':'{','Lcy':'\u041B','lcy':'\u043B','ldca':'\u2936','ldquo':'\u201C','ldquor':'\u201E','ldrdhar':'\u2967','ldrushar':'\u294B','ldsh':'\u21B2','le':'\u2264','lE':'\u2266','LeftAngleBracket':'\u27E8','LeftArrowBar':'\u21E4','leftarrow':'\u2190','LeftArrow':'\u2190','Leftarrow':'\u21D0','LeftArrowRightArrow':'\u21C6','leftarrowtail':'\u21A2','LeftCeiling':'\u2308','LeftDoubleBracket':'\u27E6','LeftDownTeeVector':'\u2961','LeftDownVectorBar':'\u2959','LeftDownVector':'\u21C3','LeftFloor':'\u230A','leftharpoondown':'\u21BD','leftharpoonup':'\u21BC','leftleftarrows':'\u21C7','leftrightarrow':'\u2194','LeftRightArrow':'\u2194','Leftrightarrow':'\u21D4','leftrightarrows':'\u21C6','leftrightharpoons':'\u21CB','leftrightsquigarrow':'\u21AD','LeftRightVector':'\u294E','LeftTeeArrow':'\u21A4','LeftTee':'\u22A3','LeftTeeVector':'\u295A','leftthreetimes':'\u22CB','LeftTriangleBar':'\u29CF','LeftTriangle':'\u22B2','LeftTriangleEqual':'\u22B4','LeftUpDownVector':'\u2951','LeftUpTeeVector':'\u2960','LeftUpVectorBar':'\u2958','LeftUpVector':'\u21BF','LeftVectorBar':'\u2952','LeftVector':'\u21BC','lEg':'\u2A8B','leg':'\u22DA','leq':'\u2264','leqq':'\u2266','leqslant':'\u2A7D','lescc':'\u2AA8','les':'\u2A7D','lesdot':'\u2A7F','lesdoto':'\u2A81','lesdotor':'\u2A83','lesg':'\u22DA\uFE00','lesges':'\u2A93','lessapprox':'\u2A85','lessdot':'\u22D6','lesseqgtr':'\u22DA','lesseqqgtr':'\u2A8B','LessEqualGreater':'\u22DA','LessFullEqual':'\u2266','LessGreater':'\u2276','lessgtr':'\u2276','LessLess':'\u2AA1','lesssim':'\u2272','LessSlantEqual':'\u2A7D','LessTilde':'\u2272','lfisht':'\u297C','lfloor':'\u230A','Lfr':'\uD835\uDD0F','lfr':'\uD835\uDD29','lg':'\u2276','lgE':'\u2A91','lHar':'\u2962','lhard':'\u21BD','lharu':'\u21BC','lharul':'\u296A','lhblk':'\u2584','LJcy':'\u0409','ljcy':'\u0459','llarr':'\u21C7','ll':'\u226A','Ll':'\u22D8','llcorner':'\u231E','Lleftarrow':'\u21DA','llhard':'\u296B','lltri':'\u25FA','Lmidot':'\u013F','lmidot':'\u0140','lmoustache':'\u23B0','lmoust':'\u23B0','lnap':'\u2A89','lnapprox':'\u2A89','lne':'\u2A87','lnE':'\u2268','lneq':'\u2A87','lneqq':'\u2268','lnsim':'\u22E6','loang':'\u27EC','loarr':'\u21FD','lobrk':'\u27E6','longleftarrow':'\u27F5','LongLeftArrow':'\u27F5','Longleftarrow':'\u27F8','longleftrightarrow':'\u27F7','LongLeftRightArrow':'\u27F7','Longleftrightarrow':'\u27FA','longmapsto':'\u27FC','longrightarrow':'\u27F6','LongRightArrow':'\u27F6','Longrightarrow':'\u27F9','looparrowleft':'\u21AB','looparrowright':'\u21AC','lopar':'\u2985','Lopf':'\uD835\uDD43','lopf':'\uD835\uDD5D','loplus':'\u2A2D','lotimes':'\u2A34','lowast':'\u2217','lowbar':'_','LowerLeftArrow':'\u2199','LowerRightArrow':'\u2198','loz':'\u25CA','lozenge':'\u25CA','lozf':'\u29EB','lpar':'(','lparlt':'\u2993','lrarr':'\u21C6','lrcorner':'\u231F','lrhar':'\u21CB','lrhard':'\u296D','lrm':'\u200E','lrtri':'\u22BF','lsaquo':'\u2039','lscr':'\uD835\uDCC1','Lscr':'\u2112','lsh':'\u21B0','Lsh':'\u21B0','lsim':'\u2272','lsime':'\u2A8D','lsimg':'\u2A8F','lsqb':'[','lsquo':'\u2018','lsquor':'\u201A','Lstrok':'\u0141','lstrok':'\u0142','ltcc':'\u2AA6','ltcir':'\u2A79','lt':'<','LT':'<','Lt':'\u226A','ltdot':'\u22D6','lthree':'\u22CB','ltimes':'\u22C9','ltlarr':'\u2976','ltquest':'\u2A7B','ltri':'\u25C3','ltrie':'\u22B4','ltrif':'\u25C2','ltrPar':'\u2996','lurdshar':'\u294A','luruhar':'\u2966','lvertneqq':'\u2268\uFE00','lvnE':'\u2268\uFE00','macr':'\xAF','male':'\u2642','malt':'\u2720','maltese':'\u2720','Map':'\u2905','map':'\u21A6','mapsto':'\u21A6','mapstodown':'\u21A7','mapstoleft':'\u21A4','mapstoup':'\u21A5','marker':'\u25AE','mcomma':'\u2A29','Mcy':'\u041C','mcy':'\u043C','mdash':'\u2014','mDDot':'\u223A','measuredangle':'\u2221','MediumSpace':'\u205F','Mellintrf':'\u2133','Mfr':'\uD835\uDD10','mfr':'\uD835\uDD2A','mho':'\u2127','micro':'\xB5','midast':'*','midcir':'\u2AF0','mid':'\u2223','middot':'\xB7','minusb':'\u229F','minus':'\u2212','minusd':'\u2238','minusdu':'\u2A2A','MinusPlus':'\u2213','mlcp':'\u2ADB','mldr':'\u2026','mnplus':'\u2213','models':'\u22A7','Mopf':'\uD835\uDD44','mopf':'\uD835\uDD5E','mp':'\u2213','mscr':'\uD835\uDCC2','Mscr':'\u2133','mstpos':'\u223E','Mu':'\u039C','mu':'\u03BC','multimap':'\u22B8','mumap':'\u22B8','nabla':'\u2207','Nacute':'\u0143','nacute':'\u0144','nang':'\u2220\u20D2','nap':'\u2249','napE':'\u2A70\u0338','napid':'\u224B\u0338','napos':'\u0149','napprox':'\u2249','natural':'\u266E','naturals':'\u2115','natur':'\u266E','nbsp':'\xA0','nbump':'\u224E\u0338','nbumpe':'\u224F\u0338','ncap':'\u2A43','Ncaron':'\u0147','ncaron':'\u0148','Ncedil':'\u0145','ncedil':'\u0146','ncong':'\u2247','ncongdot':'\u2A6D\u0338','ncup':'\u2A42','Ncy':'\u041D','ncy':'\u043D','ndash':'\u2013','nearhk':'\u2924','nearr':'\u2197','neArr':'\u21D7','nearrow':'\u2197','ne':'\u2260','nedot':'\u2250\u0338','NegativeMediumSpace':'\u200B','NegativeThickSpace':'\u200B','NegativeThinSpace':'\u200B','NegativeVeryThinSpace':'\u200B','nequiv':'\u2262','nesear':'\u2928','nesim':'\u2242\u0338','NestedGreaterGreater':'\u226B','NestedLessLess':'\u226A','NewLine':'\n','nexist':'\u2204','nexists':'\u2204','Nfr':'\uD835\uDD11','nfr':'\uD835\uDD2B','ngE':'\u2267\u0338','nge':'\u2271','ngeq':'\u2271','ngeqq':'\u2267\u0338','ngeqslant':'\u2A7E\u0338','nges':'\u2A7E\u0338','nGg':'\u22D9\u0338','ngsim':'\u2275','nGt':'\u226B\u20D2','ngt':'\u226F','ngtr':'\u226F','nGtv':'\u226B\u0338','nharr':'\u21AE','nhArr':'\u21CE','nhpar':'\u2AF2','ni':'\u220B','nis':'\u22FC','nisd':'\u22FA','niv':'\u220B','NJcy':'\u040A','njcy':'\u045A','nlarr':'\u219A','nlArr':'\u21CD','nldr':'\u2025','nlE':'\u2266\u0338','nle':'\u2270','nleftarrow':'\u219A','nLeftarrow':'\u21CD','nleftrightarrow':'\u21AE','nLeftrightarrow':'\u21CE','nleq':'\u2270','nleqq':'\u2266\u0338','nleqslant':'\u2A7D\u0338','nles':'\u2A7D\u0338','nless':'\u226E','nLl':'\u22D8\u0338','nlsim':'\u2274','nLt':'\u226A\u20D2','nlt':'\u226E','nltri':'\u22EA','nltrie':'\u22EC','nLtv':'\u226A\u0338','nmid':'\u2224','NoBreak':'\u2060','NonBreakingSpace':'\xA0','nopf':'\uD835\uDD5F','Nopf':'\u2115','Not':'\u2AEC','not':'\xAC','NotCongruent':'\u2262','NotCupCap':'\u226D','NotDoubleVerticalBar':'\u2226','NotElement':'\u2209','NotEqual':'\u2260','NotEqualTilde':'\u2242\u0338','NotExists':'\u2204','NotGreater':'\u226F','NotGreaterEqual':'\u2271','NotGreaterFullEqual':'\u2267\u0338','NotGreaterGreater':'\u226B\u0338','NotGreaterLess':'\u2279','NotGreaterSlantEqual':'\u2A7E\u0338','NotGreaterTilde':'\u2275','NotHumpDownHump':'\u224E\u0338','NotHumpEqual':'\u224F\u0338','notin':'\u2209','notindot':'\u22F5\u0338','notinE':'\u22F9\u0338','notinva':'\u2209','notinvb':'\u22F7','notinvc':'\u22F6','NotLeftTriangleBar':'\u29CF\u0338','NotLeftTriangle':'\u22EA','NotLeftTriangleEqual':'\u22EC','NotLess':'\u226E','NotLessEqual':'\u2270','NotLessGreater':'\u2278','NotLessLess':'\u226A\u0338','NotLessSlantEqual':'\u2A7D\u0338','NotLessTilde':'\u2274','NotNestedGreaterGreater':'\u2AA2\u0338','NotNestedLessLess':'\u2AA1\u0338','notni':'\u220C','notniva':'\u220C','notnivb':'\u22FE','notnivc':'\u22FD','NotPrecedes':'\u2280','NotPrecedesEqual':'\u2AAF\u0338','NotPrecedesSlantEqual':'\u22E0','NotReverseElement':'\u220C','NotRightTriangleBar':'\u29D0\u0338','NotRightTriangle':'\u22EB','NotRightTriangleEqual':'\u22ED','NotSquareSubset':'\u228F\u0338','NotSquareSubsetEqual':'\u22E2','NotSquareSuperset':'\u2290\u0338','NotSquareSupersetEqual':'\u22E3','NotSubset':'\u2282\u20D2','NotSubsetEqual':'\u2288','NotSucceeds':'\u2281','NotSucceedsEqual':'\u2AB0\u0338','NotSucceedsSlantEqual':'\u22E1','NotSucceedsTilde':'\u227F\u0338','NotSuperset':'\u2283\u20D2','NotSupersetEqual':'\u2289','NotTilde':'\u2241','NotTildeEqual':'\u2244','NotTildeFullEqual':'\u2247','NotTildeTilde':'\u2249','NotVerticalBar':'\u2224','nparallel':'\u2226','npar':'\u2226','nparsl':'\u2AFD\u20E5','npart':'\u2202\u0338','npolint':'\u2A14','npr':'\u2280','nprcue':'\u22E0','nprec':'\u2280','npreceq':'\u2AAF\u0338','npre':'\u2AAF\u0338','nrarrc':'\u2933\u0338','nrarr':'\u219B','nrArr':'\u21CF','nrarrw':'\u219D\u0338','nrightarrow':'\u219B','nRightarrow':'\u21CF','nrtri':'\u22EB','nrtrie':'\u22ED','nsc':'\u2281','nsccue':'\u22E1','nsce':'\u2AB0\u0338','Nscr':'\uD835\uDCA9','nscr':'\uD835\uDCC3','nshortmid':'\u2224','nshortparallel':'\u2226','nsim':'\u2241','nsime':'\u2244','nsimeq':'\u2244','nsmid':'\u2224','nspar':'\u2226','nsqsube':'\u22E2','nsqsupe':'\u22E3','nsub':'\u2284','nsubE':'\u2AC5\u0338','nsube':'\u2288','nsubset':'\u2282\u20D2','nsubseteq':'\u2288','nsubseteqq':'\u2AC5\u0338','nsucc':'\u2281','nsucceq':'\u2AB0\u0338','nsup':'\u2285','nsupE':'\u2AC6\u0338','nsupe':'\u2289','nsupset':'\u2283\u20D2','nsupseteq':'\u2289','nsupseteqq':'\u2AC6\u0338','ntgl':'\u2279','Ntilde':'\xD1','ntilde':'\xF1','ntlg':'\u2278','ntriangleleft':'\u22EA','ntrianglelefteq':'\u22EC','ntriangleright':'\u22EB','ntrianglerighteq':'\u22ED','Nu':'\u039D','nu':'\u03BD','num':'#','numero':'\u2116','numsp':'\u2007','nvap':'\u224D\u20D2','nvdash':'\u22AC','nvDash':'\u22AD','nVdash':'\u22AE','nVDash':'\u22AF','nvge':'\u2265\u20D2','nvgt':'>\u20D2','nvHarr':'\u2904','nvinfin':'\u29DE','nvlArr':'\u2902','nvle':'\u2264\u20D2','nvlt':'<\u20D2','nvltrie':'\u22B4\u20D2','nvrArr':'\u2903','nvrtrie':'\u22B5\u20D2','nvsim':'\u223C\u20D2','nwarhk':'\u2923','nwarr':'\u2196','nwArr':'\u21D6','nwarrow':'\u2196','nwnear':'\u2927','Oacute':'\xD3','oacute':'\xF3','oast':'\u229B','Ocirc':'\xD4','ocirc':'\xF4','ocir':'\u229A','Ocy':'\u041E','ocy':'\u043E','odash':'\u229D','Odblac':'\u0150','odblac':'\u0151','odiv':'\u2A38','odot':'\u2299','odsold':'\u29BC','OElig':'\u0152','oelig':'\u0153','ofcir':'\u29BF','Ofr':'\uD835\uDD12','ofr':'\uD835\uDD2C','ogon':'\u02DB','Ograve':'\xD2','ograve':'\xF2','ogt':'\u29C1','ohbar':'\u29B5','ohm':'\u03A9','oint':'\u222E','olarr':'\u21BA','olcir':'\u29BE','olcross':'\u29BB','oline':'\u203E','olt':'\u29C0','Omacr':'\u014C','omacr':'\u014D','Omega':'\u03A9','omega':'\u03C9','Omicron':'\u039F','omicron':'\u03BF','omid':'\u29B6','ominus':'\u2296','Oopf':'\uD835\uDD46','oopf':'\uD835\uDD60','opar':'\u29B7','OpenCurlyDoubleQuote':'\u201C','OpenCurlyQuote':'\u2018','operp':'\u29B9','oplus':'\u2295','orarr':'\u21BB','Or':'\u2A54','or':'\u2228','ord':'\u2A5D','order':'\u2134','orderof':'\u2134','ordf':'\xAA','ordm':'\xBA','origof':'\u22B6','oror':'\u2A56','orslope':'\u2A57','orv':'\u2A5B','oS':'\u24C8','Oscr':'\uD835\uDCAA','oscr':'\u2134','Oslash':'\xD8','oslash':'\xF8','osol':'\u2298','Otilde':'\xD5','otilde':'\xF5','otimesas':'\u2A36','Otimes':'\u2A37','otimes':'\u2297','Ouml':'\xD6','ouml':'\xF6','ovbar':'\u233D','OverBar':'\u203E','OverBrace':'\u23DE','OverBracket':'\u23B4','OverParenthesis':'\u23DC','para':'\xB6','parallel':'\u2225','par':'\u2225','parsim':'\u2AF3','parsl':'\u2AFD','part':'\u2202','PartialD':'\u2202','Pcy':'\u041F','pcy':'\u043F','percnt':'%','period':'.','permil':'\u2030','perp':'\u22A5','pertenk':'\u2031','Pfr':'\uD835\uDD13','pfr':'\uD835\uDD2D','Phi':'\u03A6','phi':'\u03C6','phiv':'\u03D5','phmmat':'\u2133','phone':'\u260E','Pi':'\u03A0','pi':'\u03C0','pitchfork':'\u22D4','piv':'\u03D6','planck':'\u210F','planckh':'\u210E','plankv':'\u210F','plusacir':'\u2A23','plusb':'\u229E','pluscir':'\u2A22','plus':'+','plusdo':'\u2214','plusdu':'\u2A25','pluse':'\u2A72','PlusMinus':'\xB1','plusmn':'\xB1','plussim':'\u2A26','plustwo':'\u2A27','pm':'\xB1','Poincareplane':'\u210C','pointint':'\u2A15','popf':'\uD835\uDD61','Popf':'\u2119','pound':'\xA3','prap':'\u2AB7','Pr':'\u2ABB','pr':'\u227A','prcue':'\u227C','precapprox':'\u2AB7','prec':'\u227A','preccurlyeq':'\u227C','Precedes':'\u227A','PrecedesEqual':'\u2AAF','PrecedesSlantEqual':'\u227C','PrecedesTilde':'\u227E','preceq':'\u2AAF','precnapprox':'\u2AB9','precneqq':'\u2AB5','precnsim':'\u22E8','pre':'\u2AAF','prE':'\u2AB3','precsim':'\u227E','prime':'\u2032','Prime':'\u2033','primes':'\u2119','prnap':'\u2AB9','prnE':'\u2AB5','prnsim':'\u22E8','prod':'\u220F','Product':'\u220F','profalar':'\u232E','profline':'\u2312','profsurf':'\u2313','prop':'\u221D','Proportional':'\u221D','Proportion':'\u2237','propto':'\u221D','prsim':'\u227E','prurel':'\u22B0','Pscr':'\uD835\uDCAB','pscr':'\uD835\uDCC5','Psi':'\u03A8','psi':'\u03C8','puncsp':'\u2008','Qfr':'\uD835\uDD14','qfr':'\uD835\uDD2E','qint':'\u2A0C','qopf':'\uD835\uDD62','Qopf':'\u211A','qprime':'\u2057','Qscr':'\uD835\uDCAC','qscr':'\uD835\uDCC6','quaternions':'\u210D','quatint':'\u2A16','quest':'?','questeq':'\u225F','quot':'"','QUOT':'"','rAarr':'\u21DB','race':'\u223D\u0331','Racute':'\u0154','racute':'\u0155','radic':'\u221A','raemptyv':'\u29B3','rang':'\u27E9','Rang':'\u27EB','rangd':'\u2992','range':'\u29A5','rangle':'\u27E9','raquo':'\xBB','rarrap':'\u2975','rarrb':'\u21E5','rarrbfs':'\u2920','rarrc':'\u2933','rarr':'\u2192','Rarr':'\u21A0','rArr':'\u21D2','rarrfs':'\u291E','rarrhk':'\u21AA','rarrlp':'\u21AC','rarrpl':'\u2945','rarrsim':'\u2974','Rarrtl':'\u2916','rarrtl':'\u21A3','rarrw':'\u219D','ratail':'\u291A','rAtail':'\u291C','ratio':'\u2236','rationals':'\u211A','rbarr':'\u290D','rBarr':'\u290F','RBarr':'\u2910','rbbrk':'\u2773','rbrace':'}','rbrack':']','rbrke':'\u298C','rbrksld':'\u298E','rbrkslu':'\u2990','Rcaron':'\u0158','rcaron':'\u0159','Rcedil':'\u0156','rcedil':'\u0157','rceil':'\u2309','rcub':'}','Rcy':'\u0420','rcy':'\u0440','rdca':'\u2937','rdldhar':'\u2969','rdquo':'\u201D','rdquor':'\u201D','rdsh':'\u21B3','real':'\u211C','realine':'\u211B','realpart':'\u211C','reals':'\u211D','Re':'\u211C','rect':'\u25AD','reg':'\xAE','REG':'\xAE','ReverseElement':'\u220B','ReverseEquilibrium':'\u21CB','ReverseUpEquilibrium':'\u296F','rfisht':'\u297D','rfloor':'\u230B','rfr':'\uD835\uDD2F','Rfr':'\u211C','rHar':'\u2964','rhard':'\u21C1','rharu':'\u21C0','rharul':'\u296C','Rho':'\u03A1','rho':'\u03C1','rhov':'\u03F1','RightAngleBracket':'\u27E9','RightArrowBar':'\u21E5','rightarrow':'\u2192','RightArrow':'\u2192','Rightarrow':'\u21D2','RightArrowLeftArrow':'\u21C4','rightarrowtail':'\u21A3','RightCeiling':'\u2309','RightDoubleBracket':'\u27E7','RightDownTeeVector':'\u295D','RightDownVectorBar':'\u2955','RightDownVector':'\u21C2','RightFloor':'\u230B','rightharpoondown':'\u21C1','rightharpoonup':'\u21C0','rightleftarrows':'\u21C4','rightleftharpoons':'\u21CC','rightrightarrows':'\u21C9','rightsquigarrow':'\u219D','RightTeeArrow':'\u21A6','RightTee':'\u22A2','RightTeeVector':'\u295B','rightthreetimes':'\u22CC','RightTriangleBar':'\u29D0','RightTriangle':'\u22B3','RightTriangleEqual':'\u22B5','RightUpDownVector':'\u294F','RightUpTeeVector':'\u295C','RightUpVectorBar':'\u2954','RightUpVector':'\u21BE','RightVectorBar':'\u2953','RightVector':'\u21C0','ring':'\u02DA','risingdotseq':'\u2253','rlarr':'\u21C4','rlhar':'\u21CC','rlm':'\u200F','rmoustache':'\u23B1','rmoust':'\u23B1','rnmid':'\u2AEE','roang':'\u27ED','roarr':'\u21FE','robrk':'\u27E7','ropar':'\u2986','ropf':'\uD835\uDD63','Ropf':'\u211D','roplus':'\u2A2E','rotimes':'\u2A35','RoundImplies':'\u2970','rpar':')','rpargt':'\u2994','rppolint':'\u2A12','rrarr':'\u21C9','Rrightarrow':'\u21DB','rsaquo':'\u203A','rscr':'\uD835\uDCC7','Rscr':'\u211B','rsh':'\u21B1','Rsh':'\u21B1','rsqb':']','rsquo':'\u2019','rsquor':'\u2019','rthree':'\u22CC','rtimes':'\u22CA','rtri':'\u25B9','rtrie':'\u22B5','rtrif':'\u25B8','rtriltri':'\u29CE','RuleDelayed':'\u29F4','ruluhar':'\u2968','rx':'\u211E','Sacute':'\u015A','sacute':'\u015B','sbquo':'\u201A','scap':'\u2AB8','Scaron':'\u0160','scaron':'\u0161','Sc':'\u2ABC','sc':'\u227B','sccue':'\u227D','sce':'\u2AB0','scE':'\u2AB4','Scedil':'\u015E','scedil':'\u015F','Scirc':'\u015C','scirc':'\u015D','scnap':'\u2ABA','scnE':'\u2AB6','scnsim':'\u22E9','scpolint':'\u2A13','scsim':'\u227F','Scy':'\u0421','scy':'\u0441','sdotb':'\u22A1','sdot':'\u22C5','sdote':'\u2A66','searhk':'\u2925','searr':'\u2198','seArr':'\u21D8','searrow':'\u2198','sect':'\xA7','semi':';','seswar':'\u2929','setminus':'\u2216','setmn':'\u2216','sext':'\u2736','Sfr':'\uD835\uDD16','sfr':'\uD835\uDD30','sfrown':'\u2322','sharp':'\u266F','SHCHcy':'\u0429','shchcy':'\u0449','SHcy':'\u0428','shcy':'\u0448','ShortDownArrow':'\u2193','ShortLeftArrow':'\u2190','shortmid':'\u2223','shortparallel':'\u2225','ShortRightArrow':'\u2192','ShortUpArrow':'\u2191','shy':'\xAD','Sigma':'\u03A3','sigma':'\u03C3','sigmaf':'\u03C2','sigmav':'\u03C2','sim':'\u223C','simdot':'\u2A6A','sime':'\u2243','simeq':'\u2243','simg':'\u2A9E','simgE':'\u2AA0','siml':'\u2A9D','simlE':'\u2A9F','simne':'\u2246','simplus':'\u2A24','simrarr':'\u2972','slarr':'\u2190','SmallCircle':'\u2218','smallsetminus':'\u2216','smashp':'\u2A33','smeparsl':'\u29E4','smid':'\u2223','smile':'\u2323','smt':'\u2AAA','smte':'\u2AAC','smtes':'\u2AAC\uFE00','SOFTcy':'\u042C','softcy':'\u044C','solbar':'\u233F','solb':'\u29C4','sol':'/','Sopf':'\uD835\uDD4A','sopf':'\uD835\uDD64','spades':'\u2660','spadesuit':'\u2660','spar':'\u2225','sqcap':'\u2293','sqcaps':'\u2293\uFE00','sqcup':'\u2294','sqcups':'\u2294\uFE00','Sqrt':'\u221A','sqsub':'\u228F','sqsube':'\u2291','sqsubset':'\u228F','sqsubseteq':'\u2291','sqsup':'\u2290','sqsupe':'\u2292','sqsupset':'\u2290','sqsupseteq':'\u2292','square':'\u25A1','Square':'\u25A1','SquareIntersection':'\u2293','SquareSubset':'\u228F','SquareSubsetEqual':'\u2291','SquareSuperset':'\u2290','SquareSupersetEqual':'\u2292','SquareUnion':'\u2294','squarf':'\u25AA','squ':'\u25A1','squf':'\u25AA','srarr':'\u2192','Sscr':'\uD835\uDCAE','sscr':'\uD835\uDCC8','ssetmn':'\u2216','ssmile':'\u2323','sstarf':'\u22C6','Star':'\u22C6','star':'\u2606','starf':'\u2605','straightepsilon':'\u03F5','straightphi':'\u03D5','strns':'\xAF','sub':'\u2282','Sub':'\u22D0','subdot':'\u2ABD','subE':'\u2AC5','sube':'\u2286','subedot':'\u2AC3','submult':'\u2AC1','subnE':'\u2ACB','subne':'\u228A','subplus':'\u2ABF','subrarr':'\u2979','subset':'\u2282','Subset':'\u22D0','subseteq':'\u2286','subseteqq':'\u2AC5','SubsetEqual':'\u2286','subsetneq':'\u228A','subsetneqq':'\u2ACB','subsim':'\u2AC7','subsub':'\u2AD5','subsup':'\u2AD3','succapprox':'\u2AB8','succ':'\u227B','succcurlyeq':'\u227D','Succeeds':'\u227B','SucceedsEqual':'\u2AB0','SucceedsSlantEqual':'\u227D','SucceedsTilde':'\u227F','succeq':'\u2AB0','succnapprox':'\u2ABA','succneqq':'\u2AB6','succnsim':'\u22E9','succsim':'\u227F','SuchThat':'\u220B','sum':'\u2211','Sum':'\u2211','sung':'\u266A','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','sup':'\u2283','Sup':'\u22D1','supdot':'\u2ABE','supdsub':'\u2AD8','supE':'\u2AC6','supe':'\u2287','supedot':'\u2AC4','Superset':'\u2283','SupersetEqual':'\u2287','suphsol':'\u27C9','suphsub':'\u2AD7','suplarr':'\u297B','supmult':'\u2AC2','supnE':'\u2ACC','supne':'\u228B','supplus':'\u2AC0','supset':'\u2283','Supset':'\u22D1','supseteq':'\u2287','supseteqq':'\u2AC6','supsetneq':'\u228B','supsetneqq':'\u2ACC','supsim':'\u2AC8','supsub':'\u2AD4','supsup':'\u2AD6','swarhk':'\u2926','swarr':'\u2199','swArr':'\u21D9','swarrow':'\u2199','swnwar':'\u292A','szlig':'\xDF','Tab':'\t','target':'\u2316','Tau':'\u03A4','tau':'\u03C4','tbrk':'\u23B4','Tcaron':'\u0164','tcaron':'\u0165','Tcedil':'\u0162','tcedil':'\u0163','Tcy':'\u0422','tcy':'\u0442','tdot':'\u20DB','telrec':'\u2315','Tfr':'\uD835\uDD17','tfr':'\uD835\uDD31','there4':'\u2234','therefore':'\u2234','Therefore':'\u2234','Theta':'\u0398','theta':'\u03B8','thetasym':'\u03D1','thetav':'\u03D1','thickapprox':'\u2248','thicksim':'\u223C','ThickSpace':'\u205F\u200A','ThinSpace':'\u2009','thinsp':'\u2009','thkap':'\u2248','thksim':'\u223C','THORN':'\xDE','thorn':'\xFE','tilde':'\u02DC','Tilde':'\u223C','TildeEqual':'\u2243','TildeFullEqual':'\u2245','TildeTilde':'\u2248','timesbar':'\u2A31','timesb':'\u22A0','times':'\xD7','timesd':'\u2A30','tint':'\u222D','toea':'\u2928','topbot':'\u2336','topcir':'\u2AF1','top':'\u22A4','Topf':'\uD835\uDD4B','topf':'\uD835\uDD65','topfork':'\u2ADA','tosa':'\u2929','tprime':'\u2034','trade':'\u2122','TRADE':'\u2122','triangle':'\u25B5','triangledown':'\u25BF','triangleleft':'\u25C3','trianglelefteq':'\u22B4','triangleq':'\u225C','triangleright':'\u25B9','trianglerighteq':'\u22B5','tridot':'\u25EC','trie':'\u225C','triminus':'\u2A3A','TripleDot':'\u20DB','triplus':'\u2A39','trisb':'\u29CD','tritime':'\u2A3B','trpezium':'\u23E2','Tscr':'\uD835\uDCAF','tscr':'\uD835\uDCC9','TScy':'\u0426','tscy':'\u0446','TSHcy':'\u040B','tshcy':'\u045B','Tstrok':'\u0166','tstrok':'\u0167','twixt':'\u226C','twoheadleftarrow':'\u219E','twoheadrightarrow':'\u21A0','Uacute':'\xDA','uacute':'\xFA','uarr':'\u2191','Uarr':'\u219F','uArr':'\u21D1','Uarrocir':'\u2949','Ubrcy':'\u040E','ubrcy':'\u045E','Ubreve':'\u016C','ubreve':'\u016D','Ucirc':'\xDB','ucirc':'\xFB','Ucy':'\u0423','ucy':'\u0443','udarr':'\u21C5','Udblac':'\u0170','udblac':'\u0171','udhar':'\u296E','ufisht':'\u297E','Ufr':'\uD835\uDD18','ufr':'\uD835\uDD32','Ugrave':'\xD9','ugrave':'\xF9','uHar':'\u2963','uharl':'\u21BF','uharr':'\u21BE','uhblk':'\u2580','ulcorn':'\u231C','ulcorner':'\u231C','ulcrop':'\u230F','ultri':'\u25F8','Umacr':'\u016A','umacr':'\u016B','uml':'\xA8','UnderBar':'_','UnderBrace':'\u23DF','UnderBracket':'\u23B5','UnderParenthesis':'\u23DD','Union':'\u22C3','UnionPlus':'\u228E','Uogon':'\u0172','uogon':'\u0173','Uopf':'\uD835\uDD4C','uopf':'\uD835\uDD66','UpArrowBar':'\u2912','uparrow':'\u2191','UpArrow':'\u2191','Uparrow':'\u21D1','UpArrowDownArrow':'\u21C5','updownarrow':'\u2195','UpDownArrow':'\u2195','Updownarrow':'\u21D5','UpEquilibrium':'\u296E','upharpoonleft':'\u21BF','upharpoonright':'\u21BE','uplus':'\u228E','UpperLeftArrow':'\u2196','UpperRightArrow':'\u2197','upsi':'\u03C5','Upsi':'\u03D2','upsih':'\u03D2','Upsilon':'\u03A5','upsilon':'\u03C5','UpTeeArrow':'\u21A5','UpTee':'\u22A5','upuparrows':'\u21C8','urcorn':'\u231D','urcorner':'\u231D','urcrop':'\u230E','Uring':'\u016E','uring':'\u016F','urtri':'\u25F9','Uscr':'\uD835\uDCB0','uscr':'\uD835\uDCCA','utdot':'\u22F0','Utilde':'\u0168','utilde':'\u0169','utri':'\u25B5','utrif':'\u25B4','uuarr':'\u21C8','Uuml':'\xDC','uuml':'\xFC','uwangle':'\u29A7','vangrt':'\u299C','varepsilon':'\u03F5','varkappa':'\u03F0','varnothing':'\u2205','varphi':'\u03D5','varpi':'\u03D6','varpropto':'\u221D','varr':'\u2195','vArr':'\u21D5','varrho':'\u03F1','varsigma':'\u03C2','varsubsetneq':'\u228A\uFE00','varsubsetneqq':'\u2ACB\uFE00','varsupsetneq':'\u228B\uFE00','varsupsetneqq':'\u2ACC\uFE00','vartheta':'\u03D1','vartriangleleft':'\u22B2','vartriangleright':'\u22B3','vBar':'\u2AE8','Vbar':'\u2AEB','vBarv':'\u2AE9','Vcy':'\u0412','vcy':'\u0432','vdash':'\u22A2','vDash':'\u22A8','Vdash':'\u22A9','VDash':'\u22AB','Vdashl':'\u2AE6','veebar':'\u22BB','vee':'\u2228','Vee':'\u22C1','veeeq':'\u225A','vellip':'\u22EE','verbar':'|','Verbar':'\u2016','vert':'|','Vert':'\u2016','VerticalBar':'\u2223','VerticalLine':'|','VerticalSeparator':'\u2758','VerticalTilde':'\u2240','VeryThinSpace':'\u200A','Vfr':'\uD835\uDD19','vfr':'\uD835\uDD33','vltri':'\u22B2','vnsub':'\u2282\u20D2','vnsup':'\u2283\u20D2','Vopf':'\uD835\uDD4D','vopf':'\uD835\uDD67','vprop':'\u221D','vrtri':'\u22B3','Vscr':'\uD835\uDCB1','vscr':'\uD835\uDCCB','vsubnE':'\u2ACB\uFE00','vsubne':'\u228A\uFE00','vsupnE':'\u2ACC\uFE00','vsupne':'\u228B\uFE00','Vvdash':'\u22AA','vzigzag':'\u299A','Wcirc':'\u0174','wcirc':'\u0175','wedbar':'\u2A5F','wedge':'\u2227','Wedge':'\u22C0','wedgeq':'\u2259','weierp':'\u2118','Wfr':'\uD835\uDD1A','wfr':'\uD835\uDD34','Wopf':'\uD835\uDD4E','wopf':'\uD835\uDD68','wp':'\u2118','wr':'\u2240','wreath':'\u2240','Wscr':'\uD835\uDCB2','wscr':'\uD835\uDCCC','xcap':'\u22C2','xcirc':'\u25EF','xcup':'\u22C3','xdtri':'\u25BD','Xfr':'\uD835\uDD1B','xfr':'\uD835\uDD35','xharr':'\u27F7','xhArr':'\u27FA','Xi':'\u039E','xi':'\u03BE','xlarr':'\u27F5','xlArr':'\u27F8','xmap':'\u27FC','xnis':'\u22FB','xodot':'\u2A00','Xopf':'\uD835\uDD4F','xopf':'\uD835\uDD69','xoplus':'\u2A01','xotime':'\u2A02','xrarr':'\u27F6','xrArr':'\u27F9','Xscr':'\uD835\uDCB3','xscr':'\uD835\uDCCD','xsqcup':'\u2A06','xuplus':'\u2A04','xutri':'\u25B3','xvee':'\u22C1','xwedge':'\u22C0','Yacute':'\xDD','yacute':'\xFD','YAcy':'\u042F','yacy':'\u044F','Ycirc':'\u0176','ycirc':'\u0177','Ycy':'\u042B','ycy':'\u044B','yen':'\xA5','Yfr':'\uD835\uDD1C','yfr':'\uD835\uDD36','YIcy':'\u0407','yicy':'\u0457','Yopf':'\uD835\uDD50','yopf':'\uD835\uDD6A','Yscr':'\uD835\uDCB4','yscr':'\uD835\uDCCE','YUcy':'\u042E','yucy':'\u044E','yuml':'\xFF','Yuml':'\u0178','Zacute':'\u0179','zacute':'\u017A','Zcaron':'\u017D','zcaron':'\u017E','Zcy':'\u0417','zcy':'\u0437','Zdot':'\u017B','zdot':'\u017C','zeetrf':'\u2128','ZeroWidthSpace':'\u200B','Zeta':'\u0396','zeta':'\u03B6','zfr':'\uD835\uDD37','Zfr':'\u2128','ZHcy':'\u0416','zhcy':'\u0436','zigrarr':'\u21DD','zopf':'\uD835\uDD6B','Zopf':'\u2124','Zscr':'\uD835\uDCB5','zscr':'\uD835\uDCCF','zwj':'\u200D','zwnj':'\u200C'}; - var decodeMapLegacy = {'Aacute':'\xC1','aacute':'\xE1','Acirc':'\xC2','acirc':'\xE2','acute':'\xB4','AElig':'\xC6','aelig':'\xE6','Agrave':'\xC0','agrave':'\xE0','amp':'&','AMP':'&','Aring':'\xC5','aring':'\xE5','Atilde':'\xC3','atilde':'\xE3','Auml':'\xC4','auml':'\xE4','brvbar':'\xA6','Ccedil':'\xC7','ccedil':'\xE7','cedil':'\xB8','cent':'\xA2','copy':'\xA9','COPY':'\xA9','curren':'\xA4','deg':'\xB0','divide':'\xF7','Eacute':'\xC9','eacute':'\xE9','Ecirc':'\xCA','ecirc':'\xEA','Egrave':'\xC8','egrave':'\xE8','ETH':'\xD0','eth':'\xF0','Euml':'\xCB','euml':'\xEB','frac12':'\xBD','frac14':'\xBC','frac34':'\xBE','gt':'>','GT':'>','Iacute':'\xCD','iacute':'\xED','Icirc':'\xCE','icirc':'\xEE','iexcl':'\xA1','Igrave':'\xCC','igrave':'\xEC','iquest':'\xBF','Iuml':'\xCF','iuml':'\xEF','laquo':'\xAB','lt':'<','LT':'<','macr':'\xAF','micro':'\xB5','middot':'\xB7','nbsp':'\xA0','not':'\xAC','Ntilde':'\xD1','ntilde':'\xF1','Oacute':'\xD3','oacute':'\xF3','Ocirc':'\xD4','ocirc':'\xF4','Ograve':'\xD2','ograve':'\xF2','ordf':'\xAA','ordm':'\xBA','Oslash':'\xD8','oslash':'\xF8','Otilde':'\xD5','otilde':'\xF5','Ouml':'\xD6','ouml':'\xF6','para':'\xB6','plusmn':'\xB1','pound':'\xA3','quot':'"','QUOT':'"','raquo':'\xBB','reg':'\xAE','REG':'\xAE','sect':'\xA7','shy':'\xAD','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','szlig':'\xDF','THORN':'\xDE','thorn':'\xFE','times':'\xD7','Uacute':'\xDA','uacute':'\xFA','Ucirc':'\xDB','ucirc':'\xFB','Ugrave':'\xD9','ugrave':'\xF9','uml':'\xA8','Uuml':'\xDC','uuml':'\xFC','Yacute':'\xDD','yacute':'\xFD','yen':'\xA5','yuml':'\xFF'}; - var decodeMapNumeric = {'0':'\uFFFD','128':'\u20AC','130':'\u201A','131':'\u0192','132':'\u201E','133':'\u2026','134':'\u2020','135':'\u2021','136':'\u02C6','137':'\u2030','138':'\u0160','139':'\u2039','140':'\u0152','142':'\u017D','145':'\u2018','146':'\u2019','147':'\u201C','148':'\u201D','149':'\u2022','150':'\u2013','151':'\u2014','152':'\u02DC','153':'\u2122','154':'\u0161','155':'\u203A','156':'\u0153','158':'\u017E','159':'\u0178'}; - var invalidReferenceCodePoints = [1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65000,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]; - - /*--------------------------------------------------------------------------*/ - - var stringFromCharCode = String.fromCharCode; - - var object = {}; - var hasOwnProperty = object.hasOwnProperty; - var has = function(object, propertyName) { - return hasOwnProperty.call(object, propertyName); - }; - - var contains = function(array, value) { - var index = -1; - var length = array.length; - while (++index < length) { - if (array[index] == value) { - return true; - } - } - return false; - }; - - var merge = function(options, defaults) { - if (!options) { - return defaults; - } - var result = {}; - var key; - for (key in defaults) { - // A `hasOwnProperty` check is not needed here, since only recognized - // option names are used anyway. Any others are ignored. - result[key] = has(options, key) ? options[key] : defaults[key]; - } - return result; - }; - - // Modified version of `ucs2encode`; see http://mths.be/punycode. - var codePointToSymbol = function(codePoint, strict) { - var output = ''; - if ((codePoint >= 0xD800 && codePoint <= 0xDFFF) || codePoint > 0x10FFFF) { - // See issue #4: - // “Otherwise, if the number is in the range 0xD800 to 0xDFFF or is - // greater than 0x10FFFF, then this is a parse error. Return a U+FFFD - // REPLACEMENT CHARACTER.” - if (strict) { - parseError('character reference outside the permissible Unicode range'); - } - return '\uFFFD'; - } - if (has(decodeMapNumeric, codePoint)) { - if (strict) { - parseError('disallowed character reference'); - } - return decodeMapNumeric[codePoint]; - } - if (strict && contains(invalidReferenceCodePoints, codePoint)) { - parseError('disallowed character reference'); - } - if (codePoint > 0xFFFF) { - codePoint -= 0x10000; - output += stringFromCharCode(codePoint >>> 10 & 0x3FF | 0xD800); - codePoint = 0xDC00 | codePoint & 0x3FF; - } - output += stringFromCharCode(codePoint); - return output; - }; - - var hexEscape = function(symbol) { - return '&#x' + symbol.charCodeAt(0).toString(16).toUpperCase() + ';'; - }; - - var parseError = function(message) { - throw Error('Parse error: ' + message); - }; - - /*--------------------------------------------------------------------------*/ - - var encode = function(string, options) { - options = merge(options, encode.options); - var strict = options.strict; - if (strict && regexInvalidRawCodePoint.test(string)) { - parseError('forbidden code point'); - } - var encodeEverything = options.encodeEverything; - var useNamedReferences = options.useNamedReferences; - var allowUnsafeSymbols = options.allowUnsafeSymbols; - if (encodeEverything) { - // Encode ASCII symbols. - string = string.replace(regexAsciiWhitelist, function(symbol) { - // Use named references if requested & possible. - if (useNamedReferences && has(encodeMap, symbol)) { - return '&' + encodeMap[symbol] + ';'; - } - return hexEscape(symbol); - }); - // Shorten a few escapes that represent two symbols, of which at least one - // is within the ASCII range. - if (useNamedReferences) { - string = string - .replace(/>\u20D2/g, '>⃒') - .replace(/<\u20D2/g, '<⃒') - .replace(/fj/g, 'fj'); - } - // Encode non-ASCII symbols. - if (useNamedReferences) { - // Encode non-ASCII symbols that can be replaced with a named reference. - string = string.replace(regexEncodeNonAscii, function(string) { - // Note: there is no need to check `has(encodeMap, string)` here. - return '&' + encodeMap[string] + ';'; - }); - } - // Note: any remaining non-ASCII symbols are handled outside of the `if`. - } else if (useNamedReferences) { - // Apply named character references. - // Encode `<>"'&` using named character references. - if (!allowUnsafeSymbols) { - string = string.replace(regexEscape, function(string) { - return '&' + encodeMap[string] + ';'; // no need to check `has()` here - }); - } - // Shorten escapes that represent two symbols, of which at least one is - // `<>"'&`. - string = string - .replace(/>\u20D2/g, '>⃒') - .replace(/<\u20D2/g, '<⃒'); - // Encode non-ASCII symbols that can be replaced with a named reference. - string = string.replace(regexEncodeNonAscii, function(string) { - // Note: there is no need to check `has(encodeMap, string)` here. - return '&' + encodeMap[string] + ';'; - }); - } else if (!allowUnsafeSymbols) { - // Encode `<>"'&` using hexadecimal escapes, now that they’re not handled - // using named character references. - string = string.replace(regexEscape, hexEscape); - } - return string - // Encode astral symbols. - .replace(regexAstralSymbols, function($0) { - // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - var high = $0.charCodeAt(0); - var low = $0.charCodeAt(1); - var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000; - return '&#x' + codePoint.toString(16).toUpperCase() + ';'; - }) - // Encode any remaining BMP symbols that are not printable ASCII symbols - // using a hexadecimal escape. - .replace(regexBmpWhitelist, hexEscape); - }; - // Expose default options (so they can be overridden globally). - encode.options = { - 'allowUnsafeSymbols': false, - 'encodeEverything': false, - 'strict': false, - 'useNamedReferences': false - }; - - var decode = function(html, options) { - options = merge(options, decode.options); - var strict = options.strict; - if (strict && regexInvalidEntity.test(html)) { - parseError('malformed character reference'); - } - return html.replace(regexDecode, function($0, $1, $2, $3, $4, $5, $6, $7) { - var codePoint; - var semicolon; - var hexDigits; - var reference; - var next; - if ($1) { - // Decode decimal escapes, e.g. `𝌆`. - codePoint = $1; - semicolon = $2; - if (strict && !semicolon) { - parseError('character reference was not terminated by a semicolon'); - } - return codePointToSymbol(codePoint, strict); - } - if ($3) { - // Decode hexadecimal escapes, e.g. `𝌆`. - hexDigits = $3; - semicolon = $4; - if (strict && !semicolon) { - parseError('character reference was not terminated by a semicolon'); - } - codePoint = parseInt(hexDigits, 16); - return codePointToSymbol(codePoint, strict); - } - if ($5) { - // Decode named character references with trailing `;`, e.g. `©`. - reference = $5; - if (has(decodeMap, reference)) { - return decodeMap[reference]; - } else { - // Ambiguous ampersand; see http://mths.be/notes/ambiguous-ampersands. - if (strict) { - parseError( - 'named character reference was not terminated by a semicolon' - ); - } - return $0; - } - } - // If we’re still here, it’s a legacy reference for sure. No need for an - // extra `if` check. - // Decode named character references without trailing `;`, e.g. `&` - // This is only a parse error if it gets converted to `&`, or if it is - // followed by `=` in an attribute context. - reference = $6; - next = $7; - if (next && options.isAttributeValue) { - if (strict && next == '=') { - parseError('`&` did not start a character reference'); - } - return $0; - } else { - if (strict) { - parseError( - 'named character reference was not terminated by a semicolon' - ); - } - // Note: there is no need to check `has(decodeMapLegacy, reference)`. - return decodeMapLegacy[reference] + (next || ''); - } - }); - }; - // Expose default options (so they can be overridden globally). - decode.options = { - 'isAttributeValue': false, - 'strict': false - }; - - var escape = function(string) { - return string.replace(regexEscape, function($0) { - // Note: there is no need to check `has(escapeMap, $0)` here. - return escapeMap[$0]; - }); - }; - - /*--------------------------------------------------------------------------*/ - - var he = { - 'version': '0.5.0', - 'encode': encode, - 'decode': decode, - 'escape': escape, - 'unescape': decode - }; - - // Some AMD build optimizers, like r.js, check for specific condition patterns - // like the following: - if ( - typeof define == 'function' && - typeof define.amd == 'object' && - define.amd - ) { - define(function() { - return he; - }); - } else if (freeExports && !freeExports.nodeType) { - if (freeModule) { // in Node.js or RingoJS v0.8.0+ - freeModule.exports = he; - } else { // in Narwhal or RingoJS v0.7.0- - for (var key in he) { - has(he, key) && (freeExports[key] = he[key]); - } - } - } else { // in Rhino or a web browser - root.he = he; - } - -}(this)); - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],106:[function(require,module,exports){ +},{}],83:[function(require,module,exports){ //! moment.js -//! version : 2.10.6 +//! version : 2.12.0 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com -(function (global, factory) { +;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory() @@ -27845,7 +27487,7 @@ module.exports=require(53) } function isArray(input) { - return Object.prototype.toString.call(input) === '[object Array]'; + return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; } function isDate(input) { @@ -27943,39 +27585,45 @@ module.exports=require(53) return m; } + function isUndefined(input) { + return input === void 0; + } + + // Plugins that add properties should also add the key here (null value), + // so we can properly clone ourselves. var momentProperties = utils_hooks__hooks.momentProperties = []; function copyConfig(to, from) { var i, prop, val; - if (typeof from._isAMomentObject !== 'undefined') { + if (!isUndefined(from._isAMomentObject)) { to._isAMomentObject = from._isAMomentObject; } - if (typeof from._i !== 'undefined') { + if (!isUndefined(from._i)) { to._i = from._i; } - if (typeof from._f !== 'undefined') { + if (!isUndefined(from._f)) { to._f = from._f; } - if (typeof from._l !== 'undefined') { + if (!isUndefined(from._l)) { to._l = from._l; } - if (typeof from._strict !== 'undefined') { + if (!isUndefined(from._strict)) { to._strict = from._strict; } - if (typeof from._tzm !== 'undefined') { + if (!isUndefined(from._tzm)) { to._tzm = from._tzm; } - if (typeof from._isUTC !== 'undefined') { + if (!isUndefined(from._isUTC)) { to._isUTC = from._isUTC; } - if (typeof from._offset !== 'undefined') { + if (!isUndefined(from._offset)) { to._offset = from._offset; } - if (typeof from._pf !== 'undefined') { + if (!isUndefined(from._pf)) { to._pf = getParsingFlags(from); } - if (typeof from._locale !== 'undefined') { + if (!isUndefined(from._locale)) { to._locale = from._locale; } @@ -27983,7 +27631,7 @@ module.exports=require(53) for (i in momentProperties) { prop = momentProperties[i]; val = from[prop]; - if (typeof val !== 'undefined') { + if (!isUndefined(val)) { to[prop] = val; } } @@ -28030,6 +27678,7 @@ module.exports=require(53) return value; } + // compare two arrays, return the number of differences function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), @@ -28044,9 +27693,85 @@ module.exports=require(53) return diffs + lengthDiff; } - function Locale() { + function warn(msg) { + if (utils_hooks__hooks.suppressDeprecationWarnings === false && + (typeof console !== 'undefined') && console.warn) { + console.warn('Deprecation warning: ' + msg); + } } + function deprecate(msg, fn) { + var firstTime = true; + + return extend(function () { + if (firstTime) { + warn(msg + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\n' + (new Error()).stack); + firstTime = false; + } + return fn.apply(this, arguments); + }, fn); + } + + var deprecations = {}; + + function deprecateSimple(name, msg) { + if (!deprecations[name]) { + warn(msg); + deprecations[name] = true; + } + } + + utils_hooks__hooks.suppressDeprecationWarnings = false; + + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + + function isObject(input) { + return Object.prototype.toString.call(input) === '[object Object]'; + } + + function locale_set__set (config) { + var prop, i; + for (i in config) { + prop = config[i]; + if (isFunction(prop)) { + this[i] = prop; + } else { + this['_' + i] = prop; + } + } + this._config = config; + // Lenient ordinal parsing accepts just a number in addition to + // number + (possibly) stuff coming from _ordinalParseLenient. + this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source); + } + + function mergeConfigs(parentConfig, childConfig) { + var res = extend({}, parentConfig), prop; + for (prop in childConfig) { + if (hasOwnProp(childConfig, prop)) { + if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { + res[prop] = {}; + extend(res[prop], parentConfig[prop]); + extend(res[prop], childConfig[prop]); + } else if (childConfig[prop] != null) { + res[prop] = childConfig[prop]; + } else { + delete res[prop]; + } + } + } + return res; + } + + function Locale(config) { + if (config != null) { + this.set(config); + } + } + + // internal storage for locale config files var locales = {}; var globalLocale; @@ -28084,7 +27809,7 @@ module.exports=require(53) function loadLocale(name) { var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node - if (!locales[name] && typeof module !== 'undefined' && + if (!locales[name] && (typeof module !== 'undefined') && module && module.exports) { try { oldLocale = globalLocale._abbr; @@ -28103,7 +27828,7 @@ module.exports=require(53) function locale_locales__getSetGlobalLocale (key, values) { var data; if (key) { - if (typeof values === 'undefined') { + if (isUndefined(values)) { data = locale_locales__getLocale(key); } else { @@ -28119,11 +27844,25 @@ module.exports=require(53) return globalLocale._abbr; } - function defineLocale (name, values) { - if (values !== null) { - values.abbr = name; - locales[name] = locales[name] || new Locale(); - locales[name].set(values); + function defineLocale (name, config) { + if (config !== null) { + config.abbr = name; + if (locales[name] != null) { + deprecateSimple('defineLocaleOverride', + 'use moment.updateLocale(localeName, config) to change ' + + 'an existing locale. moment.defineLocale(localeName, ' + + 'config) should only be used for creating a new locale'); + config = mergeConfigs(locales[name]._config, config); + } else if (config.parentLocale != null) { + if (locales[config.parentLocale] != null) { + config = mergeConfigs(locales[config.parentLocale]._config, config); + } else { + // treat as if there is no base config + deprecateSimple('parentLocaleUndefined', + 'specified parentLocale is not defined yet'); + } + } + locales[name] = new Locale(config); // backwards compat for now: also set the locale locale_locales__getSetGlobalLocale(name); @@ -28136,6 +27875,31 @@ module.exports=require(53) } } + function updateLocale(name, config) { + if (config != null) { + var locale; + if (locales[name] != null) { + config = mergeConfigs(locales[name]._config, config); + } + locale = new Locale(config); + locale.parentLocale = locales[name]; + locales[name] = locale; + + // backwards compat for now: also set the locale + locale_locales__getSetGlobalLocale(name); + } else { + // pass null for config to unupdate, useful for tests + if (locales[name] != null) { + if (locales[name].parentLocale != null) { + locales[name] = locales[name].parentLocale; + } else if (locales[name] != null) { + delete locales[name]; + } + } + } + return locales[name]; + } + // returns locale data function locale_locales__getLocale (key) { var locale; @@ -28160,6 +27924,10 @@ module.exports=require(53) return chooseLocale(key); } + function locale_locales__listLocales() { + return Object.keys(locales); + } + var aliases = {}; function addUnitAlias (unit, shorthand) { @@ -28201,11 +27969,14 @@ module.exports=require(53) } function get_set__get (mom, unit) { - return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit](); + return mom.isValid() ? + mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; } function get_set__set (mom, unit, value) { - return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + if (mom.isValid()) { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + } } // MOMENTS @@ -28218,7 +27989,7 @@ module.exports=require(53) } } else { units = normalizeUnits(units); - if (typeof this[units] === 'function') { + if (isFunction(this[units])) { return this[units](value); } } @@ -28233,7 +28004,7 @@ module.exports=require(53) Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; } - var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; + var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; @@ -28329,6 +28100,8 @@ module.exports=require(53) var match4 = /\d{4}/; // 0000 - 9999 var match6 = /[+-]?\d{6}/; // -999999 - 999999 var match1to2 = /\d\d?/; // 0 - 99 + var match3to4 = /\d\d\d\d?/; // 999 - 9999 + var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 var match1to3 = /\d{1,3}/; // 0 - 999 var match1to4 = /\d{1,4}/; // 0 - 9999 var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 @@ -28337,23 +28110,19 @@ module.exports=require(53) var matchSigned = /[+-]?\d+/; // -inf - inf var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z + var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. + // includes scottish gaelic two word and hyphenated months var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; + var regexes = {}; - function isFunction (sth) { - // https://github.com/moment/moment/issues/2325 - return typeof sth === 'function' && - Object.prototype.toString.call(sth) === '[object Function]'; - } - - function addRegexToken (token, regex, strictRegex) { - regexes[token] = isFunction(regex) ? regex : function (isStrict) { + regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { return (isStrict && strictRegex) ? strictRegex : regex; }; } @@ -28368,9 +28137,13 @@ module.exports=require(53) // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function unescapeFormat(s) { - return s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { + return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; - }).replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + })); + } + + function regexEscape(s) { + return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } var tokens = {}; @@ -28410,6 +28183,8 @@ module.exports=require(53) var MINUTE = 4; var SECOND = 5; var MILLISECOND = 6; + var WEEK = 7; + var WEEKDAY = 8; function daysInMonth(year, month) { return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); @@ -28437,8 +28212,12 @@ module.exports=require(53) addRegexToken('M', match1to2); addRegexToken('MM', match1to2, match2); - addRegexToken('MMM', matchWord); - addRegexToken('MMMM', matchWord); + addRegexToken('MMM', function (isStrict, locale) { + return locale.monthsShortRegex(isStrict); + }); + addRegexToken('MMMM', function (isStrict, locale) { + return locale.monthsRegex(isStrict); + }); addParseToken(['M', 'MM'], function (input, array) { array[MONTH] = toInt(input) - 1; @@ -28456,14 +28235,17 @@ module.exports=require(53) // LOCALES + var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/; var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); - function localeMonths (m) { - return this._months[m.month()]; + function localeMonths (m, format) { + return isArray(this._months) ? this._months[m.month()] : + this._months[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); - function localeMonthsShort (m) { - return this._monthsShort[m.month()]; + function localeMonthsShort (m, format) { + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : + this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } function localeMonthsParse (monthName, format, strict) { @@ -28502,12 +28284,20 @@ module.exports=require(53) function setMonth (mom, value) { var dayOfMonth; - // TODO: Move this out of here! + if (!mom.isValid()) { + // No op + return mom; + } + if (typeof value === 'string') { - value = mom.localeData().monthsParse(value); - // TODO: Another silent failure? - if (typeof value !== 'number') { - return mom; + if (/^\d+$/.test(value)) { + value = toInt(value); + } else { + value = mom.localeData().monthsParse(value); + // TODO: Another silent failure? + if (typeof value !== 'number') { + return mom; + } } } @@ -28530,6 +28320,72 @@ module.exports=require(53) return daysInMonth(this.year(), this.month()); } + var defaultMonthsShortRegex = matchWord; + function monthsShortRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsShortStrictRegex; + } else { + return this._monthsShortRegex; + } + } else { + return this._monthsShortStrictRegex && isStrict ? + this._monthsShortStrictRegex : this._monthsShortRegex; + } + } + + var defaultMonthsRegex = matchWord; + function monthsRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsStrictRegex; + } else { + return this._monthsRegex; + } + } else { + return this._monthsStrictRegex && isStrict ? + this._monthsStrictRegex : this._monthsRegex; + } + } + + function computeMonthsParse () { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var shortPieces = [], longPieces = [], mixedPieces = [], + i, mom; + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + mom = create_utc__createUTC([2000, i]); + shortPieces.push(this.monthsShort(mom, '')); + longPieces.push(this.months(mom, '')); + mixedPieces.push(this.months(mom, '')); + mixedPieces.push(this.monthsShort(mom, '')); + } + // Sorting makes sure if one month (or abbr) is a prefix of another it + // will match the longer piece. + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + for (i = 0; i < 12; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + + this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._monthsShortRegex = this._monthsRegex; + this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')$', 'i'); + this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')$', 'i'); + } + function checkOverflow (m) { var overflow; var a = m._a; @@ -28547,6 +28403,12 @@ module.exports=require(53) if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { overflow = DATE; } + if (getParsingFlags(m)._overflowWeeks && overflow === -1) { + overflow = WEEK; + } + if (getParsingFlags(m)._overflowWeekday && overflow === -1) { + overflow = WEEKDAY; + } getParsingFlags(m).overflow = overflow; } @@ -28554,51 +28416,39 @@ module.exports=require(53) return m; } - function warn(msg) { - if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { - console.warn('Deprecation warning: ' + msg); - } - } + // iso 8601 regex + // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) + var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; + var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; - function deprecate(msg, fn) { - var firstTime = true; - - return extend(function () { - if (firstTime) { - warn(msg + '\n' + (new Error()).stack); - firstTime = false; - } - return fn.apply(this, arguments); - }, fn); - } - - var deprecations = {}; - - function deprecateSimple(name, msg) { - if (!deprecations[name]) { - warn(msg); - deprecations[name] = true; - } - } - - utils_hooks__hooks.suppressDeprecationWarnings = false; - - var from_string__isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; + var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; var isoDates = [ - ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], - ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], - ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], - ['GGGG-[W]WW', /\d{4}-W\d{2}/], - ['YYYY-DDD', /\d{4}-\d{3}/] + ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], + ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], + ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], + ['GGGG-[W]WW', /\d{4}-W\d\d/, false], + ['YYYY-DDD', /\d{4}-\d{3}/], + ['YYYY-MM', /\d{4}-\d\d/, false], + ['YYYYYYMMDD', /[+-]\d{10}/], + ['YYYYMMDD', /\d{8}/], + // YYYYMM is NOT allowed by the standard + ['GGGG[W]WWE', /\d{4}W\d{3}/], + ['GGGG[W]WW', /\d{4}W\d{2}/, false], + ['YYYYDDD', /\d{7}/] ]; // iso time formats and regexes var isoTimes = [ - ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], - ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], - ['HH:mm', /(T| )\d\d:\d\d/], - ['HH', /(T| )\d\d/] + ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], + ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], + ['HH:mm:ss', /\d\d:\d\d:\d\d/], + ['HH:mm', /\d\d:\d\d/], + ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], + ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], + ['HHmmss', /\d\d\d\d\d\d/], + ['HHmm', /\d\d\d\d/], + ['HH', /\d\d/] ]; var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; @@ -28607,26 +28457,49 @@ module.exports=require(53) function configFromISO(config) { var i, l, string = config._i, - match = from_string__isoRegex.exec(string); + match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), + allowTime, dateFormat, timeFormat, tzFormat; if (match) { getParsingFlags(config).iso = true; + for (i = 0, l = isoDates.length; i < l; i++) { - if (isoDates[i][1].exec(string)) { - config._f = isoDates[i][0]; + if (isoDates[i][1].exec(match[1])) { + dateFormat = isoDates[i][0]; + allowTime = isoDates[i][2] !== false; break; } } - for (i = 0, l = isoTimes.length; i < l; i++) { - if (isoTimes[i][1].exec(string)) { - // match[6] should be 'T' or space - config._f += (match[6] || ' ') + isoTimes[i][0]; - break; + if (dateFormat == null) { + config._isValid = false; + return; + } + if (match[3]) { + for (i = 0, l = isoTimes.length; i < l; i++) { + if (isoTimes[i][1].exec(match[3])) { + // match[2] should be 'T' or space + timeFormat = (match[2] || ' ') + isoTimes[i][0]; + break; + } + } + if (timeFormat == null) { + config._isValid = false; + return; } } - if (string.match(matchOffset)) { - config._f += 'Z'; + if (!allowTime && timeFormat != null) { + config._isValid = false; + return; } + if (match[4]) { + if (tzRegex.exec(match[4])) { + tzFormat = 'Z'; + } else { + config._isValid = false; + return; + } + } + config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; @@ -28664,8 +28537,8 @@ module.exports=require(53) //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply var date = new Date(y, m, d, h, M, s, ms); - //the date constructor doesn't accept years < 1970 - if (y < 1970) { + //the date constructor remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { date.setFullYear(y); } return date; @@ -28673,12 +28546,21 @@ module.exports=require(53) function createUTCDate (y) { var date = new Date(Date.UTC.apply(null, arguments)); - if (y < 1970) { + + //the Date.UTC function remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } return date; } + // FORMATTING + + addFormatToken('Y', 0, 0, function () { + var y = this.year(); + return y <= 9999 ? '' + y : '+' + y; + }); + addFormatToken(0, ['YY', 2], 0, function () { return this.year() % 100; }); @@ -28706,6 +28588,9 @@ module.exports=require(53) addParseToken('YY', function (input, array) { array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input); }); + addParseToken('Y', function (input, array) { + array[YEAR] = parseInt(input, 10); + }); // HELPERS @@ -28731,124 +28616,66 @@ module.exports=require(53) return isLeapYear(this.year()); } - addFormatToken('w', ['ww', 2], 'wo', 'week'); - addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + // start-of-first-week - start-of-year + function firstWeekOffset(year, dow, doy) { + var // first-week day -- which january is always in the first week (4 for iso, 1 for other) + fwd = 7 + dow - doy, + // first-week day local weekday -- which local weekday is fwd + fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; - // ALIASES - - addUnitAlias('week', 'w'); - addUnitAlias('isoWeek', 'W'); - - // PARSING - - addRegexToken('w', match1to2); - addRegexToken('ww', match1to2, match2); - addRegexToken('W', match1to2); - addRegexToken('WW', match1to2, match2); - - addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { - week[token.substr(0, 1)] = toInt(input); - }); - - // HELPERS - - // firstDayOfWeek 0 = sun, 6 = sat - // the day of the week that starts the week - // (usually sunday or monday) - // firstDayOfWeekOfYear 0 = sun, 6 = sat - // the first week is the week that contains the first - // of this day of the week - // (eg. ISO weeks use thursday (4)) - function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { - var end = firstDayOfWeekOfYear - firstDayOfWeek, - daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), - adjustedMoment; - - - if (daysToDayOfWeek > end) { - daysToDayOfWeek -= 7; - } - - if (daysToDayOfWeek < end - 7) { - daysToDayOfWeek += 7; - } - - adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd'); - return { - week: Math.ceil(adjustedMoment.dayOfYear() / 7), - year: adjustedMoment.year() - }; + return -fwdlw + fwd - 1; } - // LOCALES - - function localeWeek (mom) { - return weekOfYear(mom, this._week.dow, this._week.doy).week; - } - - var defaultLocaleWeek = { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - }; - - function localeFirstDayOfWeek () { - return this._week.dow; - } - - function localeFirstDayOfYear () { - return this._week.doy; - } - - // MOMENTS - - function getSetWeek (input) { - var week = this.localeData().week(this); - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - function getSetISOWeek (input) { - var week = weekOfYear(this, 1, 4).week; - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); - - // ALIASES - - addUnitAlias('dayOfYear', 'DDD'); - - // PARSING - - addRegexToken('DDD', match1to3); - addRegexToken('DDDD', match3); - addParseToken(['DDD', 'DDDD'], function (input, array, config) { - config._dayOfYear = toInt(input); - }); - - // HELPERS - //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { - var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear; - if (d < firstDayOfWeek) { - d += 7; + function dayOfYearFromWeeks(year, week, weekday, dow, doy) { + var localWeekday = (7 + weekday - dow) % 7, + weekOffset = firstWeekOffset(year, dow, doy), + dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, + resYear, resDayOfYear; + + if (dayOfYear <= 0) { + resYear = year - 1; + resDayOfYear = daysInYear(resYear) + dayOfYear; + } else if (dayOfYear > daysInYear(year)) { + resYear = year + 1; + resDayOfYear = dayOfYear - daysInYear(year); + } else { + resYear = year; + resDayOfYear = dayOfYear; } - weekday = weekday != null ? 1 * weekday : firstDayOfWeek; - - dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday; - return { - year: dayOfYear > 0 ? year : year - 1, - dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear + year: resYear, + dayOfYear: resDayOfYear }; } - // MOMENTS + function weekOfYear(mom, dow, doy) { + var weekOffset = firstWeekOffset(mom.year(), dow, doy), + week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, + resWeek, resYear; - function getSetDayOfYear (input) { - var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; - return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + if (week < 1) { + resYear = mom.year() - 1; + resWeek = week + weeksInYear(resYear, dow, doy); + } else if (week > weeksInYear(mom.year(), dow, doy)) { + resWeek = week - weeksInYear(mom.year(), dow, doy); + resYear = mom.year() + 1; + } else { + resYear = mom.year(); + resWeek = week; + } + + return { + week: resWeek, + year: resYear + }; + } + + function weeksInYear(year, dow, doy) { + var weekOffset = firstWeekOffset(year, dow, doy), + weekOffsetNext = firstWeekOffset(year + 1, dow, doy); + return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; } // Pick the first defined of two or three arguments. @@ -28863,11 +28690,12 @@ module.exports=require(53) } function currentDateArray(config) { - var now = new Date(); + // hooks is actually the exported moment object + var nowValue = new Date(utils_hooks__hooks.now()); if (config._useUTC) { - return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()]; + return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; } - return [now.getFullYear(), now.getMonth(), now.getDate()]; + return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; } // convert an array to a date. @@ -28937,7 +28765,7 @@ module.exports=require(53) } function dayOfYearFromWeekInfo(config) { - var w, weekYear, week, weekday, dow, doy, temp; + var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; w = config._w; if (w.GG != null || w.W != null || w.E != null) { @@ -28951,6 +28779,9 @@ module.exports=require(53) weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year); week = defaults(w.W, 1); weekday = defaults(w.E, 1); + if (weekday < 1 || weekday > 7) { + weekdayOverflow = true; + } } else { dow = config._locale._week.dow; doy = config._locale._week.doy; @@ -28961,23 +28792,32 @@ module.exports=require(53) if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; - if (weekday < dow) { - ++week; + if (weekday < 0 || weekday > 6) { + weekdayOverflow = true; } } else if (w.e != null) { // local weekday -- counting starts from begining of week weekday = w.e + dow; + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; + } } else { // default to begining of week weekday = dow; } } - temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow); - - config._a[YEAR] = temp.year; - config._dayOfYear = temp.dayOfYear; + if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { + getParsingFlags(config)._overflowWeeks = true; + } else if (weekdayOverflow != null) { + getParsingFlags(config)._overflowWeekday = true; + } else { + temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); + config._a[YEAR] = temp.year; + config._dayOfYear = temp.dayOfYear; + } } + // constant that refers to the ISO standard utils_hooks__hooks.ISO_8601 = function () {}; // date from string and format string @@ -29002,6 +28842,8 @@ module.exports=require(53) for (i = 0; i < tokens.length; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; + // console.log('token', token, 'parsedInput', parsedInput, + // 'regex', getParseRegexForToken(token, config)); if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { @@ -29070,6 +28912,7 @@ module.exports=require(53) } } + // date from string and array of format strings function configFromStringAndArray(config) { var tempConfig, bestMoment, @@ -29120,7 +28963,9 @@ module.exports=require(53) } var i = normalizeObjectUnits(config._i); - config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond]; + config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { + return obj && parseInt(obj, 10); + }); configFromArray(config); } @@ -29162,13 +29007,17 @@ module.exports=require(53) configFromInput(config); } + if (!valid__isValid(config)) { + config._d = null; + } + return config; } function configFromInput(config) { var input = config._i; if (input === undefined) { - config._d = new Date(); + config._d = new Date(utils_hooks__hooks.now()); } else if (isDate(input)) { config._d = new Date(+input); } else if (typeof input === 'string') { @@ -29212,18 +29061,26 @@ module.exports=require(53) } var prototypeMin = deprecate( - 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', + 'moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); - return other < this ? this : other; + if (this.isValid() && other.isValid()) { + return other < this ? this : other; + } else { + return valid__createInvalid(); + } } ); var prototypeMax = deprecate( - 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', + 'moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); - return other > this ? this : other; + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return valid__createInvalid(); + } } ); @@ -29262,6 +29119,10 @@ module.exports=require(53) return pickBy('isAfter', args); } + var now = function () { + return Date.now ? Date.now() : +(new Date()); + }; + function Duration (duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, @@ -29301,6 +29162,8 @@ module.exports=require(53) return obj instanceof Duration; } + // FORMATTING + function offset (token, separator) { addFormatToken(token, 0, 0, function () { var offset = this.utcOffset(); @@ -29318,11 +29181,11 @@ module.exports=require(53) // PARSING - addRegexToken('Z', matchOffset); - addRegexToken('ZZ', matchOffset); + addRegexToken('Z', matchShortOffset); + addRegexToken('ZZ', matchShortOffset); addParseToken(['Z', 'ZZ'], function (input, array, config) { config._useUTC = true; - config._tzm = offsetFromString(input); + config._tzm = offsetFromString(matchShortOffset, input); }); // HELPERS @@ -29332,8 +29195,8 @@ module.exports=require(53) // '-1530' > ['-15', '30'] var chunkOffset = /([\+\-]|\d\d)/gi; - function offsetFromString(string) { - var matches = ((string || '').match(matchOffset) || []); + function offsetFromString(matcher, string) { + var matches = ((string || '').match(matcher) || []); var chunk = matches[matches.length - 1] || []; var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; var minutes = +(parts[1] * 60) + toInt(parts[2]); @@ -29383,11 +29246,13 @@ module.exports=require(53) function getSetOffset (input, keepLocalTime) { var offset = this._offset || 0, localAdjust; + if (!this.isValid()) { + return input != null ? this : NaN; + } if (input != null) { if (typeof input === 'string') { - input = offsetFromString(input); - } - if (Math.abs(input) < 16) { + input = offsetFromString(matchShortOffset, input); + } else if (Math.abs(input) < 16) { input = input * 60; } if (!this._isUTC && keepLocalTime) { @@ -29447,12 +29312,15 @@ module.exports=require(53) if (this._tzm) { this.utcOffset(this._tzm); } else if (typeof this._i === 'string') { - this.utcOffset(offsetFromString(this._i)); + this.utcOffset(offsetFromString(matchOffset, this._i)); } return this; } function hasAlignedHourOffset (input) { + if (!this.isValid()) { + return false; + } input = input ? local__createLocal(input).utcOffset() : 0; return (this.utcOffset() - input) % 60 === 0; @@ -29466,7 +29334,7 @@ module.exports=require(53) } function isDaylightSavingTimeShifted () { - if (typeof this._isDSTShifted !== 'undefined') { + if (!isUndefined(this._isDSTShifted)) { return this._isDSTShifted; } @@ -29487,22 +29355,24 @@ module.exports=require(53) } function isLocal () { - return !this._isUTC; + return this.isValid() ? !this._isUTC : false; } function isUtcOffset () { - return this._isUTC; + return this.isValid() ? this._isUTC : false; } function isUtc () { - return this._isUTC && this._offset === 0; + return this.isValid() ? this._isUTC && this._offset === 0 : false; } - var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; + // ASP.NET json date format regex + var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/; // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere - var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; + // and further modified to allow for strings containing both week and day + var isoRegex = /^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/; function create__createDuration (input, key) { var duration = input, @@ -29535,16 +29405,16 @@ module.exports=require(53) s : toInt(match[SECOND]) * sign, ms : toInt(match[MILLISECOND]) * sign }; - } else if (!!(match = create__isoRegex.exec(input))) { + } else if (!!(match = isoRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; duration = { y : parseIso(match[2], sign), M : parseIso(match[3], sign), - d : parseIso(match[4], sign), - h : parseIso(match[5], sign), - m : parseIso(match[6], sign), - s : parseIso(match[7], sign), - w : parseIso(match[8], sign) + w : parseIso(match[4], sign), + d : parseIso(match[5], sign), + h : parseIso(match[6], sign), + m : parseIso(match[7], sign), + s : parseIso(match[8], sign) }; } else if (duration == null) {// checks for null or undefined duration = {}; @@ -29592,6 +29462,10 @@ module.exports=require(53) function momentsDifference(base, other) { var res; + if (!(base.isValid() && other.isValid())) { + return {milliseconds: 0, months: 0}; + } + other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); @@ -29604,6 +29478,15 @@ module.exports=require(53) return res; } + function absRound (number) { + if (number < 0) { + return Math.round(-1 * number) * -1; + } else { + return Math.round(number); + } + } + + // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { var dur, tmp; @@ -29622,8 +29505,14 @@ module.exports=require(53) function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, - days = duration._days, - months = duration._months; + days = absRound(duration._days), + months = absRound(duration._months); + + if (!mom.isValid()) { + // No op + return; + } + updateOffset = updateOffset == null ? true : updateOffset; if (milliseconds) { @@ -29655,7 +29544,10 @@ module.exports=require(53) diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; - return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now))); + + var output = formats && (isFunction(formats[format]) ? formats[format]() : formats[format]); + + return this.format(output || this.localeData().calendar(format, this, local__createLocal(now))); } function clone () { @@ -29663,26 +29555,28 @@ module.exports=require(53) } function isAfter (input, units) { - var inputMs; - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this > +input; + return +this > +localInput; } else { - inputMs = isMoment(input) ? +input : +local__createLocal(input); - return inputMs < +this.clone().startOf(units); + return +localInput < +this.clone().startOf(units); } } function isBefore (input, units) { - var inputMs; - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this < +input; + return +this < +localInput; } else { - inputMs = isMoment(input) ? +input : +local__createLocal(input); - return +this.clone().endOf(units) < inputMs; + return +this.clone().endOf(units) < +localInput; } } @@ -29691,22 +29585,45 @@ module.exports=require(53) } function isSame (input, units) { - var inputMs; + var localInput = isMoment(input) ? input : local__createLocal(input), + inputMs; + if (!(this.isValid() && localInput.isValid())) { + return false; + } units = normalizeUnits(units || 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this === +input; + return +this === +localInput; } else { - inputMs = +local__createLocal(input); + inputMs = +localInput; return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units)); } } + function isSameOrAfter (input, units) { + return this.isSame(input, units) || this.isAfter(input,units); + } + + function isSameOrBefore (input, units) { + return this.isSame(input, units) || this.isBefore(input,units); + } + function diff (input, units, asFloat) { - var that = cloneWithOffset(input, this), - zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4, + var that, + zoneDelta, delta, output; + if (!this.isValid()) { + return NaN; + } + + that = cloneWithOffset(input, this); + + if (!that.isValid()) { + return NaN; + } + + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + units = normalizeUnits(units); if (units === 'year' || units === 'month' || units === 'quarter') { @@ -29757,7 +29674,7 @@ module.exports=require(53) function moment_format__toISOString () { var m = this.clone().utc(); if (0 < m.year() && m.year() <= 9999) { - if ('function' === typeof Date.prototype.toISOString) { + if (isFunction(Date.prototype.toISOString)) { // native implementation is ~50x faster, use it when we can return this.toDate().toISOString(); } else { @@ -29774,10 +29691,13 @@ module.exports=require(53) } function from (time, withoutSuffix) { - if (!this.isValid()) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { return this.localeData().invalidDate(); } - return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); } function fromNow (withoutSuffix) { @@ -29785,16 +29705,22 @@ module.exports=require(53) } function to (time, withoutSuffix) { - if (!this.isValid()) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { return this.localeData().invalidDate(); } - return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); } function toNow (withoutSuffix) { return this.to(local__createLocal(), withoutSuffix); } + // If passed a locale key, it will set the locale for this + // instance. Otherwise, it will return the locale configuration + // variables for this instance. function locale (key) { var newLocaleData; @@ -29905,6 +29831,11 @@ module.exports=require(53) }; } + function toJSON () { + // new Date(NaN).toJSON() === null + return this.isValid() ? this.toISOString() : null; + } + function moment_valid__isValid () { return valid__isValid(this); } @@ -29917,6 +29848,18 @@ module.exports=require(53) return getParsingFlags(this).overflow; } + function creationData() { + return { + input: this._i, + format: this._f, + locale: this._locale, + isUTC: this._isUTC, + strict: this._strict + }; + } + + // FORMATTING + addFormatToken(0, ['gg', 2], 0, function () { return this.weekYear() % 100; }); @@ -29958,22 +29901,20 @@ module.exports=require(53) week[token] = utils_hooks__hooks.parseTwoDigitYear(input); }); - // HELPERS - - function weeksInYear(year, dow, doy) { - return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week; - } - // MOMENTS function getSetWeekYear (input) { - var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; - return input == null ? year : this.add((input - year), 'y'); + return getSetWeekYearHelper.call(this, + input, + this.week(), + this.weekday(), + this.localeData()._week.dow, + this.localeData()._week.doy); } function getSetISOWeekYear (input) { - var year = weekOfYear(this, 1, 4).year; - return input == null ? year : this.add((input - year), 'y'); + return getSetWeekYearHelper.call(this, + input, this.isoWeek(), this.isoWeekday(), 1, 4); } function getISOWeeksInYear () { @@ -29985,7 +29926,32 @@ module.exports=require(53) return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } - addFormatToken('Q', 0, 0, 'quarter'); + function getSetWeekYearHelper(input, week, weekday, dow, doy) { + var weeksTarget; + if (input == null) { + return weekOfYear(this, dow, doy).year; + } else { + weeksTarget = weeksInYear(input, dow, doy); + if (week > weeksTarget) { + week = weeksTarget; + } + return setWeekAll.call(this, input, week, weekday, dow, doy); + } + } + + function setWeekAll(weekYear, week, weekday, dow, doy) { + var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), + date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); + + this.year(date.getUTCFullYear()); + this.month(date.getUTCMonth()); + this.date(date.getUTCDate()); + return this; + } + + // FORMATTING + + addFormatToken('Q', 0, 'Qo', 'quarter'); // ALIASES @@ -30004,6 +29970,62 @@ module.exports=require(53) return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); } + // FORMATTING + + addFormatToken('w', ['ww', 2], 'wo', 'week'); + addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + + // ALIASES + + addUnitAlias('week', 'w'); + addUnitAlias('isoWeek', 'W'); + + // PARSING + + addRegexToken('w', match1to2); + addRegexToken('ww', match1to2, match2); + addRegexToken('W', match1to2); + addRegexToken('WW', match1to2, match2); + + addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { + week[token.substr(0, 1)] = toInt(input); + }); + + // HELPERS + + // LOCALES + + function localeWeek (mom) { + return weekOfYear(mom, this._week.dow, this._week.doy).week; + } + + var defaultLocaleWeek = { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. + }; + + function localeFirstDayOfWeek () { + return this._week.dow; + } + + function localeFirstDayOfYear () { + return this._week.doy; + } + + // MOMENTS + + function getSetWeek (input) { + var week = this.localeData().week(this); + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + function getSetISOWeek (input) { + var week = weekOfYear(this, 1, 4).week; + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + // FORMATTING + addFormatToken('D', ['DD', 2], 'Do', 'date'); // ALIASES @@ -30027,6 +30049,8 @@ module.exports=require(53) var getSetDayOfMonth = makeGetSet('Date', true); + // FORMATTING + addFormatToken('d', 0, 'do', 'day'); addFormatToken('dd', 0, 0, function (format) { @@ -30059,8 +30083,8 @@ module.exports=require(53) addRegexToken('ddd', matchWord); addRegexToken('dddd', matchWord); - addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) { - var weekday = config._locale.weekdaysParse(input); + addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { + var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid if (weekday != null) { week.d = weekday; @@ -30095,8 +30119,9 @@ module.exports=require(53) // LOCALES var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); - function localeWeekdays (m) { - return this._weekdays[m.day()]; + function localeWeekdays (m, format) { + return isArray(this._weekdays) ? this._weekdays[m.day()] : + this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()]; } var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); @@ -30109,20 +30134,37 @@ module.exports=require(53) return this._weekdaysMin[m.day()]; } - function localeWeekdaysParse (weekdayName) { + function localeWeekdaysParse (weekdayName, format, strict) { var i, mom, regex; - this._weekdaysParse = this._weekdaysParse || []; + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._minWeekdaysParse = []; + this._shortWeekdaysParse = []; + this._fullWeekdaysParse = []; + } for (i = 0; i < 7; i++) { // make the regex if we don't have it already + + mom = local__createLocal([2000, 1]).day(i); + if (strict && !this._fullWeekdaysParse[i]) { + this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); + this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); + this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i'); + } if (!this._weekdaysParse[i]) { - mom = local__createLocal([2000, 1]).day(i); regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex - if (this._weekdaysParse[i].test(weekdayName)) { + if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { return i; } } @@ -30131,6 +30173,9 @@ module.exports=require(53) // MOMENTS function getSetDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); if (input != null) { input = parseWeekday(input, this.localeData()); @@ -30141,20 +30186,73 @@ module.exports=require(53) } function getSetLocaleDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); } function getSetISODayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); } - addFormatToken('H', ['HH', 2], 0, 'hour'); - addFormatToken('h', ['hh', 2], 0, function () { + // FORMATTING + + addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); + + // ALIASES + + addUnitAlias('dayOfYear', 'DDD'); + + // PARSING + + addRegexToken('DDD', match1to3); + addRegexToken('DDDD', match3); + addParseToken(['DDD', 'DDDD'], function (input, array, config) { + config._dayOfYear = toInt(input); + }); + + // HELPERS + + // MOMENTS + + function getSetDayOfYear (input) { + var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; + return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + } + + // FORMATTING + + function hFormat() { return this.hours() % 12 || 12; + } + + addFormatToken('H', ['HH', 2], 0, 'hour'); + addFormatToken('h', ['hh', 2], 0, hFormat); + + addFormatToken('hmm', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); + }); + + addFormatToken('hmmss', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); + }); + + addFormatToken('Hmm', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2); + }); + + addFormatToken('Hmmss', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); }); function meridiem (token, lowercase) { @@ -30183,6 +30281,11 @@ module.exports=require(53) addRegexToken('HH', match1to2, match2); addRegexToken('hh', match1to2, match2); + addRegexToken('hmm', match3to4); + addRegexToken('hmmss', match5to6); + addRegexToken('Hmm', match3to4); + addRegexToken('Hmmss', match5to6); + addParseToken(['H', 'HH'], HOUR); addParseToken(['a', 'A'], function (input, array, config) { config._isPm = config._locale.isPM(input); @@ -30192,6 +30295,32 @@ module.exports=require(53) array[HOUR] = toInt(input); getParsingFlags(config).bigHour = true; }); + addParseToken('hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('Hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + }); + addParseToken('Hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + }); // LOCALES @@ -30219,6 +30348,8 @@ module.exports=require(53) // this rule. var getSetHour = makeGetSet('Hours', true); + // FORMATTING + addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES @@ -30235,6 +30366,8 @@ module.exports=require(53) var getSetMinute = makeGetSet('Minutes', false); + // FORMATTING + addFormatToken('s', ['ss', 2], 0, 'second'); // ALIASES @@ -30251,6 +30384,8 @@ module.exports=require(53) var getSetSecond = makeGetSet('Seconds', false); + // FORMATTING + addFormatToken('S', 0, 0, function () { return ~~(this.millisecond() / 100); }); @@ -30306,6 +30441,8 @@ module.exports=require(53) var getSetMillisecond = makeGetSet('Milliseconds', false); + // FORMATTING + addFormatToken('z', 0, 0, 'zoneAbbr'); addFormatToken('zz', 0, 0, 'zoneName'); @@ -30321,40 +30458,43 @@ module.exports=require(53) var momentPrototype__proto = Moment.prototype; - momentPrototype__proto.add = add_subtract__add; - momentPrototype__proto.calendar = moment_calendar__calendar; - momentPrototype__proto.clone = clone; - momentPrototype__proto.diff = diff; - momentPrototype__proto.endOf = endOf; - momentPrototype__proto.format = format; - momentPrototype__proto.from = from; - momentPrototype__proto.fromNow = fromNow; - momentPrototype__proto.to = to; - momentPrototype__proto.toNow = toNow; - momentPrototype__proto.get = getSet; - momentPrototype__proto.invalidAt = invalidAt; - momentPrototype__proto.isAfter = isAfter; - momentPrototype__proto.isBefore = isBefore; - momentPrototype__proto.isBetween = isBetween; - momentPrototype__proto.isSame = isSame; - momentPrototype__proto.isValid = moment_valid__isValid; - momentPrototype__proto.lang = lang; - momentPrototype__proto.locale = locale; - momentPrototype__proto.localeData = localeData; - momentPrototype__proto.max = prototypeMax; - momentPrototype__proto.min = prototypeMin; - momentPrototype__proto.parsingFlags = parsingFlags; - momentPrototype__proto.set = getSet; - momentPrototype__proto.startOf = startOf; - momentPrototype__proto.subtract = add_subtract__subtract; - momentPrototype__proto.toArray = toArray; - momentPrototype__proto.toObject = toObject; - momentPrototype__proto.toDate = toDate; - momentPrototype__proto.toISOString = moment_format__toISOString; - momentPrototype__proto.toJSON = moment_format__toISOString; - momentPrototype__proto.toString = toString; - momentPrototype__proto.unix = unix; - momentPrototype__proto.valueOf = to_type__valueOf; + momentPrototype__proto.add = add_subtract__add; + momentPrototype__proto.calendar = moment_calendar__calendar; + momentPrototype__proto.clone = clone; + momentPrototype__proto.diff = diff; + momentPrototype__proto.endOf = endOf; + momentPrototype__proto.format = format; + momentPrototype__proto.from = from; + momentPrototype__proto.fromNow = fromNow; + momentPrototype__proto.to = to; + momentPrototype__proto.toNow = toNow; + momentPrototype__proto.get = getSet; + momentPrototype__proto.invalidAt = invalidAt; + momentPrototype__proto.isAfter = isAfter; + momentPrototype__proto.isBefore = isBefore; + momentPrototype__proto.isBetween = isBetween; + momentPrototype__proto.isSame = isSame; + momentPrototype__proto.isSameOrAfter = isSameOrAfter; + momentPrototype__proto.isSameOrBefore = isSameOrBefore; + momentPrototype__proto.isValid = moment_valid__isValid; + momentPrototype__proto.lang = lang; + momentPrototype__proto.locale = locale; + momentPrototype__proto.localeData = localeData; + momentPrototype__proto.max = prototypeMax; + momentPrototype__proto.min = prototypeMin; + momentPrototype__proto.parsingFlags = parsingFlags; + momentPrototype__proto.set = getSet; + momentPrototype__proto.startOf = startOf; + momentPrototype__proto.subtract = add_subtract__subtract; + momentPrototype__proto.toArray = toArray; + momentPrototype__proto.toObject = toObject; + momentPrototype__proto.toDate = toDate; + momentPrototype__proto.toISOString = moment_format__toISOString; + momentPrototype__proto.toJSON = toJSON; + momentPrototype__proto.toString = toString; + momentPrototype__proto.unix = unix; + momentPrototype__proto.valueOf = to_type__valueOf; + momentPrototype__proto.creationData = creationData; // Year momentPrototype__proto.year = getSetYear; @@ -30440,7 +30580,7 @@ module.exports=require(53) function locale_calendar__calendar (key, mom, now) { var output = this._calendar[key]; - return typeof output === 'function' ? output.call(mom, now) : output; + return isFunction(output) ? output.call(mom, now) : output; } var defaultLongDateFormat = { @@ -30502,29 +30642,14 @@ module.exports=require(53) function relative__relativeTime (number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; - return (typeof output === 'function') ? + return (isFunction(output)) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } function pastFuture (diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); - } - - function locale_set__set (config) { - var prop, i; - for (i in config) { - prop = config[i]; - if (typeof prop === 'function') { - this[i] = prop; - } else { - this['_' + i] = prop; - } - } - // Lenient ordinal parsing accepts just a number in addition to - // number + (possibly) stuff coming from _ordinalParseLenient. - this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source); + return isFunction(format) ? format(output) : format.replace(/%s/i, output); } var prototype__proto = Locale.prototype; @@ -30546,11 +30671,15 @@ module.exports=require(53) prototype__proto.set = locale_set__set; // Month - prototype__proto.months = localeMonths; - prototype__proto._months = defaultLocaleMonths; - prototype__proto.monthsShort = localeMonthsShort; - prototype__proto._monthsShort = defaultLocaleMonthsShort; - prototype__proto.monthsParse = localeMonthsParse; + prototype__proto.months = localeMonths; + prototype__proto._months = defaultLocaleMonths; + prototype__proto.monthsShort = localeMonthsShort; + prototype__proto._monthsShort = defaultLocaleMonthsShort; + prototype__proto.monthsParse = localeMonthsParse; + prototype__proto._monthsRegex = defaultMonthsRegex; + prototype__proto.monthsRegex = monthsRegex; + prototype__proto._monthsShortRegex = defaultMonthsShortRegex; + prototype__proto.monthsShortRegex = monthsShortRegex; // Week prototype__proto.week = localeWeek; @@ -30838,15 +30967,15 @@ module.exports=require(53) var years = round(duration.as('y')); var a = seconds < thresholds.s && ['s', seconds] || - minutes === 1 && ['m'] || + minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || - hours === 1 && ['h'] || + hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || - days === 1 && ['d'] || + days <= 1 && ['d'] || days < thresholds.d && ['dd', days] || - months === 1 && ['M'] || + months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || - years === 1 && ['y'] || ['yy', years]; + years <= 1 && ['y'] || ['yy', years]; a[2] = withoutSuffix; a[3] = +posNegDuration > 0; @@ -30967,6 +31096,8 @@ module.exports=require(53) // Side effect imports + // FORMATTING + addFormatToken('X', 0, 0, 'unix'); addFormatToken('x', 0, 0, 'valueOf'); @@ -30984,13 +31115,14 @@ module.exports=require(53) // Side effect imports - utils_hooks__hooks.version = '2.10.6'; + utils_hooks__hooks.version = '2.12.0'; setHookCallback(local__createLocal); utils_hooks__hooks.fn = momentPrototype; utils_hooks__hooks.min = min; utils_hooks__hooks.max = max; + utils_hooks__hooks.now = now; utils_hooks__hooks.utc = create_utc__createUTC; utils_hooks__hooks.unix = moment__createUnix; utils_hooks__hooks.months = lists__listMonths; @@ -31006,16 +31138,335 @@ module.exports=require(53) utils_hooks__hooks.monthsShort = lists__listMonthsShort; utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin; utils_hooks__hooks.defineLocale = defineLocale; + utils_hooks__hooks.updateLocale = updateLocale; + utils_hooks__hooks.locales = locale_locales__listLocales; utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort; utils_hooks__hooks.normalizeUnits = normalizeUnits; utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold; + utils_hooks__hooks.prototype = momentPrototype; var _moment = utils_hooks__hooks; return _moment; })); -},{}],107:[function(require,module,exports){ +},{}],84:[function(require,module,exports){ +(function (process){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// resolves . and .. elements in a path array with directory names there +// must be no slashes, empty elements, or device names (c:\) in the array +// (so also no leading and trailing slashes - it does not distinguish +// relative and absolute paths) +function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + + return parts; +} + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var splitPath = function(filename) { + return splitPathRe.exec(filename).slice(1); +}; + +// path.resolve([from ...], to) +// posix version +exports.resolve = function() { + var resolvedPath = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) ? arguments[i] : process.cwd(); + + // Skip empty and invalid entries + if (typeof path !== 'string') { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { + return !!p; + }), !resolvedAbsolute).join('/'); + + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; +}; + +// path.normalize(path) +// posix version +exports.normalize = function(path) { + var isAbsolute = exports.isAbsolute(path), + trailingSlash = substr(path, -1) === '/'; + + // Normalize the path + path = normalizeArray(filter(path.split('/'), function(p) { + return !!p; + }), !isAbsolute).join('/'); + + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + + return (isAbsolute ? '/' : '') + path; +}; + +// posix version +exports.isAbsolute = function(path) { + return path.charAt(0) === '/'; +}; + +// posix version +exports.join = function() { + var paths = Array.prototype.slice.call(arguments, 0); + return exports.normalize(filter(paths, function(p, index) { + if (typeof p !== 'string') { + throw new TypeError('Arguments to path.join must be strings'); + } + return p; + }).join('/')); +}; + + +// path.relative(from, to) +// posix version +exports.relative = function(from, to) { + from = exports.resolve(from).substr(1); + to = exports.resolve(to).substr(1); + + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('/'); +}; + +exports.sep = '/'; +exports.delimiter = ':'; + +exports.dirname = function(path) { + var result = splitPath(path), + root = result[0], + dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; +}; + + +exports.basename = function(path, ext) { + var f = splitPath(path)[2]; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +}; + + +exports.extname = function(path) { + return splitPath(path)[3]; +}; + +function filter (xs, f) { + if (xs.filter) return xs.filter(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + if (f(xs[i], i, xs)) res.push(xs[i]); + } + return res; +} + +// String.prototype.substr - negative index don't work in IE8 +var substr = 'ab'.substr(-1) === 'b' + ? function (str, start, len) { return str.substr(start, len) } + : function (str, start, len) { + if (start < 0) start = str.length + start; + return str.substr(start, len); + } +; + +}).call(this,require('_process')) +},{"_process":85}],85:[function(require,module,exports){ +// shim for using process in browser + +var process = module.exports = {}; + +process.nextTick = (function () { + var canSetImmediate = typeof window !== 'undefined' + && window.setImmediate; + var canMutationObserver = typeof window !== 'undefined' + && window.MutationObserver; + var canPost = typeof window !== 'undefined' + && window.postMessage && window.addEventListener + ; + + if (canSetImmediate) { + return function (f) { return window.setImmediate(f) }; + } + + var queue = []; + + if (canMutationObserver) { + var hiddenDiv = document.createElement("div"); + var observer = new MutationObserver(function () { + var queueList = queue.slice(); + queue.length = 0; + queueList.forEach(function (fn) { + fn(); + }); + }); + + observer.observe(hiddenDiv, { attributes: true }); + + return function nextTick(fn) { + if (!queue.length) { + hiddenDiv.setAttribute('yes', 'no'); + } + queue.push(fn); + }; + } + + if (canPost) { + window.addEventListener('message', function (ev) { + var source = ev.source; + if ((source === window || source === null) && ev.data === 'process-tick') { + ev.stopPropagation(); + if (queue.length > 0) { + var fn = queue.shift(); + fn(); + } + } + }, true); + + return function nextTick(fn) { + queue.push(fn); + window.postMessage('process-tick', '*'); + }; + } + + return function nextTick(fn) { + setTimeout(fn, 0); + }; +})(); + +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +// TODO(shtylman) +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; + +},{}],86:[function(require,module,exports){ module.exports={ "name": "mermaid", "version": "0.5.8", @@ -31125,7 +31576,7 @@ module.exports={ "marked": "^0.3.2", "mock-browser": "^0.91.34", "path": "^0.4.9", - "phantomjs": "^1.9.18", + "phantomjs": "^2.1.3", "proxyquire": "^1.7.3", "proxyquire-universal": "^1.0.8", "proxyquireify": "^3.0.0", @@ -31140,7 +31591,7 @@ module.exports={ } } -},{}],108:[function(require,module,exports){ +},{}],87:[function(require,module,exports){ /* global window */ //log.debug('Setting up d3'); 'use strict'; @@ -31611,7 +32062,7 @@ module.exports = d3; })(); /* jshint ignore:end */ -},{"d3":4}],109:[function(require,module,exports){ +},{"d3":2}],88:[function(require,module,exports){ 'use strict'; var Logger = require('../../logger'); @@ -31698,7 +32149,7 @@ exports.relationType = { DEPENDENCY: 3 }; -},{"../../logger":127}],110:[function(require,module,exports){ +},{"../../logger":106}],89:[function(require,module,exports){ /** * Created by knut on 14-11-23. */ @@ -32007,7 +32458,7 @@ module.exports.draw = function (text, id) { //diagram.attr('viewBox', (box.startx-conf.diagramMarginX) + ' -' +conf.diagramMarginY + ' ' + width + ' ' + height); }; -},{"../../d3":108,"../../logger":127,"./classDb":109,"./parser/classDiagram":111,"dagre":54}],111:[function(require,module,exports){ +},{"../../d3":87,"../../logger":106,"./classDb":88,"./parser/classDiagram":90,"dagre":31}],90:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -32809,7 +33260,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],112:[function(require,module,exports){ +},{"_process":85,"fs":1,"path":84}],91:[function(require,module,exports){ (function (global){ /** * Created by knut on 15-01-14. @@ -32844,7 +33295,7 @@ exports.parseError = function (err, hash) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../logger":127}],113:[function(require,module,exports){ +},{"../../logger":106}],92:[function(require,module,exports){ /** * Created by knut on 14-12-11. */ @@ -32879,7 +33330,7 @@ exports.draw = function (txt, id, ver) { /* var box = exports.bounds.getBounds(); - var height = box.stopy-box.starty+2*conf.diagramMarginY; + var height = box.stopy-box.starty+2*conf.diagramMarginY; var width = box.stopx-box.startx+2*conf.diagramMarginX;*/ svg.attr('height', 100); @@ -32887,7 +33338,7 @@ exports.draw = function (txt, id, ver) { //svg.attr('viewBox', '0 0 300 150'); }; -},{"../../d3":108,"../../logger":127,"./exampleDb":112,"./parser/example.js":114}],114:[function(require,module,exports){ +},{"../../d3":87,"../../logger":106,"./exampleDb":91,"./parser/example.js":93}],93:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -33533,7 +33984,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],115:[function(require,module,exports){ +},{"_process":85,"fs":1,"path":84}],94:[function(require,module,exports){ /* global window */ 'use strict'; @@ -33557,7 +34008,7 @@ if (!dagreD3) { module.exports = dagreD3; -},{"../../logger":127,"dagre-d3":5}],116:[function(require,module,exports){ +},{"../../logger":106,"dagre-d3":3}],95:[function(require,module,exports){ /** * Created by knut on 14-12-11. */ @@ -34030,7 +34481,7 @@ exports.draw = function (text, id, isDot) { } }; -},{"../../d3":108,"../../logger":127,"./dagre-d3":115,"./graphDb":117,"./parser/dot":118,"./parser/flow":119}],117:[function(require,module,exports){ +},{"../../d3":87,"../../logger":106,"./dagre-d3":94,"./graphDb":96,"./parser/dot":97,"./parser/flow":98}],96:[function(require,module,exports){ (function (global){ /** * Created by knut on 14-11-03. @@ -34419,7 +34870,7 @@ exports.parseError = function (err, hash) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../d3":108,"../../logger":127}],118:[function(require,module,exports){ +},{"../../d3":87,"../../logger":106}],97:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -35250,7 +35701,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],119:[function(require,module,exports){ +},{"_process":85,"fs":1,"path":84}],98:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -36360,7 +36811,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],120:[function(require,module,exports){ +},{"_process":85,"fs":1,"path":84}],99:[function(require,module,exports){ (function (global){ /** * Created by knut on 15-01-14. @@ -36747,7 +37198,7 @@ exports.parseError = function (err, hash) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../logger":127,"moment":106}],121:[function(require,module,exports){ +},{"../../logger":106,"moment":83}],100:[function(require,module,exports){ 'use strict'; var gantt = require('./parser/gantt').parser; @@ -37101,7 +37552,7 @@ module.exports.draw = function (text, id) { } }; -},{"../../d3":108,"./ganttDb":120,"./parser/gantt":122,"moment":106}],122:[function(require,module,exports){ +},{"../../d3":87,"./ganttDb":99,"./parser/gantt":101,"moment":83}],101:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -37784,9 +38235,9 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],123:[function(require,module,exports){ +},{"_process":85,"fs":1,"path":84}],102:[function(require,module,exports){ (function (process){ -/* parser generated by jison 0.4.15 */ +/* parser generated by jison 0.4.17 */ /* Returns a Parser object of the following structure: @@ -37865,63 +38316,75 @@ var sequenceDiagram = (function () { var o = function o(k, v, _o, l) { for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v);return _o; }, - $V0 = [2, 2], - $V1 = [1, 5], - $V2 = [1, 7], - $V3 = [1, 8], - $V4 = [1, 11], - $V5 = [1, 12], - $V6 = [1, 13], + $V0 = [1, 2], + $V1 = [1, 3], + $V2 = [1, 4], + $V3 = [2, 4], + $V4 = [1, 9], + $V5 = [1, 11], + $V6 = [1, 12], $V7 = [1, 14], - $V8 = [1, 16], + $V8 = [1, 15], $V9 = [1, 17], - $Va = [1, 7, 9, 10, 16, 18, 19, 20, 21, 22, 23, 33], - $Vb = [7, 9, 10, 16, 18, 19, 20, 21, 23, 33], - $Vc = [1, 53]; + $Va = [1, 18], + $Vb = [1, 19], + $Vc = [1, 20], + $Vd = [1, 22], + $Ve = [1, 23], + $Vf = [1, 4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 24, 25, 37], + $Vg = [4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 25, 37], + $Vh = [35, 36, 37], + $Vi = [1, 67]; var parser = { trace: function trace() {}, yy: {}, - symbols_: { "error": 2, "start": 3, "SD": 4, "document": 5, "line": 6, "SPACE": 7, "statement": 8, "NL": 9, "participant": 10, "actor": 11, "AS": 12, "restOfLine": 13, "signal": 14, "note_statement": 15, "title": 16, "text": 17, "loop": 18, "end": 19, "opt": 20, "alt": 21, "else": 22, "note": 23, "placement": 24, "text2": 25, "over": 26, "actor_pair": 27, "spaceList": 28, ",": 29, "left_of": 30, "right_of": 31, "signaltype": 32, "ACTOR": 33, "SOLID_OPEN_ARROW": 34, "DOTTED_OPEN_ARROW": 35, "SOLID_ARROW": 36, "DOTTED_ARROW": 37, "SOLID_CROSS": 38, "DOTTED_CROSS": 39, "TXT": 40, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "SD", 7: "SPACE", 9: "NL", 10: "participant", 12: "AS", 13: "restOfLine", 16: "title", 17: "text", 18: "loop", 19: "end", 20: "opt", 21: "alt", 22: "else", 23: "note", 26: "over", 29: ",", 30: "left_of", 31: "right_of", 33: "ACTOR", 34: "SOLID_OPEN_ARROW", 35: "DOTTED_OPEN_ARROW", 36: "SOLID_ARROW", 37: "DOTTED_ARROW", 38: "SOLID_CROSS", 39: "DOTTED_CROSS", 40: "TXT" }, - productions_: [0, [3, 2], [5, 0], [5, 2], [6, 2], [6, 1], [6, 1], [8, 5], [8, 3], [8, 2], [8, 2], [8, 4], [8, 4], [8, 4], [8, 7], [15, 4], [15, 4], [28, 2], [28, 1], [27, 3], [27, 1], [24, 1], [24, 1], [14, 4], [11, 1], [32, 1], [32, 1], [32, 1], [32, 1], [32, 1], [32, 1], [25, 1]], + 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, "text": 19, "loop": 20, "end": 21, "opt": 22, "alt": 23, "else": 24, "note": 25, "placement": 26, "text2": 27, "over": 28, "actor_pair": 29, "spaceList": 30, ",": 31, "left_of": 32, "right_of": 33, "signaltype": 34, "+": 35, "-": 36, "ACTOR": 37, "SOLID_OPEN_ARROW": 38, "DOTTED_OPEN_ARROW": 39, "SOLID_ARROW": 40, "DOTTED_ARROW": 41, "SOLID_CROSS": 42, "DOTTED_CROSS": 43, "TXT": 44, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 4: "SPACE", 5: "NL", 6: "SD", 10: "participant", 12: "AS", 13: "restOfLine", 15: "activate", 16: "deactivate", 18: "title", 19: "text", 20: "loop", 21: "end", 22: "opt", 23: "alt", 24: "else", 25: "note", 28: "over", 31: ",", 32: "left_of", 33: "right_of", 35: "+", 36: "-", 37: "ACTOR", 38: "SOLID_OPEN_ARROW", 39: "DOTTED_OPEN_ARROW", 40: "SOLID_ARROW", 41: "DOTTED_ARROW", 42: "SOLID_CROSS", 43: "DOTTED_CROSS", 44: "TXT" }, + 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, 4], [9, 4], [9, 4], [9, 7], [17, 4], [17, 4], [30, 2], [30, 1], [29, 3], [29, 1], [26, 1], [26, 1], [14, 5], [14, 5], [14, 4], [11, 1], [34, 1], [34, 1], [34, 1], [34, 1], [34, 1], [34, 1], [27, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, /* action[1] */$$, /* vstack */_$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { - case 1: + case 3: yy.apply($$[$0]);return $$[$0]; break; - case 2: + case 4: this.$ = []; break; - case 3: + case 5: $$[$0 - 1].push($$[$0]);this.$ = $$[$0 - 1]; break; - case 4:case 5: + case 6:case 7: this.$ = $$[$0]; break; - case 6: + case 8: this.$ = []; break; - case 7: + case 9: $$[$0 - 3].description = $$[$0 - 1];this.$ = $$[$0 - 3]; break; - case 8: + case 10: this.$ = $$[$0 - 1]; break; case 12: + this.$ = { type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] }; + break; + case 13: + this.$ = { type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 1] }; + break; + case 16: $$[$0 - 1].unshift({ type: 'loopStart', loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_START }); $$[$0 - 1].push({ type: 'loopEnd', loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_END }); this.$ = $$[$0 - 1]; break; - case 13: + case 17: $$[$0 - 1].unshift({ type: 'optStart', optText: $$[$0 - 2], signalType: yy.LINETYPE.OPT_START }); $$[$0 - 1].push({ type: 'optEnd', optText: $$[$0 - 2], signalType: yy.LINETYPE.OPT_END }); this.$ = $$[$0 - 1]; break; - case 14: + case 18: // Alt start $$[$0 - 4].unshift({ type: 'altStart', altText: $$[$0 - 5], signalType: yy.LINETYPE.ALT_START }); @@ -37935,11 +38398,11 @@ var sequenceDiagram = (function () { this.$ = $$[$0 - 4]; break; - case 15: + case 19: this.$ = [$$[$0 - 1], { type: 'addNote', placement: $$[$0 - 2], actor: $$[$0 - 1].actor, text: $$[$0] }]; break; - case 16: + case 20: // Coerce actor_pair into a [to, from, ...] array $$[$0 - 2] = [].concat($$[$0 - 1], $$[$0 - 1]).slice(0, 2); @@ -37947,49 +38410,55 @@ var sequenceDiagram = (function () { $$[$0 - 2][1] = $$[$0 - 2][1].actor; this.$ = [$$[$0 - 1], { type: 'addNote', placement: yy.PLACEMENT.OVER, actor: $$[$0 - 2].slice(0, 2), text: $$[$0] }]; break; - case 19: + case 23: this.$ = [$$[$0 - 2], $$[$0]]; break; - case 20: + case 24: this.$ = $$[$0]; break; - case 21: + case 25: this.$ = yy.PLACEMENT.LEFTOF; break; - case 22: + case 26: this.$ = yy.PLACEMENT.RIGHTOF; break; - case 23: - this.$ = [$$[$0 - 3], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }]; - break; - case 24: - this.$ = { type: 'addActor', actor: $$[$0] }; - break; - case 25: - this.$ = yy.LINETYPE.SOLID_OPEN; - break; - case 26: - this.$ = yy.LINETYPE.DOTTED_OPEN; - break; case 27: - this.$ = yy.LINETYPE.SOLID; + this.$ = [$$[$0 - 4], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, { type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] }]; break; case 28: - this.$ = yy.LINETYPE.DOTTED; + this.$ = [$$[$0 - 4], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, { type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 4] }]; break; case 29: - this.$ = yy.LINETYPE.SOLID_CROSS; + this.$ = [$$[$0 - 3], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }]; break; case 30: - this.$ = yy.LINETYPE.DOTTED_CROSS; + this.$ = { type: 'addActor', actor: $$[$0] }; break; case 31: + this.$ = yy.LINETYPE.SOLID_OPEN; + break; + case 32: + this.$ = yy.LINETYPE.DOTTED_OPEN; + break; + case 33: + this.$ = yy.LINETYPE.SOLID; + break; + case 34: + this.$ = yy.LINETYPE.DOTTED; + break; + case 35: + this.$ = yy.LINETYPE.SOLID_CROSS; + break; + case 36: + this.$ = yy.LINETYPE.DOTTED_CROSS; + break; + case 37: this.$ = $$[$0].substring(1).trim().replace(/\\n/gm, "\n"); break; } }, - table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o([1, 7, 9, 10, 16, 18, 20, 21, 23, 33], $V0, { 5: 3 }), { 1: [2, 1], 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, o($Va, [2, 3]), { 8: 18, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, o($Va, [2, 5]), o($Va, [2, 6]), { 11: 19, 33: $V9 }, { 9: [1, 20] }, { 9: [1, 21] }, { 7: [1, 22] }, { 13: [1, 23] }, { 13: [1, 24] }, { 13: [1, 25] }, { 32: 26, 34: [1, 27], 35: [1, 28], 36: [1, 29], 37: [1, 30], 38: [1, 31], 39: [1, 32] }, { 24: 33, 26: [1, 34], 30: [1, 35], 31: [1, 36] }, o([9, 12, 29, 34, 35, 36, 37, 38, 39, 40], [2, 24]), o($Va, [2, 4]), { 9: [1, 38], 12: [1, 37] }, o($Va, [2, 9]), o($Va, [2, 10]), { 17: [1, 39] }, o($Vb, $V0, { 5: 40 }), o($Vb, $V0, { 5: 41 }), o([7, 9, 10, 16, 18, 20, 21, 22, 23, 33], $V0, { 5: 42 }), { 11: 43, 33: $V9 }, { 33: [2, 25] }, { 33: [2, 26] }, { 33: [2, 27] }, { 33: [2, 28] }, { 33: [2, 29] }, { 33: [2, 30] }, { 11: 44, 33: $V9 }, { 11: 46, 27: 45, 33: $V9 }, { 33: [2, 21] }, { 33: [2, 22] }, { 13: [1, 47] }, o($Va, [2, 8]), { 9: [1, 48] }, { 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 19: [1, 49], 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, { 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 19: [1, 50], 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, { 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 20: $V6, 21: $V7, 22: [1, 51], 23: $V8, 33: $V9 }, { 25: 52, 40: $Vc }, { 25: 54, 40: $Vc }, { 25: 55, 40: $Vc }, { 29: [1, 56], 40: [2, 20] }, { 9: [1, 57] }, o($Va, [2, 11]), o($Va, [2, 12]), o($Va, [2, 13]), { 13: [1, 58] }, { 9: [2, 23] }, { 9: [2, 31] }, { 9: [2, 15] }, { 9: [2, 16] }, { 11: 59, 33: $V9 }, o($Va, [2, 7]), o($Vb, $V0, { 5: 60 }), { 40: [2, 19] }, { 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 19: [1, 61], 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, o($Va, [2, 14])], - defaultActions: { 27: [2, 25], 28: [2, 26], 29: [2, 27], 30: [2, 28], 31: [2, 29], 32: [2, 30], 35: [2, 21], 36: [2, 22], 52: [2, 23], 53: [2, 31], 54: [2, 15], 55: [2, 16], 59: [2, 19] }, + 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, 37], $V3, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, o($Vf, [2, 5]), { 9: 24, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, o($Vf, [2, 7]), o($Vf, [2, 8]), { 11: 25, 37: $Ve }, { 5: [1, 26] }, { 11: 27, 37: $Ve }, { 11: 28, 37: $Ve }, { 5: [1, 29] }, { 4: [1, 30] }, { 13: [1, 31] }, { 13: [1, 32] }, { 13: [1, 33] }, { 34: 34, 38: [1, 35], 39: [1, 36], 40: [1, 37], 41: [1, 38], 42: [1, 39], 43: [1, 40] }, { 26: 41, 28: [1, 42], 32: [1, 43], 33: [1, 44] }, o([5, 12, 31, 38, 39, 40, 41, 42, 43, 44], [2, 30]), o($Vf, [2, 6]), { 5: [1, 46], 12: [1, 45] }, o($Vf, [2, 11]), { 5: [1, 47] }, { 5: [1, 48] }, o($Vf, [2, 14]), { 19: [1, 49] }, o($Vg, $V3, { 7: 50 }), o($Vg, $V3, { 7: 51 }), o([4, 5, 10, 15, 16, 18, 20, 22, 23, 24, 25, 37], $V3, { 7: 52 }), { 11: 55, 35: [1, 53], 36: [1, 54], 37: $Ve }, o($Vh, [2, 31]), o($Vh, [2, 32]), o($Vh, [2, 33]), o($Vh, [2, 34]), o($Vh, [2, 35]), o($Vh, [2, 36]), { 11: 56, 37: $Ve }, { 11: 58, 29: 57, 37: $Ve }, { 37: [2, 25] }, { 37: [2, 26] }, { 13: [1, 59] }, o($Vf, [2, 10]), o($Vf, [2, 12]), o($Vf, [2, 13]), { 5: [1, 60] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 61], 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 62], 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 24: [1, 63], 25: $Vd, 37: $Ve }, { 11: 64, 37: $Ve }, { 11: 65, 37: $Ve }, { 27: 66, 44: $Vi }, { 27: 68, 44: $Vi }, { 27: 69, 44: $Vi }, { 31: [1, 70], 44: [2, 24] }, { 5: [1, 71] }, o($Vf, [2, 15]), o($Vf, [2, 16]), o($Vf, [2, 17]), { 13: [1, 72] }, { 27: 73, 44: $Vi }, { 27: 74, 44: $Vi }, { 5: [2, 29] }, { 5: [2, 37] }, { 5: [2, 19] }, { 5: [2, 20] }, { 11: 75, 37: $Ve }, o($Vf, [2, 9]), o($Vg, $V3, { 7: 76 }), { 5: [2, 27] }, { 5: [2, 28] }, { 44: [2, 23] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 77], 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, o($Vf, [2, 18])], + defaultActions: { 5: [2, 1], 6: [2, 2], 43: [2, 25], 44: [2, 26], 66: [2, 29], 67: [2, 37], 68: [2, 19], 69: [2, 20], 73: [2, 27], 74: [2, 28], 75: [2, 23] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); @@ -37999,7 +38468,7 @@ var sequenceDiagram = (function () { this.hash = hash; }; - _parseError.prototype = new Error(); + _parseError.prototype = Error; throw new _parseError(str, hash); } @@ -38469,7 +38938,7 @@ var sequenceDiagram = (function () { var YYSTATE = YY_START; switch ($avoiding_name_collisions) { case 0: - return 9; + return 5; break; case 1: /* skip all whitespace */ @@ -38487,70 +38956,70 @@ var sequenceDiagram = (function () { this.begin('ID');return 10; break; case 6: - this.begin('ALIAS');return 33; + this.begin('ALIAS');return 37; break; case 7: this.popState();this.popState();this.begin('LINE');return 12; break; case 8: - this.popState();this.popState();return 9; + this.popState();this.popState();return 5; break; case 9: - this.begin('LINE');return 18; - break; - case 10: this.begin('LINE');return 20; break; + case 10: + this.begin('LINE');return 22; + break; case 11: - this.begin('LINE');return 21; + this.begin('LINE');return 23; break; case 12: - this.begin('LINE');return 22; + this.begin('LINE');return 24; break; case 13: this.popState();return 13; break; case 14: - return 19; + return 21; break; case 15: - return 30; + return 32; break; case 16: - return 31; - break; - case 17: - return 26; - break; - case 18: - return 23; - break; - case 19: - return 16; - break; - case 20: - return 4; - break; - case 21: - return 29; - break; - case 22: - return 9; - break; - case 23: return 33; break; + case 17: + return 28; + break; + case 18: + return 25; + break; + case 19: + this.begin('ID');return 15; + break; + case 20: + this.begin('ID');return 16; + break; + case 21: + return 18; + break; + case 22: + return 6; + break; + case 23: + return 31; + break; case 24: - return 36; + return 5; break; case 25: - return 37; + yy_.yytext = yy_.yytext.trim();return 37; break; case 26: - return 34; + return 40; break; case 27: - return 35; + return 41; break; case 28: return 38; @@ -38559,18 +39028,30 @@ var sequenceDiagram = (function () { return 39; break; case 30: - return 40; + return 42; break; case 31: - return 9; + return 43; break; case 32: + return 44; + break; + case 33: + return 35; + break; + case 34: + return 36; + break; + case 35: + return 5; + break; + case 36: return 'INVALID'; break; } }, - 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, /^(?:[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:title\b)/i, /^(?:sequenceDiagram\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\->:\n,;]+)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?::[^#\n;]+)/i, /^(?:$)/i, /^(?:.)/i], - conditions: { "LINE": { "rules": [2, 3, 13], "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, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], "inclusive": true } } + 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, /^(?:[^#\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], + conditions: { "LINE": { "rules": [2, 3, 13], "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, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36], "inclusive": true } } }; return lexer; })(); @@ -38602,7 +39083,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],124:[function(require,module,exports){ +},{"_process":85,"fs":1,"path":84}],103:[function(require,module,exports){ (function (global){ /** * Created by knut on 14-11-19. @@ -38671,7 +39152,9 @@ exports.LINETYPE = { ALT_ELSE: 13, ALT_END: 14, OPT_START: 15, - OPT_END: 16 + OPT_END: 16, + ACTIVE_START: 17, + ACTIVE_END: 18 }; exports.ARROWTYPE = { @@ -38705,11 +39188,17 @@ exports.apply = function (param) { exports.apply(item); }); } else { - // log.debug(param); + // console.info(param); switch (param.type) { case 'addActor': exports.addActor(param.actor, param.actor, param.description); break; + case 'activeStart': + exports.addSignal(param.actor, undefined, undefined, param.signalType); + break; + case 'activeEnd': + exports.addSignal(param.actor, undefined, undefined, param.signalType); + break; case 'addNote': exports.addNote(param.actor, param.placement, param.text); break; @@ -38748,7 +39237,7 @@ exports.apply = function (param) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../logger":127}],125:[function(require,module,exports){ +},{"../../logger":106}],104:[function(require,module,exports){ /** * Created by knut on 14-11-23. */ @@ -38768,7 +39257,7 @@ var conf = { diagramMarginY: 10, // Margin between actors actorMargin: 50, - // Width of actor moxes + // Width of actor boxes width: 150, // Height of actor boxes height: 65, @@ -38782,7 +39271,10 @@ var conf = { mirrorActors: false, // Depending on css styling this might need adjustment // Prolongs the edge of the diagram downwards - bottomMarginAdj: 1 + bottomMarginAdj: 1, + + // width of activation box + activationWidth: 10 }; //var bb = getBBox('path'); @@ -38795,9 +39287,11 @@ exports.bounds = { }, verticalPos: 0, - list: [], + sequenceItems: [], + activations: [], init: function init() { - this.list = []; + this.sequenceItems = []; + this.activations = []; this.data = { startx: undefined, stopx: undefined, @@ -38813,24 +39307,33 @@ exports.bounds = { obj[key] = fun(val, obj[key]); } }, - updateLoops: function updateLoops(startx, starty, stopx, stopy) { + updateBounds: function updateBounds(startx, starty, stopx, stopy) { var _self = this; var cnt = 0; - this.list.forEach(function (loop) { - cnt++; - // The loop list is a stack so the biggest margins in the beginning of the list - var n = _self.list.length - cnt + 1; + function updateFn(type) { + return function updateItemBounds(item) { + cnt++; + // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems + var n = _self.sequenceItems.length - cnt + 1; - _self.updateVal(loop, 'startx', startx - n * conf.boxMargin, Math.min); - _self.updateVal(loop, 'starty', starty - n * conf.boxMargin, Math.min); - _self.updateVal(loop, 'stopx', stopx + n * conf.boxMargin, Math.max); - _self.updateVal(loop, 'stopy', stopy + n * conf.boxMargin, Math.max); + _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min); + _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max); - _self.updateVal(exports.bounds.data, 'startx', startx - n * conf.boxMargin, Math.min); - _self.updateVal(exports.bounds.data, 'starty', starty - n * conf.boxMargin, Math.min); - _self.updateVal(exports.bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max); - _self.updateVal(exports.bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max); - }); + _self.updateVal(exports.bounds.data, 'startx', startx - n * conf.boxMargin, Math.min); + _self.updateVal(exports.bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max); + + if (!(type == 'activation')) { + _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min); + _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max); + + _self.updateVal(exports.bounds.data, 'starty', starty - n * conf.boxMargin, Math.min); + _self.updateVal(exports.bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max); + } + }; + } + + this.sequenceItems.forEach(updateFn()); + this.activations.forEach(updateFn('activation')); }, insert: function insert(startx, starty, stopx, stopy) { @@ -38846,21 +39349,37 @@ exports.bounds = { this.updateVal(exports.bounds.data, 'stopx', _stopx, Math.max); this.updateVal(exports.bounds.data, 'stopy', _stopy, Math.max); - this.updateLoops(_startx, _starty, _stopx, _stopy); + this.updateBounds(_startx, _starty, _stopx, _stopy); + }, + newActivation: function newActivation(message, diagram) { + var actorRect = sq.yy.getActors()[message.from.actor]; + var stackedSize = actorActivations(message.from.actor).length; + var x = actorRect.x + conf.width / 2 + (stackedSize - 1) * conf.activationWidth / 2; + this.activations.push({ startx: x, starty: this.verticalPos + 2, stopx: x + conf.activationWidth, stopy: undefined, + actor: message.from.actor, + anchored: svgDraw.anchorElement(diagram) + }); + }, + endActivation: function endActivation(message) { + // find most recent activation for given actor + var lastActorActivationIdx = this.activations.map(function (activation) { + return activation.actor; + }).lastIndexOf(message.from.actor); + var activation = this.activations.splice(lastActorActivationIdx, 1)[0]; + return activation; }, newLoop: function newLoop(title) { - this.list.push({ startx: undefined, starty: this.verticalPos, stopx: undefined, stopy: undefined, title: title }); + this.sequenceItems.push({ startx: undefined, starty: this.verticalPos, stopx: undefined, stopy: undefined, title: title }); }, endLoop: function endLoop() { - var loop = this.list.pop(); - //loop.stopy = exports.bounds.getVerticalPos(); + var loop = this.sequenceItems.pop(); return loop; }, addElseToLoop: function addElseToLoop(message) { - var loop = this.list.pop(); + var loop = this.sequenceItems.pop(); loop.elsey = exports.bounds.getVerticalPos(); loop.elseText = message; - this.list.push(loop); + this.sequenceItems.push(loop); }, bumpVerticalPos: function bumpVerticalPos(bump) { this.verticalPos = this.verticalPos + bump; @@ -38996,7 +39515,7 @@ module.exports.drawActors = function (diagram, actors, actorKeys, verticalPos) { // Add some rendering data to the object actors[key].x = i * conf.actorMargin + i * conf.width; actors[key].y = verticalPos; - actors[key].width = conf.diagramMarginY; + actors[key].width = conf.diagramMarginX; actors[key].height = conf.diagramMarginY; // Draw the box with the attached line @@ -39016,6 +39535,27 @@ module.exports.setConf = function (cnf) { conf[key] = cnf[key]; }); }; + +var actorActivations = function actorActivations(actor) { + return module.exports.bounds.activations.filter(function (activation) { + return activation.actor == actor; + }); +}; + +var actorFlowVerticaBounds = function actorFlowVerticaBounds(actor) { + // handle multiple stacked activations for same actor + var actors = sq.yy.getActors(); + var activations = actorActivations(actor); + + var left = activations.reduce(function (acc, activation) { + return Math.min(acc, activation.startx); + }, actors[actor].x + conf.width / 2); + var right = activations.reduce(function (acc, activation) { + return Math.max(acc, activation.stopx); + }, actors[actor].x + conf.width / 2); + return [left, right]; +}; + /** * Draws a flowchart in the tag with id: id based on the graph definition in text. * @param text @@ -39042,6 +39582,19 @@ module.exports.draw = function (text, id) { svgDraw.insertArrowHead(diagram); svgDraw.insertArrowCrossHead(diagram); + function activeEnd(msg, verticalPos) { + var activationData = exports.bounds.endActivation(msg); + if (activationData.starty + 18 > verticalPos) { + activationData.starty = verticalPos - 6; + verticalPos += 12; + } + svgDraw.drawActivation(diagram, activationData, verticalPos, conf); + + exports.bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos); + } + + var lastMsg; + // Draw the messages/signals messages.forEach(function (msg) { var loopData; @@ -39066,6 +39619,12 @@ module.exports.draw = function (text, id) { drawNote(diagram, (startx + stopx + conf.width - forceWidth) / 2, exports.bounds.getVerticalPos(), msg, forceWidth); } break; + case sq.yy.LINETYPE.ACTIVE_START: + exports.bounds.newActivation(msg, diagram); + break; + case sq.yy.LINETYPE.ACTIVE_END: + activeEnd(msg, exports.bounds.getVerticalPos()); + break; case sq.yy.LINETYPE.LOOP_START: exports.bounds.bumpVerticalPos(conf.boxMargin); exports.bounds.newLoop(msg.message); @@ -39107,12 +39666,23 @@ module.exports.draw = function (text, id) { exports.bounds.bumpVerticalPos(conf.boxMargin); break; default: - exports.bounds.bumpVerticalPos(conf.messageMargin); - startx = actors[msg.from].x + conf.width / 2; - stopx = actors[msg.to].x + conf.width / 2; - - drawMessage(diagram, startx, stopx, exports.bounds.getVerticalPos(), msg); + try { + lastMsg = msg; + exports.bounds.bumpVerticalPos(conf.messageMargin); + var fromBounds = actorFlowVerticaBounds(msg.from); + var toBounds = actorFlowVerticaBounds(msg.to); + var fromIdx = fromBounds[0] <= toBounds[0] ? 1 : 0; + var toIdx = fromBounds[0] < toBounds[0] ? 0 : 1; + startx = fromBounds[fromIdx]; + stopx = toBounds[toIdx]; + var verticalPos = exports.bounds.getVerticalPos(); + drawMessage(diagram, startx, stopx, verticalPos, msg); + var allBounds = fromBounds.concat(toBounds); + exports.bounds.insert(Math.min.apply(null, allBounds), verticalPos, Math.max.apply(null, allBounds), verticalPos); + } catch (e) { + console.error('error while drawing message', e); + } } }); @@ -39147,7 +39717,7 @@ module.exports.draw = function (text, id) { diagram.attr('viewBox', box.startx - conf.diagramMarginX + ' -' + conf.diagramMarginY + ' ' + width + ' ' + height); }; -},{"../../d3":108,"../../logger":127,"./parser/sequenceDiagram":123,"./sequenceDb":124,"./svgDraw":126}],126:[function(require,module,exports){ +},{"../../d3":87,"../../logger":106,"./parser/sequenceDiagram":102,"./sequenceDb":103,"./svgDraw":105}],105:[function(require,module,exports){ /** * Created by knut on 14-12-20. */ @@ -39259,6 +39829,26 @@ exports.drawActor = function (elem, left, verticalPos, description, conf) { .attr('x', center).attr('y', verticalPos + conf.height / 2 + 5).attr('class', 'actor').style('text-anchor', 'middle').text(description); }; +exports.anchorElement = function (elem) { + return elem.append('g'); +}; +/** + * Draws an actor in the diagram with the attaced line + * @param elem - element to append activation rect + * @param bounds - activation box bounds + * @param verticalPos - precise y cooridnate of bottom activation box edge + */ +exports.drawActivation = function (elem, bounds, verticalPos) { + var rect = exports.getNoteRect(); + var g = bounds.anchored; + rect.x = bounds.startx; + rect.y = bounds.starty; + rect.fill = '#f4f4f4'; + rect.width = bounds.stopx - bounds.startx; + rect.height = verticalPos - bounds.starty; + exports.drawRect(g, rect); +}; + /** * Draws an actor in the diagram with the attaced line * @param center - The center of the the actor @@ -39355,7 +39945,7 @@ exports.getNoteRect = function () { return rect; }; -},{}],127:[function(require,module,exports){ +},{}],106:[function(require,module,exports){ /** * #logger * logger = require('logger').create() @@ -39455,7 +40045,7 @@ function Log(level) { exports.Log = Log; -},{}],128:[function(require,module,exports){ +},{}],107:[function(require,module,exports){ (function (global){ /** * Web page integration module for the mermaid framework. It uses the mermaidAPI for mermaid functionality and to render @@ -39712,7 +40302,7 @@ if (typeof document !== 'undefined') { //})); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../package.json":107,"./logger":127,"./mermaidAPI":129,"he":105}],129:[function(require,module,exports){ +},{"../package.json":86,"./logger":106,"./mermaidAPI":108,"he":81}],108:[function(require,module,exports){ (function (global){ /** * --- @@ -40249,7 +40839,7 @@ global.mermaidAPI = { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../package.json":107,"./d3":108,"./diagrams/classDiagram/classDb":109,"./diagrams/classDiagram/classRenderer":110,"./diagrams/classDiagram/parser/classDiagram":111,"./diagrams/example/exampleDb":112,"./diagrams/example/exampleRenderer":113,"./diagrams/example/parser/example":114,"./diagrams/flowchart/flowRenderer":116,"./diagrams/flowchart/graphDb":117,"./diagrams/flowchart/parser/dot":118,"./diagrams/flowchart/parser/flow":119,"./diagrams/gantt/ganttDb":120,"./diagrams/gantt/ganttRenderer":121,"./diagrams/gantt/parser/gantt":122,"./diagrams/sequenceDiagram/parser/sequenceDiagram":123,"./diagrams/sequenceDiagram/sequenceDb":124,"./diagrams/sequenceDiagram/sequenceRenderer":125,"./logger":127,"./utils":130}],130:[function(require,module,exports){ +},{"../package.json":86,"./d3":87,"./diagrams/classDiagram/classDb":88,"./diagrams/classDiagram/classRenderer":89,"./diagrams/classDiagram/parser/classDiagram":90,"./diagrams/example/exampleDb":91,"./diagrams/example/exampleRenderer":92,"./diagrams/example/parser/example":93,"./diagrams/flowchart/flowRenderer":95,"./diagrams/flowchart/graphDb":96,"./diagrams/flowchart/parser/dot":97,"./diagrams/flowchart/parser/flow":98,"./diagrams/gantt/ganttDb":99,"./diagrams/gantt/ganttRenderer":100,"./diagrams/gantt/parser/gantt":101,"./diagrams/sequenceDiagram/parser/sequenceDiagram":102,"./diagrams/sequenceDiagram/sequenceDb":103,"./diagrams/sequenceDiagram/sequenceRenderer":104,"./logger":106,"./utils":109}],109:[function(require,module,exports){ /** * Created by knut on 14-11-23. */ @@ -40389,5 +40979,5 @@ var cloneCssStyles = function cloneCssStyles(svg, classes) { exports.cloneCssStyles = cloneCssStyles; -},{"./logger":127}]},{},[128])(128) +},{"./logger":106}]},{},[107])(107) }); \ No newline at end of file diff --git a/dist/mermaid.min.js b/dist/mermaid.min.js index 356945d2e..039c81186 100644 --- a/dist/mermaid.min.js +++ b/dist/mermaid.min.js @@ -1,26 +1,21 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.mermaid=t()}}(function(){var define,module,exports;return function t(e,n,r){function i(u,o){if(!n[u]){if(!e[u]){var s="function"==typeof require&&require;if(!o&&s)return s(u,!0);if(a)return a(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[u]={exports:{}};e[u][0].call(l.exports,function(t){var n=e[u][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[u].exports}for(var a="function"==typeof require&&require,u=0;u=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!i;a--){var u=a>=0?arguments[a]:t.cwd();if("string"!=typeof u)throw new TypeError("Arguments to path.resolve must be strings");u&&(n=u+"/"+n,i="/"===u.charAt(0))}return n=e(r(n.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(t){var i=n.isAbsolute(t),a="/"===u(t,-1);return t=e(r(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(r(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function r(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),a=r(e.split("/")),u=Math.min(i.length,a.length),o=u,s=0;u>s;s++)if(i[s]!==a[s]){o=s;break}for(var c=[],s=o;se&&(e=t.length+e),t.substr(e,n)}}).call(this,t("_process"))},{_process:3}],3:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.MutationObserver,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};var r=[];if(e){var i=document.createElement("div"),a=new MutationObserver(function(){var t=r.slice();r.length=0,t.forEach(function(t){t()})});return a.observe(i,{attributes:!0}),function(t){r.length||i.setAttribute("yes","no"),r.push(t)}}return n?(window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),r.length>0)){var n=r.shift();n()}},!0),function(t){r.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],4:[function(t,e){!function(){function t(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function r(t,e){return e>t?-1:t>e?1:t>=e?0:0/0}function i(t){return null===t?0/0:+t}function a(t){return!isNaN(t)}function u(t){return{left:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var a=r+i>>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var a=r+i>>>1;t(e[a],n)>0?i=a:r=a+1}return r}}}function o(t){return t.length}function s(t){for(var e=1;t*e%1;)e*=10;return e}function c(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function l(){this._=Object.create(null)}function h(t){return(t+="")===gu||t[0]===mu?mu+t:t}function f(t){return(t+="")[0]===mu?t.slice(1):t}function d(t){return h(t)in this._}function p(t){return(t=h(t))in this._&&delete this._[t]}function g(){var t=[];for(var e in this._)t.push(f(e));return t}function m(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function v(){this._=Object.create(null)}function b(t){return t}function _(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function x(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=yu.length;r>n;++n){var i=yu[n]+e;if(i in t)return i}}function w(){}function A(){}function E(t){function e(){for(var e,r=n,i=-1,a=r.length;++in;n++)for(var i,a=t[n],u=0,o=a.length;o>u;u++)(i=a[u])&&e(i,u,n);return t}function $(t){return bu(t,ku),t}function G(t){var e,n;return function(r,i,a){var u,o=t[a].update,s=o.length;for(a!=n&&(n=a,e=0),i>=e&&(e=i+1);!(u=o[e])&&++e0&&(t=t.slice(0,o));var c=Du.get(t);return c&&(t=c,s=Z),o?e?i:r:e?w:a}function W(t,e){return function(n){var r=nu.event;nu.event=n,e[0]=this.__data__;try{t.apply(this,e)}finally{nu.event=r}}}function Z(t,e){var n=W(t,e);return function(t){var e=this,r=t.relatedTarget;r&&(r===e||8&r.compareDocumentPosition(e))||n.call(e,t)}}function X(e){var r=".dragsuppress-"+ ++Mu,i="click"+r,a=nu.select(n(e)).on("touchmove"+r,k).on("dragstart"+r,k).on("selectstart"+r,k);if(null==Cu&&(Cu="onselectstart"in e?!1:x(e.style,"userSelect")),Cu){var u=t(e).style,o=u[Cu];u[Cu]="none"}return function(t){if(a.on(r,null),Cu&&(u[Cu]=o),t){var e=function(){a.on(i,null)};a.on(i,function(){k(),e()},!0),setTimeout(e,0)}}}function J(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>Su){var a=n(t);if(a.scrollX||a.scrollY){r=nu.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=r[0][0].getScreenCTM();Su=!(u.f||u.e),r.remove()}}return Su?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}function K(){return nu.event.changedTouches[0].identifier}function Q(t){return t>0?1:0>t?-1:0}function tt(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function et(t){return t>1?0:-1>t?Bu:Math.acos(t)}function nt(t){return t>1?Ou:-1>t?-Ou:Math.asin(t)}function rt(t){return((t=Math.exp(t))-1/t)/2}function it(t){return((t=Math.exp(t))+1/t)/2}function at(t){return((t=Math.exp(2*t))-1)/(t+1)}function ut(t){return(t=Math.sin(t/2))*t}function ot(){}function st(t,e,n){return this instanceof st?(this.h=+t,this.s=+e,void(this.l=+n)):arguments.length<2?t instanceof st?new st(t.h,t.s,t.l):wt(""+t,At,st):new st(t,e,n)}function ct(t,e,n){function r(t){return t>360?t-=360:0>t&&(t+=360),60>t?a+(u-a)*t/60:180>t?u:240>t?a+(u-a)*(240-t)/60:a}function i(t){return Math.round(255*r(t))}var a,u;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:0>e?0:e>1?1:e,n=0>n?0:n>1?1:n,u=.5>=n?n*(1+e):n+e-n*e,a=2*n-u,new vt(i(t+120),i(t),i(t-120))}function lt(t,e,n){return this instanceof lt?(this.h=+t,this.c=+e,void(this.l=+n)):arguments.length<2?t instanceof lt?new lt(t.h,t.c,t.l):t instanceof ft?pt(t.l,t.a,t.b):pt((t=Et((t=nu.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new lt(t,e,n)}function ht(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ft(n,Math.cos(t*=Iu)*e,Math.sin(t)*e)}function ft(t,e,n){return this instanceof ft?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof ft?new ft(t.l,t.a,t.b):t instanceof lt?ht(t.h,t.c,t.l):Et((t=vt(t)).r,t.g,t.b):new ft(t,e,n)}function dt(t,e,n){var r=(t+16)/116,i=r+e/500,a=r-n/200;return i=gt(i)*Hu,r=gt(r)*Wu,a=gt(a)*Zu,new vt(yt(3.2404542*i-1.5371385*r-.4985314*a),yt(-.969266*i+1.8760108*r+.041556*a),yt(.0556434*i-.2040259*r+1.0572252*a))}function pt(t,e,n){return t>0?new lt(Math.atan2(n,e)*Ru,Math.sqrt(e*e+n*n),t):new lt(0/0,0/0,t)}function gt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function mt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function vt(t,e,n){return this instanceof vt?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof vt?new vt(t.r,t.g,t.b):wt(""+t,vt,ct):new vt(t,e,n)}function bt(t){return new vt(t>>16,t>>8&255,255&t)}function _t(t){return bt(t)+""}function xt(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function wt(t,e,n){t=t.toLowerCase();var r,i,a,u=0,o=0,s=0;if(r=/([a-z]+)\((.*)\)/.exec(t))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(Dt(i[0]),Dt(i[1]),Dt(i[2]))}return(a=Ku.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(u=(3840&a)>>4,u=u>>4|u,o=240&a,o=o>>4|o,s=15&a,s=s<<4|s):7===t.length&&(u=(16711680&a)>>16,o=(65280&a)>>8,s=255&a)),e(u,o,s))}function At(t,e,n){var r,i,a=Math.min(t/=255,e/=255,n/=255),u=Math.max(t,e,n),o=u-a,s=(u+a)/2;return o?(i=.5>s?o/(u+a):o/(2-u-a),r=t==u?(e-n)/o+(n>e?6:0):e==u?(n-t)/o+2:(t-e)/o+4,r*=60):(r=0/0,i=s>0&&1>s?0:r),new st(r,i,s)}function Et(t,e,n){t=kt(t),e=kt(e),n=kt(n);var r=mt((.4124564*t+.3575761*e+.1804375*n)/Hu),i=mt((.2126729*t+.7151522*e+.072175*n)/Wu),a=mt((.0193339*t+.119192*e+.9503041*n)/Zu);return ft(116*i-16,500*(r-i),200*(i-a))}function kt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Dt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Ct(t){return"function"==typeof t?t:function(){return t}}function Mt(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),St(e,n,t,r)}}function St(t,e,n,r){function i(){var t,e=s.status;if(!e&&Ft(s)||e>=200&&300>e||304===e){try{t=n.call(a,s)}catch(r){return void u.error.call(a,r)}u.load.call(a,t)}else u.error.call(a,s)}var a={},u=nu.dispatch("beforesend","progress","load","error"),o={},s=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(t)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=i:s.onreadystatechange=function(){s.readyState>3&&i()},s.onprogress=function(t){var e=nu.event;nu.event=t;try{u.progress.call(a,s)}finally{nu.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?o[t]:(null==e?delete o[t]:o[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(c=t,a):c},a.response=function(t){return n=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(iu(arguments)))}}),a.send=function(n,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),s.open(n,t,!0),null==e||"accept"in o||(o.accept=e+",*/*"),s.setRequestHeader)for(var l in o)s.setRequestHeader(l,o[l]);return null!=e&&s.overrideMimeType&&s.overrideMimeType(e),null!=c&&(s.responseType=c),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),u.beforesend.call(a,s),s.send(null==r?null:r),a},a.abort=function(){return s.abort(),a},nu.rebind(a,u,"on"),null==r?a:a.get(Tt(r))}function Tt(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Ft(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Bt(){var t=Lt(),e=Nt()-t;e>24?(isFinite(e)&&(clearTimeout(no),no=setTimeout(Bt,e)),eo=0):(eo=1,io(Bt))}function Lt(){var t=Date.now();for(ro=Qu;ro;)t>=ro.t&&(ro.f=ro.c(t-ro.t)),ro=ro.n;return t}function Nt(){for(var t,e=Qu,n=1/0;e;)e.f?e=t?t.n=e.n:Qu=e.n:(e.t8?function(t){return t/n}:function(t){return t*n},symbol:t}}function Rt(t){var e=t.decimal,n=t.thousands,r=t.grouping,i=t.currency,a=r&&n?function(t,e){for(var i=t.length,a=[],u=0,o=r[0],s=0;i>0&&o>0&&(s+o+1>e&&(o=Math.max(1,e-s)),a.push(t.substring(i-=o,i+o)),!((s+=o+1)>e));)o=r[u=(u+1)%r.length];return a.reverse().join(n)}:b;return function(t){var n=uo.exec(t),r=n[1]||" ",u=n[2]||">",o=n[3]||"-",s=n[4]||"",c=n[5],l=+n[6],h=n[7],f=n[8],d=n[9],p=1,g="",m="",y=!1,v=!0;switch(f&&(f=+f.substring(1)),(c||"0"===r&&"="===u)&&(c=r="0",u="="),d){case"n":h=!0,d="g";break;case"%":p=100,m="%",d="f";break;case"p":p=100,m="%",d="r";break;case"b":case"o":case"x":case"X":"#"===s&&(g="0"+d.toLowerCase());case"c":v=!1;case"d":y=!0,f=0;break;case"s":p=-1,d="r"}"$"===s&&(g=i[0],m=i[1]),"r"!=d||f||(d="g"),null!=f&&("g"==d?f=Math.max(1,Math.min(21,f)):("e"==d||"f"==d)&&(f=Math.max(0,Math.min(20,f)))),d=oo.get(d)||Pt;var b=c&&h;return function(t){var n=m;if(y&&t%1)return"";var i=0>t||0===t&&0>1/t?(t=-t,"-"):"-"===o?"":o;if(0>p){var s=nu.formatPrefix(t,f);t=s.scale(t),n=s.symbol+m}else t*=p;t=d(t,f);var _,x,w=t.lastIndexOf(".");if(0>w){var A=v?t.lastIndexOf("e"):-1;0>A?(_=t,x=""):(_=t.substring(0,A),x=t.substring(A))}else _=t.substring(0,w),x=e+t.substring(w+1);!c&&h&&(_=a(_,1/0));var E=g.length+_.length+x.length+(b?0:i.length),k=l>E?new Array(E=l-E+1).join(r):"";return b&&(_=a(k+_,k.length?l-x.length:1/0)),i+=g,t=_+x,("<"===u?i+t+k:">"===u?k+i+t:"^"===u?k.substring(0,E>>=1)+i+t+k.substring(E):i+(b?t:k+t))+n}}}function Pt(t){return t+""}function qt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function jt(t,e,n){function r(e){var n=t(e),r=a(n,1);return r-e>e-n?n:r}function i(n){return e(n=t(new co(n-1)),1),n}function a(t,n){return e(t=new co(+t),n),t}function u(t,r,a){var u=i(t),o=[];if(a>1)for(;r>u;)n(u)%a||o.push(new Date(+u)),e(u,1);else for(;r>u;)o.push(new Date(+u)),e(u,1);return o}function o(t,e,n){try{co=qt;var r=new qt;return r._=t,u(r,e,n)}finally{co=Date}}t.floor=t,t.round=r,t.ceil=i,t.offset=a,t.range=u;var s=t.utc=Ut(t);return s.floor=s,s.round=Ut(r),s.ceil=Ut(i),s.offset=Ut(a),s.range=o,t}function Ut(t){return function(e,n){try{co=qt;var r=new qt;return r._=e,t(r,n)._}finally{co=Date}}}function Yt(t){function e(t){function e(e){for(var n,i,a,u=[],o=-1,s=0;++oo;){if(r>=c)return-1;if(i=e.charCodeAt(o++),37===i){if(u=e.charAt(o++),a=S[u in ho?e.charAt(o++):u],!a||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function r(t,e,n){w.lastIndex=0;var r=w.exec(e.slice(n));return r?(t.w=A.get(r[0].toLowerCase()),n+r[0].length):-1}function i(t,e,n){_.lastIndex=0;var r=_.exec(e.slice(n));return r?(t.w=x.get(r[0].toLowerCase()),n+r[0].length):-1}function a(t,e,n){D.lastIndex=0;var r=D.exec(e.slice(n));return r?(t.m=C.get(r[0].toLowerCase()),n+r[0].length):-1}function u(t,e,n){E.lastIndex=0;var r=E.exec(e.slice(n));return r?(t.m=k.get(r[0].toLowerCase()),n+r[0].length):-1}function o(t,e,r){return n(t,M.c.toString(),e,r)}function s(t,e,r){return n(t,M.x.toString(),e,r)}function c(t,e,r){return n(t,M.X.toString(),e,r)}function l(t,e,n){var r=b.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}var h=t.dateTime,f=t.date,d=t.time,p=t.periods,g=t.days,m=t.shortDays,y=t.months,v=t.shortMonths;e.utc=function(t){function n(t){try{co=qt;var e=new co;return e._=t,r(e)}finally{co=Date}}var r=e(t);return n.parse=function(t){try{co=qt;var e=r.parse(t);return e&&e._}finally{co=Date}},n.toString=r.toString,n},e.multi=e.utc.multi=se;var b=nu.map(),_=Vt(g),x=$t(g),w=Vt(m),A=$t(m),E=Vt(y),k=$t(y),D=Vt(v),C=$t(v);p.forEach(function(t,e){b.set(t.toLowerCase(),e)});var M={a:function(t){return m[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return v[t.getMonth()]},B:function(t){return y[t.getMonth()]},c:e(h),d:function(t,e){return zt(t.getDate(),e,2)},e:function(t,e){return zt(t.getDate(),e,2)},H:function(t,e){return zt(t.getHours(),e,2)},I:function(t,e){return zt(t.getHours()%12||12,e,2)},j:function(t,e){return zt(1+so.dayOfYear(t),e,3)},L:function(t,e){return zt(t.getMilliseconds(),e,3)},m:function(t,e){return zt(t.getMonth()+1,e,2)},M:function(t,e){return zt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return zt(t.getSeconds(),e,2)},U:function(t,e){return zt(so.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return zt(so.mondayOfYear(t),e,2)},x:e(f),X:e(d),y:function(t,e){return zt(t.getFullYear()%100,e,2)},Y:function(t,e){return zt(t.getFullYear()%1e4,e,4)},Z:ue,"%":function(){return"%"}},S={a:r,A:i,b:a,B:u,c:o,d:te,e:te,H:ne,I:ne,j:ee,L:ae,m:Qt,M:re,p:l,S:ie,U:Ht,w:Gt,W:Wt,x:s,X:c,y:Xt,Y:Zt,Z:Jt,"%":oe};return e}function zt(t,e,n){var r=0>t?"-":"",i=(r?-t:t)+"",a=i.length;return r+(n>a?new Array(n-a+1).join(e)+i:i)}function Vt(t){return new RegExp("^(?:"+t.map(nu.requote).join("|")+")","i")}function $t(t){for(var e=new l,n=-1,r=t.length;++n68?1900:2e3)}function Qt(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function te(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function ee(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function ne(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function re(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function ie(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function ae(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function ue(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=pu(e)/60|0,i=pu(e)%60;return n+zt(r,"0",2)+zt(i,"0",2)}function oe(t,e,n){po.lastIndex=0;var r=po.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function se(t){for(var e=t.length,n=-1;++n=0?1:-1,o=u*n,s=Math.cos(e),c=Math.sin(e),l=a*c,h=i*s+l*Math.cos(o),f=l*u*Math.sin(o);_o.add(Math.atan2(f,h)),r=t,i=s,a=c}var e,n,r,i,a;xo.point=function(u,o){xo.point=t,r=(e=u)*Iu,i=Math.cos(o=(n=o)*Iu/2+Bu/4),a=Math.sin(o)},xo.lineEnd=function(){t(e,n)}}function ge(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function me(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ye(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ve(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function be(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function _e(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function xe(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function we(t,e){return pu(t[0]-e[0])o;++o)i.point((n=t[o])[0],n[1]);return void i.lineEnd()}var s=new Be(n,t,null,!0),c=new Be(n,null,s,!1);s.o=c,a.push(s),u.push(c),s=new Be(r,t,null,!1),c=new Be(r,null,s,!0),s.o=c,a.push(s),u.push(c)}}),u.sort(e),Fe(a),Fe(u),a.length){for(var o=0,s=n,c=u.length;c>o;++o)u[o].e=s=!s;for(var l,h,f=a[0];;){for(var d=f,p=!0;d.v;)if((d=d.n)===f)return;l=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(p)for(var o=0,c=l.length;c>o;++o)i.point((h=l[o])[0],h[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(p){l=d.p.z;for(var o=l.length-1;o>=0;--o)i.point((h=l[o])[0],h[1])}else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,l=d.z,p=!p}while(!d.v);i.lineEnd()}}}function Fe(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r0){for(x||(a.polygonStart(),x=!0),a.lineStart();++u1&&2&e&&n.push(n.pop().concat(n.shift())),d.push(n.filter(Ne))}var d,p,g,m=e(a),y=i.invert(r[0],r[1]),v={point:u,lineStart:s,lineEnd:c,polygonStart:function(){v.point=l,v.lineStart=h,v.lineEnd=f,d=[],p=[]},polygonEnd:function(){v.point=u,v.lineStart=s,v.lineEnd=c,d=nu.merge(d);var t=je(y,p);d.length?(x||(a.polygonStart(),x=!0),Te(d,Ie,t,n,a)):t&&(x||(a.polygonStart(),x=!0),a.lineStart(),n(null,null,1,a),a.lineEnd()),x&&(a.polygonEnd(),x=!1),d=p=null},sphere:function(){a.polygonStart(),a.lineStart(),n(null,null,1,a),a.lineEnd(),a.polygonEnd()}},b=Oe(),_=e(b),x=!1;return v}}function Ne(t){return t.length>1}function Oe(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:w,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Ie(t,e){return((t=t.x)[0]<0?t[1]-Ou-Tu:Ou-t[1])-((e=e.x)[0]<0?e[1]-Ou-Tu:Ou-e[1])}function Re(t){var e,n=0/0,r=0/0,i=0/0;return{lineStart:function(){t.lineStart(),e=1},point:function(a,u){var o=a>0?Bu:-Bu,s=pu(a-n);pu(s-Bu)0?Ou:-Ou),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(o,r),t.point(a,r),e=0):i!==o&&s>=Bu&&(pu(n-i)Tu?Math.atan((Math.sin(e)*(a=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*a*u)):(e+r)/2}function qe(t,e,n,r){var i;if(null==t)i=n*Ou,r.point(-Bu,i),r.point(0,i),r.point(Bu,i),r.point(Bu,0),r.point(Bu,-i),r.point(0,-i),r.point(-Bu,-i),r.point(-Bu,0),r.point(-Bu,i);else if(pu(t[0]-e[0])>Tu){var a=t[0]o;++o){var c=e[o],l=c.length;if(l)for(var h=c[0],f=h[0],d=h[1]/2+Bu/4,p=Math.sin(d),g=Math.cos(d),m=1;;){m===l&&(m=0),t=c[m];var y=t[0],v=t[1]/2+Bu/4,b=Math.sin(v),_=Math.cos(v),x=y-f,w=x>=0?1:-1,A=w*x,E=A>Bu,k=p*b;if(_o.add(Math.atan2(k*w*Math.sin(A),g*_+k*Math.cos(A))),a+=E?x+w*Lu:x,E^f>=n^y>=n){var D=ye(ge(h),ge(t));_e(D);var C=ye(i,D);_e(C);var M=(E^x>=0?-1:1)*nt(C[2]);(r>M||r===M&&(D[0]||D[1]))&&(u+=E^x>=0?1:-1)}if(!m++)break;f=y,p=b,g=_,h=t}}return(-Tu>a||Tu>a&&0>_o)^1&u}function Ue(t){function e(t,e){return Math.cos(t)*Math.cos(e)>a}function n(t){var n,a,s,c,l;return{lineStart:function(){c=s=!1,l=1},point:function(h,f){var d,p=[h,f],g=e(h,f),m=u?g?0:i(h,f):g?i(h+(0>h?Bu:-Bu),f):0;if(!n&&(c=s=g)&&t.lineStart(),g!==s&&(d=r(n,p),(we(n,d)||we(p,d))&&(p[0]+=Tu,p[1]+=Tu,g=e(p[0],p[1]))),g!==s)l=0,g?(t.lineStart(),d=r(p,n),t.point(d[0],d[1])):(d=r(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(o&&n&&u^g){var y;m&a||!(y=r(p,n,!0))||(l=0,u?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!g||n&&we(n,p)||t.point(p[0],p[1]),n=p,s=g,a=m},lineEnd:function(){s&&t.lineEnd(),n=null},clean:function(){return l|(c&&s)<<1}}}function r(t,e,n){var r=ge(t),i=ge(e),u=[1,0,0],o=ye(r,i),s=me(o,o),c=o[0],l=s-c*c;if(!l)return!n&&t;var h=a*s/l,f=-a*c/l,d=ye(u,o),p=be(u,h),g=be(o,f);ve(p,g);var m=d,y=me(p,m),v=me(m,m),b=y*y-v*(me(p,p)-1);if(!(0>b)){var _=Math.sqrt(b),x=be(m,(-y-_)/v);if(ve(x,p),x=xe(x),!n)return x;var w,A=t[0],E=e[0],k=t[1],D=e[1];A>E&&(w=A,A=E,E=w);var C=E-A,M=pu(C-Bu)C;if(!M&&k>D&&(w=k,k=D,D=w),S?M?k+D>0^x[1]<(pu(x[0]-A)Bu^(A<=x[0]&&x[0]<=E)){var T=be(m,(-y+_)/v);return ve(T,p),[x,xe(T)]}}}function i(e,n){var r=u?t:Bu-t,i=0;return-r>e?i|=1:e>r&&(i|=2),-r>n?i|=4:n>r&&(i|=8),i}var a=Math.cos(t),u=a>0,o=pu(a)>Tu,s=gn(t,6*Iu);return Le(e,n,s,u?[0,-t]:[-Bu,t-Bu])}function Ye(t,e,n,r){return function(i){var a,u=i.a,o=i.b,s=u.x,c=u.y,l=o.x,h=o.y,f=0,d=1,p=l-s,g=h-c;if(a=t-s,p||!(a>0)){if(a/=p,0>p){if(f>a)return;d>a&&(d=a)}else if(p>0){if(a>d)return;a>f&&(f=a)}if(a=n-s,p||!(0>a)){if(a/=p,0>p){if(a>d)return;a>f&&(f=a)}else if(p>0){if(f>a)return;d>a&&(d=a)}if(a=e-c,g||!(a>0)){if(a/=g,0>g){if(f>a)return;d>a&&(d=a)}else if(g>0){if(a>d)return;a>f&&(f=a)}if(a=r-c,g||!(0>a)){if(a/=g,0>g){if(a>d)return;a>f&&(f=a)}else if(g>0){if(f>a)return;d>a&&(d=a)}return f>0&&(i.a={x:s+f*p,y:c+f*g}),1>d&&(i.b={x:s+d*p,y:c+d*g}),i}}}}}}function ze(t,e,n,r){function i(r,i){return pu(r[0]-t)0?0:3:pu(r[0]-n)0?2:1:pu(r[1]-e)0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=i(t,1),r=i(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]; +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.mermaid=t()}}(function(){var define,module,exports;return function t(e,n,r){function i(u,o){if(!n[u]){if(!e[u]){var s="function"==typeof require&&require;if(!o&&s)return s(u,!0);if(a)return a(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[u]={exports:{}};e[u][0].call(l.exports,function(t){var n=e[u][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[u].exports}for(var a="function"==typeof require&&require,u=0;ut?-1:t>e?1:t>=e?0:0/0}function i(t){return null===t?0/0:+t}function a(t){return!isNaN(t)}function u(t){return{left:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var a=r+i>>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var a=r+i>>>1;t(e[a],n)>0?i=a:r=a+1}return r}}}function o(t){return t.length}function s(t){for(var e=1;t*e%1;)e*=10;return e}function c(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function l(){this._=Object.create(null)}function h(t){return(t+="")===gu||t[0]===mu?mu+t:t}function f(t){return(t+="")[0]===mu?t.slice(1):t}function d(t){return h(t)in this._}function p(t){return(t=h(t))in this._&&delete this._[t]}function g(){var t=[];for(var e in this._)t.push(f(e));return t}function m(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function v(){this._=Object.create(null)}function b(t){return t}function _(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function x(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=yu.length;r>n;++n){var i=yu[n]+e;if(i in t)return i}}function w(){}function A(){}function E(t){function e(){for(var e,r=n,i=-1,a=r.length;++in;n++)for(var i,a=t[n],u=0,o=a.length;o>u;u++)(i=a[u])&&e(i,u,n);return t}function $(t){return bu(t,ku),t}function H(t){var e,n;return function(r,i,a){var u,o=t[a].update,s=o.length;for(a!=n&&(n=a,e=0),i>=e&&(e=i+1);!(u=o[e])&&++e0&&(t=t.slice(0,o));var c=Du.get(t);return c&&(t=c,s=Z),o?e?i:r:e?w:a}function W(t,e){return function(n){var r=nu.event;nu.event=n,e[0]=this.__data__;try{t.apply(this,e)}finally{nu.event=r}}}function Z(t,e){var n=W(t,e);return function(t){var e=this,r=t.relatedTarget;r&&(r===e||8&r.compareDocumentPosition(e))||n.call(e,t)}}function X(e){var r=".dragsuppress-"+ ++Su,i="click"+r,a=nu.select(n(e)).on("touchmove"+r,k).on("dragstart"+r,k).on("selectstart"+r,k);if(null==Cu&&(Cu="onselectstart"in e?!1:x(e.style,"userSelect")),Cu){var u=t(e).style,o=u[Cu];u[Cu]="none"}return function(t){if(a.on(r,null),Cu&&(u[Cu]=o),t){var e=function(){a.on(i,null)};a.on(i,function(){k(),e()},!0),setTimeout(e,0)}}}function J(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>Mu){var a=n(t);if(a.scrollX||a.scrollY){r=nu.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=r[0][0].getScreenCTM();Mu=!(u.f||u.e),r.remove()}}return Mu?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}function K(){return nu.event.changedTouches[0].identifier}function Q(t){return t>0?1:0>t?-1:0}function tt(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function et(t){return t>1?0:-1>t?Lu:Math.acos(t)}function nt(t){return t>1?Iu:-1>t?-Iu:Math.asin(t)}function rt(t){return((t=Math.exp(t))-1/t)/2}function it(t){return((t=Math.exp(t))+1/t)/2}function at(t){return((t=Math.exp(2*t))-1)/(t+1)}function ut(t){return(t=Math.sin(t/2))*t}function ot(){}function st(t,e,n){return this instanceof st?(this.h=+t,this.s=+e,void(this.l=+n)):arguments.length<2?t instanceof st?new st(t.h,t.s,t.l):wt(""+t,At,st):new st(t,e,n)}function ct(t,e,n){function r(t){return t>360?t-=360:0>t&&(t+=360),60>t?a+(u-a)*t/60:180>t?u:240>t?a+(u-a)*(240-t)/60:a}function i(t){return Math.round(255*r(t))}var a,u;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:0>e?0:e>1?1:e,n=0>n?0:n>1?1:n,u=.5>=n?n*(1+e):n+e-n*e,a=2*n-u,new vt(i(t+120),i(t),i(t-120))}function lt(t,e,n){return this instanceof lt?(this.h=+t,this.c=+e,void(this.l=+n)):arguments.length<2?t instanceof lt?new lt(t.h,t.c,t.l):t instanceof ft?pt(t.l,t.a,t.b):pt((t=Et((t=nu.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new lt(t,e,n)}function ht(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ft(n,Math.cos(t*=Ou)*e,Math.sin(t)*e)}function ft(t,e,n){return this instanceof ft?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof ft?new ft(t.l,t.a,t.b):t instanceof lt?ht(t.h,t.c,t.l):Et((t=vt(t)).r,t.g,t.b):new ft(t,e,n)}function dt(t,e,n){var r=(t+16)/116,i=r+e/500,a=r-n/200;return i=gt(i)*Gu,r=gt(r)*Wu,a=gt(a)*Zu,new vt(yt(3.2404542*i-1.5371385*r-.4985314*a),yt(-.969266*i+1.8760108*r+.041556*a),yt(.0556434*i-.2040259*r+1.0572252*a))}function pt(t,e,n){return t>0?new lt(Math.atan2(n,e)*Ru,Math.sqrt(e*e+n*n),t):new lt(0/0,0/0,t)}function gt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function mt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function vt(t,e,n){return this instanceof vt?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof vt?new vt(t.r,t.g,t.b):wt(""+t,vt,ct):new vt(t,e,n)}function bt(t){return new vt(t>>16,t>>8&255,255&t)}function _t(t){return bt(t)+""}function xt(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function wt(t,e,n){t=t.toLowerCase();var r,i,a,u=0,o=0,s=0;if(r=/([a-z]+)\((.*)\)/.exec(t))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(Dt(i[0]),Dt(i[1]),Dt(i[2]))}return(a=Ku.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(u=(3840&a)>>4,u=u>>4|u,o=240&a,o=o>>4|o,s=15&a,s=s<<4|s):7===t.length&&(u=(16711680&a)>>16,o=(65280&a)>>8,s=255&a)),e(u,o,s))}function At(t,e,n){var r,i,a=Math.min(t/=255,e/=255,n/=255),u=Math.max(t,e,n),o=u-a,s=(u+a)/2;return o?(i=.5>s?o/(u+a):o/(2-u-a),r=t==u?(e-n)/o+(n>e?6:0):e==u?(n-t)/o+2:(t-e)/o+4,r*=60):(r=0/0,i=s>0&&1>s?0:r),new st(r,i,s)}function Et(t,e,n){t=kt(t),e=kt(e),n=kt(n);var r=mt((.4124564*t+.3575761*e+.1804375*n)/Gu),i=mt((.2126729*t+.7151522*e+.072175*n)/Wu),a=mt((.0193339*t+.119192*e+.9503041*n)/Zu);return ft(116*i-16,500*(r-i),200*(i-a))}function kt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Dt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Ct(t){return"function"==typeof t?t:function(){return t}}function St(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),Mt(e,n,t,r)}}function Mt(t,e,n,r){function i(){var t,e=s.status;if(!e&&Ft(s)||e>=200&&300>e||304===e){try{t=n.call(a,s)}catch(r){return void u.error.call(a,r)}u.load.call(a,t)}else u.error.call(a,s)}var a={},u=nu.dispatch("beforesend","progress","load","error"),o={},s=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(t)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=i:s.onreadystatechange=function(){s.readyState>3&&i()},s.onprogress=function(t){var e=nu.event;nu.event=t;try{u.progress.call(a,s)}finally{nu.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?o[t]:(null==e?delete o[t]:o[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(c=t,a):c},a.response=function(t){return n=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(iu(arguments)))}}),a.send=function(n,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),s.open(n,t,!0),null==e||"accept"in o||(o.accept=e+",*/*"),s.setRequestHeader)for(var l in o)s.setRequestHeader(l,o[l]);return null!=e&&s.overrideMimeType&&s.overrideMimeType(e),null!=c&&(s.responseType=c),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),u.beforesend.call(a,s),s.send(null==r?null:r),a},a.abort=function(){return s.abort(),a},nu.rebind(a,u,"on"),null==r?a:a.get(Tt(r))}function Tt(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Ft(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Lt(){var t=Bt(),e=Nt()-t;e>24?(isFinite(e)&&(clearTimeout(no),no=setTimeout(Lt,e)),eo=0):(eo=1,io(Lt))}function Bt(){var t=Date.now();for(ro=Qu;ro;)t>=ro.t&&(ro.f=ro.c(t-ro.t)),ro=ro.n;return t}function Nt(){for(var t,e=Qu,n=1/0;e;)e.f?e=t?t.n=e.n:Qu=e.n:(e.t8?function(t){return t/n}:function(t){return t*n},symbol:t}}function Rt(t){var e=t.decimal,n=t.thousands,r=t.grouping,i=t.currency,a=r&&n?function(t,e){for(var i=t.length,a=[],u=0,o=r[0],s=0;i>0&&o>0&&(s+o+1>e&&(o=Math.max(1,e-s)),a.push(t.substring(i-=o,i+o)),!((s+=o+1)>e));)o=r[u=(u+1)%r.length];return a.reverse().join(n)}:b;return function(t){var n=uo.exec(t),r=n[1]||" ",u=n[2]||">",o=n[3]||"-",s=n[4]||"",c=n[5],l=+n[6],h=n[7],f=n[8],d=n[9],p=1,g="",m="",y=!1,v=!0;switch(f&&(f=+f.substring(1)),(c||"0"===r&&"="===u)&&(c=r="0",u="="),d){case"n":h=!0,d="g";break;case"%":p=100,m="%",d="f";break;case"p":p=100,m="%",d="r";break;case"b":case"o":case"x":case"X":"#"===s&&(g="0"+d.toLowerCase());case"c":v=!1;case"d":y=!0,f=0;break;case"s":p=-1,d="r"}"$"===s&&(g=i[0],m=i[1]),"r"!=d||f||(d="g"),null!=f&&("g"==d?f=Math.max(1,Math.min(21,f)):("e"==d||"f"==d)&&(f=Math.max(0,Math.min(20,f)))),d=oo.get(d)||Pt;var b=c&&h;return function(t){var n=m;if(y&&t%1)return"";var i=0>t||0===t&&0>1/t?(t=-t,"-"):"-"===o?"":o;if(0>p){var s=nu.formatPrefix(t,f);t=s.scale(t),n=s.symbol+m}else t*=p;t=d(t,f);var _,x,w=t.lastIndexOf(".");if(0>w){var A=v?t.lastIndexOf("e"):-1;0>A?(_=t,x=""):(_=t.substring(0,A),x=t.substring(A))}else _=t.substring(0,w),x=e+t.substring(w+1);!c&&h&&(_=a(_,1/0));var E=g.length+_.length+x.length+(b?0:i.length),k=l>E?new Array(E=l-E+1).join(r):"";return b&&(_=a(k+_,k.length?l-x.length:1/0)),i+=g,t=_+x,("<"===u?i+t+k:">"===u?k+i+t:"^"===u?k.substring(0,E>>=1)+i+t+k.substring(E):i+(b?t:k+t))+n}}}function Pt(t){return t+""}function qt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function jt(t,e,n){function r(e){var n=t(e),r=a(n,1);return r-e>e-n?n:r}function i(n){return e(n=t(new co(n-1)),1),n}function a(t,n){return e(t=new co(+t),n),t}function u(t,r,a){var u=i(t),o=[];if(a>1)for(;r>u;)n(u)%a||o.push(new Date(+u)),e(u,1);else for(;r>u;)o.push(new Date(+u)),e(u,1);return o}function o(t,e,n){try{co=qt;var r=new qt;return r._=t,u(r,e,n)}finally{co=Date}}t.floor=t,t.round=r,t.ceil=i,t.offset=a,t.range=u;var s=t.utc=Ut(t);return s.floor=s,s.round=Ut(r),s.ceil=Ut(i),s.offset=Ut(a),s.range=o,t}function Ut(t){return function(e,n){try{co=qt;var r=new qt;return r._=e,t(r,n)._}finally{co=Date}}}function Yt(t){function e(t){function e(e){for(var n,i,a,u=[],o=-1,s=0;++oo;){if(r>=c)return-1;if(i=e.charCodeAt(o++),37===i){if(u=e.charAt(o++),a=M[u in ho?e.charAt(o++):u],!a||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function r(t,e,n){w.lastIndex=0;var r=w.exec(e.slice(n));return r?(t.w=A.get(r[0].toLowerCase()),n+r[0].length):-1}function i(t,e,n){_.lastIndex=0;var r=_.exec(e.slice(n));return r?(t.w=x.get(r[0].toLowerCase()),n+r[0].length):-1}function a(t,e,n){D.lastIndex=0;var r=D.exec(e.slice(n));return r?(t.m=C.get(r[0].toLowerCase()),n+r[0].length):-1}function u(t,e,n){E.lastIndex=0;var r=E.exec(e.slice(n));return r?(t.m=k.get(r[0].toLowerCase()),n+r[0].length):-1}function o(t,e,r){return n(t,S.c.toString(),e,r)}function s(t,e,r){return n(t,S.x.toString(),e,r)}function c(t,e,r){return n(t,S.X.toString(),e,r)}function l(t,e,n){var r=b.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}var h=t.dateTime,f=t.date,d=t.time,p=t.periods,g=t.days,m=t.shortDays,y=t.months,v=t.shortMonths;e.utc=function(t){function n(t){try{co=qt;var e=new co;return e._=t,r(e)}finally{co=Date}}var r=e(t);return n.parse=function(t){try{co=qt;var e=r.parse(t);return e&&e._}finally{co=Date}},n.toString=r.toString,n},e.multi=e.utc.multi=se;var b=nu.map(),_=zt(g),x=$t(g),w=zt(m),A=$t(m),E=zt(y),k=$t(y),D=zt(v),C=$t(v);p.forEach(function(t,e){b.set(t.toLowerCase(),e)});var S={a:function(t){return m[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return v[t.getMonth()]},B:function(t){return y[t.getMonth()]},c:e(h),d:function(t,e){return Vt(t.getDate(),e,2)},e:function(t,e){return Vt(t.getDate(),e,2)},H:function(t,e){return Vt(t.getHours(),e,2)},I:function(t,e){return Vt(t.getHours()%12||12,e,2)},j:function(t,e){return Vt(1+so.dayOfYear(t),e,3)},L:function(t,e){return Vt(t.getMilliseconds(),e,3)},m:function(t,e){return Vt(t.getMonth()+1,e,2)},M:function(t,e){return Vt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Vt(t.getSeconds(),e,2)},U:function(t,e){return Vt(so.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Vt(so.mondayOfYear(t),e,2)},x:e(f),X:e(d),y:function(t,e){return Vt(t.getFullYear()%100,e,2)},Y:function(t,e){return Vt(t.getFullYear()%1e4,e,4)},Z:ue,"%":function(){return"%"}},M={a:r,A:i,b:a,B:u,c:o,d:te,e:te,H:ne,I:ne,j:ee,L:ae,m:Qt,M:re,p:l,S:ie,U:Gt,w:Ht,W:Wt,x:s,X:c,y:Xt,Y:Zt,Z:Jt,"%":oe};return e}function Vt(t,e,n){var r=0>t?"-":"",i=(r?-t:t)+"",a=i.length;return r+(n>a?new Array(n-a+1).join(e)+i:i)}function zt(t){return new RegExp("^(?:"+t.map(nu.requote).join("|")+")","i")}function $t(t){for(var e=new l,n=-1,r=t.length;++n68?1900:2e3)}function Qt(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function te(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function ee(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function ne(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function re(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function ie(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function ae(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function ue(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=pu(e)/60|0,i=pu(e)%60;return n+Vt(r,"0",2)+Vt(i,"0",2)}function oe(t,e,n){po.lastIndex=0;var r=po.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function se(t){for(var e=t.length,n=-1;++n=0?1:-1,o=u*n,s=Math.cos(e),c=Math.sin(e),l=a*c,h=i*s+l*Math.cos(o),f=l*u*Math.sin(o);_o.add(Math.atan2(f,h)),r=t,i=s,a=c}var e,n,r,i,a;xo.point=function(u,o){xo.point=t,r=(e=u)*Ou,i=Math.cos(o=(n=o)*Ou/2+Lu/4),a=Math.sin(o)},xo.lineEnd=function(){t(e,n)}}function ge(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function me(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ye(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ve(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function be(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function _e(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function xe(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function we(t,e){return pu(t[0]-e[0])o;++o)i.point((n=t[o])[0],n[1]);return void i.lineEnd()}var s=new Le(n,t,null,!0),c=new Le(n,null,s,!1);s.o=c,a.push(s),u.push(c),s=new Le(r,t,null,!1),c=new Le(r,null,s,!0),s.o=c,a.push(s),u.push(c)}}),u.sort(e),Fe(a),Fe(u),a.length){for(var o=0,s=n,c=u.length;c>o;++o)u[o].e=s=!s;for(var l,h,f=a[0];;){for(var d=f,p=!0;d.v;)if((d=d.n)===f)return;l=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(p)for(var o=0,c=l.length;c>o;++o)i.point((h=l[o])[0],h[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(p){l=d.p.z;for(var o=l.length-1;o>=0;--o)i.point((h=l[o])[0],h[1])}else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,l=d.z,p=!p}while(!d.v);i.lineEnd()}}}function Fe(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r0){for(x||(a.polygonStart(),x=!0),a.lineStart();++u1&&2&e&&n.push(n.pop().concat(n.shift())),d.push(n.filter(Ne))}var d,p,g,m=e(a),y=i.invert(r[0],r[1]),v={point:u,lineStart:s,lineEnd:c,polygonStart:function(){v.point=l,v.lineStart=h,v.lineEnd=f,d=[],p=[]},polygonEnd:function(){v.point=u,v.lineStart=s,v.lineEnd=c,d=nu.merge(d);var t=je(y,p);d.length?(x||(a.polygonStart(),x=!0),Te(d,Oe,t,n,a)):t&&(x||(a.polygonStart(),x=!0),a.lineStart(),n(null,null,1,a),a.lineEnd()),x&&(a.polygonEnd(),x=!1),d=p=null},sphere:function(){a.polygonStart(),a.lineStart(),n(null,null,1,a),a.lineEnd(),a.polygonEnd()}},b=Ie(),_=e(b),x=!1;return v}}function Ne(t){return t.length>1}function Ie(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:w,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Oe(t,e){return((t=t.x)[0]<0?t[1]-Iu-Tu:Iu-t[1])-((e=e.x)[0]<0?e[1]-Iu-Tu:Iu-e[1])}function Re(t){var e,n=0/0,r=0/0,i=0/0;return{lineStart:function(){t.lineStart(),e=1},point:function(a,u){var o=a>0?Lu:-Lu,s=pu(a-n);pu(s-Lu)0?Iu:-Iu),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(o,r),t.point(a,r),e=0):i!==o&&s>=Lu&&(pu(n-i)Tu?Math.atan((Math.sin(e)*(a=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*a*u)):(e+r)/2}function qe(t,e,n,r){var i;if(null==t)i=n*Iu,r.point(-Lu,i),r.point(0,i),r.point(Lu,i),r.point(Lu,0),r.point(Lu,-i),r.point(0,-i),r.point(-Lu,-i),r.point(-Lu,0),r.point(-Lu,i);else if(pu(t[0]-e[0])>Tu){var a=t[0]o;++o){var c=e[o],l=c.length;if(l)for(var h=c[0],f=h[0],d=h[1]/2+Lu/4,p=Math.sin(d),g=Math.cos(d),m=1;;){m===l&&(m=0),t=c[m];var y=t[0],v=t[1]/2+Lu/4,b=Math.sin(v),_=Math.cos(v),x=y-f,w=x>=0?1:-1,A=w*x,E=A>Lu,k=p*b;if(_o.add(Math.atan2(k*w*Math.sin(A),g*_+k*Math.cos(A))),a+=E?x+w*Bu:x,E^f>=n^y>=n){var D=ye(ge(h),ge(t));_e(D);var C=ye(i,D);_e(C);var S=(E^x>=0?-1:1)*nt(C[2]);(r>S||r===S&&(D[0]||D[1]))&&(u+=E^x>=0?1:-1)}if(!m++)break;f=y,p=b,g=_,h=t}}return(-Tu>a||Tu>a&&0>_o)^1&u}function Ue(t){function e(t,e){return Math.cos(t)*Math.cos(e)>a}function n(t){var n,a,s,c,l;return{lineStart:function(){c=s=!1,l=1},point:function(h,f){var d,p=[h,f],g=e(h,f),m=u?g?0:i(h,f):g?i(h+(0>h?Lu:-Lu),f):0;if(!n&&(c=s=g)&&t.lineStart(),g!==s&&(d=r(n,p),(we(n,d)||we(p,d))&&(p[0]+=Tu,p[1]+=Tu,g=e(p[0],p[1]))),g!==s)l=0,g?(t.lineStart(),d=r(p,n),t.point(d[0],d[1])):(d=r(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(o&&n&&u^g){var y;m&a||!(y=r(p,n,!0))||(l=0,u?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!g||n&&we(n,p)||t.point(p[0],p[1]),n=p,s=g,a=m},lineEnd:function(){s&&t.lineEnd(),n=null},clean:function(){return l|(c&&s)<<1}}}function r(t,e,n){var r=ge(t),i=ge(e),u=[1,0,0],o=ye(r,i),s=me(o,o),c=o[0],l=s-c*c;if(!l)return!n&&t;var h=a*s/l,f=-a*c/l,d=ye(u,o),p=be(u,h),g=be(o,f);ve(p,g);var m=d,y=me(p,m),v=me(m,m),b=y*y-v*(me(p,p)-1);if(!(0>b)){var _=Math.sqrt(b),x=be(m,(-y-_)/v);if(ve(x,p),x=xe(x),!n)return x;var w,A=t[0],E=e[0],k=t[1],D=e[1];A>E&&(w=A,A=E,E=w);var C=E-A,S=pu(C-Lu)C;if(!S&&k>D&&(w=k,k=D,D=w),M?S?k+D>0^x[1]<(pu(x[0]-A)Lu^(A<=x[0]&&x[0]<=E)){var T=be(m,(-y+_)/v);return ve(T,p),[x,xe(T)]}}}function i(e,n){var r=u?t:Lu-t,i=0;return-r>e?i|=1:e>r&&(i|=2),-r>n?i|=4:n>r&&(i|=8),i}var a=Math.cos(t),u=a>0,o=pu(a)>Tu,s=gn(t,6*Ou);return Be(e,n,s,u?[0,-t]:[-Lu,t-Lu])}function Ye(t,e,n,r){return function(i){var a,u=i.a,o=i.b,s=u.x,c=u.y,l=o.x,h=o.y,f=0,d=1,p=l-s,g=h-c;if(a=t-s,p||!(a>0)){if(a/=p,0>p){if(f>a)return;d>a&&(d=a)}else if(p>0){if(a>d)return;a>f&&(f=a)}if(a=n-s,p||!(0>a)){if(a/=p,0>p){if(a>d)return;a>f&&(f=a)}else if(p>0){if(f>a)return;d>a&&(d=a)}if(a=e-c,g||!(a>0)){if(a/=g,0>g){if(f>a)return;d>a&&(d=a)}else if(g>0){if(a>d)return;a>f&&(f=a)}if(a=r-c,g||!(0>a)){if(a/=g,0>g){if(a>d)return;a>f&&(f=a)}else if(g>0){if(f>a)return;d>a&&(d=a)}return f>0&&(i.a={x:s+f*p,y:c+f*g}),1>d&&(i.b={x:s+d*p,y:c+d*g}),i}}}}}}function Ve(t,e,n,r){function i(r,i){return pu(r[0]-t)0?0:3:pu(r[0]-n)0?2:1:pu(r[1]-e)0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=i(t,1),r=i(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){function s(t){for(var e=0,n=m.length,r=t[1],i=0;n>i;++i)for(var a,u=1,o=m[i],s=o.length,c=o[0];s>u;++u)a=o[u],c[1]<=r?a[1]>r&&tt(c,a,t)>0&&++e:a[1]<=r&&tt(c,a,t)<0&&--e,c=a;return 0!==e}function c(a,o,s,c){var l=0,h=0;if(null==a||(l=i(a,s))!==(h=i(o,s))||u(a,o)<0^s>0){do c.point(0===l||3===l?t:n,l>1?r:e);while((l=(l+s+4)%4)!==h)}else c.point(o[0],o[1])}function l(i,a){return i>=t&&n>=i&&a>=e&&r>=a}function h(t,e){l(t,e)&&o.point(t,e)}function f(){M.point=p,m&&m.push(y=[]),E=!0,A=!1,x=w=0/0}function d(){g&&(p(v,b),_&&A&&C.rejoin(),g.push(C.buffer())),M.point=h,A&&o.lineEnd()}function p(t,e){t=Math.max(-Io,Math.min(Io,t)),e=Math.max(-Io,Math.min(Io,e));var n=l(t,e);if(m&&y.push([t,e]),E)v=t,b=e,_=n,E=!1,n&&(o.lineStart(),o.point(t,e));else if(n&&A)o.point(t,e);else{var r={a:{x:x,y:w},b:{x:t,y:e}};S(r)?(A||(o.lineStart(),o.point(r.a.x,r.a.y)),o.point(r.b.x,r.b.y),n||o.lineEnd(),k=!1):n&&(o.lineStart(),o.point(t,e),k=!1)}x=t,w=e,A=n}var g,m,y,v,b,_,x,w,A,E,k,D=o,C=Ie(),S=Ye(t,e,n,r),M={point:h,lineStart:f,lineEnd:d,polygonStart:function(){o=C,g=[],m=[],k=!0},polygonEnd:function(){o=D,g=nu.merge(g);var e=s([t,r]),n=k&&e,i=g.length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),c(null,null,1,o),o.lineEnd()),i&&Te(g,a,e,c,o),o.polygonEnd()),g=m=y=null}};return M}}function ze(t){var e=0,n=Lu/3,r=on(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Lu/180,n=t[1]*Lu/180):[e/Lu*180,n/Lu*180]},i}function $e(t,e){function n(t,e){var n=Math.sqrt(a-2*i*Math.sin(e))/i;return[n*Math.sin(t*=i),u-n*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(e))/2,a=1+r*(2*i-r),u=Math.sqrt(a)/i;return n.invert=function(t,e){var n=u-e;return[Math.atan2(t,n)/i,nt((a-(t*t+n*n)*i*i)/(2*i))]},n}function He(){function t(t,e){Ro+=i*t-r*e,r=t,i=e}var e,n,r,i;Yo.point=function(a,u){Yo.point=t,e=r=a,n=i=u},Yo.lineEnd=function(){t(e,n)}}function Ge(t,e){Po>t&&(Po=t),t>jo&&(jo=t),qo>e&&(qo=e),e>Uo&&(Uo=e)}function We(){function t(t,e){u.push("M",t,",",e,a)}function e(t,e){u.push("M",t,",",e),o.point=n}function n(t,e){u.push("L",t,",",e)}function r(){o.point=t}function i(){u.push("Z")}var a=Ze(4.5),u=[],o={point:t,lineStart:function(){o.point=e},lineEnd:r,polygonStart:function(){o.lineEnd=i},polygonEnd:function(){o.lineEnd=r,o.point=t},pointRadius:function(t){return a=Ze(t),o},result:function(){if(u.length){var t=u.join("");return u=[],t}}};return o}function Ze(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Xe(t,e){Eo+=t,ko+=e,++Do}function Je(){function t(t,r){var i=t-e,a=r-n,u=Math.sqrt(i*i+a*a);Co+=u*(e+t)/2,So+=u*(n+r)/2,Mo+=u,Xe(e=t,n=r)}var e,n;zo.point=function(r,i){zo.point=t,Xe(e=r,n=i)}}function Ke(){zo.point=Xe}function Qe(){function t(t,e){var n=t-r,a=e-i,u=Math.sqrt(n*n+a*a);Co+=u*(r+t)/2,So+=u*(i+e)/2,Mo+=u,u=i*t-r*e,To+=u*(r+t),Fo+=u*(i+e),Lo+=3*u,Xe(r=t,i=e)}var e,n,r,i;zo.point=function(a,u){zo.point=t,Xe(e=r=a,n=i=u)},zo.lineEnd=function(){t(e,n)}}function tn(t){function e(e,n){t.moveTo(e+u,n),t.arc(e,n,u,0,Bu)}function n(e,n){t.moveTo(e,n),o.point=r}function r(e,n){t.lineTo(e,n)}function i(){o.point=e}function a(){t.closePath(); -}return function(o){function s(t){for(var e=0,n=m.length,r=t[1],i=0;n>i;++i)for(var a,u=1,o=m[i],s=o.length,c=o[0];s>u;++u)a=o[u],c[1]<=r?a[1]>r&&tt(c,a,t)>0&&++e:a[1]<=r&&tt(c,a,t)<0&&--e,c=a;return 0!==e}function c(a,o,s,c){var l=0,h=0;if(null==a||(l=i(a,s))!==(h=i(o,s))||u(a,o)<0^s>0){do c.point(0===l||3===l?t:n,l>1?r:e);while((l=(l+s+4)%4)!==h)}else c.point(o[0],o[1])}function l(i,a){return i>=t&&n>=i&&a>=e&&r>=a}function h(t,e){l(t,e)&&o.point(t,e)}function f(){S.point=p,m&&m.push(y=[]),E=!0,A=!1,x=w=0/0}function d(){g&&(p(v,b),_&&A&&C.rejoin(),g.push(C.buffer())),S.point=h,A&&o.lineEnd()}function p(t,e){t=Math.max(-Oo,Math.min(Oo,t)),e=Math.max(-Oo,Math.min(Oo,e));var n=l(t,e);if(m&&y.push([t,e]),E)v=t,b=e,_=n,E=!1,n&&(o.lineStart(),o.point(t,e));else if(n&&A)o.point(t,e);else{var r={a:{x:x,y:w},b:{x:t,y:e}};M(r)?(A||(o.lineStart(),o.point(r.a.x,r.a.y)),o.point(r.b.x,r.b.y),n||o.lineEnd(),k=!1):n&&(o.lineStart(),o.point(t,e),k=!1)}x=t,w=e,A=n}var g,m,y,v,b,_,x,w,A,E,k,D=o,C=Oe(),M=Ye(t,e,n,r),S={point:h,lineStart:f,lineEnd:d,polygonStart:function(){o=C,g=[],m=[],k=!0},polygonEnd:function(){o=D,g=nu.merge(g);var e=s([t,r]),n=k&&e,i=g.length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),c(null,null,1,o),o.lineEnd()),i&&Te(g,a,e,c,o),o.polygonEnd()),g=m=y=null}};return S}}function Ve(t){var e=0,n=Bu/3,r=on(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Bu/180,n=t[1]*Bu/180):[e/Bu*180,n/Bu*180]},i}function $e(t,e){function n(t,e){var n=Math.sqrt(a-2*i*Math.sin(e))/i;return[n*Math.sin(t*=i),u-n*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(e))/2,a=1+r*(2*i-r),u=Math.sqrt(a)/i;return n.invert=function(t,e){var n=u-e;return[Math.atan2(t,n)/i,nt((a-(t*t+n*n)*i*i)/(2*i))]},n}function Ge(){function t(t,e){Ro+=i*t-r*e,r=t,i=e}var e,n,r,i;Yo.point=function(a,u){Yo.point=t,e=r=a,n=i=u},Yo.lineEnd=function(){t(e,n)}}function He(t,e){Po>t&&(Po=t),t>jo&&(jo=t),qo>e&&(qo=e),e>Uo&&(Uo=e)}function We(){function t(t,e){u.push("M",t,",",e,a)}function e(t,e){u.push("M",t,",",e),o.point=n}function n(t,e){u.push("L",t,",",e)}function r(){o.point=t}function i(){u.push("Z")}var a=Ze(4.5),u=[],o={point:t,lineStart:function(){o.point=e},lineEnd:r,polygonStart:function(){o.lineEnd=i},polygonEnd:function(){o.lineEnd=r,o.point=t},pointRadius:function(t){return a=Ze(t),o},result:function(){if(u.length){var t=u.join("");return u=[],t}}};return o}function Ze(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Xe(t,e){Eo+=t,ko+=e,++Do}function Je(){function t(t,r){var i=t-e,a=r-n,u=Math.sqrt(i*i+a*a);Co+=u*(e+t)/2,Mo+=u*(n+r)/2,So+=u,Xe(e=t,n=r)}var e,n;Vo.point=function(r,i){Vo.point=t,Xe(e=r,n=i)}}function Ke(){Vo.point=Xe}function Qe(){function t(t,e){var n=t-r,a=e-i,u=Math.sqrt(n*n+a*a);Co+=u*(r+t)/2,Mo+=u*(i+e)/2,So+=u,u=i*t-r*e,To+=u*(r+t),Fo+=u*(i+e),Bo+=3*u,Xe(r=t,i=e)}var e,n,r,i;Vo.point=function(a,u){Vo.point=t,Xe(e=r=a,n=i=u)},Vo.lineEnd=function(){t(e,n)}}function tn(t){function e(e,n){t.moveTo(e+u,n),t.arc(e,n,u,0,Lu)}function n(e,n){t.moveTo(e,n),o.point=r}function r(e,n){t.lineTo(e,n)}function i(){o.point=e}function a(){t.closePath()}var u=4.5,o={point:e,lineStart:function(){o.point=n},lineEnd:i,polygonStart:function(){o.lineEnd=a},polygonEnd:function(){o.lineEnd=i,o.point=e},pointRadius:function(t){return u=t,o},result:w};return o}function en(t){function e(t){return(o?r:n)(t)}function n(e){return an(e,function(n,r){n=t(n,r),e.point(n[0],n[1])})}function r(e){function n(n,r){n=t(n,r),e.point(n[0],n[1])}function r(){b=0/0,E.point=a,e.lineStart()}function a(n,r){var a=ge([n,r]),u=t(n,r);i(b,_,v,x,w,A,b=u[0],_=u[1],v=n,x=a[0],w=a[1],A=a[2],o,e),e.point(b,_)}function u(){E.point=n,e.lineEnd()}function s(){r(),E.point=c,E.lineEnd=l}function c(t,e){a(h=t,f=e),d=b,p=_,g=x,m=w,y=A,E.point=a}function l(){i(b,_,v,x,w,A,d,p,h,g,m,y,o,e),E.lineEnd=u,u()}var h,f,d,p,g,m,y,v,b,_,x,w,A,E={point:n,lineStart:r,lineEnd:u,polygonStart:function(){e.polygonStart(),E.lineStart=s},polygonEnd:function(){e.polygonEnd(),E.lineStart=r}};return E}function i(e,n,r,o,s,c,l,h,f,d,p,g,m,y){var v=l-e,b=h-n,_=v*v+b*b;if(_>4*a&&m--){var x=o+d,w=s+p,A=c+g,E=Math.sqrt(x*x+w*w+A*A),k=Math.asin(A/=E),D=pu(pu(A)-1)a||pu((v*T+b*F)/_-.5)>.3||u>o*d+s*p+c*g)&&(i(e,n,r,o,s,c,M,S,D,x/=E,w/=E,A,m,y),y.point(M,S),i(M,S,D,x,w,A,l,h,f,d,p,g,m,y))}}var a=.5,u=Math.cos(30*Iu),o=16;return e.precision=function(t){return arguments.length?(o=(a=t*t)>0&&16,e):Math.sqrt(a)},e}function nn(t){var e=en(function(e,n){return t([e*Ru,n*Ru])});return function(t){return sn(e(t))}}function rn(t){this.stream=t}function an(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function un(t){return on(function(){return t})()}function on(t){function e(t){return t=o(t[0]*Iu,t[1]*Iu),[t[0]*f+s,c-t[1]*f]}function n(t){return t=o.invert((t[0]-s)/f,(c-t[1])/f),t&&[t[0]*Ru,t[1]*Ru]}function r(){o=Me(u=hn(y,v,_),a);var t=a(g,m);return s=d-t[0]*f,c=p+t[1]*f,i()}function i(){return l&&(l.valid=!1,l=null),e}var a,u,o,s,c,l,h=en(function(t,e){return t=a(t,e),[t[0]*f+s,c-t[1]*f]}),f=150,d=480,p=250,g=0,m=0,y=0,v=0,_=0,x=No,w=b,A=null,E=null;return e.stream=function(t){return l&&(l.valid=!1),l=sn(x(u,h(w(t)))),l.valid=!0,l},e.clipAngle=function(t){return arguments.length?(x=null==t?(A=t,No):Ue((A=+t)*Iu),i()):A},e.clipExtent=function(t){return arguments.length?(E=t,w=t?ze(t[0][0],t[0][1],t[1][0],t[1][1]):b,i()):E},e.scale=function(t){return arguments.length?(f=+t,r()):f},e.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],r()):[d,p]},e.center=function(t){return arguments.length?(g=t[0]%360*Iu,m=t[1]%360*Iu,r()):[g*Ru,m*Ru]},e.rotate=function(t){return arguments.length?(y=t[0]%360*Iu,v=t[1]%360*Iu,_=t.length>2?t[2]%360*Iu:0,r()):[y*Ru,v*Ru,_*Ru]},nu.rebind(e,h,"precision"),function(){return a=t.apply(this,arguments),e.invert=a.invert&&n,r()}}function sn(t){return an(t,function(e,n){t.point(e*Iu,n*Iu)})}function cn(t,e){return[t,e]}function ln(t,e){return[t>Bu?t-Lu:-Bu>t?t+Lu:t,e]}function hn(t,e,n){return t?e||n?Me(dn(t),pn(e,n)):dn(t):e||n?pn(e,n):ln}function fn(t){return function(e,n){return e+=t,[e>Bu?e-Lu:-Bu>e?e+Lu:e,n]}}function dn(t){var e=fn(t);return e.invert=fn(-t),e}function pn(t,e){function n(t,e){var n=Math.cos(e),o=Math.cos(t)*n,s=Math.sin(t)*n,c=Math.sin(e),l=c*r+o*i;return[Math.atan2(s*a-l*u,o*r-c*i),nt(l*a+s*u)]}var r=Math.cos(t),i=Math.sin(t),a=Math.cos(e),u=Math.sin(e);return n.invert=function(t,e){var n=Math.cos(e),o=Math.cos(t)*n,s=Math.sin(t)*n,c=Math.sin(e),l=c*a-s*u;return[Math.atan2(s*a+c*u,o*r+l*i),nt(l*r-o*i)]},n}function gn(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,a,u,o){var s=u*e;null!=i?(i=mn(n,i),a=mn(n,a),(u>0?a>i:i>a)&&(i+=u*Lu)):(i=t+u*Lu,a=t-.5*s);for(var c,l=i;u>0?l>a:a>l;l-=s)o.point((c=xe([n,-r*Math.cos(l),-r*Math.sin(l)]))[0],c[1])}}function mn(t,e){var n=ge(e);n[0]-=t,_e(n);var r=et(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Tu)%(2*Math.PI)}function yn(t,e,n){var r=nu.range(t,e-Tu,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function vn(t,e,n){var r=nu.range(t,e-Tu,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function bn(t){return t.source}function _n(t){return t.target}function xn(t,e,n,r){var i=Math.cos(e),a=Math.sin(e),u=Math.cos(r),o=Math.sin(r),s=i*Math.cos(t),c=i*Math.sin(t),l=u*Math.cos(n),h=u*Math.sin(n),f=2*Math.asin(Math.sqrt(ut(r-e)+i*u*ut(n-t))),d=1/Math.sin(f),p=f?function(t){var e=Math.sin(t*=f)*d,n=Math.sin(f-t)*d,r=n*s+e*l,i=n*c+e*h,u=n*a+e*o;return[Math.atan2(i,r)*Ru,Math.atan2(u,Math.sqrt(r*r+i*i))*Ru]}:function(){return[t*Ru,e*Ru]};return p.distance=f,p}function wn(){function t(t,i){var a=Math.sin(i*=Iu),u=Math.cos(i),o=pu((t*=Iu)-e),s=Math.cos(o);$o+=Math.atan2(Math.sqrt((o=u*Math.sin(o))*o+(o=r*a-n*u*s)*o),n*a+r*u*s),e=t,n=a,r=u}var e,n,r;Go.point=function(i,a){e=i*Iu,n=Math.sin(a*=Iu),r=Math.cos(a),Go.point=t},Go.lineEnd=function(){Go.point=Go.lineEnd=w}}function An(t,e){function n(e,n){var r=Math.cos(e),i=Math.cos(n),a=t(r*i);return[a*i*Math.sin(e),a*Math.sin(n)]}return n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),i=e(r),a=Math.sin(i),u=Math.cos(i);return[Math.atan2(t*a,r*u),Math.asin(r&&n*a/r)]},n}function En(t,e){function n(t,e){u>0?-Ou+Tu>e&&(e=-Ou+Tu):e>Ou-Tu&&(e=Ou-Tu);var n=u/Math.pow(i(e),a);return[n*Math.sin(a*t),u-n*Math.cos(a*t)]}var r=Math.cos(t),i=function(t){return Math.tan(Bu/4+t/2)},a=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(i(e)/i(t)),u=r*Math.pow(i(t),a)/a;return a?(n.invert=function(t,e){var n=u-e,r=Q(a)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/a,2*Math.atan(Math.pow(u/r,1/a))-Ou]},n):Dn}function kn(t,e){function n(t,e){var n=a-e;return[n*Math.sin(i*t),a-n*Math.cos(i*t)]}var r=Math.cos(t),i=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),a=r/i+t;return pu(i)i;i++){for(;r>1&&tt(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function Bn(t,e){return t[0]-e[0]||t[1]-e[1]}function Ln(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function Nn(t,e,n,r){var i=t[0],a=n[0],u=e[0]-i,o=r[0]-a,s=t[1],c=n[1],l=e[1]-s,h=r[1]-c,f=(o*(s-c)-h*(i-a))/(h*u-o*l);return[i+f*u,s+f*l]}function On(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function In(){rr(this),this.edge=this.site=this.circle=null}function Rn(t){var e=is.pop()||new In;return e.site=t,e}function Pn(t){Wn(t),es.remove(t),is.push(t),rr(t)}function qn(t){var e=t.circle,n=e.x,r=e.cy,i={x:n,y:r},a=t.P,u=t.N,o=[t];Pn(t);for(var s=a;s.circle&&pu(n-s.circle.x)l;++l)c=o[l],s=o[l-1],tr(c.edge,s.site,c.site,i);s=o[0],c=o[h-1],c.edge=Kn(s.site,c.site,null,i),Hn(s),Hn(c)}function jn(t){for(var e,n,r,i,a=t.x,u=t.y,o=es._;o;)if(r=Un(o,u)-a,r>Tu)o=o.L;else{if(i=a-Yn(o,u),!(i>Tu)){r>-Tu?(e=o.P,n=o):i>-Tu?(e=o,n=o.N):e=n=o;break}if(!o.R){e=o;break}o=o.R}var s=Rn(t);if(es.insert(e,s),e||n){if(e===n)return Wn(e),n=Rn(e.site),es.insert(s,n),s.edge=n.edge=Kn(e.site,s.site),Hn(e),void Hn(n);if(!n)return void(s.edge=Kn(e.site,s.site));Wn(e),Wn(n);var c=e.site,l=c.x,h=c.y,f=t.x-l,d=t.y-h,p=n.site,g=p.x-l,m=p.y-h,y=2*(f*m-d*g),v=f*f+d*d,b=g*g+m*m,_={x:(m*v-d*b)/y+l,y:(f*b-g*v)/y+h};tr(n.edge,c,p,_),s.edge=Kn(c,t,null,_),n.edge=Kn(t,p,null,_),Hn(e),Hn(n)}}function Un(t,e){var n=t.site,r=n.x,i=n.y,a=i-e;if(!a)return r;var u=t.P;if(!u)return-(1/0);n=u.site;var o=n.x,s=n.y,c=s-e;if(!c)return o;var l=o-r,h=1/a-1/c,f=l/c;return h?(-f+Math.sqrt(f*f-2*h*(l*l/(-2*c)-s+c/2+i-a/2)))/h+r:(r+o)/2}function Yn(t,e){var n=t.N;if(n)return Un(n,e);var r=t.site;return r.y===e?r.x:1/0}function zn(t){this.site=t,this.edges=[]}function Vn(t){for(var e,n,r,i,a,u,o,s,c,l,h=t[0][0],f=t[1][0],d=t[0][1],p=t[1][1],g=ts,m=g.length;m--;)if(a=g[m],a&&a.prepare())for(o=a.edges,s=o.length,u=0;s>u;)l=o[u].end(),r=l.x,i=l.y,c=o[++u%s].start(),e=c.x,n=c.y,(pu(r-e)>Tu||pu(i-n)>Tu)&&(o.splice(u,0,new er(Qn(a.site,l,pu(r-h)Tu?{x:h,y:pu(e-h)Tu?{x:pu(n-p)Tu?{x:f,y:pu(e-f)Tu?{x:pu(n-d)=-Fu)){var d=s*s+c*c,p=l*l+h*h,g=(h*d-c*p)/f,m=(s*p-l*d)/f,h=m+o,y=as.pop()||new Gn;y.arc=t,y.site=i,y.x=g+u,y.y=h+Math.sqrt(g*g+m*m),y.cy=h,t.circle=y;for(var v=null,b=rs._;b;)if(y.ym||m>=o)return;if(f>p){if(a){if(a.y>=c)return}else a={x:m,y:s};n={x:m,y:c}}else{if(a){if(a.yr||r>1)if(f>p){if(a){if(a.y>=c)return}else a={x:(s-i)/r,y:s};n={x:(c-i)/r,y:c}}else{if(a){if(a.yd){if(a){if(a.x>=o)return}else a={x:u,y:r*u+i};n={x:o,y:r*o+i}}else{if(a){if(a.xa||h>u||r>f||i>d)){if(p=t.point){var p,g=e-t.x,m=n-t.y,y=g*g+m*m;if(s>y){var v=Math.sqrt(s=y);r=e-v,i=n-v,a=e+v,u=n+v,o=p}}for(var b=t.nodes,_=.5*(l+f),x=.5*(h+d),w=e>=_,A=n>=x,E=A<<1|w,k=E+4;k>E;++E)if(t=b[3&E])switch(3&E){case 0:c(t,l,h,_,x);break;case 1:c(t,_,h,f,x);break;case 2:c(t,l,x,_,d);break;case 3:c(t,_,x,f,d)}}}(t,r,i,a,u),o}function gr(t,e){t=nu.rgb(t),e=nu.rgb(e);var n=t.r,r=t.g,i=t.b,a=e.r-n,u=e.g-r,o=e.b-i;return function(t){return"#"+xt(Math.round(n+a*t))+xt(Math.round(r+u*t))+xt(Math.round(i+o*t))}}function mr(t,e){var n,r={},i={};for(n in t)n in e?r[n]=br(t[n],e[n]):i[n]=t[n];for(n in e)n in t||(i[n]=e[n]);return function(t){for(n in r)i[n]=r[n](t);return i}}function yr(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function vr(t,e){var n,r,i,a=os.lastIndex=ss.lastIndex=0,u=-1,o=[],s=[];for(t+="",e+="";(n=os.exec(t))&&(r=ss.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),o[u]?o[u]+=i:o[++u]=i),(n=n[0])===(r=r[0])?o[u]?o[u]+=r:o[++u]=r:(o[++u]=null,s.push({i:u,x:yr(n,r)})),a=ss.lastIndex;return ar;++r)o[(n=s[r]).i]=n.x(t);return o.join("")})}function br(t,e){for(var n,r=nu.interpolators.length;--r>=0&&!(n=nu.interpolators[r](t,e)););return n}function _r(t,e){var n,r=[],i=[],a=t.length,u=e.length,o=Math.min(t.length,e.length);for(n=0;o>n;++n)r.push(br(t[n],e[n]));for(;a>n;++n)i[n]=t[n];for(;u>n;++n)i[n]=e[n];return function(t){for(n=0;o>n;++n)i[n]=r[n](t);return i}}function xr(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function wr(t){return function(e){return 1-t(1-e)}}function Ar(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function Er(t){return t*t}function kr(t){return t*t*t}function Dr(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(.5>t?n:3*(t-e)+n-.75)}function Cr(t){return function(e){return Math.pow(e,t)}}function Mr(t){return 1-Math.cos(t*Ou)}function Sr(t){return Math.pow(2,10*(t-1))}function Tr(t){return 1-Math.sqrt(1-t*t)}function Fr(t,e){var n;return arguments.length<2&&(e=.45),arguments.length?n=e/Lu*Math.asin(1/t):(t=1,n=e/4),function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-n)*Lu/e)}}function Br(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function Lr(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Nr(t,e){t=nu.hcl(t),e=nu.hcl(e);var n=t.h,r=t.c,i=t.l,a=e.h-n,u=e.c-r,o=e.l-i;return isNaN(u)&&(u=0,r=isNaN(r)?e.c:r),isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:-180>a&&(a+=360),function(t){return ht(n+a*t,r+u*t,i+o*t)+""}}function Or(t,e){t=nu.hsl(t),e=nu.hsl(e);var n=t.h,r=t.s,i=t.l,a=e.h-n,u=e.s-r,o=e.l-i;return isNaN(u)&&(u=0,r=isNaN(r)?e.s:r),isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:-180>a&&(a+=360),function(t){return ct(n+a*t,r+u*t,i+o*t)+""}}function Ir(t,e){t=nu.lab(t),e=nu.lab(e);var n=t.l,r=t.a,i=t.b,a=e.l-n,u=e.a-r,o=e.b-i;return function(t){return dt(n+a*t,r+u*t,i+o*t)+""}}function Rr(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function Pr(t){var e=[t.a,t.b],n=[t.c,t.d],r=jr(e),i=qr(e,n),a=jr(Ur(n,e,-i))||0;e[0]*n[1]180?l+=360:l-c>180&&(c+=360),i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:yr(c,l)})):l&&r.push(r.pop()+"rotate("+l+")"),h!=f?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:yr(h,f)}):f&&r.push(r.pop()+"skewX("+f+")"),d[0]!=p[0]||d[1]!=p[1]?(n=r.push(r.pop()+"scale(",null,",",null,")"),i.push({i:n-4,x:yr(d[0],p[0])},{i:n-2,x:yr(d[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),n=i.length,function(t){for(var e,a=-1;++a=0;)n.push(i[r])}function ei(t,e){for(var n=[t],r=[];null!=(t=n.pop());)if(r.push(t),(a=t.children)&&(i=a.length))for(var i,a,u=-1;++un;++n)(e=t[n][1])>i&&(r=n,i=e);return r}function fi(t){return t.reduce(di,0)}function di(t,e){return t+e[1]}function pi(t,e){return gi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function gi(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,a=[];++n<=e;)a[n]=i*n+r;return a}function mi(t){return[nu.min(t),nu.max(t)]}function yi(t,e){return t.value-e.value}function vi(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function bi(t,e){t._pack_next=e,e._pack_prev=t}function _i(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return.999*i*i>n*n+r*r}function xi(t){function e(t){l=Math.min(t.x-t.r,l),h=Math.max(t.x+t.r,h),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}if((n=t.children)&&(c=n.length)){var n,r,i,a,u,o,s,c,l=1/0,h=-(1/0),f=1/0,d=-(1/0);if(n.forEach(wi),r=n[0],r.x=-r.r,r.y=0,e(r),c>1&&(i=n[1],i.x=i.r,i.y=0,e(i),c>2))for(a=n[2],ki(r,i,a),e(a),vi(r,a),r._pack_prev=a,vi(a,i),i=r._pack_next,u=3;c>u;u++){ki(r,i,a=n[u]);var p=0,g=1,m=1;for(o=i._pack_next;o!==i;o=o._pack_next,g++)if(_i(o,a)){p=1;break}if(1==p)for(s=r._pack_prev;s!==o._pack_prev&&!_i(s,a);s=s._pack_prev,m++);p?(m>g||g==m&&i.ru;u++)a=n[u],a.x-=y,a.y-=v,b=Math.max(b,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=b,n.forEach(Ai)}}function wi(t){t._pack_next=t._pack_prev=t}function Ai(t){delete t._pack_next,delete t._pack_prev}function Ei(t,e,n,r){var i=t.children;if(t.x=e+=r*t.x,t.y=n+=r*t.y,t.r*=r,i)for(var a=-1,u=i.length;++a=0;)e=i[a],e.z+=n,e.m+=n,n+=e.s+(r+=e.c)}function Fi(t,e,n){return t.a.parent===e.parent?t.a:n}function Bi(t){return 1+nu.max(t,function(t){return t.y})}function Li(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ni(t){var e=t.children;return e&&e.length?Ni(e[0]):t}function Oi(t){var e,n=t.children;return n&&(e=n.length)?Oi(n[e-1]):t}function Ii(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Ri(t,e){var n=t.x+e[3],r=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return 0>i&&(n+=i/2,i=0),0>a&&(r+=a/2,a=0),{x:n,y:r,dx:i,dy:a}}function Pi(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function qi(t){return t.rangeExtent?t.rangeExtent():Pi(t.range())}function ji(t,e,n,r){var i=n(t[0],t[1]),a=r(e[0],e[1]);return function(t){return a(i(t))}}function Ui(t,e){var n,r=0,i=t.length-1,a=t[r],u=t[i];return a>u&&(n=r,r=i,i=n,n=a,a=u,u=n),t[r]=e.floor(a),t[i]=e.ceil(u),t}function Yi(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:bs}function zi(t,e,n,r){var i=[],a=[],u=0,o=Math.min(t.length,e.length)-1;for(t[o]2?zi:ji,s=r?Vr:zr;return u=i(t,e,s,n),o=i(e,t,s,br),a}function a(t){return u(t)}var u,o;return a.invert=function(t){return o(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Rr)},a.clamp=function(t){return arguments.length?(r=t,i()):r},a.interpolate=function(t){return arguments.length?(n=t,i()):n},a.ticks=function(e){return Wi(t,e)},a.tickFormat=function(e,n){return Zi(t,e,n)},a.nice=function(e){return Gi(t,e),i()},a.copy=function(){return Vi(t,e,n,r)},i()}function $i(t,e){return nu.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Gi(t,e){return Ui(t,Yi(Hi(t,e)[2]))}function Hi(t,e){null==e&&(e=10);var n=Pi(t),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),a=e/r*i;return.15>=a?i*=10:.35>=a?i*=5:.75>=a&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function Wi(t,e){return nu.range.apply(nu,Hi(t,e))}function Zi(t,e,n){var r=Hi(t,e);if(n){var i=uo.exec(n);if(i.shift(),"s"===i[8]){var a=nu.formatPrefix(Math.max(pu(r[0]),pu(r[1])));return i[7]||(i[7]="."+Xi(a.scale(r[2]))),i[8]="f",n=nu.format(i.join("")),function(t){return n(a.scale(t))+a.symbol}}i[7]||(i[7]="."+Ji(i[8],r)),n=i.join("")}else n=",."+Xi(r[2])+"f";return nu.format(n)}function Xi(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function Ji(t,e){var n=Xi(e[2]);return t in _s?Math.abs(n-Xi(Math.max(pu(e[0]),pu(e[1]))))+ +("e"!==t):n-2*("%"===t)}function Ki(t,e,n,r){function i(t){return(n?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function u(e){return t(i(e))}return u.invert=function(e){return a(t.invert(e))},u.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((r=e.map(Number)).map(i)),u):r},u.base=function(n){return arguments.length?(e=+n,t.domain(r.map(i)),u):e},u.nice=function(){var e=Ui(r.map(i),n?Math:ws);return t.domain(e),r=e.map(a),u},u.ticks=function(){var t=Pi(r),u=[],o=t[0],s=t[1],c=Math.floor(i(o)),l=Math.ceil(i(s)),h=e%1?2:e;if(isFinite(l-c)){if(n){for(;l>c;c++)for(var f=1;h>f;f++)u.push(a(c)*f);u.push(a(c))}else for(u.push(a(c));c++0;f--)u.push(a(c)*f);for(c=0;u[c]s;l--);u=u.slice(c,l)}return u},u.tickFormat=function(t,e){if(!arguments.length)return xs;arguments.length<2?e=xs:"function"!=typeof e&&(e=nu.format(e));var r,o=Math.max(.1,t/u.ticks().length),s=n?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(t){return t/a(s(i(t)+r))<=o?e(t):""}},u.copy=function(){return Ki(t.copy(),e,n,r)},$i(u,t)}function Qi(t,e,n){function r(e){return t(i(e))}var i=ta(e),a=ta(1/e);return r.invert=function(e){return a(t.invert(e))},r.domain=function(e){return arguments.length?(t.domain((n=e.map(Number)).map(i)),r):n},r.ticks=function(t){return Wi(n,t)},r.tickFormat=function(t,e){return Zi(n,t,e)},r.nice=function(t){return r.domain(Gi(n,t))},r.exponent=function(u){return arguments.length?(i=ta(e=u),a=ta(1/e),t.domain(n.map(i)),r):e},r.copy=function(){return Qi(t.copy(),e,n)},$i(r,t)}function ta(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function ea(t,e){function n(n){return a[((i.get(n)||("range"===e.t?i.set(n,t.push(n)):0/0))-1)%a.length]}function r(e,n){return nu.range(t.length).map(function(t){return e+n*t})}var i,a,u;return n.domain=function(r){if(!arguments.length)return t;t=[],i=new l;for(var a,u=-1,o=r.length;++un?[0/0,0/0]:[n>0?o[n-1]:t[0],ne?0/0:e/a+t,[e,e+1/a]},r.copy=function(){return ra(t,e,n)},i()}function ia(t,e){function n(n){return n>=n?e[nu.bisect(t,n)]:void 0}return n.domain=function(e){return arguments.length?(t=e,n):t},n.range=function(t){return arguments.length?(e=t,n):e},n.invertExtent=function(n){return n=e.indexOf(n),[t[n-1],t[n]]},n.copy=function(){return ia(t,e)},n}function aa(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(n){return arguments.length?(t=n.map(e),e):t},e.ticks=function(e){return Wi(t,e)},e.tickFormat=function(e,n){return Zi(t,e,n)},e.copy=function(){return aa(t)},e}function ua(){return 0}function oa(t){return t.innerRadius}function sa(t){return t.outerRadius}function ca(t){return t.startAngle}function la(t){return t.endAngle}function ha(t){return t&&t.padAngle}function fa(t,e,n,r){return(t-n)*e-(e-r)*t>0?0:1}function da(t,e,n,r,i){var a=t[0]-e[0],u=t[1]-e[1],o=(i?r:-r)/Math.sqrt(a*a+u*u),s=o*u,c=-o*a,l=t[0]+s,h=t[1]+c,f=e[0]+s,d=e[1]+c,p=(l+f)/2,g=(h+d)/2,m=f-l,y=d-h,v=m*m+y*y,b=n-r,_=l*d-f*h,x=(0>y?-1:1)*Math.sqrt(b*b*v-_*_),w=(_*y-m*x)/v,A=(-_*m-y*x)/v,E=(_*y+m*x)/v,k=(-_*m+y*x)/v,D=w-p,C=A-g,M=E-p,S=k-g;return D*D+C*C>M*M+S*S&&(w=E,A=k),[[w-s,A-c],[w*n/b,A*n/b]]}function pa(t){function e(e){function u(){c.push("M",a(t(l),o))}for(var s,c=[],l=[],h=-1,f=e.length,d=Ct(n),p=Ct(r);++h1&&i.push("H",r[0]),i.join("")}function va(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e1){o=e[1],a=t[s],s++,r+="C"+(i[0]+u[0])+","+(i[1]+u[1])+","+(a[0]-o[0])+","+(a[1]-o[1])+","+a[0]+","+a[1];for(var c=2;c9&&(i=3*e/Math.sqrt(i),u[o]=i*n,u[o+1]=i*r));for(o=-1;++o<=s;)i=(t[Math.min(s,o+1)][0]-t[Math.max(0,o-1)][0])/(6*(1+u[o]*u[o])),a.push([i||0,u[o]*i||0]);return a}function Na(t){return t.length<3?ga(t):t[0]+Aa(t,La(t))}function Oa(t){for(var e,n,r,i=-1,a=t.length;++ir)return l();var i=a[a.active];i&&(--a.count,delete a[a.active],i.event&&i.event.interrupt.call(t,t.__data__,i.index)),a.active=r,u.event&&u.event.start.call(t,t.__data__,e),u.tween.forEach(function(n,r){(r=r.call(t,t.__data__,e))&&g.push(r)}),f=u.ease,h=u.duration,nu.timer(function(){return p.c=c(n||1)?Se:c,1},0,o)}function c(n){if(a.active!==r)return 1;for(var i=n/h,o=f(i),s=g.length;s>0;)g[--s].call(t,o);return i>=1?(u.event&&u.event.end.call(t,t.__data__,e),l()):void 0}function l(){return--a.count?delete a[r]:delete t[n],1}var h,f,d=u.delay,p=ro,g=[];return p.t=d+o,i>=d?s(i-d):void(p.c=s)},0,o)}}function Za(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function Xa(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}function Ja(t){return t.toISOString()}function Ka(t,e,n){function r(e){return t(e)}function i(t,n){var r=t[1]-t[0],i=r/n,a=nu.bisect(Hs,i);return a==Hs.length?[e.year,Hi(t.map(function(t){return t/31536e6}),n)[2]]:a?e[i/Hs[a-1]1?{floor:function(e){for(;n(e=t.floor(e));)e=Qa(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=Qa(+e+1);return e}}:t))},r.ticks=function(t,e){var n=Pi(r.domain()),a=null==t?i(n,10):"number"==typeof t?i(n,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(n[0],Qa(+n[1]+1),1>e?1:e)},r.tickFormat=function(){return n},r.copy=function(){return Ka(t.copy(),e,n)},$i(r,t)}function Qa(t){return new Date(t)}function tu(t){return JSON.parse(t.responseText)}function eu(t){var e=au.createRange();return e.selectNode(au.body),e.createContextualFragment(t.responseText)}var nu={version:"3.5.6"},ru=[].slice,iu=function(t){return ru.call(t)},au=this.document;if(au)try{iu(au.documentElement.childNodes)[0].nodeType}catch(uu){iu=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}if(Date.now||(Date.now=function(){return+new Date}),au)try{au.createElement("DIV").style.setProperty("opacity",0,"")}catch(ou){var su=this.Element.prototype,cu=su.setAttribute,lu=su.setAttributeNS,hu=this.CSSStyleDeclaration.prototype,fu=hu.setProperty;su.setAttribute=function(t,e){cu.call(this,t,e+"")},su.setAttributeNS=function(t,e,n){lu.call(this,t,e,n+"")},hu.setProperty=function(t,e,n){fu.call(this,t,e+"",n)}}nu.ascending=r,nu.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:0/0},nu.min=function(t,e){var n,r,i=-1,a=t.length;if(1===arguments.length){for(;++i=r){n=r;break}for(;++ir&&(n=r)}else{for(;++i=r){n=r;break}for(;++ir&&(n=r)}return n},nu.max=function(t,e){var n,r,i=-1,a=t.length;if(1===arguments.length){for(;++i=r){n=r;break}for(;++in&&(n=r)}else{for(;++i=r){n=r;break}for(;++in&&(n=r)}return n},nu.extent=function(t,e){var n,r,i,a=-1,u=t.length;if(1===arguments.length){for(;++a=r){n=i=r;break}for(;++ar&&(n=r),r>i&&(i=r))}else{for(;++a=r){n=i=r;break}for(;++ar&&(n=r),r>i&&(i=r))}return[n,i]},nu.sum=function(t,e){var n,r=0,i=t.length,u=-1;if(1===arguments.length)for(;++u1?s/(l-1):void 0},nu.deviation=function(){var t=nu.variance.apply(this,arguments);return t?Math.sqrt(t):t};var du=u(r);nu.bisectLeft=du.left,nu.bisect=nu.bisectRight=du.right,nu.bisector=function(t){return u(1===t.length?function(e,n){return r(t(e),n)}:t)},nu.shuffle=function(t,e,n){(a=arguments.length)<3&&(n=t.length,2>a&&(e=0));for(var r,i,a=n-e;a;)i=Math.random()*a--|0,r=t[a+e],t[a+e]=t[i+e],t[i+e]=r;return t},nu.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},nu.pairs=function(t){for(var e,n=0,r=t.length-1,i=t[0],a=new Array(0>r?0:r);r>n;)a[n]=[e=i,i=t[++n]];return a},nu.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,e=nu.min(arguments,o),n=new Array(e);++t=0;)for(r=t[i],e=r.length;--e>=0;)n[--u]=r[e];return n};var pu=Math.abs;nu.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n===1/0)throw new Error("infinite range");var r,i=[],a=s(pu(n)),u=-1;if(t*=a,e*=a,n*=a,0>n)for(;(r=t+n*++u)>e;)i.push(r/a);else for(;(r=t+n*++u)=a.length)return r?r.call(i,u):n?u.sort(n):u;for(var s,c,h,f,d=-1,p=u.length,g=a[o++],m=new l;++d=a.length)return t;var r=[],i=u[n++];return t.forEach(function(t,i){r.push({key:t,values:e(i,n)})}),i?r.sort(function(t,e){return i(t.key,e.key)}):r}var n,r,i={},a=[],u=[];return i.map=function(e,n){return t(n,e,0)},i.entries=function(n){return e(t(nu.map,n,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return u[a.length-1]=t,i},i.sortValues=function(t){return n=t,i},i.rollup=function(t){return r=t,i},i},nu.set=function(t){var e=new v;if(t)for(var n=0,r=t.length;r>n;++n)e.add(t[n]);return e},c(v,{has:d,add:function(t){return this._[h(t+="")]=!0,t},remove:p,values:g,size:m,empty:y,forEach:function(t){for(var e in this._)t.call(this,f(e))}}),nu.behavior={},nu.rebind=function(t,e){for(var n,r=1,i=arguments.length;++r=0&&(r=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},nu.event=null,nu.requote=function(t){return t.replace(vu,"\\$&")};var vu=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,bu={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},_u=function(t,e){return e.querySelector(t)},xu=function(t,e){return e.querySelectorAll(t)},wu=function(t,e){var n=t.matches||t[x(t,"matchesSelector")];return(wu=function(t,e){return n.call(t,e)})(t,e)};"function"==typeof Sizzle&&(_u=function(t,e){return Sizzle(t,e)[0]||null},xu=Sizzle,wu=Sizzle.matchesSelector),nu.selection=function(){return nu.select(au.documentElement)};var Au=nu.selection.prototype=[];Au.select=function(t){var e,n,r,i,a=[];t=S(t);for(var u=-1,o=this.length;++u=0&&(n=t.slice(0,e),t=t.slice(e+1)),Eu.hasOwnProperty(n)?{space:Eu[n],local:t}:t}},Au.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return t=nu.ns.qualify(t),t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(F(e,t[e]));return this}return this.each(F(t,e))},Au.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=N(t)).length,i=-1;if(e=n.classList){for(;++ii){if("string"!=typeof t){2>i&&(e="");for(r in t)this.each(R(r,t[r],e));return this}if(2>i){var a=this.node();return n(a).getComputedStyle(a,null).getPropertyValue(t)}r=""}return this.each(R(t,e,r))},Au.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(P(e,t[e]));return this}return this.each(P(t,e))},Au.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},Au.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},Au.append=function(t){return t=q(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Au.insert=function(t,e){return t=q(t),e=S(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},Au.remove=function(){return this.each(j)},Au.data=function(t,e){function n(t,n){var r,i,a,u=t.length,h=n.length,f=Math.min(u,h),d=new Array(h),p=new Array(h),g=new Array(u);if(e){var m,y=new l,v=new Array(u);for(r=-1;++rr;++r)p[r]=U(n[r]);for(;u>r;++r)g[r]=t[r]}p.update=d,p.parentNode=d.parentNode=g.parentNode=t.parentNode,o.push(p),s.push(d),c.push(g)}var r,i,a=-1,u=this.length;if(!arguments.length){for(t=new Array(u=(r=this[0]).length);++aa;a++){i.push(e=[]),e.parentNode=(n=this[a]).parentNode;for(var o=0,s=n.length;s>o;o++)(r=n[o])&&t.call(r,r.__data__,o,a)&&e.push(r)}return M(i)},Au.order=function(){for(var t=-1,e=this.length;++t=0;)(n=r[i])&&(a&&a!==n.nextSibling&&a.parentNode.insertBefore(n,a),a=n);return this},Au.sort=function(t){t=z.apply(this,arguments);for(var e=-1,n=this.length;++et;t++)for(var n=this[t],r=0,i=n.length;i>r;r++){var a=n[r];if(a)return a}return null},Au.size=function(){var t=0;return V(this,function(){++t}),t};var ku=[];nu.selection.enter=$,nu.selection.enter.prototype=ku,ku.append=Au.append,ku.empty=Au.empty,ku.node=Au.node,ku.call=Au.call,ku.size=Au.size,ku.select=function(t){for(var e,n,r,i,a,u=[],o=-1,s=this.length;++or){if("string"!=typeof t){2>r&&(e=!1);for(n in t)this.each(H(n,t[n],e));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;n=!1}return this.each(H(t,e,n))};var Du=nu.map({mouseenter:"mouseover",mouseleave:"mouseout"});au&&Du.forEach(function(t){"on"+t in au&&Du.remove(t)});var Cu,Mu=0;nu.mouse=function(t){return J(t,D())};var Su=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;nu.touch=function(t,e,n){if(arguments.length<3&&(n=e,e=D().changedTouches),e)for(var r,i=0,a=e.length;a>i;++i)if((r=e[i]).identifier===n)return J(t,r)},nu.behavior.drag=function(){function t(){this.on("mousedown.drag",a).on("touchstart.drag",u)}function e(t,e,n,a,u){return function(){function o(){var t,n,r=e(f,g);r&&(t=r[0]-b[0],n=r[1]-b[1],p|=t|n,b=r,d({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:t,dy:n}))}function s(){e(f,g)&&(y.on(a+m,null).on(u+m,null),v(p&&nu.event.target===h),d({type:"dragend"}))}var c,l=this,h=nu.event.target,f=l.parentNode,d=r.of(l,arguments),p=0,g=t(),m=".drag"+(null==g?"":"-"+g),y=nu.select(n(h)).on(a+m,o).on(u+m,s),v=X(h),b=e(f,g);i?(c=i.apply(l,arguments),c=[c.x-b[0],c.y-b[1]]):c=[0,0],d({type:"dragstart"})}}var r=C(t,"drag","dragstart","dragend"),i=null,a=e(w,nu.mouse,n,"mousemove","mouseup"),u=e(K,nu.touch,b,"touchmove","touchend");return t.origin=function(e){return arguments.length?(i=e,t):i},nu.rebind(t,r,"on")},nu.touches=function(t,e){return arguments.length<2&&(e=D().touches),e?iu(e).map(function(e){var n=J(t,e);return n.identifier=e.identifier,n}):[]};var Tu=1e-6,Fu=Tu*Tu,Bu=Math.PI,Lu=2*Bu,Nu=Lu-Tu,Ou=Bu/2,Iu=Bu/180,Ru=180/Bu,Pu=Math.SQRT2,qu=2,ju=4;nu.interpolateZoom=function(t,e){function n(t){var e=t*v;if(y){var n=it(g),u=a/(qu*f)*(n*at(Pu*e+g)-rt(g));return[r+u*c,i+u*l,a*n/it(Pu*e+g)]}return[r+t*c,i+t*l,a*Math.exp(Pu*e)]}var r=t[0],i=t[1],a=t[2],u=e[0],o=e[1],s=e[2],c=u-r,l=o-i,h=c*c+l*l,f=Math.sqrt(h),d=(s*s-a*a+ju*h)/(2*a*qu*f),p=(s*s-a*a-ju*h)/(2*s*qu*f),g=Math.log(Math.sqrt(d*d+1)-d),m=Math.log(Math.sqrt(p*p+1)-p),y=m-g,v=(y||Math.log(s/a))/Pu;return n.duration=1e3*v,n},nu.behavior.zoom=function(){function t(t){t.on(F,h).on(Yu+".zoom",d).on("dblclick.zoom",p).on(N,f)}function e(t){return[(t[0]-E.x)/E.k,(t[1]-E.y)/E.k]}function r(t){return[t[0]*E.k+E.x,t[1]*E.k+E.y]}function i(t){E.k=Math.max(M[0],Math.min(M[1],t))}function a(t,e){e=r(e),E.x+=t[0]-e[0],E.y+=t[1]-e[1]}function u(e,n,r,u){e.__chart__={x:E.x,y:E.y,k:E.k},i(Math.pow(2,u)),a(m=n,r),e=nu.select(e),S>0&&(e=e.transition().duration(S)),e.call(t.event)}function o(){x&&x.domain(_.range().map(function(t){return(t-E.x)/E.k}).map(_.invert)),A&&A.domain(w.range().map(function(t){return(t-E.y)/E.k}).map(w.invert))}function s(t){T++||t({type:"zoomstart"})}function c(t){o(),t({type:"zoom",scale:E.k,translate:[E.x,E.y]})}function l(t){--T||(t({type:"zoomend"}),m=null)}function h(){function t(){h=1,a(nu.mouse(i),d),c(o)}function r(){f.on(B,null).on(L,null),p(h&&nu.event.target===u),l(o)}var i=this,u=nu.event.target,o=O.of(i,arguments),h=0,f=nu.select(n(i)).on(B,t).on(L,r),d=e(nu.mouse(i)),p=X(i);Rs.call(i),s(o)}function f(){function t(){var t=nu.touches(p);return d=E.k,t.forEach(function(t){t.identifier in m&&(m[t.identifier]=e(t))}),t}function n(){var e=nu.event.target;nu.select(e).on(_,r).on(x,o),w.push(e);for(var n=nu.event.changedTouches,i=0,a=n.length;a>i;++i)m[n[i].identifier]=null;var s=t(),c=Date.now();if(1===s.length){if(500>c-b){var l=s[0];u(p,l,m[l.identifier],Math.floor(Math.log(E.k)/Math.LN2)+1),k()}b=c}else if(s.length>1){var l=s[0],h=s[1],f=l[0]-h[0],d=l[1]-h[1];y=f*f+d*d}}function r(){var t,e,n,r,u=nu.touches(p);Rs.call(p);for(var o=0,s=u.length;s>o;++o,r=null)if(n=u[o],r=m[n.identifier]){if(e)break;t=n,e=r}if(r){var l=(l=n[0]-t[0])*l+(l=n[1]-t[1])*l,h=y&&Math.sqrt(l/y);t=[(t[0]+n[0])/2,(t[1]+n[1])/2],e=[(e[0]+r[0])/2,(e[1]+r[1])/2],i(h*d)}b=null,a(t,e),c(g)}function o(){if(nu.event.touches.length){for(var e=nu.event.changedTouches,n=0,r=e.length;r>n;++n)delete m[e[n].identifier];for(var i in m)return void t()}nu.selectAll(w).on(v,null),A.on(F,h).on(N,f),D(),l(g)}var d,p=this,g=O.of(p,arguments),m={},y=0,v=".zoom-"+nu.event.changedTouches[0].identifier,_="touchmove"+v,x="touchend"+v,w=[],A=nu.select(p),D=X(p);n(),s(g),A.on(F,null).on(N,n)}function d(){var t=O.of(this,arguments);v?clearTimeout(v):(Rs.call(this),g=e(m=y||nu.mouse(this)),s(t)),v=setTimeout(function(){v=null,l(t)},50),k(),i(Math.pow(2,.002*Uu())*E.k),a(m,g),c(t)}function p(){var t=nu.mouse(this),n=Math.log(E.k)/Math.LN2;u(this,t,e(t),nu.event.shiftKey?Math.ceil(n)-1:Math.floor(n)+1)}var g,m,y,v,b,_,x,w,A,E={x:0,y:0,k:1},D=[960,500],M=zu,S=250,T=0,F="mousedown.zoom",B="mousemove.zoom",L="mouseup.zoom",N="touchstart.zoom",O=C(t,"zoomstart","zoom","zoomend");return Yu||(Yu="onwheel"in au?(Uu=function(){return-nu.event.deltaY*(nu.event.deltaMode?120:1)},"wheel"):"onmousewheel"in au?(Uu=function(){return nu.event.wheelDelta},"mousewheel"):(Uu=function(){return-nu.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=O.of(this,arguments),e=E;Os?nu.select(this).transition().each("start.zoom",function(){E=this.__chart__||{x:0,y:0,k:1},s(t)}).tween("zoom:zoom",function(){var n=D[0],r=D[1],i=m?m[0]:n/2,a=m?m[1]:r/2,u=nu.interpolateZoom([(i-E.x)/E.k,(a-E.y)/E.k,n/E.k],[(i-e.x)/e.k,(a-e.y)/e.k,n/e.k]);return function(e){var r=u(e),o=n/r[2];this.__chart__=E={x:i-r[0]*o,y:a-r[1]*o,k:o},c(t)}}).each("interrupt.zoom",function(){l(t)}).each("end.zoom",function(){l(t)}):(this.__chart__=E,s(t),c(t),l(t))})},t.translate=function(e){return arguments.length?(E={x:+e[0],y:+e[1],k:E.k},o(),t):[E.x,E.y]},t.scale=function(e){return arguments.length?(E={x:E.x,y:E.y,k:+e},o(),t):E.k},t.scaleExtent=function(e){return arguments.length?(M=null==e?zu:[+e[0],+e[1]],t):M},t.center=function(e){return arguments.length?(y=e&&[+e[0],+e[1]],t):y},t.size=function(e){return arguments.length?(D=e&&[+e[0],+e[1]],t):D},t.duration=function(e){return arguments.length?(S=+e,t):S},t.x=function(e){return arguments.length?(x=e,_=e.copy(),E={x:0,y:0,k:1},t):x},t.y=function(e){return arguments.length?(A=e,w=e.copy(),E={x:0,y:0,k:1},t):A},nu.rebind(t,O,"on")};var Uu,Yu,zu=[0,1/0];nu.color=ot,ot.prototype.toString=function(){return this.rgb()+""},nu.hsl=st;var Vu=st.prototype=new ot;Vu.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new st(this.h,this.s,this.l/t)},Vu.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new st(this.h,this.s,t*this.l)},Vu.rgb=function(){return ct(this.h,this.s,this.l)},nu.hcl=lt;var $u=lt.prototype=new ot;$u.brighter=function(t){return new lt(this.h,this.c,Math.min(100,this.l+Gu*(arguments.length?t:1)))},$u.darker=function(t){return new lt(this.h,this.c,Math.max(0,this.l-Gu*(arguments.length?t:1)))},$u.rgb=function(){return ht(this.h,this.c,this.l).rgb()},nu.lab=ft;var Gu=18,Hu=.95047,Wu=1,Zu=1.08883,Xu=ft.prototype=new ot;Xu.brighter=function(t){return new ft(Math.min(100,this.l+Gu*(arguments.length?t:1)),this.a,this.b)},Xu.darker=function(t){return new ft(Math.max(0,this.l-Gu*(arguments.length?t:1)),this.a,this.b)},Xu.rgb=function(){return dt(this.l,this.a,this.b)},nu.rgb=vt;var Ju=vt.prototype=new ot;Ju.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,i=30;return e||n||r?(e&&i>e&&(e=i),n&&i>n&&(n=i),r&&i>r&&(r=i),new vt(Math.min(255,e/t),Math.min(255,n/t),Math.min(255,r/t))):new vt(i,i,i)},Ju.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new vt(t*this.r,t*this.g,t*this.b)},Ju.hsl=function(){return At(this.r,this.g,this.b)},Ju.toString=function(){return"#"+xt(this.r)+xt(this.g)+xt(this.b)};var Ku=nu.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Ku.forEach(function(t,e){Ku.set(t,bt(e))}),nu.functor=Ct,nu.xhr=Mt(b),nu.dsv=function(t,e){function n(t,n,a){arguments.length<3&&(a=n,n=null);var u=St(t,e,null==n?r:i(n),a);return u.row=function(t){return arguments.length?u.response(null==(n=t)?r:i(t)):n},u}function r(t){return n.parse(t.responseText)}function i(t){return function(e){return n.parse(e.responseText,t)}}function a(e){return e.map(u).join(t)}function u(t){return o.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var o=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return n.parse=function(t,e){var r;return n.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,n){return e(i(t),n)}:i})},n.parseRows=function(t,e){function n(){if(l>=c)return u;if(i)return i=!1,a;var e=l;if(34===t.charCodeAt(e)){for(var n=e;n++l;){var r=t.charCodeAt(l++),o=1;if(10===r)i=!0;else if(13===r)i=!0,10===t.charCodeAt(l)&&(++l,++o);else if(r!==s)continue;return t.slice(e,l-o)}return t.slice(e)}for(var r,i,a={},u={},o=[],c=t.length,l=0,h=0;(r=n())!==u;){for(var f=[];r!==a&&r!==u;)f.push(r),r=n();e&&null==(f=e(f,h++))||o.push(f)}return o},n.format=function(e){if(Array.isArray(e[0]))return n.formatRows(e);var r=new v,i=[];return e.forEach(function(t){for(var e in t)r.has(e)||i.push(r.add(e))}),[i.map(u).join(t)].concat(e.map(function(e){return i.map(function(t){return u(e[t])}).join(t)})).join("\n")},n.formatRows=function(t){return t.map(a).join("\n")},n},nu.csv=nu.dsv(",","text/csv"),nu.tsv=nu.dsv(" ","text/tab-separated-values");var Qu,to,eo,no,ro,io=this[x(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};nu.timer=function(t,e,n){var r=arguments.length;2>r&&(e=0),3>r&&(n=Date.now());var i=n+e,a={c:t,t:i,f:!1,n:null};to?to.n=a:Qu=a, -to=a,eo||(no=clearTimeout(no),eo=1,io(Bt))},nu.timer.flush=function(){Lt(),Nt()},nu.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var ao=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(It);nu.formatPrefix=function(t,e){var n=0;return t&&(0>t&&(t*=-1),e&&(t=nu.round(t,Ot(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),ao[8+n/3]};var uo=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,oo=nu.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=nu.round(t,Ot(t,e))).toFixed(Math.max(0,Math.min(20,Ot(t*(1+1e-15),e))))}}),so=nu.time={},co=Date;qt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){lo.setUTCDate.apply(this._,arguments)},setDay:function(){lo.setUTCDay.apply(this._,arguments)},setFullYear:function(){lo.setUTCFullYear.apply(this._,arguments)},setHours:function(){lo.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){lo.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){lo.setUTCMinutes.apply(this._,arguments)},setMonth:function(){lo.setUTCMonth.apply(this._,arguments)},setSeconds:function(){lo.setUTCSeconds.apply(this._,arguments)},setTime:function(){lo.setTime.apply(this._,arguments)}};var lo=Date.prototype;so.year=jt(function(t){return t=so.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),so.years=so.year.range,so.years.utc=so.year.utc.range,so.day=jt(function(t){var e=new co(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),so.days=so.day.range,so.days.utc=so.day.utc.range,so.dayOfYear=function(t){var e=so.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=so[t]=jt(function(t){return(t=so.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=so.year(t).getDay();return Math.floor((so.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});so[t+"s"]=n.range,so[t+"s"].utc=n.utc.range,so[t+"OfYear"]=function(t){var n=so.year(t).getDay();return Math.floor((so.dayOfYear(t)+(n+e)%7)/7)}}),so.week=so.sunday,so.weeks=so.sunday.range,so.weeks.utc=so.sunday.utc.range,so.weekOfYear=so.sundayOfYear;var ho={"-":"",_:" ",0:"0"},fo=/^\s*\d+/,po=/^%/;nu.locale=function(t){return{numberFormat:Rt(t),timeFormat:Yt(t)}};var go=nu.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});nu.format=go.numberFormat,nu.geo={},ce.prototype={s:0,t:0,add:function(t){le(t,this.t,mo),le(mo.s,this.s,this),this.s?this.t+=mo.t:this.s=mo.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var mo=new ce;nu.geo.stream=function(t,e){t&&yo.hasOwnProperty(t.type)?yo[t.type](t,e):he(t,e)};var yo={Feature:function(t,e){he(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++rt?4*Bu+t:t,xo.lineStart=xo.lineEnd=xo.point=w}};nu.geo.bounds=function(){function t(t,e){b.push(_=[l=t,f=t]),h>e&&(h=e),e>d&&(d=e)}function e(e,n){var r=ge([e*Iu,n*Iu]);if(y){var i=ye(y,r),a=[i[1],-i[0],0],u=ye(a,i);_e(u),u=xe(u);var s=e-p,c=s>0?1:-1,g=u[0]*Ru*c,m=pu(s)>180;if(m^(g>c*p&&c*e>g)){var v=u[1]*Ru;v>d&&(d=v)}else if(g=(g+360)%360-180,m^(g>c*p&&c*e>g)){var v=-u[1]*Ru;h>v&&(h=v)}else h>n&&(h=n),n>d&&(d=n);m?p>e?o(l,e)>o(l,f)&&(f=e):o(e,f)>o(l,f)&&(l=e):f>=l?(l>e&&(l=e),e>f&&(f=e)):e>p?o(l,e)>o(l,f)&&(f=e):o(e,f)>o(l,f)&&(l=e)}else t(e,n);y=r,p=e}function n(){x.point=e}function r(){_[0]=l,_[1]=f,x.point=t,y=null}function i(t,n){if(y){var r=t-p;v+=pu(r)>180?r+(r>0?360:-360):r}else g=t,m=n;xo.point(t,n),e(t,n)}function a(){xo.lineStart()}function u(){i(g,m),xo.lineEnd(),pu(v)>Tu&&(l=-(f=180)),_[0]=l,_[1]=f,y=null}function o(t,e){return(e-=t)<0?e+360:e}function s(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t_o?(l=-(f=180),h=-(d=90)):v>Tu?d=90:-Tu>v&&(h=-90),_[0]=l,_[1]=f}};return function(t){d=f=-(l=h=1/0),b=[],nu.geo.stream(t,x);var e=b.length;if(e){b.sort(s);for(var n,r=1,i=b[0],a=[i];e>r;++r)n=b[r],c(n[0],i)||c(n[1],i)?(o(i[0],n[1])>o(i[0],i[1])&&(i[1]=n[1]),o(n[0],i[1])>o(i[0],i[1])&&(i[0]=n[0])):a.push(i=n);for(var u,n,p=-(1/0),e=a.length-1,r=0,i=a[e];e>=r;i=n,++r)n=a[r],(u=o(i[1],n[0]))>p&&(p=u,l=n[0],f=i[1])}return b=_=null,l===1/0||h===1/0?[[0/0,0/0],[0/0,0/0]]:[[l,h],[f,d]]}}(),nu.geo.centroid=function(t){wo=Ao=Eo=ko=Do=Co=Mo=So=To=Fo=Bo=0,nu.geo.stream(t,Lo);var e=To,n=Fo,r=Bo,i=e*e+n*n+r*r;return Fu>i&&(e=Co,n=Mo,r=So,Tu>Ao&&(e=Eo,n=ko,r=Do),i=e*e+n*n+r*r,Fu>i)?[0/0,0/0]:[Math.atan2(n,e)*Ru,nt(r/Math.sqrt(i))*Ru]};var wo,Ao,Eo,ko,Do,Co,Mo,So,To,Fo,Bo,Lo={sphere:w,point:Ae,lineStart:ke,lineEnd:De,polygonStart:function(){Lo.lineStart=Ce},polygonEnd:function(){Lo.lineStart=ke}},No=Le(Se,Re,qe,[-Bu,-Bu/2]),Oo=1e9;nu.geo.clipExtent=function(){var t,e,n,r,i,a,u={stream:function(t){return i&&(i.valid=!1),i=a(t),i.valid=!0,i},extent:function(o){return arguments.length?(a=ze(t=+o[0][0],e=+o[0][1],n=+o[1][0],r=+o[1][1]),i&&(i.valid=!1,i=null),u):[[t,e],[n,r]]}};return u.extent([[0,0],[960,500]])},(nu.geo.conicEqualArea=function(){return Ve($e)}).raw=$e,nu.geo.albers=function(){return nu.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},nu.geo.albersUsa=function(){function t(t){var a=t[0],u=t[1];return e=null,n(a,u),e||(r(a,u),e)||i(a,u),e}var e,n,r,i,a=nu.geo.albers(),u=nu.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o=nu.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,n){e=[t,n]}};return t.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?u:i>=.166&&.234>i&&r>=-.214&&-.115>r?o:a).invert(t)},t.stream=function(t){var e=a.stream(t),n=u.stream(t),r=o.stream(t);return{point:function(t,i){e.point(t,i),n.point(t,i),r.point(t,i)},sphere:function(){e.sphere(),n.sphere(),r.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),u.precision(e),o.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),u.scale(.35*e),o.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var c=a.scale(),l=+e[0],h=+e[1];return n=a.translate(e).clipExtent([[l-.455*c,h-.238*c],[l+.455*c,h+.238*c]]).stream(s).point,r=u.translate([l-.307*c,h+.201*c]).clipExtent([[l-.425*c+Tu,h+.12*c+Tu],[l-.214*c-Tu,h+.234*c-Tu]]).stream(s).point,i=o.translate([l-.205*c,h+.212*c]).clipExtent([[l-.214*c+Tu,h+.166*c+Tu],[l-.115*c-Tu,h+.234*c-Tu]]).stream(s).point,t},t.scale(1070)};var Io,Ro,Po,qo,jo,Uo,Yo={point:w,lineStart:w,lineEnd:w,polygonStart:function(){Ro=0,Yo.lineStart=Ge},polygonEnd:function(){Yo.lineStart=Yo.lineEnd=Yo.point=w,Io+=pu(Ro/2)}},zo={point:He,lineStart:w,lineEnd:w,polygonStart:w,polygonEnd:w},Vo={point:Xe,lineStart:Je,lineEnd:Ke,polygonStart:function(){Vo.lineStart=Qe},polygonEnd:function(){Vo.point=Xe,Vo.lineStart=Je,Vo.lineEnd=Ke}};nu.geo.path=function(){function t(t){return t&&("function"==typeof o&&a.pointRadius(+o.apply(this,arguments)),u&&u.valid||(u=i(a)),nu.geo.stream(t,u)),a.result()}function e(){return u=null,t}var n,r,i,a,u,o=4.5;return t.area=function(t){return Io=0,nu.geo.stream(t,i(Yo)),Io},t.centroid=function(t){return Eo=ko=Do=Co=Mo=So=To=Fo=Bo=0,nu.geo.stream(t,i(Vo)),Bo?[To/Bo,Fo/Bo]:So?[Co/So,Mo/So]:Do?[Eo/Do,ko/Do]:[0/0,0/0]},t.bounds=function(t){return jo=Uo=-(Po=qo=1/0),nu.geo.stream(t,i(zo)),[[Po,qo],[jo,Uo]]},t.projection=function(t){return arguments.length?(i=(n=t)?t.stream||nn(t):b,e()):n},t.context=function(t){return arguments.length?(a=null==(r=t)?new We:new tn(t),"function"!=typeof o&&a.pointRadius(o),e()):r},t.pointRadius=function(e){return arguments.length?(o="function"==typeof e?e:(a.pointRadius(+e),+e),t):o},t.projection(nu.geo.albersUsa()).context(null)},nu.geo.transform=function(t){return{stream:function(e){var n=new rn(e);for(var r in t)n[r]=t[r];return n}}},rn.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},nu.geo.projection=un,nu.geo.projectionMutator=on,(nu.geo.equirectangular=function(){return un(cn)}).raw=cn.invert=cn,nu.geo.rotation=function(t){function e(e){return e=t(e[0]*Iu,e[1]*Iu),e[0]*=Ru,e[1]*=Ru,e}return t=hn(t[0]%360*Iu,t[1]*Iu,t.length>2?t[2]*Iu:0),e.invert=function(e){return e=t.invert(e[0]*Iu,e[1]*Iu),e[0]*=Ru,e[1]*=Ru,e},e},ln.invert=cn,nu.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=hn(-t[0]*Iu,-t[1]*Iu,0).invert,i=[];return n(null,null,1,{point:function(t,n){i.push(t=e(t,n)),t[0]*=Ru,t[1]*=Ru}}),{type:"Polygon",coordinates:[i]}}var e,n,r=[0,0],i=6;return t.origin=function(e){return arguments.length?(r=e,t):r},t.angle=function(r){return arguments.length?(n=gn((e=+r)*Iu,i*Iu),t):e},t.precision=function(r){return arguments.length?(n=gn(e*Iu,(i=+r)*Iu),t):i},t.angle(90)},nu.geo.distance=function(t,e){var n,r=(e[0]-t[0])*Iu,i=t[1]*Iu,a=e[1]*Iu,u=Math.sin(r),o=Math.cos(r),s=Math.sin(i),c=Math.cos(i),l=Math.sin(a),h=Math.cos(a);return Math.atan2(Math.sqrt((n=h*u)*n+(n=c*l-s*h*o)*n),s*l+c*h*o)},nu.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return nu.range(Math.ceil(a/m)*m,i,m).map(f).concat(nu.range(Math.ceil(c/y)*y,s,y).map(d)).concat(nu.range(Math.ceil(r/p)*p,n,p).filter(function(t){return pu(t%m)>Tu}).map(l)).concat(nu.range(Math.ceil(o/g)*g,u,g).filter(function(t){return pu(t%y)>Tu}).map(h))}var n,r,i,a,u,o,s,c,l,h,f,d,p=10,g=p,m=90,y=360,v=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(s).slice(1),f(i).reverse().slice(1),d(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],c=+e[0][1],s=+e[1][1],a>i&&(e=a,a=i,i=e),c>s&&(e=c,c=s,s=e),t.precision(v)):[[a,c],[i,s]]},t.minorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],o=+e[0][1],u=+e[1][1],r>n&&(e=r,r=n,n=e),o>u&&(e=o,o=u,u=e),t.precision(v)):[[r,o],[n,u]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(m=+e[0],y=+e[1],t):[m,y]},t.minorStep=function(e){return arguments.length?(p=+e[0],g=+e[1],t):[p,g]},t.precision=function(e){return arguments.length?(v=+e,l=yn(o,u,90),h=vn(r,n,v),f=yn(c,s,90),d=vn(a,i,v),t):v},t.majorExtent([[-180,-90+Tu],[180,90-Tu]]).minorExtent([[-180,-80-Tu],[180,80+Tu]])},nu.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||i.apply(this,arguments)]}}var e,n,r=bn,i=_n;return t.distance=function(){return nu.geo.distance(e||r.apply(this,arguments),n||i.apply(this,arguments))},t.source=function(n){return arguments.length?(r=n,e="function"==typeof n?null:n,t):r},t.target=function(e){return arguments.length?(i=e,n="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},nu.geo.interpolate=function(t,e){return xn(t[0]*Iu,t[1]*Iu,e[0]*Iu,e[1]*Iu)},nu.geo.length=function(t){return $o=0,nu.geo.stream(t,Go),$o};var $o,Go={sphere:w,point:w,lineStart:wn,lineEnd:w,polygonStart:w,polygonEnd:w},Ho=An(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(nu.geo.azimuthalEqualArea=function(){return un(Ho)}).raw=Ho;var Wo=An(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},b);(nu.geo.azimuthalEquidistant=function(){return un(Wo)}).raw=Wo,(nu.geo.conicConformal=function(){return Ve(En)}).raw=En,(nu.geo.conicEquidistant=function(){return Ve(kn)}).raw=kn;var Zo=An(function(t){return 1/t},Math.atan);(nu.geo.gnomonic=function(){return un(Zo)}).raw=Zo,Dn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Ou]},(nu.geo.mercator=function(){return Cn(Dn)}).raw=Dn;var Xo=An(function(){return 1},Math.asin);(nu.geo.orthographic=function(){return un(Xo)}).raw=Xo;var Jo=An(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(nu.geo.stereographic=function(){return un(Jo)}).raw=Jo,Mn.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Ou]},(nu.geo.transverseMercator=function(){var t=Cn(Mn),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90])}).raw=Mn,nu.geom={},nu.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=Ct(n),a=Ct(r),u=t.length,o=[],s=[];for(e=0;u>e;e++)o.push([+i.call(this,t[e],e),+a.call(this,t[e],e),e]);for(o.sort(Bn),e=0;u>e;e++)s.push([o[e][0],-o[e][1]]);var c=Fn(o),l=Fn(s),h=l[0]===c[0],f=l[l.length-1]===c[c.length-1],d=[];for(e=c.length-1;e>=0;--e)d.push(t[o[c[e]][2]]);for(e=+h;e=r&&c.x<=a&&c.y>=i&&c.y<=u?[[r,u],[a,u],[a,i],[r,i]]:[];l.point=t[o]}),e}function n(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Tu)*Tu,y:Math.round(u(t,e)/Tu)*Tu,i:e}})}var r=Sn,i=Tn,a=r,u=i,o=us;return t?e(t):(e.links=function(t){return or(n(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return or(n(t)).cells.forEach(function(n,r){for(var i,a,u=n.site,o=n.edges.sort($n),s=-1,c=o.length,l=o[c-1].edge,h=l.l===u?l.r:l.l;++s=c,f=r>=l,d=f<<1|h;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]=fr()),h?i=c:o=c,f?u=l:s=l,a(t,e,n,r,i,u,o,s)}var l,h,f,d,p,g,m,y,v,b=Ct(o),_=Ct(s);if(null!=e)g=e,m=n,y=r,v=i;else if(y=v=-(g=m=1/0),h=[],f=[],p=t.length,u)for(d=0;p>d;++d)l=t[d],l.xy&&(y=l.x),l.y>v&&(v=l.y),h.push(l.x),f.push(l.y);else for(d=0;p>d;++d){var x=+b(l=t[d],d),w=+_(l,d);g>x&&(g=x),m>w&&(m=w),x>y&&(y=x),w>v&&(v=w),h.push(x),f.push(w)}var A=y-g,E=v-m;A>E?v=m+A:y=g+E;var k=fr();if(k.add=function(t){a(k,t,+b(t,++d),+_(t,d),g,m,y,v)},k.visit=function(t){dr(t,k,g,m,y,v)},k.find=function(t){return pr(k,t[0],t[1],g,m,y,v)},d=-1,null==e){for(;++d=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";return n=ls.get(n)||cs,r=hs.get(r)||b,xr(r(n.apply(null,ru.call(arguments,1))))},nu.interpolateHcl=Nr,nu.interpolateHsl=Or,nu.interpolateLab=Ir,nu.interpolateRound=Rr,nu.transform=function(t){var e=au.createElementNS(nu.ns.prefix.svg,"g");return(nu.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Pr(n?n.matrix:fs)})(t)},Pr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var fs={a:1,b:0,c:0,d:1,e:0,f:0};nu.interpolateTransform=Yr,nu.layout={},nu.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++no*o/m){if(p>s){var c=e.charge/s;t.px-=a*c,t.py-=u*c}return!0}if(e.point&&s&&p>s){var c=e.pointCharge/s;t.px-=a*c,t.py-=u*c}}return!e.charge}}function e(t){t.px=nu.event.x,t.py=nu.event.y,o.resume()}var n,r,i,a,u,o={},s=nu.dispatch("start","tick","end"),c=[1,1],l=.9,h=ds,f=ps,d=-30,p=gs,g=.1,m=.64,y=[],v=[];return o.tick=function(){if((r*=.99)<.005)return s.end({type:"end",alpha:r=0}),!0;var e,n,o,h,f,p,m,b,_,x=y.length,w=v.length;for(n=0;w>n;++n)o=v[n],h=o.source,f=o.target,b=f.x-h.x,_=f.y-h.y,(p=b*b+_*_)&&(p=r*a[n]*((p=Math.sqrt(p))-i[n])/p,b*=p,_*=p,f.x-=b*(m=h.weight/(f.weight+h.weight)),f.y-=_*m,h.x+=b*(m=1-m),h.y+=_*m);if((m=r*g)&&(b=c[0]/2,_=c[1]/2,n=-1,m))for(;++n0?t:0:t>0&&(s.start({type:"start",alpha:r=t}),nu.timer(o.tick)),o):r},o.start=function(){function t(t,r){if(!n){for(n=new Array(s),o=0;s>o;++o)n[o]=[];for(o=0;l>o;++o){var i=v[o];n[i.source.index].push(i.target),n[i.target.index].push(i.source)}}for(var a,u=n[e],o=-1,c=u.length;++oe;++e)(r=y[e]).index=e,r.weight=0;for(e=0;l>e;++e)r=v[e],"number"==typeof r.source&&(r.source=y[r.source]),"number"==typeof r.target&&(r.target=y[r.target]),++r.source.weight,++r.target.weight;for(e=0;s>e;++e)r=y[e],isNaN(r.x)&&(r.x=t("x",p)),isNaN(r.y)&&(r.y=t("y",g)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof h)for(e=0;l>e;++e)i[e]=+h.call(this,v[e],e);else for(e=0;l>e;++e)i[e]=h;if(a=[],"function"==typeof f)for(e=0;l>e;++e)a[e]=+f.call(this,v[e],e);else for(e=0;l>e;++e)a[e]=f;if(u=[],"function"==typeof d)for(e=0;s>e;++e)u[e]=+d.call(this,y[e],e);else for(e=0;s>e;++e)u[e]=d;return o.resume()},o.resume=function(){return o.alpha(.1)},o.stop=function(){return o.alpha(0)},o.drag=function(){return n||(n=nu.behavior.drag().origin(b).on("dragstart.force",Wr).on("drag.force",e).on("dragend.force",Zr)),arguments.length?void this.on("mouseover.force",Xr).on("mouseout.force",Jr).call(n):n},nu.rebind(o,s,"on")};var ds=20,ps=1,gs=1/0;nu.layout.hierarchy=function(){function t(i){var a,u=[i],o=[];for(i.depth=0;null!=(a=u.pop());)if(o.push(a),(c=n.call(t,a,a.depth))&&(s=c.length)){for(var s,c,l;--s>=0;)u.push(l=c[s]),l.parent=a,l.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(t,a,a.depth)||0),delete a.children;return ei(i,function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)}),o}var e=ii,n=ni,r=ri;return t.sort=function(n){return arguments.length?(e=n,t):e},t.children=function(e){return arguments.length?(n=e,t):n},t.value=function(e){return arguments.length?(r=e,t):r},t.revalue=function(e){return r&&(ti(e,function(t){t.children&&(t.value=0)}),ei(e,function(e){var n;e.children||(e.value=+r.call(t,e,e.depth)||0),(n=e.parent)&&(n.value+=e.value)})),e},t},nu.layout.partition=function(){function t(e,n,r,i){var a=e.children;if(e.x=n,e.y=e.depth*i,e.dx=r,e.dy=i,a&&(u=a.length)){var u,o,s,c=-1;for(r=e.value?r/e.value:0;++ch?-1:1),p=(h-s*d)/nu.sum(c),g=nu.range(s),m=[];return null!=n&&g.sort(n===ms?function(t,e){return c[e]-c[t]}:function(t,e){return n(u[t],u[e])}),g.forEach(function(t){m[t]={data:u[t],value:o=c[t],startAngle:l,endAngle:l+=o*p+d,padAngle:f}}),m}var e=Number,n=ms,r=0,i=Lu,a=0;return t.value=function(n){return arguments.length?(e=n,t):e},t.sort=function(e){return arguments.length?(n=e,t):n},t.startAngle=function(e){return arguments.length?(r=e,t):r},t.endAngle=function(e){return arguments.length?(i=e,t):i},t.padAngle=function(e){return arguments.length?(a=e,t):a},t};var ms={};nu.layout.stack=function(){function t(o,s){if(!(f=o.length))return o;var c=o.map(function(n,r){return e.call(t,n,r)}),l=c.map(function(e){return e.map(function(e,n){return[a.call(t,e,n),u.call(t,e,n)]})}),h=n.call(t,l,s);c=nu.permute(c,h),l=nu.permute(l,h);var f,d,p,g,m=r.call(t,l,s),y=c[0].length;for(p=0;y>p;++p)for(i.call(t,c[0][p],g=m[p],l[0][p][1]),d=1;f>d;++d)i.call(t,c[d][p],g+=l[d-1][p][1],l[d][p][1]);return o}var e=b,n=ci,r=li,i=si,a=ui,u=oi;return t.values=function(n){return arguments.length?(e=n,t):e},t.order=function(e){return arguments.length?(n="function"==typeof e?e:ys.get(e)||ci,t):n},t.offset=function(e){return arguments.length?(r="function"==typeof e?e:vs.get(e)||li,t):r},t.x=function(e){return arguments.length?(a=e,t):a},t.y=function(e){return arguments.length?(u=e,t):u},t.out=function(e){return arguments.length?(i=e,t):i},t};var ys=nu.map({"inside-out":function(t){var e,n,r=t.length,i=t.map(hi),a=t.map(fi),u=nu.range(r).sort(function(t,e){return i[t]-i[e]}),o=0,s=0,c=[],l=[];for(e=0;r>e;++e)n=u[e],s>o?(o+=a[n],c.push(n)):(s+=a[n],l.push(n));return l.reverse().concat(c)},reverse:function(t){return nu.range(t.length).reverse()},"default":ci}),vs=nu.map({silhouette:function(t){var e,n,r,i=t.length,a=t[0].length,u=[],o=0,s=[];for(n=0;a>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];r>o&&(o=r),u.push(r)}for(n=0;a>n;++n)s[n]=(o-u[n])/2;return s},wiggle:function(t){var e,n,r,i,a,u,o,s,c,l=t.length,h=t[0],f=h.length,d=[];for(d[0]=s=c=0,n=1;f>n;++n){for(e=0,i=0;l>e;++e)i+=t[e][n][1];for(e=0,a=0,o=h[n][0]-h[n-1][0];l>e;++e){for(r=0,u=(t[e][n][1]-t[e][n-1][1])/(2*o);e>r;++r)u+=(t[r][n][1]-t[r][n-1][1])/o;a+=u*t[e][n][1]}d[n]=s-=i?a/i*o:0,c>s&&(c=s)}for(n=0;f>n;++n)d[n]-=c;return d},expand:function(t){var e,n,r,i=t.length,a=t[0].length,u=1/i,o=[];for(n=0;a>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];if(r)for(e=0;i>e;e++)t[e][n][1]/=r;else for(e=0;i>e;e++)t[e][n][1]=u}for(n=0;a>n;++n)o[n]=0;return o},zero:li});nu.layout.histogram=function(){function t(t,a){for(var u,o,s=[],c=t.map(n,this),l=r.call(this,c,a),h=i.call(this,l,c,a),a=-1,f=c.length,d=h.length-1,p=e?1:1/f;++a0)for(a=-1;++a=l[0]&&o<=l[1]&&(u=s[nu.bisect(h,o,1,d)-1],u.y+=p,u.push(t[a]));return s}var e=!0,n=Number,r=mi,i=pi;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(r=Ct(e),t):r},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return gi(t,e)}:Ct(e),t):i},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},nu.layout.pack=function(){function t(t,a){var u=n.call(this,t,a),o=u[0],s=i[0],c=i[1],l=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(o.x=o.y=0,ei(o,function(t){t.r=+l(t.value)}),ei(o,xi),r){var h=r*(e?1:Math.max(2*o.r/s,2*o.r/c))/2;ei(o,function(t){t.r+=h; +}var u=4.5,o={point:e,lineStart:function(){o.point=n},lineEnd:i,polygonStart:function(){o.lineEnd=a},polygonEnd:function(){o.lineEnd=i,o.point=e},pointRadius:function(t){return u=t,o},result:w};return o}function en(t){function e(t){return(o?r:n)(t)}function n(e){return an(e,function(n,r){n=t(n,r),e.point(n[0],n[1])})}function r(e){function n(n,r){n=t(n,r),e.point(n[0],n[1])}function r(){b=0/0,E.point=a,e.lineStart()}function a(n,r){var a=ge([n,r]),u=t(n,r);i(b,_,v,x,w,A,b=u[0],_=u[1],v=n,x=a[0],w=a[1],A=a[2],o,e),e.point(b,_)}function u(){E.point=n,e.lineEnd()}function s(){r(),E.point=c,E.lineEnd=l}function c(t,e){a(h=t,f=e),d=b,p=_,g=x,m=w,y=A,E.point=a}function l(){i(b,_,v,x,w,A,d,p,h,g,m,y,o,e),E.lineEnd=u,u()}var h,f,d,p,g,m,y,v,b,_,x,w,A,E={point:n,lineStart:r,lineEnd:u,polygonStart:function(){e.polygonStart(),E.lineStart=s},polygonEnd:function(){e.polygonEnd(),E.lineStart=r}};return E}function i(e,n,r,o,s,c,l,h,f,d,p,g,m,y){var v=l-e,b=h-n,_=v*v+b*b;if(_>4*a&&m--){var x=o+d,w=s+p,A=c+g,E=Math.sqrt(x*x+w*w+A*A),k=Math.asin(A/=E),D=pu(pu(A)-1)a||pu((v*T+b*F)/_-.5)>.3||u>o*d+s*p+c*g)&&(i(e,n,r,o,s,c,S,M,D,x/=E,w/=E,A,m,y),y.point(S,M),i(S,M,D,x,w,A,l,h,f,d,p,g,m,y))}}var a=.5,u=Math.cos(30*Ou),o=16;return e.precision=function(t){return arguments.length?(o=(a=t*t)>0&&16,e):Math.sqrt(a)},e}function nn(t){var e=en(function(e,n){return t([e*Ru,n*Ru])});return function(t){return sn(e(t))}}function rn(t){this.stream=t}function an(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function un(t){return on(function(){return t})()}function on(t){function e(t){return t=o(t[0]*Ou,t[1]*Ou),[t[0]*f+s,c-t[1]*f]}function n(t){return t=o.invert((t[0]-s)/f,(c-t[1])/f),t&&[t[0]*Ru,t[1]*Ru]}function r(){o=Se(u=hn(y,v,_),a);var t=a(g,m);return s=d-t[0]*f,c=p+t[1]*f,i()}function i(){return l&&(l.valid=!1,l=null),e}var a,u,o,s,c,l,h=en(function(t,e){return t=a(t,e),[t[0]*f+s,c-t[1]*f]}),f=150,d=480,p=250,g=0,m=0,y=0,v=0,_=0,x=No,w=b,A=null,E=null;return e.stream=function(t){return l&&(l.valid=!1),l=sn(x(u,h(w(t)))),l.valid=!0,l},e.clipAngle=function(t){return arguments.length?(x=null==t?(A=t,No):Ue((A=+t)*Ou),i()):A},e.clipExtent=function(t){return arguments.length?(E=t,w=t?Ve(t[0][0],t[0][1],t[1][0],t[1][1]):b,i()):E},e.scale=function(t){return arguments.length?(f=+t,r()):f},e.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],r()):[d,p]},e.center=function(t){return arguments.length?(g=t[0]%360*Ou,m=t[1]%360*Ou,r()):[g*Ru,m*Ru]},e.rotate=function(t){return arguments.length?(y=t[0]%360*Ou,v=t[1]%360*Ou,_=t.length>2?t[2]%360*Ou:0,r()):[y*Ru,v*Ru,_*Ru]},nu.rebind(e,h,"precision"),function(){return a=t.apply(this,arguments),e.invert=a.invert&&n,r()}}function sn(t){return an(t,function(e,n){t.point(e*Ou,n*Ou)})}function cn(t,e){return[t,e]}function ln(t,e){return[t>Lu?t-Bu:-Lu>t?t+Bu:t,e]}function hn(t,e,n){return t?e||n?Se(dn(t),pn(e,n)):dn(t):e||n?pn(e,n):ln}function fn(t){return function(e,n){return e+=t,[e>Lu?e-Bu:-Lu>e?e+Bu:e,n]}}function dn(t){var e=fn(t);return e.invert=fn(-t),e}function pn(t,e){function n(t,e){var n=Math.cos(e),o=Math.cos(t)*n,s=Math.sin(t)*n,c=Math.sin(e),l=c*r+o*i;return[Math.atan2(s*a-l*u,o*r-c*i),nt(l*a+s*u)]}var r=Math.cos(t),i=Math.sin(t),a=Math.cos(e),u=Math.sin(e);return n.invert=function(t,e){var n=Math.cos(e),o=Math.cos(t)*n,s=Math.sin(t)*n,c=Math.sin(e),l=c*a-s*u;return[Math.atan2(s*a+c*u,o*r+l*i),nt(l*r-o*i)]},n}function gn(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,a,u,o){var s=u*e;null!=i?(i=mn(n,i),a=mn(n,a),(u>0?a>i:i>a)&&(i+=u*Bu)):(i=t+u*Bu,a=t-.5*s);for(var c,l=i;u>0?l>a:a>l;l-=s)o.point((c=xe([n,-r*Math.cos(l),-r*Math.sin(l)]))[0],c[1])}}function mn(t,e){var n=ge(e);n[0]-=t,_e(n);var r=et(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Tu)%(2*Math.PI)}function yn(t,e,n){var r=nu.range(t,e-Tu,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function vn(t,e,n){var r=nu.range(t,e-Tu,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function bn(t){return t.source}function _n(t){return t.target}function xn(t,e,n,r){var i=Math.cos(e),a=Math.sin(e),u=Math.cos(r),o=Math.sin(r),s=i*Math.cos(t),c=i*Math.sin(t),l=u*Math.cos(n),h=u*Math.sin(n),f=2*Math.asin(Math.sqrt(ut(r-e)+i*u*ut(n-t))),d=1/Math.sin(f),p=f?function(t){var e=Math.sin(t*=f)*d,n=Math.sin(f-t)*d,r=n*s+e*l,i=n*c+e*h,u=n*a+e*o;return[Math.atan2(i,r)*Ru,Math.atan2(u,Math.sqrt(r*r+i*i))*Ru]}:function(){return[t*Ru,e*Ru]};return p.distance=f,p}function wn(){function t(t,i){var a=Math.sin(i*=Ou),u=Math.cos(i),o=pu((t*=Ou)-e),s=Math.cos(o);$o+=Math.atan2(Math.sqrt((o=u*Math.sin(o))*o+(o=r*a-n*u*s)*o),n*a+r*u*s),e=t,n=a,r=u}var e,n,r;Ho.point=function(i,a){e=i*Ou,n=Math.sin(a*=Ou),r=Math.cos(a),Ho.point=t},Ho.lineEnd=function(){Ho.point=Ho.lineEnd=w}}function An(t,e){function n(e,n){var r=Math.cos(e),i=Math.cos(n),a=t(r*i);return[a*i*Math.sin(e),a*Math.sin(n)]}return n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),i=e(r),a=Math.sin(i),u=Math.cos(i);return[Math.atan2(t*a,r*u),Math.asin(r&&n*a/r)]},n}function En(t,e){function n(t,e){u>0?-Iu+Tu>e&&(e=-Iu+Tu):e>Iu-Tu&&(e=Iu-Tu);var n=u/Math.pow(i(e),a);return[n*Math.sin(a*t),u-n*Math.cos(a*t)]}var r=Math.cos(t),i=function(t){return Math.tan(Lu/4+t/2)},a=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(i(e)/i(t)),u=r*Math.pow(i(t),a)/a;return a?(n.invert=function(t,e){var n=u-e,r=Q(a)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/a,2*Math.atan(Math.pow(u/r,1/a))-Iu]},n):Dn}function kn(t,e){function n(t,e){var n=a-e;return[n*Math.sin(i*t),a-n*Math.cos(i*t)]}var r=Math.cos(t),i=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),a=r/i+t;return pu(i)i;i++){for(;r>1&&tt(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function Ln(t,e){return t[0]-e[0]||t[1]-e[1]}function Bn(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function Nn(t,e,n,r){var i=t[0],a=n[0],u=e[0]-i,o=r[0]-a,s=t[1],c=n[1],l=e[1]-s,h=r[1]-c,f=(o*(s-c)-h*(i-a))/(h*u-o*l);return[i+f*u,s+f*l]}function In(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function On(){rr(this),this.edge=this.site=this.circle=null}function Rn(t){var e=is.pop()||new On;return e.site=t,e}function Pn(t){Wn(t),es.remove(t),is.push(t),rr(t)}function qn(t){var e=t.circle,n=e.x,r=e.cy,i={x:n,y:r},a=t.P,u=t.N,o=[t];Pn(t);for(var s=a;s.circle&&pu(n-s.circle.x)l;++l)c=o[l],s=o[l-1],tr(c.edge,s.site,c.site,i);s=o[0],c=o[h-1],c.edge=Kn(s.site,c.site,null,i),Gn(s),Gn(c)}function jn(t){for(var e,n,r,i,a=t.x,u=t.y,o=es._;o;)if(r=Un(o,u)-a,r>Tu)o=o.L;else{if(i=a-Yn(o,u),!(i>Tu)){r>-Tu?(e=o.P,n=o):i>-Tu?(e=o,n=o.N):e=n=o;break}if(!o.R){e=o;break}o=o.R}var s=Rn(t);if(es.insert(e,s),e||n){if(e===n)return Wn(e),n=Rn(e.site),es.insert(s,n),s.edge=n.edge=Kn(e.site,s.site),Gn(e),void Gn(n);if(!n)return void(s.edge=Kn(e.site,s.site));Wn(e),Wn(n);var c=e.site,l=c.x,h=c.y,f=t.x-l,d=t.y-h,p=n.site,g=p.x-l,m=p.y-h,y=2*(f*m-d*g),v=f*f+d*d,b=g*g+m*m,_={x:(m*v-d*b)/y+l,y:(f*b-g*v)/y+h};tr(n.edge,c,p,_),s.edge=Kn(c,t,null,_),n.edge=Kn(t,p,null,_),Gn(e),Gn(n)}}function Un(t,e){var n=t.site,r=n.x,i=n.y,a=i-e;if(!a)return r;var u=t.P;if(!u)return-(1/0);n=u.site;var o=n.x,s=n.y,c=s-e;if(!c)return o;var l=o-r,h=1/a-1/c,f=l/c;return h?(-f+Math.sqrt(f*f-2*h*(l*l/(-2*c)-s+c/2+i-a/2)))/h+r:(r+o)/2}function Yn(t,e){var n=t.N;if(n)return Un(n,e);var r=t.site;return r.y===e?r.x:1/0}function Vn(t){this.site=t,this.edges=[]}function zn(t){for(var e,n,r,i,a,u,o,s,c,l,h=t[0][0],f=t[1][0],d=t[0][1],p=t[1][1],g=ts,m=g.length;m--;)if(a=g[m],a&&a.prepare())for(o=a.edges,s=o.length,u=0;s>u;)l=o[u].end(),r=l.x,i=l.y,c=o[++u%s].start(),e=c.x,n=c.y,(pu(r-e)>Tu||pu(i-n)>Tu)&&(o.splice(u,0,new er(Qn(a.site,l,pu(r-h)Tu?{x:h,y:pu(e-h)Tu?{x:pu(n-p)Tu?{x:f,y:pu(e-f)Tu?{x:pu(n-d)=-Fu)){var d=s*s+c*c,p=l*l+h*h,g=(h*d-c*p)/f,m=(s*p-l*d)/f,h=m+o,y=as.pop()||new Hn;y.arc=t,y.site=i,y.x=g+u,y.y=h+Math.sqrt(g*g+m*m),y.cy=h,t.circle=y;for(var v=null,b=rs._;b;)if(y.ym||m>=o)return;if(f>p){if(a){if(a.y>=c)return}else a={x:m,y:s};n={x:m,y:c}}else{if(a){if(a.yr||r>1)if(f>p){if(a){if(a.y>=c)return}else a={x:(s-i)/r,y:s};n={x:(c-i)/r,y:c}}else{if(a){if(a.yd){if(a){if(a.x>=o)return}else a={x:u,y:r*u+i};n={x:o,y:r*o+i}}else{if(a){if(a.xa||h>u||r>f||i>d)){if(p=t.point){var p,g=e-t.x,m=n-t.y,y=g*g+m*m;if(s>y){var v=Math.sqrt(s=y);r=e-v,i=n-v,a=e+v,u=n+v,o=p}}for(var b=t.nodes,_=.5*(l+f),x=.5*(h+d),w=e>=_,A=n>=x,E=A<<1|w,k=E+4;k>E;++E)if(t=b[3&E])switch(3&E){case 0:c(t,l,h,_,x);break;case 1:c(t,_,h,f,x);break;case 2:c(t,l,x,_,d);break;case 3:c(t,_,x,f,d)}}}(t,r,i,a,u),o}function gr(t,e){t=nu.rgb(t),e=nu.rgb(e);var n=t.r,r=t.g,i=t.b,a=e.r-n,u=e.g-r,o=e.b-i;return function(t){return"#"+xt(Math.round(n+a*t))+xt(Math.round(r+u*t))+xt(Math.round(i+o*t))}}function mr(t,e){var n,r={},i={};for(n in t)n in e?r[n]=br(t[n],e[n]):i[n]=t[n];for(n in e)n in t||(i[n]=e[n]);return function(t){for(n in r)i[n]=r[n](t);return i}}function yr(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function vr(t,e){var n,r,i,a=os.lastIndex=ss.lastIndex=0,u=-1,o=[],s=[];for(t+="",e+="";(n=os.exec(t))&&(r=ss.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),o[u]?o[u]+=i:o[++u]=i),(n=n[0])===(r=r[0])?o[u]?o[u]+=r:o[++u]=r:(o[++u]=null,s.push({i:u,x:yr(n,r)})),a=ss.lastIndex;return ar;++r)o[(n=s[r]).i]=n.x(t);return o.join("")})}function br(t,e){for(var n,r=nu.interpolators.length;--r>=0&&!(n=nu.interpolators[r](t,e)););return n}function _r(t,e){var n,r=[],i=[],a=t.length,u=e.length,o=Math.min(t.length,e.length);for(n=0;o>n;++n)r.push(br(t[n],e[n]));for(;a>n;++n)i[n]=t[n];for(;u>n;++n)i[n]=e[n];return function(t){for(n=0;o>n;++n)i[n]=r[n](t);return i}}function xr(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function wr(t){return function(e){return 1-t(1-e)}}function Ar(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function Er(t){return t*t}function kr(t){return t*t*t}function Dr(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(.5>t?n:3*(t-e)+n-.75)}function Cr(t){return function(e){return Math.pow(e,t)}}function Sr(t){return 1-Math.cos(t*Iu)}function Mr(t){return Math.pow(2,10*(t-1))}function Tr(t){return 1-Math.sqrt(1-t*t)}function Fr(t,e){var n;return arguments.length<2&&(e=.45),arguments.length?n=e/Bu*Math.asin(1/t):(t=1,n=e/4),function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-n)*Bu/e)}}function Lr(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function Br(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Nr(t,e){t=nu.hcl(t),e=nu.hcl(e);var n=t.h,r=t.c,i=t.l,a=e.h-n,u=e.c-r,o=e.l-i;return isNaN(u)&&(u=0,r=isNaN(r)?e.c:r),isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:-180>a&&(a+=360),function(t){return ht(n+a*t,r+u*t,i+o*t)+""}}function Ir(t,e){t=nu.hsl(t),e=nu.hsl(e);var n=t.h,r=t.s,i=t.l,a=e.h-n,u=e.s-r,o=e.l-i;return isNaN(u)&&(u=0,r=isNaN(r)?e.s:r),isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:-180>a&&(a+=360),function(t){return ct(n+a*t,r+u*t,i+o*t)+""}}function Or(t,e){t=nu.lab(t),e=nu.lab(e);var n=t.l,r=t.a,i=t.b,a=e.l-n,u=e.a-r,o=e.b-i;return function(t){return dt(n+a*t,r+u*t,i+o*t)+""}}function Rr(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function Pr(t){var e=[t.a,t.b],n=[t.c,t.d],r=jr(e),i=qr(e,n),a=jr(Ur(n,e,-i))||0;e[0]*n[1]180?l+=360:l-c>180&&(c+=360),i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:yr(c,l)})):l&&r.push(r.pop()+"rotate("+l+")"),h!=f?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:yr(h,f)}):f&&r.push(r.pop()+"skewX("+f+")"),d[0]!=p[0]||d[1]!=p[1]?(n=r.push(r.pop()+"scale(",null,",",null,")"),i.push({i:n-4,x:yr(d[0],p[0])},{i:n-2,x:yr(d[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),n=i.length,function(t){for(var e,a=-1;++a=0;)n.push(i[r])}function ei(t,e){for(var n=[t],r=[];null!=(t=n.pop());)if(r.push(t),(a=t.children)&&(i=a.length))for(var i,a,u=-1;++un;++n)(e=t[n][1])>i&&(r=n,i=e);return r}function fi(t){return t.reduce(di,0)}function di(t,e){return t+e[1]}function pi(t,e){return gi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function gi(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,a=[];++n<=e;)a[n]=i*n+r;return a}function mi(t){return[nu.min(t),nu.max(t)]}function yi(t,e){return t.value-e.value}function vi(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function bi(t,e){t._pack_next=e,e._pack_prev=t}function _i(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return.999*i*i>n*n+r*r}function xi(t){function e(t){l=Math.min(t.x-t.r,l),h=Math.max(t.x+t.r,h),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}if((n=t.children)&&(c=n.length)){var n,r,i,a,u,o,s,c,l=1/0,h=-(1/0),f=1/0,d=-(1/0);if(n.forEach(wi),r=n[0],r.x=-r.r,r.y=0,e(r),c>1&&(i=n[1],i.x=i.r,i.y=0,e(i),c>2))for(a=n[2],ki(r,i,a),e(a),vi(r,a),r._pack_prev=a,vi(a,i),i=r._pack_next,u=3;c>u;u++){ki(r,i,a=n[u]);var p=0,g=1,m=1;for(o=i._pack_next;o!==i;o=o._pack_next,g++)if(_i(o,a)){p=1;break}if(1==p)for(s=r._pack_prev;s!==o._pack_prev&&!_i(s,a);s=s._pack_prev,m++);p?(m>g||g==m&&i.ru;u++)a=n[u],a.x-=y,a.y-=v,b=Math.max(b,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=b,n.forEach(Ai)}}function wi(t){t._pack_next=t._pack_prev=t}function Ai(t){delete t._pack_next,delete t._pack_prev}function Ei(t,e,n,r){var i=t.children;if(t.x=e+=r*t.x,t.y=n+=r*t.y,t.r*=r,i)for(var a=-1,u=i.length;++a=0;)e=i[a],e.z+=n,e.m+=n,n+=e.s+(r+=e.c)}function Fi(t,e,n){return t.a.parent===e.parent?t.a:n}function Li(t){return 1+nu.max(t,function(t){return t.y})}function Bi(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ni(t){var e=t.children;return e&&e.length?Ni(e[0]):t}function Ii(t){var e,n=t.children;return n&&(e=n.length)?Ii(n[e-1]):t}function Oi(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Ri(t,e){var n=t.x+e[3],r=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return 0>i&&(n+=i/2,i=0),0>a&&(r+=a/2,a=0),{x:n,y:r,dx:i,dy:a}}function Pi(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function qi(t){return t.rangeExtent?t.rangeExtent():Pi(t.range())}function ji(t,e,n,r){var i=n(t[0],t[1]),a=r(e[0],e[1]);return function(t){return a(i(t))}}function Ui(t,e){var n,r=0,i=t.length-1,a=t[r],u=t[i];return a>u&&(n=r,r=i,i=n,n=a,a=u,u=n),t[r]=e.floor(a),t[i]=e.ceil(u),t}function Yi(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:bs}function Vi(t,e,n,r){var i=[],a=[],u=0,o=Math.min(t.length,e.length)-1;for(t[o]2?Vi:ji,s=r?zr:Vr;return u=i(t,e,s,n),o=i(e,t,s,br),a}function a(t){return u(t)}var u,o;return a.invert=function(t){return o(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Rr)},a.clamp=function(t){return arguments.length?(r=t,i()):r},a.interpolate=function(t){return arguments.length?(n=t,i()):n},a.ticks=function(e){return Wi(t,e)},a.tickFormat=function(e,n){return Zi(t,e,n)},a.nice=function(e){return Hi(t,e),i()},a.copy=function(){return zi(t,e,n,r)},i()}function $i(t,e){return nu.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Hi(t,e){return Ui(t,Yi(Gi(t,e)[2]))}function Gi(t,e){null==e&&(e=10);var n=Pi(t),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),a=e/r*i;return.15>=a?i*=10:.35>=a?i*=5:.75>=a&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function Wi(t,e){return nu.range.apply(nu,Gi(t,e))}function Zi(t,e,n){var r=Gi(t,e);if(n){var i=uo.exec(n);if(i.shift(),"s"===i[8]){var a=nu.formatPrefix(Math.max(pu(r[0]),pu(r[1])));return i[7]||(i[7]="."+Xi(a.scale(r[2]))),i[8]="f",n=nu.format(i.join("")),function(t){return n(a.scale(t))+a.symbol}}i[7]||(i[7]="."+Ji(i[8],r)),n=i.join("")}else n=",."+Xi(r[2])+"f";return nu.format(n)}function Xi(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function Ji(t,e){var n=Xi(e[2]);return t in _s?Math.abs(n-Xi(Math.max(pu(e[0]),pu(e[1]))))+ +("e"!==t):n-2*("%"===t)}function Ki(t,e,n,r){function i(t){return(n?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function u(e){return t(i(e))}return u.invert=function(e){return a(t.invert(e))},u.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((r=e.map(Number)).map(i)),u):r},u.base=function(n){return arguments.length?(e=+n,t.domain(r.map(i)),u):e},u.nice=function(){var e=Ui(r.map(i),n?Math:ws);return t.domain(e),r=e.map(a),u},u.ticks=function(){var t=Pi(r),u=[],o=t[0],s=t[1],c=Math.floor(i(o)),l=Math.ceil(i(s)),h=e%1?2:e;if(isFinite(l-c)){if(n){for(;l>c;c++)for(var f=1;h>f;f++)u.push(a(c)*f);u.push(a(c))}else for(u.push(a(c));c++0;f--)u.push(a(c)*f);for(c=0;u[c]s;l--);u=u.slice(c,l)}return u},u.tickFormat=function(t,e){if(!arguments.length)return xs;arguments.length<2?e=xs:"function"!=typeof e&&(e=nu.format(e));var r,o=Math.max(.1,t/u.ticks().length),s=n?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(t){return t/a(s(i(t)+r))<=o?e(t):""}},u.copy=function(){return Ki(t.copy(),e,n,r)},$i(u,t)}function Qi(t,e,n){function r(e){return t(i(e))}var i=ta(e),a=ta(1/e);return r.invert=function(e){return a(t.invert(e))},r.domain=function(e){return arguments.length?(t.domain((n=e.map(Number)).map(i)),r):n},r.ticks=function(t){return Wi(n,t)},r.tickFormat=function(t,e){return Zi(n,t,e)},r.nice=function(t){return r.domain(Hi(n,t))},r.exponent=function(u){return arguments.length?(i=ta(e=u),a=ta(1/e),t.domain(n.map(i)),r):e},r.copy=function(){return Qi(t.copy(),e,n)},$i(r,t)}function ta(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function ea(t,e){function n(n){return a[((i.get(n)||("range"===e.t?i.set(n,t.push(n)):0/0))-1)%a.length]}function r(e,n){return nu.range(t.length).map(function(t){return e+n*t})}var i,a,u;return n.domain=function(r){if(!arguments.length)return t;t=[],i=new l;for(var a,u=-1,o=r.length;++un?[0/0,0/0]:[n>0?o[n-1]:t[0],ne?0/0:e/a+t,[e,e+1/a]},r.copy=function(){return ra(t,e,n)},i()}function ia(t,e){function n(n){return n>=n?e[nu.bisect(t,n)]:void 0}return n.domain=function(e){return arguments.length?(t=e,n):t},n.range=function(t){return arguments.length?(e=t,n):e},n.invertExtent=function(n){return n=e.indexOf(n),[t[n-1],t[n]]},n.copy=function(){return ia(t,e)},n}function aa(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(n){return arguments.length?(t=n.map(e),e):t},e.ticks=function(e){return Wi(t,e)},e.tickFormat=function(e,n){return Zi(t,e,n)},e.copy=function(){return aa(t)},e}function ua(){return 0}function oa(t){return t.innerRadius}function sa(t){return t.outerRadius}function ca(t){return t.startAngle}function la(t){return t.endAngle}function ha(t){return t&&t.padAngle}function fa(t,e,n,r){return(t-n)*e-(e-r)*t>0?0:1}function da(t,e,n,r,i){var a=t[0]-e[0],u=t[1]-e[1],o=(i?r:-r)/Math.sqrt(a*a+u*u),s=o*u,c=-o*a,l=t[0]+s,h=t[1]+c,f=e[0]+s,d=e[1]+c,p=(l+f)/2,g=(h+d)/2,m=f-l,y=d-h,v=m*m+y*y,b=n-r,_=l*d-f*h,x=(0>y?-1:1)*Math.sqrt(b*b*v-_*_),w=(_*y-m*x)/v,A=(-_*m-y*x)/v,E=(_*y+m*x)/v,k=(-_*m+y*x)/v,D=w-p,C=A-g,S=E-p,M=k-g;return D*D+C*C>S*S+M*M&&(w=E,A=k),[[w-s,A-c],[w*n/b,A*n/b]]}function pa(t){function e(e){function u(){c.push("M",a(t(l),o))}for(var s,c=[],l=[],h=-1,f=e.length,d=Ct(n),p=Ct(r);++h1&&i.push("H",r[0]),i.join("")}function va(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e1){o=e[1],a=t[s],s++,r+="C"+(i[0]+u[0])+","+(i[1]+u[1])+","+(a[0]-o[0])+","+(a[1]-o[1])+","+a[0]+","+a[1];for(var c=2;c9&&(i=3*e/Math.sqrt(i),u[o]=i*n,u[o+1]=i*r));for(o=-1;++o<=s;)i=(t[Math.min(s,o+1)][0]-t[Math.max(0,o-1)][0])/(6*(1+u[o]*u[o])), +a.push([i||0,u[o]*i||0]);return a}function Na(t){return t.length<3?ga(t):t[0]+Aa(t,Ba(t))}function Ia(t){for(var e,n,r,i=-1,a=t.length;++ir)return l();var i=a[a.active];i&&(--a.count,delete a[a.active],i.event&&i.event.interrupt.call(t,t.__data__,i.index)),a.active=r,u.event&&u.event.start.call(t,t.__data__,e),u.tween.forEach(function(n,r){(r=r.call(t,t.__data__,e))&&g.push(r)}),f=u.ease,h=u.duration,nu.timer(function(){return p.c=c(n||1)?Me:c,1},0,o)}function c(n){if(a.active!==r)return 1;for(var i=n/h,o=f(i),s=g.length;s>0;)g[--s].call(t,o);return i>=1?(u.event&&u.event.end.call(t,t.__data__,e),l()):void 0}function l(){return--a.count?delete a[r]:delete t[n],1}var h,f,d=u.delay,p=ro,g=[];return p.t=d+o,i>=d?s(i-d):void(p.c=s)},0,o)}}function Za(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function Xa(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}function Ja(t){return t.toISOString()}function Ka(t,e,n){function r(e){return t(e)}function i(t,n){var r=t[1]-t[0],i=r/n,a=nu.bisect(Gs,i);return a==Gs.length?[e.year,Gi(t.map(function(t){return t/31536e6}),n)[2]]:a?e[i/Gs[a-1]1?{floor:function(e){for(;n(e=t.floor(e));)e=Qa(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=Qa(+e+1);return e}}:t))},r.ticks=function(t,e){var n=Pi(r.domain()),a=null==t?i(n,10):"number"==typeof t?i(n,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(n[0],Qa(+n[1]+1),1>e?1:e)},r.tickFormat=function(){return n},r.copy=function(){return Ka(t.copy(),e,n)},$i(r,t)}function Qa(t){return new Date(t)}function tu(t){return JSON.parse(t.responseText)}function eu(t){var e=au.createRange();return e.selectNode(au.body),e.createContextualFragment(t.responseText)}var nu={version:"3.5.6"},ru=[].slice,iu=function(t){return ru.call(t)},au=this.document;if(au)try{iu(au.documentElement.childNodes)[0].nodeType}catch(uu){iu=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}if(Date.now||(Date.now=function(){return+new Date}),au)try{au.createElement("DIV").style.setProperty("opacity",0,"")}catch(ou){var su=this.Element.prototype,cu=su.setAttribute,lu=su.setAttributeNS,hu=this.CSSStyleDeclaration.prototype,fu=hu.setProperty;su.setAttribute=function(t,e){cu.call(this,t,e+"")},su.setAttributeNS=function(t,e,n){lu.call(this,t,e,n+"")},hu.setProperty=function(t,e,n){fu.call(this,t,e+"",n)}}nu.ascending=r,nu.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:0/0},nu.min=function(t,e){var n,r,i=-1,a=t.length;if(1===arguments.length){for(;++i=r){n=r;break}for(;++ir&&(n=r)}else{for(;++i=r){n=r;break}for(;++ir&&(n=r)}return n},nu.max=function(t,e){var n,r,i=-1,a=t.length;if(1===arguments.length){for(;++i=r){n=r;break}for(;++in&&(n=r)}else{for(;++i=r){n=r;break}for(;++in&&(n=r)}return n},nu.extent=function(t,e){var n,r,i,a=-1,u=t.length;if(1===arguments.length){for(;++a=r){n=i=r;break}for(;++ar&&(n=r),r>i&&(i=r))}else{for(;++a=r){n=i=r;break}for(;++ar&&(n=r),r>i&&(i=r))}return[n,i]},nu.sum=function(t,e){var n,r=0,i=t.length,u=-1;if(1===arguments.length)for(;++u1?s/(l-1):void 0},nu.deviation=function(){var t=nu.variance.apply(this,arguments);return t?Math.sqrt(t):t};var du=u(r);nu.bisectLeft=du.left,nu.bisect=nu.bisectRight=du.right,nu.bisector=function(t){return u(1===t.length?function(e,n){return r(t(e),n)}:t)},nu.shuffle=function(t,e,n){(a=arguments.length)<3&&(n=t.length,2>a&&(e=0));for(var r,i,a=n-e;a;)i=Math.random()*a--|0,r=t[a+e],t[a+e]=t[i+e],t[i+e]=r;return t},nu.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},nu.pairs=function(t){for(var e,n=0,r=t.length-1,i=t[0],a=new Array(0>r?0:r);r>n;)a[n]=[e=i,i=t[++n]];return a},nu.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,e=nu.min(arguments,o),n=new Array(e);++t=0;)for(r=t[i],e=r.length;--e>=0;)n[--u]=r[e];return n};var pu=Math.abs;nu.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n===1/0)throw new Error("infinite range");var r,i=[],a=s(pu(n)),u=-1;if(t*=a,e*=a,n*=a,0>n)for(;(r=t+n*++u)>e;)i.push(r/a);else for(;(r=t+n*++u)=a.length)return r?r.call(i,u):n?u.sort(n):u;for(var s,c,h,f,d=-1,p=u.length,g=a[o++],m=new l;++d=a.length)return t;var r=[],i=u[n++];return t.forEach(function(t,i){r.push({key:t,values:e(i,n)})}),i?r.sort(function(t,e){return i(t.key,e.key)}):r}var n,r,i={},a=[],u=[];return i.map=function(e,n){return t(n,e,0)},i.entries=function(n){return e(t(nu.map,n,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return u[a.length-1]=t,i},i.sortValues=function(t){return n=t,i},i.rollup=function(t){return r=t,i},i},nu.set=function(t){var e=new v;if(t)for(var n=0,r=t.length;r>n;++n)e.add(t[n]);return e},c(v,{has:d,add:function(t){return this._[h(t+="")]=!0,t},remove:p,values:g,size:m,empty:y,forEach:function(t){for(var e in this._)t.call(this,f(e))}}),nu.behavior={},nu.rebind=function(t,e){for(var n,r=1,i=arguments.length;++r=0&&(r=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},nu.event=null,nu.requote=function(t){return t.replace(vu,"\\$&")};var vu=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,bu={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},_u=function(t,e){return e.querySelector(t)},xu=function(t,e){return e.querySelectorAll(t)},wu=function(t,e){var n=t.matches||t[x(t,"matchesSelector")];return(wu=function(t,e){return n.call(t,e)})(t,e)};"function"==typeof Sizzle&&(_u=function(t,e){return Sizzle(t,e)[0]||null},xu=Sizzle,wu=Sizzle.matchesSelector),nu.selection=function(){return nu.select(au.documentElement)};var Au=nu.selection.prototype=[];Au.select=function(t){var e,n,r,i,a=[];t=M(t);for(var u=-1,o=this.length;++u=0&&(n=t.slice(0,e),t=t.slice(e+1)),Eu.hasOwnProperty(n)?{space:Eu[n],local:t}:t}},Au.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return t=nu.ns.qualify(t),t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(F(e,t[e]));return this}return this.each(F(t,e))},Au.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=N(t)).length,i=-1;if(e=n.classList){for(;++ii){if("string"!=typeof t){2>i&&(e="");for(r in t)this.each(R(r,t[r],e));return this}if(2>i){var a=this.node();return n(a).getComputedStyle(a,null).getPropertyValue(t)}r=""}return this.each(R(t,e,r))},Au.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(P(e,t[e]));return this}return this.each(P(t,e))},Au.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},Au.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},Au.append=function(t){return t=q(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Au.insert=function(t,e){return t=q(t),e=M(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},Au.remove=function(){return this.each(j)},Au.data=function(t,e){function n(t,n){var r,i,a,u=t.length,h=n.length,f=Math.min(u,h),d=new Array(h),p=new Array(h),g=new Array(u);if(e){var m,y=new l,v=new Array(u);for(r=-1;++rr;++r)p[r]=U(n[r]);for(;u>r;++r)g[r]=t[r]}p.update=d,p.parentNode=d.parentNode=g.parentNode=t.parentNode,o.push(p),s.push(d),c.push(g)}var r,i,a=-1,u=this.length;if(!arguments.length){for(t=new Array(u=(r=this[0]).length);++aa;a++){i.push(e=[]),e.parentNode=(n=this[a]).parentNode;for(var o=0,s=n.length;s>o;o++)(r=n[o])&&t.call(r,r.__data__,o,a)&&e.push(r)}return S(i)},Au.order=function(){for(var t=-1,e=this.length;++t=0;)(n=r[i])&&(a&&a!==n.nextSibling&&a.parentNode.insertBefore(n,a),a=n);return this},Au.sort=function(t){t=V.apply(this,arguments);for(var e=-1,n=this.length;++et;t++)for(var n=this[t],r=0,i=n.length;i>r;r++){var a=n[r];if(a)return a}return null},Au.size=function(){var t=0;return z(this,function(){++t}),t};var ku=[];nu.selection.enter=$,nu.selection.enter.prototype=ku,ku.append=Au.append,ku.empty=Au.empty,ku.node=Au.node,ku.call=Au.call,ku.size=Au.size,ku.select=function(t){for(var e,n,r,i,a,u=[],o=-1,s=this.length;++or){if("string"!=typeof t){2>r&&(e=!1);for(n in t)this.each(G(n,t[n],e));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;n=!1}return this.each(G(t,e,n))};var Du=nu.map({mouseenter:"mouseover",mouseleave:"mouseout"});au&&Du.forEach(function(t){"on"+t in au&&Du.remove(t)});var Cu,Su=0;nu.mouse=function(t){return J(t,D())};var Mu=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;nu.touch=function(t,e,n){if(arguments.length<3&&(n=e,e=D().changedTouches),e)for(var r,i=0,a=e.length;a>i;++i)if((r=e[i]).identifier===n)return J(t,r)},nu.behavior.drag=function(){function t(){this.on("mousedown.drag",a).on("touchstart.drag",u)}function e(t,e,n,a,u){return function(){function o(){var t,n,r=e(f,g);r&&(t=r[0]-b[0],n=r[1]-b[1],p|=t|n,b=r,d({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:t,dy:n}))}function s(){e(f,g)&&(y.on(a+m,null).on(u+m,null),v(p&&nu.event.target===h),d({type:"dragend"}))}var c,l=this,h=nu.event.target,f=l.parentNode,d=r.of(l,arguments),p=0,g=t(),m=".drag"+(null==g?"":"-"+g),y=nu.select(n(h)).on(a+m,o).on(u+m,s),v=X(h),b=e(f,g);i?(c=i.apply(l,arguments),c=[c.x-b[0],c.y-b[1]]):c=[0,0],d({type:"dragstart"})}}var r=C(t,"drag","dragstart","dragend"),i=null,a=e(w,nu.mouse,n,"mousemove","mouseup"),u=e(K,nu.touch,b,"touchmove","touchend");return t.origin=function(e){return arguments.length?(i=e,t):i},nu.rebind(t,r,"on")},nu.touches=function(t,e){return arguments.length<2&&(e=D().touches),e?iu(e).map(function(e){var n=J(t,e);return n.identifier=e.identifier,n}):[]};var Tu=1e-6,Fu=Tu*Tu,Lu=Math.PI,Bu=2*Lu,Nu=Bu-Tu,Iu=Lu/2,Ou=Lu/180,Ru=180/Lu,Pu=Math.SQRT2,qu=2,ju=4;nu.interpolateZoom=function(t,e){function n(t){var e=t*v;if(y){var n=it(g),u=a/(qu*f)*(n*at(Pu*e+g)-rt(g));return[r+u*c,i+u*l,a*n/it(Pu*e+g)]}return[r+t*c,i+t*l,a*Math.exp(Pu*e)]}var r=t[0],i=t[1],a=t[2],u=e[0],o=e[1],s=e[2],c=u-r,l=o-i,h=c*c+l*l,f=Math.sqrt(h),d=(s*s-a*a+ju*h)/(2*a*qu*f),p=(s*s-a*a-ju*h)/(2*s*qu*f),g=Math.log(Math.sqrt(d*d+1)-d),m=Math.log(Math.sqrt(p*p+1)-p),y=m-g,v=(y||Math.log(s/a))/Pu;return n.duration=1e3*v,n},nu.behavior.zoom=function(){function t(t){t.on(F,h).on(Yu+".zoom",d).on("dblclick.zoom",p).on(N,f)}function e(t){return[(t[0]-E.x)/E.k,(t[1]-E.y)/E.k]}function r(t){return[t[0]*E.k+E.x,t[1]*E.k+E.y]}function i(t){E.k=Math.max(S[0],Math.min(S[1],t))}function a(t,e){e=r(e),E.x+=t[0]-e[0],E.y+=t[1]-e[1]}function u(e,n,r,u){e.__chart__={x:E.x,y:E.y,k:E.k},i(Math.pow(2,u)),a(m=n,r),e=nu.select(e),M>0&&(e=e.transition().duration(M)),e.call(t.event)}function o(){x&&x.domain(_.range().map(function(t){return(t-E.x)/E.k}).map(_.invert)),A&&A.domain(w.range().map(function(t){return(t-E.y)/E.k}).map(w.invert))}function s(t){T++||t({type:"zoomstart"})}function c(t){o(),t({type:"zoom",scale:E.k,translate:[E.x,E.y]})}function l(t){--T||(t({type:"zoomend"}),m=null)}function h(){function t(){h=1,a(nu.mouse(i),d),c(o)}function r(){f.on(L,null).on(B,null),p(h&&nu.event.target===u),l(o)}var i=this,u=nu.event.target,o=I.of(i,arguments),h=0,f=nu.select(n(i)).on(L,t).on(B,r),d=e(nu.mouse(i)),p=X(i);Rs.call(i),s(o)}function f(){function t(){var t=nu.touches(p);return d=E.k,t.forEach(function(t){t.identifier in m&&(m[t.identifier]=e(t))}),t}function n(){var e=nu.event.target;nu.select(e).on(_,r).on(x,o),w.push(e);for(var n=nu.event.changedTouches,i=0,a=n.length;a>i;++i)m[n[i].identifier]=null;var s=t(),c=Date.now();if(1===s.length){if(500>c-b){var l=s[0];u(p,l,m[l.identifier],Math.floor(Math.log(E.k)/Math.LN2)+1),k()}b=c}else if(s.length>1){var l=s[0],h=s[1],f=l[0]-h[0],d=l[1]-h[1];y=f*f+d*d}}function r(){var t,e,n,r,u=nu.touches(p);Rs.call(p);for(var o=0,s=u.length;s>o;++o,r=null)if(n=u[o],r=m[n.identifier]){if(e)break;t=n,e=r}if(r){var l=(l=n[0]-t[0])*l+(l=n[1]-t[1])*l,h=y&&Math.sqrt(l/y);t=[(t[0]+n[0])/2,(t[1]+n[1])/2],e=[(e[0]+r[0])/2,(e[1]+r[1])/2],i(h*d)}b=null,a(t,e),c(g)}function o(){if(nu.event.touches.length){for(var e=nu.event.changedTouches,n=0,r=e.length;r>n;++n)delete m[e[n].identifier];for(var i in m)return void t()}nu.selectAll(w).on(v,null),A.on(F,h).on(N,f),D(),l(g)}var d,p=this,g=I.of(p,arguments),m={},y=0,v=".zoom-"+nu.event.changedTouches[0].identifier,_="touchmove"+v,x="touchend"+v,w=[],A=nu.select(p),D=X(p);n(),s(g),A.on(F,null).on(N,n)}function d(){var t=I.of(this,arguments);v?clearTimeout(v):(Rs.call(this),g=e(m=y||nu.mouse(this)),s(t)),v=setTimeout(function(){v=null,l(t)},50),k(),i(Math.pow(2,.002*Uu())*E.k),a(m,g),c(t)}function p(){var t=nu.mouse(this),n=Math.log(E.k)/Math.LN2;u(this,t,e(t),nu.event.shiftKey?Math.ceil(n)-1:Math.floor(n)+1)}var g,m,y,v,b,_,x,w,A,E={x:0,y:0,k:1},D=[960,500],S=Vu,M=250,T=0,F="mousedown.zoom",L="mousemove.zoom",B="mouseup.zoom",N="touchstart.zoom",I=C(t,"zoomstart","zoom","zoomend");return Yu||(Yu="onwheel"in au?(Uu=function(){return-nu.event.deltaY*(nu.event.deltaMode?120:1)},"wheel"):"onmousewheel"in au?(Uu=function(){return nu.event.wheelDelta},"mousewheel"):(Uu=function(){return-nu.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=I.of(this,arguments),e=E;Is?nu.select(this).transition().each("start.zoom",function(){E=this.__chart__||{x:0,y:0,k:1},s(t)}).tween("zoom:zoom",function(){var n=D[0],r=D[1],i=m?m[0]:n/2,a=m?m[1]:r/2,u=nu.interpolateZoom([(i-E.x)/E.k,(a-E.y)/E.k,n/E.k],[(i-e.x)/e.k,(a-e.y)/e.k,n/e.k]);return function(e){var r=u(e),o=n/r[2];this.__chart__=E={x:i-r[0]*o,y:a-r[1]*o,k:o},c(t)}}).each("interrupt.zoom",function(){l(t)}).each("end.zoom",function(){l(t)}):(this.__chart__=E,s(t),c(t),l(t))})},t.translate=function(e){return arguments.length?(E={x:+e[0],y:+e[1],k:E.k},o(),t):[E.x,E.y]},t.scale=function(e){return arguments.length?(E={x:E.x,y:E.y,k:+e},o(),t):E.k},t.scaleExtent=function(e){return arguments.length?(S=null==e?Vu:[+e[0],+e[1]],t):S},t.center=function(e){return arguments.length?(y=e&&[+e[0],+e[1]],t):y},t.size=function(e){return arguments.length?(D=e&&[+e[0],+e[1]],t):D},t.duration=function(e){return arguments.length?(M=+e,t):M},t.x=function(e){return arguments.length?(x=e,_=e.copy(),E={x:0,y:0,k:1},t):x},t.y=function(e){return arguments.length?(A=e,w=e.copy(),E={x:0,y:0,k:1},t):A},nu.rebind(t,I,"on")};var Uu,Yu,Vu=[0,1/0];nu.color=ot,ot.prototype.toString=function(){return this.rgb()+""},nu.hsl=st;var zu=st.prototype=new ot;zu.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new st(this.h,this.s,this.l/t)},zu.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new st(this.h,this.s,t*this.l)},zu.rgb=function(){return ct(this.h,this.s,this.l)},nu.hcl=lt;var $u=lt.prototype=new ot;$u.brighter=function(t){return new lt(this.h,this.c,Math.min(100,this.l+Hu*(arguments.length?t:1)))},$u.darker=function(t){return new lt(this.h,this.c,Math.max(0,this.l-Hu*(arguments.length?t:1)))},$u.rgb=function(){return ht(this.h,this.c,this.l).rgb()},nu.lab=ft;var Hu=18,Gu=.95047,Wu=1,Zu=1.08883,Xu=ft.prototype=new ot;Xu.brighter=function(t){return new ft(Math.min(100,this.l+Hu*(arguments.length?t:1)),this.a,this.b)},Xu.darker=function(t){return new ft(Math.max(0,this.l-Hu*(arguments.length?t:1)),this.a,this.b)},Xu.rgb=function(){return dt(this.l,this.a,this.b)},nu.rgb=vt;var Ju=vt.prototype=new ot;Ju.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,i=30;return e||n||r?(e&&i>e&&(e=i),n&&i>n&&(n=i),r&&i>r&&(r=i),new vt(Math.min(255,e/t),Math.min(255,n/t),Math.min(255,r/t))):new vt(i,i,i)},Ju.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new vt(t*this.r,t*this.g,t*this.b)},Ju.hsl=function(){return At(this.r,this.g,this.b)},Ju.toString=function(){return"#"+xt(this.r)+xt(this.g)+xt(this.b)};var Ku=nu.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Ku.forEach(function(t,e){Ku.set(t,bt(e))}),nu.functor=Ct,nu.xhr=St(b),nu.dsv=function(t,e){function n(t,n,a){arguments.length<3&&(a=n,n=null);var u=Mt(t,e,null==n?r:i(n),a);return u.row=function(t){return arguments.length?u.response(null==(n=t)?r:i(t)):n},u}function r(t){return n.parse(t.responseText)}function i(t){return function(e){return n.parse(e.responseText,t)}}function a(e){return e.map(u).join(t)}function u(t){return o.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var o=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return n.parse=function(t,e){var r;return n.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,n){return e(i(t),n)}:i})},n.parseRows=function(t,e){function n(){if(l>=c)return u;if(i)return i=!1,a;var e=l;if(34===t.charCodeAt(e)){for(var n=e;n++l;){var r=t.charCodeAt(l++),o=1;if(10===r)i=!0;else if(13===r)i=!0,10===t.charCodeAt(l)&&(++l,++o);else if(r!==s)continue;return t.slice(e,l-o)}return t.slice(e)}for(var r,i,a={},u={},o=[],c=t.length,l=0,h=0;(r=n())!==u;){for(var f=[];r!==a&&r!==u;)f.push(r),r=n();e&&null==(f=e(f,h++))||o.push(f)}return o},n.format=function(e){if(Array.isArray(e[0]))return n.formatRows(e);var r=new v,i=[];return e.forEach(function(t){for(var e in t)r.has(e)||i.push(r.add(e))}),[i.map(u).join(t)].concat(e.map(function(e){return i.map(function(t){return u(e[t])}).join(t)})).join("\n")},n.formatRows=function(t){return t.map(a).join("\n")},n},nu.csv=nu.dsv(",","text/csv"),nu.tsv=nu.dsv(" ","text/tab-separated-values");var Qu,to,eo,no,ro,io=this[x(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};nu.timer=function(t,e,n){var r=arguments.length;2>r&&(e=0),3>r&&(n=Date.now());var i=n+e,a={c:t,t:i,f:!1,n:null};to?to.n=a:Qu=a,to=a,eo||(no=clearTimeout(no),eo=1,io(Lt))},nu.timer.flush=function(){Bt(),Nt()},nu.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var ao=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Ot);nu.formatPrefix=function(t,e){var n=0;return t&&(0>t&&(t*=-1),e&&(t=nu.round(t,It(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),ao[8+n/3]};var uo=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,oo=nu.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=nu.round(t,It(t,e))).toFixed(Math.max(0,Math.min(20,It(t*(1+1e-15),e))))}}),so=nu.time={},co=Date;qt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){lo.setUTCDate.apply(this._,arguments)},setDay:function(){lo.setUTCDay.apply(this._,arguments)},setFullYear:function(){lo.setUTCFullYear.apply(this._,arguments)},setHours:function(){lo.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){lo.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){lo.setUTCMinutes.apply(this._,arguments)},setMonth:function(){lo.setUTCMonth.apply(this._,arguments)},setSeconds:function(){lo.setUTCSeconds.apply(this._,arguments)},setTime:function(){lo.setTime.apply(this._,arguments)}};var lo=Date.prototype;so.year=jt(function(t){return t=so.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),so.years=so.year.range,so.years.utc=so.year.utc.range,so.day=jt(function(t){var e=new co(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),so.days=so.day.range,so.days.utc=so.day.utc.range,so.dayOfYear=function(t){var e=so.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=so[t]=jt(function(t){return(t=so.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=so.year(t).getDay();return Math.floor((so.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});so[t+"s"]=n.range,so[t+"s"].utc=n.utc.range,so[t+"OfYear"]=function(t){var n=so.year(t).getDay();return Math.floor((so.dayOfYear(t)+(n+e)%7)/7); -}),ei(o,xi),ei(o,function(t){t.r-=h})}return Ei(o,s/2,c/2,e?1:1/Math.max(2*o.r/s,2*o.r/c)),u}var e,n=nu.layout.hierarchy().sort(yi),r=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(n){return arguments.length?(e=null==n||"function"==typeof n?n:+n,t):e},t.padding=function(e){return arguments.length?(r=+e,t):r},Qr(t,n)},nu.layout.tree=function(){function t(t,i){var l=u.call(this,t,i),h=l[0],f=e(h);if(ei(f,n),f.parent.m=-f.z,ti(f,r),c)ti(h,a);else{var d=h,p=h,g=h;ti(h,function(t){t.xp.x&&(p=t),t.depth>g.depth&&(g=t)});var m=o(d,p)/2-d.x,y=s[0]/(p.x+o(p,d)/2+m),v=s[1]/(g.depth||1);ti(h,function(t){t.x=(t.x+m)*y,t.y=t.depth*v})}return l}function e(t){for(var e,n={A:null,children:[t]},r=[n];null!=(e=r.pop());)for(var i,a=e.children,u=0,o=a.length;o>u;++u)r.push((a[u]=i={_:a[u],parent:e,children:(i=a[u].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:u}).a=i);return n.children[0]}function n(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e.length){Ti(t);var a=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+o(t._,r._),t.m=t.z-a):t.z=a}else r&&(t.z=r.z+o(t._,r._));t.parent.A=i(t,r,t.parent.A||n[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function i(t,e,n){if(e){for(var r,i=t,a=t,u=e,s=i.parent.children[0],c=i.m,l=a.m,h=u.m,f=s.m;u=Mi(u),i=Ci(i),u&&i;)s=Ci(s),a=Mi(a),a.a=t,r=u.z+h-i.z-c+o(u._,i._),r>0&&(Si(Fi(u,t,n),t,r),c+=r,l+=r),h+=u.m,c+=i.m,f+=s.m,l+=a.m;u&&!Mi(a)&&(a.t=u,a.m+=h-l),i&&!Ci(s)&&(s.t=i,s.m+=c-f,n=t)}return n}function a(t){t.x*=s[0],t.y=t.depth*s[1]}var u=nu.layout.hierarchy().sort(null).value(null),o=Di,s=[1,1],c=null;return t.separation=function(e){return arguments.length?(o=e,t):o},t.size=function(e){return arguments.length?(c=null==(s=e)?a:null,t):c?null:s},t.nodeSize=function(e){return arguments.length?(c=null==(s=e)?null:a,t):c?s:null},Qr(t,u)},nu.layout.cluster=function(){function t(t,a){var u,o=e.call(this,t,a),s=o[0],c=0;ei(s,function(t){var e=t.children;e&&e.length?(t.x=Li(e),t.y=Bi(e)):(t.x=u?c+=n(t,u):0,t.y=0,u=t)});var l=Ni(s),h=Oi(s),f=l.x-n(l,h)/2,d=h.x+n(h,l)/2;return ei(s,i?function(t){t.x=(t.x-s.x)*r[0],t.y=(s.y-t.y)*r[1]}:function(t){t.x=(t.x-f)/(d-f)*r[0],t.y=(1-(s.y?t.y/s.y:1))*r[1]}),o}var e=nu.layout.hierarchy().sort(null).value(null),n=Di,r=[1,1],i=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(i=null==(r=e),t):i?null:r},t.nodeSize=function(e){return arguments.length?(i=null!=(r=e),t):i?r:null},Qr(t,e)},nu.layout.treemap=function(){function t(t,e){for(var n,r,i=-1,a=t.length;++ie?0:e),n.area=isNaN(r)||0>=r?0:r}function e(n){var a=n.children;if(a&&a.length){var u,o,s,c=h(n),l=[],f=a.slice(),p=1/0,g="slice"===d?c.dx:"dice"===d?c.dy:"slice-dice"===d?1&n.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(t(f,c.dx*c.dy/n.value),l.area=0;(s=f.length)>0;)l.push(u=f[s-1]),l.area+=u.area,"squarify"!==d||(o=r(l,g))<=p?(f.pop(),p=o):(l.area-=l.pop().area,i(l,g,c,!1),g=Math.min(c.dx,c.dy),l.length=l.area=0,p=1/0);l.length&&(i(l,g,c,!0),l.length=l.area=0),a.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var a,u=h(e),o=r.slice(),s=[];for(t(o,u.dx*u.dy/e.value),s.area=0;a=o.pop();)s.push(a),s.area+=a.area,null!=a.z&&(i(s,a.z?u.dx:u.dy,u,!o.length),s.length=s.area=0);r.forEach(n)}}function r(t,e){for(var n,r=t.area,i=0,a=1/0,u=-1,o=t.length;++un&&(a=n),n>i&&(i=n));return r*=r,e*=e,r?Math.max(e*i*p/r,r/(e*a*p)):1/0}function i(t,e,n,r){var i,a=-1,u=t.length,o=n.x,c=n.y,l=e?s(t.area/e):0;if(e==n.dx){for((r||l>n.dy)&&(l=n.dy);++an.dx)&&(l=n.dx);++an&&(e=1),1>n&&(t=0),function(){var n,r,i;do n=2*Math.random()-1,r=2*Math.random()-1,i=n*n+r*r;while(!i||i>1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=nu.random.normal.apply(nu,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=nu.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;t>n;n++)e+=Math.random();return e}}},nu.scale={};var bs={floor:b,ceil:b};nu.scale.linear=function(){return Vi([0,1],[0,1],br,!1)};var _s={s:1,g:1,p:1,r:1,e:1};nu.scale.log=function(){return Ki(nu.scale.linear().domain([0,1]),10,!0,[1,10])};var xs=nu.format(".0e"),ws={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};nu.scale.pow=function(){return Qi(nu.scale.linear(),1,[0,1])},nu.scale.sqrt=function(){return nu.scale.pow().exponent(.5)},nu.scale.ordinal=function(){return ea([],{t:"range",a:[[]]})},nu.scale.category10=function(){return nu.scale.ordinal().range(As)},nu.scale.category20=function(){return nu.scale.ordinal().range(Es)},nu.scale.category20b=function(){return nu.scale.ordinal().range(ks)},nu.scale.category20c=function(){return nu.scale.ordinal().range(Ds)};var As=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(_t),Es=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(_t),ks=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(_t),Ds=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(_t);nu.scale.quantile=function(){return na([],[])},nu.scale.quantize=function(){return ra(0,1,[0,1])},nu.scale.threshold=function(){return ia([.5],[0,1])},nu.scale.identity=function(){return aa([0,1])},nu.svg={},nu.svg.arc=function(){function t(){var t=Math.max(0,+n.apply(this,arguments)),c=Math.max(0,+r.apply(this,arguments)),l=u.apply(this,arguments)-Ou,h=o.apply(this,arguments)-Ou,f=Math.abs(h-l),d=l>h?0:1;if(t>c&&(p=c,c=t,t=p),f>=Nu)return e(c,d)+(t?e(t,1-d):"")+"Z";var p,g,m,y,v,b,_,x,w,A,E,k,D=0,C=0,M=[];if((y=(+s.apply(this,arguments)||0)/2)&&(m=a===Cs?Math.sqrt(t*t+c*c):+a.apply(this,arguments),d||(C*=-1),c&&(C=nt(m/c*Math.sin(y))),t&&(D=nt(m/t*Math.sin(y)))),c){v=c*Math.cos(l+C),b=c*Math.sin(l+C),_=c*Math.cos(h-C),x=c*Math.sin(h-C);var S=Math.abs(h-l-2*C)<=Bu?0:1;if(C&&fa(v,b,_,x)===d^S){var T=(l+h)/2;v=c*Math.cos(T),b=c*Math.sin(T),_=x=null}}else v=b=0;if(t){w=t*Math.cos(h-D),A=t*Math.sin(h-D),E=t*Math.cos(l+D),k=t*Math.sin(l+D);var F=Math.abs(l-h+2*D)<=Bu?0:1;if(D&&fa(w,A,E,k)===1-d^F){var B=(l+h)/2;w=t*Math.cos(B),A=t*Math.sin(B),E=k=null}}else w=A=0;if((p=Math.min(Math.abs(c-t)/2,+i.apply(this,arguments)))>.001){g=c>t^d?0:1;var L=null==E?[w,A]:null==_?[v,b]:Nn([v,b],[E,k],[_,x],[w,A]),N=v-L[0],O=b-L[1],I=_-L[0],R=x-L[1],P=1/Math.sin(Math.acos((N*I+O*R)/(Math.sqrt(N*N+O*O)*Math.sqrt(I*I+R*R)))/2),q=Math.sqrt(L[0]*L[0]+L[1]*L[1]);if(null!=_){var j=Math.min(p,(c-q)/(P+1)),U=da(null==E?[w,A]:[E,k],[v,b],c,j,d),Y=da([_,x],[w,A],c,j,d);p===j?M.push("M",U[0],"A",j,",",j," 0 0,",g," ",U[1],"A",c,",",c," 0 ",1-d^fa(U[1][0],U[1][1],Y[1][0],Y[1][1]),",",d," ",Y[1],"A",j,",",j," 0 0,",g," ",Y[0]):M.push("M",U[0],"A",j,",",j," 0 1,",g," ",Y[0])}else M.push("M",v,",",b);if(null!=E){var z=Math.min(p,(t-q)/(P-1)),V=da([v,b],[E,k],t,-z,d),$=da([w,A],null==_?[v,b]:[_,x],t,-z,d);p===z?M.push("L",$[0],"A",z,",",z," 0 0,",g," ",$[1],"A",t,",",t," 0 ",d^fa($[1][0],$[1][1],V[1][0],V[1][1]),",",1-d," ",V[1],"A",z,",",z," 0 0,",g," ",V[0]):M.push("L",$[0],"A",z,",",z," 0 0,",g," ",V[0])}else M.push("L",w,",",A)}else M.push("M",v,",",b),null!=_&&M.push("A",c,",",c," 0 ",S,",",d," ",_,",",x),M.push("L",w,",",A),null!=E&&M.push("A",t,",",t," 0 ",F,",",1-d," ",E,",",k);return M.push("Z"),M.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var n=oa,r=sa,i=ua,a=Cs,u=ca,o=la,s=ha;return t.innerRadius=function(e){return arguments.length?(n=Ct(e),t):n},t.outerRadius=function(e){return arguments.length?(r=Ct(e),t):r},t.cornerRadius=function(e){return arguments.length?(i=Ct(e),t):i},t.padRadius=function(e){return arguments.length?(a=e==Cs?Cs:Ct(e),t):a},t.startAngle=function(e){return arguments.length?(u=Ct(e),t):u},t.endAngle=function(e){return arguments.length?(o=Ct(e),t):o},t.padAngle=function(e){return arguments.length?(s=Ct(e),t):s},t.centroid=function(){var t=(+n.apply(this,arguments)+ +r.apply(this,arguments))/2,e=(+u.apply(this,arguments)+ +o.apply(this,arguments))/2-Ou;return[Math.cos(e)*t,Math.sin(e)*t]},t};var Cs="auto";nu.svg.line=function(){return pa(b)};var Ms=nu.map({linear:ga,"linear-closed":ma,step:ya,"step-before":va,"step-after":ba,basis:ka,"basis-open":Da,"basis-closed":Ca,bundle:Ma,cardinal:wa,"cardinal-open":_a,"cardinal-closed":xa,monotone:Na});Ms.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Ss=[0,2/3,1/3,0],Ts=[0,1/3,2/3,0],Fs=[0,1/6,2/3,1/6];nu.svg.line.radial=function(){var t=pa(Oa);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},va.reverse=ba,ba.reverse=va,nu.svg.area=function(){return Ia(b)},nu.svg.area.radial=function(){var t=Ia(Oa);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},nu.svg.chord=function(){function t(t,o){var s=e(this,a,t,o),c=e(this,u,t,o);return"M"+s.p0+r(s.r,s.p1,s.a1-s.a0)+(n(s,c)?i(s.r,s.p1,s.r,s.p0):i(s.r,s.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+i(c.r,c.p1,s.r,s.p0))+"Z"}function e(t,e,n,r){var i=e.call(t,n,r),a=o.call(t,i,r),u=s.call(t,i,r)-Ou,l=c.call(t,i,r)-Ou;return{r:a,a0:u,a1:l,p0:[a*Math.cos(u),a*Math.sin(u)],p1:[a*Math.cos(l),a*Math.sin(l)]}}function n(t,e){return t.a0==e.a0&&t.a1==e.a1}function r(t,e,n){return"A"+t+","+t+" 0 "+ +(n>Bu)+",1 "+e}function i(t,e,n,r){return"Q 0,0 "+r}var a=bn,u=_n,o=Ra,s=ca,c=la;return t.radius=function(e){return arguments.length?(o=Ct(e),t):o},t.source=function(e){return arguments.length?(a=Ct(e),t):a},t.target=function(e){return arguments.length?(u=Ct(e),t):u},t.startAngle=function(e){return arguments.length?(s=Ct(e),t):s},t.endAngle=function(e){return arguments.length?(c=Ct(e),t):c},t},nu.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),u=n.call(this,t,i),o=(a.y+u.y)/2,s=[a,{x:a.x,y:o},{x:u.x,y:o},u];return s=s.map(r),"M"+s[0]+"C"+s[1]+" "+s[2]+" "+s[3]}var e=bn,n=_n,r=Pa;return t.source=function(n){return arguments.length?(e=Ct(n),t):e},t.target=function(e){return arguments.length?(n=Ct(e),t):n},t.projection=function(e){return arguments.length?(r=e,t):r},t},nu.svg.diagonal.radial=function(){var t=nu.svg.diagonal(),e=Pa,n=t.projection;return t.projection=function(t){return arguments.length?n(qa(e=t)):e},t},nu.svg.symbol=function(){function t(t,r){return(Bs.get(e.call(this,t,r))||Ya)(n.call(this,t,r))}var e=Ua,n=ja;return t.type=function(n){return arguments.length?(e=Ct(n),t):e},t.size=function(e){return arguments.length?(n=Ct(e),t):n},t};var Bs=nu.map({circle:Ya,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Ns)),n=e*Ns;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Ls),n=e*Ls/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Ls),n=e*Ls/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});nu.svg.symbolTypes=Bs.keys();var Ls=Math.sqrt(3),Ns=Math.tan(30*Iu);Au.transition=function(t){for(var e,n,r=Os||++qs,i=Ha(t),a=[],u=Is||{time:Date.now(),ease:Dr,delay:0,duration:250},o=-1,s=this.length;++oa;a++){i.push(e=[]);for(var n=this[a],o=0,s=n.length;s>o;o++)(r=n[o])&&t.call(r,r.__data__,o,a)&&e.push(r)}return Va(i,this.namespace,this.id)},Ps.tween=function(t,e){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(t):V(this,null==e?function(e){e[r][n].tween.remove(t)}:function(i){i[r][n].tween.set(t,e)})},Ps.attr=function(t,e){function n(){this.removeAttribute(o)}function r(){this.removeAttributeNS(o.space,o.local)}function i(t){return null==t?n:(t+="",function(){var e,n=this.getAttribute(o);return n!==t&&(e=u(n,t),function(t){this.setAttribute(o,e(t))})})}function a(t){return null==t?r:(t+="",function(){var e,n=this.getAttributeNS(o.space,o.local);return n!==t&&(e=u(n,t),function(t){this.setAttributeNS(o.space,o.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var u="transform"==t?Yr:br,o=nu.ns.qualify(t);return $a(this,"attr."+t,e,o.local?a:i)},Ps.attrTween=function(t,e){function n(t,n){var r=e.call(this,t,n,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,n){var r=e.call(this,t,n,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=nu.ns.qualify(t);return this.tween("attr."+t,i.local?r:n)},Ps.style=function(t,e,r){function i(){this.style.removeProperty(t)}function a(e){return null==e?i:(e+="",function(){var i,a=n(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(i=br(a,e),function(e){this.style.setProperty(t,i(e),r)})})}var u=arguments.length;if(3>u){if("string"!=typeof t){2>u&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return $a(this,"style."+t,e,a)},Ps.styleTween=function(t,e,r){function i(i,a){var u=e.call(this,i,a,n(this).getComputedStyle(this,null).getPropertyValue(t));return u&&function(e){this.style.setProperty(t,u(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,i)},Ps.text=function(t){return $a(this,"text",t,Ga)},Ps.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Ps.ease=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].ease:("function"!=typeof t&&(t=nu.ease.apply(nu,arguments)),V(this,function(r){r[n][e].ease=t}))},Ps.delay=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].delay:V(this,"function"==typeof t?function(r,i,a){r[n][e].delay=+t.call(r,r.__data__,i,a)}:(t=+t,function(r){r[n][e].delay=t}))},Ps.duration=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].duration:V(this,"function"==typeof t?function(r,i,a){r[n][e].duration=Math.max(1,t.call(r,r.__data__,i,a))}:(t=Math.max(1,t),function(r){r[n][e].duration=t}))},Ps.each=function(t,e){var n=this.id,r=this.namespace;if(arguments.length<2){var i=Is,a=Os;try{Os=n,V(this,function(e,i,a){Is=e[r][n],t.call(e,e.__data__,i,a)})}finally{Is=i,Os=a}}else V(this,function(i){var a=i[r][n];(a.event||(a.event=nu.dispatch("start","end","interrupt"))).on(t,e)});return this},Ps.transition=function(){for(var t,e,n,r,i=this.id,a=++qs,u=this.namespace,o=[],s=0,c=this.length;c>s;s++){o.push(t=[]);for(var e=this[s],l=0,h=e.length;h>l;l++)(n=e[l])&&(r=n[u][i],Wa(n,l,u,a,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),t.push(n)}return Va(o,u,a)},nu.svg.axis=function(){function t(t){t.each(function(){var t,c=nu.select(this),l=this.__chart__||n,h=this.__chart__=n.copy(),f=null==s?h.ticks?h.ticks.apply(h,o):h.domain():s,d=null==e?h.tickFormat?h.tickFormat.apply(h,o):b:e,p=c.selectAll(".tick").data(f,h),g=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Tu),m=nu.transition(p.exit()).style("opacity",Tu).remove(),y=nu.transition(p.order()).style("opacity",1),v=Math.max(i,0)+u,_=qi(h),x=c.selectAll(".domain").data([0]),w=(x.enter().append("path").attr("class","domain"),nu.transition(x));g.append("line"),g.append("text");var A,E,k,D,C=g.select("line"),M=y.select("line"),S=p.select("text").text(d),T=g.select("text"),F=y.select("text"),B="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(t=Za,A="x",k="y",E="x2",D="y2",S.attr("dy",0>B?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+_[0]+","+B*a+"V0H"+_[1]+"V"+B*a)):(t=Xa,A="y",k="x",E="y2",D="x2",S.attr("dy",".32em").style("text-anchor",0>B?"end":"start"),w.attr("d","M"+B*a+","+_[0]+"H0V"+_[1]+"H"+B*a)),C.attr(D,B*i),T.attr(k,B*v),M.attr(E,0).attr(D,B*i),F.attr(A,0).attr(k,B*v),h.rangeBand){var L=h,N=L.rangeBand()/2;l=h=function(t){return L(t)+N}}else l.rangeBand?l=h:m.call(t,h,l);g.call(t,l,h),y.call(t,h,h)})}var e,n=nu.scale.linear(),r=js,i=6,a=6,u=3,o=[10],s=null;return t.scale=function(e){return arguments.length?(n=e,t):n},t.orient=function(e){return arguments.length?(r=e in Us?e+"":js,t):r},t.ticks=function(){return arguments.length?(o=arguments,t):o},t.tickValues=function(e){return arguments.length?(s=e,t):s},t.tickFormat=function(n){return arguments.length?(e=n,t):e},t.tickSize=function(e){var n=arguments.length;return n?(i=+e,a=+arguments[n-1],t):i},t.innerTickSize=function(e){return arguments.length?(i=+e,t):i},t.outerTickSize=function(e){return arguments.length?(a=+e,t):a},t.tickPadding=function(e){return arguments.length?(u=+e,t):u},t.tickSubdivide=function(){return arguments.length&&t},t};var js="bottom",Us={top:1,right:1,bottom:1,left:1};nu.svg.brush=function(){function t(n){n.each(function(){var n=nu.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",a).on("touchstart.brush",a),u=n.selectAll(".background").data([0]);u.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var o=n.selectAll(".resize").data(g,b);o.exit().remove(),o.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Ys[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),o.style("display",t.empty()?"none":null);var s,h=nu.transition(n),f=nu.transition(u);c&&(s=qi(c),f.attr("x",s[0]).attr("width",s[1]-s[0]),r(h)),l&&(s=qi(l),f.attr("y",s[0]).attr("height",s[1]-s[0]),i(h)),e(h)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+h[+/e$/.test(t)]+","+f[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",h[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",h[1]-h[0])}function i(t){t.select(".extent").attr("y",f[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function a(){function a(){32==nu.event.keyCode&&(S||(b=null,F[0]-=h[1],F[1]-=f[1],S=2),k())}function g(){32==nu.event.keyCode&&2==S&&(F[0]+=h[1],F[1]+=f[1],S=0,k())}function m(){var t=nu.mouse(x),n=!1;_&&(t[0]+=_[0],t[1]+=_[1]),S||(nu.event.altKey?(b||(b=[(h[0]+h[1])/2,(f[0]+f[1])/2]),F[0]=h[+(t[0]l?(i=r,r=l):i=l),g[0]!=r||g[1]!=i?(n?o=null:u=null,g[0]=r,g[1]=i,!0):void 0}function v(){m(),E.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),nu.select("body").style("cursor",null),B.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),T(),A({type:"brushend"})}var b,_,x=this,w=nu.select(nu.event.target),A=s.of(x,arguments),E=nu.select(x),D=w.datum(),C=!/^(n|s)$/.test(D)&&c,M=!/^(e|w)$/.test(D)&&l,S=w.classed("extent"),T=X(x),F=nu.mouse(x),B=nu.select(n(x)).on("keydown.brush",a).on("keyup.brush",g);if(nu.event.changedTouches?B.on("touchmove.brush",m).on("touchend.brush",v):B.on("mousemove.brush",m).on("mouseup.brush",v),E.interrupt().selectAll("*").interrupt(),S)F[0]=h[0]-F[0],F[1]=f[0]-F[1];else if(D){var L=+/w$/.test(D),N=+/^n/.test(D);_=[h[1-L]-F[0],f[1-N]-F[1]],F[0]=h[L],F[1]=f[N]}else nu.event.altKey&&(b=F.slice());E.style("pointer-events","none").selectAll(".resize").style("display",null),nu.select("body").style("cursor",w.style("cursor")),A({type:"brushstart"}),m()}var u,o,s=C(t,"brushstart","brush","brushend"),c=null,l=null,h=[0,0],f=[0,0],d=!0,p=!0,g=zs[0];return t.event=function(t){t.each(function(){var t=s.of(this,arguments),e={x:h,y:f,i:u,j:o},n=this.__chart__||e;this.__chart__=e,Os?nu.select(this).transition().each("start.brush",function(){u=n.i,o=n.j,h=n.x,f=n.y,t({type:"brushstart"})}).tween("brush:brush",function(){var n=_r(h,e.x),r=_r(f,e.y);return u=o=null,function(i){h=e.x=n(i),f=e.y=r(i),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){u=e.i,o=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(c=e,g=zs[!c<<1|!l],t):c},t.y=function(e){return arguments.length?(l=e,g=zs[!c<<1|!l],t):l},t.clamp=function(e){return arguments.length?(c&&l?(d=!!e[0],p=!!e[1]):c?d=!!e:l&&(p=!!e),t):c&&l?[d,p]:c?d:l?p:null},t.extent=function(e){var n,r,i,a,s;return arguments.length?(c&&(n=e[0],r=e[1],l&&(n=n[0],r=r[0]),u=[n,r],c.invert&&(n=c(n),r=c(r)),n>r&&(s=n,n=r,r=s),(n!=h[0]||r!=h[1])&&(h=[n,r])),l&&(i=e[0],a=e[1],c&&(i=i[1],a=a[1]),o=[i,a],l.invert&&(i=l(i),a=l(a)),i>a&&(s=i,i=a,a=s),(i!=f[0]||a!=f[1])&&(f=[i,a])),t):(c&&(u?(n=u[0],r=u[1]):(n=h[0],r=h[1],c.invert&&(n=c.invert(n),r=c.invert(r)),n>r&&(s=n,n=r,r=s))),l&&(o?(i=o[0],a=o[1]):(i=f[0],a=f[1],l.invert&&(i=l.invert(i),a=l.invert(a)),i>a&&(s=i,i=a,a=s))),c&&l?[[n,i],[r,a]]:c?[n,r]:l&&[i,a])},t.clear=function(){return t.empty()||(h=[0,0],f=[0,0],u=o=null),t},t.empty=function(){return!!c&&h[0]==h[1]||!!l&&f[0]==f[1]},nu.rebind(t,s,"on")};var Ys={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},zs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Vs=so.format=go.timeFormat,$s=Vs.utc,Gs=$s("%Y-%m-%dT%H:%M:%S.%LZ");Vs.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ja:Gs,Ja.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Ja.toString=Gs.toString,so.second=jt(function(t){return new co(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),so.seconds=so.second.range,so.seconds.utc=so.second.utc.range,so.minute=jt(function(t){return new co(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),so.minutes=so.minute.range,so.minutes.utc=so.minute.utc.range,so.hour=jt(function(t){var e=t.getTimezoneOffset()/60;return new co(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),so.hours=so.hour.range,so.hours.utc=so.hour.utc.range,so.month=jt(function(t){return t=so.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),so.months=so.month.range,so.months.utc=so.month.utc.range;var Hs=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ws=[[so.second,1],[so.second,5],[so.second,15],[so.second,30],[so.minute,1],[so.minute,5],[so.minute,15],[so.minute,30],[so.hour,1],[so.hour,3],[so.hour,6],[so.hour,12],[so.day,1],[so.day,2],[so.week,1],[so.month,1],[so.month,3],[so.year,1]],Zs=Vs.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Se]]),Xs={range:function(t,e,n){return nu.range(Math.ceil(t/n)*n,+e,n).map(Qa)},floor:b,ceil:b};Ws.year=so.year,so.scale=function(){return Ka(nu.scale.linear(),Ws,Zs)};var Js=Ws.map(function(t){return[t[0].utc,t[1]]}),Ks=$s.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Se]]);Js.year=so.year.utc,so.scale.utc=function(){return Ka(nu.scale.linear(),Js,Ks)},nu.text=Mt(function(t){return t.responseText}),nu.json=function(t,e){return St(t,"application/json",tu,e)},nu.html=function(t,e){return St(t,"text/html",eu,e)},nu.xml=Mt(function(t){return t.responseXML}),"function"==typeof define&&define.amd?define(nu):"object"==typeof e&&e.exports&&(e.exports=nu),this.d3=nu}()},{}],5:[function(t,e){e.exports={graphlib:t("./lib/graphlib"),dagre:t("./lib/dagre"),intersect:t("./lib/intersect"),render:t("./lib/render"),util:t("./lib/util"),version:t("./lib/version")}},{"./lib/dagre":12,"./lib/graphlib":13,"./lib/intersect":14,"./lib/render":29,"./lib/util":31,"./lib/version":32}],6:[function(t,e){function n(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),u=i.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(u,n[r+"Style"])}function r(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),u=i.append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(u,n[r+"Style"])}function i(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),u=i.append("path").attr("d","M 0 5 L 10 5").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(u,n[r+"Style"])}var a=t("./util");e.exports={"default":n,normal:n,vee:r,undirected:i}},{"./util":31}],7:[function(t,e){function n(t,e){var n=e.nodes().filter(function(t){return r.isSubgraph(e,t)}),a=t.selectAll("g.cluster").data(n,function(t){return t});return a.selectAll("*").remove(),a.enter().append("g").attr("class","cluster").attr("id",function(t){var n=e.node(t);return n.id}).style("opacity",0),r.applyTransition(a,e).style("opacity",1),a.each(function(t){var n=e.node(t),r=d3.select(this);d3.select(this).append("rect");var a=r.append("g").attr("class","label");i(a,n,n.clusterLabelPos)}),a.selectAll("rect").each(function(t){var n=e.node(t),i=d3.select(this);r.applyStyle(i,n.style)}),r.applyTransition(a.exit(),e).style("opacity",0).remove(),a}var r=t("./util"),i=t("./label/add-label");e.exports=n},{"./label/add-label":22,"./util":31}],8:[function(t,e){"use strict";function n(t,e){var n=t.selectAll("g.edgeLabel").data(e.edges(),function(t){return a.edgeToId(t)}).classed("update",!0);return n.selectAll("*").remove(),n.enter().append("g").classed("edgeLabel",!0).style("opacity",0),n.each(function(t){var n=e.edge(t),a=i(u.select(this),e.edge(t),0,0).classed("label",!0),o=a.node().getBBox();n.labelId&&a.attr("id",n.labelId),r.has(n,"width")||(n.width=o.width),r.has(n,"height")||(n.height=o.height)}),a.applyTransition(n.exit(),e).style("opacity",0).remove(),n}var r=t("./lodash"),i=t("./label/add-label"),a=t("./util"),u=t("./d3");e.exports=n},{"./d3":11,"./label/add-label":22,"./lodash":25,"./util":31}],9:[function(t,e){"use strict";function n(t,e,n){var i=t.selectAll("g.edgePath").data(e.edges(),function(t){return l.edgeToId(t)}).classed("update",!0);return u(i,e),o(i,e),l.applyTransition(i,e).style("opacity",1),i.each(function(t){var n=h.select(this),r=e.edge(t);r.elem=this,r.id&&n.attr("id",r.id),l.applyClass(n,r["class"],(n.classed("update")?"update ":"")+"edgePath")}),i.selectAll("path.path").each(function(t){var n=e.edge(t);n.arrowheadId=s.uniqueId("arrowhead");var i=h.select(this).attr("marker-end",function(){return"url(#"+n.arrowheadId+")"}).style("fill","none");l.applyTransition(i,e).attr("d",function(t){return r(e,t)}),l.applyStyle(i,n.style)}),i.selectAll("defs *").remove(),i.selectAll("defs").each(function(t){var r=e.edge(t),i=n[r.arrowhead];i(h.select(this),r.arrowheadId,r,"arrowhead")}),i}function r(t,e){var n=t.edge(e),r=t.node(e.v),a=t.node(e.w),u=n.points.slice(1,n.points.length-1);return u.unshift(c(r,u[0])),u.push(c(a,u[u.length-1])),i(n,u)}function i(t,e){var n=h.svg.line().x(function(t){return t.x}).y(function(t){return t.y});return s.has(t,"lineInterpolate")&&n.interpolate(t.lineInterpolate),s.has(t,"lineTension")&&n.tension(Number(t.lineTension)),n(e)}function a(t){var e=t.getBBox(),n=t.getTransformToElement(t.ownerSVGElement).translate(e.width/2,e.height/2);return{x:n.e,y:n.f}}function u(t,e){var n=t.enter().append("g").attr("class","edgePath").style("opacity",0);n.append("path").attr("class","path").attr("d",function(t){var n=e.edge(t),r=e.node(t.v).elem,u=s.range(n.points.length).map(function(){return a(r)});return i(n,u)}),n.append("defs")}function o(t,e){var n=t.exit();l.applyTransition(n,e).style("opacity",0).remove(),l.applyTransition(n.select("path.path"),e).attr("d",function(t){var n=e.node(t.v);if(n){var r=s.range(this.pathSegList.length).map(function(){return n});return i({},r)}return h.select(this).attr("d")})}var s=t("./lodash"),c=t("./intersect/intersect-node"),l=t("./util"),h=t("./d3");e.exports=n},{"./d3":11,"./intersect/intersect-node":18,"./lodash":25,"./util":31}],10:[function(t,e){"use strict"; +}}),so.week=so.sunday,so.weeks=so.sunday.range,so.weeks.utc=so.sunday.utc.range,so.weekOfYear=so.sundayOfYear;var ho={"-":"",_:" ",0:"0"},fo=/^\s*\d+/,po=/^%/;nu.locale=function(t){return{numberFormat:Rt(t),timeFormat:Yt(t)}};var go=nu.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});nu.format=go.numberFormat,nu.geo={},ce.prototype={s:0,t:0,add:function(t){le(t,this.t,mo),le(mo.s,this.s,this),this.s?this.t+=mo.t:this.s=mo.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var mo=new ce;nu.geo.stream=function(t,e){t&&yo.hasOwnProperty(t.type)?yo[t.type](t,e):he(t,e)};var yo={Feature:function(t,e){he(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++rt?4*Lu+t:t,xo.lineStart=xo.lineEnd=xo.point=w}};nu.geo.bounds=function(){function t(t,e){b.push(_=[l=t,f=t]),h>e&&(h=e),e>d&&(d=e)}function e(e,n){var r=ge([e*Ou,n*Ou]);if(y){var i=ye(y,r),a=[i[1],-i[0],0],u=ye(a,i);_e(u),u=xe(u);var s=e-p,c=s>0?1:-1,g=u[0]*Ru*c,m=pu(s)>180;if(m^(g>c*p&&c*e>g)){var v=u[1]*Ru;v>d&&(d=v)}else if(g=(g+360)%360-180,m^(g>c*p&&c*e>g)){var v=-u[1]*Ru;h>v&&(h=v)}else h>n&&(h=n),n>d&&(d=n);m?p>e?o(l,e)>o(l,f)&&(f=e):o(e,f)>o(l,f)&&(l=e):f>=l?(l>e&&(l=e),e>f&&(f=e)):e>p?o(l,e)>o(l,f)&&(f=e):o(e,f)>o(l,f)&&(l=e)}else t(e,n);y=r,p=e}function n(){x.point=e}function r(){_[0]=l,_[1]=f,x.point=t,y=null}function i(t,n){if(y){var r=t-p;v+=pu(r)>180?r+(r>0?360:-360):r}else g=t,m=n;xo.point(t,n),e(t,n)}function a(){xo.lineStart()}function u(){i(g,m),xo.lineEnd(),pu(v)>Tu&&(l=-(f=180)),_[0]=l,_[1]=f,y=null}function o(t,e){return(e-=t)<0?e+360:e}function s(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t_o?(l=-(f=180),h=-(d=90)):v>Tu?d=90:-Tu>v&&(h=-90),_[0]=l,_[1]=f}};return function(t){d=f=-(l=h=1/0),b=[],nu.geo.stream(t,x);var e=b.length;if(e){b.sort(s);for(var n,r=1,i=b[0],a=[i];e>r;++r)n=b[r],c(n[0],i)||c(n[1],i)?(o(i[0],n[1])>o(i[0],i[1])&&(i[1]=n[1]),o(n[0],i[1])>o(i[0],i[1])&&(i[0]=n[0])):a.push(i=n);for(var u,n,p=-(1/0),e=a.length-1,r=0,i=a[e];e>=r;i=n,++r)n=a[r],(u=o(i[1],n[0]))>p&&(p=u,l=n[0],f=i[1])}return b=_=null,l===1/0||h===1/0?[[0/0,0/0],[0/0,0/0]]:[[l,h],[f,d]]}}(),nu.geo.centroid=function(t){wo=Ao=Eo=ko=Do=Co=So=Mo=To=Fo=Lo=0,nu.geo.stream(t,Bo);var e=To,n=Fo,r=Lo,i=e*e+n*n+r*r;return Fu>i&&(e=Co,n=So,r=Mo,Tu>Ao&&(e=Eo,n=ko,r=Do),i=e*e+n*n+r*r,Fu>i)?[0/0,0/0]:[Math.atan2(n,e)*Ru,nt(r/Math.sqrt(i))*Ru]};var wo,Ao,Eo,ko,Do,Co,So,Mo,To,Fo,Lo,Bo={sphere:w,point:Ae,lineStart:ke,lineEnd:De,polygonStart:function(){Bo.lineStart=Ce},polygonEnd:function(){Bo.lineStart=ke}},No=Be(Me,Re,qe,[-Lu,-Lu/2]),Io=1e9;nu.geo.clipExtent=function(){var t,e,n,r,i,a,u={stream:function(t){return i&&(i.valid=!1),i=a(t),i.valid=!0,i},extent:function(o){return arguments.length?(a=Ve(t=+o[0][0],e=+o[0][1],n=+o[1][0],r=+o[1][1]),i&&(i.valid=!1,i=null),u):[[t,e],[n,r]]}};return u.extent([[0,0],[960,500]])},(nu.geo.conicEqualArea=function(){return ze($e)}).raw=$e,nu.geo.albers=function(){return nu.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},nu.geo.albersUsa=function(){function t(t){var a=t[0],u=t[1];return e=null,n(a,u),e||(r(a,u),e)||i(a,u),e}var e,n,r,i,a=nu.geo.albers(),u=nu.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o=nu.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,n){e=[t,n]}};return t.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?u:i>=.166&&.234>i&&r>=-.214&&-.115>r?o:a).invert(t)},t.stream=function(t){var e=a.stream(t),n=u.stream(t),r=o.stream(t);return{point:function(t,i){e.point(t,i),n.point(t,i),r.point(t,i)},sphere:function(){e.sphere(),n.sphere(),r.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),u.precision(e),o.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),u.scale(.35*e),o.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var c=a.scale(),l=+e[0],h=+e[1];return n=a.translate(e).clipExtent([[l-.455*c,h-.238*c],[l+.455*c,h+.238*c]]).stream(s).point,r=u.translate([l-.307*c,h+.201*c]).clipExtent([[l-.425*c+Tu,h+.12*c+Tu],[l-.214*c-Tu,h+.234*c-Tu]]).stream(s).point,i=o.translate([l-.205*c,h+.212*c]).clipExtent([[l-.214*c+Tu,h+.166*c+Tu],[l-.115*c-Tu,h+.234*c-Tu]]).stream(s).point,t},t.scale(1070)};var Oo,Ro,Po,qo,jo,Uo,Yo={point:w,lineStart:w,lineEnd:w,polygonStart:function(){Ro=0,Yo.lineStart=He},polygonEnd:function(){Yo.lineStart=Yo.lineEnd=Yo.point=w,Oo+=pu(Ro/2)}},Vo={point:Ge,lineStart:w,lineEnd:w,polygonStart:w,polygonEnd:w},zo={point:Xe,lineStart:Je,lineEnd:Ke,polygonStart:function(){zo.lineStart=Qe},polygonEnd:function(){zo.point=Xe,zo.lineStart=Je,zo.lineEnd=Ke}};nu.geo.path=function(){function t(t){return t&&("function"==typeof o&&a.pointRadius(+o.apply(this,arguments)),u&&u.valid||(u=i(a)),nu.geo.stream(t,u)),a.result()}function e(){return u=null,t}var n,r,i,a,u,o=4.5;return t.area=function(t){return Oo=0,nu.geo.stream(t,i(Yo)),Oo},t.centroid=function(t){return Eo=ko=Do=Co=So=Mo=To=Fo=Lo=0,nu.geo.stream(t,i(zo)),Lo?[To/Lo,Fo/Lo]:Mo?[Co/Mo,So/Mo]:Do?[Eo/Do,ko/Do]:[0/0,0/0]},t.bounds=function(t){return jo=Uo=-(Po=qo=1/0),nu.geo.stream(t,i(Vo)),[[Po,qo],[jo,Uo]]},t.projection=function(t){return arguments.length?(i=(n=t)?t.stream||nn(t):b,e()):n},t.context=function(t){return arguments.length?(a=null==(r=t)?new We:new tn(t),"function"!=typeof o&&a.pointRadius(o),e()):r},t.pointRadius=function(e){return arguments.length?(o="function"==typeof e?e:(a.pointRadius(+e),+e),t):o},t.projection(nu.geo.albersUsa()).context(null)},nu.geo.transform=function(t){return{stream:function(e){var n=new rn(e);for(var r in t)n[r]=t[r];return n}}},rn.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},nu.geo.projection=un,nu.geo.projectionMutator=on,(nu.geo.equirectangular=function(){return un(cn)}).raw=cn.invert=cn,nu.geo.rotation=function(t){function e(e){return e=t(e[0]*Ou,e[1]*Ou),e[0]*=Ru,e[1]*=Ru,e}return t=hn(t[0]%360*Ou,t[1]*Ou,t.length>2?t[2]*Ou:0),e.invert=function(e){return e=t.invert(e[0]*Ou,e[1]*Ou),e[0]*=Ru,e[1]*=Ru,e},e},ln.invert=cn,nu.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=hn(-t[0]*Ou,-t[1]*Ou,0).invert,i=[];return n(null,null,1,{point:function(t,n){i.push(t=e(t,n)),t[0]*=Ru,t[1]*=Ru}}),{type:"Polygon",coordinates:[i]}}var e,n,r=[0,0],i=6;return t.origin=function(e){return arguments.length?(r=e,t):r},t.angle=function(r){return arguments.length?(n=gn((e=+r)*Ou,i*Ou),t):e},t.precision=function(r){return arguments.length?(n=gn(e*Ou,(i=+r)*Ou),t):i},t.angle(90)},nu.geo.distance=function(t,e){var n,r=(e[0]-t[0])*Ou,i=t[1]*Ou,a=e[1]*Ou,u=Math.sin(r),o=Math.cos(r),s=Math.sin(i),c=Math.cos(i),l=Math.sin(a),h=Math.cos(a);return Math.atan2(Math.sqrt((n=h*u)*n+(n=c*l-s*h*o)*n),s*l+c*h*o)},nu.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return nu.range(Math.ceil(a/m)*m,i,m).map(f).concat(nu.range(Math.ceil(c/y)*y,s,y).map(d)).concat(nu.range(Math.ceil(r/p)*p,n,p).filter(function(t){return pu(t%m)>Tu}).map(l)).concat(nu.range(Math.ceil(o/g)*g,u,g).filter(function(t){return pu(t%y)>Tu}).map(h))}var n,r,i,a,u,o,s,c,l,h,f,d,p=10,g=p,m=90,y=360,v=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(s).slice(1),f(i).reverse().slice(1),d(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],c=+e[0][1],s=+e[1][1],a>i&&(e=a,a=i,i=e),c>s&&(e=c,c=s,s=e),t.precision(v)):[[a,c],[i,s]]},t.minorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],o=+e[0][1],u=+e[1][1],r>n&&(e=r,r=n,n=e),o>u&&(e=o,o=u,u=e),t.precision(v)):[[r,o],[n,u]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(m=+e[0],y=+e[1],t):[m,y]},t.minorStep=function(e){return arguments.length?(p=+e[0],g=+e[1],t):[p,g]},t.precision=function(e){return arguments.length?(v=+e,l=yn(o,u,90),h=vn(r,n,v),f=yn(c,s,90),d=vn(a,i,v),t):v},t.majorExtent([[-180,-90+Tu],[180,90-Tu]]).minorExtent([[-180,-80-Tu],[180,80+Tu]])},nu.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||i.apply(this,arguments)]}}var e,n,r=bn,i=_n;return t.distance=function(){return nu.geo.distance(e||r.apply(this,arguments),n||i.apply(this,arguments))},t.source=function(n){return arguments.length?(r=n,e="function"==typeof n?null:n,t):r},t.target=function(e){return arguments.length?(i=e,n="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},nu.geo.interpolate=function(t,e){return xn(t[0]*Ou,t[1]*Ou,e[0]*Ou,e[1]*Ou)},nu.geo.length=function(t){return $o=0,nu.geo.stream(t,Ho),$o};var $o,Ho={sphere:w,point:w,lineStart:wn,lineEnd:w,polygonStart:w,polygonEnd:w},Go=An(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(nu.geo.azimuthalEqualArea=function(){return un(Go)}).raw=Go;var Wo=An(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},b);(nu.geo.azimuthalEquidistant=function(){return un(Wo)}).raw=Wo,(nu.geo.conicConformal=function(){return ze(En)}).raw=En,(nu.geo.conicEquidistant=function(){return ze(kn)}).raw=kn;var Zo=An(function(t){return 1/t},Math.atan);(nu.geo.gnomonic=function(){return un(Zo)}).raw=Zo,Dn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Iu]},(nu.geo.mercator=function(){return Cn(Dn)}).raw=Dn;var Xo=An(function(){return 1},Math.asin);(nu.geo.orthographic=function(){return un(Xo)}).raw=Xo;var Jo=An(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(nu.geo.stereographic=function(){return un(Jo)}).raw=Jo,Sn.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Iu]},(nu.geo.transverseMercator=function(){var t=Cn(Sn),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90])}).raw=Sn,nu.geom={},nu.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=Ct(n),a=Ct(r),u=t.length,o=[],s=[];for(e=0;u>e;e++)o.push([+i.call(this,t[e],e),+a.call(this,t[e],e),e]);for(o.sort(Ln),e=0;u>e;e++)s.push([o[e][0],-o[e][1]]);var c=Fn(o),l=Fn(s),h=l[0]===c[0],f=l[l.length-1]===c[c.length-1],d=[];for(e=c.length-1;e>=0;--e)d.push(t[o[c[e]][2]]);for(e=+h;e=r&&c.x<=a&&c.y>=i&&c.y<=u?[[r,u],[a,u],[a,i],[r,i]]:[];l.point=t[o]}),e}function n(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Tu)*Tu,y:Math.round(u(t,e)/Tu)*Tu,i:e}})}var r=Mn,i=Tn,a=r,u=i,o=us;return t?e(t):(e.links=function(t){return or(n(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return or(n(t)).cells.forEach(function(n,r){for(var i,a,u=n.site,o=n.edges.sort($n),s=-1,c=o.length,l=o[c-1].edge,h=l.l===u?l.r:l.l;++s=c,f=r>=l,d=f<<1|h;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]=fr()),h?i=c:o=c,f?u=l:s=l,a(t,e,n,r,i,u,o,s)}var l,h,f,d,p,g,m,y,v,b=Ct(o),_=Ct(s);if(null!=e)g=e,m=n,y=r,v=i;else if(y=v=-(g=m=1/0),h=[],f=[],p=t.length,u)for(d=0;p>d;++d)l=t[d],l.xy&&(y=l.x),l.y>v&&(v=l.y),h.push(l.x),f.push(l.y);else for(d=0;p>d;++d){var x=+b(l=t[d],d),w=+_(l,d);g>x&&(g=x),m>w&&(m=w),x>y&&(y=x),w>v&&(v=w),h.push(x),f.push(w)}var A=y-g,E=v-m;A>E?v=m+A:y=g+E;var k=fr();if(k.add=function(t){a(k,t,+b(t,++d),+_(t,d),g,m,y,v)},k.visit=function(t){dr(t,k,g,m,y,v)},k.find=function(t){return pr(k,t[0],t[1],g,m,y,v)},d=-1,null==e){for(;++d=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";return n=ls.get(n)||cs,r=hs.get(r)||b,xr(r(n.apply(null,ru.call(arguments,1))))},nu.interpolateHcl=Nr,nu.interpolateHsl=Ir,nu.interpolateLab=Or,nu.interpolateRound=Rr,nu.transform=function(t){var e=au.createElementNS(nu.ns.prefix.svg,"g");return(nu.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Pr(n?n.matrix:fs)})(t)},Pr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var fs={a:1,b:0,c:0,d:1,e:0,f:0};nu.interpolateTransform=Yr,nu.layout={},nu.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++no*o/m){if(p>s){var c=e.charge/s;t.px-=a*c,t.py-=u*c}return!0}if(e.point&&s&&p>s){var c=e.pointCharge/s;t.px-=a*c,t.py-=u*c}}return!e.charge}}function e(t){t.px=nu.event.x,t.py=nu.event.y,o.resume()}var n,r,i,a,u,o={},s=nu.dispatch("start","tick","end"),c=[1,1],l=.9,h=ds,f=ps,d=-30,p=gs,g=.1,m=.64,y=[],v=[];return o.tick=function(){if((r*=.99)<.005)return s.end({type:"end",alpha:r=0}),!0;var e,n,o,h,f,p,m,b,_,x=y.length,w=v.length;for(n=0;w>n;++n)o=v[n],h=o.source,f=o.target,b=f.x-h.x,_=f.y-h.y,(p=b*b+_*_)&&(p=r*a[n]*((p=Math.sqrt(p))-i[n])/p,b*=p,_*=p,f.x-=b*(m=h.weight/(f.weight+h.weight)),f.y-=_*m,h.x+=b*(m=1-m),h.y+=_*m);if((m=r*g)&&(b=c[0]/2,_=c[1]/2,n=-1,m))for(;++n0?t:0:t>0&&(s.start({type:"start",alpha:r=t}),nu.timer(o.tick)),o):r},o.start=function(){function t(t,r){if(!n){for(n=new Array(s),o=0;s>o;++o)n[o]=[];for(o=0;l>o;++o){var i=v[o];n[i.source.index].push(i.target),n[i.target.index].push(i.source)}}for(var a,u=n[e],o=-1,c=u.length;++oe;++e)(r=y[e]).index=e,r.weight=0;for(e=0;l>e;++e)r=v[e],"number"==typeof r.source&&(r.source=y[r.source]),"number"==typeof r.target&&(r.target=y[r.target]),++r.source.weight,++r.target.weight;for(e=0;s>e;++e)r=y[e],isNaN(r.x)&&(r.x=t("x",p)),isNaN(r.y)&&(r.y=t("y",g)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof h)for(e=0;l>e;++e)i[e]=+h.call(this,v[e],e);else for(e=0;l>e;++e)i[e]=h;if(a=[],"function"==typeof f)for(e=0;l>e;++e)a[e]=+f.call(this,v[e],e);else for(e=0;l>e;++e)a[e]=f;if(u=[],"function"==typeof d)for(e=0;s>e;++e)u[e]=+d.call(this,y[e],e);else for(e=0;s>e;++e)u[e]=d;return o.resume()},o.resume=function(){return o.alpha(.1)},o.stop=function(){return o.alpha(0)},o.drag=function(){return n||(n=nu.behavior.drag().origin(b).on("dragstart.force",Wr).on("drag.force",e).on("dragend.force",Zr)),arguments.length?void this.on("mouseover.force",Xr).on("mouseout.force",Jr).call(n):n},nu.rebind(o,s,"on")};var ds=20,ps=1,gs=1/0;nu.layout.hierarchy=function(){function t(i){var a,u=[i],o=[];for(i.depth=0;null!=(a=u.pop());)if(o.push(a),(c=n.call(t,a,a.depth))&&(s=c.length)){for(var s,c,l;--s>=0;)u.push(l=c[s]),l.parent=a,l.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(t,a,a.depth)||0),delete a.children;return ei(i,function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)}),o}var e=ii,n=ni,r=ri;return t.sort=function(n){return arguments.length?(e=n,t):e},t.children=function(e){return arguments.length?(n=e,t):n},t.value=function(e){return arguments.length?(r=e,t):r},t.revalue=function(e){return r&&(ti(e,function(t){t.children&&(t.value=0)}),ei(e,function(e){var n;e.children||(e.value=+r.call(t,e,e.depth)||0),(n=e.parent)&&(n.value+=e.value)})),e},t},nu.layout.partition=function(){function t(e,n,r,i){var a=e.children;if(e.x=n,e.y=e.depth*i,e.dx=r,e.dy=i,a&&(u=a.length)){var u,o,s,c=-1;for(r=e.value?r/e.value:0;++ch?-1:1),p=(h-s*d)/nu.sum(c),g=nu.range(s),m=[];return null!=n&&g.sort(n===ms?function(t,e){return c[e]-c[t]}:function(t,e){return n(u[t],u[e])}),g.forEach(function(t){m[t]={data:u[t],value:o=c[t],startAngle:l,endAngle:l+=o*p+d,padAngle:f}}),m}var e=Number,n=ms,r=0,i=Bu,a=0;return t.value=function(n){return arguments.length?(e=n,t):e},t.sort=function(e){return arguments.length?(n=e,t):n},t.startAngle=function(e){return arguments.length?(r=e,t):r},t.endAngle=function(e){return arguments.length?(i=e,t):i},t.padAngle=function(e){return arguments.length?(a=e,t):a},t};var ms={};nu.layout.stack=function(){function t(o,s){if(!(f=o.length))return o;var c=o.map(function(n,r){return e.call(t,n,r)}),l=c.map(function(e){return e.map(function(e,n){return[a.call(t,e,n),u.call(t,e,n)]})}),h=n.call(t,l,s);c=nu.permute(c,h),l=nu.permute(l,h);var f,d,p,g,m=r.call(t,l,s),y=c[0].length;for(p=0;y>p;++p)for(i.call(t,c[0][p],g=m[p],l[0][p][1]),d=1;f>d;++d)i.call(t,c[d][p],g+=l[d-1][p][1],l[d][p][1]);return o}var e=b,n=ci,r=li,i=si,a=ui,u=oi;return t.values=function(n){return arguments.length?(e=n,t):e},t.order=function(e){return arguments.length?(n="function"==typeof e?e:ys.get(e)||ci,t):n},t.offset=function(e){return arguments.length?(r="function"==typeof e?e:vs.get(e)||li,t):r},t.x=function(e){return arguments.length?(a=e,t):a},t.y=function(e){return arguments.length?(u=e,t):u},t.out=function(e){return arguments.length?(i=e,t):i},t};var ys=nu.map({"inside-out":function(t){var e,n,r=t.length,i=t.map(hi),a=t.map(fi),u=nu.range(r).sort(function(t,e){return i[t]-i[e]}),o=0,s=0,c=[],l=[];for(e=0;r>e;++e)n=u[e],s>o?(o+=a[n],c.push(n)):(s+=a[n],l.push(n));return l.reverse().concat(c)},reverse:function(t){return nu.range(t.length).reverse()},"default":ci}),vs=nu.map({silhouette:function(t){var e,n,r,i=t.length,a=t[0].length,u=[],o=0,s=[];for(n=0;a>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];r>o&&(o=r),u.push(r)}for(n=0;a>n;++n)s[n]=(o-u[n])/2;return s},wiggle:function(t){var e,n,r,i,a,u,o,s,c,l=t.length,h=t[0],f=h.length,d=[];for(d[0]=s=c=0,n=1;f>n;++n){for(e=0,i=0;l>e;++e)i+=t[e][n][1];for(e=0,a=0,o=h[n][0]-h[n-1][0];l>e;++e){for(r=0,u=(t[e][n][1]-t[e][n-1][1])/(2*o);e>r;++r)u+=(t[r][n][1]-t[r][n-1][1])/o;a+=u*t[e][n][1]}d[n]=s-=i?a/i*o:0,c>s&&(c=s)}for(n=0;f>n;++n)d[n]-=c;return d},expand:function(t){var e,n,r,i=t.length,a=t[0].length,u=1/i,o=[];for(n=0;a>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];if(r)for(e=0;i>e;e++)t[e][n][1]/=r;else for(e=0;i>e;e++)t[e][n][1]=u}for(n=0;a>n;++n)o[n]=0;return o},zero:li});nu.layout.histogram=function(){function t(t,a){for(var u,o,s=[],c=t.map(n,this),l=r.call(this,c,a),h=i.call(this,l,c,a),a=-1,f=c.length,d=h.length-1,p=e?1:1/f;++a0)for(a=-1;++a=l[0]&&o<=l[1]&&(u=s[nu.bisect(h,o,1,d)-1],u.y+=p,u.push(t[a]));return s}var e=!0,n=Number,r=mi,i=pi;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(r=Ct(e),t):r},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return gi(t,e)}:Ct(e),t):i},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},nu.layout.pack=function(){function t(t,a){var u=n.call(this,t,a),o=u[0],s=i[0],c=i[1],l=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(o.x=o.y=0,ei(o,function(t){t.r=+l(t.value)}),ei(o,xi),r){var h=r*(e?1:Math.max(2*o.r/s,2*o.r/c))/2;ei(o,function(t){t.r+=h}),ei(o,xi),ei(o,function(t){t.r-=h})}return Ei(o,s/2,c/2,e?1:1/Math.max(2*o.r/s,2*o.r/c)),u}var e,n=nu.layout.hierarchy().sort(yi),r=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(n){return arguments.length?(e=null==n||"function"==typeof n?n:+n,t):e},t.padding=function(e){return arguments.length?(r=+e,t):r},Qr(t,n)},nu.layout.tree=function(){function t(t,i){var l=u.call(this,t,i),h=l[0],f=e(h);if(ei(f,n),f.parent.m=-f.z,ti(f,r),c)ti(h,a);else{var d=h,p=h,g=h;ti(h,function(t){t.xp.x&&(p=t),t.depth>g.depth&&(g=t)});var m=o(d,p)/2-d.x,y=s[0]/(p.x+o(p,d)/2+m),v=s[1]/(g.depth||1);ti(h,function(t){t.x=(t.x+m)*y,t.y=t.depth*v})}return l}function e(t){for(var e,n={A:null,children:[t]},r=[n];null!=(e=r.pop());)for(var i,a=e.children,u=0,o=a.length;o>u;++u)r.push((a[u]=i={_:a[u],parent:e,children:(i=a[u].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:u}).a=i);return n.children[0]}function n(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e.length){Ti(t);var a=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+o(t._,r._),t.m=t.z-a):t.z=a}else r&&(t.z=r.z+o(t._,r._));t.parent.A=i(t,r,t.parent.A||n[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function i(t,e,n){if(e){for(var r,i=t,a=t,u=e,s=i.parent.children[0],c=i.m,l=a.m,h=u.m,f=s.m;u=Si(u),i=Ci(i),u&&i;)s=Ci(s),a=Si(a),a.a=t,r=u.z+h-i.z-c+o(u._,i._),r>0&&(Mi(Fi(u,t,n),t,r),c+=r,l+=r),h+=u.m,c+=i.m,f+=s.m,l+=a.m;u&&!Si(a)&&(a.t=u,a.m+=h-l),i&&!Ci(s)&&(s.t=i,s.m+=c-f,n=t)}return n}function a(t){t.x*=s[0],t.y=t.depth*s[1]}var u=nu.layout.hierarchy().sort(null).value(null),o=Di,s=[1,1],c=null;return t.separation=function(e){return arguments.length?(o=e,t):o},t.size=function(e){return arguments.length?(c=null==(s=e)?a:null,t):c?null:s},t.nodeSize=function(e){return arguments.length?(c=null==(s=e)?null:a,t):c?s:null},Qr(t,u)},nu.layout.cluster=function(){function t(t,a){var u,o=e.call(this,t,a),s=o[0],c=0;ei(s,function(t){var e=t.children;e&&e.length?(t.x=Bi(e),t.y=Li(e)):(t.x=u?c+=n(t,u):0,t.y=0,u=t)});var l=Ni(s),h=Ii(s),f=l.x-n(l,h)/2,d=h.x+n(h,l)/2;return ei(s,i?function(t){t.x=(t.x-s.x)*r[0],t.y=(s.y-t.y)*r[1]}:function(t){t.x=(t.x-f)/(d-f)*r[0],t.y=(1-(s.y?t.y/s.y:1))*r[1]}),o}var e=nu.layout.hierarchy().sort(null).value(null),n=Di,r=[1,1],i=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(i=null==(r=e),t):i?null:r},t.nodeSize=function(e){return arguments.length?(i=null!=(r=e),t):i?r:null},Qr(t,e)},nu.layout.treemap=function(){function t(t,e){for(var n,r,i=-1,a=t.length;++ie?0:e),n.area=isNaN(r)||0>=r?0:r}function e(n){var a=n.children;if(a&&a.length){var u,o,s,c=h(n),l=[],f=a.slice(),p=1/0,g="slice"===d?c.dx:"dice"===d?c.dy:"slice-dice"===d?1&n.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(t(f,c.dx*c.dy/n.value),l.area=0;(s=f.length)>0;)l.push(u=f[s-1]),l.area+=u.area,"squarify"!==d||(o=r(l,g))<=p?(f.pop(),p=o):(l.area-=l.pop().area,i(l,g,c,!1),g=Math.min(c.dx,c.dy),l.length=l.area=0,p=1/0);l.length&&(i(l,g,c,!0),l.length=l.area=0),a.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){ +var a,u=h(e),o=r.slice(),s=[];for(t(o,u.dx*u.dy/e.value),s.area=0;a=o.pop();)s.push(a),s.area+=a.area,null!=a.z&&(i(s,a.z?u.dx:u.dy,u,!o.length),s.length=s.area=0);r.forEach(n)}}function r(t,e){for(var n,r=t.area,i=0,a=1/0,u=-1,o=t.length;++un&&(a=n),n>i&&(i=n));return r*=r,e*=e,r?Math.max(e*i*p/r,r/(e*a*p)):1/0}function i(t,e,n,r){var i,a=-1,u=t.length,o=n.x,c=n.y,l=e?s(t.area/e):0;if(e==n.dx){for((r||l>n.dy)&&(l=n.dy);++an.dx)&&(l=n.dx);++an&&(e=1),1>n&&(t=0),function(){var n,r,i;do n=2*Math.random()-1,r=2*Math.random()-1,i=n*n+r*r;while(!i||i>1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=nu.random.normal.apply(nu,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=nu.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;t>n;n++)e+=Math.random();return e}}},nu.scale={};var bs={floor:b,ceil:b};nu.scale.linear=function(){return zi([0,1],[0,1],br,!1)};var _s={s:1,g:1,p:1,r:1,e:1};nu.scale.log=function(){return Ki(nu.scale.linear().domain([0,1]),10,!0,[1,10])};var xs=nu.format(".0e"),ws={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};nu.scale.pow=function(){return Qi(nu.scale.linear(),1,[0,1])},nu.scale.sqrt=function(){return nu.scale.pow().exponent(.5)},nu.scale.ordinal=function(){return ea([],{t:"range",a:[[]]})},nu.scale.category10=function(){return nu.scale.ordinal().range(As)},nu.scale.category20=function(){return nu.scale.ordinal().range(Es)},nu.scale.category20b=function(){return nu.scale.ordinal().range(ks)},nu.scale.category20c=function(){return nu.scale.ordinal().range(Ds)};var As=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(_t),Es=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(_t),ks=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(_t),Ds=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(_t);nu.scale.quantile=function(){return na([],[])},nu.scale.quantize=function(){return ra(0,1,[0,1])},nu.scale.threshold=function(){return ia([.5],[0,1])},nu.scale.identity=function(){return aa([0,1])},nu.svg={},nu.svg.arc=function(){function t(){var t=Math.max(0,+n.apply(this,arguments)),c=Math.max(0,+r.apply(this,arguments)),l=u.apply(this,arguments)-Iu,h=o.apply(this,arguments)-Iu,f=Math.abs(h-l),d=l>h?0:1;if(t>c&&(p=c,c=t,t=p),f>=Nu)return e(c,d)+(t?e(t,1-d):"")+"Z";var p,g,m,y,v,b,_,x,w,A,E,k,D=0,C=0,S=[];if((y=(+s.apply(this,arguments)||0)/2)&&(m=a===Cs?Math.sqrt(t*t+c*c):+a.apply(this,arguments),d||(C*=-1),c&&(C=nt(m/c*Math.sin(y))),t&&(D=nt(m/t*Math.sin(y)))),c){v=c*Math.cos(l+C),b=c*Math.sin(l+C),_=c*Math.cos(h-C),x=c*Math.sin(h-C);var M=Math.abs(h-l-2*C)<=Lu?0:1;if(C&&fa(v,b,_,x)===d^M){var T=(l+h)/2;v=c*Math.cos(T),b=c*Math.sin(T),_=x=null}}else v=b=0;if(t){w=t*Math.cos(h-D),A=t*Math.sin(h-D),E=t*Math.cos(l+D),k=t*Math.sin(l+D);var F=Math.abs(l-h+2*D)<=Lu?0:1;if(D&&fa(w,A,E,k)===1-d^F){var L=(l+h)/2;w=t*Math.cos(L),A=t*Math.sin(L),E=k=null}}else w=A=0;if((p=Math.min(Math.abs(c-t)/2,+i.apply(this,arguments)))>.001){g=c>t^d?0:1;var B=null==E?[w,A]:null==_?[v,b]:Nn([v,b],[E,k],[_,x],[w,A]),N=v-B[0],I=b-B[1],O=_-B[0],R=x-B[1],P=1/Math.sin(Math.acos((N*O+I*R)/(Math.sqrt(N*N+I*I)*Math.sqrt(O*O+R*R)))/2),q=Math.sqrt(B[0]*B[0]+B[1]*B[1]);if(null!=_){var j=Math.min(p,(c-q)/(P+1)),U=da(null==E?[w,A]:[E,k],[v,b],c,j,d),Y=da([_,x],[w,A],c,j,d);p===j?S.push("M",U[0],"A",j,",",j," 0 0,",g," ",U[1],"A",c,",",c," 0 ",1-d^fa(U[1][0],U[1][1],Y[1][0],Y[1][1]),",",d," ",Y[1],"A",j,",",j," 0 0,",g," ",Y[0]):S.push("M",U[0],"A",j,",",j," 0 1,",g," ",Y[0])}else S.push("M",v,",",b);if(null!=E){var V=Math.min(p,(t-q)/(P-1)),z=da([v,b],[E,k],t,-V,d),$=da([w,A],null==_?[v,b]:[_,x],t,-V,d);p===V?S.push("L",$[0],"A",V,",",V," 0 0,",g," ",$[1],"A",t,",",t," 0 ",d^fa($[1][0],$[1][1],z[1][0],z[1][1]),",",1-d," ",z[1],"A",V,",",V," 0 0,",g," ",z[0]):S.push("L",$[0],"A",V,",",V," 0 0,",g," ",z[0])}else S.push("L",w,",",A)}else S.push("M",v,",",b),null!=_&&S.push("A",c,",",c," 0 ",M,",",d," ",_,",",x),S.push("L",w,",",A),null!=E&&S.push("A",t,",",t," 0 ",F,",",1-d," ",E,",",k);return S.push("Z"),S.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var n=oa,r=sa,i=ua,a=Cs,u=ca,o=la,s=ha;return t.innerRadius=function(e){return arguments.length?(n=Ct(e),t):n},t.outerRadius=function(e){return arguments.length?(r=Ct(e),t):r},t.cornerRadius=function(e){return arguments.length?(i=Ct(e),t):i},t.padRadius=function(e){return arguments.length?(a=e==Cs?Cs:Ct(e),t):a},t.startAngle=function(e){return arguments.length?(u=Ct(e),t):u},t.endAngle=function(e){return arguments.length?(o=Ct(e),t):o},t.padAngle=function(e){return arguments.length?(s=Ct(e),t):s},t.centroid=function(){var t=(+n.apply(this,arguments)+ +r.apply(this,arguments))/2,e=(+u.apply(this,arguments)+ +o.apply(this,arguments))/2-Iu;return[Math.cos(e)*t,Math.sin(e)*t]},t};var Cs="auto";nu.svg.line=function(){return pa(b)};var Ss=nu.map({linear:ga,"linear-closed":ma,step:ya,"step-before":va,"step-after":ba,basis:ka,"basis-open":Da,"basis-closed":Ca,bundle:Sa,cardinal:wa,"cardinal-open":_a,"cardinal-closed":xa,monotone:Na});Ss.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Ms=[0,2/3,1/3,0],Ts=[0,1/3,2/3,0],Fs=[0,1/6,2/3,1/6];nu.svg.line.radial=function(){var t=pa(Ia);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},va.reverse=ba,ba.reverse=va,nu.svg.area=function(){return Oa(b)},nu.svg.area.radial=function(){var t=Oa(Ia);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},nu.svg.chord=function(){function t(t,o){var s=e(this,a,t,o),c=e(this,u,t,o);return"M"+s.p0+r(s.r,s.p1,s.a1-s.a0)+(n(s,c)?i(s.r,s.p1,s.r,s.p0):i(s.r,s.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+i(c.r,c.p1,s.r,s.p0))+"Z"}function e(t,e,n,r){var i=e.call(t,n,r),a=o.call(t,i,r),u=s.call(t,i,r)-Iu,l=c.call(t,i,r)-Iu;return{r:a,a0:u,a1:l,p0:[a*Math.cos(u),a*Math.sin(u)],p1:[a*Math.cos(l),a*Math.sin(l)]}}function n(t,e){return t.a0==e.a0&&t.a1==e.a1}function r(t,e,n){return"A"+t+","+t+" 0 "+ +(n>Lu)+",1 "+e}function i(t,e,n,r){return"Q 0,0 "+r}var a=bn,u=_n,o=Ra,s=ca,c=la;return t.radius=function(e){return arguments.length?(o=Ct(e),t):o},t.source=function(e){return arguments.length?(a=Ct(e),t):a},t.target=function(e){return arguments.length?(u=Ct(e),t):u},t.startAngle=function(e){return arguments.length?(s=Ct(e),t):s},t.endAngle=function(e){return arguments.length?(c=Ct(e),t):c},t},nu.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),u=n.call(this,t,i),o=(a.y+u.y)/2,s=[a,{x:a.x,y:o},{x:u.x,y:o},u];return s=s.map(r),"M"+s[0]+"C"+s[1]+" "+s[2]+" "+s[3]}var e=bn,n=_n,r=Pa;return t.source=function(n){return arguments.length?(e=Ct(n),t):e},t.target=function(e){return arguments.length?(n=Ct(e),t):n},t.projection=function(e){return arguments.length?(r=e,t):r},t},nu.svg.diagonal.radial=function(){var t=nu.svg.diagonal(),e=Pa,n=t.projection;return t.projection=function(t){return arguments.length?n(qa(e=t)):e},t},nu.svg.symbol=function(){function t(t,r){return(Ls.get(e.call(this,t,r))||Ya)(n.call(this,t,r))}var e=Ua,n=ja;return t.type=function(n){return arguments.length?(e=Ct(n),t):e},t.size=function(e){return arguments.length?(n=Ct(e),t):n},t};var Ls=nu.map({circle:Ya,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Ns)),n=e*Ns;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Bs),n=e*Bs/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Bs),n=e*Bs/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});nu.svg.symbolTypes=Ls.keys();var Bs=Math.sqrt(3),Ns=Math.tan(30*Ou);Au.transition=function(t){for(var e,n,r=Is||++qs,i=Ga(t),a=[],u=Os||{time:Date.now(),ease:Dr,delay:0,duration:250},o=-1,s=this.length;++oa;a++){i.push(e=[]);for(var n=this[a],o=0,s=n.length;s>o;o++)(r=n[o])&&t.call(r,r.__data__,o,a)&&e.push(r)}return za(i,this.namespace,this.id)},Ps.tween=function(t,e){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(t):z(this,null==e?function(e){e[r][n].tween.remove(t)}:function(i){i[r][n].tween.set(t,e)})},Ps.attr=function(t,e){function n(){this.removeAttribute(o)}function r(){this.removeAttributeNS(o.space,o.local)}function i(t){return null==t?n:(t+="",function(){var e,n=this.getAttribute(o);return n!==t&&(e=u(n,t),function(t){this.setAttribute(o,e(t))})})}function a(t){return null==t?r:(t+="",function(){var e,n=this.getAttributeNS(o.space,o.local);return n!==t&&(e=u(n,t),function(t){this.setAttributeNS(o.space,o.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var u="transform"==t?Yr:br,o=nu.ns.qualify(t);return $a(this,"attr."+t,e,o.local?a:i)},Ps.attrTween=function(t,e){function n(t,n){var r=e.call(this,t,n,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,n){var r=e.call(this,t,n,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=nu.ns.qualify(t);return this.tween("attr."+t,i.local?r:n)},Ps.style=function(t,e,r){function i(){this.style.removeProperty(t)}function a(e){return null==e?i:(e+="",function(){var i,a=n(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(i=br(a,e),function(e){this.style.setProperty(t,i(e),r)})})}var u=arguments.length;if(3>u){if("string"!=typeof t){2>u&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return $a(this,"style."+t,e,a)},Ps.styleTween=function(t,e,r){function i(i,a){var u=e.call(this,i,a,n(this).getComputedStyle(this,null).getPropertyValue(t));return u&&function(e){this.style.setProperty(t,u(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,i)},Ps.text=function(t){return $a(this,"text",t,Ha)},Ps.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Ps.ease=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].ease:("function"!=typeof t&&(t=nu.ease.apply(nu,arguments)),z(this,function(r){r[n][e].ease=t}))},Ps.delay=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].delay:z(this,"function"==typeof t?function(r,i,a){r[n][e].delay=+t.call(r,r.__data__,i,a)}:(t=+t,function(r){r[n][e].delay=t}))},Ps.duration=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].duration:z(this,"function"==typeof t?function(r,i,a){r[n][e].duration=Math.max(1,t.call(r,r.__data__,i,a))}:(t=Math.max(1,t),function(r){r[n][e].duration=t}))},Ps.each=function(t,e){var n=this.id,r=this.namespace;if(arguments.length<2){var i=Os,a=Is;try{Is=n,z(this,function(e,i,a){Os=e[r][n],t.call(e,e.__data__,i,a)})}finally{Os=i,Is=a}}else z(this,function(i){var a=i[r][n];(a.event||(a.event=nu.dispatch("start","end","interrupt"))).on(t,e)});return this},Ps.transition=function(){for(var t,e,n,r,i=this.id,a=++qs,u=this.namespace,o=[],s=0,c=this.length;c>s;s++){o.push(t=[]);for(var e=this[s],l=0,h=e.length;h>l;l++)(n=e[l])&&(r=n[u][i],Wa(n,l,u,a,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),t.push(n)}return za(o,u,a)},nu.svg.axis=function(){function t(t){t.each(function(){var t,c=nu.select(this),l=this.__chart__||n,h=this.__chart__=n.copy(),f=null==s?h.ticks?h.ticks.apply(h,o):h.domain():s,d=null==e?h.tickFormat?h.tickFormat.apply(h,o):b:e,p=c.selectAll(".tick").data(f,h),g=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Tu),m=nu.transition(p.exit()).style("opacity",Tu).remove(),y=nu.transition(p.order()).style("opacity",1),v=Math.max(i,0)+u,_=qi(h),x=c.selectAll(".domain").data([0]),w=(x.enter().append("path").attr("class","domain"),nu.transition(x));g.append("line"),g.append("text");var A,E,k,D,C=g.select("line"),S=y.select("line"),M=p.select("text").text(d),T=g.select("text"),F=y.select("text"),L="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(t=Za,A="x",k="y",E="x2",D="y2",M.attr("dy",0>L?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+_[0]+","+L*a+"V0H"+_[1]+"V"+L*a)):(t=Xa,A="y",k="x",E="y2",D="x2",M.attr("dy",".32em").style("text-anchor",0>L?"end":"start"),w.attr("d","M"+L*a+","+_[0]+"H0V"+_[1]+"H"+L*a)),C.attr(D,L*i),T.attr(k,L*v),S.attr(E,0).attr(D,L*i),F.attr(A,0).attr(k,L*v),h.rangeBand){var B=h,N=B.rangeBand()/2;l=h=function(t){return B(t)+N}}else l.rangeBand?l=h:m.call(t,h,l);g.call(t,l,h),y.call(t,h,h)})}var e,n=nu.scale.linear(),r=js,i=6,a=6,u=3,o=[10],s=null;return t.scale=function(e){return arguments.length?(n=e,t):n},t.orient=function(e){return arguments.length?(r=e in Us?e+"":js,t):r},t.ticks=function(){return arguments.length?(o=arguments,t):o},t.tickValues=function(e){return arguments.length?(s=e,t):s},t.tickFormat=function(n){return arguments.length?(e=n,t):e},t.tickSize=function(e){var n=arguments.length;return n?(i=+e,a=+arguments[n-1],t):i},t.innerTickSize=function(e){return arguments.length?(i=+e,t):i},t.outerTickSize=function(e){return arguments.length?(a=+e,t):a},t.tickPadding=function(e){return arguments.length?(u=+e,t):u},t.tickSubdivide=function(){return arguments.length&&t},t};var js="bottom",Us={top:1,right:1,bottom:1,left:1};nu.svg.brush=function(){function t(n){n.each(function(){var n=nu.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",a).on("touchstart.brush",a),u=n.selectAll(".background").data([0]);u.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var o=n.selectAll(".resize").data(g,b);o.exit().remove(),o.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Ys[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),o.style("display",t.empty()?"none":null);var s,h=nu.transition(n),f=nu.transition(u);c&&(s=qi(c),f.attr("x",s[0]).attr("width",s[1]-s[0]),r(h)),l&&(s=qi(l),f.attr("y",s[0]).attr("height",s[1]-s[0]),i(h)),e(h)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+h[+/e$/.test(t)]+","+f[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",h[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",h[1]-h[0])}function i(t){t.select(".extent").attr("y",f[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function a(){function a(){32==nu.event.keyCode&&(M||(b=null,F[0]-=h[1],F[1]-=f[1],M=2),k())}function g(){32==nu.event.keyCode&&2==M&&(F[0]+=h[1],F[1]+=f[1],M=0,k())}function m(){var t=nu.mouse(x),n=!1;_&&(t[0]+=_[0],t[1]+=_[1]),M||(nu.event.altKey?(b||(b=[(h[0]+h[1])/2,(f[0]+f[1])/2]),F[0]=h[+(t[0]l?(i=r,r=l):i=l),g[0]!=r||g[1]!=i?(n?o=null:u=null,g[0]=r,g[1]=i,!0):void 0}function v(){m(),E.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),nu.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),T(),A({type:"brushend"})}var b,_,x=this,w=nu.select(nu.event.target),A=s.of(x,arguments),E=nu.select(x),D=w.datum(),C=!/^(n|s)$/.test(D)&&c,S=!/^(e|w)$/.test(D)&&l,M=w.classed("extent"),T=X(x),F=nu.mouse(x),L=nu.select(n(x)).on("keydown.brush",a).on("keyup.brush",g);if(nu.event.changedTouches?L.on("touchmove.brush",m).on("touchend.brush",v):L.on("mousemove.brush",m).on("mouseup.brush",v),E.interrupt().selectAll("*").interrupt(),M)F[0]=h[0]-F[0],F[1]=f[0]-F[1];else if(D){var B=+/w$/.test(D),N=+/^n/.test(D);_=[h[1-B]-F[0],f[1-N]-F[1]],F[0]=h[B],F[1]=f[N]}else nu.event.altKey&&(b=F.slice());E.style("pointer-events","none").selectAll(".resize").style("display",null),nu.select("body").style("cursor",w.style("cursor")),A({type:"brushstart"}),m()}var u,o,s=C(t,"brushstart","brush","brushend"),c=null,l=null,h=[0,0],f=[0,0],d=!0,p=!0,g=Vs[0];return t.event=function(t){t.each(function(){var t=s.of(this,arguments),e={x:h,y:f,i:u,j:o},n=this.__chart__||e;this.__chart__=e,Is?nu.select(this).transition().each("start.brush",function(){u=n.i,o=n.j,h=n.x,f=n.y,t({type:"brushstart"})}).tween("brush:brush",function(){var n=_r(h,e.x),r=_r(f,e.y);return u=o=null,function(i){h=e.x=n(i),f=e.y=r(i),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){u=e.i,o=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(c=e,g=Vs[!c<<1|!l],t):c},t.y=function(e){return arguments.length?(l=e,g=Vs[!c<<1|!l],t):l},t.clamp=function(e){return arguments.length?(c&&l?(d=!!e[0],p=!!e[1]):c?d=!!e:l&&(p=!!e),t):c&&l?[d,p]:c?d:l?p:null},t.extent=function(e){var n,r,i,a,s;return arguments.length?(c&&(n=e[0],r=e[1],l&&(n=n[0],r=r[0]),u=[n,r],c.invert&&(n=c(n),r=c(r)),n>r&&(s=n,n=r,r=s),(n!=h[0]||r!=h[1])&&(h=[n,r])),l&&(i=e[0],a=e[1],c&&(i=i[1],a=a[1]),o=[i,a],l.invert&&(i=l(i),a=l(a)),i>a&&(s=i,i=a,a=s),(i!=f[0]||a!=f[1])&&(f=[i,a])),t):(c&&(u?(n=u[0],r=u[1]):(n=h[0],r=h[1],c.invert&&(n=c.invert(n),r=c.invert(r)),n>r&&(s=n,n=r,r=s))),l&&(o?(i=o[0],a=o[1]):(i=f[0],a=f[1],l.invert&&(i=l.invert(i),a=l.invert(a)),i>a&&(s=i,i=a,a=s))),c&&l?[[n,i],[r,a]]:c?[n,r]:l&&[i,a])},t.clear=function(){return t.empty()||(h=[0,0],f=[0,0],u=o=null),t},t.empty=function(){return!!c&&h[0]==h[1]||!!l&&f[0]==f[1]},nu.rebind(t,s,"on")};var Ys={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Vs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],zs=so.format=go.timeFormat,$s=zs.utc,Hs=$s("%Y-%m-%dT%H:%M:%S.%LZ");zs.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ja:Hs,Ja.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Ja.toString=Hs.toString,so.second=jt(function(t){return new co(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),so.seconds=so.second.range,so.seconds.utc=so.second.utc.range,so.minute=jt(function(t){return new co(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),so.minutes=so.minute.range,so.minutes.utc=so.minute.utc.range,so.hour=jt(function(t){var e=t.getTimezoneOffset()/60;return new co(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),so.hours=so.hour.range,so.hours.utc=so.hour.utc.range,so.month=jt(function(t){return t=so.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),so.months=so.month.range,so.months.utc=so.month.utc.range;var Gs=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ws=[[so.second,1],[so.second,5],[so.second,15],[so.second,30],[so.minute,1],[so.minute,5],[so.minute,15],[so.minute,30],[so.hour,1],[so.hour,3],[so.hour,6],[so.hour,12],[so.day,1],[so.day,2],[so.week,1],[so.month,1],[so.month,3],[so.year,1]],Zs=zs.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Me]]),Xs={range:function(t,e,n){return nu.range(Math.ceil(t/n)*n,+e,n).map(Qa)},floor:b,ceil:b};Ws.year=so.year,so.scale=function(){return Ka(nu.scale.linear(),Ws,Zs)};var Js=Ws.map(function(t){return[t[0].utc,t[1]]}),Ks=$s.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Me]]);Js.year=so.year.utc,so.scale.utc=function(){return Ka(nu.scale.linear(),Js,Ks)},nu.text=St(function(t){return t.responseText}),nu.json=function(t,e){return Mt(t,"application/json",tu,e)},nu.html=function(t,e){return Mt(t,"text/html",eu,e)},nu.xml=St(function(t){return t.responseXML}),"function"==typeof define&&define.amd?define(nu):"object"==typeof e&&e.exports&&(e.exports=nu),this.d3=nu}()},{}],3:[function(t,e){e.exports={graphlib:t("./lib/graphlib"),dagre:t("./lib/dagre"),intersect:t("./lib/intersect"),render:t("./lib/render"),util:t("./lib/util"),version:t("./lib/version")}},{"./lib/dagre":10,"./lib/graphlib":11,"./lib/intersect":12,"./lib/render":27,"./lib/util":29,"./lib/version":30}],4:[function(t,e){function n(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),u=i.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(u,n[r+"Style"])}function r(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),u=i.append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(u,n[r+"Style"])}function i(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),u=i.append("path").attr("d","M 0 5 L 10 5").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(u,n[r+"Style"])}var a=t("./util");e.exports={"default":n,normal:n,vee:r,undirected:i}},{"./util":29}],5:[function(t,e){function n(t,e){var n=e.nodes().filter(function(t){return r.isSubgraph(e,t)}),a=t.selectAll("g.cluster").data(n,function(t){return t});return a.selectAll("*").remove(),a.enter().append("g").attr("class","cluster").attr("id",function(t){var n=e.node(t);return n.id}).style("opacity",0),r.applyTransition(a,e).style("opacity",1),a.each(function(t){var n=e.node(t),r=d3.select(this);d3.select(this).append("rect");var a=r.append("g").attr("class","label");i(a,n,n.clusterLabelPos)}),a.selectAll("rect").each(function(t){var n=e.node(t),i=d3.select(this);r.applyStyle(i,n.style)}),r.applyTransition(a.exit(),e).style("opacity",0).remove(),a}var r=t("./util"),i=t("./label/add-label");e.exports=n},{"./label/add-label":20,"./util":29}],6:[function(t,e){"use strict";function n(t,e){var n=t.selectAll("g.edgeLabel").data(e.edges(),function(t){return a.edgeToId(t)}).classed("update",!0);return n.selectAll("*").remove(),n.enter().append("g").classed("edgeLabel",!0).style("opacity",0),n.each(function(t){var n=e.edge(t),a=i(u.select(this),e.edge(t),0,0).classed("label",!0),o=a.node().getBBox();n.labelId&&a.attr("id",n.labelId),r.has(n,"width")||(n.width=o.width),r.has(n,"height")||(n.height=o.height)}),a.applyTransition(n.exit(),e).style("opacity",0).remove(),n}var r=t("./lodash"),i=t("./label/add-label"),a=t("./util"),u=t("./d3");e.exports=n},{"./d3":9,"./label/add-label":20,"./lodash":23,"./util":29}],7:[function(t,e){"use strict";function n(t,e,n){var i=t.selectAll("g.edgePath").data(e.edges(),function(t){return l.edgeToId(t)}).classed("update",!0);return u(i,e),o(i,e),l.applyTransition(i,e).style("opacity",1),i.each(function(t){var n=h.select(this),r=e.edge(t);r.elem=this,r.id&&n.attr("id",r.id),l.applyClass(n,r["class"],(n.classed("update")?"update ":"")+"edgePath")}),i.selectAll("path.path").each(function(t){var n=e.edge(t);n.arrowheadId=s.uniqueId("arrowhead");var i=h.select(this).attr("marker-end",function(){return"url(#"+n.arrowheadId+")"}).style("fill","none");l.applyTransition(i,e).attr("d",function(t){return r(e,t)}),l.applyStyle(i,n.style)}),i.selectAll("defs *").remove(),i.selectAll("defs").each(function(t){var r=e.edge(t),i=n[r.arrowhead];i(h.select(this),r.arrowheadId,r,"arrowhead")}),i}function r(t,e){var n=t.edge(e),r=t.node(e.v),a=t.node(e.w),u=n.points.slice(1,n.points.length-1);return u.unshift(c(r,u[0])),u.push(c(a,u[u.length-1])),i(n,u)}function i(t,e){var n=h.svg.line().x(function(t){return t.x}).y(function(t){return t.y});return s.has(t,"lineInterpolate")&&n.interpolate(t.lineInterpolate),s.has(t,"lineTension")&&n.tension(Number(t.lineTension)),n(e)}function a(t){var e=t.getBBox(),n=t.getTransformToElement(t.ownerSVGElement).translate(e.width/2,e.height/2);return{x:n.e,y:n.f}}function u(t,e){var n=t.enter().append("g").attr("class","edgePath").style("opacity",0);n.append("path").attr("class","path").attr("d",function(t){var n=e.edge(t),r=e.node(t.v).elem,u=s.range(n.points.length).map(function(){return a(r)});return i(n,u)}),n.append("defs")}function o(t,e){var n=t.exit();l.applyTransition(n,e).style("opacity",0).remove(),l.applyTransition(n.select("path.path"),e).attr("d",function(t){var n=e.node(t.v);if(n){var r=s.range(this.pathSegList.length).map(function(){return n});return i({},r)}return h.select(this).attr("d")})}var s=t("./lodash"),c=t("./intersect/intersect-node"),l=t("./util"),h=t("./d3");e.exports=n},{"./d3":9,"./intersect/intersect-node":16,"./lodash":23,"./util":29}],8:[function(t,e){"use strict";function n(t,e,n){var o=e.nodes().filter(function(t){return!a.isSubgraph(e,t)}),s=t.selectAll("g.node").data(o,function(t){return t}).classed("update",!0);return s.selectAll("*").remove(),s.enter().append("g").attr("class","node").style("opacity",0),s.each(function(t){var o=e.node(t),s=u.select(this),c=s.append("g").attr("class","label"),l=i(c,o),h=n[o.shape],f=r.pick(l.node().getBBox(),"width","height");o.elem=this,o.id&&s.attr("id",o.id),o.labelId&&c.attr("id",o.labelId),a.applyClass(s,o["class"],(s.classed("update")?"update ":"")+"node"),r.has(o,"width")&&(f.width=o.width),r.has(o,"height")&&(f.height=o.height),f.width+=o.paddingLeft+o.paddingRight,f.height+=o.paddingTop+o.paddingBottom,c.attr("transform","translate("+(o.paddingLeft-o.paddingRight)/2+","+(o.paddingTop-o.paddingBottom)/2+")");var d=h(u.select(this),f,o);a.applyStyle(d,o.style);var p=d.node().getBBox();o.width=p.width,o.height=p.height}),a.applyTransition(s.exit(),e).style("opacity",0).remove(),s}var r=t("./lodash"),i=t("./label/add-label"),a=t("./util"),u=t("./d3");e.exports=n},{"./d3":9,"./label/add-label":20,"./lodash":23,"./util":29}],9:[function(t,e){e.exports=window.d3},{}],10:[function(t,e){var n;if(t)try{n=t("dagre")}catch(r){}n||(n=window.dagre),e.exports=n},{dagre:31}],11:[function(t,e){var n;if(t)try{n=t("graphlib")}catch(r){}n||(n=window.graphlib),e.exports=n},{graphlib:61}],12:[function(t,e){e.exports={node:t("./intersect-node"),circle:t("./intersect-circle"),ellipse:t("./intersect-ellipse"),polygon:t("./intersect-polygon"),rect:t("./intersect-rect")}},{"./intersect-circle":13,"./intersect-ellipse":14,"./intersect-node":16,"./intersect-polygon":17,"./intersect-rect":18}],13:[function(t,e){function n(t,e,n){return r(t,e,e,n)}var r=t("./intersect-ellipse");e.exports=n},{"./intersect-ellipse":14}],14:[function(t,e){function n(t,e,n,r){var i=t.x,a=t.y,u=i-r.x,o=a-r.y,s=Math.sqrt(e*e*o*o+n*n*u*u),c=Math.abs(e*n*u/s);r.xy?(y-m)/g:(y+m)/g,y=u*c-a*l,b=0>y?(y-m)/g:(y+m)/g,{x:v,y:b})}function r(t,e){return t*e>0}e.exports=n},{}],16:[function(t,e){function n(t,e){return t.intersect(e)}e.exports=n},{}],17:[function(t,e){function n(t,e,n){var i=t.x,a=t.y,u=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;e.forEach(function(t){o=Math.min(o,t.x),s=Math.min(s,t.y)});for(var c=i-t.width/2-o,l=a-t.height/2-s,h=0;h1&&u.sort(function(t,e){var r=t.x-n.x,i=t.y-n.y,a=Math.sqrt(r*r+i*i),u=e.x-n.x,o=e.y-n.y,s=Math.sqrt(u*u+o*o);return s>a?-1:a===s?0:1}),u[0]):(console.log("NO INTERSECTION FOUND, RETURN NODE CENTER",t),t)}var r=t("./intersect-line");e.exports=n},{"./intersect-line":15}],18:[function(t,e){ +function n(t,e){var n,r,i=t.x,a=t.y,u=e.x-i,o=e.y-a,s=t.width/2,c=t.height/2;return Math.abs(o)*s>Math.abs(u)*c?(0>o&&(c=-c),n=0===o?0:c*u/o,r=c):(0>u&&(s=-s),n=s,r=0===u?0:s*o/u),{x:i+n,y:a+r}}e.exports=n},{}],19:[function(t,e){function n(t,e){var n=t.append("foreignObject").attr("width","100000"),i=n.append("xhtml:div"),a=e.label;switch(typeof a){case"function":i.insert(a);break;case"object":i.insert(function(){return a});break;default:i.html(a)}r.applyStyle(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap");var u,o;return i.each(function(){u=this.clientWidth,o=this.clientHeight}),n.attr("width",u).attr("height",o),n}var r=t("../util");e.exports=n},{"../util":29}],20:[function(t,e){function n(t,e,n){var u=e.label,o=t.append("g");"svg"===e.labelType?a(o,e):"string"!=typeof u||"html"===e.labelType?i(o,e):r(o,e);var s,c=o.node().getBBox();switch(n){case"top":s=-e.height/2;break;case"bottom":s=e.height/2-c.height;break;default:s=-c.height/2}return o.attr("transform","translate("+-c.width/2+","+s+")"),o}var r=t("./add-text-label"),i=t("./add-html-label"),a=t("./add-svg-label");e.exports=n},{"./add-html-label":19,"./add-svg-label":21,"./add-text-label":22}],21:[function(t,e){function n(t,e){var n=t;return n.node().appendChild(e.label),r.applyStyle(n,e.labelStyle),n}var r=t("../util");e.exports=n},{"../util":29}],22:[function(t,e){function n(t,e){for(var n=t.append("text"),a=r(e.label).split("\n"),u=0;uo;++o)r(t,"borderLeft","_bl",n,u,o),r(t,"borderRight","_br",n,u,o)}}i.each(t.children(),e)}function r(t,e,n,r,i,u){var o={width:0,height:0,rank:u,borderType:e},s=i[e][u-1],c=a.addDummyNode(t,"border",o,n);i[e][u]=c,t.setParent(c,r),s&&t.setEdge(s,c,{weight:1})}var i=t("./lodash"),a=t("./util");e.exports=n},{"./lodash":40,"./util":59}],34:[function(t,e){"use strict";function n(t){var e=t.graph().rankdir.toLowerCase();("lr"===e||"rl"===e)&&i(t)}function r(t){var e=t.graph().rankdir.toLowerCase();("bt"===e||"rl"===e)&&u(t),("lr"===e||"rl"===e)&&(s(t),i(t))}function i(t){l.each(t.nodes(),function(e){a(t.node(e))}),l.each(t.edges(),function(e){a(t.edge(e))})}function a(t){var e=t.width;t.width=t.height,t.height=e}function u(t){l.each(t.nodes(),function(e){o(t.node(e))}),l.each(t.edges(),function(e){var n=t.edge(e);l.each(n.points,o),l.has(n,"y")&&o(n)})}function o(t){t.y=-t.y}function s(t){l.each(t.nodes(),function(e){c(t.node(e))}),l.each(t.edges(),function(e){var n=t.edge(e);l.each(n.points,c),l.has(n,"x")&&c(n)})}function c(t){var e=t.x;t.x=t.y,t.y=e}var l=t("./lodash");e.exports={adjust:n,undo:r}},{"./lodash":40}],35:[function(t,e){function n(){var t={};t._next=t._prev=t,this._sentinel=t}function r(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function i(t,e){return"_next"!==t&&"_prev"!==t?e:void 0}e.exports=n,n.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;return e!==t?(r(e),e):void 0},n.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&r(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},n.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,i)),n=n._prev;return"["+t.join(", ")+"]"}},{}],36:[function(t,e){function n(t){var e=i.buildLayerMatrix(t),n=new a({compound:!0,multigraph:!0}).setGraph({});return r.each(t.nodes(),function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)}),r.each(t.edges(),function(t){n.setEdge(t.v,t.w,{},t.name)}),r.each(e,function(t,e){var i="layer"+e;n.setNode(i,{rank:"same"}),r.reduce(t,function(t,e){return n.setEdge(t,e,{style:"invis"}),e})}),n}var r=t("./lodash"),i=t("./util"),a=t("./graphlib").Graph;e.exports={debugOrdering:n}},{"./graphlib":37,"./lodash":40,"./util":59}],37:[function(t,e){var n;if("function"==typeof t)try{n=t("graphlib")}catch(r){}n||(n=window.graphlib),e.exports=n},{graphlib:61}],38:[function(t,e){function n(t,e){if(t.nodeCount()<=1)return[];var n=a(t,e||l),i=r(n.graph,n.buckets,n.zeroIdx);return o.flatten(o.map(i,function(e){return t.outEdges(e.v,e.w)}),!0)}function r(t,e,n){for(var r,a=[],u=e[e.length-1],o=e[0];t.nodeCount();){for(;r=o.dequeue();)i(t,e,n,r);for(;r=u.dequeue();)i(t,e,n,r);if(t.nodeCount())for(var s=e.length-2;s>0;--s)if(r=e[s].dequeue()){a=a.concat(i(t,e,n,r,!0));break}}return a}function i(t,e,n,r,i){var a=i?[]:void 0;return o.each(t.inEdges(r.v),function(r){var o=t.edge(r),s=t.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,u(e,n,s)}),o.each(t.outEdges(r.v),function(r){var i=t.edge(r),a=r.w,o=t.node(a);o["in"]-=i,u(e,n,o)}),t.removeNode(r.v),a}function a(t,e){var n=new s,r=0,i=0;o.each(t.nodes(),function(t){n.setNode(t,{v:t,"in":0,out:0})}),o.each(t.edges(),function(t){var a=n.edge(t.v,t.w)||0,u=e(t),o=a+u;n.setEdge(t.v,t.w,o),i=Math.max(i,n.node(t.v).out+=u),r=Math.max(r,n.node(t.w)["in"]+=u)});var a=o.range(i+r+3).map(function(){return new c}),l=r+1;return o.each(n.nodes(),function(t){u(a,l,n.node(t))}),{graph:n,buckets:a,zeroIdx:l}}function u(t,e,n){n.out?n["in"]?t[n.out-n["in"]+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}var o=t("./lodash"),s=t("./graphlib").Graph,c=t("./data/list");e.exports=n;var l=o.constant(1)},{"./data/list":35,"./graphlib":37,"./lodash":40}],39:[function(t,e){"use strict";function n(t,e){var n=e&&e.debugTiming?L.time:L.notime;n("layout",function(){var e=n(" buildLayoutGraph",function(){return a(t)});n(" runLayout",function(){r(e,n)}),n(" updateInputGraph",function(){i(t,e)})})}function r(t,e){e(" makeSpaceForEdgeLabels",function(){u(t)}),e(" removeSelfEdges",function(){g(t)}),e(" acyclic",function(){x.run(t)}),e(" nestingGraph.run",function(){C.run(t)}),e(" rank",function(){A(L.asNonCompoundGraph(t))}),e(" injectEdgeLabelProxies",function(){o(t)}),e(" removeEmptyRanks",function(){D(t)}),e(" nestingGraph.cleanup",function(){C.cleanup(t)}),e(" normalizeRanks",function(){E(t)}),e(" assignRankMinMax",function(){s(t)}),e(" removeEdgeLabelProxies",function(){c(t)}),e(" normalize.run",function(){w.run(t)}),e(" parentDummyChains",function(){k(t)}),e(" addBorderSegments",function(){S(t)}),e(" order",function(){T(t)}),e(" insertSelfEdges",function(){m(t)}),e(" adjustCoordinateSystem",function(){M.adjust(t)}),e(" position",function(){F(t)}),e(" positionSelfEdges",function(){y(t)}),e(" removeBorderNodes",function(){p(t)}),e(" normalize.undo",function(){w.undo(t)}),e(" fixupEdgeLabelCoords",function(){f(t)}),e(" undoCoordinateSystem",function(){M.undo(t)}),e(" translateGraph",function(){l(t)}),e(" assignNodeIntersects",function(){h(t)}),e(" reversePoints",function(){d(t)}),e(" acyclic.undo",function(){x.undo(t)})}function i(t,e){_.each(t.nodes(),function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))}),_.each(t.edges(),function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,_.has(i,"x")&&(r.x=i.x,r.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function a(t){var e=new B({multigraph:!0,compound:!0}),n=b(t.graph());return e.setGraph(_.merge({},I,v(n,N),_.pick(n,O))),_.each(t.nodes(),function(n){var r=b(t.node(n));e.setNode(n,_.defaults(v(r,R),P)),e.setParent(n,t.parent(n))}),_.each(t.edges(),function(n){var r=b(t.edge(n));e.setEdge(n,_.merge({},j,v(r,q),_.pick(r,U)))}),e}function u(t){var e=t.graph();e.ranksep/=2,_.each(t.edges(),function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function o(t){_.each(t.edges(),function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-r.rank)/2+r.rank,e:e};L.addDummyNode(t,"edge-proxy",a,"_ep")}})}function s(t){var e=0;_.each(t.nodes(),function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=_.max(e,r.maxRank))}),t.graph().maxRank=e}function c(t){_.each(t.nodes(),function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}function l(t){function e(t){var e=t.x,u=t.y,o=t.width,s=t.height;n=Math.min(n,e-o/2),r=Math.max(r,e+o/2),i=Math.min(i,u-s/2),a=Math.max(a,u+s/2)}var n=Number.POSITIVE_INFINITY,r=0,i=Number.POSITIVE_INFINITY,a=0,u=t.graph(),o=u.marginx||0,s=u.marginy||0;_.each(t.nodes(),function(n){e(t.node(n))}),_.each(t.edges(),function(n){var r=t.edge(n);_.has(r,"x")&&e(r)}),n-=o,i-=s,_.each(t.nodes(),function(e){var r=t.node(e);r.x-=n,r.y-=i}),_.each(t.edges(),function(e){var r=t.edge(e);_.each(r.points,function(t){t.x-=n,t.y-=i}),_.has(r,"x")&&(r.x-=n),_.has(r,"y")&&(r.y-=i)}),u.width=r-n+o,u.height=a-i+s}function h(t){_.each(t.edges(),function(e){var n,r,i=t.edge(e),a=t.node(e.v),u=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=u,r=a),i.points.unshift(L.intersectRect(a,n)),i.points.push(L.intersectRect(u,r))})}function f(t){_.each(t.edges(),function(e){var n=t.edge(e);if(_.has(n,"x"))switch(("l"===n.labelpos||"r"===n.labelpos)&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}function d(t){_.each(t.edges(),function(e){var n=t.edge(e);n.reversed&&n.points.reverse()})}function p(t){_.each(t.nodes(),function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),a=t.node(_.last(n.borderLeft)),u=t.node(_.last(n.borderRight));n.width=Math.abs(u.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),_.each(t.nodes(),function(e){"border"===t.node(e).dummy&&t.removeNode(e)})}function g(t){_.each(t.edges(),function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}function m(t){var e=L.buildLayerMatrix(t);_.each(e,function(e){var n=0;_.each(e,function(e,r){var i=t.node(e);i.order=r+n,_.each(i.selfEdges,function(e){L.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")}),delete i.selfEdges})})}function y(t){_.each(t.nodes(),function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,a=r.y,u=n.x-i,o=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*u/3,y:a-o},{x:i+5*u/6,y:a-o},{x:i+u,y:a},{x:i+5*u/6,y:a+o},{x:i+2*u/3,y:a+o}],n.label.x=n.x,n.label.y=n.y}})}function v(t,e){return _.mapValues(_.pick(t,e),Number)}function b(t){var e={};return _.each(t,function(t,n){e[n.toLowerCase()]=t}),e}var _=t("./lodash"),x=t("./acyclic"),w=t("./normalize"),A=t("./rank"),E=t("./util").normalizeRanks,k=t("./parent-dummy-chains"),D=t("./util").removeEmptyRanks,C=t("./nesting-graph"),S=t("./add-border-segments"),M=t("./coordinate-system"),T=t("./order"),F=t("./position"),L=t("./util"),B=t("./graphlib").Graph;e.exports=n;var N=["nodesep","edgesep","ranksep","marginx","marginy"],I={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},O=["acyclicer","ranker","rankdir","align"],R=["width","height"],P={width:0,height:0},q=["minlen","weight","width","height","labeloffset"],j={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},U=["labelpos"]},{"./acyclic":32,"./add-border-segments":33,"./coordinate-system":34,"./graphlib":37,"./lodash":40,"./nesting-graph":41,"./normalize":42,"./order":47,"./parent-dummy-chains":52,"./position":54,"./rank":56,"./util":59}],40:[function(t,e){var n;if("function"==typeof t)try{n=t("lodash")}catch(r){}n||(n=window._),e.exports=n},{lodash:82}],41:[function(t,e){function n(t){var e=s.addDummyNode(t,"root",{},"_root"),n=i(t),u=o.max(n)-1,c=2*u+1;t.graph().nestingRoot=e,o.each(t.edges(),function(e){t.edge(e).minlen*=c});var l=a(t)+1;o.each(t.children(),function(i){r(t,e,c,l,u,n,i)}),t.graph().nodeRankFactor=c}function r(t,e,n,i,a,u,c){var l=t.children(c);if(!l.length)return void(c!==e&&t.setEdge(e,c,{weight:0,minlen:n}));var h=s.addBorderNode(t,"_bt"),f=s.addBorderNode(t,"_bb"),d=t.node(c);t.setParent(h,c),d.borderTop=h,t.setParent(f,c),d.borderBottom=f,o.each(l,function(o){r(t,e,n,i,a,u,o);var s=t.node(o),l=s.borderTop?s.borderTop:o,d=s.borderBottom?s.borderBottom:o,p=s.borderTop?i:2*i,g=l!==d?1:a-u[c]+1;t.setEdge(h,l,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(d,f,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(c)||t.setEdge(e,h,{weight:0,minlen:a+u[c]})}function i(t){function e(r,i){var a=t.children(r);a&&a.length&&o.each(a,function(t){e(t,i+1)}),n[r]=i}var n={};return o.each(t.children(),function(t){e(t,1)}),n}function a(t){return o.reduce(t.edges(),function(e,n){return e+t.edge(n).weight},0)}function u(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,o.each(t.edges(),function(e){var n=t.edge(e);n.nestingEdge&&t.removeEdge(e)})}var o=t("./lodash"),s=t("./util");e.exports={run:n,cleanup:u}},{"./lodash":40,"./util":59}],42:[function(t,e){"use strict";function n(t){t.graph().dummyChains=[],a.each(t.edges(),function(e){r(t,e)})}function r(t,e){var n=e.v,r=t.node(n).rank,i=e.w,a=t.node(i).rank,o=e.name,s=t.edge(e),c=s.labelRank;if(a!==r+1){t.removeEdge(e);var l,h,f;for(f=0,++r;a>r;++f,++r)s.points=[],h={width:0,height:0,edgeLabel:s,edgeObj:e,rank:r},l=u.addDummyNode(t,"edge",h,"_d"),r===c&&(h.width=s.width,h.height=s.height,h.dummy="edge-label",h.labelpos=s.labelpos),t.setEdge(n,l,{weight:s.weight},o),0===f&&t.graph().dummyChains.push(l),n=l;t.setEdge(n,i,{weight:s.weight},o)}}function i(t){a.each(t.graph().dummyChains,function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)})}var a=t("./lodash"),u=t("./util");e.exports={run:n,undo:i}},{"./lodash":40,"./util":59}],43:[function(t,e){function n(t,e,n){var i,a={};r.each(n,function(n){for(var r,u,o=t.parent(n);o;){if(r=t.parent(o),r?(u=a[r],a[r]=o):(u=i,i=o),u&&u!==o)return void e.setEdge(u,o);o=r}})}var r=t("../lodash");e.exports=n},{"../lodash":40}],44:[function(t,e){function n(t,e){return r.map(e,function(e){var n=t.inEdges(e);if(n.length){var i=r.reduce(n,function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}},{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}})}var r=t("../lodash");e.exports=n},{"../lodash":40}],45:[function(t,e){function n(t,e,n){var u=r(t),o=new a({compound:!0}).setGraph({root:u}).setDefaultNodeLabel(function(e){return t.node(e)});return i.each(t.nodes(),function(r){var a=t.node(r),s=t.parent(r);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(o.setNode(r),o.setParent(r,s||u),i.each(t[n](r),function(e){var n=e.v===r?e.w:e.v,a=o.edge(n,r),u=i.isUndefined(a)?0:a.weight;o.setEdge(n,r,{weight:t.edge(e).weight+u})}),i.has(a,"minRank")&&o.setNode(r,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),o}function r(t){for(var e;t.hasNode(e=i.uniqueId("_root")););return e}var i=t("../lodash"),a=t("../graphlib").Graph;e.exports=n},{"../graphlib":37,"../lodash":40}],46:[function(t,e){"use strict";function n(t,e){for(var n=0,i=1;i0;)e%2&&(n+=s[e+1]),e=e-1>>1,s[e]+=t.weight;c+=t.weight*n})),c}var i=t("../lodash");e.exports=n},{"../lodash":40}],47:[function(t,e){"use strict";function n(t){var e=d.maxRank(t),n=r(t,u.range(1,e+1),"inEdges"),c=r(t,u.range(e-1,-1,-1),"outEdges"),l=o(t);a(t,l);for(var h,f=Number.POSITIVE_INFINITY,p=0,g=0;4>g;++p,++g){i(p%2?n:c,p%4>=2),l=d.buildLayerMatrix(t);var m=s(t,l);f>m&&(g=0,h=u.cloneDeep(l),f=m)}a(t,h)}function r(t,e,n){return u.map(e,function(e){return l(t,e,n)})}function i(t,e){var n=new f;u.each(t,function(t){var r=t.graph().root,i=c(t,r,n,e);u.each(i.vs,function(e,n){t.node(e).order=n}),h(t,n,i.vs)})}function a(t,e){u.each(e,function(e){u.each(e,function(e,n){t.node(e).order=n})})}var u=t("../lodash"),o=t("./init-order"),s=t("./cross-count"),c=t("./sort-subgraph"),l=t("./build-layer-graph"),h=t("./add-subgraph-constraints"),f=t("../graphlib").Graph,d=t("../util");e.exports=n},{"../graphlib":37,"../lodash":40,"../util":59,"./add-subgraph-constraints":43,"./build-layer-graph":45,"./cross-count":46,"./init-order":48,"./sort-subgraph":50}],48:[function(t,e){"use strict";function n(t){function e(i){if(!r.has(n,i)){n[i]=!0;var a=t.node(i);u[a.rank].push(i),r.each(t.successors(i),e)}}var n={},i=r.filter(t.nodes(),function(e){return!t.children(e).length}),a=r.max(r.map(i,function(e){return t.node(e).rank})),u=r.map(r.range(a+1),function(){return[]}),o=r.sortBy(i,function(e){return t.node(e).rank});return r.each(o,e),u}var r=t("../lodash");e.exports=n},{"../lodash":40}],49:[function(t,e){"use strict";function n(t,e){var n={};a.each(t,function(t,e){var r=n[t.v]={indegree:0,"in":[],out:[],vs:[t.v],i:e};a.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)}),a.each(e.edges(),function(t){var e=n[t.v],r=n[t.w];a.isUndefined(e)||a.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))});var i=a.filter(n,function(t){return!t.indegree});return r(i)}function r(t){function e(t){return function(e){e.merged||(a.isUndefined(e.barycenter)||a.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&i(t,e)}}function n(e){return function(n){n["in"].push(e),0===--n.indegree&&t.push(n)}}for(var r=[];t.length;){var u=t.pop();r.push(u),a.each(u["in"].reverse(),e(u)),a.each(u.out,n(u))}return a.chain(r).filter(function(t){return!t.merged}).map(function(t){return a.pick(t,["vs","i","barycenter","weight"])}).value()}function i(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}var a=t("../lodash");e.exports=n},{"../lodash":40}],50:[function(t,e){function n(t,e,c,l){var h=t.children(e),f=t.node(e),d=f?f.borderLeft:void 0,p=f?f.borderRight:void 0,g={};d&&(h=a.filter(h,function(t){return t!==d&&t!==p}));var m=u(t,h);a.each(m,function(e){if(t.children(e.v).length){var r=n(t,e.v,c,l);g[e.v]=r,a.has(r,"barycenter")&&i(e,r)}});var y=o(m,c);r(y,g);var v=s(y,l);if(d&&(v.vs=a.flatten([d,v.vs,p],!0),t.predecessors(d).length)){var b=t.node(t.predecessors(d)[0]),_=t.node(t.predecessors(p)[0]);a.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+b.order+_.order)/(v.weight+2),v.weight+=2}return v}function r(t,e){a.each(t,function(t){t.vs=a.flatten(t.vs.map(function(t){return e[t]?e[t].vs:t}),!0)})}function i(t,e){a.isUndefined(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}var a=t("../lodash"),u=t("./barycenter"),o=t("./resolve-conflicts"),s=t("./sort");e.exports=n},{"../lodash":40,"./barycenter":44,"./resolve-conflicts":49,"./sort":51}],51:[function(t,e){function n(t,e){var n=u.partition(t,function(t){return a.has(t,"barycenter")}),o=n.lhs,s=a.sortBy(n.rhs,function(t){return-t.i}),c=[],l=0,h=0,f=0;o.sort(i(!!e)),f=r(c,s,f),a.each(o,function(t){f+=t.vs.length,c.push(t.vs),l+=t.barycenter*t.weight,h+=t.weight,f=r(c,s,f)});var d={vs:a.flatten(c,!0)};return h&&(d.barycenter=l/h,d.weight=h),d}function r(t,e,n){for(var r;e.length&&(r=a.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}function i(t){return function(e,n){return e.barycentern.barycenter?1:t?n.i-e.i:e.i-n.i}}var a=t("../lodash"),u=t("../util");e.exports=n},{"../lodash":40,"../util":59}],52:[function(t,e){function n(t){var e=i(t);a.each(t.graph().dummyChains,function(n){for(var i=t.node(n),a=i.edgeObj,u=r(t,e,a.v,a.w),o=u.path,s=u.lca,c=0,l=o[c],h=!0;n!==a.w;){if(i=t.node(n),h){for(;(l=o[c])!==s&&t.node(l).maxRanks||c>e[i].lim));for(a=i,i=r;(i=t.parent(i))!==a;)o.push(i);return{path:u.concat(o.reverse()),lca:a}}function i(t){function e(i){var u=r;a.each(t.children(i),e),n[i]={low:u,lim:r++}}var n={},r=0;return a.each(t.children(),e),n}var a=t("./lodash");e.exports=n},{"./lodash":40}],53:[function(t,e){"use strict";function n(t,e){function n(e,n){var u=0,o=0,s=e.length,c=m.last(n);return m.each(n,function(e,l){var h=i(t,e),f=h?t.node(h).order:s;(h||e===c)&&(m.each(n.slice(o,l+1),function(e){m.each(t.predecessors(e),function(n){var i=t.node(n),o=i.order;!(u>o||o>f)||i.dummy&&t.node(e).dummy||a(r,n,e)})}),o=l+1,u=f)}),n}var r={};return m.reduce(e,n),r}function r(t,e){function n(e,n,r,u,o){var s;m.each(m.range(n,r),function(n){s=e[n],t.node(s).dummy&&m.each(t.predecessors(s),function(e){var n=t.node(e);n.dummy&&(n.ordero)&&a(i,e,s)})})}function r(e,r){var i,a=-1,u=0;return m.each(r,function(o,s){if("border"===t.node(o).dummy){var c=t.predecessors(o);c.length&&(i=t.node(c[0]).order,n(r,u,s,a,i),u=s,a=i)}n(r,u,r.length,i,e.length)}),r}var i={};return m.reduce(e,r),i}function i(t,e){return t.node(e).dummy?m.find(t.predecessors(e),function(e){return t.node(e).dummy}):void 0}function a(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function u(t,e,n){if(e>n){var r=e;e=n,n=r}return m.has(t[e],n)}function o(t,e,n,r){var i={},a={},o={};return m.each(e,function(t){m.each(t,function(t,e){i[t]=t,a[t]=t,o[t]=e})}),m.each(e,function(t){var e=-1;m.each(t,function(t){var s=r(t);if(s.length){s=m.sortBy(s,function(t){return o[t]});for(var c=(s.length-1)/2,l=Math.floor(c),h=Math.ceil(c);h>=l;++l){var f=s[l];a[t]===t&&eu.lim&&(o=u,s=!0);var c=p.filter(e.edges(),function(e){return s===d(t,t.node(e.v),o)&&s!==d(t,t.node(e.w),o)});return p.min(c,function(t){return m(e,t)})}function l(t,e,n,i){var a=n.v,o=n.w;t.removeEdge(a,o),t.setEdge(i.v,i.w,{}),u(t),r(t,e),h(t,e)}function h(t,e){var n=p.find(t.nodes(),function(t){return!e.node(t).parent}),r=v(t,n);r=r.slice(1),p.each(r,function(n){var r=t.node(n).parent,i=e.edge(n,r),a=!1;i||(i=e.edge(r,n),a=!0),e.node(n).rank=e.node(r).rank+(a?i.minlen:-i.minlen)})}function f(t,e,n){return t.hasEdge(e,n)}function d(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}var p=t("../lodash"),g=t("./feasible-tree"),m=t("./util").slack,y=t("./util").longestPath,v=t("../graphlib").alg.preorder,b=t("../graphlib").alg.postorder,_=t("../util").simplify;e.exports=n,n.initLowLimValues=u,n.initCutValues=r,n.calcCutValue=a,n.leaveEdge=s,n.enterEdge=c,n.exchangeEdges=l},{"../graphlib":37,"../lodash":40,"../util":59,"./feasible-tree":55,"./util":58}],58:[function(t,e){"use strict";function n(t){function e(r){var a=t.node(r);if(i.has(n,r))return a.rank;n[r]=!0;var u=i.min(i.map(t.outEdges(r),function(n){return e(n.w)-t.edge(n).minlen}));return u===Number.POSITIVE_INFINITY&&(u=0),a.rank=u}var n={};i.each(t.sources(),e)}function r(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var i=t("../lodash");e.exports={longestPath:n,slack:r}},{"../lodash":40}],59:[function(t,e){"use strict";function n(t,e,n,r){var i;do i=m.uniqueId(r);while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function r(t){var e=(new y).setGraph(t.graph());return m.each(t.nodes(),function(n){e.setNode(n,t.node(n))}),m.each(t.edges(),function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),e}function i(t){var e=new y({multigraph:t.isMultigraph()}).setGraph(t.graph());return m.each(t.nodes(),function(n){t.children(n).length||e.setNode(n,t.node(n))}),m.each(t.edges(),function(n){e.setEdge(n,t.edge(n))}),e}function a(t){var e=m.map(t.nodes(),function(e){var n={};return m.each(t.outEdges(e),function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight}),n});return m.zipObject(t.nodes(),e)}function u(t){var e=m.map(t.nodes(),function(e){var n={};return m.each(t.inEdges(e),function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight}),n});return m.zipObject(t.nodes(),e)}function o(t,e){var n=t.x,r=t.y,i=e.x-n,a=e.y-r,u=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var s,c;return Math.abs(a)*u>Math.abs(i)*o?(0>a&&(o=-o),s=o*i/a,c=o):(0>i&&(u=-u),s=u,c=u*a/i),{x:n+s,y:r+c}}function s(t){var e=m.map(m.range(f(t)+1),function(){return[]});return m.each(t.nodes(),function(n){var r=t.node(n),i=r.rank;m.isUndefined(i)||(e[i][r.order]=n)}),e}function c(t){var e=m.min(m.map(t.nodes(),function(e){return t.node(e).rank}));m.each(t.nodes(),function(n){var r=t.node(n);m.has(r,"rank")&&(r.rank-=e)})}function l(t){var e=m.min(m.map(t.nodes(),function(e){return t.node(e).rank})),n=[];m.each(t.nodes(),function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=t.graph().nodeRankFactor;m.each(n,function(e,n){m.isUndefined(e)&&n%i!==0?--r:r&&m.each(e,function(e){t.node(e).rank+=r})})}function h(t,e,r,i){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=i),n(t,"border",a,e)}function f(t){return m.max(m.map(t.nodes(),function(e){var n=t.node(e).rank;return m.isUndefined(n)?void 0:n}))}function d(t,e){var n={lhs:[],rhs:[]};return m.each(t,function(t){e(t)?n.lhs.push(t):n.rhs.push(t)}),n}function p(t,e){var n=m.now();try{return e()}finally{console.log(t+" time: "+(m.now()-n)+"ms")}}function g(t,e){return e()}var m=t("./lodash"),y=t("./graphlib").Graph;e.exports={addDummyNode:n,simplify:r,asNonCompoundGraph:i,successorWeights:a,predecessorWeights:u,intersectRect:o,buildLayerMatrix:s,normalizeRanks:c,removeEmptyRanks:l,addBorderNode:h,maxRank:f,partition:d,time:p,notime:g}},{"./graphlib":37,"./lodash":40}],60:[function(t,e){e.exports="0.7.4"},{}],61:[function(t,e){var n=t("./lib");e.exports={Graph:n.Graph,json:t("./lib/json"),alg:t("./lib/alg"),version:n.version}},{"./lib":77,"./lib/alg":68,"./lib/json":78}],62:[function(t,e){function n(t){function e(a){r.has(i,a)||(i[a]=!0,n.push(a),r.each(t.successors(a),e),r.each(t.predecessors(a),e))}var n,i={},a=[];return r.each(t.nodes(),function(t){n=[],e(t),n.length&&a.push(n)}),a}var r=t("../lodash");e.exports=n},{"../lodash":79}],63:[function(t,e){function n(t,e,n){i.isArray(e)||(e=[e]);var a=[],u={};return i.each(e,function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);r(t,e,"post"===n,u,a)}),a}function r(t,e,n,a,u){i.has(a,e)||(a[e]=!0,n||u.push(e),i.each(t.neighbors(e),function(e){r(t,e,n,a,u)}),n&&u.push(e))}var i=t("../lodash");e.exports=n},{"../lodash":79}],64:[function(t,e){function n(t,e,n){return i.transform(t.nodes(),function(i,a){i[a]=r(t,a,e,n)},{})}var r=t("./dijkstra"),i=t("../lodash");e.exports=n},{"../lodash":79,"./dijkstra":65}],65:[function(t,e){function n(t,e,n,i){return r(t,String(e),n||u,i||function(e){return t.outEdges(e)})}function r(t,e,n,r){var i,u,o={},s=new a,c=function(t){var e=t.v!==i?t.v:t.w,r=o[e],a=n(t),c=u.distance+a;if(0>a)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+a);c0&&(i=s.removeMin(),u=o[i],u.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(c);return o}var i=t("../lodash"),a=t("../data/priority-queue");e.exports=n;var u=i.constant(1)},{"../data/priority-queue":75,"../lodash":79}],66:[function(t,e){function n(t){return r.filter(i(t),function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})}var r=t("../lodash"),i=t("./tarjan");e.exports=n},{"../lodash":79,"./tarjan":73}],67:[function(t,e){function n(t,e,n){return r(t,e||a,n||function(e){return t.outEdges(e)})}function r(t,e,n){var r={},i=t.nodes();return i.forEach(function(t){r[t]={},r[t][t]={distance:0},i.forEach(function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})}),n(t).forEach(function(n){var i=n.v===t?n.w:n.v,a=e(n);r[t][i]={distance:a,predecessor:t}})}),i.forEach(function(t){var e=r[t];i.forEach(function(n){var a=r[n];i.forEach(function(n){var r=a[t],i=e[n],u=a[n],o=r.distance+i.distance;oi&&(s[n]=u,c.decrease(n,i))}}var u,o=new i,s={},c=new a;if(0===t.nodeCount())return o;r.each(t.nodes(),function(t){c.add(t,Number.POSITIVE_INFINITY),o.setNode(t)}),c.decrease(t.nodes()[0],0);for(var l=!1;c.size()>0;){if(u=c.removeMin(),r.has(s,u))o.setEdge(u,s[u]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(u).forEach(n)}return o}var r=t("../lodash"),i=t("../graph"),a=t("../data/priority-queue");e.exports=n},{"../data/priority-queue":75,"../graph":76,"../lodash":79}],73:[function(t,e){function n(t){function e(o){var s=a[o]={onStack:!0,lowlink:n,index:n++};if(i.push(o),t.successors(o).forEach(function(t){r.has(a,t)?a[t].onStack&&(s.lowlink=Math.min(s.lowlink,a[t].index)):(e(t),s.lowlink=Math.min(s.lowlink,a[t].lowlink))}),s.lowlink===s.index){var c,l=[];do c=i.pop(),a[c].onStack=!1,l.push(c);while(o!==c);u.push(l)}}var n=0,i=[],a={},u=[];return t.nodes().forEach(function(t){r.has(a,t)||e(t)}),u}var r=t("../lodash");e.exports=n},{"../lodash":79}],74:[function(t,e){function n(t){function e(o){if(i.has(a,o))throw new r;i.has(n,o)||(a[o]=!0,n[o]=!0,i.each(t.predecessors(o),e),delete a[o],u.push(o))}var n={},a={},u=[];if(i.each(t.sinks(),e),i.size(n)!==t.nodeCount())throw new r;return u}function r(){}var i=t("../lodash");e.exports=n,n.CycleException=r},{"../lodash":79}],75:[function(t,e){function n(){this._arr=[],this._keyIndices={}}var r=t("../lodash");e.exports=n,n.prototype.size=function(){return this._arr.length},n.prototype.keys=function(){return this._arr.map(function(t){return t.key})},n.prototype.has=function(t){return r.has(this._keyIndices,t)},n.prototype.priority=function(t){var e=this._keyIndices[t];return void 0!==e?this._arr[e].priority:void 0},n.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},n.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,a=i.length;return n[t]=a,i.push({key:t,priority:e}),this._decrease(a),!0}return!1},n.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},n.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},n.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n>1,!(n[e].prioritya){var u=i;i=a,a=u}return i+h+a+h+(s.isUndefined(r)?c:r)}function u(t,e,n,r){var i=""+e,a=""+n;if(!t&&i>a){var u=i;i=a,a=u}var o={v:i,w:a};return r&&(o.name=r),o}function o(t,e){return a(t,e.v,e.w,e.name)}var s=t("./lodash");e.exports=n;var c="\x00",l="\x00",h="";n.prototype._nodeCount=0,n.prototype._edgeCount=0,n.prototype.isDirected=function(){return this._isDirected},n.prototype.isMultigraph=function(){return this._isMultigraph},n.prototype.isCompound=function(){return this._isCompound},n.prototype.setGraph=function(t){return this._label=t,this},n.prototype.graph=function(){return this._label},n.prototype.setDefaultNodeLabel=function(t){return s.isFunction(t)||(t=s.constant(t)),this._defaultNodeLabelFn=t,this},n.prototype.nodeCount=function(){return this._nodeCount},n.prototype.nodes=function(){return s.keys(this._nodes)},n.prototype.sources=function(){return s.filter(this.nodes(),function(t){return s.isEmpty(this._in[t])},this)},n.prototype.sinks=function(){return s.filter(this.nodes(),function(t){return s.isEmpty(this._out[t])},this)},n.prototype.setNodes=function(t,e){var n=arguments;return s.each(t,function(t){n.length>1?this.setNode(t,e):this.setNode(t)},this),this},n.prototype.setNode=function(t,e){return s.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=l,this._children[t]={},this._children[l][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},n.prototype.node=function(t){return this._nodes[t]},n.prototype.hasNode=function(t){return s.has(this._nodes,t)},n.prototype.removeNode=function(t){var e=this;if(s.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],s.each(this.children(t),function(t){this.setParent(t)},this),delete this._children[t]),s.each(s.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],s.each(s.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},n.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(s.isUndefined(e))e=l;else{e+="";for(var n=e;!s.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},n.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},n.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==l)return e}},n.prototype.children=function(t){if(s.isUndefined(t)&&(t=l),this._isCompound){var e=this._children[t];if(e)return s.keys(e)}else{if(t===l)return this.nodes();if(this.hasNode(t))return[]}},n.prototype.predecessors=function(t){var e=this._preds[t];return e?s.keys(e):void 0},n.prototype.successors=function(t){var e=this._sucs[t];return e?s.keys(e):void 0},n.prototype.neighbors=function(t){var e=this.predecessors(t);return e?s.union(e,this.successors(t)):void 0},n.prototype.filterNodes=function(t){function e(t){var a=r.parent(t);return void 0===a||n.hasNode(a)?(i[t]=a,a):a in i?i[a]:e(a)}var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph()),s.each(this._nodes,function(e,r){t(r)&&n.setNode(r,e)},this),s.each(this._edgeObjs,function(t){n.hasNode(t.v)&&n.hasNode(t.w)&&n.setEdge(t,this.edge(t))},this);var r=this,i={};return this._isCompound&&s.each(n.nodes(),function(t){n.setParent(t,e(t))}),n},n.prototype.setDefaultEdgeLabel=function(t){return s.isFunction(t)||(t=s.constant(t)),this._defaultEdgeLabelFn=t,this},n.prototype.edgeCount=function(){return this._edgeCount},n.prototype.edges=function(){return s.values(this._edgeObjs)},n.prototype.setPath=function(t,e){var n=this,r=arguments;return s.reduce(t,function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i}),this},n.prototype.setEdge=function(){var t,e,n,i,o=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(t=c.v,e=c.w,n=c.name,2===arguments.length&&(i=arguments[1],o=!0)):(t=c,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,e=""+e,s.isUndefined(n)||(n=""+n);var l=a(this._isDirected,t,e,n);if(s.has(this._edgeLabels,l))return o&&(this._edgeLabels[l]=i),this;if(!s.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=o?i:this._defaultEdgeLabelFn(t,e,n);var h=u(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[l]=h,r(this._preds[e],t),r(this._sucs[t],e),this._in[e][l]=h,this._out[t][l]=h,this._edgeCount++,this},n.prototype.edge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return this._edgeLabels[r]},n.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return s.has(this._edgeLabels,r)},n.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n),u=this._edgeObjs[r];return u&&(t=u.v,e=u.w,delete this._edgeLabels[r],delete this._edgeObjs[r],i(this._preds[e],t),i(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},n.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=s.values(n);return e?s.filter(r,function(t){return t.v===e}):r}},n.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=s.values(n);return e?s.filter(r,function(t){return t.w===e}):r}},n.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);return n?n.concat(this.outEdges(t,e)):void 0}},{"./lodash":79}],77:[function(t,e){e.exports={Graph:t("./graph"),version:t("./version")}},{"./graph":76,"./version":80}],78:[function(t,e){function n(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:r(t),edges:i(t)};return u.isUndefined(t.graph())||(e.value=u.clone(t.graph())),e}function r(t){return u.map(t.nodes(),function(e){var n=t.node(e),r=t.parent(e),i={v:e};return u.isUndefined(n)||(i.value=n),u.isUndefined(r)||(i.parent=r),i})}function i(t){return u.map(t.edges(),function(e){var n=t.edge(e),r={v:e.v,w:e.w};return u.isUndefined(e.name)||(r.name=e.name),u.isUndefined(n)||(r.value=n),r})}function a(t){var e=new o(t.options).setGraph(t.value);return u.each(t.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),u.each(t.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}var u=t("./lodash"),o=t("./graph");e.exports={write:n,read:a}},{"./graph":76,"./lodash":79}],79:[function(t,e){e.exports=t(40)},{"/Users/knut/source/mermaid/node_modules/dagre/lib/lodash.js":40,lodash:82}],80:[function(t,e){e.exports="1.0.7"},{}],81:[function(t,e,n){(function(t){!function(r){var i="object"==typeof n&&n,a="object"==typeof e&&e&&e.exports==i&&e,u="object"==typeof t&&t;(u.global===u||u.window===u)&&(r=u);var o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,s=/[\x01-\x7F]/g,c=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,l=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,h={"Á":"Aacute","á":"aacute","Ă":"Abreve","ă":"abreve","∾":"ac","∿":"acd","∾̳":"acE","Â":"Acirc","â":"acirc","´":"acute","А":"Acy","а":"acy","Æ":"AElig","æ":"aelig","⁡":"af","𝔄":"Afr","𝔞":"afr","À":"Agrave","à":"agrave","ℵ":"aleph","Α":"Alpha","α":"alpha","Ā":"Amacr","ā":"amacr","⨿":"amalg","&":"amp","⩕":"andand","⩓":"And","∧":"and","⩜":"andd","⩘":"andslope","⩚":"andv","∠":"ang","⦤":"ange","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","∡":"angmsd","∟":"angrt","⊾":"angrtvb","⦝":"angrtvbd","∢":"angsph","Å":"angst","⍼":"angzarr","Ą":"Aogon","ą":"aogon","𝔸":"Aopf","𝕒":"aopf","⩯":"apacir","≈":"ap","⩰":"apE","≊":"ape","≋":"apid","'":"apos","å":"aring","𝒜":"Ascr","𝒶":"ascr","≔":"colone","*":"ast","≍":"CupCap","Ã":"Atilde","ã":"atilde","Ä":"Auml","ä":"auml","∳":"awconint","⨑":"awint","≌":"bcong","϶":"bepsi","‵":"bprime","∽":"bsim","⋍":"bsime","∖":"setmn","⫧":"Barv","⊽":"barvee","⌅":"barwed","⌆":"Barwed","⎵":"bbrk","⎶":"bbrktbrk","Б":"Bcy","б":"bcy","„":"bdquo","∵":"becaus","⦰":"bemptyv","ℬ":"Bscr","Β":"Beta","β":"beta","ℶ":"beth","≬":"twixt","𝔅":"Bfr","𝔟":"bfr","⋂":"xcap","◯":"xcirc","⋃":"xcup","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨆":"xsqcup","★":"starf","▽":"xdtri","△":"xutri","⨄":"xuplus","⋁":"Vee","⋀":"Wedge","⤍":"rbarr","⧫":"lozf","▪":"squf","▴":"utrif","▾":"dtrif","◂":"ltrif","▸":"rtrif","␣":"blank","▒":"blk12","░":"blk14","▓":"blk34","█":"block","=⃥":"bne","≡⃥":"bnequiv","⫭":"bNot","⌐":"bnot","𝔹":"Bopf","𝕓":"bopf","⊥":"bot","⋈":"bowtie","⧉":"boxbox","┐":"boxdl","╕":"boxdL","╖":"boxDl","╗":"boxDL","┌":"boxdr","╒":"boxdR","╓":"boxDr","╔":"boxDR","─":"boxh","═":"boxH","┬":"boxhd","╤":"boxHd","╥":"boxhD","╦":"boxHD","┴":"boxhu","╧":"boxHu","╨":"boxhU","╩":"boxHU","⊟":"minusb","⊞":"plusb","⊠":"timesb","┘":"boxul","╛":"boxuL","╜":"boxUl","╝":"boxUL","└":"boxur","╘":"boxuR","╙":"boxUr","╚":"boxUR","│":"boxv","║":"boxV","┼":"boxvh","╪":"boxvH","╫":"boxVh","╬":"boxVH","┤":"boxvl","╡":"boxvL","╢":"boxVl","╣":"boxVL","├":"boxvr","╞":"boxvR","╟":"boxVr","╠":"boxVR","˘":"breve","¦":"brvbar","𝒷":"bscr","⁏":"bsemi","⧅":"bsolb","\\":"bsol","⟈":"bsolhsub","•":"bull","≎":"bump","⪮":"bumpE","≏":"bumpe","Ć":"Cacute","ć":"cacute","⩄":"capand","⩉":"capbrcup","⩋":"capcap","∩":"cap","⋒":"Cap","⩇":"capcup","⩀":"capdot","ⅅ":"DD","∩︀":"caps","⁁":"caret","ˇ":"caron","ℭ":"Cfr","⩍":"ccaps","Č":"Ccaron","č":"ccaron","Ç":"Ccedil","ç":"ccedil","Ĉ":"Ccirc","ĉ":"ccirc","∰":"Cconint","⩌":"ccups","⩐":"ccupssm","Ċ":"Cdot","ċ":"cdot","¸":"cedil","⦲":"cemptyv","¢":"cent","·":"middot","𝔠":"cfr","Ч":"CHcy","ч":"chcy","✓":"check","Χ":"Chi","χ":"chi","ˆ":"circ","≗":"cire","↺":"olarr","↻":"orarr","⊛":"oast","⊚":"ocir","⊝":"odash","⊙":"odot","®":"reg","Ⓢ":"oS","⊖":"ominus","⊕":"oplus","⊗":"otimes","○":"cir","⧃":"cirE","⨐":"cirfnint","⫯":"cirmid","⧂":"cirscir","∲":"cwconint","”":"rdquo","’":"rsquo","♣":"clubs",":":"colon","∷":"Colon","⩴":"Colone",",":"comma","@":"commat","∁":"comp","∘":"compfn","ℂ":"Copf","≅":"cong","⩭":"congdot","≡":"equiv","∮":"oint","∯":"Conint","𝕔":"copf","∐":"coprod","©":"copy","℗":"copysr","↵":"crarr","✗":"cross","⨯":"Cross","𝒞":"Cscr","𝒸":"cscr","⫏":"csub","⫑":"csube","⫐":"csup","⫒":"csupe","⋯":"ctdot","⤸":"cudarrl","⤵":"cudarrr","⋞":"cuepr","⋟":"cuesc","↶":"cularr","⤽":"cularrp","⩈":"cupbrcap","⩆":"cupcap","∪":"cup","⋓":"Cup","⩊":"cupcup","⊍":"cupdot","⩅":"cupor","∪︀":"cups","↷":"curarr","⤼":"curarrm","⋎":"cuvee","⋏":"cuwed","¤":"curren","∱":"cwint","⌭":"cylcty","†":"dagger","‡":"Dagger","ℸ":"daleth","↓":"darr","↡":"Darr","⇓":"dArr","‐":"dash","⫤":"Dashv","⊣":"dashv","⤏":"rBarr","˝":"dblac","Ď":"Dcaron","ď":"dcaron","Д":"Dcy","д":"dcy","⇊":"ddarr","ⅆ":"dd","⤑":"DDotrahd","⩷":"eDDot","°":"deg","∇":"Del","Δ":"Delta","δ":"delta","⦱":"demptyv","⥿":"dfisht","𝔇":"Dfr","𝔡":"dfr","⥥":"dHar","⇃":"dharl","⇂":"dharr","˙":"dot","`":"grave","˜":"tilde","⋄":"diam","♦":"diams","¨":"die","ϝ":"gammad","⋲":"disin","÷":"div","⋇":"divonx","Ђ":"DJcy","ђ":"djcy","⌞":"dlcorn","⌍":"dlcrop",$:"dollar","𝔻":"Dopf","𝕕":"dopf","⃜":"DotDot","≐":"doteq","≑":"eDot","∸":"minusd","∔":"plusdo","⊡":"sdotb","⇐":"lArr","⇔":"iff","⟸":"xlArr","⟺":"xhArr","⟹":"xrArr","⇒":"rArr","⊨":"vDash","⇑":"uArr","⇕":"vArr","∥":"par","⤓":"DownArrowBar","⇵":"duarr","̑":"DownBreve","⥐":"DownLeftRightVector","⥞":"DownLeftTeeVector","⥖":"DownLeftVectorBar","↽":"lhard","⥟":"DownRightTeeVector","⥗":"DownRightVectorBar","⇁":"rhard","↧":"mapstodown","⊤":"top","⤐":"RBarr","⌟":"drcorn","⌌":"drcrop","𝒟":"Dscr","𝒹":"dscr","Ѕ":"DScy","ѕ":"dscy","⧶":"dsol","Đ":"Dstrok","đ":"dstrok","⋱":"dtdot","▿":"dtri","⥯":"duhar","⦦":"dwangle","Џ":"DZcy","џ":"dzcy","⟿":"dzigrarr","É":"Eacute","é":"eacute","⩮":"easter","Ě":"Ecaron","ě":"ecaron","Ê":"Ecirc","ê":"ecirc","≖":"ecir","≕":"ecolon","Э":"Ecy","э":"ecy","Ė":"Edot","ė":"edot","ⅇ":"ee","≒":"efDot","𝔈":"Efr","𝔢":"efr","⪚":"eg","È":"Egrave","è":"egrave","⪖":"egs","⪘":"egsdot","⪙":"el","∈":"in","⏧":"elinters","ℓ":"ell","⪕":"els","⪗":"elsdot","Ē":"Emacr","ē":"emacr","∅":"empty","◻":"EmptySmallSquare","▫":"EmptyVerySmallSquare"," ":"emsp13"," ":"emsp14"," ":"emsp","Ŋ":"ENG","ŋ":"eng"," ":"ensp","Ę":"Eogon","ę":"eogon","𝔼":"Eopf","𝕖":"eopf","⋕":"epar","⧣":"eparsl","⩱":"eplus","ε":"epsi","Ε":"Epsilon","ϵ":"epsiv","≂":"esim","⩵":"Equal","=":"equals","≟":"equest","⇌":"rlhar","⩸":"equivDD","⧥":"eqvparsl","⥱":"erarr","≓":"erDot","ℯ":"escr","ℰ":"Escr","⩳":"Esim","Η":"Eta","η":"eta","Ð":"ETH","ð":"eth","Ë":"Euml","ë":"euml","€":"euro","!":"excl","∃":"exist","Ф":"Fcy","ф":"fcy","♀":"female","ffi":"ffilig","ff":"fflig","ffl":"ffllig","𝔉":"Ffr","𝔣":"ffr","fi":"filig","◼":"FilledSmallSquare",fj:"fjlig","♭":"flat","fl":"fllig","▱":"fltns","ƒ":"fnof","𝔽":"Fopf","𝕗":"fopf","∀":"forall","⋔":"fork","⫙":"forkv","ℱ":"Fscr","⨍":"fpartint","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","⅔":"frac23","⅖":"frac25","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","⁄":"frasl","⌢":"frown","𝒻":"fscr","ǵ":"gacute","Γ":"Gamma","γ":"gamma","Ϝ":"Gammad","⪆":"gap","Ğ":"Gbreve","ğ":"gbreve","Ģ":"Gcedil","Ĝ":"Gcirc","ĝ":"gcirc","Г":"Gcy","г":"gcy","Ġ":"Gdot","ġ":"gdot","≥":"ge","≧":"gE","⪌":"gEl","⋛":"gel","⩾":"ges","⪩":"gescc","⪀":"gesdot","⪂":"gesdoto","⪄":"gesdotol","⋛︀":"gesl","⪔":"gesles","𝔊":"Gfr","𝔤":"gfr","≫":"gg","⋙":"Gg","ℷ":"gimel","Ѓ":"GJcy","ѓ":"gjcy","⪥":"gla","≷":"gl","⪒":"glE","⪤":"glj","⪊":"gnap","⪈":"gne","≩":"gnE","⋧":"gnsim","𝔾":"Gopf","𝕘":"gopf","⪢":"GreaterGreater","≳":"gsim","𝒢":"Gscr","ℊ":"gscr","⪎":"gsime","⪐":"gsiml","⪧":"gtcc","⩺":"gtcir",">":"gt","⋗":"gtdot","⦕":"gtlPar","⩼":"gtquest","⥸":"gtrarr","≩︀":"gvnE"," ":"hairsp","ℋ":"Hscr","Ъ":"HARDcy","ъ":"hardcy","⥈":"harrcir","↔":"harr","↭":"harrw","^":"Hat","ℏ":"hbar","Ĥ":"Hcirc","ĥ":"hcirc","♥":"hearts","…":"mldr","⊹":"hercon","𝔥":"hfr","ℌ":"Hfr","⤥":"searhk","⤦":"swarhk","⇿":"hoarr","∻":"homtht","↩":"larrhk","↪":"rarrhk","𝕙":"hopf","ℍ":"Hopf","―":"horbar","𝒽":"hscr","Ħ":"Hstrok","ħ":"hstrok","⁃":"hybull","Í":"Iacute","í":"iacute","⁣":"ic","Î":"Icirc","î":"icirc","И":"Icy","и":"icy","İ":"Idot","Е":"IEcy","е":"iecy","¡":"iexcl","𝔦":"ifr","ℑ":"Im","Ì":"Igrave","ì":"igrave","ⅈ":"ii","⨌":"qint","∭":"tint","⧜":"iinfin","℩":"iiota","IJ":"IJlig","ij":"ijlig","Ī":"Imacr","ī":"imacr","ℐ":"Iscr","ı":"imath","⊷":"imof","Ƶ":"imped","℅":"incare","∞":"infin","⧝":"infintie","⊺":"intcal","∫":"int","∬":"Int","ℤ":"Zopf","⨗":"intlarhk","⨼":"iprod","⁢":"it","Ё":"IOcy","ё":"iocy","Į":"Iogon","į":"iogon","𝕀":"Iopf","𝕚":"iopf","Ι":"Iota","ι":"iota","¿":"iquest","𝒾":"iscr","⋵":"isindot","⋹":"isinE","⋴":"isins","⋳":"isinsv","Ĩ":"Itilde","ĩ":"itilde","І":"Iukcy","і":"iukcy","Ï":"Iuml","ï":"iuml","Ĵ":"Jcirc","ĵ":"jcirc","Й":"Jcy","й":"jcy","𝔍":"Jfr","𝔧":"jfr","ȷ":"jmath","𝕁":"Jopf","𝕛":"jopf","𝒥":"Jscr","𝒿":"jscr","Ј":"Jsercy","ј":"jsercy","Є":"Jukcy","є":"jukcy","Κ":"Kappa","κ":"kappa","ϰ":"kappav","Ķ":"Kcedil","ķ":"kcedil","К":"Kcy","к":"kcy","𝔎":"Kfr","𝔨":"kfr","ĸ":"kgreen","Х":"KHcy","х":"khcy","Ќ":"KJcy","ќ":"kjcy","𝕂":"Kopf","𝕜":"kopf","𝒦":"Kscr","𝓀":"kscr","⇚":"lAarr","Ĺ":"Lacute","ĺ":"lacute","⦴":"laemptyv","ℒ":"Lscr","Λ":"Lambda","λ":"lambda","⟨":"lang","⟪":"Lang","⦑":"langd","⪅":"lap","«":"laquo","⇤":"larrb","⤟":"larrbfs","←":"larr","↞":"Larr","⤝":"larrfs","↫":"larrlp","⤹":"larrpl","⥳":"larrsim","↢":"larrtl","⤙":"latail","⤛":"lAtail","⪫":"lat","⪭":"late","⪭︀":"lates","⤌":"lbarr","⤎":"lBarr","❲":"lbbrk","{":"lcub","[":"lsqb","⦋":"lbrke","⦏":"lbrksld","⦍":"lbrkslu","Ľ":"Lcaron","ľ":"lcaron", +"Ļ":"Lcedil","ļ":"lcedil","⌈":"lceil","Л":"Lcy","л":"lcy","⤶":"ldca","“":"ldquo","⥧":"ldrdhar","⥋":"ldrushar","↲":"ldsh","≤":"le","≦":"lE","⇆":"lrarr","⟦":"lobrk","⥡":"LeftDownTeeVector","⥙":"LeftDownVectorBar","⌊":"lfloor","↼":"lharu","⇇":"llarr","⇋":"lrhar","⥎":"LeftRightVector","↤":"mapstoleft","⥚":"LeftTeeVector","⋋":"lthree","⧏":"LeftTriangleBar","⊲":"vltri","⊴":"ltrie","⥑":"LeftUpDownVector","⥠":"LeftUpTeeVector","⥘":"LeftUpVectorBar","↿":"uharl","⥒":"LeftVectorBar","⪋":"lEg","⋚":"leg","⩽":"les","⪨":"lescc","⩿":"lesdot","⪁":"lesdoto","⪃":"lesdotor","⋚︀":"lesg","⪓":"lesges","⋖":"ltdot","≶":"lg","⪡":"LessLess","≲":"lsim","⥼":"lfisht","𝔏":"Lfr","𝔩":"lfr","⪑":"lgE","⥢":"lHar","⥪":"lharul","▄":"lhblk","Љ":"LJcy","љ":"ljcy","≪":"ll","⋘":"Ll","⥫":"llhard","◺":"lltri","Ŀ":"Lmidot","ŀ":"lmidot","⎰":"lmoust","⪉":"lnap","⪇":"lne","≨":"lnE","⋦":"lnsim","⟬":"loang","⇽":"loarr","⟵":"xlarr","⟷":"xharr","⟼":"xmap","⟶":"xrarr","↬":"rarrlp","⦅":"lopar","𝕃":"Lopf","𝕝":"lopf","⨭":"loplus","⨴":"lotimes","∗":"lowast",_:"lowbar","↙":"swarr","↘":"searr","◊":"loz","(":"lpar","⦓":"lparlt","⥭":"lrhard","‎":"lrm","⊿":"lrtri","‹":"lsaquo","𝓁":"lscr","↰":"lsh","⪍":"lsime","⪏":"lsimg","‘":"lsquo","‚":"sbquo","Ł":"Lstrok","ł":"lstrok","⪦":"ltcc","⩹":"ltcir","<":"lt","⋉":"ltimes","⥶":"ltlarr","⩻":"ltquest","◃":"ltri","⦖":"ltrPar","⥊":"lurdshar","⥦":"luruhar","≨︀":"lvnE","¯":"macr","♂":"male","✠":"malt","⤅":"Map","↦":"map","↥":"mapstoup","▮":"marker","⨩":"mcomma","М":"Mcy","м":"mcy","—":"mdash","∺":"mDDot"," ":"MediumSpace","ℳ":"Mscr","𝔐":"Mfr","𝔪":"mfr","℧":"mho","µ":"micro","⫰":"midcir","∣":"mid","−":"minus","⨪":"minusdu","∓":"mp","⫛":"mlcp","⊧":"models","𝕄":"Mopf","𝕞":"mopf","𝓂":"mscr","Μ":"Mu","μ":"mu","⊸":"mumap","Ń":"Nacute","ń":"nacute","∠⃒":"nang","≉":"nap","⩰̸":"napE","≋̸":"napid","ʼn":"napos","♮":"natur","ℕ":"Nopf"," ":"nbsp","≎̸":"nbump","≏̸":"nbumpe","⩃":"ncap","Ň":"Ncaron","ň":"ncaron","Ņ":"Ncedil","ņ":"ncedil","≇":"ncong","⩭̸":"ncongdot","⩂":"ncup","Н":"Ncy","н":"ncy","–":"ndash","⤤":"nearhk","↗":"nearr","⇗":"neArr","≠":"ne","≐̸":"nedot","​":"ZeroWidthSpace","≢":"nequiv","⤨":"toea","≂̸":"nesim","\n":"NewLine","∄":"nexist","𝔑":"Nfr","𝔫":"nfr","≧̸":"ngE","≱":"nge","⩾̸":"nges","⋙̸":"nGg","≵":"ngsim","≫⃒":"nGt","≯":"ngt","≫̸":"nGtv","↮":"nharr","⇎":"nhArr","⫲":"nhpar","∋":"ni","⋼":"nis","⋺":"nisd","Њ":"NJcy","њ":"njcy","↚":"nlarr","⇍":"nlArr","‥":"nldr","≦̸":"nlE","≰":"nle","⩽̸":"nles","≮":"nlt","⋘̸":"nLl","≴":"nlsim","≪⃒":"nLt","⋪":"nltri","⋬":"nltrie","≪̸":"nLtv","∤":"nmid","⁠":"NoBreak","𝕟":"nopf","⫬":"Not","¬":"not","≭":"NotCupCap","∦":"npar","∉":"notin","≹":"ntgl","⋵̸":"notindot","⋹̸":"notinE","⋷":"notinvb","⋶":"notinvc","⧏̸":"NotLeftTriangleBar","≸":"ntlg","⪢̸":"NotNestedGreaterGreater","⪡̸":"NotNestedLessLess","∌":"notni","⋾":"notnivb","⋽":"notnivc","⊀":"npr","⪯̸":"npre","⋠":"nprcue","⧐̸":"NotRightTriangleBar","⋫":"nrtri","⋭":"nrtrie","⊏̸":"NotSquareSubset","⋢":"nsqsube","⊐̸":"NotSquareSuperset","⋣":"nsqsupe","⊂⃒":"vnsub","⊈":"nsube","⊁":"nsc","⪰̸":"nsce","⋡":"nsccue","≿̸":"NotSucceedsTilde","⊃⃒":"vnsup","⊉":"nsupe","≁":"nsim","≄":"nsime","⫽⃥":"nparsl","∂̸":"npart","⨔":"npolint","⤳̸":"nrarrc","↛":"nrarr","⇏":"nrArr","↝̸":"nrarrw","𝒩":"Nscr","𝓃":"nscr","⊄":"nsub","⫅̸":"nsubE","⊅":"nsup","⫆̸":"nsupE","Ñ":"Ntilde","ñ":"ntilde","Ν":"Nu","ν":"nu","#":"num","№":"numero"," ":"numsp","≍⃒":"nvap","⊬":"nvdash","⊭":"nvDash","⊮":"nVdash","⊯":"nVDash","≥⃒":"nvge",">⃒":"nvgt","⤄":"nvHarr","⧞":"nvinfin","⤂":"nvlArr","≤⃒":"nvle","<⃒":"nvlt","⊴⃒":"nvltrie","⤃":"nvrArr","⊵⃒":"nvrtrie","∼⃒":"nvsim","⤣":"nwarhk","↖":"nwarr","⇖":"nwArr","⤧":"nwnear","Ó":"Oacute","ó":"oacute","Ô":"Ocirc","ô":"ocirc","О":"Ocy","о":"ocy","Ő":"Odblac","ő":"odblac","⨸":"odiv","⦼":"odsold","Œ":"OElig","œ":"oelig","⦿":"ofcir","𝔒":"Ofr","𝔬":"ofr","˛":"ogon","Ò":"Ograve","ò":"ograve","⧁":"ogt","⦵":"ohbar","Ω":"ohm","⦾":"olcir","⦻":"olcross","‾":"oline","⧀":"olt","Ō":"Omacr","ō":"omacr","ω":"omega","Ο":"Omicron","ο":"omicron","⦶":"omid","𝕆":"Oopf","𝕠":"oopf","⦷":"opar","⦹":"operp","⩔":"Or","∨":"or","⩝":"ord","ℴ":"oscr","ª":"ordf","º":"ordm","⊶":"origof","⩖":"oror","⩗":"orslope","⩛":"orv","𝒪":"Oscr","Ø":"Oslash","ø":"oslash","⊘":"osol","Õ":"Otilde","õ":"otilde","⨶":"otimesas","⨷":"Otimes","Ö":"Ouml","ö":"ouml","⌽":"ovbar","⏞":"OverBrace","⎴":"tbrk","⏜":"OverParenthesis","¶":"para","⫳":"parsim","⫽":"parsl","∂":"part","П":"Pcy","п":"pcy","%":"percnt",".":"period","‰":"permil","‱":"pertenk","𝔓":"Pfr","𝔭":"pfr","Φ":"Phi","φ":"phi","ϕ":"phiv","☎":"phone","Π":"Pi","π":"pi","ϖ":"piv","ℎ":"planckh","⨣":"plusacir","⨢":"pluscir","+":"plus","⨥":"plusdu","⩲":"pluse","±":"pm","⨦":"plussim","⨧":"plustwo","⨕":"pointint","𝕡":"popf","ℙ":"Popf","£":"pound","⪷":"prap","⪻":"Pr","≺":"pr","≼":"prcue","⪯":"pre","≾":"prsim","⪹":"prnap","⪵":"prnE","⋨":"prnsim","⪳":"prE","′":"prime","″":"Prime","∏":"prod","⌮":"profalar","⌒":"profline","⌓":"profsurf","∝":"prop","⊰":"prurel","𝒫":"Pscr","𝓅":"pscr","Ψ":"Psi","ψ":"psi"," ":"puncsp","𝔔":"Qfr","𝔮":"qfr","𝕢":"qopf","ℚ":"Qopf","⁗":"qprime","𝒬":"Qscr","𝓆":"qscr","⨖":"quatint","?":"quest",'"':"quot","⇛":"rAarr","∽̱":"race","Ŕ":"Racute","ŕ":"racute","√":"Sqrt","⦳":"raemptyv","⟩":"rang","⟫":"Rang","⦒":"rangd","⦥":"range","»":"raquo","⥵":"rarrap","⇥":"rarrb","⤠":"rarrbfs","⤳":"rarrc","→":"rarr","↠":"Rarr","⤞":"rarrfs","⥅":"rarrpl","⥴":"rarrsim","⤖":"Rarrtl","↣":"rarrtl","↝":"rarrw","⤚":"ratail","⤜":"rAtail","∶":"ratio","❳":"rbbrk","}":"rcub","]":"rsqb","⦌":"rbrke","⦎":"rbrksld","⦐":"rbrkslu","Ř":"Rcaron","ř":"rcaron","Ŗ":"Rcedil","ŗ":"rcedil","⌉":"rceil","Р":"Rcy","р":"rcy","⤷":"rdca","⥩":"rdldhar","↳":"rdsh","ℜ":"Re","ℛ":"Rscr","ℝ":"Ropf","▭":"rect","⥽":"rfisht","⌋":"rfloor","𝔯":"rfr","⥤":"rHar","⇀":"rharu","⥬":"rharul","Ρ":"Rho","ρ":"rho","ϱ":"rhov","⇄":"rlarr","⟧":"robrk","⥝":"RightDownTeeVector","⥕":"RightDownVectorBar","⇉":"rrarr","⊢":"vdash","⥛":"RightTeeVector","⋌":"rthree","⧐":"RightTriangleBar","⊳":"vrtri","⊵":"rtrie","⥏":"RightUpDownVector","⥜":"RightUpTeeVector","⥔":"RightUpVectorBar","↾":"uharr","⥓":"RightVectorBar","˚":"ring","‏":"rlm","⎱":"rmoust","⫮":"rnmid","⟭":"roang","⇾":"roarr","⦆":"ropar","𝕣":"ropf","⨮":"roplus","⨵":"rotimes","⥰":"RoundImplies",")":"rpar","⦔":"rpargt","⨒":"rppolint","›":"rsaquo","𝓇":"rscr","↱":"rsh","⋊":"rtimes","▹":"rtri","⧎":"rtriltri","⧴":"RuleDelayed","⥨":"ruluhar","℞":"rx","Ś":"Sacute","ś":"sacute","⪸":"scap","Š":"Scaron","š":"scaron","⪼":"Sc","≻":"sc","≽":"sccue","⪰":"sce","⪴":"scE","Ş":"Scedil","ş":"scedil","Ŝ":"Scirc","ŝ":"scirc","⪺":"scnap","⪶":"scnE","⋩":"scnsim","⨓":"scpolint","≿":"scsim","С":"Scy","с":"scy","⋅":"sdot","⩦":"sdote","⇘":"seArr","§":"sect",";":"semi","⤩":"tosa","✶":"sext","𝔖":"Sfr","𝔰":"sfr","♯":"sharp","Щ":"SHCHcy","щ":"shchcy","Ш":"SHcy","ш":"shcy","↑":"uarr","­":"shy","Σ":"Sigma","σ":"sigma","ς":"sigmaf","∼":"sim","⩪":"simdot","≃":"sime","⪞":"simg","⪠":"simgE","⪝":"siml","⪟":"simlE","≆":"simne","⨤":"simplus","⥲":"simrarr","⨳":"smashp","⧤":"smeparsl","⌣":"smile","⪪":"smt","⪬":"smte","⪬︀":"smtes","Ь":"SOFTcy","ь":"softcy","⌿":"solbar","⧄":"solb","/":"sol","𝕊":"Sopf","𝕤":"sopf","♠":"spades","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊏":"sqsub","⊑":"sqsube","⊐":"sqsup","⊒":"sqsupe","□":"squ","𝒮":"Sscr","𝓈":"sscr","⋆":"Star","☆":"star","⊂":"sub","⋐":"Sub","⪽":"subdot","⫅":"subE","⊆":"sube","⫃":"subedot","⫁":"submult","⫋":"subnE","⊊":"subne","⪿":"subplus","⥹":"subrarr","⫇":"subsim","⫕":"subsub","⫓":"subsup","∑":"sum","♪":"sung","¹":"sup1","²":"sup2","³":"sup3","⊃":"sup","⋑":"Sup","⪾":"supdot","⫘":"supdsub","⫆":"supE","⊇":"supe","⫄":"supedot","⟉":"suphsol","⫗":"suphsub","⥻":"suplarr","⫂":"supmult","⫌":"supnE","⊋":"supne","⫀":"supplus","⫈":"supsim","⫔":"supsub","⫖":"supsup","⇙":"swArr","⤪":"swnwar","ß":"szlig"," ":"Tab","⌖":"target","Τ":"Tau","τ":"tau","Ť":"Tcaron","ť":"tcaron","Ţ":"Tcedil","ţ":"tcedil","Т":"Tcy","т":"tcy","⃛":"tdot","⌕":"telrec","𝔗":"Tfr","𝔱":"tfr","∴":"there4","Θ":"Theta","θ":"theta","ϑ":"thetav","  ":"ThickSpace"," ":"thinsp","Þ":"THORN","þ":"thorn","⨱":"timesbar","×":"times","⨰":"timesd","⌶":"topbot","⫱":"topcir","𝕋":"Topf","𝕥":"topf","⫚":"topfork","‴":"tprime","™":"trade","▵":"utri","≜":"trie","◬":"tridot","⨺":"triminus","⨹":"triplus","⧍":"trisb","⨻":"tritime","⏢":"trpezium","𝒯":"Tscr","𝓉":"tscr","Ц":"TScy","ц":"tscy","Ћ":"TSHcy","ћ":"tshcy","Ŧ":"Tstrok","ŧ":"tstrok","Ú":"Uacute","ú":"uacute","↟":"Uarr","⥉":"Uarrocir","Ў":"Ubrcy","ў":"ubrcy","Ŭ":"Ubreve","ŭ":"ubreve","Û":"Ucirc","û":"ucirc","У":"Ucy","у":"ucy","⇅":"udarr","Ű":"Udblac","ű":"udblac","⥮":"udhar","⥾":"ufisht","𝔘":"Ufr","𝔲":"ufr","Ù":"Ugrave","ù":"ugrave","⥣":"uHar","▀":"uhblk","⌜":"ulcorn","⌏":"ulcrop","◸":"ultri","Ū":"Umacr","ū":"umacr","⏟":"UnderBrace","⏝":"UnderParenthesis","⊎":"uplus","Ų":"Uogon","ų":"uogon","𝕌":"Uopf","𝕦":"uopf","⤒":"UpArrowBar","↕":"varr","υ":"upsi","ϒ":"Upsi","Υ":"Upsilon","⇈":"uuarr","⌝":"urcorn","⌎":"urcrop","Ů":"Uring","ů":"uring","◹":"urtri","𝒰":"Uscr","𝓊":"uscr","⋰":"utdot","Ũ":"Utilde","ũ":"utilde","Ü":"Uuml","ü":"uuml","⦧":"uwangle","⦜":"vangrt","⊊︀":"vsubne","⫋︀":"vsubnE","⊋︀":"vsupne","⫌︀":"vsupnE","⫨":"vBar","⫫":"Vbar","⫩":"vBarv","В":"Vcy","в":"vcy","⊩":"Vdash","⊫":"VDash","⫦":"Vdashl","⊻":"veebar","≚":"veeeq","⋮":"vellip","|":"vert","‖":"Vert","❘":"VerticalSeparator","≀":"wr","𝔙":"Vfr","𝔳":"vfr","𝕍":"Vopf","𝕧":"vopf","𝒱":"Vscr","𝓋":"vscr","⊪":"Vvdash","⦚":"vzigzag","Ŵ":"Wcirc","ŵ":"wcirc","⩟":"wedbar","≙":"wedgeq","℘":"wp","𝔚":"Wfr","𝔴":"wfr","𝕎":"Wopf","𝕨":"wopf","𝒲":"Wscr","𝓌":"wscr","𝔛":"Xfr","𝔵":"xfr","Ξ":"Xi","ξ":"xi","⋻":"xnis","𝕏":"Xopf","𝕩":"xopf","𝒳":"Xscr","𝓍":"xscr","Ý":"Yacute","ý":"yacute","Я":"YAcy","я":"yacy","Ŷ":"Ycirc","ŷ":"ycirc","Ы":"Ycy","ы":"ycy","¥":"yen","𝔜":"Yfr","𝔶":"yfr","Ї":"YIcy","ї":"yicy","𝕐":"Yopf","𝕪":"yopf","𝒴":"Yscr","𝓎":"yscr","Ю":"YUcy","ю":"yucy","ÿ":"yuml","Ÿ":"Yuml","Ź":"Zacute","ź":"zacute","Ž":"Zcaron","ž":"zcaron","З":"Zcy","з":"zcy","Ż":"Zdot","ż":"zdot","ℨ":"Zfr","Ζ":"Zeta","ζ":"zeta","𝔷":"zfr","Ж":"ZHcy","ж":"zhcy","⇝":"zigrarr","𝕫":"zopf","𝒵":"Zscr","𝓏":"zscr","‍":"zwj","‌":"zwnj"},f=/["&'<>`]/g,d={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},p=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,g=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,m=/&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|iacute|Uacute|plusmn|otilde|Otilde|Agrave|agrave|yacute|Yacute|oslash|Oslash|Atilde|atilde|brvbar|Ccedil|ccedil|ograve|curren|divide|Eacute|eacute|Ograve|oacute|Egrave|egrave|ugrave|frac12|frac14|frac34|Ugrave|Oacute|Iacute|ntilde|Ntilde|uacute|middot|Igrave|igrave|iquest|aacute|laquo|THORN|micro|iexcl|icirc|Icirc|Acirc|ucirc|ecirc|Ocirc|ocirc|Ecirc|Ucirc|aring|Aring|aelig|AElig|acute|pound|raquo|acirc|times|thorn|szlig|cedil|COPY|Auml|ordf|ordm|uuml|macr|Uuml|auml|Ouml|ouml|para|nbsp|Euml|quot|QUOT|euml|yuml|cent|sect|copy|sup1|sup2|sup3|Iuml|iuml|shy|eth|reg|not|yen|amp|AMP|REG|uml|ETH|deg|gt|GT|LT|lt)([=a-zA-Z0-9])?/g,y={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅","in":"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺","int":"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽", +SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"},v={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"},b={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},_=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],x=String.fromCharCode,w={},A=w.hasOwnProperty,E=function(t,e){return A.call(t,e)},k=function(t,e){for(var n=-1,r=t.length;++n=55296&&57343>=t||t>1114111?(e&&M("character reference outside the permissible Unicode range"),"�"):E(b,t)?(e&&M("disallowed character reference"),b[t]):(e&&k(_,t)&&M("disallowed character reference"),t>65535&&(t-=65536,n+=x(t>>>10&1023|55296),t=56320|1023&t),n+=x(t))},S=function(t){return"&#x"+t.charCodeAt(0).toString(16).toUpperCase()+";"},M=function(t){throw Error("Parse error: "+t)},T=function(t,e){e=D(e,T.options);var n=e.strict;n&&g.test(t)&&M("forbidden code point");var r=e.encodeEverything,i=e.useNamedReferences,a=e.allowUnsafeSymbols;return r?(t=t.replace(s,function(t){return i&&E(h,t)?"&"+h[t]+";":S(t)}),i&&(t=t.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),i&&(t=t.replace(l,function(t){return"&"+h[t]+";"}))):i?(a||(t=t.replace(f,function(t){return"&"+h[t]+";"})),t=t.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒"),t=t.replace(l,function(t){return"&"+h[t]+";"})):a||(t=t.replace(f,S)),t.replace(o,function(t){var e=t.charCodeAt(0),n=t.charCodeAt(1),r=1024*(e-55296)+n-56320+65536;return"&#x"+r.toString(16).toUpperCase()+";"}).replace(c,S)};T.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1};var F=function(t,e){e=D(e,F.options);var n=e.strict;return n&&p.test(t)&&M("malformed character reference"),t.replace(m,function(t,r,i,a,u,o,s,c){var l,h,f,d,p;return r?(l=r,h=i,n&&!h&&M("character reference was not terminated by a semicolon"),C(l,n)):a?(f=a,h=u,n&&!h&&M("character reference was not terminated by a semicolon"),l=parseInt(f,16),C(l,n)):o?(d=o,E(y,d)?y[d]:(n&&M("named character reference was not terminated by a semicolon"),t)):(d=s,p=c,p&&e.isAttributeValue?(n&&"="==p&&M("`&` did not start a character reference"),t):(n&&M("named character reference was not terminated by a semicolon"),v[d]+(p||"")))})};F.options={isAttributeValue:!1,strict:!1};var L=function(t){return t.replace(f,function(t){return d[t]})},B={version:"0.5.0",encode:T,decode:F,escape:L,unescape:F};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return B});else if(i&&!i.nodeType)if(a)a.exports=B;else for(var N in B)E(B,N)&&(i[N]=B[N]);else r.he=B}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],82:[function(t,e,n){(function(t){(function(){function r(t,e){if(t!==e){var n=null===t,r=t===k,i=t===t,a=null===e,u=e===k,o=e===e;if(t>e&&!a||!i||n&&!u&&o||r&&o)return 1;if(e>t&&!n||!o||a&&!r&&i||u&&i)return-1}return 0}function i(t,e,n){for(var r=t.length,i=n?r:-1;n?i--:++i-1;);return n}function c(t,e){for(var n=t.length;n--&&e.indexOf(t.charAt(n))>-1;);return n}function l(t,e){return r(t.criteria,e.criteria)||t.index-e.index}function h(t,e,n){for(var i=-1,a=t.criteria,u=e.criteria,o=a.length,s=n.length;++i=s)return c;var l=n[i];return c*("asc"===l||l===!0?1:-1)}}return t.index-e.index}function f(t){return zt[t]}function d(t){return $t[t]}function p(t,e,n){return e?t=Wt[t]:n&&(t=Zt[t]),"\\"+t}function g(t){return"\\"+Zt[t]}function m(t,e,n){for(var r=t.length,i=e+(n?0:-1);n?i--:++i=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function b(t,e){for(var n=-1,r=t.length,i=-1,a=[];++ne,i=n?t.length:0,a=Hn(0,i,this.__views__),u=a.start,o=a.end,s=o-u,c=r?o:u-1,l=this.__iteratees__,h=l.length,f=0,d=wu(s,this.__takeCount__);if(!n||j>i||i==s&&d==s)return nn(r&&n?t.reverse():t,this.__actions__);var p=[];t:for(;s--&&d>f;){c+=e;for(var g=-1,m=t[c];++g=j?gn(e):null,c=e.length;s&&(u=Jt,o=!1,e=s);t:for(;++in&&(n=-n>i?0:i+n),r=r===k||r>i?i:+r||0,0>r&&(r+=i),i=n>r?0:r>>>0,n>>>=0;i>n;)t[n++]=e;return t}function Ce(t,e){var n=[];return Iu(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function Se(t,e,n,r){var i;return n(t,function(t,n,a){return e(t,n,a)?(i=r?n:t,!1):void 0}),i}function Me(t,e,n,r){r||(r=[]);for(var i=-1,a=t.length;++ir;)t=t[e[r++]];return r&&r==i?t:k}}function Ie(t,e,n,r,i,a){return t===e?!0:null==t||null==e||!Ni(t)&&!y(e)?t!==t&&e!==e:Oe(t,e,Ie,n,r,i,a)}function Oe(t,e,n,r,i,a,u){var o=Mo(t),s=Mo(e),c=H,l=H;o||(c=nu.call(t),c==$?c=Q:c!=Q&&(o=Vi(t))),s||(l=nu.call(e),l==$?l=Q:l!=Q&&(s=Vi(e)));var h=c==Q,f=l==Q,d=c==l;if(d&&!o&&!h)return qn(t,e,c);if(!i){var p=h&&tu.call(t,"__wrapped__"),g=f&&tu.call(e,"__wrapped__");if(p||g)return n(p?t.value():t,g?e.value():e,r,i,a,u)}if(!d)return!1;a||(a=[]),u||(u=[]);for(var m=a.length;m--;)if(a[m]==t)return u[m]==e;a.push(t),u.push(e);var y=(o?Pn:jn)(t,e,n,r,i,a,u);return a.pop(),u.pop(),y}function Re(t,e,n){var r=e.length,i=r,a=!n;if(null==t)return!i;for(t=hr(t);r--;){var u=e[r];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++re&&(e=-e>i?0:i+e),n=n===k||n>i?i:+n||0,0>n&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=ja(i);++r=j,s=o?gn():null,c=[];s?(r=Jt,u=!1):(o=!1,s=e?[]:c);t:for(;++n=i){for(;i>r;){var a=r+i>>>1,u=t[a];(n?e>=u:e>u)&&null!==u?r=a+1:i=a}return i}return an(t,e,Ca,n)}function an(t,e,n,r){e=n(e);for(var i=0,a=t?t.length:0,u=e!==e,o=null===e,s=e===k;a>i;){var c=yu((i+a)/2),l=n(t[c]),h=l!==k,f=l===l;if(u)var d=f||r;else d=o?f&&h&&(r||null!=l):s?f&&(r||h):null==l?!1:r?e>=l:e>l;d?i=c+1:a=c}return wu(a,Mu)}function un(t,e,n){if("function"!=typeof t)return Ca;if(e===k)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,a){return t.call(e,n,r,i,a)};case 5:return function(n,r,i,a,u){return t.call(e,n,r,i,a,u)}}return function(){return t.apply(e,arguments)}}function on(t){var e=new au(t.byteLength),n=new du(e);return n.set(new du(t)),e}function sn(t,e,n){for(var r=n.length,i=-1,a=xu(t.length-r,0),u=-1,o=e.length,s=ja(o+a);++u2?n[i-2]:k,u=i>2?n[2]:k,o=i>1?n[i-1]:k;for("function"==typeof a?(a=un(a,o,5),i-=2):(a="function"==typeof o?o:k,i-=a?1:0),u&&Qn(n[0],n[1],u)&&(a=3>i?k:a,i=1);++r-1?n[u]:k}return Se(n,r,t)}}function wn(t){return function(e,n,r){return e&&e.length?(n=Un(n,r,3),i(e,n,t)):-1}}function An(t){return function(e,n,r){return n=Un(n,r,3),Se(e,n,t,!0)}}function En(t){return function(){for(var e,n=arguments.length,r=t?n:-1,i=0,a=ja(n);t?r--:++r=j)return e.plant(r).value();for(var i=0,u=n?a[i].apply(this,t):r;++iv){var E=o?te(o):k,D=xu(c-v,0),M=p?A:k,T=p?k:A,F=p?x:k,N=p?k:x;e|=p?L:B,e&=~(p?B:L),g||(e&=~(C|S));var I=[t,e,n,F,M,N,T,E,s,D],O=Ln.apply(k,I);return er(t)&&Yu(O,I),O.placeholder=w,O}}var R=f?n:this,P=d?R[t]:t;return o&&(x=sr(x,o)),h&&s=e||!bu(e))return"";var i=e-r;return n=null==n?" ":n+"",ma(n,gu(i/n.length)).slice(0,i)}function Nn(t,e,n,r){function i(){for(var e=-1,o=arguments.length,s=-1,c=r.length,l=ja(c+o);++ss))return!1;for(;++o-1&&t%1==0&&e>t}function Qn(t,e,n){if(!Ni(n))return!1;var r=typeof e;if("number"==r?Jn(n)&&Kn(e,n.length):"string"==r&&e in n){var i=n[e];return t===t?t===i:i!==i}return!1}function tr(t,e){var n=typeof t;if("string"==n&&kt.test(t)||"number"==n)return!0;if(Mo(t))return!1;var r=!Et.test(t);return r||null!=e&&t in hr(e)}function er(t){var n=Yn(t);if(!(n in J.prototype))return!1;var r=e[n];if(t===r)return!0;var i=ju(r);return!!i&&t===i[0]}function nr(t){return"number"==typeof t&&t>-1&&t%1==0&&Fu>=t}function rr(t){return t===t&&!Ni(t)}function ir(t,e){var n=t[1],r=e[1],i=n|r,a=N>i,u=r==N&&n==T||r==N&&n==I&&t[7].length<=e[8]||r==(N|I)&&n==T;if(!a&&!u)return t;r&C&&(t[2]=e[2],i|=n&C?0:M);var o=e[3];if(o){var s=t[3];t[3]=s?sn(s,o,e[4]):te(o),t[4]=s?b(t[3],z):te(e[4])}return o=e[5],o&&(s=t[5],t[5]=s?cn(s,o,e[6]):te(o),t[6]=s?b(t[5],z):te(e[6])),o=e[7],o&&(t[7]=te(o)),r&N&&(t[8]=null==t[8]?e[8]:wu(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}function ar(t,e){return t===k?e:To(t,e,ar)}function ur(t,e){t=hr(t);for(var n=-1,r=e.length,i={};++nr;)u[++a]=We(t,r,r+=e);return u}function gr(t){for(var e=-1,n=t?t.length:0,r=-1,i=[];++ee?0:e)):[]}function yr(t,e,n){var r=t?t.length:0;return r?((n?Qn(t,e,n):null==e)&&(e=1),e=r-(+e||0),We(t,0,0>e?0:e)):[]}function vr(t,e,n){return t&&t.length?en(t,Un(e,n,3),!0,!0):[]}function br(t,e,n){return t&&t.length?en(t,Un(e,n,3),!0):[]}function _r(t,e,n,r){var i=t?t.length:0;return i?(n&&"number"!=typeof n&&Qn(t,e,n)&&(n=0,r=i),De(t,e,n,r)):[]}function xr(t){return t?t[0]:k}function wr(t,e,n){var r=t?t.length:0;return n&&Qn(t,e,n)&&(e=!1),r?Me(t,e):[]}function Ar(t){var e=t?t.length:0;return e?Me(t,!0):[]}function Er(t,e,n){var r=t?t.length:0;if(!r)return-1;if("number"==typeof n)n=0>n?xu(r+n,0):n;else if(n){var i=rn(t,e);return r>i&&(e===e?e===t[i]:t[i]!==t[i])?i:-1}return a(t,e,n||0)}function kr(t){return yr(t,1)}function Dr(t){var e=t?t.length:0;return e?t[e-1]:k}function Cr(t,e,n){var r=t?t.length:0;if(!r)return-1;var i=r;if("number"==typeof n)i=(0>n?xu(r+n,0):wu(n||0,r-1))+1;else if(n){i=rn(t,e,!0)-1;var a=t[i];return(e===e?e===a:a!==a)?i:-1}if(e!==e)return m(t,i,!0);for(;i--;)if(t[i]===e)return i;return-1}function Sr(){var t=arguments,e=t[0];if(!e||!e.length)return e;for(var n=0,r=Vn(),i=t.length;++n-1;)fu.call(e,a,1);return e}function Mr(t,e,n){var r=[];if(!t||!t.length)return r;var i=-1,a=[],u=t.length;for(e=Un(e,n,3);++ie?0:e)):[]}function Br(t,e,n){var r=t?t.length:0;return r?((n?Qn(t,e,n):null==e)&&(e=1),e=r-(+e||0),We(t,0>e?0:e)):[]}function Nr(t,e,n){return t&&t.length?en(t,Un(e,n,3),!1,!0):[]}function Ir(t,e,n){return t&&t.length?en(t,Un(e,n,3)):[]}function Or(t,e,n,r){var i=t?t.length:0;if(!i)return[];null!=e&&"boolean"!=typeof e&&(r=n,n=Qn(t,e,r)?k:e,e=!1);var u=Un();return(null!=n||u!==_e)&&(n=u(n,r,3)),e&&Vn()==a?_(t,n):Qe(t,n)}function Rr(t){if(!t||!t.length)return[];var e=-1,n=0;t=oe(t,function(t){return Jn(t)?(n=xu(t.length,n),!0):void 0});for(var r=ja(n);++ey?(y-m)/g:(y+m)/g,y=u*c-a*l,b=0>y?(y-m)/g:(y+m)/g,{x:v,y:b})}function r(t,e){return t*e>0}e.exports=n},{}],18:[function(t,e){function n(t,e){return t.intersect(e)}e.exports=n},{}],19:[function(t,e){function n(t,e,n){var i=t.x,a=t.y,u=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;e.forEach(function(t){o=Math.min(o,t.x),s=Math.min(s,t.y)});for(var c=i-t.width/2-o,l=a-t.height/2-s,h=0;h1&&u.sort(function(t,e){var r=t.x-n.x,i=t.y-n.y,a=Math.sqrt(r*r+i*i),u=e.x-n.x,o=e.y-n.y,s=Math.sqrt(u*u+o*o);return s>a?-1:a===s?0:1}),u[0]):(console.log("NO INTERSECTION FOUND, RETURN NODE CENTER",t),t)}var r=t("./intersect-line");e.exports=n},{"./intersect-line":17}],20:[function(t,e){function n(t,e){var n,r,i=t.x,a=t.y,u=e.x-i,o=e.y-a,s=t.width/2,c=t.height/2;return Math.abs(o)*s>Math.abs(u)*c?(0>o&&(c=-c),n=0===o?0:c*u/o,r=c):(0>u&&(s=-s),n=s,r=0===u?0:s*o/u),{x:i+n,y:a+r}}e.exports=n},{}],21:[function(t,e){function n(t,e){var n=t.append("foreignObject").attr("width","100000"),i=n.append("xhtml:div"),a=e.label;switch(typeof a){case"function":i.insert(a);break;case"object":i.insert(function(){return a});break;default:i.html(a)}r.applyStyle(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap");var u,o;return i.each(function(){u=this.clientWidth,o=this.clientHeight}),n.attr("width",u).attr("height",o),n}var r=t("../util");e.exports=n},{"../util":31}],22:[function(t,e){function n(t,e,n){var u=e.label,o=t.append("g");"svg"===e.labelType?a(o,e):"string"!=typeof u||"html"===e.labelType?i(o,e):r(o,e);var s,c=o.node().getBBox();switch(n){case"top":s=-e.height/2;break;case"bottom":s=e.height/2-c.height;break;default:s=-c.height/2}return o.attr("transform","translate("+-c.width/2+","+s+")"),o}var r=t("./add-text-label"),i=t("./add-html-label"),a=t("./add-svg-label");e.exports=n},{"./add-html-label":21,"./add-svg-label":23,"./add-text-label":24}],23:[function(t,e){function n(t,e){var n=t;return n.node().appendChild(e.label),r.applyStyle(n,e.labelStyle),n}var r=t("../util");e.exports=n},{"../util":31}],24:[function(t,e){function n(t,e){for(var n=t.append("text"),a=r(e.label).split("\n"),u=0;ua)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+a);c0&&(i=s.removeMin(),u=o[i],u.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(c);return o}var i=t("../lodash"),a=t("../data/priority-queue");e.exports=n;var u=i.constant(1)},{"../data/priority-queue":47,"../lodash":51}],38:[function(t,e){function n(t){return r.filter(i(t),function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})}var r=t("../lodash"),i=t("./tarjan");e.exports=n},{"../lodash":51,"./tarjan":45}],39:[function(t,e){function n(t,e,n){return r(t,e||a,n||function(e){return t.outEdges(e)})}function r(t,e,n){var r={},i=t.nodes();return i.forEach(function(t){r[t]={},r[t][t]={distance:0},i.forEach(function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})}),n(t).forEach(function(n){var i=n.v===t?n.w:n.v,a=e(n);r[t][i]={distance:a,predecessor:t}})}),i.forEach(function(t){var e=r[t];i.forEach(function(n){var a=r[n];i.forEach(function(n){var r=a[t],i=e[n],u=a[n],o=r.distance+i.distance;oi&&(s[n]=u,c.decrease(n,i))}}var u,o=new i,s={},c=new a;if(0===t.nodeCount())return o;r.each(t.nodes(),function(t){c.add(t,Number.POSITIVE_INFINITY),o.setNode(t)}),c.decrease(t.nodes()[0],0);for(var l=!1;c.size()>0;){if(u=c.removeMin(),r.has(s,u))o.setEdge(u,s[u]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(u).forEach(n)}return o}var r=t("../lodash"),i=t("../graph"),a=t("../data/priority-queue");e.exports=n},{"../data/priority-queue":47,"../graph":48,"../lodash":51}],45:[function(t,e){function n(t){function e(o){var s=a[o]={onStack:!0,lowlink:n,index:n++};if(i.push(o),t.successors(o).forEach(function(t){r.has(a,t)?a[t].onStack&&(s.lowlink=Math.min(s.lowlink,a[t].index)):(e(t),s.lowlink=Math.min(s.lowlink,a[t].lowlink))}),s.lowlink===s.index){var c,l=[];do c=i.pop(),a[c].onStack=!1,l.push(c);while(o!==c);u.push(l)}}var n=0,i=[],a={},u=[];return t.nodes().forEach(function(t){r.has(a,t)||e(t)}),u}var r=t("../lodash");e.exports=n},{"../lodash":51}],46:[function(t,e){function n(t){function e(o){if(i.has(a,o))throw new r;i.has(n,o)||(a[o]=!0,n[o]=!0,i.each(t.predecessors(o),e),delete a[o],u.push(o))}var n={},a={},u=[];if(i.each(t.sinks(),e),i.size(n)!==t.nodeCount())throw new r;return u}function r(){}var i=t("../lodash");e.exports=n,n.CycleException=r},{"../lodash":51}],47:[function(t,e){function n(){this._arr=[],this._keyIndices={}}var r=t("../lodash");e.exports=n,n.prototype.size=function(){return this._arr.length},n.prototype.keys=function(){return this._arr.map(function(t){return t.key})},n.prototype.has=function(t){return r.has(this._keyIndices,t)},n.prototype.priority=function(t){var e=this._keyIndices[t];return void 0!==e?this._arr[e].priority:void 0},n.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},n.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,a=i.length;return n[t]=a,i.push({key:t,priority:e}),this._decrease(a),!0}return!1},n.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},n.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},n.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n>1,!(n[e].prioritya){var u=i;i=a,a=u}return i+h+a+h+(s.isUndefined(r)?c:r)}function u(t,e,n,r){var i=""+e,a=""+n;if(!t&&i>a){var u=i;i=a,a=u}var o={v:i,w:a};return r&&(o.name=r),o}function o(t,e){return a(t,e.v,e.w,e.name)}var s=t("./lodash");e.exports=n;var c="\x00",l="\x00",h="";n.prototype._nodeCount=0,n.prototype._edgeCount=0,n.prototype.isDirected=function(){return this._isDirected},n.prototype.isMultigraph=function(){return this._isMultigraph},n.prototype.isCompound=function(){return this._isCompound},n.prototype.setGraph=function(t){return this._label=t,this},n.prototype.graph=function(){return this._label},n.prototype.setDefaultNodeLabel=function(t){return s.isFunction(t)||(t=s.constant(t)),this._defaultNodeLabelFn=t,this},n.prototype.nodeCount=function(){return this._nodeCount},n.prototype.nodes=function(){return s.keys(this._nodes)},n.prototype.sources=function(){return s.filter(this.nodes(),function(t){return s.isEmpty(this._in[t])},this)},n.prototype.sinks=function(){return s.filter(this.nodes(),function(t){return s.isEmpty(this._out[t])},this)},n.prototype.setNodes=function(t,e){var n=arguments;return s.each(t,function(t){n.length>1?this.setNode(t,e):this.setNode(t)},this),this},n.prototype.setNode=function(t,e){return s.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=l,this._children[t]={},this._children[l][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},n.prototype.node=function(t){return this._nodes[t]},n.prototype.hasNode=function(t){return s.has(this._nodes,t)},n.prototype.removeNode=function(t){var e=this;if(s.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],s.each(this.children(t),function(t){this.setParent(t)},this),delete this._children[t]),s.each(s.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],s.each(s.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},n.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(s.isUndefined(e))e=l;else{e+="";for(var n=e;!s.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},n.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},n.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==l)return e}},n.prototype.children=function(t){if(s.isUndefined(t)&&(t=l),this._isCompound){var e=this._children[t];if(e)return s.keys(e)}else{if(t===l)return this.nodes();if(this.hasNode(t))return[]}},n.prototype.predecessors=function(t){var e=this._preds[t];return e?s.keys(e):void 0},n.prototype.successors=function(t){var e=this._sucs[t];return e?s.keys(e):void 0},n.prototype.neighbors=function(t){var e=this.predecessors(t);return e?s.union(e,this.successors(t)):void 0},n.prototype.filterNodes=function(t){function e(t){var a=r.parent(t);return void 0===a||n.hasNode(a)?(i[t]=a,a):a in i?i[a]:e(a)}var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph()),s.each(this._nodes,function(e,r){t(r)&&n.setNode(r,e)},this),s.each(this._edgeObjs,function(t){n.hasNode(t.v)&&n.hasNode(t.w)&&n.setEdge(t,this.edge(t))},this);var r=this,i={};return this._isCompound&&s.each(n.nodes(),function(t){n.setParent(t,e(t))}),n},n.prototype.setDefaultEdgeLabel=function(t){return s.isFunction(t)||(t=s.constant(t)),this._defaultEdgeLabelFn=t,this},n.prototype.edgeCount=function(){return this._edgeCount},n.prototype.edges=function(){return s.values(this._edgeObjs)},n.prototype.setPath=function(t,e){var n=this,r=arguments;return s.reduce(t,function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i}),this},n.prototype.setEdge=function(){var t,e,n,i,o=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(t=c.v,e=c.w,n=c.name,2===arguments.length&&(i=arguments[1],o=!0)):(t=c,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,e=""+e,s.isUndefined(n)||(n=""+n);var l=a(this._isDirected,t,e,n);if(s.has(this._edgeLabels,l))return o&&(this._edgeLabels[l]=i),this;if(!s.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=o?i:this._defaultEdgeLabelFn(t,e,n);var h=u(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[l]=h,r(this._preds[e],t),r(this._sucs[t],e),this._in[e][l]=h,this._out[t][l]=h,this._edgeCount++,this},n.prototype.edge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return this._edgeLabels[r]},n.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return s.has(this._edgeLabels,r)},n.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n),u=this._edgeObjs[r];return u&&(t=u.v,e=u.w,delete this._edgeLabels[r],delete this._edgeObjs[r],i(this._preds[e],t),i(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},n.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=s.values(n);return e?s.filter(r,function(t){return t.v===e}):r}},n.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=s.values(n);return e?s.filter(r,function(t){return t.w===e}):r}},n.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);return n?n.concat(this.outEdges(t,e)):void 0}},{"./lodash":51}],49:[function(t,e){e.exports={Graph:t("./graph"),version:t("./version")}},{"./graph":48,"./version":52}],50:[function(t,e){function n(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:r(t),edges:i(t)};return u.isUndefined(t.graph())||(e.value=u.clone(t.graph())),e}function r(t){return u.map(t.nodes(),function(e){var n=t.node(e),r=t.parent(e),i={v:e};return u.isUndefined(n)||(i.value=n),u.isUndefined(r)||(i.parent=r),i})}function i(t){return u.map(t.edges(),function(e){var n=t.edge(e),r={v:e.v,w:e.w};return u.isUndefined(e.name)||(r.name=e.name),u.isUndefined(n)||(r.value=n),r})}function a(t){var e=new o(t.options).setGraph(t.value);return u.each(t.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),u.each(t.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}var u=t("./lodash"),o=t("./graph");e.exports={write:n,read:a}},{"./graph":48,"./lodash":51}],51:[function(t,e){var n;if("function"==typeof t)try{n=t("lodash")}catch(r){}n||(n=window._),e.exports=n},{lodash:53}],52:[function(t,e){e.exports="1.0.7"},{}],53:[function(t,e,n){(function(t){(function(){function r(t,e){if(t!==e){var n=null===t,r=t===k,i=t===t,a=null===e,u=e===k,o=e===e;if(t>e&&!a||!i||n&&!u&&o||r&&o)return 1;if(e>t&&!n||!o||a&&!r&&i||u&&i)return-1}return 0}function i(t,e,n){for(var r=t.length,i=n?r:-1;n?i--:++i-1;);return n}function c(t,e){for(var n=t.length;n--&&e.indexOf(t.charAt(n))>-1;);return n}function l(t,e){return r(t.criteria,e.criteria)||t.index-e.index}function h(t,e,n){for(var i=-1,a=t.criteria,u=e.criteria,o=a.length,s=n.length;++i=s)return c;var l=n[i];return c*("asc"===l||l===!0?1:-1)}}return t.index-e.index}function f(t){return Vt[t]}function d(t){return $t[t]}function p(t,e,n){return e?t=Wt[t]:n&&(t=Zt[t]),"\\"+t}function g(t){return"\\"+Zt[t]}function m(t,e,n){for(var r=t.length,i=e+(n?0:-1);n?i--:++i=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function b(t,e){for(var n=-1,r=t.length,i=-1,a=[];++ne,i=n?t.length:0,a=Gn(0,i,this.__views__),u=a.start,o=a.end,s=o-u,c=r?o:u-1,l=this.__iteratees__,h=l.length,f=0,d=wu(s,this.__takeCount__);if(!n||j>i||i==s&&d==s)return nn(r&&n?t.reverse():t,this.__actions__);var p=[];t:for(;s--&&d>f;){c+=e;for(var g=-1,m=t[c];++g=j?gn(e):null,c=e.length;s&&(u=Jt,o=!1,e=s);t:for(;++in&&(n=-n>i?0:i+n),r=r===k||r>i?i:+r||0,0>r&&(r+=i),i=n>r?0:r>>>0,n>>>=0;i>n;)t[n++]=e;return t}function Ce(t,e){var n=[];return Ou(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function Me(t,e,n,r){var i;return n(t,function(t,n,a){return e(t,n,a)?(i=r?n:t,!1):void 0}),i}function Se(t,e,n,r){r||(r=[]);for(var i=-1,a=t.length;++ir;)t=t[e[r++]];return r&&r==i?t:k}}function Oe(t,e,n,r,i,a){return t===e?!0:null==t||null==e||!Ni(t)&&!y(e)?t!==t&&e!==e:Ie(t,e,Oe,n,r,i,a)}function Ie(t,e,n,r,i,a,u){var o=So(t),s=So(e),c=G,l=G;o||(c=nu.call(t),c==$?c=Q:c!=Q&&(o=zi(t))),s||(l=nu.call(e),l==$?l=Q:l!=Q&&(s=zi(e)));var h=c==Q,f=l==Q,d=c==l;if(d&&!o&&!h)return qn(t,e,c);if(!i){var p=h&&tu.call(t,"__wrapped__"),g=f&&tu.call(e,"__wrapped__");if(p||g)return n(p?t.value():t,g?e.value():e,r,i,a,u)}if(!d)return!1;a||(a=[]),u||(u=[]);for(var m=a.length;m--;)if(a[m]==t)return u[m]==e;a.push(t),u.push(e); +return null==e?i:(e=un(e,n,4),se(i,function(t){return le(t,e,k,!0)}))}function qr(){for(var t=-1,e=arguments.length;++tn?xu(i+n,0):n||0,"string"==typeof t||!Mo(t)&&Yi(t)?i>=n&&t.indexOf(e,n)>-1:!!i&&Vn(t,e,n)>-1}function ti(t,e,n){var r=Mo(t)?se:Pe;return e=Un(e,n,3),r(t,e)}function ei(t,e){return ti(t,Ba(e))}function ni(t,e,n){var r=Mo(t)?oe:Ce;return e=Un(e,n,3),r(t,function(t,n,r){return!e(t,n,r)})}function ri(t,e,n){if(n?Qn(t,e,n):null==e){t=lr(t);var r=t.length;return r>0?t[He(0,r-1)]:k}var i=-1,a=Gi(t),r=a.length,u=r-1;for(e=wu(0>e?0:+e||0,r);++i0&&(n=e.apply(this,arguments)),1>=t&&(e=k),n}}function di(t,e,n){function r(){d&&uu(d),c&&uu(c),g=0,c=d=p=k}function i(e,n){n&&uu(n),c=d=p=k,e&&(g=go(),l=t.apply(f,s),d||c||(s=f=k))}function a(){var t=e-(go()-h);0>=t||t>e?i(p,c):d=hu(a,t)}function u(){i(y,d)}function o(){if(s=arguments,h=go(),f=this,p=y&&(d||!v),m===!1)var n=v&&!d;else{c||v||(g=h);var r=m-(h-g),i=0>=r||r>m;i?(c&&(c=uu(c)),g=h,l=t.apply(f,s)):c||(c=hu(u,r))}return i&&d?d=uu(d):d||e===m||(d=hu(a,e)),n&&(i=!0,l=t.apply(f,s)),!i||d||c||(s=f=k),l}var s,c,l,h,f,d,p,g=0,m=!1,y=!0;if("function"!=typeof t)throw new Za(V);if(e=0>e?0:+e||0,n===!0){var v=!0;y=!1}else Ni(n)&&(v=!!n.leading,m="maxWait"in n&&xu(+n.maxWait||0,e),y="trailing"in n?!!n.trailing:y);return o.cancel=r,o}function pi(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new Za(V);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var u=t.apply(this,r);return n.cache=a.set(i,u),u};return n.cache=new pi.Cache,n}function gi(t){if("function"!=typeof t)throw new Za(V);return function(){return!t.apply(this,arguments)}}function mi(t){return fi(2,t)}function yi(t,e){if("function"!=typeof t)throw new Za(V);return e=xu(e===k?t.length-1:+e||0,0),function(){for(var n=arguments,r=-1,i=xu(n.length-e,0),a=ja(i);++re}function Ei(t,e){return t>=e}function ki(t){return y(t)&&Jn(t)&&tu.call(t,"callee")&&!cu.call(t,"callee")}function Di(t){return t===!0||t===!1||y(t)&&nu.call(t)==G}function Ci(t){return y(t)&&nu.call(t)==W}function Si(t){return!!t&&1===t.nodeType&&y(t)&&!ji(t)}function Mi(t){return null==t?!0:Jn(t)&&(Mo(t)||Yi(t)||ki(t)||y(t)&&Bi(t.splice))?!t.length:!jo(t).length}function Ti(t,e,n,r){n="function"==typeof n?un(n,r,3):k;var i=n?n(t,e):k;return i===k?Ie(t,e,n):!!i}function Fi(t){return y(t)&&"string"==typeof t.message&&nu.call(t)==Z}function Li(t){return"number"==typeof t&&bu(t)}function Bi(t){return Ni(t)&&nu.call(t)==X}function Ni(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Ii(t,e,n,r){return n="function"==typeof n?un(n,r,3):k,Re(t,zn(e),n)}function Oi(t){return qi(t)&&t!=+t}function Ri(t){return null==t?!1:Bi(t)?iu.test(Qa.call(t)):y(t)&&Nt.test(t)}function Pi(t){return null===t}function qi(t){return"number"==typeof t||y(t)&&nu.call(t)==K}function ji(t){var e;if(!y(t)||nu.call(t)!=Q||ki(t)||!tu.call(t,"constructor")&&(e=t.constructor,"function"==typeof e&&!(e instanceof e)))return!1;var n;return Te(t,function(t,e){n=e}),n===k||tu.call(t,n)}function Ui(t){return Ni(t)&&nu.call(t)==tt}function Yi(t){return"string"==typeof t||y(t)&&nu.call(t)==nt}function Vi(t){return y(t)&&nr(t.length)&&!!Yt[nu.call(t)]}function zi(t){return t===k}function $i(t,e){return e>t}function Hi(t,e){return e>=t}function Gi(t){var e=t?Uu(t):0;return nr(e)?e?te(t):[]:aa(t)}function Wi(t){return be(t,ta(t))}function Zi(t,e,n){var r=Nu(t);return n&&Qn(t,e,n)&&(e=k),e?ye(r,e):r}function Xi(t){return Be(t,ta(t))}function Ji(t,e,n){var r=null==t?k:Ne(t,fr(e),e+"");return r===k?n:r}function Ki(t,e){if(null==t)return!1;var n=tu.call(t,e);if(!n&&!tr(e)){if(e=fr(e),t=1==e.length?t:Ne(t,We(e,0,-1)),null==t)return!1;e=Dr(e),n=tu.call(t,e)}return n||nr(t.length)&&Kn(e,t.length)&&(Mo(t)||ki(t))}function Qi(t,e,n){n&&Qn(t,e,n)&&(e=k);for(var r=-1,i=jo(t),a=i.length,u={};++r0;++r=wu(e,n)&&tn?0:+n||0,r),n-=e.length,n>=0&&t.indexOf(e,n)==n}function fa(t){return t=o(t),t&&_t.test(t)?t.replace(vt,d):t}function da(t){return t=o(t),t&&St.test(t)?t.replace(Ct,p):t||"(?:)"}function pa(t,e,n){t=o(t),e=+e;var r=t.length;if(r>=e||!bu(e))return t;var i=(e-r)/2,a=yu(i),u=gu(i);return n=Bn("",u,n),n.slice(0,a)+t+n}function ga(t,e,n){return(n?Qn(t,e,n):null==e)?e=0:e&&(e=+e),t=ba(t),Eu(t,e||(Bt.test(t)?16:10))}function ma(t,e){var n="";if(t=o(t),e=+e,1>e||!t||!bu(e))return n;do e%2&&(n+=t),e=yu(e/2),t+=t;while(e);return n}function ya(t,e,n){return t=o(t),n=null==n?0:wu(0>n?0:+n||0,t.length),t.lastIndexOf(e,n)==n}function va(t,n,r){var i=e.templateSettings;r&&Qn(t,n,r)&&(n=r=k),t=o(t),n=me(ye({},r||n),i,ge);var a,u,s=me(ye({},n.imports),i.imports,ge),c=jo(s),l=tn(s,c),h=0,f=n.interpolate||Rt,d="__p += '",p=Ga((n.escape||Rt).source+"|"+f.source+"|"+(f===At?Ft:Rt).source+"|"+(n.evaluate||Rt).source+"|$","g"),m="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++Ut+"]")+"\n";t.replace(p,function(e,n,r,i,o,s){return r||(r=i),d+=t.slice(h,s).replace(Pt,g),n&&(a=!0,d+="' +\n__e("+n+") +\n'"),o&&(u=!0,d+="';\n"+o+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),h=s+e.length,e}),d+="';\n";var y=n.variable;y||(d="with (obj) {\n"+d+"\n}\n"),d=(u?d.replace(pt,""):d).replace(gt,"$1").replace(mt,"$1;"),d="function("+(y||"obj")+") {\n"+(y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=Jo(function(){return Va(c,m+"return "+d).apply(k,l)});if(v.source=d,Fi(v))throw v;return v}function ba(t,e,n){var r=t;return(t=o(t))?(n?Qn(r,e,n):null==e)?t.slice(x(t),w(t)+1):(e+="",t.slice(s(t,e),c(t,e)+1)):t}function _a(t,e,n){var r=t;return t=o(t),t?t.slice((n?Qn(r,e,n):null==e)?x(t):s(t,e+"")):t}function xa(t,e,n){var r=t;return t=o(t),t?(n?Qn(r,e,n):null==e)?t.slice(0,w(t)+1):t.slice(0,c(t,e+"")+1):t}function wa(t,e,n){n&&Qn(t,e,n)&&(e=k);var r=O,i=R;if(null!=e)if(Ni(e)){var a="separator"in e?e.separator:a;r="length"in e?+e.length||0:r,i="omission"in e?o(e.omission):i}else r=+e||0;if(t=o(t),r>=t.length)return t;var u=r-i.length;if(1>u)return i;var s=t.slice(0,u);if(null==a)return s+i;if(Ui(a)){if(t.slice(u).search(a)){var c,l,h=t.slice(0,u);for(a.global||(a=Ga(a.source,(Lt.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(h);)l=c.index;s=s.slice(0,null==l?u:l)}}else if(t.indexOf(a,u)!=u){var f=s.lastIndexOf(a);f>-1&&(s=s.slice(0,f))}return s+i}function Aa(t){return t=o(t),t&&bt.test(t)?t.replace(yt,A):t}function Ea(t,e,n){return n&&Qn(t,e,n)&&(e=k),t=o(t),t.match(e||qt)||[]}function ka(t,e,n){return n&&Qn(t,e,n)&&(e=k),y(t)?Sa(t):_e(t,e)}function Da(t){return function(){return t}}function Ca(t){return t}function Sa(t){return qe(xe(t,!0))}function Ma(t,e){return je(t,xe(e,!0))}function Ta(t,e,n){if(null==n){var r=Ni(e),i=r?jo(e):k,a=i&&i.length?Be(e,i):k;(a?a.length:r)||(a=!1,n=e,e=t,t=this)}a||(a=Be(e,jo(e)));var u=!0,o=-1,s=Bi(t),c=a.length;n===!1?u=!1:Ni(n)&&"chain"in n&&(u=n.chain);for(;++ot||!bu(t))return[];var r=-1,i=ja(wu(t,Su));for(e=un(e,n,1);++rr?i[r]=e(r):e(r);return i}function Ra(t){var e=++eu;return o(t)+e}function Pa(t,e){return(+t||0)+(+e||0)}function qa(t,e,n){return n&&Qn(t,e,n)&&(e=k),e=Un(e,n,3),1==e.length?de(Mo(t)?t:lr(t),e):Ke(t,e)}t=t?re.defaults(ne.Object(),t,re.pick(ne,jt)):ne;{var ja=t.Array,Ua=t.Date,Ya=t.Error,Va=t.Function,za=t.Math,$a=t.Number,Ha=t.Object,Ga=t.RegExp,Wa=t.String,Za=t.TypeError,Xa=ja.prototype,Ja=Ha.prototype,Ka=Wa.prototype,Qa=Va.prototype.toString,tu=Ja.hasOwnProperty,eu=0,nu=Ja.toString,ru=ne._,iu=Ga("^"+Qa.call(tu).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),au=t.ArrayBuffer,uu=t.clearTimeout,ou=t.parseFloat,su=za.pow,cu=Ja.propertyIsEnumerable,lu=$n(t,"Set"),hu=t.setTimeout,fu=Xa.splice,du=t.Uint8Array,pu=$n(t,"WeakMap"),gu=za.ceil,mu=$n(Ha,"create"),yu=za.floor,vu=$n(ja,"isArray"),bu=t.isFinite,_u=$n(Ha,"keys"),xu=za.max,wu=za.min,Au=$n(Ua,"now"),Eu=t.parseInt,ku=za.random,Du=$a.NEGATIVE_INFINITY,Cu=$a.POSITIVE_INFINITY,Su=4294967295,Mu=Su-1,Tu=Su>>>1,Fu=9007199254740991,Lu=pu&&new pu,Bu={};e.support={}}e.templateSettings={escape:xt,evaluate:wt,interpolate:At,variable:"",imports:{_:e}};var Nu=function(){function t(){}return function(e){if(Ni(e)){t.prototype=e;var n=new t;t.prototype=k}return n||{}}}(),Iu=fn(Fe),Ou=fn(Le,!0),Ru=dn(),Pu=dn(!0),qu=Lu?function(t,e){return Lu.set(t,e),t}:Ca,ju=Lu?function(t){return Lu.get(t)}:La,Uu=Ve("length"),Yu=function(){var t=0,e=0;return function(n,r){var i=go(),a=q-(i-e);if(e=i,a>0){if(++t>=P)return n}else t=0;return qu(n,r)}}(),Vu=yi(function(t,e){return y(t)&&Jn(t)?Ae(t,Me(e,!1,!0)):[]}),zu=wn(),$u=wn(!0),Hu=yi(function(t){for(var e=t.length,n=e,r=ja(h),i=Vn(),u=i==a,o=[];n--;){var s=t[n]=Jn(s=t[n])?s:[];r[n]=u&&s.length>=120?gn(n&&s):null}var c=t[0],l=-1,h=c?c.length:0,f=r[0];t:for(;++l2?t[e-2]:k,r=e>1?t[e-1]:k;return e>2&&"function"==typeof n?e-=2:(n=e>1&&"function"==typeof r?(--e,r):k,r=k),t.length=e,Pr(t,n,r)}),to=yi(function(t){return t=Me(t),this.thru(function(e){return Qt(Mo(e)?e:[hr(e)],t)})}),eo=yi(function(t,e){return ve(t,Me(e))}),no=ln(function(t,e,n){tu.call(t,n)?++t[n]:t[n]=1}),ro=xn(Iu),io=xn(Ou,!0),ao=kn(ee,Iu),uo=kn(ie,Ou),oo=ln(function(t,e,n){tu.call(t,n)?t[n].push(e):t[n]=[e]}),so=ln(function(t,e,n){t[n]=e}),co=yi(function(t,e,n){var r=-1,i="function"==typeof e,a=tr(e),u=Jn(t)?ja(t.length):[];return Iu(t,function(t){var o=i?e:a&&null!=t?t[e]:k;u[++r]=o?o.apply(t,n):Xn(t,e,n)}),u}),lo=ln(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),ho=Fn(le,Iu),fo=Fn(he,Ou),po=yi(function(t,e){if(null==t)return[];var n=e[2];return n&&Qn(e[0],e[1],n)&&(e.length=1),Je(t,Me(e),[])}),go=Au||function(){return(new Ua).getTime()},mo=yi(function(t,e,n){var r=C;if(n.length){var i=b(n,mo.placeholder);r|=L}return Rn(t,r,e,n,i)}),yo=yi(function(t,e){e=e.length?Me(e):Xi(t);for(var n=-1,r=e.length;++n0||0>e)?new J(n):(0>t?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==k&&(e=+e||0,n=0>e?n.dropRight(-e):n.take(e-t)),n)},J.prototype.takeRightWhile=function(t,e){return this.reverse().takeWhile(t,e).reverse()},J.prototype.toArray=function(){return this.take(Cu)},Fe(J.prototype,function(t,n){var r=/^(?:filter|map|reject)|While$/.test(n),i=/^(?:first|last)$/.test(n),a=e[i?"take"+("last"==n?"Right":""):n];a&&(e.prototype[n]=function(){var e=i?[1]:arguments,n=this.__chain__,u=this.__wrapped__,o=!!this.__actions__.length,s=u instanceof J,c=e[0],l=s||Mo(u);l&&r&&"function"==typeof c&&1!=c.length&&(s=l=!1);var h=function(t){return i&&n?a(t,1)[0]:a.apply(k,ce([t],e))},f={func:Vr,args:[h],thisArg:k},d=s&&!o;if(i&&!n)return d?(u=u.clone(),u.__actions__.push(f),t.call(u)):a.call(k,this.value())[0];if(!i&&l){u=d?u:new J(this);var p=t.apply(u,e);return p.__actions__.push(f),new v(p,n)}return this.thru(h)})}),ee(["join","pop","push","replace","shift","sort","splice","split","unshift"],function(t){var n=(/^(?:replace|split)$/.test(t)?Ka:Xa)[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:join|pop|replace|shift)$/.test(t);e.prototype[t]=function(){var t=arguments;return i&&!this.__chain__?n.apply(this.value(),t):this[r](function(e){return n.apply(e,t)})}}),Fe(J.prototype,function(t,n){var r=e[n];if(r){var i=r.name,a=Bu[i]||(Bu[i]=[]);a.push({name:n,func:r})}}),Bu[Ln(k,S).name]=[{name:"wrapper",func:k}],J.prototype.clone=et,J.prototype.reverse=rt,J.prototype.value=zt,e.prototype.chain=zr,e.prototype.commit=$r,e.prototype.concat=to,e.prototype.plant=Hr,e.prototype.reverse=Gr,e.prototype.toString=Wr,e.prototype.run=e.prototype.toJSON=e.prototype.valueOf=e.prototype.value=Zr,e.prototype.collect=e.prototype.map,e.prototype.head=e.prototype.first,e.prototype.select=e.prototype.filter,e.prototype.tail=e.prototype.rest,e}var k,D="3.10.1",C=1,S=2,M=4,T=8,F=16,L=32,B=64,N=128,I=256,O=30,R="...",P=150,q=16,j=200,U=1,Y=2,V="Expected a function",z="__lodash_placeholder__",$="[object Arguments]",H="[object Array]",G="[object Boolean]",W="[object Date]",Z="[object Error]",X="[object Function]",J="[object Map]",K="[object Number]",Q="[object Object]",tt="[object RegExp]",et="[object Set]",nt="[object String]",rt="[object WeakMap]",it="[object ArrayBuffer]",at="[object Float32Array]",ut="[object Float64Array]",ot="[object Int8Array]",st="[object Int16Array]",ct="[object Int32Array]",lt="[object Uint8Array]",ht="[object Uint8ClampedArray]",ft="[object Uint16Array]",dt="[object Uint32Array]",pt=/\b__p \+= '';/g,gt=/\b(__p \+=) '' \+/g,mt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,yt=/&(?:amp|lt|gt|quot|#39|#96);/g,vt=/[&<>"'`]/g,bt=RegExp(yt.source),_t=RegExp(vt.source),xt=/<%-([\s\S]+?)%>/g,wt=/<%([\s\S]+?)%>/g,At=/<%=([\s\S]+?)%>/g,Et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,kt=/^\w*$/,Dt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,Ct=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,St=RegExp(Ct.source),Mt=/[\u0300-\u036f\ufe20-\ufe23]/g,Tt=/\\(\\)?/g,Ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Lt=/\w*$/,Bt=/^0[xX]/,Nt=/^\[object .+?Constructor\]$/,It=/^\d+$/,Ot=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Rt=/($^)/,Pt=/['\n\r\u2028\u2029\\]/g,qt=function(){var t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",e="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(t+"+(?="+t+e+")|"+t+"?"+e+"|"+t+"+|[0-9]+","g")}(),jt=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Ut=-1,Yt={};Yt[at]=Yt[ut]=Yt[ot]=Yt[st]=Yt[ct]=Yt[lt]=Yt[ht]=Yt[ft]=Yt[dt]=!0,Yt[$]=Yt[H]=Yt[it]=Yt[G]=Yt[W]=Yt[Z]=Yt[X]=Yt[J]=Yt[K]=Yt[Q]=Yt[tt]=Yt[et]=Yt[nt]=Yt[rt]=!1;var Vt={};Vt[$]=Vt[H]=Vt[it]=Vt[G]=Vt[W]=Vt[at]=Vt[ut]=Vt[ot]=Vt[st]=Vt[ct]=Vt[K]=Vt[Q]=Vt[tt]=Vt[nt]=Vt[lt]=Vt[ht]=Vt[ft]=Vt[dt]=!0,Vt[Z]=Vt[X]=Vt[J]=Vt[et]=Vt[rt]=!1;var zt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},$t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ht={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Gt={"function":!0,object:!0},Wt={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Zt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Xt=Gt[typeof n]&&n&&!n.nodeType&&n,Jt=Gt[typeof e]&&e&&!e.nodeType&&e,Kt=Xt&&Jt&&"object"==typeof t&&t&&t.Object&&t,Qt=Gt[typeof self]&&self&&self.Object&&self,te=Gt[typeof window]&&window&&window.Object&&window,ee=Jt&&Jt.exports===Xt&&Xt,ne=Kt||te!==(this&&this.window)&&te||Qt||this,re=E();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(ne._=re,define(function(){return re})):Xt&&Jt?ee?(Jt.exports=re)._=re:Xt._=re:ne._=re}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],83:[function(t,e,n){!function(t,r){"object"==typeof n&&"undefined"!=typeof e?e.exports=r():"function"==typeof define&&define.amd?define(r):t.moment=r()}(this,function(){"use strict";function n(){return tr.apply(null,arguments)}function r(t){tr=t}function i(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function a(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function u(t,e){var n,r=[];for(n=0;n0)for(n in er)r=er[n],i=e[r],p(i)||(t[r]=i);return t}function m(t){g(this,t),this._d=new Date(null!=t._d?t._d.getTime():0/0),nr===!1&&(nr=!0,n.updateOffset(this),nr=!1)}function y(t){return t instanceof m||null!=t&&null!=t._isAMomentObject}function v(t){return 0>t?Math.ceil(t):Math.floor(t)}function b(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=v(e)),n}function _(t,e,n){var r,i=Math.min(t.length,e.length),a=Math.abs(t.length-e.length),u=0;for(r=0;i>r;r++)(n&&t[r]!==e[r]||!n&&b(t[r])!==b(e[r]))&&u++;return u+a}function x(t){n.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function w(t,e){var n=!0;return s(function(){return n&&(x(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),n=!1),e.apply(this,arguments)},e)}function A(t,e){rr[t]||(x(e),rr[t]=!0)}function E(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function k(t){return"[object Object]"===Object.prototype.toString.call(t)}function D(t){var e,n;for(n in t)e=t[n],E(e)?this[n]=e:this["_"+n]=e;this._config=t,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function C(t,e){var n,r=s({},t);for(n in e)o(e,n)&&(k(t[n])&&k(e[n])?(r[n]={},s(r[n],t[n]),s(r[n],e[n])):null!=e[n]?r[n]=e[n]:delete r[n]);return r}function S(t){null!=t&&this.set(t)}function M(t){return t?t.toLowerCase().replace("_","-"):t}function T(t){for(var e,n,r,i,a=0;a0;){if(r=F(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&_(i,n,!0)>=e-1)break;e--}a++}return null}function F(n){var r=null;if(!ar[n]&&"undefined"!=typeof e&&e&&e.exports)try{r=ir._abbr,t("./locale/"+n),L(r)}catch(i){}return ar[n]}function L(t,e){var n;return t&&(n=p(e)?I(t):B(t,e),n&&(ir=n)),ir._abbr}function B(t,e){return null!==e?(e.abbr=t,null!=ar[t]?(A("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),e=C(ar[t]._config,e)):null!=e.parentLocale&&(null!=ar[e.parentLocale]?e=C(ar[e.parentLocale]._config,e):A("parentLocaleUndefined","specified parentLocale is not defined yet")),ar[t]=new S(e),L(t),ar[t]):(delete ar[t],null)}function N(t,e){if(null!=e){var n;null!=ar[t]&&(e=C(ar[t]._config,e)),n=new S(e),n.parentLocale=ar[t],ar[t]=n,L(t)}else null!=ar[t]&&(null!=ar[t].parentLocale?ar[t]=ar[t].parentLocale:null!=ar[t]&&delete ar[t]);return ar[t]}function I(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return ir;if(!i(t)){if(e=F(t))return e;t=[t]}return T(t); -var y=(o?Pn:jn)(t,e,n,r,i,a,u);return a.pop(),u.pop(),y}function Re(t,e,n){var r=e.length,i=r,a=!n;if(null==t)return!i;for(t=hr(t);r--;){var u=e[r];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++re&&(e=-e>i?0:i+e),n=n===k||n>i?i:+n||0,0>n&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=ja(i);++r=j,s=o?gn():null,c=[];s?(r=Jt,u=!1):(o=!1,s=e?[]:c);t:for(;++n=i){for(;i>r;){var a=r+i>>>1,u=t[a];(n?e>=u:e>u)&&null!==u?r=a+1:i=a}return i}return an(t,e,Ca,n)}function an(t,e,n,r){e=n(e);for(var i=0,a=t?t.length:0,u=e!==e,o=null===e,s=e===k;a>i;){var c=yu((i+a)/2),l=n(t[c]),h=l!==k,f=l===l;if(u)var d=f||r;else d=o?f&&h&&(r||null!=l):s?f&&(r||h):null==l?!1:r?e>=l:e>l;d?i=c+1:a=c}return wu(a,Su)}function un(t,e,n){if("function"!=typeof t)return Ca;if(e===k)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,a){return t.call(e,n,r,i,a)};case 5:return function(n,r,i,a,u){return t.call(e,n,r,i,a,u)}}return function(){return t.apply(e,arguments)}}function on(t){var e=new au(t.byteLength),n=new du(e);return n.set(new du(t)),e}function sn(t,e,n){for(var r=n.length,i=-1,a=xu(t.length-r,0),u=-1,o=e.length,s=ja(o+a);++u2?n[i-2]:k,u=i>2?n[2]:k,o=i>1?n[i-1]:k;for("function"==typeof a?(a=un(a,o,5),i-=2):(a="function"==typeof o?o:k,i-=a?1:0),u&&Qn(n[0],n[1],u)&&(a=3>i?k:a,i=1);++r-1?n[u]:k}return Me(n,r,t)}}function wn(t){return function(e,n,r){return e&&e.length?(n=Un(n,r,3),i(e,n,t)):-1}}function An(t){return function(e,n,r){return n=Un(n,r,3),Me(e,n,t,!0)}}function En(t){return function(){for(var e,n=arguments.length,r=t?n:-1,i=0,a=ja(n);t?r--:++r=j)return e.plant(r).value();for(var i=0,u=n?a[i].apply(this,t):r;++iv){var E=o?te(o):k,D=xu(c-v,0),S=p?A:k,T=p?k:A,F=p?x:k,N=p?k:x;e|=p?B:L,e&=~(p?L:B),g||(e&=~(C|M));var O=[t,e,n,F,S,N,T,E,s,D],I=Bn.apply(k,O);return er(t)&&Yu(I,O),I.placeholder=w,I}}var R=f?n:this,P=d?R[t]:t;return o&&(x=sr(x,o)),h&&s=e||!bu(e))return"";var i=e-r;return n=null==n?" ":n+"",ma(n,gu(i/n.length)).slice(0,i)}function Nn(t,e,n,r){function i(){for(var e=-1,o=arguments.length,s=-1,c=r.length,l=ja(c+o);++ss))return!1;for(;++o-1&&t%1==0&&e>t}function Qn(t,e,n){if(!Ni(n))return!1;var r=typeof e;if("number"==r?Jn(n)&&Kn(e,n.length):"string"==r&&e in n){var i=n[e];return t===t?t===i:i!==i}return!1}function tr(t,e){var n=typeof t;if("string"==n&&kt.test(t)||"number"==n)return!0;if(So(t))return!1;var r=!Et.test(t);return r||null!=e&&t in hr(e)}function er(t){var n=Yn(t);if(!(n in J.prototype))return!1;var r=e[n];if(t===r)return!0;var i=ju(r);return!!i&&t===i[0]}function nr(t){return"number"==typeof t&&t>-1&&t%1==0&&Fu>=t}function rr(t){return t===t&&!Ni(t)}function ir(t,e){var n=t[1],r=e[1],i=n|r,a=N>i,u=r==N&&n==T||r==N&&n==O&&t[7].length<=e[8]||r==(N|O)&&n==T;if(!a&&!u)return t;r&C&&(t[2]=e[2],i|=n&C?0:S);var o=e[3];if(o){var s=t[3];t[3]=s?sn(s,o,e[4]):te(o),t[4]=s?b(t[3],V):te(e[4])}return o=e[5],o&&(s=t[5],t[5]=s?cn(s,o,e[6]):te(o),t[6]=s?b(t[5],V):te(e[6])),o=e[7],o&&(t[7]=te(o)),r&N&&(t[8]=null==t[8]?e[8]:wu(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}function ar(t,e){return t===k?e:To(t,e,ar)}function ur(t,e){t=hr(t);for(var n=-1,r=e.length,i={};++nr;)u[++a]=We(t,r,r+=e);return u}function gr(t){for(var e=-1,n=t?t.length:0,r=-1,i=[];++ee?0:e)):[]}function yr(t,e,n){var r=t?t.length:0;return r?((n?Qn(t,e,n):null==e)&&(e=1),e=r-(+e||0),We(t,0,0>e?0:e)):[]}function vr(t,e,n){return t&&t.length?en(t,Un(e,n,3),!0,!0):[]}function br(t,e,n){return t&&t.length?en(t,Un(e,n,3),!0):[]}function _r(t,e,n,r){var i=t?t.length:0;return i?(n&&"number"!=typeof n&&Qn(t,e,n)&&(n=0,r=i),De(t,e,n,r)):[]}function xr(t){return t?t[0]:k}function wr(t,e,n){var r=t?t.length:0;return n&&Qn(t,e,n)&&(e=!1),r?Se(t,e):[]}function Ar(t){var e=t?t.length:0;return e?Se(t,!0):[]}function Er(t,e,n){var r=t?t.length:0;if(!r)return-1;if("number"==typeof n)n=0>n?xu(r+n,0):n;else if(n){var i=rn(t,e);return r>i&&(e===e?e===t[i]:t[i]!==t[i])?i:-1}return a(t,e,n||0)}function kr(t){return yr(t,1)}function Dr(t){var e=t?t.length:0;return e?t[e-1]:k}function Cr(t,e,n){var r=t?t.length:0;if(!r)return-1;var i=r;if("number"==typeof n)i=(0>n?xu(r+n,0):wu(n||0,r-1))+1;else if(n){i=rn(t,e,!0)-1;var a=t[i];return(e===e?e===a:a!==a)?i:-1}if(e!==e)return m(t,i,!0);for(;i--;)if(t[i]===e)return i;return-1}function Mr(){var t=arguments,e=t[0];if(!e||!e.length)return e;for(var n=0,r=zn(),i=t.length;++n-1;)fu.call(e,a,1);return e}function Sr(t,e,n){var r=[];if(!t||!t.length)return r;var i=-1,a=[],u=t.length;for(e=Un(e,n,3);++ie?0:e)):[]}function Lr(t,e,n){var r=t?t.length:0;return r?((n?Qn(t,e,n):null==e)&&(e=1),e=r-(+e||0),We(t,0>e?0:e)):[]}function Nr(t,e,n){return t&&t.length?en(t,Un(e,n,3),!1,!0):[]}function Or(t,e,n){return t&&t.length?en(t,Un(e,n,3)):[]}function Ir(t,e,n,r){var i=t?t.length:0;if(!i)return[];null!=e&&"boolean"!=typeof e&&(r=n,n=Qn(t,e,r)?k:e,e=!1);var u=Un();return(null!=n||u!==_e)&&(n=u(n,r,3)),e&&zn()==a?_(t,n):Qe(t,n)}function Rr(t){if(!t||!t.length)return[];var e=-1,n=0;t=oe(t,function(t){return Jn(t)?(n=xu(t.length,n),!0):void 0});for(var r=ja(n);++en?xu(i+n,0):n||0,"string"==typeof t||!So(t)&&Yi(t)?i>=n&&t.indexOf(e,n)>-1:!!i&&zn(t,e,n)>-1}function ti(t,e,n){var r=So(t)?se:Pe;return e=Un(e,n,3),r(t,e)}function ei(t,e){return ti(t,La(e))}function ni(t,e,n){var r=So(t)?oe:Ce;return e=Un(e,n,3),r(t,function(t,n,r){return!e(t,n,r)})}function ri(t,e,n){if(n?Qn(t,e,n):null==e){t=lr(t);var r=t.length;return r>0?t[Ge(0,r-1)]:k}var i=-1,a=Hi(t),r=a.length,u=r-1;for(e=wu(0>e?0:+e||0,r);++i0&&(n=e.apply(this,arguments)),1>=t&&(e=k),n}}function di(t,e,n){function r(){d&&uu(d),c&&uu(c),g=0,c=d=p=k}function i(e,n){n&&uu(n),c=d=p=k,e&&(g=go(),l=t.apply(f,s),d||c||(s=f=k))}function a(){var t=e-(go()-h);0>=t||t>e?i(p,c):d=hu(a,t)}function u(){i(y,d)}function o(){if(s=arguments,h=go(),f=this,p=y&&(d||!v),m===!1)var n=v&&!d;else{c||v||(g=h);var r=m-(h-g),i=0>=r||r>m;i?(c&&(c=uu(c)),g=h,l=t.apply(f,s)):c||(c=hu(u,r))}return i&&d?d=uu(d):d||e===m||(d=hu(a,e)),n&&(i=!0,l=t.apply(f,s)),!i||d||c||(s=f=k),l}var s,c,l,h,f,d,p,g=0,m=!1,y=!0;if("function"!=typeof t)throw new Za(z);if(e=0>e?0:+e||0,n===!0){var v=!0;y=!1}else Ni(n)&&(v=!!n.leading,m="maxWait"in n&&xu(+n.maxWait||0,e),y="trailing"in n?!!n.trailing:y);return o.cancel=r,o}function pi(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new Za(z);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var u=t.apply(this,r);return n.cache=a.set(i,u),u};return n.cache=new pi.Cache,n}function gi(t){if("function"!=typeof t)throw new Za(z);return function(){return!t.apply(this,arguments)}}function mi(t){return fi(2,t)}function yi(t,e){if("function"!=typeof t)throw new Za(z);return e=xu(e===k?t.length-1:+e||0,0),function(){for(var n=arguments,r=-1,i=xu(n.length-e,0),a=ja(i);++re}function Ei(t,e){return t>=e}function ki(t){return y(t)&&Jn(t)&&tu.call(t,"callee")&&!cu.call(t,"callee")}function Di(t){return t===!0||t===!1||y(t)&&nu.call(t)==H}function Ci(t){return y(t)&&nu.call(t)==W}function Mi(t){return!!t&&1===t.nodeType&&y(t)&&!ji(t)}function Si(t){return null==t?!0:Jn(t)&&(So(t)||Yi(t)||ki(t)||y(t)&&Li(t.splice))?!t.length:!jo(t).length}function Ti(t,e,n,r){n="function"==typeof n?un(n,r,3):k;var i=n?n(t,e):k;return i===k?Oe(t,e,n):!!i}function Fi(t){return y(t)&&"string"==typeof t.message&&nu.call(t)==Z}function Bi(t){return"number"==typeof t&&bu(t)}function Li(t){return Ni(t)&&nu.call(t)==X}function Ni(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Oi(t,e,n,r){return n="function"==typeof n?un(n,r,3):k,Re(t,Vn(e),n)}function Ii(t){return qi(t)&&t!=+t}function Ri(t){return null==t?!1:Li(t)?iu.test(Qa.call(t)):y(t)&&Nt.test(t)}function Pi(t){return null===t}function qi(t){return"number"==typeof t||y(t)&&nu.call(t)==K}function ji(t){var e;if(!y(t)||nu.call(t)!=Q||ki(t)||!tu.call(t,"constructor")&&(e=t.constructor,"function"==typeof e&&!(e instanceof e)))return!1;var n;return Te(t,function(t,e){n=e}),n===k||tu.call(t,n)}function Ui(t){return Ni(t)&&nu.call(t)==tt}function Yi(t){return"string"==typeof t||y(t)&&nu.call(t)==nt}function zi(t){return y(t)&&nr(t.length)&&!!Yt[nu.call(t)]}function Vi(t){return t===k}function $i(t,e){return e>t}function Gi(t,e){return e>=t}function Hi(t){var e=t?Uu(t):0;return nr(e)?e?te(t):[]:aa(t)}function Wi(t){return be(t,ta(t))}function Zi(t,e,n){var r=Nu(t);return n&&Qn(t,e,n)&&(e=k),e?ye(r,e):r}function Xi(t){return Le(t,ta(t))}function Ji(t,e,n){var r=null==t?k:Ne(t,fr(e),e+"");return r===k?n:r}function Ki(t,e){if(null==t)return!1;var n=tu.call(t,e);if(!n&&!tr(e)){if(e=fr(e),t=1==e.length?t:Ne(t,We(e,0,-1)),null==t)return!1;e=Dr(e),n=tu.call(t,e)}return n||nr(t.length)&&Kn(e,t.length)&&(So(t)||ki(t))}function Qi(t,e,n){n&&Qn(t,e,n)&&(e=k);for(var r=-1,i=jo(t),a=i.length,u={};++r0;++r=wu(e,n)&&tn?0:+n||0,r),n-=e.length,n>=0&&t.indexOf(e,n)==n}function fa(t){return t=o(t),t&&_t.test(t)?t.replace(vt,d):t}function da(t){return t=o(t),t&&Mt.test(t)?t.replace(Ct,p):t||"(?:)"}function pa(t,e,n){t=o(t),e=+e;var r=t.length;if(r>=e||!bu(e))return t;var i=(e-r)/2,a=yu(i),u=gu(i);return n=Ln("",u,n),n.slice(0,a)+t+n}function ga(t,e,n){return(n?Qn(t,e,n):null==e)?e=0:e&&(e=+e),t=ba(t),Eu(t,e||(Lt.test(t)?16:10))}function ma(t,e){var n="";if(t=o(t),e=+e,1>e||!t||!bu(e))return n;do e%2&&(n+=t),e=yu(e/2),t+=t;while(e);return n}function ya(t,e,n){return t=o(t),n=null==n?0:wu(0>n?0:+n||0,t.length),t.lastIndexOf(e,n)==n}function va(t,n,r){var i=e.templateSettings;r&&Qn(t,n,r)&&(n=r=k),t=o(t),n=me(ye({},r||n),i,ge);var a,u,s=me(ye({},n.imports),i.imports,ge),c=jo(s),l=tn(s,c),h=0,f=n.interpolate||Rt,d="__p += '",p=Ha((n.escape||Rt).source+"|"+f.source+"|"+(f===At?Ft:Rt).source+"|"+(n.evaluate||Rt).source+"|$","g"),m="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++Ut+"]")+"\n";t.replace(p,function(e,n,r,i,o,s){return r||(r=i),d+=t.slice(h,s).replace(Pt,g),n&&(a=!0,d+="' +\n__e("+n+") +\n'"),o&&(u=!0,d+="';\n"+o+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),h=s+e.length,e}),d+="';\n";var y=n.variable;y||(d="with (obj) {\n"+d+"\n}\n"),d=(u?d.replace(pt,""):d).replace(gt,"$1").replace(mt,"$1;"),d="function("+(y||"obj")+") {\n"+(y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=Jo(function(){return za(c,m+"return "+d).apply(k,l)});if(v.source=d,Fi(v))throw v;return v}function ba(t,e,n){var r=t;return(t=o(t))?(n?Qn(r,e,n):null==e)?t.slice(x(t),w(t)+1):(e+="",t.slice(s(t,e),c(t,e)+1)):t}function _a(t,e,n){var r=t;return t=o(t),t?t.slice((n?Qn(r,e,n):null==e)?x(t):s(t,e+"")):t}function xa(t,e,n){var r=t;return t=o(t),t?(n?Qn(r,e,n):null==e)?t.slice(0,w(t)+1):t.slice(0,c(t,e+"")+1):t}function wa(t,e,n){n&&Qn(t,e,n)&&(e=k);var r=I,i=R;if(null!=e)if(Ni(e)){var a="separator"in e?e.separator:a;r="length"in e?+e.length||0:r,i="omission"in e?o(e.omission):i}else r=+e||0;if(t=o(t),r>=t.length)return t;var u=r-i.length;if(1>u)return i;var s=t.slice(0,u);if(null==a)return s+i;if(Ui(a)){if(t.slice(u).search(a)){var c,l,h=t.slice(0,u);for(a.global||(a=Ha(a.source,(Bt.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(h);)l=c.index;s=s.slice(0,null==l?u:l)}}else if(t.indexOf(a,u)!=u){var f=s.lastIndexOf(a);f>-1&&(s=s.slice(0,f))}return s+i}function Aa(t){return t=o(t),t&&bt.test(t)?t.replace(yt,A):t}function Ea(t,e,n){return n&&Qn(t,e,n)&&(e=k),t=o(t),t.match(e||qt)||[]}function ka(t,e,n){return n&&Qn(t,e,n)&&(e=k),y(t)?Ma(t):_e(t,e)}function Da(t){return function(){return t}}function Ca(t){return t}function Ma(t){return qe(xe(t,!0))}function Sa(t,e){return je(t,xe(e,!0))}function Ta(t,e,n){if(null==n){var r=Ni(e),i=r?jo(e):k,a=i&&i.length?Le(e,i):k;(a?a.length:r)||(a=!1,n=e,e=t,t=this)}a||(a=Le(e,jo(e)));var u=!0,o=-1,s=Li(t),c=a.length;n===!1?u=!1:Ni(n)&&"chain"in n&&(u=n.chain);for(;++ot||!bu(t))return[];var r=-1,i=ja(wu(t,Mu));for(e=un(e,n,1);++rr?i[r]=e(r):e(r);return i}function Ra(t){var e=++eu;return o(t)+e}function Pa(t,e){return(+t||0)+(+e||0)}function qa(t,e,n){return n&&Qn(t,e,n)&&(e=k),e=Un(e,n,3),1==e.length?de(So(t)?t:lr(t),e):Ke(t,e)}t=t?re.defaults(ne.Object(),t,re.pick(ne,jt)):ne;{var ja=t.Array,Ua=t.Date,Ya=t.Error,za=t.Function,Va=t.Math,$a=t.Number,Ga=t.Object,Ha=t.RegExp,Wa=t.String,Za=t.TypeError,Xa=ja.prototype,Ja=Ga.prototype,Ka=Wa.prototype,Qa=za.prototype.toString,tu=Ja.hasOwnProperty,eu=0,nu=Ja.toString,ru=ne._,iu=Ha("^"+Qa.call(tu).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),au=t.ArrayBuffer,uu=t.clearTimeout,ou=t.parseFloat,su=Va.pow,cu=Ja.propertyIsEnumerable,lu=$n(t,"Set"),hu=t.setTimeout,fu=Xa.splice,du=t.Uint8Array,pu=$n(t,"WeakMap"),gu=Va.ceil,mu=$n(Ga,"create"),yu=Va.floor,vu=$n(ja,"isArray"),bu=t.isFinite,_u=$n(Ga,"keys"),xu=Va.max,wu=Va.min,Au=$n(Ua,"now"),Eu=t.parseInt,ku=Va.random,Du=$a.NEGATIVE_INFINITY,Cu=$a.POSITIVE_INFINITY,Mu=4294967295,Su=Mu-1,Tu=Mu>>>1,Fu=9007199254740991,Bu=pu&&new pu,Lu={};e.support={}}e.templateSettings={escape:xt,evaluate:wt,interpolate:At,variable:"",imports:{_:e}};var Nu=function(){function t(){}return function(e){if(Ni(e)){t.prototype=e;var n=new t;t.prototype=k}return n||{}}}(),Ou=fn(Fe),Iu=fn(Be,!0),Ru=dn(),Pu=dn(!0),qu=Bu?function(t,e){return Bu.set(t,e),t}:Ca,ju=Bu?function(t){return Bu.get(t)}:Ba,Uu=ze("length"),Yu=function(){var t=0,e=0;return function(n,r){var i=go(),a=q-(i-e);if(e=i,a>0){if(++t>=P)return n}else t=0;return qu(n,r)}}(),zu=yi(function(t,e){return y(t)&&Jn(t)?Ae(t,Se(e,!1,!0)):[]}),Vu=wn(),$u=wn(!0),Gu=yi(function(t){for(var e=t.length,n=e,r=ja(h),i=zn(),u=i==a,o=[];n--;){var s=t[n]=Jn(s=t[n])?s:[];r[n]=u&&s.length>=120?gn(n&&s):null}var c=t[0],l=-1,h=c?c.length:0,f=r[0];t:for(;++l2?t[e-2]:k,r=e>1?t[e-1]:k;return e>2&&"function"==typeof n?e-=2:(n=e>1&&"function"==typeof r?(--e,r):k,r=k),t.length=e,Pr(t,n,r)}),to=yi(function(t){return t=Se(t),this.thru(function(e){return Qt(So(e)?e:[hr(e)],t)})}),eo=yi(function(t,e){return ve(t,Se(e))}),no=ln(function(t,e,n){tu.call(t,n)?++t[n]:t[n]=1}),ro=xn(Ou),io=xn(Iu,!0),ao=kn(ee,Ou),uo=kn(ie,Iu),oo=ln(function(t,e,n){tu.call(t,n)?t[n].push(e):t[n]=[e]}),so=ln(function(t,e,n){t[n]=e}),co=yi(function(t,e,n){var r=-1,i="function"==typeof e,a=tr(e),u=Jn(t)?ja(t.length):[];return Ou(t,function(t){var o=i?e:a&&null!=t?t[e]:k;u[++r]=o?o.apply(t,n):Xn(t,e,n)}),u}),lo=ln(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),ho=Fn(le,Ou),fo=Fn(he,Iu),po=yi(function(t,e){if(null==t)return[];var n=e[2];return n&&Qn(e[0],e[1],n)&&(e.length=1),Je(t,Se(e),[])}),go=Au||function(){return(new Ua).getTime()},mo=yi(function(t,e,n){var r=C;if(n.length){var i=b(n,mo.placeholder);r|=B}return Rn(t,r,e,n,i)}),yo=yi(function(t,e){e=e.length?Se(e):Xi(t);for(var n=-1,r=e.length;++n0||0>e)?new J(n):(0>t?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==k&&(e=+e||0,n=0>e?n.dropRight(-e):n.take(e-t)),n)},J.prototype.takeRightWhile=function(t,e){return this.reverse().takeWhile(t,e).reverse()},J.prototype.toArray=function(){return this.take(Cu)},Fe(J.prototype,function(t,n){var r=/^(?:filter|map|reject)|While$/.test(n),i=/^(?:first|last)$/.test(n),a=e[i?"take"+("last"==n?"Right":""):n];a&&(e.prototype[n]=function(){var e=i?[1]:arguments,n=this.__chain__,u=this.__wrapped__,o=!!this.__actions__.length,s=u instanceof J,c=e[0],l=s||So(u);l&&r&&"function"==typeof c&&1!=c.length&&(s=l=!1);var h=function(t){return i&&n?a(t,1)[0]:a.apply(k,ce([t],e))},f={func:zr,args:[h],thisArg:k},d=s&&!o;if(i&&!n)return d?(u=u.clone(),u.__actions__.push(f),t.call(u)):a.call(k,this.value())[0];if(!i&&l){u=d?u:new J(this);var p=t.apply(u,e);return p.__actions__.push(f),new v(p,n)}return this.thru(h)})}),ee(["join","pop","push","replace","shift","sort","splice","split","unshift"],function(t){var n=(/^(?:replace|split)$/.test(t)?Ka:Xa)[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:join|pop|replace|shift)$/.test(t);e.prototype[t]=function(){var t=arguments;return i&&!this.__chain__?n.apply(this.value(),t):this[r](function(e){return n.apply(e,t)})}}),Fe(J.prototype,function(t,n){var r=e[n];if(r){var i=r.name,a=Lu[i]||(Lu[i]=[]);a.push({name:n,func:r})}}),Lu[Bn(k,M).name]=[{name:"wrapper",func:k}],J.prototype.clone=et,J.prototype.reverse=rt,J.prototype.value=Vt,e.prototype.chain=Vr,e.prototype.commit=$r,e.prototype.concat=to,e.prototype.plant=Gr,e.prototype.reverse=Hr,e.prototype.toString=Wr,e.prototype.run=e.prototype.toJSON=e.prototype.valueOf=e.prototype.value=Zr,e.prototype.collect=e.prototype.map,e.prototype.head=e.prototype.first,e.prototype.select=e.prototype.filter,e.prototype.tail=e.prototype.rest,e}var k,D="3.10.1",C=1,M=2,S=4,T=8,F=16,B=32,L=64,N=128,O=256,I=30,R="...",P=150,q=16,j=200,U=1,Y=2,z="Expected a function",V="__lodash_placeholder__",$="[object Arguments]",G="[object Array]",H="[object Boolean]",W="[object Date]",Z="[object Error]",X="[object Function]",J="[object Map]",K="[object Number]",Q="[object Object]",tt="[object RegExp]",et="[object Set]",nt="[object String]",rt="[object WeakMap]",it="[object ArrayBuffer]",at="[object Float32Array]",ut="[object Float64Array]",ot="[object Int8Array]",st="[object Int16Array]",ct="[object Int32Array]",lt="[object Uint8Array]",ht="[object Uint8ClampedArray]",ft="[object Uint16Array]",dt="[object Uint32Array]",pt=/\b__p \+= '';/g,gt=/\b(__p \+=) '' \+/g,mt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,yt=/&(?:amp|lt|gt|quot|#39|#96);/g,vt=/[&<>"'`]/g,bt=RegExp(yt.source),_t=RegExp(vt.source),xt=/<%-([\s\S]+?)%>/g,wt=/<%([\s\S]+?)%>/g,At=/<%=([\s\S]+?)%>/g,Et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,kt=/^\w*$/,Dt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,Ct=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,Mt=RegExp(Ct.source),St=/[\u0300-\u036f\ufe20-\ufe23]/g,Tt=/\\(\\)?/g,Ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Bt=/\w*$/,Lt=/^0[xX]/,Nt=/^\[object .+?Constructor\]$/,Ot=/^\d+$/,It=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Rt=/($^)/,Pt=/['\n\r\u2028\u2029\\]/g,qt=function(){var t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",e="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(t+"+(?="+t+e+")|"+t+"?"+e+"|"+t+"+|[0-9]+","g")}(),jt=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Ut=-1,Yt={};Yt[at]=Yt[ut]=Yt[ot]=Yt[st]=Yt[ct]=Yt[lt]=Yt[ht]=Yt[ft]=Yt[dt]=!0,Yt[$]=Yt[G]=Yt[it]=Yt[H]=Yt[W]=Yt[Z]=Yt[X]=Yt[J]=Yt[K]=Yt[Q]=Yt[tt]=Yt[et]=Yt[nt]=Yt[rt]=!1;var zt={};zt[$]=zt[G]=zt[it]=zt[H]=zt[W]=zt[at]=zt[ut]=zt[ot]=zt[st]=zt[ct]=zt[K]=zt[Q]=zt[tt]=zt[nt]=zt[lt]=zt[ht]=zt[ft]=zt[dt]=!0,zt[Z]=zt[X]=zt[J]=zt[et]=zt[rt]=!1;var Vt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},$t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Gt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ht={"function":!0,object:!0},Wt={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Zt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Xt=Ht[typeof n]&&n&&!n.nodeType&&n,Jt=Ht[typeof e]&&e&&!e.nodeType&&e,Kt=Xt&&Jt&&"object"==typeof t&&t&&t.Object&&t,Qt=Ht[typeof self]&&self&&self.Object&&self,te=Ht[typeof window]&&window&&window.Object&&window,ee=Jt&&Jt.exports===Xt&&Xt,ne=Kt||te!==(this&&this.window)&&te||Qt||this,re=E();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(ne._=re,define(function(){return re})):Xt&&Jt?ee?(Jt.exports=re)._=re:Xt._=re:ne._=re}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],54:[function(t,e){e.exports={graphlib:t("./lib/graphlib"),layout:t("./lib/layout"),debug:t("./lib/debug"),util:{time:t("./lib/util").time,notime:t("./lib/util").notime},version:t("./lib/version")}},{"./lib/debug":59,"./lib/graphlib":60,"./lib/layout":62,"./lib/util":82,"./lib/version":83}],55:[function(t,e){"use strict";function n(t){function e(t){return function(e){return t.edge(e).weight}}var n="greedy"===t.graph().acyclicer?u(t,e(t)):r(t);a.each(n,function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,a.uniqueId("rev"))})}function r(t){function e(u){a.has(i,u)||(i[u]=!0,r[u]=!0,a.each(t.outEdges(u),function(t){a.has(r,t.w)?n.push(t):e(t.w)}),delete r[u])}var n=[],r={},i={};return a.each(t.nodes(),e),n}function i(t){a.each(t.edges(),function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}})}var a=t("./lodash"),u=t("./greedy-fas");e.exports={run:n,undo:i}},{"./greedy-fas":61,"./lodash":63}],56:[function(t,e){function n(t){function e(n){var a=t.children(n),u=t.node(n);if(a.length&&i.each(a,e),i.has(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(var o=u.minRank,s=u.maxRank+1;s>o;++o)r(t,"borderLeft","_bl",n,u,o),r(t,"borderRight","_br",n,u,o)}}i.each(t.children(),e)}function r(t,e,n,r,i,u){var o={width:0,height:0,rank:u,borderType:e},s=i[e][u-1],c=a.addDummyNode(t,"border",o,n);i[e][u]=c,t.setParent(c,r),s&&t.setEdge(s,c,{weight:1})}var i=t("./lodash"),a=t("./util");e.exports=n},{"./lodash":63,"./util":82}],57:[function(t,e){"use strict";function n(t){var e=t.graph().rankdir.toLowerCase();("lr"===e||"rl"===e)&&i(t)}function r(t){var e=t.graph().rankdir.toLowerCase();("bt"===e||"rl"===e)&&u(t),("lr"===e||"rl"===e)&&(s(t),i(t))}function i(t){l.each(t.nodes(),function(e){a(t.node(e))}),l.each(t.edges(),function(e){a(t.edge(e))})}function a(t){var e=t.width;t.width=t.height,t.height=e}function u(t){l.each(t.nodes(),function(e){o(t.node(e))}),l.each(t.edges(),function(e){var n=t.edge(e);l.each(n.points,o),l.has(n,"y")&&o(n)})}function o(t){t.y=-t.y}function s(t){l.each(t.nodes(),function(e){c(t.node(e))}),l.each(t.edges(),function(e){var n=t.edge(e);l.each(n.points,c),l.has(n,"x")&&c(n)})}function c(t){var e=t.x;t.x=t.y,t.y=e}var l=t("./lodash");e.exports={adjust:n,undo:r}},{"./lodash":63}],58:[function(t,e){function n(){var t={};t._next=t._prev=t,this._sentinel=t}function r(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function i(t,e){return"_next"!==t&&"_prev"!==t?e:void 0}e.exports=n,n.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;return e!==t?(r(e),e):void 0},n.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&r(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},n.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,i)),n=n._prev;return"["+t.join(", ")+"]"}},{}],59:[function(t,e){function n(t){var e=i.buildLayerMatrix(t),n=new a({compound:!0,multigraph:!0}).setGraph({});return r.each(t.nodes(),function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)}),r.each(t.edges(),function(t){n.setEdge(t.v,t.w,{},t.name)}),r.each(e,function(t,e){var i="layer"+e;n.setNode(i,{rank:"same"}),r.reduce(t,function(t,e){return n.setEdge(t,e,{style:"invis"}),e})}),n}var r=t("./lodash"),i=t("./util"),a=t("./graphlib").Graph;e.exports={debugOrdering:n}},{"./graphlib":60,"./lodash":63,"./util":82}],60:[function(t,e){var n;if("function"==typeof t)try{n=t("graphlib")}catch(r){}n||(n=window.graphlib),e.exports=n},{graphlib:84}],61:[function(t,e){function n(t,e){if(t.nodeCount()<=1)return[];var n=a(t,e||l),i=r(n.graph,n.buckets,n.zeroIdx);return o.flatten(o.map(i,function(e){return t.outEdges(e.v,e.w)}),!0)}function r(t,e,n){for(var r,a=[],u=e[e.length-1],o=e[0];t.nodeCount();){for(;r=o.dequeue();)i(t,e,n,r);for(;r=u.dequeue();)i(t,e,n,r);if(t.nodeCount())for(var s=e.length-2;s>0;--s)if(r=e[s].dequeue()){a=a.concat(i(t,e,n,r,!0));break}}return a}function i(t,e,n,r,i){var a=i?[]:void 0;return o.each(t.inEdges(r.v),function(r){var o=t.edge(r),s=t.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,u(e,n,s)}),o.each(t.outEdges(r.v),function(r){var i=t.edge(r),a=r.w,o=t.node(a);o["in"]-=i,u(e,n,o)}),t.removeNode(r.v),a}function a(t,e){var n=new s,r=0,i=0;o.each(t.nodes(),function(t){n.setNode(t,{v:t,"in":0,out:0})}),o.each(t.edges(),function(t){var a=n.edge(t.v,t.w)||0,u=e(t),o=a+u;n.setEdge(t.v,t.w,o),i=Math.max(i,n.node(t.v).out+=u),r=Math.max(r,n.node(t.w)["in"]+=u)});var a=o.range(i+r+3).map(function(){return new c}),l=r+1;return o.each(n.nodes(),function(t){u(a,l,n.node(t))}),{graph:n,buckets:a,zeroIdx:l}}function u(t,e,n){n.out?n["in"]?t[n.out-n["in"]+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}var o=t("./lodash"),s=t("./graphlib").Graph,c=t("./data/list");e.exports=n;var l=o.constant(1)},{"./data/list":58,"./graphlib":60,"./lodash":63}],62:[function(t,e){"use strict";function n(t,e){var n=e&&e.debugTiming?B.time:B.notime;n("layout",function(){var e=n(" buildLayoutGraph",function(){return a(t)});n(" runLayout",function(){r(e,n)}),n(" updateInputGraph",function(){i(t,e)})})}function r(t,e){e(" makeSpaceForEdgeLabels",function(){u(t)}),e(" removeSelfEdges",function(){g(t)}),e(" acyclic",function(){x.run(t)}),e(" nestingGraph.run",function(){C.run(t)}),e(" rank",function(){A(B.asNonCompoundGraph(t))}),e(" injectEdgeLabelProxies",function(){o(t)}),e(" removeEmptyRanks",function(){D(t)}),e(" nestingGraph.cleanup",function(){C.cleanup(t)}),e(" normalizeRanks",function(){E(t)}),e(" assignRankMinMax",function(){s(t)}),e(" removeEdgeLabelProxies",function(){c(t)}),e(" normalize.run",function(){w.run(t)}),e(" parentDummyChains",function(){k(t)}),e(" addBorderSegments",function(){M(t)}),e(" order",function(){T(t)}),e(" insertSelfEdges",function(){m(t)}),e(" adjustCoordinateSystem",function(){S.adjust(t)}),e(" position",function(){F(t)}),e(" positionSelfEdges",function(){y(t)}),e(" removeBorderNodes",function(){p(t)}),e(" normalize.undo",function(){w.undo(t)}),e(" fixupEdgeLabelCoords",function(){f(t)}),e(" undoCoordinateSystem",function(){S.undo(t)}),e(" translateGraph",function(){l(t)}),e(" assignNodeIntersects",function(){h(t)}),e(" reversePoints",function(){d(t)}),e(" acyclic.undo",function(){x.undo(t)})}function i(t,e){_.each(t.nodes(),function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))}),_.each(t.edges(),function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,_.has(i,"x")&&(r.x=i.x,r.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function a(t){var e=new L({multigraph:!0,compound:!0}),n=b(t.graph());return e.setGraph(_.merge({},O,v(n,N),_.pick(n,I))),_.each(t.nodes(),function(n){var r=b(t.node(n));e.setNode(n,_.defaults(v(r,R),P)),e.setParent(n,t.parent(n))}),_.each(t.edges(),function(n){var r=b(t.edge(n));e.setEdge(n,_.merge({},j,v(r,q),_.pick(r,U)))}),e}function u(t){var e=t.graph();e.ranksep/=2,_.each(t.edges(),function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function o(t){_.each(t.edges(),function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-r.rank)/2+r.rank,e:e};B.addDummyNode(t,"edge-proxy",a,"_ep")}})}function s(t){var e=0;_.each(t.nodes(),function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=_.max(e,r.maxRank))}),t.graph().maxRank=e}function c(t){_.each(t.nodes(),function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}function l(t){function e(t){var e=t.x,u=t.y,o=t.width,s=t.height;n=Math.min(n,e-o/2),r=Math.max(r,e+o/2),i=Math.min(i,u-s/2),a=Math.max(a,u+s/2)}var n=Number.POSITIVE_INFINITY,r=0,i=Number.POSITIVE_INFINITY,a=0,u=t.graph(),o=u.marginx||0,s=u.marginy||0;_.each(t.nodes(),function(n){e(t.node(n))}),_.each(t.edges(),function(n){var r=t.edge(n);_.has(r,"x")&&e(r)}),n-=o,i-=s,_.each(t.nodes(),function(e){var r=t.node(e);r.x-=n,r.y-=i}),_.each(t.edges(),function(e){var r=t.edge(e);_.each(r.points,function(t){t.x-=n,t.y-=i}),_.has(r,"x")&&(r.x-=n),_.has(r,"y")&&(r.y-=i)}),u.width=r-n+o,u.height=a-i+s}function h(t){_.each(t.edges(),function(e){var n,r,i=t.edge(e),a=t.node(e.v),u=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=u,r=a),i.points.unshift(B.intersectRect(a,n)),i.points.push(B.intersectRect(u,r))})}function f(t){_.each(t.edges(),function(e){var n=t.edge(e);if(_.has(n,"x"))switch(("l"===n.labelpos||"r"===n.labelpos)&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}function d(t){_.each(t.edges(),function(e){var n=t.edge(e);n.reversed&&n.points.reverse()})}function p(t){_.each(t.nodes(),function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),a=t.node(_.last(n.borderLeft)),u=t.node(_.last(n.borderRight));n.width=Math.abs(u.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),_.each(t.nodes(),function(e){"border"===t.node(e).dummy&&t.removeNode(e)})}function g(t){_.each(t.edges(),function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}function m(t){var e=B.buildLayerMatrix(t);_.each(e,function(e){var n=0;_.each(e,function(e,r){var i=t.node(e);i.order=r+n,_.each(i.selfEdges,function(e){B.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")}),delete i.selfEdges})})}function y(t){_.each(t.nodes(),function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,a=r.y,u=n.x-i,o=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*u/3,y:a-o},{x:i+5*u/6,y:a-o},{x:i+u,y:a},{x:i+5*u/6,y:a+o},{x:i+2*u/3,y:a+o}],n.label.x=n.x,n.label.y=n.y}})}function v(t,e){return _.mapValues(_.pick(t,e),Number)}function b(t){var e={};return _.each(t,function(t,n){e[n.toLowerCase()]=t}),e}var _=t("./lodash"),x=t("./acyclic"),w=t("./normalize"),A=t("./rank"),E=t("./util").normalizeRanks,k=t("./parent-dummy-chains"),D=t("./util").removeEmptyRanks,C=t("./nesting-graph"),M=t("./add-border-segments"),S=t("./coordinate-system"),T=t("./order"),F=t("./position"),B=t("./util"),L=t("./graphlib").Graph;e.exports=n;var N=["nodesep","edgesep","ranksep","marginx","marginy"],O={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},I=["acyclicer","ranker","rankdir","align"],R=["width","height"],P={width:0,height:0},q=["minlen","weight","width","height","labeloffset"],j={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},U=["labelpos"]},{"./acyclic":55,"./add-border-segments":56,"./coordinate-system":57,"./graphlib":60,"./lodash":63,"./nesting-graph":64,"./normalize":65,"./order":70,"./parent-dummy-chains":75,"./position":77,"./rank":79,"./util":82}],63:[function(t,e){e.exports=t(51)},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\lodash.js":51,lodash:104}],64:[function(t,e){function n(t){var e=s.addDummyNode(t,"root",{},"_root"),n=i(t),u=o.max(n)-1,c=2*u+1;t.graph().nestingRoot=e,o.each(t.edges(),function(e){t.edge(e).minlen*=c});var l=a(t)+1;o.each(t.children(),function(i){r(t,e,c,l,u,n,i)}),t.graph().nodeRankFactor=c}function r(t,e,n,i,a,u,c){var l=t.children(c);if(!l.length)return void(c!==e&&t.setEdge(e,c,{weight:0,minlen:n}));var h=s.addBorderNode(t,"_bt"),f=s.addBorderNode(t,"_bb"),d=t.node(c);t.setParent(h,c),d.borderTop=h,t.setParent(f,c),d.borderBottom=f,o.each(l,function(o){r(t,e,n,i,a,u,o);var s=t.node(o),l=s.borderTop?s.borderTop:o,d=s.borderBottom?s.borderBottom:o,p=s.borderTop?i:2*i,g=l!==d?1:a-u[c]+1;t.setEdge(h,l,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(d,f,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(c)||t.setEdge(e,h,{weight:0,minlen:a+u[c]})}function i(t){function e(r,i){var a=t.children(r);a&&a.length&&o.each(a,function(t){e(t,i+1)}),n[r]=i}var n={};return o.each(t.children(),function(t){e(t,1)}),n}function a(t){return o.reduce(t.edges(),function(e,n){return e+t.edge(n).weight},0)}function u(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,o.each(t.edges(),function(e){var n=t.edge(e);n.nestingEdge&&t.removeEdge(e)})}var o=t("./lodash"),s=t("./util");e.exports={run:n,cleanup:u}},{"./lodash":63,"./util":82}],65:[function(t,e){"use strict";function n(t){t.graph().dummyChains=[],a.each(t.edges(),function(e){r(t,e)})}function r(t,e){var n=e.v,r=t.node(n).rank,i=e.w,a=t.node(i).rank,o=e.name,s=t.edge(e),c=s.labelRank;if(a!==r+1){t.removeEdge(e);var l,h,f;for(f=0,++r;a>r;++f,++r)s.points=[],h={width:0,height:0,edgeLabel:s,edgeObj:e,rank:r},l=u.addDummyNode(t,"edge",h,"_d"),r===c&&(h.width=s.width,h.height=s.height,h.dummy="edge-label",h.labelpos=s.labelpos),t.setEdge(n,l,{weight:s.weight},o),0===f&&t.graph().dummyChains.push(l),n=l;t.setEdge(n,i,{weight:s.weight},o)}}function i(t){a.each(t.graph().dummyChains,function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)})}var a=t("./lodash"),u=t("./util");e.exports={run:n,undo:i}},{"./lodash":63,"./util":82}],66:[function(t,e){function n(t,e,n){var i,a={};r.each(n,function(n){for(var r,u,o=t.parent(n);o;){if(r=t.parent(o),r?(u=a[r],a[r]=o):(u=i,i=o),u&&u!==o)return void e.setEdge(u,o);o=r}})}var r=t("../lodash");e.exports=n},{"../lodash":63}],67:[function(t,e){function n(t,e){return r.map(e,function(e){var n=t.inEdges(e);if(n.length){var i=r.reduce(n,function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}},{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}})}var r=t("../lodash");e.exports=n},{"../lodash":63}],68:[function(t,e){function n(t,e,n){var u=r(t),o=new a({compound:!0}).setGraph({root:u}).setDefaultNodeLabel(function(e){return t.node(e)});return i.each(t.nodes(),function(r){var a=t.node(r),s=t.parent(r);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(o.setNode(r),o.setParent(r,s||u),i.each(t[n](r),function(e){var n=e.v===r?e.w:e.v,a=o.edge(n,r),u=i.isUndefined(a)?0:a.weight;o.setEdge(n,r,{weight:t.edge(e).weight+u})}),i.has(a,"minRank")&&o.setNode(r,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),o}function r(t){for(var e;t.hasNode(e=i.uniqueId("_root")););return e}var i=t("../lodash"),a=t("../graphlib").Graph;e.exports=n},{"../graphlib":60,"../lodash":63}],69:[function(t,e){"use strict";function n(t,e){for(var n=0,i=1;i0;)e%2&&(n+=s[e+1]),e=e-1>>1,s[e]+=t.weight;c+=t.weight*n})),c}var i=t("../lodash");e.exports=n},{"../lodash":63}],70:[function(t,e){"use strict";function n(t){var e=d.maxRank(t),n=r(t,u.range(1,e+1),"inEdges"),c=r(t,u.range(e-1,-1,-1),"outEdges"),l=o(t);a(t,l);for(var h,f=Number.POSITIVE_INFINITY,p=0,g=0;4>g;++p,++g){i(p%2?n:c,p%4>=2),l=d.buildLayerMatrix(t);var m=s(t,l);f>m&&(g=0,h=u.cloneDeep(l),f=m)}a(t,h)}function r(t,e,n){return u.map(e,function(e){return l(t,e,n)})}function i(t,e){var n=new f;u.each(t,function(t){var r=t.graph().root,i=c(t,r,n,e);u.each(i.vs,function(e,n){t.node(e).order=n}),h(t,n,i.vs)})}function a(t,e){u.each(e,function(e){u.each(e,function(e,n){t.node(e).order=n})})}var u=t("../lodash"),o=t("./init-order"),s=t("./cross-count"),c=t("./sort-subgraph"),l=t("./build-layer-graph"),h=t("./add-subgraph-constraints"),f=t("../graphlib").Graph,d=t("../util");e.exports=n},{"../graphlib":60,"../lodash":63,"../util":82,"./add-subgraph-constraints":66,"./build-layer-graph":68,"./cross-count":69,"./init-order":71,"./sort-subgraph":73}],71:[function(t,e){"use strict";function n(t){function e(i){if(!r.has(n,i)){n[i]=!0;var a=t.node(i);u[a.rank].push(i),r.each(t.successors(i),e)}}var n={},i=r.filter(t.nodes(),function(e){return!t.children(e).length}),a=r.max(r.map(i,function(e){return t.node(e).rank})),u=r.map(r.range(a+1),function(){return[]}),o=r.sortBy(i,function(e){return t.node(e).rank});return r.each(o,e),u}var r=t("../lodash");e.exports=n},{"../lodash":63}],72:[function(t,e){"use strict";function n(t,e){var n={};a.each(t,function(t,e){var r=n[t.v]={indegree:0,"in":[],out:[],vs:[t.v],i:e};a.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)}),a.each(e.edges(),function(t){var e=n[t.v],r=n[t.w];a.isUndefined(e)||a.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))});var i=a.filter(n,function(t){return!t.indegree});return r(i)}function r(t){function e(t){return function(e){e.merged||(a.isUndefined(e.barycenter)||a.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&i(t,e)}}function n(e){return function(n){n["in"].push(e),0===--n.indegree&&t.push(n)}}for(var r=[];t.length;){var u=t.pop();r.push(u),a.each(u["in"].reverse(),e(u)),a.each(u.out,n(u))}return a.chain(r).filter(function(t){return!t.merged}).map(function(t){return a.pick(t,["vs","i","barycenter","weight"])}).value()}function i(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}var a=t("../lodash");e.exports=n},{"../lodash":63}],73:[function(t,e){function n(t,e,c,l){var h=t.children(e),f=t.node(e),d=f?f.borderLeft:void 0,p=f?f.borderRight:void 0,g={};d&&(h=a.filter(h,function(t){return t!==d&&t!==p}));var m=u(t,h);a.each(m,function(e){if(t.children(e.v).length){var r=n(t,e.v,c,l);g[e.v]=r,a.has(r,"barycenter")&&i(e,r)}});var y=o(m,c);r(y,g);var v=s(y,l);if(d&&(v.vs=a.flatten([d,v.vs,p],!0),t.predecessors(d).length)){var b=t.node(t.predecessors(d)[0]),_=t.node(t.predecessors(p)[0]);a.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+b.order+_.order)/(v.weight+2),v.weight+=2}return v}function r(t,e){a.each(t,function(t){t.vs=a.flatten(t.vs.map(function(t){return e[t]?e[t].vs:t}),!0)})}function i(t,e){a.isUndefined(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}var a=t("../lodash"),u=t("./barycenter"),o=t("./resolve-conflicts"),s=t("./sort");e.exports=n},{"../lodash":63,"./barycenter":67,"./resolve-conflicts":72,"./sort":74}],74:[function(t,e){function n(t,e){var n=u.partition(t,function(t){return a.has(t,"barycenter")}),o=n.lhs,s=a.sortBy(n.rhs,function(t){return-t.i}),c=[],l=0,h=0,f=0;o.sort(i(!!e)),f=r(c,s,f),a.each(o,function(t){f+=t.vs.length,c.push(t.vs),l+=t.barycenter*t.weight,h+=t.weight,f=r(c,s,f)});var d={vs:a.flatten(c,!0)};return h&&(d.barycenter=l/h,d.weight=h),d}function r(t,e,n){for(var r;e.length&&(r=a.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}function i(t){return function(e,n){return e.barycentern.barycenter?1:t?n.i-e.i:e.i-n.i}}var a=t("../lodash"),u=t("../util");e.exports=n},{"../lodash":63,"../util":82}],75:[function(t,e){function n(t){var e=i(t);a.each(t.graph().dummyChains,function(n){for(var i=t.node(n),a=i.edgeObj,u=r(t,e,a.v,a.w),o=u.path,s=u.lca,c=0,l=o[c],h=!0;n!==a.w;){if(i=t.node(n),h){for(;(l=o[c])!==s&&t.node(l).maxRanks||c>e[i].lim));for(a=i,i=r;(i=t.parent(i))!==a;)o.push(i);return{path:u.concat(o.reverse()),lca:a}}function i(t){function e(i){var u=r;a.each(t.children(i),e),n[i]={low:u,lim:r++}}var n={},r=0;return a.each(t.children(),e),n}var a=t("./lodash");e.exports=n},{"./lodash":63}],76:[function(t,e){"use strict";function n(t,e){function n(e,n){ -var u=0,o=0,s=e.length,c=m.last(n);return m.each(n,function(e,l){var h=i(t,e),f=h?t.node(h).order:s;(h||e===c)&&(m.each(n.slice(o,l+1),function(e){m.each(t.predecessors(e),function(n){var i=t.node(n),o=i.order;!(u>o||o>f)||i.dummy&&t.node(e).dummy||a(r,n,e)})}),o=l+1,u=f)}),n}var r={};return m.reduce(e,n),r}function r(t,e){function n(e,n,r,u,o){var s;m.each(m.range(n,r),function(n){s=e[n],t.node(s).dummy&&m.each(t.predecessors(s),function(e){var n=t.node(e);n.dummy&&(n.ordero)&&a(i,e,s)})})}function r(e,r){var i,a=-1,u=0;return m.each(r,function(o,s){if("border"===t.node(o).dummy){var c=t.predecessors(o);c.length&&(i=t.node(c[0]).order,n(r,u,s,a,i),u=s,a=i)}n(r,u,r.length,i,e.length)}),r}var i={};return m.reduce(e,r),i}function i(t,e){return t.node(e).dummy?m.find(t.predecessors(e),function(e){return t.node(e).dummy}):void 0}function a(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function u(t,e,n){if(e>n){var r=e;e=n,n=r}return m.has(t[e],n)}function o(t,e,n,r){var i={},a={},o={};return m.each(e,function(t){m.each(t,function(t,e){i[t]=t,a[t]=t,o[t]=e})}),m.each(e,function(t){var e=-1;m.each(t,function(t){var s=r(t);if(s.length){s=m.sortBy(s,function(t){return o[t]});for(var c=(s.length-1)/2,l=Math.floor(c),h=Math.ceil(c);h>=l;++l){var f=s[l];a[t]===t&&eu.lim&&(o=u,s=!0);var c=p.filter(e.edges(),function(e){return s===d(t,t.node(e.v),o)&&s!==d(t,t.node(e.w),o)});return p.min(c,function(t){return m(e,t)})}function l(t,e,n,i){var a=n.v,o=n.w;t.removeEdge(a,o),t.setEdge(i.v,i.w,{}),u(t),r(t,e),h(t,e)}function h(t,e){var n=p.find(t.nodes(),function(t){return!e.node(t).parent}),r=v(t,n);r=r.slice(1),p.each(r,function(n){var r=t.node(n).parent,i=e.edge(n,r),a=!1;i||(i=e.edge(r,n),a=!0),e.node(n).rank=e.node(r).rank+(a?i.minlen:-i.minlen)})}function f(t,e,n){return t.hasEdge(e,n)}function d(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}var p=t("../lodash"),g=t("./feasible-tree"),m=t("./util").slack,y=t("./util").longestPath,v=t("../graphlib").alg.preorder,b=t("../graphlib").alg.postorder,_=t("../util").simplify;e.exports=n,n.initLowLimValues=u,n.initCutValues=r,n.calcCutValue=a,n.leaveEdge=s,n.enterEdge=c,n.exchangeEdges=l},{"../graphlib":60,"../lodash":63,"../util":82,"./feasible-tree":78,"./util":81}],81:[function(t,e){"use strict";function n(t){function e(r){var a=t.node(r);if(i.has(n,r))return a.rank;n[r]=!0;var u=i.min(i.map(t.outEdges(r),function(n){return e(n.w)-t.edge(n).minlen}));return u===Number.POSITIVE_INFINITY&&(u=0),a.rank=u}var n={};i.each(t.sources(),e)}function r(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var i=t("../lodash");e.exports={longestPath:n,slack:r}},{"../lodash":63}],82:[function(t,e){"use strict";function n(t,e,n,r){var i;do i=m.uniqueId(r);while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function r(t){var e=(new y).setGraph(t.graph());return m.each(t.nodes(),function(n){e.setNode(n,t.node(n))}),m.each(t.edges(),function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),e}function i(t){var e=new y({multigraph:t.isMultigraph()}).setGraph(t.graph());return m.each(t.nodes(),function(n){t.children(n).length||e.setNode(n,t.node(n))}),m.each(t.edges(),function(n){e.setEdge(n,t.edge(n))}),e}function a(t){var e=m.map(t.nodes(),function(e){var n={};return m.each(t.outEdges(e),function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight}),n});return m.zipObject(t.nodes(),e)}function u(t){var e=m.map(t.nodes(),function(e){var n={};return m.each(t.inEdges(e),function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight}),n});return m.zipObject(t.nodes(),e)}function o(t,e){var n=t.x,r=t.y,i=e.x-n,a=e.y-r,u=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var s,c;return Math.abs(a)*u>Math.abs(i)*o?(0>a&&(o=-o),s=o*i/a,c=o):(0>i&&(u=-u),s=u,c=u*a/i),{x:n+s,y:r+c}}function s(t){var e=m.map(m.range(f(t)+1),function(){return[]});return m.each(t.nodes(),function(n){var r=t.node(n),i=r.rank;m.isUndefined(i)||(e[i][r.order]=n)}),e}function c(t){var e=m.min(m.map(t.nodes(),function(e){return t.node(e).rank}));m.each(t.nodes(),function(n){var r=t.node(n);m.has(r,"rank")&&(r.rank-=e)})}function l(t){var e=m.min(m.map(t.nodes(),function(e){return t.node(e).rank})),n=[];m.each(t.nodes(),function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=t.graph().nodeRankFactor;m.each(n,function(e,n){m.isUndefined(e)&&n%i!==0?--r:r&&m.each(e,function(e){t.node(e).rank+=r})})}function h(t,e,r,i){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=i),n(t,"border",a,e)}function f(t){return m.max(m.map(t.nodes(),function(e){var n=t.node(e).rank;return m.isUndefined(n)?void 0:n}))}function d(t,e){var n={lhs:[],rhs:[]};return m.each(t,function(t){e(t)?n.lhs.push(t):n.rhs.push(t)}),n}function p(t,e){var n=m.now();try{return e()}finally{console.log(t+" time: "+(m.now()-n)+"ms")}}function g(t,e){return e()}var m=t("./lodash"),y=t("./graphlib").Graph;e.exports={addDummyNode:n,simplify:r,asNonCompoundGraph:i,successorWeights:a,predecessorWeights:u,intersectRect:o,buildLayerMatrix:s,normalizeRanks:c,removeEmptyRanks:l,addBorderNode:h,maxRank:f,partition:d,time:p,notime:g}},{"./graphlib":60,"./lodash":63}],83:[function(t,e){e.exports="0.7.4"},{}],84:[function(t,e){e.exports=t(33)},{"./lib":100,"./lib/alg":91,"./lib/json":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\index.js":33}],85:[function(t,e){e.exports=t(34)},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\components.js":34}],86:[function(t,e){e.exports=t(35)},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dfs.js":35}],87:[function(t,e){e.exports=t(36)},{"../lodash":102,"./dijkstra":88,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dijkstra-all.js":36}],88:[function(t,e){e.exports=t(37)},{"../data/priority-queue":98,"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dijkstra.js":37}],89:[function(t,e){e.exports=t(38)},{"../lodash":102,"./tarjan":96,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\find-cycles.js":38}],90:[function(t,e){e.exports=t(39)},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\floyd-warshall.js":39}],91:[function(t,e){e.exports=t(40)},{"./components":85,"./dijkstra":88,"./dijkstra-all":87,"./find-cycles":89,"./floyd-warshall":90,"./is-acyclic":92,"./postorder":93,"./preorder":94,"./prim":95,"./tarjan":96,"./topsort":97,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\index.js":40}],92:[function(t,e){e.exports=t(41)},{"./topsort":97,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\is-acyclic.js":41}],93:[function(t,e){e.exports=t(42)},{"./dfs":86,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\postorder.js":42}],94:[function(t,e){e.exports=t(43)},{"./dfs":86,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\preorder.js":43}],95:[function(t,e){e.exports=t(44)},{"../data/priority-queue":98,"../graph":99,"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\prim.js":44}],96:[function(t,e){e.exports=t(45)},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\tarjan.js":45}],97:[function(t,e){e.exports=t(46)},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\topsort.js":46}],98:[function(t,e){e.exports=t(47)},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\data\\priority-queue.js":47}],99:[function(t,e){e.exports=t(48)},{"./lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\graph.js":48}],100:[function(t,e){e.exports=t(49)},{"./graph":99,"./version":103,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\index.js":49}],101:[function(t,e){e.exports=t(50)},{"./graph":99,"./lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\json.js":50}],102:[function(t,e){e.exports=t(51)},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\lodash.js":51,lodash:104}],103:[function(t,e){e.exports=t(52)},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\version.js":52}],104:[function(t,e){e.exports=t(53)},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\lodash\\index.js":53}],105:[function(t,e,n){(function(t){!function(r){var i="object"==typeof n&&n,a="object"==typeof e&&e&&e.exports==i&&e,u="object"==typeof t&&t;(u.global===u||u.window===u)&&(r=u);var o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,s=/[\x01-\x7F]/g,c=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,l=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,h={"Á":"Aacute","á":"aacute","Ă":"Abreve","ă":"abreve","∾":"ac","∿":"acd","∾̳":"acE","Â":"Acirc","â":"acirc","´":"acute","А":"Acy","а":"acy","Æ":"AElig","æ":"aelig","⁡":"af","𝔄":"Afr","𝔞":"afr","À":"Agrave","à":"agrave","ℵ":"aleph","Α":"Alpha","α":"alpha","Ā":"Amacr","ā":"amacr","⨿":"amalg","&":"amp","⩕":"andand","⩓":"And","∧":"and","⩜":"andd","⩘":"andslope","⩚":"andv","∠":"ang","⦤":"ange","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","∡":"angmsd","∟":"angrt","⊾":"angrtvb","⦝":"angrtvbd","∢":"angsph","Å":"angst","⍼":"angzarr","Ą":"Aogon","ą":"aogon","𝔸":"Aopf","𝕒":"aopf","⩯":"apacir","≈":"ap","⩰":"apE","≊":"ape","≋":"apid","'":"apos","å":"aring","𝒜":"Ascr","𝒶":"ascr","≔":"colone","*":"ast","≍":"CupCap","Ã":"Atilde","ã":"atilde","Ä":"Auml","ä":"auml","∳":"awconint","⨑":"awint","≌":"bcong","϶":"bepsi","‵":"bprime","∽":"bsim","⋍":"bsime","∖":"setmn","⫧":"Barv","⊽":"barvee","⌅":"barwed","⌆":"Barwed","⎵":"bbrk","⎶":"bbrktbrk","Б":"Bcy","б":"bcy","„":"bdquo","∵":"becaus","⦰":"bemptyv","ℬ":"Bscr","Β":"Beta","β":"beta","ℶ":"beth","≬":"twixt","𝔅":"Bfr","𝔟":"bfr","⋂":"xcap","◯":"xcirc","⋃":"xcup","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨆":"xsqcup","★":"starf","▽":"xdtri","△":"xutri","⨄":"xuplus","⋁":"Vee","⋀":"Wedge","⤍":"rbarr","⧫":"lozf","▪":"squf","▴":"utrif","▾":"dtrif","◂":"ltrif","▸":"rtrif","␣":"blank","▒":"blk12","░":"blk14","▓":"blk34","█":"block","=⃥":"bne","≡⃥":"bnequiv","⫭":"bNot","⌐":"bnot","𝔹":"Bopf","𝕓":"bopf","⊥":"bot","⋈":"bowtie","⧉":"boxbox","┐":"boxdl","╕":"boxdL","╖":"boxDl","╗":"boxDL","┌":"boxdr","╒":"boxdR","╓":"boxDr","╔":"boxDR","─":"boxh","═":"boxH","┬":"boxhd","╤":"boxHd","╥":"boxhD","╦":"boxHD","┴":"boxhu","╧":"boxHu","╨":"boxhU","╩":"boxHU","⊟":"minusb","⊞":"plusb","⊠":"timesb","┘":"boxul","╛":"boxuL","╜":"boxUl","╝":"boxUL","└":"boxur","╘":"boxuR","╙":"boxUr","╚":"boxUR","│":"boxv","║":"boxV","┼":"boxvh","╪":"boxvH","╫":"boxVh","╬":"boxVH","┤":"boxvl","╡":"boxvL","╢":"boxVl","╣":"boxVL","├":"boxvr","╞":"boxvR","╟":"boxVr","╠":"boxVR","˘":"breve","¦":"brvbar","𝒷":"bscr","⁏":"bsemi","⧅":"bsolb","\\":"bsol","⟈":"bsolhsub","•":"bull","≎":"bump","⪮":"bumpE","≏":"bumpe","Ć":"Cacute","ć":"cacute","⩄":"capand","⩉":"capbrcup","⩋":"capcap","∩":"cap","⋒":"Cap","⩇":"capcup","⩀":"capdot","ⅅ":"DD","∩︀":"caps","⁁":"caret","ˇ":"caron","ℭ":"Cfr","⩍":"ccaps","Č":"Ccaron","č":"ccaron","Ç":"Ccedil","ç":"ccedil","Ĉ":"Ccirc","ĉ":"ccirc","∰":"Cconint","⩌":"ccups","⩐":"ccupssm","Ċ":"Cdot","ċ":"cdot","¸":"cedil","⦲":"cemptyv","¢":"cent","·":"middot","𝔠":"cfr","Ч":"CHcy","ч":"chcy","✓":"check","Χ":"Chi","χ":"chi","ˆ":"circ","≗":"cire","↺":"olarr","↻":"orarr","⊛":"oast","⊚":"ocir","⊝":"odash","⊙":"odot","®":"reg","Ⓢ":"oS","⊖":"ominus","⊕":"oplus","⊗":"otimes","○":"cir","⧃":"cirE","⨐":"cirfnint","⫯":"cirmid","⧂":"cirscir","∲":"cwconint","”":"rdquo","’":"rsquo","♣":"clubs",":":"colon","∷":"Colon","⩴":"Colone",",":"comma","@":"commat","∁":"comp","∘":"compfn","ℂ":"Copf","≅":"cong","⩭":"congdot","≡":"equiv","∮":"oint","∯":"Conint","𝕔":"copf","∐":"coprod","©":"copy","℗":"copysr","↵":"crarr","✗":"cross","⨯":"Cross","𝒞":"Cscr","𝒸":"cscr","⫏":"csub","⫑":"csube","⫐":"csup","⫒":"csupe","⋯":"ctdot","⤸":"cudarrl","⤵":"cudarrr","⋞":"cuepr","⋟":"cuesc","↶":"cularr","⤽":"cularrp","⩈":"cupbrcap","⩆":"cupcap","∪":"cup","⋓":"Cup","⩊":"cupcup","⊍":"cupdot","⩅":"cupor","∪︀":"cups","↷":"curarr","⤼":"curarrm","⋎":"cuvee","⋏":"cuwed","¤":"curren","∱":"cwint","⌭":"cylcty","†":"dagger","‡":"Dagger","ℸ":"daleth","↓":"darr","↡":"Darr","⇓":"dArr","‐":"dash","⫤":"Dashv","⊣":"dashv","⤏":"rBarr","˝":"dblac","Ď":"Dcaron","ď":"dcaron","Д":"Dcy","д":"dcy","⇊":"ddarr","ⅆ":"dd","⤑":"DDotrahd","⩷":"eDDot","°":"deg","∇":"Del","Δ":"Delta","δ":"delta","⦱":"demptyv","⥿":"dfisht","𝔇":"Dfr","𝔡":"dfr","⥥":"dHar","⇃":"dharl","⇂":"dharr","˙":"dot","`":"grave","˜":"tilde","⋄":"diam","♦":"diams","¨":"die","ϝ":"gammad","⋲":"disin","÷":"div","⋇":"divonx","Ђ":"DJcy","ђ":"djcy","⌞":"dlcorn","⌍":"dlcrop",$:"dollar","𝔻":"Dopf","𝕕":"dopf","⃜":"DotDot","≐":"doteq","≑":"eDot","∸":"minusd","∔":"plusdo","⊡":"sdotb","⇐":"lArr","⇔":"iff","⟸":"xlArr","⟺":"xhArr","⟹":"xrArr","⇒":"rArr","⊨":"vDash","⇑":"uArr","⇕":"vArr","∥":"par","⤓":"DownArrowBar","⇵":"duarr","̑":"DownBreve","⥐":"DownLeftRightVector","⥞":"DownLeftTeeVector","⥖":"DownLeftVectorBar","↽":"lhard","⥟":"DownRightTeeVector","⥗":"DownRightVectorBar","⇁":"rhard","↧":"mapstodown","⊤":"top","⤐":"RBarr","⌟":"drcorn","⌌":"drcrop","𝒟":"Dscr","𝒹":"dscr","Ѕ":"DScy","ѕ":"dscy","⧶":"dsol","Đ":"Dstrok","đ":"dstrok","⋱":"dtdot","▿":"dtri","⥯":"duhar","⦦":"dwangle","Џ":"DZcy","џ":"dzcy","⟿":"dzigrarr","É":"Eacute","é":"eacute","⩮":"easter","Ě":"Ecaron","ě":"ecaron","Ê":"Ecirc","ê":"ecirc","≖":"ecir","≕":"ecolon","Э":"Ecy","э":"ecy","Ė":"Edot","ė":"edot","ⅇ":"ee","≒":"efDot","𝔈":"Efr","𝔢":"efr","⪚":"eg","È":"Egrave","è":"egrave","⪖":"egs","⪘":"egsdot","⪙":"el","∈":"in","⏧":"elinters","ℓ":"ell","⪕":"els","⪗":"elsdot","Ē":"Emacr","ē":"emacr","∅":"empty","◻":"EmptySmallSquare","▫":"EmptyVerySmallSquare"," ":"emsp13"," ":"emsp14"," ":"emsp","Ŋ":"ENG","ŋ":"eng"," ":"ensp","Ę":"Eogon","ę":"eogon","𝔼":"Eopf","𝕖":"eopf","⋕":"epar","⧣":"eparsl","⩱":"eplus","ε":"epsi","Ε":"Epsilon","ϵ":"epsiv","≂":"esim","⩵":"Equal","=":"equals","≟":"equest","⇌":"rlhar","⩸":"equivDD","⧥":"eqvparsl","⥱":"erarr","≓":"erDot","ℯ":"escr","ℰ":"Escr","⩳":"Esim","Η":"Eta","η":"eta","Ð":"ETH","ð":"eth","Ë":"Euml","ë":"euml","€":"euro","!":"excl","∃":"exist","Ф":"Fcy","ф":"fcy","♀":"female","ffi":"ffilig","ff":"fflig","ffl":"ffllig","𝔉":"Ffr","𝔣":"ffr","fi":"filig","◼":"FilledSmallSquare",fj:"fjlig","♭":"flat","fl":"fllig","▱":"fltns","ƒ":"fnof","𝔽":"Fopf","𝕗":"fopf","∀":"forall","⋔":"fork","⫙":"forkv","ℱ":"Fscr","⨍":"fpartint","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","⅔":"frac23","⅖":"frac25","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","⁄":"frasl","⌢":"frown","𝒻":"fscr","ǵ":"gacute","Γ":"Gamma","γ":"gamma","Ϝ":"Gammad","⪆":"gap","Ğ":"Gbreve","ğ":"gbreve","Ģ":"Gcedil","Ĝ":"Gcirc","ĝ":"gcirc","Г":"Gcy","г":"gcy","Ġ":"Gdot","ġ":"gdot","≥":"ge","≧":"gE","⪌":"gEl","⋛":"gel","⩾":"ges","⪩":"gescc","⪀":"gesdot","⪂":"gesdoto","⪄":"gesdotol","⋛︀":"gesl","⪔":"gesles","𝔊":"Gfr","𝔤":"gfr","≫":"gg","⋙":"Gg","ℷ":"gimel","Ѓ":"GJcy","ѓ":"gjcy","⪥":"gla","≷":"gl","⪒":"glE","⪤":"glj","⪊":"gnap","⪈":"gne","≩":"gnE","⋧":"gnsim","𝔾":"Gopf","𝕘":"gopf","⪢":"GreaterGreater","≳":"gsim","𝒢":"Gscr","ℊ":"gscr","⪎":"gsime","⪐":"gsiml","⪧":"gtcc","⩺":"gtcir",">":"gt","⋗":"gtdot","⦕":"gtlPar","⩼":"gtquest","⥸":"gtrarr","≩︀":"gvnE"," ":"hairsp","ℋ":"Hscr","Ъ":"HARDcy","ъ":"hardcy","⥈":"harrcir","↔":"harr","↭":"harrw","^":"Hat","ℏ":"hbar","Ĥ":"Hcirc","ĥ":"hcirc","♥":"hearts","…":"mldr","⊹":"hercon","𝔥":"hfr","ℌ":"Hfr","⤥":"searhk","⤦":"swarhk","⇿":"hoarr","∻":"homtht","↩":"larrhk","↪":"rarrhk","𝕙":"hopf","ℍ":"Hopf","―":"horbar","𝒽":"hscr","Ħ":"Hstrok","ħ":"hstrok","⁃":"hybull","Í":"Iacute","í":"iacute","⁣":"ic","Î":"Icirc","î":"icirc","И":"Icy","и":"icy","İ":"Idot","Е":"IEcy","е":"iecy","¡":"iexcl","𝔦":"ifr","ℑ":"Im","Ì":"Igrave","ì":"igrave","ⅈ":"ii","⨌":"qint","∭":"tint","⧜":"iinfin","℩":"iiota","IJ":"IJlig","ij":"ijlig","Ī":"Imacr","ī":"imacr","ℐ":"Iscr","ı":"imath","⊷":"imof","Ƶ":"imped","℅":"incare","∞":"infin","⧝":"infintie","⊺":"intcal","∫":"int","∬":"Int","ℤ":"Zopf","⨗":"intlarhk","⨼":"iprod","⁢":"it","Ё":"IOcy","ё":"iocy","Į":"Iogon","į":"iogon","𝕀":"Iopf","𝕚":"iopf","Ι":"Iota","ι":"iota","¿":"iquest","𝒾":"iscr","⋵":"isindot","⋹":"isinE","⋴":"isins","⋳":"isinsv","Ĩ":"Itilde","ĩ":"itilde","І":"Iukcy","і":"iukcy","Ï":"Iuml","ï":"iuml","Ĵ":"Jcirc","ĵ":"jcirc","Й":"Jcy","й":"jcy","𝔍":"Jfr","𝔧":"jfr","ȷ":"jmath","𝕁":"Jopf","𝕛":"jopf","𝒥":"Jscr","𝒿":"jscr","Ј":"Jsercy","ј":"jsercy","Є":"Jukcy","є":"jukcy","Κ":"Kappa","κ":"kappa","ϰ":"kappav","Ķ":"Kcedil","ķ":"kcedil","К":"Kcy","к":"kcy","𝔎":"Kfr","𝔨":"kfr","ĸ":"kgreen","Х":"KHcy","х":"khcy","Ќ":"KJcy","ќ":"kjcy","𝕂":"Kopf","𝕜":"kopf","𝒦":"Kscr","𝓀":"kscr","⇚":"lAarr","Ĺ":"Lacute","ĺ":"lacute","⦴":"laemptyv","ℒ":"Lscr","Λ":"Lambda","λ":"lambda","⟨":"lang","⟪":"Lang","⦑":"langd","⪅":"lap","«":"laquo","⇤":"larrb","⤟":"larrbfs","←":"larr","↞":"Larr","⤝":"larrfs","↫":"larrlp","⤹":"larrpl","⥳":"larrsim","↢":"larrtl","⤙":"latail","⤛":"lAtail","⪫":"lat","⪭":"late","⪭︀":"lates","⤌":"lbarr","⤎":"lBarr","❲":"lbbrk","{":"lcub","[":"lsqb","⦋":"lbrke","⦏":"lbrksld","⦍":"lbrkslu","Ľ":"Lcaron","ľ":"lcaron","Ļ":"Lcedil","ļ":"lcedil","⌈":"lceil","Л":"Lcy","л":"lcy","⤶":"ldca","“":"ldquo","⥧":"ldrdhar","⥋":"ldrushar","↲":"ldsh","≤":"le","≦":"lE","⇆":"lrarr","⟦":"lobrk","⥡":"LeftDownTeeVector","⥙":"LeftDownVectorBar","⌊":"lfloor","↼":"lharu","⇇":"llarr","⇋":"lrhar","⥎":"LeftRightVector","↤":"mapstoleft","⥚":"LeftTeeVector","⋋":"lthree","⧏":"LeftTriangleBar","⊲":"vltri","⊴":"ltrie","⥑":"LeftUpDownVector","⥠":"LeftUpTeeVector","⥘":"LeftUpVectorBar","↿":"uharl","⥒":"LeftVectorBar","⪋":"lEg","⋚":"leg","⩽":"les","⪨":"lescc","⩿":"lesdot","⪁":"lesdoto","⪃":"lesdotor","⋚︀":"lesg","⪓":"lesges","⋖":"ltdot","≶":"lg","⪡":"LessLess","≲":"lsim","⥼":"lfisht","𝔏":"Lfr","𝔩":"lfr","⪑":"lgE","⥢":"lHar","⥪":"lharul","▄":"lhblk","Љ":"LJcy","љ":"ljcy","≪":"ll","⋘":"Ll","⥫":"llhard","◺":"lltri","Ŀ":"Lmidot","ŀ":"lmidot","⎰":"lmoust","⪉":"lnap","⪇":"lne","≨":"lnE","⋦":"lnsim","⟬":"loang","⇽":"loarr","⟵":"xlarr","⟷":"xharr","⟼":"xmap","⟶":"xrarr","↬":"rarrlp","⦅":"lopar","𝕃":"Lopf","𝕝":"lopf","⨭":"loplus","⨴":"lotimes","∗":"lowast",_:"lowbar","↙":"swarr","↘":"searr","◊":"loz","(":"lpar","⦓":"lparlt","⥭":"lrhard","‎":"lrm","⊿":"lrtri","‹":"lsaquo","𝓁":"lscr","↰":"lsh","⪍":"lsime","⪏":"lsimg","‘":"lsquo","‚":"sbquo","Ł":"Lstrok","ł":"lstrok","⪦":"ltcc","⩹":"ltcir","<":"lt","⋉":"ltimes","⥶":"ltlarr","⩻":"ltquest","◃":"ltri","⦖":"ltrPar","⥊":"lurdshar","⥦":"luruhar","≨︀":"lvnE","¯":"macr","♂":"male","✠":"malt","⤅":"Map","↦":"map","↥":"mapstoup","▮":"marker","⨩":"mcomma","М":"Mcy","м":"mcy","—":"mdash","∺":"mDDot"," ":"MediumSpace","ℳ":"Mscr","𝔐":"Mfr","𝔪":"mfr","℧":"mho","µ":"micro","⫰":"midcir","∣":"mid","−":"minus","⨪":"minusdu","∓":"mp","⫛":"mlcp","⊧":"models","𝕄":"Mopf","𝕞":"mopf","𝓂":"mscr","Μ":"Mu","μ":"mu","⊸":"mumap","Ń":"Nacute","ń":"nacute","∠⃒":"nang","≉":"nap","⩰̸":"napE","≋̸":"napid","ʼn":"napos","♮":"natur","ℕ":"Nopf"," ":"nbsp","≎̸":"nbump","≏̸":"nbumpe","⩃":"ncap","Ň":"Ncaron","ň":"ncaron","Ņ":"Ncedil","ņ":"ncedil","≇":"ncong","⩭̸":"ncongdot","⩂":"ncup","Н":"Ncy","н":"ncy","–":"ndash","⤤":"nearhk","↗":"nearr","⇗":"neArr","≠":"ne","≐̸":"nedot","​":"ZeroWidthSpace","≢":"nequiv","⤨":"toea","≂̸":"nesim","\n":"NewLine","∄":"nexist","𝔑":"Nfr","𝔫":"nfr","≧̸":"ngE","≱":"nge","⩾̸":"nges","⋙̸":"nGg","≵":"ngsim","≫⃒":"nGt","≯":"ngt","≫̸":"nGtv","↮":"nharr","⇎":"nhArr","⫲":"nhpar","∋":"ni","⋼":"nis","⋺":"nisd","Њ":"NJcy","њ":"njcy","↚":"nlarr","⇍":"nlArr","‥":"nldr","≦̸":"nlE","≰":"nle","⩽̸":"nles","≮":"nlt","⋘̸":"nLl","≴":"nlsim","≪⃒":"nLt","⋪":"nltri","⋬":"nltrie","≪̸":"nLtv","∤":"nmid","⁠":"NoBreak","𝕟":"nopf","⫬":"Not","¬":"not","≭":"NotCupCap","∦":"npar","∉":"notin","≹":"ntgl","⋵̸":"notindot","⋹̸":"notinE","⋷":"notinvb","⋶":"notinvc","⧏̸":"NotLeftTriangleBar","≸":"ntlg","⪢̸":"NotNestedGreaterGreater","⪡̸":"NotNestedLessLess","∌":"notni","⋾":"notnivb","⋽":"notnivc","⊀":"npr","⪯̸":"npre","⋠":"nprcue","⧐̸":"NotRightTriangleBar","⋫":"nrtri","⋭":"nrtrie","⊏̸":"NotSquareSubset","⋢":"nsqsube","⊐̸":"NotSquareSuperset","⋣":"nsqsupe","⊂⃒":"vnsub","⊈":"nsube","⊁":"nsc","⪰̸":"nsce","⋡":"nsccue","≿̸":"NotSucceedsTilde","⊃⃒":"vnsup","⊉":"nsupe","≁":"nsim","≄":"nsime","⫽⃥":"nparsl","∂̸":"npart","⨔":"npolint","⤳̸":"nrarrc","↛":"nrarr","⇏":"nrArr","↝̸":"nrarrw","𝒩":"Nscr","𝓃":"nscr","⊄":"nsub","⫅̸":"nsubE","⊅":"nsup","⫆̸":"nsupE","Ñ":"Ntilde","ñ":"ntilde","Ν":"Nu","ν":"nu","#":"num","№":"numero"," ":"numsp","≍⃒":"nvap","⊬":"nvdash","⊭":"nvDash","⊮":"nVdash","⊯":"nVDash","≥⃒":"nvge",">⃒":"nvgt","⤄":"nvHarr","⧞":"nvinfin","⤂":"nvlArr","≤⃒":"nvle","<⃒":"nvlt","⊴⃒":"nvltrie","⤃":"nvrArr","⊵⃒":"nvrtrie","∼⃒":"nvsim","⤣":"nwarhk","↖":"nwarr","⇖":"nwArr","⤧":"nwnear","Ó":"Oacute","ó":"oacute","Ô":"Ocirc","ô":"ocirc","О":"Ocy","о":"ocy","Ő":"Odblac","ő":"odblac","⨸":"odiv","⦼":"odsold","Œ":"OElig","œ":"oelig","⦿":"ofcir","𝔒":"Ofr","𝔬":"ofr","˛":"ogon","Ò":"Ograve","ò":"ograve","⧁":"ogt","⦵":"ohbar","Ω":"ohm","⦾":"olcir","⦻":"olcross","‾":"oline","⧀":"olt","Ō":"Omacr","ō":"omacr","ω":"omega","Ο":"Omicron","ο":"omicron","⦶":"omid","𝕆":"Oopf","𝕠":"oopf","⦷":"opar","⦹":"operp","⩔":"Or","∨":"or","⩝":"ord","ℴ":"oscr","ª":"ordf","º":"ordm","⊶":"origof","⩖":"oror","⩗":"orslope","⩛":"orv","𝒪":"Oscr","Ø":"Oslash","ø":"oslash","⊘":"osol","Õ":"Otilde","õ":"otilde","⨶":"otimesas","⨷":"Otimes","Ö":"Ouml","ö":"ouml","⌽":"ovbar","⏞":"OverBrace","⎴":"tbrk","⏜":"OverParenthesis","¶":"para","⫳":"parsim","⫽":"parsl","∂":"part","П":"Pcy","п":"pcy","%":"percnt",".":"period","‰":"permil","‱":"pertenk","𝔓":"Pfr","𝔭":"pfr","Φ":"Phi","φ":"phi","ϕ":"phiv","☎":"phone","Π":"Pi","π":"pi","ϖ":"piv","ℎ":"planckh","⨣":"plusacir","⨢":"pluscir","+":"plus","⨥":"plusdu","⩲":"pluse","±":"pm","⨦":"plussim","⨧":"plustwo","⨕":"pointint","𝕡":"popf","ℙ":"Popf","£":"pound","⪷":"prap","⪻":"Pr","≺":"pr","≼":"prcue","⪯":"pre","≾":"prsim","⪹":"prnap","⪵":"prnE","⋨":"prnsim","⪳":"prE","′":"prime","″":"Prime","∏":"prod","⌮":"profalar","⌒":"profline","⌓":"profsurf","∝":"prop","⊰":"prurel","𝒫":"Pscr","𝓅":"pscr","Ψ":"Psi","ψ":"psi"," ":"puncsp","𝔔":"Qfr","𝔮":"qfr","𝕢":"qopf","ℚ":"Qopf","⁗":"qprime","𝒬":"Qscr","𝓆":"qscr","⨖":"quatint","?":"quest",'"':"quot","⇛":"rAarr","∽̱":"race","Ŕ":"Racute","ŕ":"racute","√":"Sqrt","⦳":"raemptyv","⟩":"rang","⟫":"Rang","⦒":"rangd","⦥":"range","»":"raquo","⥵":"rarrap","⇥":"rarrb","⤠":"rarrbfs","⤳":"rarrc","→":"rarr","↠":"Rarr","⤞":"rarrfs","⥅":"rarrpl","⥴":"rarrsim","⤖":"Rarrtl","↣":"rarrtl","↝":"rarrw","⤚":"ratail","⤜":"rAtail","∶":"ratio","❳":"rbbrk","}":"rcub","]":"rsqb","⦌":"rbrke","⦎":"rbrksld","⦐":"rbrkslu","Ř":"Rcaron","ř":"rcaron","Ŗ":"Rcedil","ŗ":"rcedil","⌉":"rceil","Р":"Rcy","р":"rcy","⤷":"rdca","⥩":"rdldhar","↳":"rdsh","ℜ":"Re","ℛ":"Rscr","ℝ":"Ropf","▭":"rect","⥽":"rfisht","⌋":"rfloor","𝔯":"rfr","⥤":"rHar","⇀":"rharu","⥬":"rharul","Ρ":"Rho","ρ":"rho","ϱ":"rhov","⇄":"rlarr","⟧":"robrk","⥝":"RightDownTeeVector","⥕":"RightDownVectorBar","⇉":"rrarr","⊢":"vdash","⥛":"RightTeeVector","⋌":"rthree","⧐":"RightTriangleBar","⊳":"vrtri","⊵":"rtrie","⥏":"RightUpDownVector","⥜":"RightUpTeeVector","⥔":"RightUpVectorBar","↾":"uharr","⥓":"RightVectorBar","˚":"ring","‏":"rlm","⎱":"rmoust","⫮":"rnmid", -"⟭":"roang","⇾":"roarr","⦆":"ropar","𝕣":"ropf","⨮":"roplus","⨵":"rotimes","⥰":"RoundImplies",")":"rpar","⦔":"rpargt","⨒":"rppolint","›":"rsaquo","𝓇":"rscr","↱":"rsh","⋊":"rtimes","▹":"rtri","⧎":"rtriltri","⧴":"RuleDelayed","⥨":"ruluhar","℞":"rx","Ś":"Sacute","ś":"sacute","⪸":"scap","Š":"Scaron","š":"scaron","⪼":"Sc","≻":"sc","≽":"sccue","⪰":"sce","⪴":"scE","Ş":"Scedil","ş":"scedil","Ŝ":"Scirc","ŝ":"scirc","⪺":"scnap","⪶":"scnE","⋩":"scnsim","⨓":"scpolint","≿":"scsim","С":"Scy","с":"scy","⋅":"sdot","⩦":"sdote","⇘":"seArr","§":"sect",";":"semi","⤩":"tosa","✶":"sext","𝔖":"Sfr","𝔰":"sfr","♯":"sharp","Щ":"SHCHcy","щ":"shchcy","Ш":"SHcy","ш":"shcy","↑":"uarr","­":"shy","Σ":"Sigma","σ":"sigma","ς":"sigmaf","∼":"sim","⩪":"simdot","≃":"sime","⪞":"simg","⪠":"simgE","⪝":"siml","⪟":"simlE","≆":"simne","⨤":"simplus","⥲":"simrarr","⨳":"smashp","⧤":"smeparsl","⌣":"smile","⪪":"smt","⪬":"smte","⪬︀":"smtes","Ь":"SOFTcy","ь":"softcy","⌿":"solbar","⧄":"solb","/":"sol","𝕊":"Sopf","𝕤":"sopf","♠":"spades","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊏":"sqsub","⊑":"sqsube","⊐":"sqsup","⊒":"sqsupe","□":"squ","𝒮":"Sscr","𝓈":"sscr","⋆":"Star","☆":"star","⊂":"sub","⋐":"Sub","⪽":"subdot","⫅":"subE","⊆":"sube","⫃":"subedot","⫁":"submult","⫋":"subnE","⊊":"subne","⪿":"subplus","⥹":"subrarr","⫇":"subsim","⫕":"subsub","⫓":"subsup","∑":"sum","♪":"sung","¹":"sup1","²":"sup2","³":"sup3","⊃":"sup","⋑":"Sup","⪾":"supdot","⫘":"supdsub","⫆":"supE","⊇":"supe","⫄":"supedot","⟉":"suphsol","⫗":"suphsub","⥻":"suplarr","⫂":"supmult","⫌":"supnE","⊋":"supne","⫀":"supplus","⫈":"supsim","⫔":"supsub","⫖":"supsup","⇙":"swArr","⤪":"swnwar","ß":"szlig"," ":"Tab","⌖":"target","Τ":"Tau","τ":"tau","Ť":"Tcaron","ť":"tcaron","Ţ":"Tcedil","ţ":"tcedil","Т":"Tcy","т":"tcy","⃛":"tdot","⌕":"telrec","𝔗":"Tfr","𝔱":"tfr","∴":"there4","Θ":"Theta","θ":"theta","ϑ":"thetav","  ":"ThickSpace"," ":"thinsp","Þ":"THORN","þ":"thorn","⨱":"timesbar","×":"times","⨰":"timesd","⌶":"topbot","⫱":"topcir","𝕋":"Topf","𝕥":"topf","⫚":"topfork","‴":"tprime","™":"trade","▵":"utri","≜":"trie","◬":"tridot","⨺":"triminus","⨹":"triplus","⧍":"trisb","⨻":"tritime","⏢":"trpezium","𝒯":"Tscr","𝓉":"tscr","Ц":"TScy","ц":"tscy","Ћ":"TSHcy","ћ":"tshcy","Ŧ":"Tstrok","ŧ":"tstrok","Ú":"Uacute","ú":"uacute","↟":"Uarr","⥉":"Uarrocir","Ў":"Ubrcy","ў":"ubrcy","Ŭ":"Ubreve","ŭ":"ubreve","Û":"Ucirc","û":"ucirc","У":"Ucy","у":"ucy","⇅":"udarr","Ű":"Udblac","ű":"udblac","⥮":"udhar","⥾":"ufisht","𝔘":"Ufr","𝔲":"ufr","Ù":"Ugrave","ù":"ugrave","⥣":"uHar","▀":"uhblk","⌜":"ulcorn","⌏":"ulcrop","◸":"ultri","Ū":"Umacr","ū":"umacr","⏟":"UnderBrace","⏝":"UnderParenthesis","⊎":"uplus","Ų":"Uogon","ų":"uogon","𝕌":"Uopf","𝕦":"uopf","⤒":"UpArrowBar","↕":"varr","υ":"upsi","ϒ":"Upsi","Υ":"Upsilon","⇈":"uuarr","⌝":"urcorn","⌎":"urcrop","Ů":"Uring","ů":"uring","◹":"urtri","𝒰":"Uscr","𝓊":"uscr","⋰":"utdot","Ũ":"Utilde","ũ":"utilde","Ü":"Uuml","ü":"uuml","⦧":"uwangle","⦜":"vangrt","⊊︀":"vsubne","⫋︀":"vsubnE","⊋︀":"vsupne","⫌︀":"vsupnE","⫨":"vBar","⫫":"Vbar","⫩":"vBarv","В":"Vcy","в":"vcy","⊩":"Vdash","⊫":"VDash","⫦":"Vdashl","⊻":"veebar","≚":"veeeq","⋮":"vellip","|":"vert","‖":"Vert","❘":"VerticalSeparator","≀":"wr","𝔙":"Vfr","𝔳":"vfr","𝕍":"Vopf","𝕧":"vopf","𝒱":"Vscr","𝓋":"vscr","⊪":"Vvdash","⦚":"vzigzag","Ŵ":"Wcirc","ŵ":"wcirc","⩟":"wedbar","≙":"wedgeq","℘":"wp","𝔚":"Wfr","𝔴":"wfr","𝕎":"Wopf","𝕨":"wopf","𝒲":"Wscr","𝓌":"wscr","𝔛":"Xfr","𝔵":"xfr","Ξ":"Xi","ξ":"xi","⋻":"xnis","𝕏":"Xopf","𝕩":"xopf","𝒳":"Xscr","𝓍":"xscr","Ý":"Yacute","ý":"yacute","Я":"YAcy","я":"yacy","Ŷ":"Ycirc","ŷ":"ycirc","Ы":"Ycy","ы":"ycy","¥":"yen","𝔜":"Yfr","𝔶":"yfr","Ї":"YIcy","ї":"yicy","𝕐":"Yopf","𝕪":"yopf","𝒴":"Yscr","𝓎":"yscr","Ю":"YUcy","ю":"yucy","ÿ":"yuml","Ÿ":"Yuml","Ź":"Zacute","ź":"zacute","Ž":"Zcaron","ž":"zcaron","З":"Zcy","з":"zcy","Ż":"Zdot","ż":"zdot","ℨ":"Zfr","Ζ":"Zeta","ζ":"zeta","𝔷":"zfr","Ж":"ZHcy","ж":"zhcy","⇝":"zigrarr","𝕫":"zopf","𝒵":"Zscr","𝓏":"zscr","‍":"zwj","‌":"zwnj"},f=/["&'<>`]/g,d={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},p=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,g=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,m=/&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|iacute|Uacute|plusmn|otilde|Otilde|Agrave|agrave|yacute|Yacute|oslash|Oslash|Atilde|atilde|brvbar|Ccedil|ccedil|ograve|curren|divide|Eacute|eacute|Ograve|oacute|Egrave|egrave|ugrave|frac12|frac14|frac34|Ugrave|Oacute|Iacute|ntilde|Ntilde|uacute|middot|Igrave|igrave|iquest|aacute|laquo|THORN|micro|iexcl|icirc|Icirc|Acirc|ucirc|ecirc|Ocirc|ocirc|Ecirc|Ucirc|aring|Aring|aelig|AElig|acute|pound|raquo|acirc|times|thorn|szlig|cedil|COPY|Auml|ordf|ordm|uuml|macr|Uuml|auml|Ouml|ouml|para|nbsp|Euml|quot|QUOT|euml|yuml|cent|sect|copy|sup1|sup2|sup3|Iuml|iuml|shy|eth|reg|not|yen|amp|AMP|REG|uml|ETH|deg|gt|GT|LT|lt)([=a-zA-Z0-9])?/g,y={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅","in":"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺","int":"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"},v={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"},b={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},_=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],x=String.fromCharCode,w={},A=w.hasOwnProperty,E=function(t,e){return A.call(t,e)},k=function(t,e){for(var n=-1,r=t.length;++n=55296&&57343>=t||t>1114111?(e&&S("character reference outside the permissible Unicode range"),"�"):E(b,t)?(e&&S("disallowed character reference"),b[t]):(e&&k(_,t)&&S("disallowed character reference"),t>65535&&(t-=65536,n+=x(t>>>10&1023|55296),t=56320|1023&t),n+=x(t))},M=function(t){return"&#x"+t.charCodeAt(0).toString(16).toUpperCase()+";"},S=function(t){throw Error("Parse error: "+t)},T=function(t,e){e=D(e,T.options);var n=e.strict;n&&g.test(t)&&S("forbidden code point");var r=e.encodeEverything,i=e.useNamedReferences,a=e.allowUnsafeSymbols;return r?(t=t.replace(s,function(t){return i&&E(h,t)?"&"+h[t]+";":M(t)}),i&&(t=t.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),i&&(t=t.replace(l,function(t){return"&"+h[t]+";"}))):i?(a||(t=t.replace(f,function(t){return"&"+h[t]+";"})),t=t.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒"),t=t.replace(l,function(t){return"&"+h[t]+";"})):a||(t=t.replace(f,M)),t.replace(o,function(t){var e=t.charCodeAt(0),n=t.charCodeAt(1),r=1024*(e-55296)+n-56320+65536;return"&#x"+r.toString(16).toUpperCase()+";"}).replace(c,M)};T.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1};var F=function(t,e){e=D(e,F.options);var n=e.strict;return n&&p.test(t)&&S("malformed character reference"),t.replace(m,function(t,r,i,a,u,o,s,c){var l,h,f,d,p;return r?(l=r,h=i,n&&!h&&S("character reference was not terminated by a semicolon"),C(l,n)):a?(f=a,h=u,n&&!h&&S("character reference was not terminated by a semicolon"),l=parseInt(f,16),C(l,n)):o?(d=o,E(y,d)?y[d]:(n&&S("named character reference was not terminated by a semicolon"),t)):(d=s,p=c,p&&e.isAttributeValue?(n&&"="==p&&S("`&` did not start a character reference"),t):(n&&S("named character reference was not terminated by a semicolon"),v[d]+(p||"")))})};F.options={isAttributeValue:!1,strict:!1};var B=function(t){return t.replace(f,function(t){return d[t]})},L={version:"0.5.0",encode:T,decode:F,escape:B,unescape:F};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return L});else if(i&&!i.nodeType)if(a)a.exports=L;else for(var N in L)E(L,N)&&(i[N]=L[N]);else r.he=L}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],106:[function(t,e,n){!function(t,r){"object"==typeof n&&"undefined"!=typeof e?e.exports=r():"function"==typeof define&&define.amd?define(r):t.moment=r()}(this,function(){"use strict";function n(){return In.apply(null,arguments)}function r(t){In=t}function i(t){return"[object Array]"===Object.prototype.toString.call(t)}function a(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function u(t,e){var n,r=[];for(n=0;n0)for(n in Pn)r=Pn[n],i=e[r],"undefined"!=typeof i&&(t[r]=i);return t}function g(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():0/0),qn===!1&&(qn=!0,n.updateOffset(this),qn=!1)}function m(t){return t instanceof g||null!=t&&null!=t._isAMomentObject}function y(t){return 0>t?Math.ceil(t):Math.floor(t)}function v(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=y(e)),n}function b(t,e,n){var r,i=Math.min(t.length,e.length),a=Math.abs(t.length-e.length),u=0;for(r=0;i>r;r++)(n&&t[r]!==e[r]||!n&&v(t[r])!==v(e[r]))&&u++;return u+a}function _(){}function x(t){return t?t.toLowerCase().replace("_","-"):t}function w(t){for(var e,n,r,i,a=0;a0;){if(r=A(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&b(i,n,!0)>=e-1)break;e--}a++}return null}function A(n){var r=null;if(!jn[n]&&"undefined"!=typeof e&&e&&e.exports)try{r=Rn._abbr,t("./locale/"+n),E(r)}catch(i){}return jn[n]}function E(t,e){var n;return t&&(n="undefined"==typeof e?D(t):k(t,e),n&&(Rn=n)),Rn._abbr}function k(t,e){return null!==e?(e.abbr=t,jn[t]=jn[t]||new _,jn[t].set(e),E(t),jn[t]):(delete jn[t],null)}function D(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Rn;if(!i(t)){if(e=A(t))return e;t=[t]}return w(t)}function C(t,e){var n=t.toLowerCase();Un[n]=Un[n+"s"]=Un[e]=t}function M(t){return"string"==typeof t?Un[t]||Un[t.toLowerCase()]:void 0}function S(t){var e,n,r={};for(n in t)o(t,n)&&(e=M(n),e&&(r[e]=t[n]));return r}function T(t,e){return function(r){return null!=r?(B(this,t,r),n.updateOffset(this,e),this):F(this,t)}}function F(t,e){return t._d["get"+(t._isUTC?"UTC":"")+e]()}function B(t,e,n){return t._d["set"+(t._isUTC?"UTC":"")+e](n)}function L(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if(t=M(t),"function"==typeof this[t])return this[t](e);return this}function N(t,e,n){var r=""+Math.abs(t),i=e-r.length,a=t>=0;return(a?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}function O(t,e,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),t&&($n[t]=i),e&&($n[e[0]]=function(){return N(i.apply(this,arguments),e[1],e[2])}),n&&($n[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function I(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function R(t){var e,n,r=t.match(Yn);for(e=0,n=r.length;n>e;e++)r[e]=$n[r[e]]?$n[r[e]]:I(r[e]);return function(i){var a="";for(e=0;n>e;e++)a+=r[e]instanceof Function?r[e].call(i,t):r[e];return a}}function P(t,e){return t.isValid()?(e=q(e,t.localeData()),Vn[e]=Vn[e]||R(e),Vn[e](t)):t.localeData().invalidDate()}function q(t,e){function n(t){return e.longDateFormat(t)||t}var r=5;for(zn.lastIndex=0;r>=0&&zn.test(t);)t=t.replace(zn,n),zn.lastIndex=0,r-=1;return t}function j(t){return"function"==typeof t&&"[object Function]"===Object.prototype.toString.call(t)}function U(t,e,n){ur[t]=j(e)?e:function(t){return t&&n?n:e}}function Y(t,e){return o(ur,t)?ur[t](e._strict,e._locale):new RegExp(z(t))}function z(t){return t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,r,i){return e||n||r||i}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function V(t,e){var n,r=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(r=function(t,n){n[e]=v(t)}),n=0;nr;r++){if(i=c([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[r].test(t))return r;if(n&&"MMM"===e&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function J(t,e){var n;return"string"==typeof e&&(e=t.localeData().monthsParse(e),"number"!=typeof e)?t:(n=Math.min(t.date(),H(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t)}function K(t){return null!=t?(J(this,t),n.updateOffset(this,!0),this):F(this,"Month")}function Q(){return H(this.year(),this.month())}function tt(t){var e,n=t._a;return n&&-2===h(t).overflow&&(e=n[cr]<0||n[cr]>11?cr:n[lr]<1||n[lr]>H(n[sr],n[cr])?lr:n[hr]<0||n[hr]>24||24===n[hr]&&(0!==n[fr]||0!==n[dr]||0!==n[pr])?hr:n[fr]<0||n[fr]>59?fr:n[dr]<0||n[dr]>59?dr:n[pr]<0||n[pr]>999?pr:-1,h(t)._overflowDayOfYear&&(sr>e||e>lr)&&(e=lr),h(t).overflow=e),t}function et(t){n.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function nt(t,e){var n=!0;return s(function(){return n&&(et(t+"\n"+(new Error).stack),n=!1),e.apply(this,arguments)},e)}function rt(t,e){yr[t]||(et(e),yr[t]=!0)}function it(t){var e,n,r=t._i,i=vr.exec(r);if(i){for(h(t).iso=!0,e=0,n=br.length;n>e;e++)if(br[e][1].exec(r)){t._f=br[e][0];break}for(e=0,n=_r.length;n>e;e++)if(_r[e][1].exec(r)){t._f+=(i[6]||" ")+_r[e][0];break}r.match(rr)&&(t._f+="Z"),At(t)}else t._isValid=!1}function at(t){var e=xr.exec(t._i);return null!==e?void(t._d=new Date(+e[1])):(it(t),void(t._isValid===!1&&(delete t._isValid,n.createFromInputFallback(t))))}function ut(t,e,n,r,i,a,u){var o=new Date(t,e,n,r,i,a,u);return 1970>t&&o.setFullYear(t),o}function ot(t){var e=new Date(Date.UTC.apply(null,arguments));return 1970>t&&e.setUTCFullYear(t),e}function st(t){return ct(t)?366:365}function ct(t){return t%4===0&&t%100!==0||t%400===0}function lt(){return ct(this.year())}function ht(t,e,n){var r,i=n-e,a=n-t.day();return a>i&&(a-=7),i-7>a&&(a+=7),r=Ft(t).add(a,"d"),{week:Math.ceil(r.dayOfYear()/7),year:r.year()}}function ft(t){return ht(t,this._week.dow,this._week.doy).week}function dt(){return this._week.dow}function pt(){return this._week.doy}function gt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function mt(t){var e=ht(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function yt(t,e,n,r,i){var a,u=6+i-r,o=ot(t,0,1+u),s=o.getUTCDay();return i>s&&(s+=7),n=null!=n?1*n:i,a=1+u+7*(e-1)-s+n,{year:a>0?t:t-1,dayOfYear:a>0?a:st(t-1)+a}}function vt(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function bt(t,e,n){return null!=t?t:null!=e?e:n}function _t(t){var e=new Date;return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function xt(t){var e,n,r,i,a=[];if(!t._d){for(r=_t(t),t._w&&null==t._a[lr]&&null==t._a[cr]&&wt(t),t._dayOfYear&&(i=bt(t._a[sr],r[sr]),t._dayOfYear>st(i)&&(h(t)._overflowDayOfYear=!0),n=ot(i,0,t._dayOfYear),t._a[cr]=n.getUTCMonth(),t._a[lr]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=a[e]=r[e];for(;7>e;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[hr]&&0===t._a[fr]&&0===t._a[dr]&&0===t._a[pr]&&(t._nextDay=!0,t._a[hr]=0),t._d=(t._useUTC?ot:ut).apply(null,a),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[hr]=24)}}function wt(t){var e,n,r,i,a,u,o;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(a=1,u=4,n=bt(e.GG,t._a[sr],ht(Ft(),1,4).year),r=bt(e.W,1),i=bt(e.E,1)):(a=t._locale._week.dow,u=t._locale._week.doy,n=bt(e.gg,t._a[sr],ht(Ft(),a,u).year),r=bt(e.w,1),null!=e.d?(i=e.d,a>i&&++r):i=null!=e.e?e.e+a:a),o=yt(n,r,i,u,a),t._a[sr]=o.year,t._dayOfYear=o.dayOfYear}function At(t){if(t._f===n.ISO_8601)return void it(t);t._a=[],h(t).empty=!0;var e,r,i,a,u,o=""+t._i,s=o.length,c=0;for(i=q(t._f,t._locale).match(Yn)||[],e=0;e0&&h(t).unusedInput.push(u),o=o.slice(o.indexOf(r)+r.length),c+=r.length),$n[a]?(r?h(t).empty=!1:h(t).unusedTokens.push(a),G(a,r,t)):t._strict&&!r&&h(t).unusedTokens.push(a);h(t).charsLeftOver=s-c,o.length>0&&h(t).unusedInput.push(o),h(t).bigHour===!0&&t._a[hr]<=12&&t._a[hr]>0&&(h(t).bigHour=void 0),t._a[hr]=Et(t._locale,t._a[hr],t._meridiem),xt(t),tt(t)}function Et(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(r=t.isPM(n),r&&12>e&&(e+=12),r||12!==e||(e=0),e):e}function kt(t){var e,n,r,i,a;if(0===t._f.length)return h(t).invalidFormat=!0,void(t._d=new Date(0/0));for(i=0;ia)&&(r=a,n=e));s(t,n||e)}function Dt(t){if(!t._d){var e=S(t._i);t._a=[e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],xt(t)}}function Ct(t){var e=new g(tt(Mt(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Mt(t){var e=t._i,n=t._f;return t._locale=t._locale||D(t._l),null===e||void 0===n&&""===e?d({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),m(e)?new g(tt(e)):(i(n)?kt(t):n?At(t):a(e)?t._d=e:St(t),t))}function St(t){var e=t._i;void 0===e?t._d=new Date:a(e)?t._d=new Date(+e):"string"==typeof e?at(t):i(e)?(t._a=u(e.slice(0),function(t){return parseInt(t,10)}),xt(t)):"object"==typeof e?Dt(t):"number"==typeof e?t._d=new Date(e):n.createFromInputFallback(t)}function Tt(t,e,n,r,i){var a={};return"boolean"==typeof n&&(r=n,n=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=t,a._f=e,a._strict=r,Ct(a)}function Ft(t,e,n,r){return Tt(t,e,n,r,!1)}function Bt(t,e){var n,r;if(1===e.length&&i(e[0])&&(e=e[0]),!e.length)return Ft();for(n=e[0],r=1;rt&&(t=-t,n="-"),n+N(~~(t/60),2)+e+N(~~t%60,2)})}function Pt(t){var e=(t||"").match(rr)||[],n=e[e.length-1]||[],r=(n+"").match(Dr)||["-",0,0],i=+(60*r[1])+v(r[2]);return"+"===r[0]?i:-i}function qt(t,e){var r,i;return e._isUTC?(r=e.clone(),i=(m(t)||a(t)?+t:+Ft(t))-+r,r._d.setTime(+r._d+i),n.updateOffset(r,!1),r):Ft(t).local()}function jt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Ut(t,e){var r,i=this._offset||0;return null!=t?("string"==typeof t&&(t=Pt(t)),Math.abs(t)<16&&(t=60*t),!this._isUTC&&e&&(r=jt(this)),this._offset=t,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==t&&(!e||this._changeInProgress?re(this,Kt(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:jt(this)}function Yt(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function zt(t){return this.utcOffset(0,t)}function Vt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(jt(this),"m")),this}function $t(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Pt(this._i)),this}function Gt(t){return t=t?Ft(t).utcOffset():0,(this.utcOffset()-t)%60===0}function Ht(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Wt(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var t={};if(p(t,this),t=Mt(t),t._a){var e=t._isUTC?c(t._a):Ft(t._a);this._isDSTShifted=this.isValid()&&b(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Zt(){return!this._isUTC}function Xt(){return this._isUTC}function Jt(){return this._isUTC&&0===this._offset}function Kt(t,e){var n,r,i,a=t,u=null;return It(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(a={},e?a[e]=t:a.milliseconds=t):(u=Cr.exec(t))?(n="-"===u[1]?-1:1,a={y:0,d:v(u[lr])*n,h:v(u[hr])*n,m:v(u[fr])*n,s:v(u[dr])*n,ms:v(u[pr])*n}):(u=Mr.exec(t))?(n="-"===u[1]?-1:1,a={y:Qt(u[2],n),M:Qt(u[3],n),d:Qt(u[4],n),h:Qt(u[5],n),m:Qt(u[6],n),s:Qt(u[7],n),w:Qt(u[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(i=ee(Ft(a.from),Ft(a.to)),a={},a.ms=i.milliseconds,a.M=i.months),r=new Ot(a),It(t)&&o(t,"_locale")&&(r._locale=t._locale),r}function Qt(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function te(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function ee(t,e){var n;return e=qt(e,t),t.isBefore(e)?n=te(t,e):(n=te(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n}function ne(t,e){return function(n,r){var i,a;return null===r||isNaN(+r)||(rt(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),a=n,n=r,r=a),n="string"==typeof n?+n:n,i=Kt(n,r),re(this,i,t),this}}function re(t,e,r,i){var a=e._milliseconds,u=e._days,o=e._months;i=null==i?!0:i,a&&t._d.setTime(+t._d+a*r),u&&B(t,"Date",F(t,"Date")+u*r),o&&J(t,F(t,"Month")+o*r),i&&n.updateOffset(t,u||o)}function ie(t,e){var n=t||Ft(),r=qt(n,this).startOf("day"),i=this.diff(r,"days",!0),a=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse";return this.format(e&&e[a]||this.localeData().calendar(a,this,Ft(n)))}function ae(){return new g(this)}function ue(t,e){var n;return e=M("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=m(t)?t:Ft(t),+this>+t):(n=m(t)?+t:+Ft(t),n<+this.clone().startOf(e))}function oe(t,e){var n;return e=M("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=m(t)?t:Ft(t),+t>+this):(n=m(t)?+t:+Ft(t),+this.clone().endOf(e)e-a?(n=t.clone().add(i-1,"months"),r=(e-a)/(a-n)):(n=t.clone().add(i+1,"months"),r=(e-a)/(n-a)),-(i+r)}function fe(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function de(){var t=this.clone().utc();return 0e;e++)if(this._weekdaysParse[e]||(n=Ft([2e3,1]).day(e),r="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[e]=new RegExp(r.replace(".",""),"i")),this._weekdaysParse[e].test(t))return e}function ze(t){var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Pe(t,this.localeData()),this.add(t-e,"d")):e}function Ve(t){var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function $e(t){return null==t?this.day()||7:this.day(this.day()%7?t:t-7)}function Ge(t,e){O(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function He(t,e){return e._meridiemParse}function We(t){return"p"===(t+"").toLowerCase().charAt(0)}function Ze(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function Xe(t,e){e[pr]=v(1e3*("0."+t))}function Je(){return this._isUTC?"UTC":""}function Ke(){return this._isUTC?"Coordinated Universal Time":""}function Qe(t){return Ft(1e3*t)}function tn(){return Ft.apply(null,arguments).parseZone()}function en(t,e,n){var r=this._calendar[t];return"function"==typeof r?r.call(e,n):r}function nn(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function rn(){return this._invalidDate}function an(t){return this._ordinal.replace("%d",t)}function un(t){return t}function on(t,e,n,r){var i=this._relativeTime[n];return"function"==typeof i?i(t,e,n,r):i.replace(/%d/i,t)}function sn(t,e){var n=this._relativeTime[t>0?"future":"past"];return"function"==typeof n?n(e):n.replace(/%s/i,e)}function cn(t){var e,n;for(n in t)e=t[n],"function"==typeof e?this[n]=e:this["_"+n]=e;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function ln(t,e,n,r){var i=D(),a=c().set(r,e);return i[n](a,t)}function hn(t,e,n,r,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return ln(t,e,n,i);var a,u=[];for(a=0;r>a;a++)u[a]=ln(t,a,n,i);return u}function fn(t,e){return hn(t,e,"months",12,"month")}function dn(t,e){return hn(t,e,"monthsShort",12,"month")}function pn(t,e){return hn(t,e,"weekdays",7,"day")}function gn(t,e){return hn(t,e,"weekdaysShort",7,"day")}function mn(t,e){return hn(t,e,"weekdaysMin",7,"day")}function yn(){var t=this._data;return this._milliseconds=Jr(this._milliseconds),this._days=Jr(this._days),this._months=Jr(this._months),t.milliseconds=Jr(t.milliseconds),t.seconds=Jr(t.seconds),t.minutes=Jr(t.minutes),t.hours=Jr(t.hours),t.months=Jr(t.months),t.years=Jr(t.years),this}function vn(t,e,n,r){var i=Kt(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function bn(t,e){return vn(this,t,e,1)}function _n(t,e){return vn(this,t,e,-1)}function xn(t){return 0>t?Math.floor(t):Math.ceil(t)}function wn(){var t,e,n,r,i,a=this._milliseconds,u=this._days,o=this._months,s=this._data;return a>=0&&u>=0&&o>=0||0>=a&&0>=u&&0>=o||(a+=864e5*xn(En(o)+u),u=0,o=0),s.milliseconds=a%1e3,t=y(a/1e3),s.seconds=t%60,e=y(t/60),s.minutes=e%60,n=y(e/60),s.hours=n%24,u+=y(n/24),i=y(An(u)),o+=i,u-=xn(En(i)),r=y(o/12),o%=12,s.days=u,s.months=o,s.years=r,this}function An(t){return 4800*t/146097}function En(t){return 146097*t/4800}function kn(t){var e,n,r=this._milliseconds;if(t=M(t),"month"===t||"year"===t)return e=this._days+r/864e5,n=this._months+An(e),"month"===t?n:n/12;switch(e=this._days+Math.round(En(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}}function Dn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*v(this._months/12)}function Cn(t){return function(){return this.as(t)}}function Mn(t){return t=M(t),this[t+"s"]()}function Sn(t){return function(){return this._data[t]}}function Tn(){return y(this.days()/7)}function Fn(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function Bn(t,e,n){var r=Kt(t).abs(),i=di(r.as("s")),a=di(r.as("m")),u=di(r.as("h")),o=di(r.as("d")),s=di(r.as("M")),c=di(r.as("y")),l=i0,l[4]=n,Fn.apply(null,l)}function Ln(t,e){return void 0===pi[t]?!1:void 0===e?pi[t]:(pi[t]=e,!0)}function Nn(t){var e=this.localeData(),n=Bn(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function On(){var t,e,n,r=gi(this._milliseconds)/1e3,i=gi(this._days),a=gi(this._months);t=y(r/60),e=y(t/60),r%=60,t%=60,n=y(a/12),a%=12;var u=n,o=a,s=i,c=e,l=t,h=r,f=this.asSeconds();return f?(0>f?"-":"")+"P"+(u?u+"Y":"")+(o?o+"M":"")+(s?s+"D":"")+(c||l||h?"T":"")+(c?c+"H":"")+(l?l+"M":"")+(h?h+"S":""):"P0D"}var In,Rn,Pn=n.momentProperties=[],qn=!1,jn={},Un={},Yn=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,zn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Vn={},$n={},Gn=/\d/,Hn=/\d\d/,Wn=/\d{3}/,Zn=/\d{4}/,Xn=/[+-]?\d{6}/,Jn=/\d\d?/,Kn=/\d{1,3}/,Qn=/\d{1,4}/,tr=/[+-]?\d{1,6}/,er=/\d+/,nr=/[+-]?\d+/,rr=/Z|[+-]\d\d:?\d\d/gi,ir=/[+-]?\d+(\.\d{1,3})?/,ar=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,ur={},or={},sr=0,cr=1,lr=2,hr=3,fr=4,dr=5,pr=6;O("M",["MM",2],"Mo",function(){return this.month()+1}),O("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),O("MMMM",0,0,function(t){return this.localeData().months(this,t)}),C("month","M"),U("M",Jn),U("MM",Jn,Hn),U("MMM",ar),U("MMMM",ar),V(["M","MM"],function(t,e){e[cr]=v(t)-1}),V(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);null!=i?e[cr]=i:h(n).invalidMonth=t});var gr="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),mr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),yr={};n.suppressDeprecationWarnings=!1;var vr=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,br=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],_r=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],xr=/^\/?Date\((\-?\d+)/i;n.createFromInputFallback=nt("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),O(0,["YY",2],0,function(){return this.year()%100}),O(0,["YYYY",4],0,"year"),O(0,["YYYYY",5],0,"year"),O(0,["YYYYYY",6,!0],0,"year"),C("year","y"),U("Y",nr),U("YY",Jn,Hn),U("YYYY",Qn,Zn),U("YYYYY",tr,Xn),U("YYYYYY",tr,Xn),V(["YYYYY","YYYYYY"],sr),V("YYYY",function(t,e){e[sr]=2===t.length?n.parseTwoDigitYear(t):v(t)}),V("YY",function(t,e){e[sr]=n.parseTwoDigitYear(t)}),n.parseTwoDigitYear=function(t){return v(t)+(v(t)>68?1900:2e3)};var wr=T("FullYear",!1);O("w",["ww",2],"wo","week"),O("W",["WW",2],"Wo","isoWeek"),C("week","w"),C("isoWeek","W"),U("w",Jn),U("ww",Jn,Hn),U("W",Jn),U("WW",Jn,Hn),$(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=v(t)});var Ar={dow:0,doy:6};O("DDD",["DDDD",3],"DDDo","dayOfYear"),C("dayOfYear","DDD"),U("DDD",Kn),U("DDDD",Wn),V(["DDD","DDDD"],function(t,e,n){n._dayOfYear=v(t)}),n.ISO_8601=function(){};var Er=nt("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Ft.apply(null,arguments);return this>t?this:t}),kr=nt("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Ft.apply(null,arguments);return t>this?this:t});Rt("Z",":"),Rt("ZZ",""),U("Z",rr),U("ZZ",rr),V(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Pt(t)});var Dr=/([\+\-]|\d\d)/gi;n.updateOffset=function(){};var Cr=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Mr=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Kt.fn=Ot.prototype;var Sr=ne(1,"add"),Tr=ne(-1,"subtract");n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Fr=nt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});O(0,["gg",2],0,function(){return this.weekYear()%100}),O(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Fe("gggg","weekYear"),Fe("ggggg","weekYear"),Fe("GGGG","isoWeekYear"),Fe("GGGGG","isoWeekYear"),C("weekYear","gg"),C("isoWeekYear","GG"),U("G",nr),U("g",nr),U("GG",Jn,Hn),U("gg",Jn,Hn),U("GGGG",Qn,Zn),U("gggg",Qn,Zn),U("GGGGG",tr,Xn),U("ggggg",tr,Xn),$(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=v(t)}),$(["gg","GG"],function(t,e,r,i){e[i]=n.parseTwoDigitYear(t)}),O("Q",0,0,"quarter"),C("quarter","Q"),U("Q",Gn),V("Q",function(t,e){e[cr]=3*(v(t)-1)}),O("D",["DD",2],"Do","date"),C("date","D"),U("D",Jn),U("DD",Jn,Hn),U("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),V(["D","DD"],lr),V("Do",function(t,e){e[lr]=v(t.match(Jn)[0],10)});var Br=T("Date",!0);O("d",0,"do","day"),O("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),O("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),O("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),O("e",0,0,"weekday"),O("E",0,0,"isoWeekday"),C("day","d"),C("weekday","e"),C("isoWeekday","E"),U("d",Jn),U("e",Jn),U("E",Jn),U("dd",ar),U("ddd",ar),U("dddd",ar),$(["dd","ddd","dddd"],function(t,e,n){var r=n._locale.weekdaysParse(t); - -null!=r?e.d=r:h(n).invalidWeekday=t}),$(["d","e","E"],function(t,e,n,r){e[r]=v(t)});var Lr="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Nr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Or="Su_Mo_Tu_We_Th_Fr_Sa".split("_");O("H",["HH",2],0,"hour"),O("h",["hh",2],0,function(){return this.hours()%12||12}),Ge("a",!0),Ge("A",!1),C("hour","h"),U("a",He),U("A",He),U("H",Jn),U("h",Jn),U("HH",Jn,Hn),U("hh",Jn,Hn),V(["H","HH"],hr),V(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),V(["h","hh"],function(t,e,n){e[hr]=v(t),h(n).bigHour=!0});var Ir=/[ap]\.?m?\.?/i,Rr=T("Hours",!0);O("m",["mm",2],0,"minute"),C("minute","m"),U("m",Jn),U("mm",Jn,Hn),V(["m","mm"],fr);var Pr=T("Minutes",!1);O("s",["ss",2],0,"second"),C("second","s"),U("s",Jn),U("ss",Jn,Hn),V(["s","ss"],dr);var qr=T("Seconds",!1);O("S",0,0,function(){return~~(this.millisecond()/100)}),O(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),O(0,["SSS",3],0,"millisecond"),O(0,["SSSS",4],0,function(){return 10*this.millisecond()}),O(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),O(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),O(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),O(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),O(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),C("millisecond","ms"),U("S",Kn,Gn),U("SS",Kn,Hn),U("SSS",Kn,Wn);var jr;for(jr="SSSS";jr.length<=9;jr+="S")U(jr,er);for(jr="S";jr.length<=9;jr+="S")V(jr,Xe);var Ur=T("Milliseconds",!1);O("z",0,0,"zoneAbbr"),O("zz",0,0,"zoneName");var Yr=g.prototype;Yr.add=Sr,Yr.calendar=ie,Yr.clone=ae,Yr.diff=le,Yr.endOf=we,Yr.format=pe,Yr.from=ge,Yr.fromNow=me,Yr.to=ye,Yr.toNow=ve,Yr.get=L,Yr.invalidAt=Te,Yr.isAfter=ue,Yr.isBefore=oe,Yr.isBetween=se,Yr.isSame=ce,Yr.isValid=Me,Yr.lang=Fr,Yr.locale=be,Yr.localeData=_e,Yr.max=kr,Yr.min=Er,Yr.parsingFlags=Se,Yr.set=L,Yr.startOf=xe,Yr.subtract=Tr,Yr.toArray=De,Yr.toObject=Ce,Yr.toDate=ke,Yr.toISOString=de,Yr.toJSON=de,Yr.toString=fe,Yr.unix=Ee,Yr.valueOf=Ae,Yr.year=wr,Yr.isLeapYear=lt,Yr.weekYear=Le,Yr.isoWeekYear=Ne,Yr.quarter=Yr.quarters=Re,Yr.month=K,Yr.daysInMonth=Q,Yr.week=Yr.weeks=gt,Yr.isoWeek=Yr.isoWeeks=mt,Yr.weeksInYear=Ie,Yr.isoWeeksInYear=Oe,Yr.date=Br,Yr.day=Yr.days=ze,Yr.weekday=Ve,Yr.isoWeekday=$e,Yr.dayOfYear=vt,Yr.hour=Yr.hours=Rr,Yr.minute=Yr.minutes=Pr,Yr.second=Yr.seconds=qr,Yr.millisecond=Yr.milliseconds=Ur,Yr.utcOffset=Ut,Yr.utc=zt,Yr.local=Vt,Yr.parseZone=$t,Yr.hasAlignedHourOffset=Gt,Yr.isDST=Ht,Yr.isDSTShifted=Wt,Yr.isLocal=Zt,Yr.isUtcOffset=Xt,Yr.isUtc=Jt,Yr.isUTC=Jt,Yr.zoneAbbr=Je,Yr.zoneName=Ke,Yr.dates=nt("dates accessor is deprecated. Use date instead.",Br),Yr.months=nt("months accessor is deprecated. Use month instead",K),Yr.years=nt("years accessor is deprecated. Use year instead",wr),Yr.zone=nt("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Yt);var zr=Yr,Vr={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},$r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Gr="Invalid date",Hr="%d",Wr=/\d{1,2}/,Zr={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Xr=_.prototype;Xr._calendar=Vr,Xr.calendar=en,Xr._longDateFormat=$r,Xr.longDateFormat=nn,Xr._invalidDate=Gr,Xr.invalidDate=rn,Xr._ordinal=Hr,Xr.ordinal=an,Xr._ordinalParse=Wr,Xr.preparse=un,Xr.postformat=un,Xr._relativeTime=Zr,Xr.relativeTime=on,Xr.pastFuture=sn,Xr.set=cn,Xr.months=W,Xr._months=gr,Xr.monthsShort=Z,Xr._monthsShort=mr,Xr.monthsParse=X,Xr.week=ft,Xr._week=Ar,Xr.firstDayOfYear=pt,Xr.firstDayOfWeek=dt,Xr.weekdays=qe,Xr._weekdays=Lr,Xr.weekdaysMin=Ue,Xr._weekdaysMin=Or,Xr.weekdaysShort=je,Xr._weekdaysShort=Nr,Xr.weekdaysParse=Ye,Xr.isPM=We,Xr._meridiemParse=Ir,Xr.meridiem=Ze,E("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===v(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),n.lang=nt("moment.lang is deprecated. Use moment.locale instead.",E),n.langData=nt("moment.langData is deprecated. Use moment.localeData instead.",D);var Jr=Math.abs,Kr=Cn("ms"),Qr=Cn("s"),ti=Cn("m"),ei=Cn("h"),ni=Cn("d"),ri=Cn("w"),ii=Cn("M"),ai=Cn("y"),ui=Sn("milliseconds"),oi=Sn("seconds"),si=Sn("minutes"),ci=Sn("hours"),li=Sn("days"),hi=Sn("months"),fi=Sn("years"),di=Math.round,pi={s:45,m:45,h:22,d:26,M:11},gi=Math.abs,mi=Ot.prototype;mi.abs=yn,mi.add=bn,mi.subtract=_n,mi.as=kn,mi.asMilliseconds=Kr,mi.asSeconds=Qr,mi.asMinutes=ti,mi.asHours=ei,mi.asDays=ni,mi.asWeeks=ri,mi.asMonths=ii,mi.asYears=ai,mi.valueOf=Dn,mi._bubble=wn,mi.get=Mn,mi.milliseconds=ui,mi.seconds=oi,mi.minutes=si,mi.hours=ci,mi.days=li,mi.weeks=Tn,mi.months=hi,mi.years=fi,mi.humanize=Nn,mi.toISOString=On,mi.toString=On,mi.toJSON=On,mi.locale=be,mi.localeData=_e,mi.toIsoString=nt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",On),mi.lang=Fr,O("X",0,0,"unix"),O("x",0,0,"valueOf"),U("x",nr),U("X",ir),V("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),V("x",function(t,e,n){n._d=new Date(v(t))}),n.version="2.10.6",r(Ft),n.fn=zr,n.min=Lt,n.max=Nt,n.utc=c,n.unix=Qe,n.months=fn,n.isDate=a,n.locale=E,n.invalid=d,n.duration=Kt,n.isMoment=m,n.weekdays=pn,n.parseZone=tn,n.localeData=D,n.isDuration=It,n.monthsShort=dn,n.weekdaysMin=mn,n.defineLocale=k,n.weekdaysShort=gn,n.normalizeUnits=M,n.relativeTimeThreshold=Ln;var yi=n;return yi})},{}],107:[function(t,e){e.exports={name:"mermaid",version:"0.5.8",description:"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams and gantt charts.",main:"src/mermaid.js",keywords:["diagram","markdown","flowchart","sequence diagram","gantt"],bin:{mermaid:"./bin/mermaid.js"},scripts:{live:"live-server ./test/examples",lint:"node node_modules/eslint/bin/eslint.js src",jison:"gulp jison_legacy",karma:"node node_modules/karma/bin/karma start karma.conf.js --single-run",watch:"source ./scripts/watch.sh",doc:"rm -r build;rm -r dist/www;gulp vartree;cp dist/www/all.html ../mermaid-pages/index.html;cp dist/mermaid.js ../mermaid-pages/javascripts/lib;cp dist/mermaid.forest.css ../mermaid-pages/stylesheets",tape:"node node_modules/tape/bin/tape test/cli_test-*.js",jasmine:"npm run jison &&node node_modules/jasmine-es6/bin/jasmine.js",pretest:"npm run jison",test:"npm run dist && npm run karma && npm run tape","dist-slim-mermaid":"node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.slim.js -x d3 && cat dist/mermaid.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.slim.min.js","dist-slim-mermaidAPI":"node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.slim.js -x d3 && cat dist/mermaidAPI.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.slim.min.js","dist-mermaid":"node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.js && cat dist/mermaid.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.min.js","dist-mermaidAPI":"node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.js && cat dist/mermaidAPI.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.min.js",dist:"npm run dist-slim-mermaid && npm run dist-slim-mermaidAPI && npm run dist-mermaid && npm run dist-mermaidAPI"},repository:{type:"git",url:"https://github.com/knsv/mermaid"},author:"Knut Sveidqvist",license:"MIT",dependencies:{chalk:"^0.5.1",d3:"3.5.6",dagre:"^0.7.4","dagre-d3":"0.4.10",he:"^0.5.0",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.9.0",semver:"^4.1.1",which:"^1.0.8"},devDependencies:{async:"^0.9.0","babel-eslint":"^4.1.3",babelify:"^6.4.0",browserify:"~6.2.0",clone:"^0.2.0","codeclimate-test-reporter":"0.0.4",dateformat:"^1.0.11",dox:"^0.8.0",eslint:"^1.6.0","eslint-watch":"^2.1.2","event-stream":"^3.2.0",foundation:"^4.2.1-1","front-matter":"^0.2.0",gulp:"~3.9.0","gulp-bower":"0.0.10","gulp-browserify":"^0.5.0","gulp-bump":"^0.1.11","gulp-concat":"~2.4.1","gulp-data":"^1.1.1","gulp-dox":"^0.1.6","gulp-ext-replace":"^0.2.0","gulp-filelog":"^0.4.1","gulp-front-matter":"^1.2.3","gulp-hogan":"^1.1.0","gulp-if":"^1.2.5","gulp-insert":"^0.4.0","gulp-istanbul":"^0.4.0","gulp-jasmine":"~2.1.0","gulp-jasmine-browser":"^0.2.3","gulp-jison":"~1.2.0","gulp-jshint":"^1.9.0","gulp-less":"^3.0.1","gulp-livereload":"^3.8.0","gulp-marked":"^1.0.0","gulp-mdvars":"^2.0.0","gulp-qunit":"~1.2.1","gulp-rename":"~1.2.0","gulp-shell":"^0.2.10","gulp-tag-version":"^1.2.1","gulp-uglify":"~1.0.1","gulp-util":"^3.0.7","gulp-vartree":"^2.0.1","hogan.js":"^3.0.2",jasmine:"2.3.2","jasmine-es6":"0.0.18",jison:"zaach/jison",jsdom:"^7.0.2","jshint-stylish":"^2.0.1",karma:"^0.13.15","karma-babel-preprocessor":"^6.0.1","karma-browserify":"^4.4.0","karma-jasmine":"^0.3.6","karma-phantomjs-launcher":"^0.2.1","live-server":"^0.9.0","map-stream":"0.0.6",marked:"^0.3.2","mock-browser":"^0.91.34",path:"^0.4.9",phantomjs:"^1.9.18",proxyquire:"^1.7.3","proxyquire-universal":"^1.0.8",proxyquireify:"^3.0.0","require-dir":"^0.3.0",rewire:"^2.1.3",rimraf:"^2.2.8",tape:"^3.0.3",testdom:"^2.0.0",uglifyjs:"^2.4.10","vinyl-source-stream":"^1.1.0",watchify:"^3.6.1"}}},{}],108:[function(t,e){"use strict";var n;if(t)try{n=t("d3")}catch(r){}n||(n=window.d3),e.exports=n,function(){var t=!1;if(t="tspans",n.selection.prototype.textwrap)return!1;if("undefined"==typeof t)var t=!1;n.selection.prototype.textwrap=n.selection.enter.prototype.textwrap=function(e,r){var i,r=parseInt(r)||0,a=this,u=function(t){var e=t[0][0],r=e.tagName.toString();if("rect"!==r)return!1;var i={};return i.x=n.select(e).attr("x")||0,i.y=n.select(e).attr("y")||0,i.width=n.select(e).attr("width")||0,i.height=n.select(e).attr("height")||0,i.attr=t.attr,i},o=function(t){if(t.attr||(t.attr=function(t){return this[t]?this[t]:void 0}),"object"==typeof t&&"undefined"!=typeof t.x&&"undefined"!=typeof t.y&&"undefined"!=typeof t.width&&"undefined"!=typeof t.height)return t;if("function"==typeof Array.isArray&&Array.isArray(t)||"[object Array]"===Object.prototype.toString.call(t)){var e=u(t);return e}return!1},s=function(t,e){var n=t;return 0!==e&&(n.x=parseInt(n.x)+e,n.y=parseInt(n.y)+e,n.width-=2*e,n.height-=2*e),n},c=o(e);if(r&&(c=s(c,r)),0!=a.length&&n&&e&&c){e=c;var l,h=function(t){var r=n.select(t[0].parentNode),a=r.select("text"),u=a.style("line-height"),o=a.text();a.remove();var s=r.append("foreignObject");s.attr("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility").attr("x",e.x).attr("y",e.y).attr("width",e.width).attr("height",e.height);var c=s.append("xhtml:div").attr("class","wrapped");c.style("height",e.height).style("width",e.width).html(o),u&&c.style("line-height",u),i=r.select("foreignObject")},f=function(t){var a,u=t[0],o=u.parentNode,s=n.select(u),c=u.getBBox().height,l=u.getBBox().width,h=c,f=s.style("line-height");if(a=f&&parseInt(f)?parseInt(f.replace("px","")):h,l>e.width){var d=s.text();if(s.text(""),d){var p,g;if(-1!==d.indexOf(" ")){var p=" ";g=d.split(" ")}else{p="";var m=d.length,y=Math.ceil(l/e.width),v=Math.floor(m/y);v*y>=m||y++;for(var b,_,g=[],x=0;y>x;x++)_=x*v,b=d.substr(_,v),g.push(b)}for(var w=[],A=0,E={},x=0;xe.width&&C&&""!==C&&(A+=M,E={string:C,width:M,offset:A},w.push(E),s.text(""),s.text(D),x==g.length-1&&(k=D,s.text(k),S=u.getComputedTextLength())),x==g.length-1){s.text("");var T=k;T&&""!==T&&(S-A>0&&(S-=A),E={string:T,width:S,offset:A},w.push(E))}}var F;s.text("");for(var x=0;x0){w[x-1]}x*a0?a:void 0}),F.attr("x",function(){var t=e.x;return r&&(t+=r),t}))}}}s.attr("y",function(){var t=e.y;return a&&(t+=a),r&&(t+=r),t}),s.attr("x",function(){var t=e.x;return r&&(t+=r),t}),i=n.select(o).selectAll("text")};t&&("foreignobjects"==t?l=h:"tspans"==t&&(l=f)),t||(l="undefined"!=typeof SVGForeignObjectElement?h:f);for(var d=0;d "+t.w+": "+JSON.stringify(u.edge(t))),p(i,u.edge(t),u.edge(t).relation)}),i.attr("height","100%"),i.attr("width","100%")}},{"../../d3":108,"../../logger":127,"./classDb":109,"./parser/classDiagram":111,dagre:54}],111:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,11],r=[1,12],i=[1,13],a=[1,15],u=[1,16],o=[1,17],s=[6,8],c=[1,26],l=[1,27],h=[1,28],f=[1,29],d=[1,30],p=[1,31],g=[6,8,13,17,23,26,27,28,29,30,31],m=[6,8,13,17,23,26,27,28,29,30,31,45,46,47],y=[23,45,46,47],v=[23,30,31,45,46,47],b=[23,26,27,28,29,45,46,47],_=[6,8,13],x=[1,46],w={trace:function(){},yy:{},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},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"},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]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 5:this.$=a[u-1]+a[u];break;case 6:this.$=a[u];break;case 7:r.addRelation(a[u]);break;case 8:a[u-1].title=r.cleanupLabel(a[u]),r.addRelation(a[u-1]);break;case 12:r.addMembers(a[u-3],a[u-1]);break;case 13:this.$=[a[u]];break;case 14:a[u].push(a[u-1]),this.$=a[u];break;case 15:break;case 16:r.addMembers(a[u-1],r.cleanupLabel(a[u]));break;case 17:console.warn("Member",a[u]);break;case 18:break;case 19:this.$={id1:a[u-2],id2:a[u],relation:a[u-1],relationTitle1:"none",relationTitle2:"none"};break;case 20:this.$={id1:a[u-3],id2:a[u],relation:a[u-1],relationTitle1:a[u-2],relationTitle2:"none"};break;case 21:this.$={id1:a[u-3],id2:a[u],relation:a[u-2],relationTitle1:"none",relationTitle2:a[u-1]};break;case 22:this.$={id1:a[u-4],id2:a[u],relation:a[u-2],relationTitle1:a[u-3],relationTitle2:a[u-1]};break;case 23:this.$={type1:a[u-2],type2:a[u],lineType:a[u-1]};break;case 24:this.$={type1:"none",type2:a[u],lineType:a[u-1]};break;case 25:this.$={type1:a[u-1],type2:"none",lineType:a[u]};break;case 26:this.$={type1:"none",type2:"none",lineType:a[u]};break;case 27:this.$=r.relationType.AGGREGATION;break;case 28:this.$=r.relationType.EXTENSION;break;case 29:this.$=r.relationType.COMPOSITION;break;case 30:this.$=r.relationType.DEPENDENCY;break;case 31:this.$=r.lineType.LINE;break;case 32:this.$=r.lineType.DOTTED_LINE}},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:n,20:r,21:i,45:a,46:u,47:o},{8:[1,18]},{6:[1,19],8:[2,3]},e(s,[2,7],{13:[1,20]}),e(s,[2,9]),e(s,[2,10]),e(s,[2,15],{22:21,24:24,25:25,13:[1,23],23:[1,22],26:c,27:l,28:h,29:f,30:d,31:p}),{10:32,11:14,45:a,46:u,47:o},e(s,[2,17]),e(s,[2,18]),e(g,[2,6],{11:14,10:33,45:a,46:u,47:o}),e(m,[2,46]),e(m,[2,47]),e(m,[2,48]),{1:[2,2]},{7:34,9:6,10:10,11:14,12:7,14:8,15:9,16:n,20:r,21:i,45:a,46:u,47:o},e(s,[2,8]),{10:35,11:14,23:[1,36],45:a,46:u,47:o},{22:37,24:24,25:25,26:c,27:l,28:h,29:f,30:d,31:p},e(s,[2,16]),{25:38,30:d,31:p},e(y,[2,26],{24:39,26:c,27:l,28:h,29:f}),e(v,[2,27]),e(v,[2,28]),e(v,[2,29]),e(v,[2,30]),e(b,[2,31]),e(b,[2,32]),e(s,[2,11],{17:[1,40]}),e(g,[2,5]),{8:[2,4]},e(_,[2,19]),{10:41,11:14,45:a,46:u,47:o},{10:42,11:14,23:[1,43],45:a,46:u,47:o},e(y,[2,25],{24:44,26:c,27:l,28:h,29:f}),e(y,[2,24]),{18:45,20:x},e(_,[2,21]),e(_,[2,20]),{10:47,11:14,45:a,46:u,47:o},e(y,[2,23]),{19:[1,48]},{18:49,19:[2,13],20:x},e(_,[2,22]),e(s,[2,12]),{19:[2,14]}],defaultActions:{2:[2,1],18:[2,2],34:[2,4],49:[2,14]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;i.push(m);var y=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,x,w,A,E,k,D,C=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},M={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),x=a[_]&&a[_][v]),"undefined"==typeof x||!x.length||!x[0]){var S="";D=[];for(A in a[_])this.terminals_[A]&&A>l&&D.push("'"+this.terminals_[A]+"'");S=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:m,expected:D})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,b?(v=b,b=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,m=d.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[x[1]][1],M.$=r[r.length-E],M._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},y&&(M._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(M,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;E&&(n=n.slice(0,-1*E*2),r=r.slice(0,-1*E),i=i.slice(0,-1*E)),n.push(this.productions_[x[1]][0]),r.push(M.$),i.push(M._$),k=a[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},A=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:break;case 1:return 6;case 2:break;case 3:return 5;case 4:return this.begin("struct"),17;case 5:return this.popState(),19;case 6:break;case 7:return"MEMBER";case 8:return 16;case 9:this.begin("string");break;case 10:this.popState();break;case 11:return"STR";case 12:return 27;case 13:return 27;case 14:return 29;case 15:return 29;case 16:return 28;case 17:return 26;case 18:return 30;case 19:return 31;case 20:return 13;case 21:return 43;case 22:return"DOT";case 23:return"PLUS";case 24:return 40;case 25:return"EQUALS";case 26:return"EQUALS";case 27:return 47;case 28:return"PUNCTUATION";case 29:return 46;case 30:return 45;case 31:return 42;case 32:return 8}},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)/,/^(?:$)/], -conditions:{string:{rules:[10,11],inclusive:!1},struct:{rules:[5,6,7],inclusive:!1},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:!0}}};return t}();return w.lexer=A,t.prototype=w,w.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],112:[function(t,e,n){(function(e){"use strict";var r=t("../../logger"),i=new r.Log,a="",u=!1;n.setMessage=function(t){i.debug("Setting message to: "+t),a=t},n.getMessage=function(){return a},n.setInfo=function(t){u=t},n.getInfo=function(){return u},n.parseError=function(t,n){e.mermaidAPI.parseError(t,n)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../logger":127}],113:[function(t,e,n){"use strict";var r=t("./exampleDb"),i=t("./parser/example.js"),a=t("../../d3"),u=t("../../logger"),o=new u.Log;n.draw=function(t,e,n){var u;u=i.parser,u.yy=r,o.debug("Renering example diagram"),u.parse(t);var s=a.select("#"+e),c=s.append("g");c.append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("mermaid "+n),s.attr("height",100),s.attr("width",400)}},{"../../d3":108,"../../logger":127,"./exampleDb":112,"./parser/example.js":114}],114:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[6,9,10,12],r={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,message:11,say:12,TXT:13,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo",12:"say",13:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1],[8,1],[11,2]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 1:return r;case 4:break;case 6:r.setInfo(!0);break;case 7:r.setMessage(a[u]);break;case 8:this.$=a[u-1].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},e(n,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8],11:9,12:[1,10]},{1:[2,1]},e(n,[2,3]),e(n,[2,4]),e(n,[2,5]),e(n,[2,6]),e(n,[2,7]),{13:[1,11]},e(n,[2,8])],defaultActions:{4:[2,1]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;i.push(m);var y=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,x,w,A,E,k,D,C=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},M={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),x=a[_]&&a[_][v]),"undefined"==typeof x||!x.length||!x[0]){var S="";D=[];for(A in a[_])this.terminals_[A]&&A>l&&D.push("'"+this.terminals_[A]+"'");S=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:m,expected:D})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,b?(v=b,b=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,m=d.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[x[1]][1],M.$=r[r.length-E],M._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},y&&(M._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(M,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;E&&(n=n.slice(0,-1*E*2),r=r.slice(0,-1*E),i=i.slice(0,-1*E)),n.push(this.productions_[x[1]][0]),r.push(M.$),i.push(M._$),k=a[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},i=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 9;case 1:return 10;case 2:return 4;case 3:return 12;case 4:return 13;case 5:return 6;case 6:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:showInfo\b)/i,/^(?:info\b)/i,/^(?:say\b)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return t}();return r.lexer=i,t.prototype=r,r.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],115:[function(t,e){"use strict";var n,r=t("../../logger"),i=new r.Log;if(t)try{n=t("dagre-d3")}catch(a){i.debug("Could not load dagre-d3")}n||(n=window.dagreD3),e.exports=n},{"../../logger":127,"dagre-d3":5}],116:[function(t,e,n){"use strict";var r=t("./graphDb"),i=t("./parser/flow"),a=t("./parser/dot"),u=t("../../d3"),o=t("./dagre-d3"),s=t("../../logger"),c=new s.Log,l={};e.exports.setConf=function(t){var e,n=Object.keys(t);for(e=0;e0&&(u=a.classes.join(" "));var o="";o=r(o,a.styles),i="undefined"==typeof a.text?a.id:a.text;var s="";if(l.htmlLabels)s="html",i=i.replace(/fa:fa[\w\-]+/g,function(t){return''});else{var c=document.createElementNS("http://www.w3.org/2000/svg","text"),h=i.split(/
/),f=0;for(f=0;f/g,"\n");"undefined"==typeof t.style?l.htmlLabels?e.setEdge(t.start,t.end,{labelType:"html",style:a,labelpos:"c",label:''+t.text+"",arrowheadStyle:"fill: #333",arrowhead:n},i):e.setEdge(t.start,t.end,{labelType:"text",style:"stroke: #333; stroke-width: 1.5px;fill:none",labelpos:"c",label:u,arrowheadStyle:"fill: #333",arrowhead:n},i):e.setEdge(t.start,t.end,{labelType:"text",style:a,arrowheadStyle:"fill: #333",label:u,arrowhead:n},i)}})},n.getClasses=function(t,e){var n;r.clear(),n=e?a.parser:i.parser,n.yy=r,n.parse(t);var u=r.getClasses();return"undefined"==typeof u["default"]&&(u["default"]={id:"default"},u["default"].styles=[],u["default"].clusterStyles=["rx:4px","fill: rgb(255, 255, 222)","rx: 4px","stroke: rgb(170, 170, 51)","stroke-width: 1px"],u["default"].nodeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"],u["default"].edgeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"]),u},n.draw=function(t,e,s){c.debug("Drawing flowchart");var h;r.clear(),h=s?a.parser:i.parser,h.yy=r;try{h.parse(t)}catch(f){c.debug("Parsing failed")}var d;d=r.getDirection(),"undefined"==typeof d&&(d="TD");var p,g=new o.graphlib.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:d,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),m=r.getSubGraphs(),y=0;for(y=m.length-1;y>=0;y--)p=m[y],r.addVertex(p.id,p.title,"group",void 0);var v=r.getVertices(),b=r.getEdges();y=0;var _;for(y=m.length-1;y>=0;y--)for(p=m[y],u.selectAll("cluster").append("text"),_=0;_0?t.split(",").forEach(function(t){"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)}):"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)};var setTooltip=function(t,e){"undefined"!=typeof e&&(tooltips[t]=e)},setClickFun=function setClickFun(id,functionName){"undefined"!=typeof functionName&&"undefined"!=typeof vertices[id]&&funs.push(function(element){var elem=d3.select(element).select("#"+id);null!==elem&&elem.on("click",function(){eval(functionName+"('"+id+"')")})})},setLink=function(t,e){"undefined"!=typeof e&&"undefined"!=typeof vertices[t]&&funs.push(function(n){var r=d3.select(n).select("#"+t);null!==r&&r.on("click",function(){window.open(e,"newTab")})})};exports.getTooltip=function(t){return tooltips[t]},exports.setClickEvent=function(t,e,n,r){t.indexOf(",")>0?t.split(",").forEach(function(t){setTooltip(t,r),setClickFun(t,e),setLink(t,n)}):(setTooltip(t,r),setClickFun(t,e),setLink(t,n))},exports.bindFunctions=function(t){funs.forEach(function(e){e(t)})},exports.getDirection=function(){return direction},exports.getVertices=function(){return vertices},exports.getEdges=function(){return edges},exports.getClasses=function(){return classes};var setupToolTips=function(t){var e=d3.select(".mermaidTooltip");null===e[0][0]&&(e=d3.select("body").append("div").attr("class","mermaidTooltip").style("opacity",0));var n=d3.select(t).select("svg"),r=n.selectAll("g.node");r.on("mouseover",function(){var t=d3.select(this),n=t.attr("title");if(null!==n){var r=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.html(t.attr("title")).style("left",r.left+(r.right-r.left)/2+"px").style("top",r.top-14+document.body.scrollTop+"px"),t.classed("hover",!0)}}).on("mouseout",function(){e.transition().duration(500).style("opacity",0);var t=d3.select(this);t.classed("hover",!1)})};funs.push(setupToolTips),exports.clear=function(){vertices={},classes={},edges=[],funs=[],funs.push(setupToolTips),subGraphs=[],subCount=0,tooltips=[]},exports.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},exports.addSubGraph=function(t,e){function n(t){var e={"boolean":{},number:{},string:{}},n=[];return t.filter(function(t){var r=typeof t;return" "===t?!1:r in e?e[r].hasOwnProperty(t)?!1:e[r][t]=!0:n.indexOf(t)>=0?!1:n.push(t)})}var r=[];r=n(r.concat.apply(r,t));var i={id:"subGraph"+subCount,nodes:r,title:e};return subGraphs.push(i),subCount+=1,i.id};var getPosForId=function(t){var e;for(e=0;e2e3)){if(posCrossRef[secCount]=n,subGraphs[n].id===e)return{result:!0,count:0};for(var i=0,a=1;i=0){var o=t(e,u);if(o.result)return{result:!0,count:a+o.count};a+=o.count}i+=1}return{result:!1,count:a}}};exports.getDepthFirstPos=function(t){return posCrossRef[t]},exports.indexNodes=function(){secCount=-1,subGraphs.length>0&&indexNodes("none",subGraphs.length-1,0)},exports.getSubGraphs=function(){return subGraphs},exports.parseError=function(t,e){global.mermaidAPI.parseError(t,e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../d3":108,"../../logger":127}],118:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,5],r=[1,6],i=[1,12],a=[1,13],u=[1,14],o=[1,15],s=[1,16],c=[1,17],l=[1,18],h=[1,19],f=[1,20],d=[1,21],p=[1,22],g=[8,16,17,18,19,20,21,22,23,24,25,26],m=[1,37],y=[1,33],v=[1,34],b=[1,35],_=[1,36],x=[8,10,16,17,18,19,20,21,22,23,24,25,26,28,32,37,39,40,45,57,58],w=[10,28],A=[10,28,37,57,58],E=[2,49],k=[1,45],D=[1,48],C=[1,49],M=[1,52],S=[2,65],T=[1,65],F=[1,66],B=[1,67],L=[1,68],N=[1,69],O=[1,70],I=[1,71],R=[1,72],P=[1,73],q=[8,16,17,18,19,20,21,22,23,24,25,26,47],j=[10,28,37],U={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graph:4,EOF:5,graphStatement:6,idStatement:7,"{":8,stmt_list:9,"}":10,strict:11,GRAPH:12,DIGRAPH:13,textNoTags:14,textNoTagsToken:15,ALPHA:16,NUM:17,COLON:18,PLUS:19,EQUALS:20,MULT:21,DOT:22,BRKT:23,SPACE:24,MINUS:25,keywords:26,stmt:27,";":28,node_stmt:29,edge_stmt:30,attr_stmt:31,"=":32,subgraph:33,attr_list:34,NODE:35,EDGE:36,"[":37,a_list:38,"]":39,",":40,edgeRHS:41,node_id:42,edgeop:43,port:44,":":45,compass_pt:46,SUBGRAPH:47,n:48,ne:49,e:50,se:51,s:52,sw:53,w:54,nw:55,c:56,ARROW_POINT:57,ARROW_OPEN:58,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"{",10:"}",11:"strict",12:"GRAPH",13:"DIGRAPH",16:"ALPHA",17:"NUM",18:"COLON",19:"PLUS",20:"EQUALS",21:"MULT",22:"DOT",23:"BRKT",24:"SPACE",25:"MINUS",26:"keywords",28:";",32:"=",35:"NODE",36:"EDGE",37:"[",39:"]",40:",",45:":",47:"SUBGRAPH",48:"n",49:"ne",50:"e",51:"se",52:"s",53:"sw",54:"w",55:"nw",56:"c",57:"ARROW_POINT",58:"ARROW_OPEN"},productions_:[0,[3,2],[4,5],[4,6],[4,4],[6,1],[6,1],[7,1],[14,1],[14,2],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[9,1],[9,3],[27,1],[27,1],[27,1],[27,3],[27,1],[31,2],[31,2],[31,2],[34,4],[34,3],[34,3],[34,2],[38,5],[38,5],[38,3],[30,3],[30,3],[30,2],[30,2],[41,3],[41,3],[41,2],[41,2],[29,2],[29,1],[42,2],[42,1],[44,4],[44,2],[44,2],[33,5],[33,4],[33,3],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,0],[43,1],[43,1]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 1:this.$=a[u-1];break;case 2:this.$=a[u-4];break;case 3:this.$=a[u-5];break;case 4:this.$=a[u-3];break;case 8:case 10:case 11:this.$=a[u];break;case 9:this.$=a[u-1]+""+a[u];break;case 12:case 13:case 14:case 15:case 16:case 18:case 19:case 20:this.$=a[u];break;case 17:this.$="
";break;case 39:this.$="oy";break;case 40:r.addLink(a[u-1],a[u].id,a[u].op),this.$="oy";break;case 42:r.addLink(a[u-1],a[u].id,a[u].op),this.$={op:a[u-2],id:a[u-1]};break;case 44:this.$={op:a[u-1],id:a[u]};break;case 48:r.addVertex(a[u-1]),this.$=a[u-1];break;case 49:r.addVertex(a[u]),this.$=a[u];break;case 66:this.$="arrow";break;case 67:this.$="arrow_open"}},table:[{3:1,4:2,6:3,11:[1,4],12:n,13:r},{1:[3]},{5:[1,7]},{7:8,8:[1,9],14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},{6:23,12:n,13:r},e(g,[2,5]),e(g,[2,6]),{1:[2,1]},{8:[1,24]},{7:30,8:m,9:25,12:y,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},e([8,10,28,32,37,39,40,45,57,58],[2,7],{15:38,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p}),e(x,[2,8]),e(x,[2,10]),e(x,[2,11]),e(x,[2,12]),e(x,[2,13]),e(x,[2,14]),e(x,[2,15]),e(x,[2,16]),e(x,[2,17]),e(x,[2,18]),e(x,[2,19]),e(x,[2,20]),{7:39,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},{7:30,8:m,9:40,12:y,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{10:[1,41]},{10:[2,21],28:[1,42]},e(w,[2,23]),e(w,[2,24]),e(w,[2,25]),e(A,E,{44:44,32:[1,43],45:k}),e(w,[2,27],{41:46,43:47,57:D,58:C}),e(w,[2,47],{43:47,34:50,41:51,37:M,57:D,58:C}),{34:53,37:M},{34:54,37:M},{34:55,37:M},{7:56,8:[1,57],14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},{7:30,8:m,9:58,12:y,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},e(x,[2,9]),{8:[1,59]},{10:[1,60]},{5:[2,4]},{7:30,8:m,9:61,12:y,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{7:62,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},e(A,[2,48]),e(A,S,{14:10,15:11,7:63,46:64,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,48:T,49:F,50:B,51:L,52:N,53:O,54:I,55:R,56:P}),e(w,[2,41],{34:74,37:M}),{7:77,8:m,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,33:76,42:75,47:_},e(q,[2,66]),e(q,[2,67]),e(w,[2,46]),e(w,[2,40],{34:78,37:M}),{7:81,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,38:79,39:[1,80]},e(w,[2,28]),e(w,[2,29]),e(w,[2,30]),{8:[1,82]},{7:30,8:m,9:83,12:y,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{10:[1,84]},{7:30,8:m,9:85,12:y,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{5:[2,2]},{10:[2,22]},e(w,[2,26]),e(A,[2,51],{45:[1,86]}),e(A,[2,52]),e(A,[2,56]),e(A,[2,57]),e(A,[2,58]),e(A,[2,59]),e(A,[2,60]),e(A,[2,61]),e(A,[2,62]),e(A,[2,63]),e(A,[2,64]),e(w,[2,38]),e(j,[2,44],{43:47,41:87,57:D,58:C}),e(j,[2,45],{43:47,41:88,57:D,58:C}),e(A,E,{44:44,45:k}),e(w,[2,39]),{39:[1,89]},e(w,[2,34],{34:90,37:M}),{32:[1,91]},{7:30,8:m,9:92,12:y,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{10:[1,93]},e(A,[2,55]),{10:[1,94]},e(A,S,{46:95,48:T,49:F,50:B,51:L,52:N,53:O,54:I,55:R,56:P}),e(j,[2,42]),e(j,[2,43]),e(w,[2,33],{34:96,37:M}),e(w,[2,32]),{7:97,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},{10:[1,98]},e(A,[2,54]),{5:[2,3]},e(A,[2,50]),e(w,[2,31]),{28:[1,99],39:[2,37],40:[1,100]},e(A,[2,53]),{7:81,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,38:101},{7:81,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,38:102},{39:[2,35]},{39:[2,36]}],defaultActions:{7:[2,1],41:[2,4],60:[2,2],61:[2,22],94:[2,3],101:[2,35],102:[2,36]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;i.push(m);var y=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,x,w,A,E,k,D,C=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},M={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),x=a[_]&&a[_][v]),"undefined"==typeof x||!x.length||!x[0]){var S="";D=[];for(A in a[_])this.terminals_[A]&&A>l&&D.push("'"+this.terminals_[A]+"'");S=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:m,expected:D})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,b?(v=b,b=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,m=d.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[x[1]][1],M.$=r[r.length-E],M._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},y&&(M._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(M,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;E&&(n=n.slice(0,-1*E*2),r=r.slice(0,-1*E),i=i.slice(0,-1*E)),n.push(this.productions_[x[1]][0]),r.push(M.$),i.push(M._$),k=a[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},Y=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]), -this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:return"STYLE";case 1:return"LINKSTYLE";case 2:return"CLASSDEF";case 3:return"CLASS";case 4:return"CLICK";case 5:return 12;case 6:return 13;case 7:return 47;case 8:return 35;case 9:return 36;case 10:return"DIR";case 11:return"DIR";case 12:return"DIR";case 13:return"DIR";case 14:return"DIR";case 15:return"DIR";case 16:return 17;case 17:return 23;case 18:return 18;case 19:return 28;case 20:return 40;case 21:return 32;case 22:return 21;case 23:return 22;case 24:return"ARROW_CROSS";case 25:return 57;case 26:return"ARROW_CIRCLE";case 27:return 58;case 28:return 25;case 29:return 19;case 30:return 20;case 31:return 16;case 32:return"PIPE";case 33:return"PS";case 34:return"PE";case 35:return 37;case 36:return 39;case 37:return 8;case 38:return 10;case 39:return"QUOTE";case 40:return 24;case 41:return"NEWLINE";case 42:return 5}},rules:[/^(?:style\b)/,/^(?:linkStyle\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:digraph\b)/,/^(?:subgraph\b)/,/^(?:node\b)/,/^(?:edge\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:--[x])/,/^(?:->)/,/^(?:--[o])/,/^(?:--)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u0061-\u007A\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)/,/^(?:\n)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],inclusive:!0}}};return t}();return U.lexer=Y,t.prototype=U,U.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],119:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,4],r=[1,3],i=[1,5],a=[1,8,9,10,11,13,18,30,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],u=[2,2],o=[1,12],s=[1,13],c=[1,14],l=[1,15],h=[1,31],f=[1,33],d=[1,22],p=[1,34],g=[1,24],m=[1,25],y=[1,26],v=[1,27],b=[1,28],_=[1,38],x=[1,40],w=[1,35],A=[1,39],E=[1,45],k=[1,44],D=[1,36],C=[1,37],M=[1,41],S=[1,42],T=[1,43],F=[1,8,9,10,11,13,18,30,32,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],B=[1,53],L=[1,52],N=[1,54],O=[1,72],I=[1,80],R=[1,81],P=[1,66],q=[1,65],j=[1,85],U=[1,84],Y=[1,82],z=[1,83],V=[1,73],$=[1,68],G=[1,67],H=[1,63],W=[1,75],Z=[1,76],X=[1,77],J=[1,78],K=[1,79],Q=[1,70],tt=[1,69],et=[8,9,11],nt=[8,9,11,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64],rt=[1,115],it=[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,85,87,88,90,91,93,94,95,96,97],at=[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,83,85,87,88,90,91,93,94,95,96,97],ut=[1,117],ot=[1,118],st=[8,9,10,11,13,18,30,32,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],ct=[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,83,85,87,88,90,91,93,94,95,96,97],lt=[13,18,46,81,85,87,88,90,91,93,94,95,96,97],ht=[13,18,46,49,65,81,85,87,88,90,91,93,94,95,96,97],ft=[1,191],dt=[1,188],pt=[1,195],gt=[1,192],mt=[1,189],yt=[1,196],vt=[1,186],bt=[1,187],_t=[1,190],xt=[1,193],wt=[1,194],At=[1,211],Et=[8,9,11,85],kt=[8,9,10,11,46,71,80,81,83,85,87,88,89,90,91],Dt={trace:function(){},yy:{},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,commentStatement:82,PCT:83,style:84,COMMA:85,styleComponent:86,ALPHA:87,COLON:88,UNIT:89,BRKT:90,DOT:91,graphCodeTokens:92,PUNCTUATION:93,UNICODE_TEXT:94,PLUS:95,EQUALS:96,MULT:97,TAG_START:98,TAG_END:99,QUOTE:100,$accept:0,$end:1},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",83:"PCT",85:"COMMA",87:"ALPHA",88:"COLON",89:"UNIT",90:"BRKT",91:"DOT",93:"PUNCTUATION",94:"UNICODE_TEXT",95:"PLUS",96:"EQUALS",97:"MULT",98:"TAG_START",99:"TAG_END",100:"QUOTE"},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],[82,3],[79,1],[79,3],[84,1],[84,2],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,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],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 2:this.$=[];break;case 3:a[u]!==[]&&a[u-1].push(a[u]),this.$=a[u-1];break;case 4:case 57:case 59:case 60:case 92:case 94:case 95:case 108:this.$=a[u];break;case 11:r.setDirection(a[u-1]),this.$=a[u-1];break;case 12:r.setDirection("LR"),this.$=a[u-1];break;case 13:r.setDirection("RL"),this.$=a[u-1];break;case 14:r.setDirection("BT"),this.$=a[u-1];break;case 15:r.setDirection("TB"),this.$=a[u-1];break;case 30:this.$=a[u-1];break;case 31:case 32:case 33:case 34:case 35:this.$=[];break;case 36:this.$=r.addSubGraph(a[u-1],a[u-3]);break;case 37:this.$=r.addSubGraph(a[u-1],void 0);break;case 41:r.addLink(a[u-2],a[u],a[u-1]),this.$=[a[u-2],a[u]];break;case 42:this.$=[a[u]];break;case 43:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"square");break;case 44:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"square");break;case 45:this.$=a[u-5],r.addVertex(a[u-5],a[u-2],"circle");break;case 46:this.$=a[u-6],r.addVertex(a[u-6],a[u-3],"circle");break;case 47:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"ellipse");break;case 48:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"ellipse");break;case 49:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"round");break;case 50:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"round");break;case 51:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"diamond");break;case 52:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"diamond");break;case 53:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"odd");break;case 54:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"odd");break;case 55:this.$=a[u],r.addVertex(a[u]);break;case 56:this.$=a[u-1],r.addVertex(a[u-1]);break;case 58:case 93:case 96:case 109:this.$=a[u-1]+""+a[u];break;case 61:this.$="v";break;case 62:this.$="-";break;case 63:a[u-1].text=a[u],this.$=a[u-1];break;case 64:case 65:a[u-2].text=a[u-1],this.$=a[u-2];break;case 66:this.$=a[u];break;case 67:this.$={type:"arrow",stroke:"normal",text:a[u-1]};break;case 68:this.$={type:"arrow_circle",stroke:"normal",text:a[u-1]};break;case 69:this.$={type:"arrow_cross",stroke:"normal",text:a[u-1]};break;case 70:this.$={type:"arrow_open",stroke:"normal",text:a[u-1]};break;case 71:this.$={type:"arrow",stroke:"dotted",text:a[u-1]};break;case 72:this.$={type:"arrow_circle",stroke:"dotted",text:a[u-1]};break;case 73:this.$={type:"arrow_cross",stroke:"dotted",text:a[u-1]};break;case 74:this.$={type:"arrow_open",stroke:"dotted",text:a[u-1]};break;case 75:this.$={type:"arrow",stroke:"thick",text:a[u-1]};break;case 76:this.$={type:"arrow_circle",stroke:"thick",text:a[u-1]};break;case 77:this.$={type:"arrow_cross",stroke:"thick",text:a[u-1]};break;case 78:this.$={type:"arrow_open",stroke:"thick",text:a[u-1]};break;case 79:this.$={type:"arrow",stroke:"normal"};break;case 80:this.$={type:"arrow_circle",stroke:"normal"};break;case 81:this.$={type:"arrow_cross",stroke:"normal"};break;case 82:this.$={type:"arrow_open",stroke:"normal"};break;case 83:this.$={type:"arrow",stroke:"dotted"};break;case 84:this.$={type:"arrow_circle",stroke:"dotted"};break;case 85:this.$={type:"arrow_cross",stroke:"dotted"};break;case 86:this.$={type:"arrow_open",stroke:"dotted"};break;case 87:this.$={type:"arrow",stroke:"thick"};break;case 88:this.$={type:"arrow_circle",stroke:"thick"};break;case 89:this.$={type:"arrow_cross",stroke:"thick"};break;case 90:this.$={type:"arrow_open",stroke:"thick"};break;case 91:this.$=a[u-1];break;case 110:case 111:this.$=a[u-4],r.addClass(a[u-2],a[u]);break;case 112:this.$=a[u-4],r.setClass(a[u-2],a[u]);break;case 113:this.$=a[u-4],r.setClickEvent(a[u-2],a[u],void 0,void 0);break;case 114:this.$=a[u-6],r.setClickEvent(a[u-4],a[u-2],void 0,a[u]);break;case 115:this.$=a[u-4],r.setClickEvent(a[u-2],void 0,a[u],void 0);break;case 116:this.$=a[u-6],r.setClickEvent(a[u-4],void 0,a[u-2],a[u]);break;case 117:this.$=a[u-4],r.addVertex(a[u-2],void 0,void 0,a[u]);break;case 118:case 119:case 120:this.$=a[u-4],r.updateLink(a[u-2],a[u]);break;case 122:this.$=[a[u]];break;case 123:a[u-2].push(a[u]),this.$=a[u-2];break;case 125:this.$=a[u-1]+a[u]}},table:[{3:1,4:2,9:n,10:r,12:i},{1:[3]},e(a,u,{5:6}),{4:7,9:n,10:r,12:i},{4:8,9:n,10:r,12:i},{10:[1,9]},{1:[2,1],6:10,7:11,8:o,9:s,10:c,11:l,13:h,18:f,23:16,25:17,26:18,27:19,28:20,29:21,30:d,33:23,35:29,44:30,45:32,46:p,71:g,72:m,73:y,74:v,75:b,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},e(a,[2,9]),e(a,[2,10]),{13:[1,46],15:[1,47],16:[1,48],17:[1,49],18:[1,50]},e(F,[2,3]),e(F,[2,4]),e(F,[2,5]),e(F,[2,6]),e(F,[2,7]),e(F,[2,8]),{8:B,9:L,11:N,24:51},{8:B,9:L,11:N,24:55},{8:B,9:L,11:N,24:56},{8:B,9:L,11:N,24:57},{8:B,9:L,11:N,24:58},{8:B,9:L,11:N,24:59},{8:B,9:L,10:O,11:N,12:I,13:R,15:P,16:q,17:j,18:U,24:61,30:Y,31:60,32:z,45:71,46:V,50:$,60:G,66:62,67:H,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},e(et,[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]},e(nt,[2,55],{45:32,21:113,44:114,10:rt,13:h,15:[1,112],18:f,36:[1,108],38:[1,109],40:[1,110],42:[1,111],46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T}),e(it,[2,57]),e(it,[2,59]),e(it,[2,60]),e(it,[2,61]),e(it,[2,62]),e(at,[2,150]),e(at,[2,151]),e(at,[2,152]),e(at,[2,153]),e(at,[2,154]),e(at,[2,155]),e(at,[2,156]),e(at,[2,157]),e(at,[2,158]),e(at,[2,159]),e(at,[2,160]),{8:ut,9:ot,10:rt,14:116,21:119},{8:ut,9:ot,10:rt,14:120,21:119},{8:ut,9:ot,10:rt,14:121,21:119},{8:ut,9:ot,10:rt,14:122,21:119},{8:ut,9:ot,10:rt,14:123,21:119},e(F,[2,30]),e(F,[2,38]),e(F,[2,39]),e(F,[2,40]),e(F,[2,31]),e(F,[2,32]),e(F,[2,33]),e(F,[2,34]),e(F,[2,35]),{8:B,9:L,10:O,11:N,12:I,13:R,15:P,16:q,17:j,18:U,24:124,30:Y,32:z,45:71,46:V,50:$,60:G,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},e(st,u,{5:126}),e(ct,[2,92]),e(ct,[2,94]),e(ct,[2,139]),e(ct,[2,140]),e(ct,[2,141]),e(ct,[2,142]),e(ct,[2,143]),e(ct,[2,144]),e(ct,[2,145]),e(ct,[2,146]),e(ct,[2,147]),e(ct,[2,148]),e(ct,[2,149]),e(ct,[2,97]),e(ct,[2,98]),e(ct,[2,99]),e(ct,[2,100]),e(ct,[2,101]),e(ct,[2,102]),e(ct,[2,103]),e(ct,[2,104]),e(ct,[2,105]),e(ct,[2,106]),e(ct,[2,107]),{13:h,18:f,33:127,35:29,44:30,45:32,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},e(lt,[2,66],{48:128,49:[1,129],65:[1,130]}),{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,31:131,32:z,45:71,46:V,50:$,60:G,66:62,67:H,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,31:132,32:z,45:71,46:V,50:$,60:G,66:62,67:H,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,31:133,32:z,45:71,46:V,50:$,60:G,66:62,67:H,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},e(ht,[2,79]),e(ht,[2,80]),e(ht,[2,81]),e(ht,[2,82]),e(ht,[2,83]),e(ht,[2,84]),e(ht,[2,85]),e(ht,[2,86]),e(ht,[2,87]),e(ht,[2,88]),e(ht,[2,89]),e(ht,[2,90]),{13:h,18:f,35:134,44:30,45:32,46:p,80:[1,135],81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{78:[1,136],81:[1,137]},{13:h,18:f,35:139,44:30,45:32,46:p,78:[1,138],81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{13:h,18:f,35:140,44:30,45:32,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{13:h,18:f,35:141,44:30,45:32,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,31:142,32:z,45:71,46:V,50:$,60:G,66:62,67:H,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,31:144,32:z,38:[1,143],45:71,46:V,50:$,60:G,66:62,67:H,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,31:145,32:z,45:71,46:V,50:$,60:G,66:62,67:H,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,31:146,32:z,45:71,46:V,50:$,60:G,66:62,67:H,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,31:147,32:z,45:71,46:V,50:$,60:G,66:62,67:H,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},e(nt,[2,56]),e(it,[2,58]),e(nt,[2,29],{21:148,10:rt}),e(a,[2,11]),e(a,[2,21]),e(a,[2,22]),{9:[1,149]},e(a,[2,12]),e(a,[2,13]),e(a,[2,14]),e(a,[2,15]),e(st,u,{5:150}),e(ct,[2,93]),{6:10,7:11,8:o,9:s,10:c,11:l,13:h,18:f,23:16,25:17,26:18,27:19,28:20,29:21,30:d,32:[1,151],33:23,35:29,44:30,45:32,46:p,71:g,72:m,73:y,74:v,75:b,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},e(et,[2,41]),e(lt,[2,63],{10:[1,152]}),{10:[1,153]},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,31:154,32:z,45:71,46:V,50:$,60:G,66:62,67:H,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,32:z,45:71,46:V,50:$,51:[1,155],52:[1,156],53:[1,157],54:[1,158],60:G,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,32:z,45:71,46:V,50:$,56:[1,159],57:[1,160],58:[1,161],59:[1,162],60:G,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,32:z,45:71,46:V,50:$,60:G,61:[1,163],62:[1,164],63:[1,165],64:[1,166],66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:[1,167],13:h,18:f,44:114,45:32,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:[1,168]},{10:[1,169]},{10:[1,170]},{10:[1,171]},{10:[1,172],13:h,18:f,44:114,45:32,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:[1,173],13:h,18:f,44:114,45:32,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:[1,174],13:h,18:f,44:114,45:32,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,32:z,37:[1,175],45:71,46:V,50:$,60:G,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,31:176,32:z,45:71,46:V,50:$,60:G,66:62,67:H,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,32:z,39:[1,177],45:71,46:V,50:$,60:G,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,32:z,41:[1,178],45:71,46:V,50:$,60:G,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,32:z,43:[1,179],45:71,46:V,50:$,60:G,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,32:z,37:[1,180],45:71,46:V,50:$,60:G,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},e(nt,[2,28]),e(a,[2,23]),{6:10,7:11,8:o,9:s,10:c,11:l,13:h,18:f,23:16,25:17,26:18,27:19,28:20,29:21,30:d,32:[1,181],33:23,35:29,44:30,45:32,46:p,71:g,72:m,73:y,74:v,75:b,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},e(F,[2,37]),e(lt,[2,65]),e(lt,[2,64]),{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,32:z,45:71,46:V,50:$,60:G,65:[1,182],66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},e(lt,[2,67]),e(lt,[2,68]),e(lt,[2,69]),e(lt,[2,70]),e(lt,[2,71]),e(lt,[2,72]),e(lt,[2,73]),e(lt,[2,74]),e(lt,[2,75]),e(lt,[2,76]),e(lt,[2,77]),e(lt,[2,78]),{10:ft,46:dt,71:pt,79:183,80:gt,81:mt,83:yt,84:184,86:185,87:vt,88:bt,89:_t,90:xt,91:wt},{10:ft,46:dt,71:pt,79:197,80:gt,81:mt,83:yt,84:184,86:185,87:vt,88:bt,89:_t,90:xt,91:wt},{10:ft,46:dt,71:pt,79:198,80:gt,81:mt,83:yt,84:184,86:185,87:vt,88:bt,89:_t,90:xt,91:wt},{10:ft,46:dt,71:pt,79:199,80:gt,81:mt,83:yt,84:184,86:185,87:vt,88:bt,89:_t,90:xt,91:wt},{10:ft,46:dt,71:pt,79:200,80:gt,81:mt,83:yt,84:184,86:185,87:vt,88:bt,89:_t,90:xt,91:wt},{10:ft,46:dt,71:pt,79:201,80:gt,81:mt,83:yt,84:184,86:185,87:vt,88:bt,89:_t,90:xt,91:wt},{13:h,18:f,35:202,44:30,45:32,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},{13:h,18:f,35:203,44:30,45:32,46:p,67:[1,204],81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},e(nt,[2,43],{21:205,10:rt}),{10:O,12:I,13:R,15:P,16:q,17:j,18:U,30:Y,32:z,39:[1,206],45:71,46:V,50:$,60:G,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T},e(nt,[2,49],{21:207,10:rt}),e(nt,[2,47],{21:208,10:rt}),e(nt,[2,51],{21:209,10:rt}),e(nt,[2,53],{21:210,10:rt}),e(F,[2,36]),e([10,13,18,46,81,85,87,88,90,91,93,94,95,96,97],[2,91]),e(et,[2,117],{85:At}),e(Et,[2,122],{86:212,10:ft,46:dt,71:pt,80:gt,81:mt,83:yt,87:vt,88:bt,89:_t,90:xt,91:wt}),e(kt,[2,124]),e(kt,[2,126]),e(kt,[2,127]),e(kt,[2,128]),e(kt,[2,129]),e(kt,[2,130]),e(kt,[2,131]),e(kt,[2,132]),e(kt,[2,133]),e(kt,[2,134]),e(kt,[2,135]),e(kt,[2,136]),e(et,[2,118],{85:At}),e(et,[2,119],{85:At}),e(et,[2,120],{85:At}),e(et,[2,110],{85:At}),e(et,[2,111],{85:At}),e(et,[2,112],{45:32,44:114,13:h,18:f,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T}),e(et,[2,113],{45:32,44:114,10:[1,213],13:h,18:f,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:M,96:S,97:T}),e(et,[2,115],{10:[1,214]}),e(nt,[2,44]),{39:[1,215]},e(nt,[2,50]),e(nt,[2,48]),e(nt,[2,52]),e(nt,[2,54]),{10:ft,46:dt,71:pt,80:gt,81:mt,83:yt,84:216,86:185,87:vt,88:bt,89:_t,90:xt,91:wt},e(kt,[2,125]),{67:[1,217]},{67:[1,218]},e(nt,[2,45],{21:219,10:rt}),e(Et,[2,123],{86:212,10:ft,46:dt,71:pt,80:gt,81:mt,83:yt,87:vt,88:bt,89:_t,90:xt,91:wt}),e(et,[2,114]),e(et,[2,116]),e(nt,[2,46])],defaultActions:{},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;i.push(m);var y=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,x,w,A,E,k,D,C=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},M={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),x=a[_]&&a[_][v]),"undefined"==typeof x||!x.length||!x[0]){var S="";D=[];for(A in a[_])this.terminals_[A]&&A>l&&D.push("'"+this.terminals_[A]+"'");S=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:m,expected:D})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,b?(v=b,b=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,m=d.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[x[1]][1],M.$=r[r.length-E],M._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},y&&(M._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(M,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;E&&(n=n.slice(0,-1*E*2),r=r.slice(0,-1*E),i=i.slice(0,-1*E)),n.push(this.productions_[x[1]][0]),r.push(M.$),i.push(M._$),k=a[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},Ct=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g); - -this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:break;case 1:this.begin("string");break;case 2:this.popState();break;case 3:return"STR";case 4:return 71;case 5:return 78;case 6:return 72;case 7:return 73;case 8:return 74;case 9:return 75;case 10:return 12;case 11:return 30;case 12:return 32;case 13:return 13;case 14:return 13;case 15:return 13;case 16:return 13;case 17:return 13;case 18:return 13;case 19:return 81;case 20:return 90;case 21:return 88;case 22:return 8;case 23:return 85;case 24:return 97;case 25:return 16;case 26:return 15;case 27:return 17;case 28:return 18;case 29:return 53;case 30:return 51;case 31:return 52;case 32:return 54;case 33:return 58;case 34:return 56;case 35:return 57;case 36:return 59;case 37:return 58;case 38:return 56;case 39:return 57;case 40:return 59;case 41:return 63;case 42:return 61;case 43:return 62;case 44:return 64;case 45:return 50;case 46:return 55;case 47:return 60;case 48:return 40;case 49:return 41;case 50:return 46;case 51:return 91;case 52:return 95;case 53:return 83;case 54:return 96;case 55:return 96;case 56:return 87;case 57:return 93;case 58:return 94;case 59:return 65;case 60:return 38;case 61:return 39;case 62:return 36;case 63:return 37;case 64:return 42;case 65:return 43;case 66:return 100;case 67:return 9;case 68:return 10;case 69:return 11}},rules:[/^(?:%%[^\n]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\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)/,/^(?:$)/],conditions:{string:{rules:[2,3],inclusive:!1},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],inclusive:!0}}};return t}();return Dt.lexer=Ct,t.prototype=Dt,Dt.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],120:[function(t,e,n){(function(e){"use strict";var r=t("moment"),i=t("../../logger"),a=new i.Log,u="",o="",s=[],c=[],l="";n.clear=function(){s=[],c=[],l="",o="",g=0,h=void 0,f=void 0,b=[]},n.setDateFormat=function(t){u=t},n.getDateFormat=function(){return u},n.setTitle=function(t){o=t},n.getTitle=function(){return o},n.addSection=function(t){l=t,s.push(t)},n.getTasks=function(){for(var t=x(),e=10,n=0;!t&&e>n;)t=x(),n++;return c=b};var h,f,d=function(t,e,i){i=i.trim();var u=/^after\s+([\d\w\-]+)/,o=u.exec(i.trim());if(null!==o){var s=n.findTaskById(o[1]);if("undefined"==typeof s){var c=new Date;return c.setHours(0,0,0,0),c}return s.endTime}return r(i,e.trim(),!0).isValid()?r(i,e.trim(),!0).toDate():(a.debug("Invalid date:"+i),a.debug("With date format:"+e.trim()),new Date)},p=function(t,e,n){if(n=n.trim(),r(n,e.trim(),!0).isValid())return r(n,e.trim()).toDate();var i=r(t),a=/^([\d]+)([wdhms])/,u=a.exec(n.trim());if(null!==u){switch(u[2]){case"s":i.add(u[1],"seconds");break;case"m":i.add(u[1],"minutes");break;case"h":i.add(u[1],"hours");break;case"d":i.add(u[1],"days");break;case"w":i.add(u[1],"weeks")}return i.toDate()}return i.toDate()},g=0,m=function(t){return"undefined"==typeof t?(g+=1,"task"+g):t},y=function(t,e){var r;r=":"===e.substr(0,1)?e.substr(1,e.length):e;for(var i=r.split(","),a={},u=n.getDateFormat(),o=!0;o;)o=!1,i[0].match(/^\s*active\s*$/)&&(a.active=!0,i.shift(1),o=!0),i[0].match(/^\s*done\s*$/)&&(a.done=!0,i.shift(1),o=!0),i[0].match(/^\s*crit\s*$/)&&(a.crit=!0,i.shift(1),o=!0);var s;for(s=0;sn-e?n+i+1.5*u.sidePadding>o?e+r-5:n+r+5:(n-e)/2+e+r}).attr("y",function(t,r){return r*e+u.barHeight/2+(u.fontSize/2-2)+n}).attr("text-height",i).attr("class",function(t){for(var e=w(t.startTime),n=w(t.endTime),r=this.getBBox().width,i=0,a=0;an-e?n+r+1.5*u.sidePadding>o?"taskTextOutsideLeft taskTextOutside"+i+" "+s:"taskTextOutsideRight taskTextOutside"+i+" "+s:"taskText taskText"+i+" "+s})}function l(t,e,n,a){var o,s=[[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["h1 %I:%M",function(t){return t.getMinutes()}]],c=[["%Y",function(){return!0}]],l=[["%I:%M",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}]];"undefined"!=typeof u.axisFormatter&&(l=[],u.axisFormatter.forEach(function(t){var e=[];e[0]=t[0],e[1]=t[1],l.push(e)})),o=s.concat(l).concat(c);var h=i.svg.axis().scale(w).orient("bottom").tickSize(-a+e+u.gridLineStartPadding,0,0).tickFormat(i.time.format.multi(o));r>7&&230>r&&(h=h.ticks(i.time.monday.range)),b.append("g").attr("class","grid").attr("transform","translate("+t+", "+(a-50)+")").call(h).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em")}function h(t,e){for(var n=[],r=0,i=0;i0))return i[1]*t/2+e;for(var u=0;a>u;u++)return r+=n[a-1][1],i[1]*t/2+r*t+e}).attr("class",function(t){for(var e=0;er;++r)e.hasOwnProperty(t[r])||(e[t[r]]=!0,n.push(t[r]));return n}function p(t){for(var e=t.length,n={};e;)n[t[--e]]=(n[t[e]]||0)+1;return n}function g(t,e){return p(e)[t]||0}n.yy.clear(),n.parse(t);var m=document.getElementById(e);o=m.parentElement.offsetWidth,"undefined"==typeof o&&(o=1200),"undefined"!=typeof u.useWidth&&(o=u.useWidth);var y=n.yy.getTasks(),v=y.length*(u.barHeight+u.barGap)+2*u.topPadding;m.setAttribute("height","100%"),m.setAttribute("viewBox","0 0 "+o+" "+v);var b=i.select("#"+e),_=i.min(y,function(t){return t.startTime}),x=i.max(y,function(t){return t.endTime}),w=i.time.scale().domain([i.min(y,function(t){return t.startTime}),i.max(y,function(t){return t.endTime})]).rangeRound([0,o-150]),A=[];r=a.duration(x-_).asDays();for(var E=0;El&&D.push("'"+this.terminals_[A]+"'");S=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:m,expected:D})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,b?(v=b,b=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,m=d.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[x[1]][1],M.$=r[r.length-E],M._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},y&&(M._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(M,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;E&&(n=n.slice(0,-1*E*2),r=r.slice(0,-1*E),i=i.slice(0,-1*E)),n.push(this.productions_[x[1]][0]),r.push(M.$),i.push(M._$),k=a[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},s=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 10;case 1:break;case 2:break;case 3:break;case 4:return 4;case 5:return 11;case 6:return"date";case 7:return 12;case 8:return 13;case 9:return 14;case 10:return 15;case 11:return":";case 12:return 6;case 13:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\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],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return t}();return o.lexer=s,t.prototype=o,o.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],123:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[2,2],r=[1,5],i=[1,7],a=[1,8],u=[1,11],o=[1,12],s=[1,13],c=[1,14],l=[1,16],h=[1,17],f=[1,7,9,10,16,18,19,20,21,22,23,33],d=[7,9,10,16,18,19,20,21,23,33],p=[1,53],g={trace:function(){},yy:{},symbols_:{error:2,start:3,SD:4,document:5,line:6,SPACE:7,statement:8,NL:9,participant:10,actor:11,AS:12,restOfLine:13,signal:14,note_statement:15,title:16,text:17,loop:18,end:19,opt:20,alt:21,"else":22,note:23,placement:24,text2:25,over:26,actor_pair:27,spaceList:28,",":29,left_of:30,right_of:31,signaltype:32,ACTOR:33,SOLID_OPEN_ARROW:34,DOTTED_OPEN_ARROW:35,SOLID_ARROW:36,DOTTED_ARROW:37,SOLID_CROSS:38,DOTTED_CROSS:39,TXT:40,$accept:0,$end:1},terminals_:{2:"error",4:"SD",7:"SPACE",9:"NL",10:"participant",12:"AS",13:"restOfLine",16:"title",17:"text",18:"loop",19:"end",20:"opt",21:"alt",22:"else",23:"note",26:"over",29:",",30:"left_of",31:"right_of",33:"ACTOR",34:"SOLID_OPEN_ARROW",35:"DOTTED_OPEN_ARROW",36:"SOLID_ARROW",37:"DOTTED_ARROW",38:"SOLID_CROSS",39:"DOTTED_CROSS",40:"TXT"},productions_:[0,[3,2],[5,0],[5,2],[6,2],[6,1],[6,1],[8,5],[8,3],[8,2],[8,2],[8,4],[8,4],[8,4],[8,7],[15,4],[15,4],[28,2],[28,1],[27,3],[27,1],[24,1],[24,1],[14,4],[11,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[25,1]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 1:return r.apply(a[u]),a[u];case 2:this.$=[];break;case 3:a[u-1].push(a[u]),this.$=a[u-1];break;case 4:case 5:this.$=a[u];break;case 6:this.$=[];break;case 7:a[u-3].description=a[u-1],this.$=a[u-3];break;case 8:this.$=a[u-1];break;case 12:a[u-1].unshift({type:"loopStart",loopText:a[u-2],signalType:r.LINETYPE.LOOP_START}),a[u-1].push({type:"loopEnd",loopText:a[u-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[u-1];break;case 13:a[u-1].unshift({type:"optStart",optText:a[u-2],signalType:r.LINETYPE.OPT_START}),a[u-1].push({type:"optEnd",optText:a[u-2],signalType:r.LINETYPE.OPT_END}),this.$=a[u-1];break;case 14:a[u-4].unshift({type:"altStart",altText:a[u-5],signalType:r.LINETYPE.ALT_START}),a[u-4].push({type:"else",altText:a[u-2],signalType:r.LINETYPE.ALT_ELSE}),a[u-4]=a[u-4].concat(a[u-1]),a[u-4].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=a[u-4];break;case 15:this.$=[a[u-1],{type:"addNote",placement:a[u-2],actor:a[u-1].actor,text:a[u]}];break;case 16:a[u-2]=[].concat(a[u-1],a[u-1]).slice(0,2), -a[u-2][0]=a[u-2][0].actor,a[u-2][1]=a[u-2][1].actor,this.$=[a[u-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:a[u-2].slice(0,2),text:a[u]}];break;case 19:this.$=[a[u-2],a[u]];break;case 20:this.$=a[u];break;case 21:this.$=r.PLACEMENT.LEFTOF;break;case 22:this.$=r.PLACEMENT.RIGHTOF;break;case 23:this.$=[a[u-3],a[u-1],{type:"addMessage",from:a[u-3].actor,to:a[u-1].actor,signalType:a[u-2],msg:a[u]}];break;case 24:this.$={type:"addActor",actor:a[u]};break;case 25:this.$=r.LINETYPE.SOLID_OPEN;break;case 26:this.$=r.LINETYPE.DOTTED_OPEN;break;case 27:this.$=r.LINETYPE.SOLID;break;case 28:this.$=r.LINETYPE.DOTTED;break;case 29:this.$=r.LINETYPE.SOLID_CROSS;break;case 30:this.$=r.LINETYPE.DOTTED_CROSS;break;case 31:this.$=a[u].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},e([1,7,9,10,16,18,20,21,23,33],n,{5:3}),{1:[2,1],6:4,7:r,8:6,9:i,10:a,11:15,14:9,15:10,16:u,18:o,20:s,21:c,23:l,33:h},e(f,[2,3]),{8:18,10:a,11:15,14:9,15:10,16:u,18:o,20:s,21:c,23:l,33:h},e(f,[2,5]),e(f,[2,6]),{11:19,33:h},{9:[1,20]},{9:[1,21]},{7:[1,22]},{13:[1,23]},{13:[1,24]},{13:[1,25]},{32:26,34:[1,27],35:[1,28],36:[1,29],37:[1,30],38:[1,31],39:[1,32]},{24:33,26:[1,34],30:[1,35],31:[1,36]},e([9,12,29,34,35,36,37,38,39,40],[2,24]),e(f,[2,4]),{9:[1,38],12:[1,37]},e(f,[2,9]),e(f,[2,10]),{17:[1,39]},e(d,n,{5:40}),e(d,n,{5:41}),e([7,9,10,16,18,20,21,22,23,33],n,{5:42}),{11:43,33:h},{33:[2,25]},{33:[2,26]},{33:[2,27]},{33:[2,28]},{33:[2,29]},{33:[2,30]},{11:44,33:h},{11:46,27:45,33:h},{33:[2,21]},{33:[2,22]},{13:[1,47]},e(f,[2,8]),{9:[1,48]},{6:4,7:r,8:6,9:i,10:a,11:15,14:9,15:10,16:u,18:o,19:[1,49],20:s,21:c,23:l,33:h},{6:4,7:r,8:6,9:i,10:a,11:15,14:9,15:10,16:u,18:o,19:[1,50],20:s,21:c,23:l,33:h},{6:4,7:r,8:6,9:i,10:a,11:15,14:9,15:10,16:u,18:o,20:s,21:c,22:[1,51],23:l,33:h},{25:52,40:p},{25:54,40:p},{25:55,40:p},{29:[1,56],40:[2,20]},{9:[1,57]},e(f,[2,11]),e(f,[2,12]),e(f,[2,13]),{13:[1,58]},{9:[2,23]},{9:[2,31]},{9:[2,15]},{9:[2,16]},{11:59,33:h},e(f,[2,7]),e(d,n,{5:60}),{40:[2,19]},{6:4,7:r,8:6,9:i,10:a,11:15,14:9,15:10,16:u,18:o,19:[1,61],20:s,21:c,23:l,33:h},e(f,[2,14])],defaultActions:{27:[2,25],28:[2,26],29:[2,27],30:[2,28],31:[2,29],32:[2,30],35:[2,21],36:[2,22],52:[2,23],53:[2,31],54:[2,15],55:[2,16],59:[2,19]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;i.push(m);var y=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,x,w,A,E,k,D,C=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},M={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),x=a[_]&&a[_][v]),"undefined"==typeof x||!x.length||!x[0]){var S="";D=[];for(A in a[_])this.terminals_[A]&&A>l&&D.push("'"+this.terminals_[A]+"'");S=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:m,expected:D})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,b?(v=b,b=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,m=d.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[x[1]][1],M.$=r[r.length-E],M._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},y&&(M._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(M,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;E&&(n=n.slice(0,-1*E*2),r=r.slice(0,-1*E),i=i.slice(0,-1*E)),n.push(this.productions_[x[1]][0]),r.push(M.$),i.push(M._$),k=a[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},m=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 9;case 1:break;case 2:break;case 3:break;case 4:break;case 5:return this.begin("ID"),10;case 6:return this.begin("ALIAS"),33;case 7:return this.popState(),this.popState(),this.begin("LINE"),12;case 8:return this.popState(),this.popState(),9;case 9:return this.begin("LINE"),18;case 10:return this.begin("LINE"),20;case 11:return this.begin("LINE"),21;case 12:return this.begin("LINE"),22;case 13:return this.popState(),13;case 14:return 19;case 15:return 30;case 16:return 31;case 17:return 26;case 18:return 23;case 19:return 16;case 20:return 4;case 21:return 29;case 22:return 9;case 23:return 33;case 24:return 36;case 25:return 37;case 26:return 34;case 27:return 35;case 28:return 38;case 29:return 39;case 30:return 40;case 31:return 9;case 32:return"INVALID"}},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,/^(?:[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\->:\n,;]+)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[2,3,13],inclusive:!1},ALIAS:{rules:[2,3,7,8],inclusive:!1},ID:{rules:[2,3,6],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],inclusive:!0}}};return t}();return g.lexer=m,t.prototype=g,g.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],124:[function(t,e,n){(function(e){"use strict";var r={},i=[],a=[],u=t("../../logger"),o=new u.Log;n.addActor=function(t,e,n){var i=r[t];i&&e===i.name&&null==n||(null==n&&(n=e),r[t]={name:e,description:n})},n.addMessage=function(t,e,n,r){i.push({from:t,to:e,message:n,answer:r})},n.addSignal=function(t,e,n,r){o.debug("Adding message from="+t+" to="+e+" message="+n+" type="+r),i.push({from:t,to:e,message:n,type:r})},n.getMessages=function(){return i},n.getActors=function(){return r},n.getActor=function(t){return r[t]},n.getActorKeys=function(){return Object.keys(r)},n.clear=function(){r={},i=[]},n.LINETYPE={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16},n.ARROWTYPE={FILLED:0,OPEN:1},n.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2},n.addNote=function(t,e,r){var u={actor:t,placement:e,message:r},o=[].concat(t,t);a.push(u),i.push({from:o[0],to:o[1],message:r,type:n.LINETYPE.NOTE,placement:e})},n.parseError=function(t,n){e.mermaidAPI.parseError(t,n)},n.apply=function(t){if(t instanceof Array)t.forEach(function(t){n.apply(t)});else switch(t.type){case"addActor":n.addActor(t.actor,t.actor,t.description);break;case"addNote":n.addNote(t.actor,t.placement,t.text);break;case"addMessage":n.addSignal(t.from,t.to,t.msg,t.signalType);break;case"loopStart":n.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":n.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":n.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":n.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":n.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":n.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":n.addSignal(void 0,void 0,void 0,t.signalType)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../logger":127}],125:[function(t,e,n){"use strict";var r=t("./parser/sequenceDiagram").parser;r.yy=t("./sequenceDb");var i=t("./svgDraw"),a=t("../../d3"),u=t("../../logger"),o=new u.Log,s={diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!1,bottomMarginAdj:1};n.bounds={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,list:[],init:function(){this.list=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,n,r){t[e]="undefined"==typeof t[e]?n:r(n,t[e])},updateLoops:function(t,e,r,i){var a=this,u=0;this.list.forEach(function(o){u++;var c=a.list.length-u+1;a.updateVal(o,"startx",t-c*s.boxMargin,Math.min),a.updateVal(o,"starty",e-c*s.boxMargin,Math.min),a.updateVal(o,"stopx",r+c*s.boxMargin,Math.max),a.updateVal(o,"stopy",i+c*s.boxMargin,Math.max),a.updateVal(n.bounds.data,"startx",t-c*s.boxMargin,Math.min),a.updateVal(n.bounds.data,"starty",e-c*s.boxMargin,Math.min),a.updateVal(n.bounds.data,"stopx",r+c*s.boxMargin,Math.max),a.updateVal(n.bounds.data,"stopy",i+c*s.boxMargin,Math.max)})},insert:function(t,e,r,i){var a,u,o,s;a=Math.min(t,r),o=Math.max(t,r),u=Math.min(e,i),s=Math.max(e,i),this.updateVal(n.bounds.data,"startx",a,Math.min),this.updateVal(n.bounds.data,"starty",u,Math.min),this.updateVal(n.bounds.data,"stopx",o,Math.max),this.updateVal(n.bounds.data,"stopy",s,Math.max),this.updateLoops(a,u,o,s)},newLoop:function(t){this.list.push({startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t})},endLoop:function(){var t=this.list.pop();return t},addElseToLoop:function(t){var e=this.list.pop();e.elsey=n.bounds.getVerticalPos(),e.elseText=t,this.list.push(e)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}};var c=function(t,e,r,a,u){var o=i.getNoteRect();o.x=e,o.y=r,o.width=u||s.width,o["class"]="note";var c=t.append("g"),l=i.drawRect(c,o),h=i.getTextObj();h.x=e-4,h.y=r-13,h.textMargin=s.noteMargin,h.dy="1em",h.text=a.message,h["class"]="noteText";var f=i.drawText(c,h,o.width-s.noteMargin),d=f[0][0].getBBox().height;!u&&d>s.width?(f.remove(),c=t.append("g"),f=i.drawText(c,h,2*o.width-s.noteMargin),d=f[0][0].getBBox().height,l.attr("width",2*o.width),n.bounds.insert(e,r,e+2*o.width,r+2*s.noteMargin+d)):n.bounds.insert(e,r,e+o.width,r+2*s.noteMargin+d),l.attr("height",d+2*s.noteMargin),n.bounds.bumpVerticalPos(d+2*s.noteMargin)},l=function(t,e,i,a,u){var o,c=t.append("g"),l=e+(i-e)/2,h=c.append("text").attr("x",l).attr("y",a-7).style("text-anchor","middle").attr("class","messageText").text(u.message);o="undefined"!=typeof h[0][0].getBBox?h[0][0].getBBox().width:h[0][0].getBoundingClientRect();var f;if(e===i){f=c.append("path").attr("d","M "+e+","+a+" C "+(e+60)+","+(a-10)+" "+(e+60)+","+(a+30)+" "+e+","+(a+20)),n.bounds.bumpVerticalPos(30);var d=Math.max(o/2,100);n.bounds.insert(e-d,n.bounds.getVerticalPos()-10,i+d,n.bounds.getVerticalPos())}else f=c.append("line"),f.attr("x1",e),f.attr("y1",a),f.attr("x2",i),f.attr("y2",a),n.bounds.insert(e,n.bounds.getVerticalPos()-10,i,n.bounds.getVerticalPos());u.type===r.yy.LINETYPE.DOTTED||u.type===r.yy.LINETYPE.DOTTED_CROSS||u.type===r.yy.LINETYPE.DOTTED_OPEN?(f.style("stroke-dasharray","3, 3"),f.attr("class","messageLine1")):f.attr("class","messageLine0");var p="";s.arrowMarkerAbsolute&&(p=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,p=p.replace(/\(/g,"\\("),p=p.replace(/\)/g,"\\)")),f.attr("stroke-width",2),f.attr("stroke","black"),f.style("fill","none"),(u.type===r.yy.LINETYPE.SOLID||u.type===r.yy.LINETYPE.DOTTED)&&f.attr("marker-end","url("+p+"#arrowhead)"),(u.type===r.yy.LINETYPE.SOLID_CROSS||u.type===r.yy.LINETYPE.DOTTED_CROSS)&&f.attr("marker-end","url("+p+"#crosshead)")};e.exports.drawActors=function(t,e,r,a){var u;for(u=0;u/gi," "),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.attr("fill",e.fill),"undefined"!=typeof e["class"]&&i.attr("class",e["class"]);var a=i.append("tspan");return a.attr("x",e.x+2*e.textMargin),a.text(r),"undefined"!=typeof i.textwrap&&i.textwrap({x:e.x,y:e.y,width:n,height:1800},e.textMargin),i},n.drawLabel=function(t,e){var r=n.getNoteRect();r.x=e.x,r.y=e.y,r.width=50,r.height=20,r.fill="#526e52",r.stroke="none",r["class"]="labelBox",n.drawRect(t,r),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,e.fill="white",n.drawText(t,e)};var r=-1;n.drawActor=function(t,e,i,a,u){var o=e+u.width/2,s=t.append("g");0===i&&(r++,s.append("line").attr("id","actor"+r).attr("x1",o).attr("y1",5).attr("x2",o).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"));var c=n.getNoteRect();c.x=e,c.y=i,c.fill="#eaeaea",c.width=u.width,c.height=u.height,c["class"]="actor",c.rx=3,c.ry=3,n.drawRect(s,c),s.append("text").attr("x",o).attr("y",i+u.height/2+5).attr("class","actor").style("text-anchor","middle").text(a)},n.drawLoop=function(t,e,r,i){var a=t.append("g"),u=function(t,e,n,r){a.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",r).attr("stroke-width",2).attr("stroke","#526e52").attr("class","loopLine")};u(e.startx,e.starty,e.stopx,e.starty),u(e.stopx,e.starty,e.stopx,e.stopy),u(e.startx,e.stopy,e.stopx,e.stopy),u(e.startx,e.starty,e.startx,e.stopy),"undefined"!=typeof e.elsey&&u(e.startx,e.elsey,e.stopx,e.elsey);var o=n.getTextObj();o.text=r,o.x=e.startx,o.y=e.starty,o.labelMargin=15,o["class"]="labelText",o.fill="white",n.drawLabel(a,o),o=n.getTextObj(),o.text="[ "+e.title+" ]",o.x=e.startx+(e.stopx-e.startx)/2,o.y=e.starty+1.5*i.boxMargin,o.anchor="middle",o["class"]="loopText",n.drawText(a,o),"undefined"!=typeof e.elseText&&(o.text="[ "+e.elseText+" ]",o.y=e.elsey+1.5*i.boxMargin,n.drawText(a,o))},n.insertArrowHead=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},n.insertArrowCrossHead=function(t){var e=t.append("defs"),n=e.append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.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"),n.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")},n.getTextObj=function(){var t={x:0,y:0,fill:"black","text-anchor":"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0};return t},n.getNoteRect=function(){var t={x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0};return t}},{}],127:[function(t,e,n){"use strict";function r(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getSeconds(),i=t.getMilliseconds();10>e&&(e="0"+e),10>n&&(n="0"+n),10>r&&(r="0"+r),100>i&&(i="0"+i),10>i&&(i="00"+i);var a=e+":"+n+":"+r+" ("+i+")";return a}function i(t){this.level=t,this.log=function(t,e){var n=this.level;return"undefined"==typeof n&&(n=u),e>=n&&"undefined"!=typeof console&&"undefined"!=typeof console.log?console.log("["+r(new Date)+"] "+t):void 0},this.trace=function(t){this.log(t,a.trace)},this.debug=function(t){this.log(t,a.debug)},this.info=function(t){this.log(t,a.info)},this.warn=function(t){this.log(t,a.warn)},this.error=function(t){this.log(t,a.error)}}var a={debug:1,info:2,warn:3,error:4,fatal:5,"default":5},u=a.error;n.setLogLevel=function(t){u=t},n.Log=i},{}],128:[function(t,e,n){(function(r){"use strict";var i=t("./logger"),a=new i.Log,u=t("./mermaidAPI"),o=0,s=t("he");e.exports.mermaidAPI=u;var c=function(){var t=u.getConfig();a.debug("Starting rendering diagrams");var e;arguments.length>=2?("undefined"!=typeof arguments[0]&&(r.mermaid.sequenceConfig=arguments[0]),e=arguments[1]):e=arguments[0];var n;"function"==typeof arguments[arguments.length-1]?(n=arguments[arguments.length-1],a.debug("Callback function found")):"undefined"!=typeof t.mermaid&&("function"==typeof t.mermaid.callback?(n=t.mermaid.callback,a.debug("Callback function found")):a.debug("No Callback function found")),e=void 0===e?document.querySelectorAll(".mermaid"):"string"==typeof e?document.querySelectorAll(e):e instanceof Node?[e]:e;var i;"undefined"!=typeof mermaid_config&&u.initialize(r.mermaid_config),a.debug("Start On Load before: "+r.mermaid.startOnLoad),"undefined"!=typeof r.mermaid.startOnLoad&&(a.debug("Start On Load inner: "+r.mermaid.startOnLoad),u.initialize({startOnLoad:r.mermaid.startOnLoad})),"undefined"!=typeof r.mermaid.ganttConfig&&u.initialize({gantt:r.mermaid.ganttConfig});var c,l=function(t,e){h.innerHTML=t,"undefined"!=typeof n&&n(f),e(h)};for(i=0;i0&&(r+=n.selectorText+" { "+n.style.cssText+"}\n")}}catch(l){"undefined"!=typeof n&&i.warn('Invalid CSS selector "'+n.selectorText+'"',l)}var h="",f="";for(var d in e)e.hasOwnProperty(d)&&"undefined"!=typeof d&&("default"===d?(e["default"].styles instanceof Array&&(h+="#"+t.id.trim()+" .node>rect { "+e[d].styles.join("; ")+"; }\n"),e["default"].nodeLabelStyles instanceof Array&&(h+="#"+t.id.trim()+" .node text { "+e[d].nodeLabelStyles.join("; ")+"; }\n"),e["default"].edgeLabelStyles instanceof Array&&(h+="#"+t.id.trim()+" .edgeLabel text { "+e[d].edgeLabelStyles.join("; ")+"; }\n"),e["default"].clusterStyles instanceof Array&&(h+="#"+t.id.trim()+" .cluster rect { "+e[d].clusterStyles.join("; ")+"; }\n")):e[d].styles instanceof Array&&(f+="#"+t.id.trim()+" ."+d+">rect, ."+d+">polygon, ."+d+">ellipse { "+e[d].styles.join("; ")+"; }\n"));if(""!==r||""!==h||""!==f){var p=document.createElement("style");p.setAttribute("type","text/css"),p.setAttribute("title","mermaid-svg-internal-css"),p.innerHTML="/* */\n",t.insertBefore(p,t.firstChild)}};n.cloneCssStyles=u},{"./logger":127}]},{},[128])(128)}); \ No newline at end of file +}function O(){return Object.keys(ar)}function R(t,e){var n=t.toLowerCase();ur[n]=ur[n+"s"]=ur[e]=t}function P(t){return"string"==typeof t?ur[t]||ur[t.toLowerCase()]:void 0}function q(t){var e,n,r={};for(n in t)o(t,n)&&(e=P(n),e&&(r[e]=t[n]));return r}function j(t,e){return function(r){return null!=r?(Y(this,t,r),n.updateOffset(this,e),this):U(this,t)}}function U(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():0/0}function Y(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function V(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if(t=P(t),E(this[t]))return this[t](e);return this}function z(t,e,n){var r=""+Math.abs(t),i=e-r.length,a=t>=0;return(a?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}function $(t,e,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),t&&(lr[t]=i),e&&(lr[e[0]]=function(){return z(i.apply(this,arguments),e[1],e[2])}),n&&(lr[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function H(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function G(t){var e,n,r=t.match(or);for(e=0,n=r.length;n>e;e++)r[e]=lr[r[e]]?lr[r[e]]:H(r[e]);return function(i){var a="";for(e=0;n>e;e++)a+=r[e]instanceof Function?r[e].call(i,t):r[e];return a}}function W(t,e){return t.isValid()?(e=Z(e,t.localeData()),cr[e]=cr[e]||G(e),cr[e](t)):t.localeData().invalidDate()}function Z(t,e){function n(t){return e.longDateFormat(t)||t}var r=5;for(sr.lastIndex=0;r>=0&&sr.test(t);)t=t.replace(sr,n),sr.lastIndex=0,r-=1;return t}function X(t,e,n){Sr[t]=E(e)?e:function(t){return t&&n?n:e}}function J(t,e){return o(Sr,t)?Sr[t](e._strict,e._locale):new RegExp(K(t))}function K(t){return Q(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,r,i){return e||n||r||i}))}function Q(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function tt(t,e){var n,r=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(r=function(t,n){n[e]=b(t)}),n=0;nr;r++){if(i=c([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[r].test(t))return r;if(n&&"MMM"===e&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function ot(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=b(e);else if(e=t.localeData().monthsParse(e),"number"!=typeof e)return t;return n=Math.min(t.date(),rt(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function st(t){return null!=t?(ot(this,t),n.updateOffset(this,!0),this):U(this,"Month")}function ct(){return rt(this.year(),this.month())}function lt(t){return this._monthsParseExact?(o(this,"_monthsRegex")||ft.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex}function ht(t){return this._monthsParseExact?(o(this,"_monthsRegex")||ft.call(this),t?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex}function ft(){function t(t,e){return e.length-t.length}var e,n,r=[],i=[],a=[];for(e=0;12>e;e++)n=c([2e3,e]),r.push(this.monthsShort(n,"")),i.push(this.months(n,"")),a.push(this.months(n,"")),a.push(this.monthsShort(n,""));for(r.sort(t),i.sort(t),a.sort(t),e=0;12>e;e++)r[e]=Q(r[e]),i[e]=Q(i[e]),a[e]=Q(a[e]);this._monthsRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")$","i")}function dt(t){var e,n=t._a;return n&&-2===h(t).overflow&&(e=n[Fr]<0||n[Fr]>11?Fr:n[Lr]<1||n[Lr]>rt(n[Tr],n[Fr])?Lr:n[Br]<0||n[Br]>24||24===n[Br]&&(0!==n[Nr]||0!==n[Ir]||0!==n[Or])?Br:n[Nr]<0||n[Nr]>59?Nr:n[Ir]<0||n[Ir]>59?Ir:n[Or]<0||n[Or]>999?Or:-1,h(t)._overflowDayOfYear&&(Tr>e||e>Lr)&&(e=Lr),h(t)._overflowWeeks&&-1===e&&(e=Rr),h(t)._overflowWeekday&&-1===e&&(e=Pr),h(t).overflow=e),t}function pt(t){var e,n,r,i,a,u,o=t._i,s=zr.exec(o)||$r.exec(o);if(s){for(h(t).iso=!0,e=0,n=Gr.length;n>e;e++)if(Gr[e][1].exec(s[1])){i=Gr[e][0],r=Gr[e][2]!==!1;break}if(null==i)return void(t._isValid=!1);if(s[3]){for(e=0,n=Wr.length;n>e;e++)if(Wr[e][1].exec(s[3])){a=(s[2]||" ")+Wr[e][0];break}if(null==a)return void(t._isValid=!1)}if(!r&&null!=a)return void(t._isValid=!1);if(s[4]){if(!Hr.exec(s[4]))return void(t._isValid=!1);u="Z"}t._f=i+(a||"")+(u||""),Mt(t)}else t._isValid=!1}function gt(t){var e=Zr.exec(t._i);return null!==e?void(t._d=new Date(+e[1])):(pt(t),void(t._isValid===!1&&(delete t._isValid,n.createFromInputFallback(t))))}function mt(t,e,n,r,i,a,u){var o=new Date(t,e,n,r,i,a,u);return 100>t&&t>=0&&isFinite(o.getFullYear())&&o.setFullYear(t),o}function yt(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function vt(t){return bt(t)?366:365}function bt(t){return t%4===0&&t%100!==0||t%400===0}function _t(){return bt(this.year())}function xt(t,e,n){var r=7+e-n,i=(7+yt(t,0,r).getUTCDay()-e)%7;return-i+r-1}function wt(t,e,n,r,i){var a,u,o=(7+n-r)%7,s=xt(t,r,i),c=1+7*(e-1)+o+s;return 0>=c?(a=t-1,u=vt(a)+c):c>vt(t)?(a=t+1,u=c-vt(t)):(a=t,u=c),{year:a,dayOfYear:u}}function At(t,e,n){var r,i,a=xt(t.year(),e,n),u=Math.floor((t.dayOfYear()-a-1)/7)+1;return 1>u?(i=t.year()-1,r=u+Et(i,e,n)):u>Et(t.year(),e,n)?(r=u-Et(t.year(),e,n),i=t.year()+1):(i=t.year(),r=u),{week:r,year:i}}function Et(t,e,n){var r=xt(t,e,n),i=xt(t+1,e,n);return(vt(t)-r+i)/7}function kt(t,e,n){return null!=t?t:null!=e?e:n}function Dt(t){var e=new Date(n.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Ct(t){var e,n,r,i,a=[];if(!t._d){for(r=Dt(t),t._w&&null==t._a[Lr]&&null==t._a[Fr]&&St(t),t._dayOfYear&&(i=kt(t._a[Tr],r[Tr]),t._dayOfYear>vt(i)&&(h(t)._overflowDayOfYear=!0),n=yt(i,0,t._dayOfYear),t._a[Fr]=n.getUTCMonth(),t._a[Lr]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=a[e]=r[e];for(;7>e;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Br]&&0===t._a[Nr]&&0===t._a[Ir]&&0===t._a[Or]&&(t._nextDay=!0,t._a[Br]=0),t._d=(t._useUTC?yt:mt).apply(null,a),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Br]=24)}}function St(t){var e,n,r,i,a,u,o,s;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(a=1,u=4,n=kt(e.GG,t._a[Tr],At(Rt(),1,4).year),r=kt(e.W,1),i=kt(e.E,1),(1>i||i>7)&&(s=!0)):(a=t._locale._week.dow,u=t._locale._week.doy,n=kt(e.gg,t._a[Tr],At(Rt(),a,u).year),r=kt(e.w,1),null!=e.d?(i=e.d,(0>i||i>6)&&(s=!0)):null!=e.e?(i=e.e+a,(e.e<0||e.e>6)&&(s=!0)):i=a),1>r||r>Et(n,a,u)?h(t)._overflowWeeks=!0:null!=s?h(t)._overflowWeekday=!0:(o=wt(n,r,i,a,u),t._a[Tr]=o.year,t._dayOfYear=o.dayOfYear)}function Mt(t){if(t._f===n.ISO_8601)return void pt(t);t._a=[],h(t).empty=!0;var e,r,i,a,u,o=""+t._i,s=o.length,c=0;for(i=Z(t._f,t._locale).match(or)||[],e=0;e0&&h(t).unusedInput.push(u),o=o.slice(o.indexOf(r)+r.length),c+=r.length),lr[a]?(r?h(t).empty=!1:h(t).unusedTokens.push(a),nt(a,r,t)):t._strict&&!r&&h(t).unusedTokens.push(a);h(t).charsLeftOver=s-c,o.length>0&&h(t).unusedInput.push(o),h(t).bigHour===!0&&t._a[Br]<=12&&t._a[Br]>0&&(h(t).bigHour=void 0),t._a[Br]=Tt(t._locale,t._a[Br],t._meridiem),Ct(t),dt(t)}function Tt(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(r=t.isPM(n),r&&12>e&&(e+=12),r||12!==e||(e=0),e):e}function Ft(t){var e,n,r,i,a;if(0===t._f.length)return h(t).invalidFormat=!0,void(t._d=new Date(0/0));for(i=0;ia)&&(r=a,n=e));s(t,n||e)}function Lt(t){if(!t._d){var e=q(t._i);t._a=u([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),Ct(t)}}function Bt(t){var e=new m(dt(Nt(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Nt(t){var e=t._i,n=t._f;return t._locale=t._locale||I(t._l),null===e||void 0===n&&""===e?d({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),y(e)?new m(dt(e)):(i(n)?Ft(t):n?Mt(t):a(e)?t._d=e:It(t),f(t)||(t._d=null),t))}function It(t){var e=t._i;void 0===e?t._d=new Date(n.now()):a(e)?t._d=new Date(+e):"string"==typeof e?gt(t):i(e)?(t._a=u(e.slice(0),function(t){return parseInt(t,10)}),Ct(t)):"object"==typeof e?Lt(t):"number"==typeof e?t._d=new Date(e):n.createFromInputFallback(t)}function Ot(t,e,n,r,i){var a={};return"boolean"==typeof n&&(r=n,n=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=t,a._f=e,a._strict=r,Bt(a)}function Rt(t,e,n,r){return Ot(t,e,n,r,!1)}function Pt(t,e){var n,r;if(1===e.length&&i(e[0])&&(e=e[0]),!e.length)return Rt();for(n=e[0],r=1;rt&&(t=-t,n="-"),n+z(~~(t/60),2)+e+z(~~t%60,2)})}function zt(t,e){var n=(e||"").match(t)||[],r=n[n.length-1]||[],i=(r+"").match(ti)||["-",0,0],a=+(60*i[1])+b(i[2]);return"+"===i[0]?a:-a}function $t(t,e){var r,i;return e._isUTC?(r=e.clone(),i=(y(t)||a(t)?+t:+Rt(t))-+r,r._d.setTime(+r._d+i),n.updateOffset(r,!1),r):Rt(t).local()}function Ht(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Gt(t,e){var r,i=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=zt(kr,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&e&&(r=Ht(this)),this._offset=t,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==t&&(!e||this._changeInProgress?le(this,ie(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:Ht(this):null!=t?this:0/0}function Wt(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Zt(t){return this.utcOffset(0,t)}function Xt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ht(this),"m")),this}function Jt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(zt(Er,this._i)),this}function Kt(t){return this.isValid()?(t=t?Rt(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function Qt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function te(){if(!p(this._isDSTShifted))return this._isDSTShifted;var t={};if(g(t,this),t=Nt(t),t._a){var e=t._isUTC?c(t._a):Rt(t._a);this._isDSTShifted=this.isValid()&&_(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function ee(){return this.isValid()?!this._isUTC:!1}function ne(){return this.isValid()?this._isUTC:!1}function re(){return this.isValid()?this._isUTC&&0===this._offset:!1}function ie(t,e){var n,r,i,a=t,u=null;return Yt(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(a={},e?a[e]=t:a.milliseconds=t):(u=ei.exec(t))?(n="-"===u[1]?-1:1,a={y:0,d:b(u[Lr])*n,h:b(u[Br])*n,m:b(u[Nr])*n,s:b(u[Ir])*n,ms:b(u[Or])*n}):(u=ni.exec(t))?(n="-"===u[1]?-1:1,a={y:ae(u[2],n),M:ae(u[3],n),w:ae(u[4],n),d:ae(u[5],n),h:ae(u[6],n),m:ae(u[7],n),s:ae(u[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(i=oe(Rt(a.from),Rt(a.to)),a={},a.ms=i.milliseconds,a.M=i.months),r=new Ut(a),Yt(t)&&o(t,"_locale")&&(r._locale=t._locale),r}function ae(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function ue(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function oe(t,e){var n;return t.isValid()&&e.isValid()?(e=$t(e,t),t.isBefore(e)?n=ue(t,e):(n=ue(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function se(t){return 0>t?-1*Math.round(-1*t):Math.round(t)}function ce(t,e){return function(n,r){var i,a;return null===r||isNaN(+r)||(A(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),a=n,n=r,r=a),n="string"==typeof n?+n:n,i=ie(n,r),le(this,i,t),this}}function le(t,e,r,i){var a=e._milliseconds,u=se(e._days),o=se(e._months);t.isValid()&&(i=null==i?!0:i,a&&t._d.setTime(+t._d+a*r),u&&Y(t,"Date",U(t,"Date")+u*r),o&&ot(t,U(t,"Month")+o*r),i&&n.updateOffset(t,u||o))}function he(t,e){var n=t||Rt(),r=$t(n,this).startOf("day"),i=this.diff(r,"days",!0),a=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse",u=e&&(E(e[a])?e[a]():e[a]);return this.format(u||this.localeData().calendar(a,this,Rt(n)))}function fe(){return new m(this)}function de(t,e){var n=y(t)?t:Rt(t);return this.isValid()&&n.isValid()?(e=P(p(e)?"millisecond":e),"millisecond"===e?+this>+n:+n<+this.clone().startOf(e)):!1}function pe(t,e){var n=y(t)?t:Rt(t);return this.isValid()&&n.isValid()?(e=P(p(e)?"millisecond":e),"millisecond"===e?+n>+this:+this.clone().endOf(e)<+n):!1}function ge(t,e,n){return this.isAfter(t,n)&&this.isBefore(e,n)}function me(t,e){var n,r=y(t)?t:Rt(t);return this.isValid()&&r.isValid()?(e=P(e||"millisecond"),"millisecond"===e?+this===+r:(n=+r,+this.clone().startOf(e)<=n&&n<=+this.clone().endOf(e))):!1}function ye(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function ve(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function be(t,e,n){var r,i,a,u;return this.isValid()?(r=$t(t,this),r.isValid()?(i=6e4*(r.utcOffset()-this.utcOffset()),e=P(e),"year"===e||"month"===e||"quarter"===e?(u=_e(this,r),"quarter"===e?u/=3:"year"===e&&(u/=12)):(a=this-r,u="second"===e?a/1e3:"minute"===e?a/6e4:"hour"===e?a/36e5:"day"===e?(a-i)/864e5:"week"===e?(a-i)/6048e5:a),n?u:v(u)):0/0):0/0}function _e(t,e){var n,r,i=12*(e.year()-t.year())+(e.month()-t.month()),a=t.clone().add(i,"months");return 0>e-a?(n=t.clone().add(i-1,"months"),r=(e-a)/(a-n)):(n=t.clone().add(i+1,"months"),r=(e-a)/(n-a)),-(i+r)}function xe(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function we(){var t=this.clone().utc();return 0a&&(e=a),We.call(this,t,e,n,r,i))}function We(t,e,n,r,i){var a=wt(t,e,n,r,i),u=yt(a.year,0,a.dayOfYear);return this.year(u.getUTCFullYear()),this.month(u.getUTCMonth()),this.date(u.getUTCDate()),this}function Ze(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Xe(t){return At(t,this._week.dow,this._week.doy).week}function Je(){return this._week.dow}function Ke(){return this._week.doy}function Qe(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function tn(t){var e=At(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function en(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function nn(t,e){return i(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]}function rn(t){return this._weekdaysShort[t.day()]}function an(t){return this._weekdaysMin[t.day()]}function un(t,e,n){var r,i,a;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;7>r;r++){if(i=Rt([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[r].test(t))return r;if(n&&"ddd"===e&&this._shortWeekdaysParse[r].test(t))return r;if(n&&"dd"===e&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function on(t){if(!this.isValid())return null!=t?this:0/0;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=en(t,this.localeData()),this.add(t-e,"d")):e}function sn(t){if(!this.isValid())return null!=t?this:0/0;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function cn(t){return this.isValid()?null==t?this.day()||7:this.day(this.day()%7?t:t-7):null!=t?this:0/0}function ln(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function hn(){return this.hours()%12||12}function fn(t,e){$(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function dn(t,e){return e._meridiemParse}function pn(t){return"p"===(t+"").toLowerCase().charAt(0)}function gn(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function mn(t,e){e[Or]=b(1e3*("0."+t))}function yn(){return this._isUTC?"UTC":""}function vn(){return this._isUTC?"Coordinated Universal Time":""}function bn(t){return Rt(1e3*t)}function _n(){return Rt.apply(null,arguments).parseZone()}function xn(t,e,n){var r=this._calendar[t];return E(r)?r.call(e,n):r}function wn(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function An(){return this._invalidDate}function En(t){return this._ordinal.replace("%d",t)}function kn(t){return t}function Dn(t,e,n,r){var i=this._relativeTime[n];return E(i)?i(t,e,n,r):i.replace(/%d/i,t)}function Cn(t,e){var n=this._relativeTime[t>0?"future":"past"];return E(n)?n(e):n.replace(/%s/i,e)}function Sn(t,e,n,r){var i=I(),a=c().set(r,e);return i[n](a,t)}function Mn(t,e,n,r,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return Sn(t,e,n,i);var a,u=[];for(a=0;r>a;a++)u[a]=Sn(t,a,n,i);return u}function Tn(t,e){return Mn(t,e,"months",12,"month")}function Fn(t,e){return Mn(t,e,"monthsShort",12,"month")}function Ln(t,e){return Mn(t,e,"weekdays",7,"day")}function Bn(t,e){return Mn(t,e,"weekdaysShort",7,"day")}function Nn(t,e){return Mn(t,e,"weekdaysMin",7,"day")}function In(){var t=this._data;return this._milliseconds=Di(this._milliseconds),this._days=Di(this._days),this._months=Di(this._months),t.milliseconds=Di(t.milliseconds),t.seconds=Di(t.seconds),t.minutes=Di(t.minutes),t.hours=Di(t.hours),t.months=Di(t.months),t.years=Di(t.years),this}function On(t,e,n,r){var i=ie(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function Rn(t,e){return On(this,t,e,1)}function Pn(t,e){return On(this,t,e,-1)}function qn(t){return 0>t?Math.floor(t):Math.ceil(t)}function jn(){var t,e,n,r,i,a=this._milliseconds,u=this._days,o=this._months,s=this._data;return a>=0&&u>=0&&o>=0||0>=a&&0>=u&&0>=o||(a+=864e5*qn(Yn(o)+u),u=0,o=0),s.milliseconds=a%1e3,t=v(a/1e3),s.seconds=t%60,e=v(t/60),s.minutes=e%60,n=v(e/60),s.hours=n%24,u+=v(n/24),i=v(Un(u)),o+=i,u-=qn(Yn(i)),r=v(o/12),o%=12,s.days=u,s.months=o,s.years=r,this}function Un(t){return 4800*t/146097}function Yn(t){return 146097*t/4800}function Vn(t){var e,n,r=this._milliseconds;if(t=P(t),"month"===t||"year"===t)return e=this._days+r/864e5,n=this._months+Un(e),"month"===t?n:n/12;switch(e=this._days+Math.round(Yn(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}}function zn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*b(this._months/12)}function $n(t){return function(){return this.as(t)}}function Hn(t){return t=P(t),this[t+"s"]()}function Gn(t){return function(){return this._data[t]}}function Wn(){return v(this.days()/7)}function Zn(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function Xn(t,e,n){var r=ie(t).abs(),i=Yi(r.as("s")),a=Yi(r.as("m")),u=Yi(r.as("h")),o=Yi(r.as("d")),s=Yi(r.as("M")),c=Yi(r.as("y")),l=i=a&&["m"]||a=u&&["h"]||u=o&&["d"]||o=s&&["M"]||s=c&&["y"]||["yy",c];return l[2]=e,l[3]=+t>0,l[4]=n,Zn.apply(null,l)}function Jn(t,e){return void 0===Vi[t]?!1:void 0===e?Vi[t]:(Vi[t]=e,!0)}function Kn(t){var e=this.localeData(),n=Xn(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function Qn(){var t,e,n,r=zi(this._milliseconds)/1e3,i=zi(this._days),a=zi(this._months);t=v(r/60),e=v(t/60),r%=60,t%=60,n=v(a/12),a%=12;var u=n,o=a,s=i,c=e,l=t,h=r,f=this.asSeconds();return f?(0>f?"-":"")+"P"+(u?u+"Y":"")+(o?o+"M":"")+(s?s+"D":"")+(c||l||h?"T":"")+(c?c+"H":"")+(l?l+"M":"")+(h?h+"S":""):"P0D"}var tr,er=n.momentProperties=[],nr=!1,rr={};n.suppressDeprecationWarnings=!1;var ir,ar={},ur={},or=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,sr=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,cr={},lr={},hr=/\d/,fr=/\d\d/,dr=/\d{3}/,pr=/\d{4}/,gr=/[+-]?\d{6}/,mr=/\d\d?/,yr=/\d\d\d\d?/,vr=/\d\d\d\d\d\d?/,br=/\d{1,3}/,_r=/\d{1,4}/,xr=/[+-]?\d{1,6}/,wr=/\d+/,Ar=/[+-]?\d+/,Er=/Z|[+-]\d\d:?\d\d/gi,kr=/Z|[+-]\d\d(?::?\d\d)?/gi,Dr=/[+-]?\d+(\.\d{1,3})?/,Cr=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Sr={},Mr={},Tr=0,Fr=1,Lr=2,Br=3,Nr=4,Ir=5,Or=6,Rr=7,Pr=8;$("M",["MM",2],"Mo",function(){return this.month()+1}),$("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),$("MMMM",0,0,function(t){return this.localeData().months(this,t)}),R("month","M"),X("M",mr),X("MM",mr,fr),X("MMM",function(t,e){return e.monthsShortRegex(t)}),X("MMMM",function(t,e){return e.monthsRegex(t)}),tt(["M","MM"],function(t,e){e[Fr]=b(t)-1}),tt(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);null!=i?e[Fr]=i:h(n).invalidMonth=t});var qr=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,jr="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ur="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Yr=Cr,Vr=Cr,zr=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,$r=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Hr=/Z|[+-]\d\d(?::?\d\d)?/,Gr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Wr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Zr=/^\/?Date\((\-?\d+)/i;n.createFromInputFallback=w("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),$("Y",0,0,function(){var t=this.year();return 9999>=t?""+t:"+"+t}),$(0,["YY",2],0,function(){return this.year()%100}),$(0,["YYYY",4],0,"year"),$(0,["YYYYY",5],0,"year"),$(0,["YYYYYY",6,!0],0,"year"),R("year","y"),X("Y",Ar),X("YY",mr,fr),X("YYYY",_r,pr),X("YYYYY",xr,gr),X("YYYYYY",xr,gr),tt(["YYYYY","YYYYYY"],Tr),tt("YYYY",function(t,e){e[Tr]=2===t.length?n.parseTwoDigitYear(t):b(t)}),tt("YY",function(t,e){e[Tr]=n.parseTwoDigitYear(t)}),tt("Y",function(t,e){e[Tr]=parseInt(t,10)}),n.parseTwoDigitYear=function(t){return b(t)+(b(t)>68?1900:2e3)};var Xr=j("FullYear",!1);n.ISO_8601=function(){};var Jr=w("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Rt.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:d()}),Kr=w("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Rt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:d()}),Qr=function(){return Date.now?Date.now():+new Date};Vt("Z",":"),Vt("ZZ",""),X("Z",kr),X("ZZ",kr),tt(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=zt(kr,t)});var ti=/([\+\-]|\d\d)/gi;n.updateOffset=function(){};var ei=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,ni=/^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/;ie.fn=Ut.prototype;var ri=ce(1,"add"),ii=ce(-1,"subtract");n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var ai=w("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});$(0,["gg",2],0,function(){return this.weekYear()%100}),$(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ye("gggg","weekYear"),Ye("ggggg","weekYear"),Ye("GGGG","isoWeekYear"),Ye("GGGGG","isoWeekYear"),R("weekYear","gg"),R("isoWeekYear","GG"),X("G",Ar),X("g",Ar),X("GG",mr,fr),X("gg",mr,fr),X("GGGG",_r,pr),X("gggg",_r,pr),X("GGGGG",xr,gr),X("ggggg",xr,gr),et(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=b(t)}),et(["gg","GG"],function(t,e,r,i){e[i]=n.parseTwoDigitYear(t)}),$("Q",0,"Qo","quarter"),R("quarter","Q"),X("Q",hr),tt("Q",function(t,e){e[Fr]=3*(b(t)-1)}),$("w",["ww",2],"wo","week"),$("W",["WW",2],"Wo","isoWeek"),R("week","w"),R("isoWeek","W"),X("w",mr),X("ww",mr,fr),X("W",mr),X("WW",mr,fr),et(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=b(t)});var ui={dow:0,doy:6};$("D",["DD",2],"Do","date"),R("date","D"),X("D",mr),X("DD",mr,fr),X("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),tt(["D","DD"],Lr),tt("Do",function(t,e){e[Lr]=b(t.match(mr)[0],10)});var oi=j("Date",!0);$("d",0,"do","day"),$("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),$("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),$("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),$("e",0,0,"weekday"),$("E",0,0,"isoWeekday"),R("day","d"),R("weekday","e"),R("isoWeekday","E"),X("d",mr),X("e",mr),X("E",mr),X("dd",Cr),X("ddd",Cr),X("dddd",Cr),et(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);null!=i?e.d=i:h(n).invalidWeekday=t}),et(["d","e","E"],function(t,e,n,r){e[r]=b(t)});var si="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ci="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),li="Su_Mo_Tu_We_Th_Fr_Sa".split("_");$("DDD",["DDDD",3],"DDDo","dayOfYear"),R("dayOfYear","DDD"),X("DDD",br),X("DDDD",dr),tt(["DDD","DDDD"],function(t,e,n){n._dayOfYear=b(t)}),$("H",["HH",2],0,"hour"),$("h",["hh",2],0,hn),$("hmm",0,0,function(){return""+hn.apply(this)+z(this.minutes(),2)}),$("hmmss",0,0,function(){return""+hn.apply(this)+z(this.minutes(),2)+z(this.seconds(),2)}),$("Hmm",0,0,function(){return""+this.hours()+z(this.minutes(),2)}),$("Hmmss",0,0,function(){return""+this.hours()+z(this.minutes(),2)+z(this.seconds(),2)}),fn("a",!0),fn("A",!1),R("hour","h"),X("a",dn),X("A",dn),X("H",mr),X("h",mr),X("HH",mr,fr),X("hh",mr,fr),X("hmm",yr),X("hmmss",vr),X("Hmm",yr),X("Hmmss",vr),tt(["H","HH"],Br),tt(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),tt(["h","hh"],function(t,e,n){e[Br]=b(t),h(n).bigHour=!0}),tt("hmm",function(t,e,n){var r=t.length-2;e[Br]=b(t.substr(0,r)),e[Nr]=b(t.substr(r)),h(n).bigHour=!0}),tt("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[Br]=b(t.substr(0,r)),e[Nr]=b(t.substr(r,2)),e[Ir]=b(t.substr(i)),h(n).bigHour=!0}),tt("Hmm",function(t,e){var n=t.length-2;e[Br]=b(t.substr(0,n)),e[Nr]=b(t.substr(n))}),tt("Hmmss",function(t,e){var n=t.length-4,r=t.length-2;e[Br]=b(t.substr(0,n)),e[Nr]=b(t.substr(n,2)),e[Ir]=b(t.substr(r))});var hi=/[ap]\.?m?\.?/i,fi=j("Hours",!0);$("m",["mm",2],0,"minute"),R("minute","m"),X("m",mr),X("mm",mr,fr), +tt(["m","mm"],Nr);var di=j("Minutes",!1);$("s",["ss",2],0,"second"),R("second","s"),X("s",mr),X("ss",mr,fr),tt(["s","ss"],Ir);var pi=j("Seconds",!1);$("S",0,0,function(){return~~(this.millisecond()/100)}),$(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),$(0,["SSS",3],0,"millisecond"),$(0,["SSSS",4],0,function(){return 10*this.millisecond()}),$(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),$(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),$(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),$(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),$(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),R("millisecond","ms"),X("S",br,hr),X("SS",br,fr),X("SSS",br,dr);var gi;for(gi="SSSS";gi.length<=9;gi+="S")X(gi,wr);for(gi="S";gi.length<=9;gi+="S")tt(gi,mn);var mi=j("Milliseconds",!1);$("z",0,0,"zoneAbbr"),$("zz",0,0,"zoneName");var yi=m.prototype;yi.add=ri,yi.calendar=he,yi.clone=fe,yi.diff=be,yi.endOf=Fe,yi.format=Ae,yi.from=Ee,yi.fromNow=ke,yi.to=De,yi.toNow=Ce,yi.get=V,yi.invalidAt=je,yi.isAfter=de,yi.isBefore=pe,yi.isBetween=ge,yi.isSame=me,yi.isSameOrAfter=ye,yi.isSameOrBefore=ve,yi.isValid=Pe,yi.lang=ai,yi.locale=Se,yi.localeData=Me,yi.max=Kr,yi.min=Jr,yi.parsingFlags=qe,yi.set=V,yi.startOf=Te,yi.subtract=ii,yi.toArray=Ie,yi.toObject=Oe,yi.toDate=Ne,yi.toISOString=we,yi.toJSON=Re,yi.toString=xe,yi.unix=Be,yi.valueOf=Le,yi.creationData=Ue,yi.year=Xr,yi.isLeapYear=_t,yi.weekYear=Ve,yi.isoWeekYear=ze,yi.quarter=yi.quarters=Ze,yi.month=st,yi.daysInMonth=ct,yi.week=yi.weeks=Qe,yi.isoWeek=yi.isoWeeks=tn,yi.weeksInYear=He,yi.isoWeeksInYear=$e,yi.date=oi,yi.day=yi.days=on,yi.weekday=sn,yi.isoWeekday=cn,yi.dayOfYear=ln,yi.hour=yi.hours=fi,yi.minute=yi.minutes=di,yi.second=yi.seconds=pi,yi.millisecond=yi.milliseconds=mi,yi.utcOffset=Gt,yi.utc=Zt,yi.local=Xt,yi.parseZone=Jt,yi.hasAlignedHourOffset=Kt,yi.isDST=Qt,yi.isDSTShifted=te,yi.isLocal=ee,yi.isUtcOffset=ne,yi.isUtc=re,yi.isUTC=re,yi.zoneAbbr=yn,yi.zoneName=vn,yi.dates=w("dates accessor is deprecated. Use date instead.",oi),yi.months=w("months accessor is deprecated. Use month instead",st),yi.years=w("years accessor is deprecated. Use year instead",Xr),yi.zone=w("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Wt);var vi=yi,bi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},_i={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},xi="Invalid date",wi="%d",Ai=/\d{1,2}/,Ei={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ki=S.prototype;ki._calendar=bi,ki.calendar=xn,ki._longDateFormat=_i,ki.longDateFormat=wn,ki._invalidDate=xi,ki.invalidDate=An,ki._ordinal=wi,ki.ordinal=En,ki._ordinalParse=Ai,ki.preparse=kn,ki.postformat=kn,ki._relativeTime=Ei,ki.relativeTime=Dn,ki.pastFuture=Cn,ki.set=D,ki.months=it,ki._months=jr,ki.monthsShort=at,ki._monthsShort=Ur,ki.monthsParse=ut,ki._monthsRegex=Vr,ki.monthsRegex=ht,ki._monthsShortRegex=Yr,ki.monthsShortRegex=lt,ki.week=Xe,ki._week=ui,ki.firstDayOfYear=Ke,ki.firstDayOfWeek=Je,ki.weekdays=nn,ki._weekdays=si,ki.weekdaysMin=an,ki._weekdaysMin=li,ki.weekdaysShort=rn,ki._weekdaysShort=ci,ki.weekdaysParse=un,ki.isPM=pn,ki._meridiemParse=hi,ki.meridiem=gn,L("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===b(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),n.lang=w("moment.lang is deprecated. Use moment.locale instead.",L),n.langData=w("moment.langData is deprecated. Use moment.localeData instead.",I);var Di=Math.abs,Ci=$n("ms"),Si=$n("s"),Mi=$n("m"),Ti=$n("h"),Fi=$n("d"),Li=$n("w"),Bi=$n("M"),Ni=$n("y"),Ii=Gn("milliseconds"),Oi=Gn("seconds"),Ri=Gn("minutes"),Pi=Gn("hours"),qi=Gn("days"),ji=Gn("months"),Ui=Gn("years"),Yi=Math.round,Vi={s:45,m:45,h:22,d:26,M:11},zi=Math.abs,$i=Ut.prototype;$i.abs=In,$i.add=Rn,$i.subtract=Pn,$i.as=Vn,$i.asMilliseconds=Ci,$i.asSeconds=Si,$i.asMinutes=Mi,$i.asHours=Ti,$i.asDays=Fi,$i.asWeeks=Li,$i.asMonths=Bi,$i.asYears=Ni,$i.valueOf=zn,$i._bubble=jn,$i.get=Hn,$i.milliseconds=Ii,$i.seconds=Oi,$i.minutes=Ri,$i.hours=Pi,$i.days=qi,$i.weeks=Wn,$i.months=ji,$i.years=Ui,$i.humanize=Kn,$i.toISOString=Qn,$i.toString=Qn,$i.toJSON=Qn,$i.locale=Se,$i.localeData=Me,$i.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Qn),$i.lang=ai,$("X",0,0,"unix"),$("x",0,0,"valueOf"),X("x",Ar),X("X",Dr),tt("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),tt("x",function(t,e,n){n._d=new Date(b(t))}),n.version="2.12.0",r(Rt),n.fn=vi,n.min=qt,n.max=jt,n.now=Qr,n.utc=c,n.unix=bn,n.months=Tn,n.isDate=a,n.locale=L,n.invalid=d,n.duration=ie,n.isMoment=y,n.weekdays=Ln,n.parseZone=_n,n.localeData=I,n.isDuration=Yt,n.monthsShort=Fn,n.weekdaysMin=Nn,n.defineLocale=B,n.updateLocale=N,n.locales=O,n.weekdaysShort=Bn,n.normalizeUnits=P,n.relativeTimeThreshold=Jn,n.prototype=vi;var Hi=n;return Hi})},{}],84:[function(t,e,n){(function(t){function e(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!i;a--){var u=a>=0?arguments[a]:t.cwd();if("string"!=typeof u)throw new TypeError("Arguments to path.resolve must be strings");u&&(n=u+"/"+n,i="/"===u.charAt(0))}return n=e(r(n.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(t){var i=n.isAbsolute(t),a="/"===u(t,-1);return t=e(r(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(r(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function r(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),a=r(e.split("/")),u=Math.min(i.length,a.length),o=u,s=0;u>s;s++)if(i[s]!==a[s]){o=s;break}for(var c=[],s=o;se&&(e=t.length+e),t.substr(e,n)}}).call(this,t("_process"))},{_process:85}],85:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.MutationObserver,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};var r=[];if(e){var i=document.createElement("div"),a=new MutationObserver(function(){var t=r.slice();r.length=0,t.forEach(function(t){t()})});return a.observe(i,{attributes:!0}),function(t){r.length||i.setAttribute("yes","no"),r.push(t)}}return n?(window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),r.length>0)){var n=r.shift();n()}},!0),function(t){r.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],86:[function(t,e){e.exports={name:"mermaid",version:"0.5.8",description:"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams and gantt charts.",main:"src/mermaid.js",keywords:["diagram","markdown","flowchart","sequence diagram","gantt"],bin:{mermaid:"./bin/mermaid.js"},scripts:{live:"live-server ./test/examples",lint:"node node_modules/eslint/bin/eslint.js src",jison:"gulp jison_legacy",karma:"node node_modules/karma/bin/karma start karma.conf.js --single-run",watch:"source ./scripts/watch.sh",doc:"rm -r build;rm -r dist/www;gulp vartree;cp dist/www/all.html ../mermaid-pages/index.html;cp dist/mermaid.js ../mermaid-pages/javascripts/lib;cp dist/mermaid.forest.css ../mermaid-pages/stylesheets",tape:"node node_modules/tape/bin/tape test/cli_test-*.js",jasmine:"npm run jison &&node node_modules/jasmine-es6/bin/jasmine.js",pretest:"npm run jison",test:"npm run dist && npm run karma && npm run tape","dist-slim-mermaid":"node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.slim.js -x d3 && cat dist/mermaid.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.slim.min.js","dist-slim-mermaidAPI":"node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.slim.js -x d3 && cat dist/mermaidAPI.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.slim.min.js","dist-mermaid":"node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.js && cat dist/mermaid.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.min.js","dist-mermaidAPI":"node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.js && cat dist/mermaidAPI.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.min.js",dist:"npm run dist-slim-mermaid && npm run dist-slim-mermaidAPI && npm run dist-mermaid && npm run dist-mermaidAPI"},repository:{type:"git",url:"https://github.com/knsv/mermaid"},author:"Knut Sveidqvist",license:"MIT",dependencies:{chalk:"^0.5.1",d3:"3.5.6",dagre:"^0.7.4","dagre-d3":"0.4.10",he:"^0.5.0",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.9.0",semver:"^4.1.1",which:"^1.0.8"},devDependencies:{async:"^0.9.0","babel-eslint":"^4.1.3",babelify:"^6.4.0",browserify:"~6.2.0",clone:"^0.2.0","codeclimate-test-reporter":"0.0.4",dateformat:"^1.0.11",dox:"^0.8.0",eslint:"^1.6.0","eslint-watch":"^2.1.2","event-stream":"^3.2.0",foundation:"^4.2.1-1","front-matter":"^0.2.0",gulp:"~3.9.0","gulp-bower":"0.0.10","gulp-browserify":"^0.5.0","gulp-bump":"^0.1.11","gulp-concat":"~2.4.1","gulp-data":"^1.1.1","gulp-dox":"^0.1.6","gulp-ext-replace":"^0.2.0","gulp-filelog":"^0.4.1","gulp-front-matter":"^1.2.3","gulp-hogan":"^1.1.0","gulp-if":"^1.2.5","gulp-insert":"^0.4.0","gulp-istanbul":"^0.4.0","gulp-jasmine":"~2.1.0","gulp-jasmine-browser":"^0.2.3","gulp-jison":"~1.2.0","gulp-jshint":"^1.9.0","gulp-less":"^3.0.1","gulp-livereload":"^3.8.0","gulp-marked":"^1.0.0","gulp-mdvars":"^2.0.0","gulp-qunit":"~1.2.1","gulp-rename":"~1.2.0","gulp-shell":"^0.2.10","gulp-tag-version":"^1.2.1","gulp-uglify":"~1.0.1","gulp-util":"^3.0.7","gulp-vartree":"^2.0.1","hogan.js":"^3.0.2",jasmine:"2.3.2","jasmine-es6":"0.0.18",jison:"zaach/jison",jsdom:"^7.0.2","jshint-stylish":"^2.0.1",karma:"^0.13.15","karma-babel-preprocessor":"^6.0.1","karma-browserify":"^4.4.0","karma-jasmine":"^0.3.6","karma-phantomjs-launcher":"^0.2.1","live-server":"^0.9.0","map-stream":"0.0.6",marked:"^0.3.2","mock-browser":"^0.91.34",path:"^0.4.9",phantomjs:"^2.1.3",proxyquire:"^1.7.3","proxyquire-universal":"^1.0.8",proxyquireify:"^3.0.0","require-dir":"^0.3.0",rewire:"^2.1.3",rimraf:"^2.2.8",tape:"^3.0.3",testdom:"^2.0.0",uglifyjs:"^2.4.10","vinyl-source-stream":"^1.1.0",watchify:"^3.6.1"}}},{}],87:[function(t,e){"use strict";var n;if(t)try{n=t("d3")}catch(r){}n||(n=window.d3),e.exports=n,function(){var t=!1;if(t="tspans",n.selection.prototype.textwrap)return!1;if("undefined"==typeof t)var t=!1;n.selection.prototype.textwrap=n.selection.enter.prototype.textwrap=function(e,r){var i,r=parseInt(r)||0,a=this,u=function(t){var e=t[0][0],r=e.tagName.toString();if("rect"!==r)return!1;var i={};return i.x=n.select(e).attr("x")||0,i.y=n.select(e).attr("y")||0,i.width=n.select(e).attr("width")||0,i.height=n.select(e).attr("height")||0,i.attr=t.attr,i},o=function(t){if(t.attr||(t.attr=function(t){return this[t]?this[t]:void 0}),"object"==typeof t&&"undefined"!=typeof t.x&&"undefined"!=typeof t.y&&"undefined"!=typeof t.width&&"undefined"!=typeof t.height)return t;if("function"==typeof Array.isArray&&Array.isArray(t)||"[object Array]"===Object.prototype.toString.call(t)){var e=u(t);return e}return!1},s=function(t,e){var n=t;return 0!==e&&(n.x=parseInt(n.x)+e,n.y=parseInt(n.y)+e,n.width-=2*e,n.height-=2*e),n},c=o(e);if(r&&(c=s(c,r)),0!=a.length&&n&&e&&c){e=c;var l,h=function(t){var r=n.select(t[0].parentNode),a=r.select("text"),u=a.style("line-height"),o=a.text();a.remove();var s=r.append("foreignObject");s.attr("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility").attr("x",e.x).attr("y",e.y).attr("width",e.width).attr("height",e.height);var c=s.append("xhtml:div").attr("class","wrapped");c.style("height",e.height).style("width",e.width).html(o),u&&c.style("line-height",u),i=r.select("foreignObject")},f=function(t){var a,u=t[0],o=u.parentNode,s=n.select(u),c=u.getBBox().height,l=u.getBBox().width,h=c,f=s.style("line-height");if(a=f&&parseInt(f)?parseInt(f.replace("px","")):h,l>e.width){var d=s.text();if(s.text(""),d){var p,g;if(-1!==d.indexOf(" ")){var p=" ";g=d.split(" ")}else{p="";var m=d.length,y=Math.ceil(l/e.width),v=Math.floor(m/y);v*y>=m||y++;for(var b,_,g=[],x=0;y>x;x++)_=x*v,b=d.substr(_,v),g.push(b)}for(var w=[],A=0,E={},x=0;xe.width&&C&&""!==C&&(A+=S,E={string:C,width:S,offset:A},w.push(E),s.text(""),s.text(D),x==g.length-1&&(k=D,s.text(k),M=u.getComputedTextLength())),x==g.length-1){s.text("");var T=k;T&&""!==T&&(M-A>0&&(M-=A),E={string:T,width:M,offset:A},w.push(E))}}var F;s.text("");for(var x=0;x0){w[x-1]}x*a0?a:void 0}),F.attr("x",function(){var t=e.x;return r&&(t+=r),t}))}}}s.attr("y",function(){var t=e.y;return a&&(t+=a),r&&(t+=r),t}),s.attr("x",function(){var t=e.x;return r&&(t+=r),t}),i=n.select(o).selectAll("text")};t&&("foreignobjects"==t?l=h:"tspans"==t&&(l=f)),t||(l="undefined"!=typeof SVGForeignObjectElement?h:f);for(var d=0;d "+t.w+": "+JSON.stringify(u.edge(t))),p(i,u.edge(t),u.edge(t).relation)}),i.attr("height","100%"),i.attr("width","100%")}},{"../../d3":87,"../../logger":106,"./classDb":88,"./parser/classDiagram":90,dagre:31}],90:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,11],r=[1,12],i=[1,13],a=[1,15],u=[1,16],o=[1,17],s=[6,8],c=[1,26],l=[1,27],h=[1,28],f=[1,29],d=[1,30],p=[1,31],g=[6,8,13,17,23,26,27,28,29,30,31],m=[6,8,13,17,23,26,27,28,29,30,31,45,46,47],y=[23,45,46,47],v=[23,30,31,45,46,47],b=[23,26,27,28,29,45,46,47],_=[6,8,13],x=[1,46],w={trace:function(){},yy:{},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},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"},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]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 5:this.$=a[u-1]+a[u];break;case 6:this.$=a[u];break;case 7:r.addRelation(a[u]);break;case 8:a[u-1].title=r.cleanupLabel(a[u]),r.addRelation(a[u-1]);break;case 12:r.addMembers(a[u-3],a[u-1]);break;case 13:this.$=[a[u]];break;case 14:a[u].push(a[u-1]),this.$=a[u];break;case 15:break;case 16:r.addMembers(a[u-1],r.cleanupLabel(a[u]));break;case 17:console.warn("Member",a[u]);break;case 18:break;case 19:this.$={id1:a[u-2],id2:a[u],relation:a[u-1],relationTitle1:"none",relationTitle2:"none"};break;case 20:this.$={id1:a[u-3],id2:a[u],relation:a[u-1],relationTitle1:a[u-2],relationTitle2:"none"};break;case 21:this.$={id1:a[u-3],id2:a[u],relation:a[u-2],relationTitle1:"none",relationTitle2:a[u-1]};break;case 22:this.$={id1:a[u-4],id2:a[u],relation:a[u-2],relationTitle1:a[u-3],relationTitle2:a[u-1]};break;case 23:this.$={type1:a[u-2],type2:a[u],lineType:a[u-1]};break;case 24:this.$={type1:"none",type2:a[u],lineType:a[u-1]};break;case 25:this.$={type1:a[u-1],type2:"none",lineType:a[u]};break;case 26:this.$={type1:"none",type2:"none",lineType:a[u]};break;case 27:this.$=r.relationType.AGGREGATION;break;case 28:this.$=r.relationType.EXTENSION;break;case 29:this.$=r.relationType.COMPOSITION;break;case 30:this.$=r.relationType.DEPENDENCY;break;case 31:this.$=r.lineType.LINE;break;case 32:this.$=r.lineType.DOTTED_LINE}},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:n,20:r,21:i,45:a,46:u,47:o},{8:[1,18]},{6:[1,19],8:[2,3]},e(s,[2,7],{13:[1,20]}),e(s,[2,9]),e(s,[2,10]),e(s,[2,15],{22:21,24:24,25:25,13:[1,23],23:[1,22],26:c,27:l,28:h,29:f,30:d,31:p}),{10:32,11:14,45:a,46:u,47:o},e(s,[2,17]),e(s,[2,18]),e(g,[2,6],{11:14,10:33,45:a,46:u,47:o}),e(m,[2,46]),e(m,[2,47]),e(m,[2,48]),{1:[2,2]},{7:34,9:6,10:10,11:14,12:7,14:8,15:9,16:n,20:r,21:i,45:a,46:u,47:o},e(s,[2,8]),{10:35,11:14,23:[1,36],45:a,46:u,47:o},{22:37,24:24,25:25,26:c,27:l,28:h,29:f,30:d,31:p},e(s,[2,16]),{25:38,30:d,31:p},e(y,[2,26],{24:39,26:c,27:l,28:h,29:f}),e(v,[2,27]),e(v,[2,28]),e(v,[2,29]),e(v,[2,30]),e(b,[2,31]),e(b,[2,32]),e(s,[2,11],{17:[1,40]}),e(g,[2,5]),{8:[2,4]},e(_,[2,19]),{10:41,11:14,45:a,46:u,47:o},{10:42,11:14,23:[1,43],45:a,46:u,47:o},e(y,[2,25],{24:44,26:c,27:l,28:h,29:f}),e(y,[2,24]),{18:45,20:x},e(_,[2,21]),e(_,[2,20]),{10:47,11:14,45:a,46:u,47:o},e(y,[2,23]),{19:[1,48]},{18:49,19:[2,13],20:x},e(_,[2,22]),e(s,[2,12]),{19:[2,14]}],defaultActions:{2:[2,1],18:[2,2],34:[2,4],49:[2,14]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;i.push(m);var y=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,x,w,A,E,k,D,C=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},S={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),x=a[_]&&a[_][v]),"undefined"==typeof x||!x.length||!x[0]){var M="";D=[];for(A in a[_])this.terminals_[A]&&A>l&&D.push("'"+this.terminals_[A]+"'");M=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(M,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:m,expected:D})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,b?(v=b,b=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,m=d.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[x[1]][1],S.$=r[r.length-E],S._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},y&&(S._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(S,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;E&&(n=n.slice(0,-1*E*2),r=r.slice(0,-1*E),i=i.slice(0,-1*E)),n.push(this.productions_[x[1]][0]),r.push(S.$),i.push(S._$),k=a[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},A=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){ +for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:break;case 1:return 6;case 2:break;case 3:return 5;case 4:return this.begin("struct"),17;case 5:return this.popState(),19;case 6:break;case 7:return"MEMBER";case 8:return 16;case 9:this.begin("string");break;case 10:this.popState();break;case 11:return"STR";case 12:return 27;case 13:return 27;case 14:return 29;case 15:return 29;case 16:return 28;case 17:return 26;case 18:return 30;case 19:return 31;case 20:return 13;case 21:return 43;case 22:return"DOT";case 23:return"PLUS";case 24:return 40;case 25:return"EQUALS";case 26:return"EQUALS";case 27:return 47;case 28:return"PUNCTUATION";case 29:return 46;case 30:return 45;case 31:return 42;case 32:return 8}},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)/,/^(?:$)/],conditions:{string:{rules:[10,11],inclusive:!1},struct:{rules:[5,6,7],inclusive:!1},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:!0}}};return t}();return w.lexer=A,t.prototype=w,w.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:85,fs:1,path:84}],91:[function(t,e,n){(function(e){"use strict";var r=t("../../logger"),i=new r.Log,a="",u=!1;n.setMessage=function(t){i.debug("Setting message to: "+t),a=t},n.getMessage=function(){return a},n.setInfo=function(t){u=t},n.getInfo=function(){return u},n.parseError=function(t,n){e.mermaidAPI.parseError(t,n)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../logger":106}],92:[function(t,e,n){"use strict";var r=t("./exampleDb"),i=t("./parser/example.js"),a=t("../../d3"),u=t("../../logger"),o=new u.Log;n.draw=function(t,e,n){var u;u=i.parser,u.yy=r,o.debug("Renering example diagram"),u.parse(t);var s=a.select("#"+e),c=s.append("g");c.append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("mermaid "+n),s.attr("height",100),s.attr("width",400)}},{"../../d3":87,"../../logger":106,"./exampleDb":91,"./parser/example.js":93}],93:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[6,9,10,12],r={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,message:11,say:12,TXT:13,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo",12:"say",13:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1],[8,1],[11,2]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 1:return r;case 4:break;case 6:r.setInfo(!0);break;case 7:r.setMessage(a[u]);break;case 8:this.$=a[u-1].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},e(n,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8],11:9,12:[1,10]},{1:[2,1]},e(n,[2,3]),e(n,[2,4]),e(n,[2,5]),e(n,[2,6]),e(n,[2,7]),{13:[1,11]},e(n,[2,8])],defaultActions:{4:[2,1]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;i.push(m);var y=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,x,w,A,E,k,D,C=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},S={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),x=a[_]&&a[_][v]),"undefined"==typeof x||!x.length||!x[0]){var M="";D=[];for(A in a[_])this.terminals_[A]&&A>l&&D.push("'"+this.terminals_[A]+"'");M=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(M,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:m,expected:D})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,b?(v=b,b=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,m=d.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[x[1]][1],S.$=r[r.length-E],S._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},y&&(S._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(S,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;E&&(n=n.slice(0,-1*E*2),r=r.slice(0,-1*E),i=i.slice(0,-1*E)),n.push(this.productions_[x[1]][0]),r.push(S.$),i.push(S._$),k=a[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},i=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 9;case 1:return 10;case 2:return 4;case 3:return 12;case 4:return 13;case 5:return 6;case 6:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:showInfo\b)/i,/^(?:info\b)/i,/^(?:say\b)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return t}();return r.lexer=i,t.prototype=r,r.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:85,fs:1,path:84}],94:[function(t,e){"use strict";var n,r=t("../../logger"),i=new r.Log;if(t)try{n=t("dagre-d3")}catch(a){i.debug("Could not load dagre-d3")}n||(n=window.dagreD3),e.exports=n},{"../../logger":106,"dagre-d3":3}],95:[function(t,e,n){"use strict";var r=t("./graphDb"),i=t("./parser/flow"),a=t("./parser/dot"),u=t("../../d3"),o=t("./dagre-d3"),s=t("../../logger"),c=new s.Log,l={};e.exports.setConf=function(t){var e,n=Object.keys(t);for(e=0;e0&&(u=a.classes.join(" "));var o="";o=r(o,a.styles),i="undefined"==typeof a.text?a.id:a.text;var s="";if(l.htmlLabels)s="html",i=i.replace(/fa:fa[\w\-]+/g,function(t){return''});else{var c=document.createElementNS("http://www.w3.org/2000/svg","text"),h=i.split(/
/),f=0;for(f=0;f/g,"\n");"undefined"==typeof t.style?l.htmlLabels?e.setEdge(t.start,t.end,{labelType:"html",style:a,labelpos:"c",label:''+t.text+"",arrowheadStyle:"fill: #333",arrowhead:n},i):e.setEdge(t.start,t.end,{labelType:"text",style:"stroke: #333; stroke-width: 1.5px;fill:none",labelpos:"c",label:u,arrowheadStyle:"fill: #333",arrowhead:n},i):e.setEdge(t.start,t.end,{labelType:"text",style:a,arrowheadStyle:"fill: #333",label:u,arrowhead:n},i)}})},n.getClasses=function(t,e){var n;r.clear(),n=e?a.parser:i.parser,n.yy=r,n.parse(t);var u=r.getClasses();return"undefined"==typeof u["default"]&&(u["default"]={id:"default"},u["default"].styles=[],u["default"].clusterStyles=["rx:4px","fill: rgb(255, 255, 222)","rx: 4px","stroke: rgb(170, 170, 51)","stroke-width: 1px"],u["default"].nodeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"],u["default"].edgeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"]),u},n.draw=function(t,e,s){c.debug("Drawing flowchart");var h;r.clear(),h=s?a.parser:i.parser,h.yy=r;try{h.parse(t)}catch(f){c.debug("Parsing failed")}var d;d=r.getDirection(),"undefined"==typeof d&&(d="TD");var p,g=new o.graphlib.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:d,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),m=r.getSubGraphs(),y=0;for(y=m.length-1;y>=0;y--)p=m[y],r.addVertex(p.id,p.title,"group",void 0);var v=r.getVertices(),b=r.getEdges();y=0;var _;for(y=m.length-1;y>=0;y--)for(p=m[y],u.selectAll("cluster").append("text"),_=0;_0?t.split(",").forEach(function(t){"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)}):"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)};var setTooltip=function(t,e){"undefined"!=typeof e&&(tooltips[t]=e)},setClickFun=function setClickFun(id,functionName){"undefined"!=typeof functionName&&"undefined"!=typeof vertices[id]&&funs.push(function(element){var elem=d3.select(element).select("#"+id);null!==elem&&elem.on("click",function(){eval(functionName+"('"+id+"')")})})},setLink=function(t,e){"undefined"!=typeof e&&"undefined"!=typeof vertices[t]&&funs.push(function(n){var r=d3.select(n).select("#"+t);null!==r&&r.on("click",function(){window.open(e,"newTab")})})};exports.getTooltip=function(t){return tooltips[t]},exports.setClickEvent=function(t,e,n,r){t.indexOf(",")>0?t.split(",").forEach(function(t){setTooltip(t,r),setClickFun(t,e),setLink(t,n)}):(setTooltip(t,r),setClickFun(t,e),setLink(t,n))},exports.bindFunctions=function(t){funs.forEach(function(e){e(t)})},exports.getDirection=function(){return direction},exports.getVertices=function(){return vertices},exports.getEdges=function(){return edges},exports.getClasses=function(){return classes};var setupToolTips=function(t){var e=d3.select(".mermaidTooltip");null===e[0][0]&&(e=d3.select("body").append("div").attr("class","mermaidTooltip").style("opacity",0));var n=d3.select(t).select("svg"),r=n.selectAll("g.node");r.on("mouseover",function(){var t=d3.select(this),n=t.attr("title");if(null!==n){var r=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.html(t.attr("title")).style("left",r.left+(r.right-r.left)/2+"px").style("top",r.top-14+document.body.scrollTop+"px"),t.classed("hover",!0)}}).on("mouseout",function(){e.transition().duration(500).style("opacity",0);var t=d3.select(this);t.classed("hover",!1)})};funs.push(setupToolTips),exports.clear=function(){vertices={},classes={},edges=[],funs=[],funs.push(setupToolTips),subGraphs=[],subCount=0,tooltips=[]},exports.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},exports.addSubGraph=function(t,e){function n(t){var e={"boolean":{},number:{},string:{}},n=[];return t.filter(function(t){var r=typeof t;return" "===t?!1:r in e?e[r].hasOwnProperty(t)?!1:e[r][t]=!0:n.indexOf(t)>=0?!1:n.push(t)})}var r=[];r=n(r.concat.apply(r,t));var i={id:"subGraph"+subCount,nodes:r,title:e};return subGraphs.push(i),subCount+=1,i.id};var getPosForId=function(t){var e;for(e=0;e2e3)){if(posCrossRef[secCount]=n,subGraphs[n].id===e)return{result:!0,count:0};for(var i=0,a=1;i=0){var o=t(e,u);if(o.result)return{result:!0,count:a+o.count};a+=o.count}i+=1}return{result:!1,count:a}}};exports.getDepthFirstPos=function(t){return posCrossRef[t]},exports.indexNodes=function(){secCount=-1,subGraphs.length>0&&indexNodes("none",subGraphs.length-1,0)},exports.getSubGraphs=function(){return subGraphs},exports.parseError=function(t,e){global.mermaidAPI.parseError(t,e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../d3":87,"../../logger":106}],97:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,5],r=[1,6],i=[1,12],a=[1,13],u=[1,14],o=[1,15],s=[1,16],c=[1,17],l=[1,18],h=[1,19],f=[1,20],d=[1,21],p=[1,22],g=[8,16,17,18,19,20,21,22,23,24,25,26],m=[1,37],y=[1,33],v=[1,34],b=[1,35],_=[1,36],x=[8,10,16,17,18,19,20,21,22,23,24,25,26,28,32,37,39,40,45,57,58],w=[10,28],A=[10,28,37,57,58],E=[2,49],k=[1,45],D=[1,48],C=[1,49],S=[1,52],M=[2,65],T=[1,65],F=[1,66],L=[1,67],B=[1,68],N=[1,69],I=[1,70],O=[1,71],R=[1,72],P=[1,73],q=[8,16,17,18,19,20,21,22,23,24,25,26,47],j=[10,28,37],U={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graph:4,EOF:5,graphStatement:6,idStatement:7,"{":8,stmt_list:9,"}":10,strict:11,GRAPH:12,DIGRAPH:13,textNoTags:14,textNoTagsToken:15,ALPHA:16,NUM:17,COLON:18,PLUS:19,EQUALS:20,MULT:21,DOT:22,BRKT:23,SPACE:24,MINUS:25,keywords:26,stmt:27,";":28,node_stmt:29,edge_stmt:30,attr_stmt:31,"=":32,subgraph:33,attr_list:34,NODE:35,EDGE:36,"[":37,a_list:38,"]":39,",":40,edgeRHS:41,node_id:42,edgeop:43,port:44,":":45,compass_pt:46,SUBGRAPH:47,n:48,ne:49,e:50,se:51,s:52,sw:53,w:54,nw:55,c:56,ARROW_POINT:57,ARROW_OPEN:58,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"{",10:"}",11:"strict",12:"GRAPH",13:"DIGRAPH",16:"ALPHA",17:"NUM",18:"COLON",19:"PLUS",20:"EQUALS",21:"MULT",22:"DOT",23:"BRKT",24:"SPACE",25:"MINUS",26:"keywords",28:";",32:"=",35:"NODE",36:"EDGE",37:"[",39:"]",40:",",45:":",47:"SUBGRAPH",48:"n",49:"ne",50:"e",51:"se",52:"s",53:"sw",54:"w",55:"nw",56:"c",57:"ARROW_POINT",58:"ARROW_OPEN"},productions_:[0,[3,2],[4,5],[4,6],[4,4],[6,1],[6,1],[7,1],[14,1],[14,2],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[9,1],[9,3],[27,1],[27,1],[27,1],[27,3],[27,1],[31,2],[31,2],[31,2],[34,4],[34,3],[34,3],[34,2],[38,5],[38,5],[38,3],[30,3],[30,3],[30,2],[30,2],[41,3],[41,3],[41,2],[41,2],[29,2],[29,1],[42,2],[42,1],[44,4],[44,2],[44,2],[33,5],[33,4],[33,3],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,0],[43,1],[43,1]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 1:this.$=a[u-1];break;case 2:this.$=a[u-4];break;case 3:this.$=a[u-5];break;case 4:this.$=a[u-3];break;case 8:case 10:case 11:this.$=a[u];break;case 9:this.$=a[u-1]+""+a[u];break;case 12:case 13:case 14:case 15:case 16:case 18:case 19:case 20:this.$=a[u];break;case 17:this.$="
";break;case 39:this.$="oy";break;case 40:r.addLink(a[u-1],a[u].id,a[u].op),this.$="oy";break;case 42:r.addLink(a[u-1],a[u].id,a[u].op),this.$={op:a[u-2],id:a[u-1]};break;case 44:this.$={op:a[u-1],id:a[u]};break;case 48:r.addVertex(a[u-1]),this.$=a[u-1];break;case 49:r.addVertex(a[u]),this.$=a[u];break;case 66:this.$="arrow";break;case 67:this.$="arrow_open"}},table:[{3:1,4:2,6:3,11:[1,4],12:n,13:r},{1:[3]},{5:[1,7]},{7:8,8:[1,9],14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},{6:23,12:n, +13:r},e(g,[2,5]),e(g,[2,6]),{1:[2,1]},{8:[1,24]},{7:30,8:m,9:25,12:y,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},e([8,10,28,32,37,39,40,45,57,58],[2,7],{15:38,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p}),e(x,[2,8]),e(x,[2,10]),e(x,[2,11]),e(x,[2,12]),e(x,[2,13]),e(x,[2,14]),e(x,[2,15]),e(x,[2,16]),e(x,[2,17]),e(x,[2,18]),e(x,[2,19]),e(x,[2,20]),{7:39,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},{7:30,8:m,9:40,12:y,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{10:[1,41]},{10:[2,21],28:[1,42]},e(w,[2,23]),e(w,[2,24]),e(w,[2,25]),e(A,E,{44:44,32:[1,43],45:k}),e(w,[2,27],{41:46,43:47,57:D,58:C}),e(w,[2,47],{43:47,34:50,41:51,37:S,57:D,58:C}),{34:53,37:S},{34:54,37:S},{34:55,37:S},{7:56,8:[1,57],14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},{7:30,8:m,9:58,12:y,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},e(x,[2,9]),{8:[1,59]},{10:[1,60]},{5:[2,4]},{7:30,8:m,9:61,12:y,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{7:62,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},e(A,[2,48]),e(A,M,{14:10,15:11,7:63,46:64,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,48:T,49:F,50:L,51:B,52:N,53:I,54:O,55:R,56:P}),e(w,[2,41],{34:74,37:S}),{7:77,8:m,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,33:76,42:75,47:_},e(q,[2,66]),e(q,[2,67]),e(w,[2,46]),e(w,[2,40],{34:78,37:S}),{7:81,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,38:79,39:[1,80]},e(w,[2,28]),e(w,[2,29]),e(w,[2,30]),{8:[1,82]},{7:30,8:m,9:83,12:y,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{10:[1,84]},{7:30,8:m,9:85,12:y,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{5:[2,2]},{10:[2,22]},e(w,[2,26]),e(A,[2,51],{45:[1,86]}),e(A,[2,52]),e(A,[2,56]),e(A,[2,57]),e(A,[2,58]),e(A,[2,59]),e(A,[2,60]),e(A,[2,61]),e(A,[2,62]),e(A,[2,63]),e(A,[2,64]),e(w,[2,38]),e(j,[2,44],{43:47,41:87,57:D,58:C}),e(j,[2,45],{43:47,41:88,57:D,58:C}),e(A,E,{44:44,45:k}),e(w,[2,39]),{39:[1,89]},e(w,[2,34],{34:90,37:S}),{32:[1,91]},{7:30,8:m,9:92,12:y,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{10:[1,93]},e(A,[2,55]),{10:[1,94]},e(A,M,{46:95,48:T,49:F,50:L,51:B,52:N,53:I,54:O,55:R,56:P}),e(j,[2,42]),e(j,[2,43]),e(w,[2,33],{34:96,37:S}),e(w,[2,32]),{7:97,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},{10:[1,98]},e(A,[2,54]),{5:[2,3]},e(A,[2,50]),e(w,[2,31]),{28:[1,99],39:[2,37],40:[1,100]},e(A,[2,53]),{7:81,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,38:101},{7:81,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,38:102},{39:[2,35]},{39:[2,36]}],defaultActions:{7:[2,1],41:[2,4],60:[2,2],61:[2,22],94:[2,3],101:[2,35],102:[2,36]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;i.push(m);var y=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,x,w,A,E,k,D,C=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},S={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),x=a[_]&&a[_][v]),"undefined"==typeof x||!x.length||!x[0]){var M="";D=[];for(A in a[_])this.terminals_[A]&&A>l&&D.push("'"+this.terminals_[A]+"'");M=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(M,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:m,expected:D})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,b?(v=b,b=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,m=d.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[x[1]][1],S.$=r[r.length-E],S._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},y&&(S._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(S,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;E&&(n=n.slice(0,-1*E*2),r=r.slice(0,-1*E),i=i.slice(0,-1*E)),n.push(this.productions_[x[1]][0]),r.push(S.$),i.push(S._$),k=a[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},Y=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:return"STYLE";case 1:return"LINKSTYLE";case 2:return"CLASSDEF";case 3:return"CLASS";case 4:return"CLICK";case 5:return 12;case 6:return 13;case 7:return 47;case 8:return 35;case 9:return 36;case 10:return"DIR";case 11:return"DIR";case 12:return"DIR";case 13:return"DIR";case 14:return"DIR";case 15:return"DIR";case 16:return 17;case 17:return 23;case 18:return 18;case 19:return 28;case 20:return 40;case 21:return 32;case 22:return 21;case 23:return 22;case 24:return"ARROW_CROSS";case 25:return 57;case 26:return"ARROW_CIRCLE";case 27:return 58;case 28:return 25;case 29:return 19;case 30:return 20;case 31:return 16;case 32:return"PIPE";case 33:return"PS";case 34:return"PE";case 35:return 37;case 36:return 39;case 37:return 8;case 38:return 10;case 39:return"QUOTE";case 40:return 24;case 41:return"NEWLINE";case 42:return 5}},rules:[/^(?:style\b)/,/^(?:linkStyle\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:digraph\b)/,/^(?:subgraph\b)/,/^(?:node\b)/,/^(?:edge\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:--[x])/,/^(?:->)/,/^(?:--[o])/,/^(?:--)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u0061-\u007A\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)/,/^(?:\n)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],inclusive:!0}}};return t}();return U.lexer=Y,t.prototype=U,U.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:85,fs:1,path:84}],98:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,4],r=[1,3],i=[1,5],a=[1,8,9,10,11,13,18,30,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],u=[2,2],o=[1,12],s=[1,13],c=[1,14],l=[1,15],h=[1,31],f=[1,33],d=[1,22],p=[1,34],g=[1,24],m=[1,25],y=[1,26],v=[1,27],b=[1,28],_=[1,38],x=[1,40],w=[1,35],A=[1,39],E=[1,45],k=[1,44],D=[1,36],C=[1,37],S=[1,41],M=[1,42],T=[1,43],F=[1,8,9,10,11,13,18,30,32,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],L=[1,53],B=[1,52],N=[1,54],I=[1,72],O=[1,80],R=[1,81],P=[1,66],q=[1,65],j=[1,85],U=[1,84],Y=[1,82],V=[1,83],z=[1,73],$=[1,68],H=[1,67],G=[1,63],W=[1,75],Z=[1,76],X=[1,77],J=[1,78],K=[1,79],Q=[1,70],tt=[1,69],et=[8,9,11],nt=[8,9,11,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64],rt=[1,115],it=[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,85,87,88,90,91,93,94,95,96,97],at=[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,83,85,87,88,90,91,93,94,95,96,97],ut=[1,117],ot=[1,118],st=[8,9,10,11,13,18,30,32,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],ct=[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,83,85,87,88,90,91,93,94,95,96,97],lt=[13,18,46,81,85,87,88,90,91,93,94,95,96,97],ht=[13,18,46,49,65,81,85,87,88,90,91,93,94,95,96,97],ft=[1,191],dt=[1,188],pt=[1,195],gt=[1,192],mt=[1,189],yt=[1,196],vt=[1,186],bt=[1,187],_t=[1,190],xt=[1,193],wt=[1,194],At=[1,211],Et=[8,9,11,85],kt=[8,9,10,11,46,71,80,81,83,85,87,88,89,90,91],Dt={trace:function(){},yy:{},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,commentStatement:82,PCT:83,style:84,COMMA:85,styleComponent:86,ALPHA:87,COLON:88,UNIT:89,BRKT:90,DOT:91,graphCodeTokens:92,PUNCTUATION:93,UNICODE_TEXT:94,PLUS:95,EQUALS:96,MULT:97,TAG_START:98,TAG_END:99,QUOTE:100,$accept:0,$end:1},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",83:"PCT",85:"COMMA",87:"ALPHA",88:"COLON",89:"UNIT",90:"BRKT",91:"DOT",93:"PUNCTUATION",94:"UNICODE_TEXT",95:"PLUS",96:"EQUALS",97:"MULT",98:"TAG_START",99:"TAG_END",100:"QUOTE"},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],[82,3],[79,1],[79,3],[84,1],[84,2],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,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],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 2:this.$=[];break;case 3:a[u]!==[]&&a[u-1].push(a[u]),this.$=a[u-1];break;case 4:case 57:case 59:case 60:case 92:case 94:case 95:case 108:this.$=a[u];break;case 11:r.setDirection(a[u-1]),this.$=a[u-1];break;case 12:r.setDirection("LR"),this.$=a[u-1];break;case 13:r.setDirection("RL"),this.$=a[u-1];break;case 14:r.setDirection("BT"),this.$=a[u-1];break;case 15:r.setDirection("TB"),this.$=a[u-1];break;case 30:this.$=a[u-1];break;case 31:case 32:case 33:case 34:case 35:this.$=[];break;case 36:this.$=r.addSubGraph(a[u-1],a[u-3]);break;case 37:this.$=r.addSubGraph(a[u-1],void 0);break;case 41:r.addLink(a[u-2],a[u],a[u-1]),this.$=[a[u-2],a[u]];break;case 42:this.$=[a[u]];break;case 43:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"square");break;case 44:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"square");break;case 45:this.$=a[u-5],r.addVertex(a[u-5],a[u-2],"circle");break;case 46:this.$=a[u-6],r.addVertex(a[u-6],a[u-3],"circle");break;case 47:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"ellipse");break;case 48:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"ellipse");break;case 49:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"round");break;case 50:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"round");break;case 51:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"diamond");break;case 52:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"diamond");break;case 53:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"odd");break;case 54:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"odd");break;case 55:this.$=a[u],r.addVertex(a[u]);break;case 56:this.$=a[u-1],r.addVertex(a[u-1]);break;case 58:case 93:case 96:case 109:this.$=a[u-1]+""+a[u];break;case 61:this.$="v";break;case 62:this.$="-";break;case 63:a[u-1].text=a[u],this.$=a[u-1];break;case 64:case 65:a[u-2].text=a[u-1],this.$=a[u-2];break;case 66:this.$=a[u];break;case 67:this.$={type:"arrow",stroke:"normal",text:a[u-1]};break;case 68:this.$={type:"arrow_circle",stroke:"normal",text:a[u-1]};break;case 69:this.$={type:"arrow_cross",stroke:"normal",text:a[u-1]};break;case 70:this.$={type:"arrow_open",stroke:"normal",text:a[u-1]};break;case 71:this.$={type:"arrow",stroke:"dotted",text:a[u-1]};break;case 72:this.$={type:"arrow_circle",stroke:"dotted",text:a[u-1]};break;case 73:this.$={type:"arrow_cross",stroke:"dotted",text:a[u-1]};break;case 74:this.$={type:"arrow_open",stroke:"dotted",text:a[u-1]};break;case 75:this.$={type:"arrow",stroke:"thick",text:a[u-1]};break;case 76:this.$={type:"arrow_circle",stroke:"thick",text:a[u-1]};break;case 77:this.$={type:"arrow_cross",stroke:"thick",text:a[u-1]};break;case 78:this.$={type:"arrow_open",stroke:"thick",text:a[u-1]};break;case 79:this.$={type:"arrow",stroke:"normal"};break;case 80:this.$={type:"arrow_circle",stroke:"normal"};break;case 81:this.$={type:"arrow_cross",stroke:"normal"};break;case 82:this.$={type:"arrow_open",stroke:"normal"};break;case 83:this.$={type:"arrow",stroke:"dotted"};break;case 84:this.$={type:"arrow_circle",stroke:"dotted"};break;case 85:this.$={type:"arrow_cross",stroke:"dotted"};break;case 86:this.$={type:"arrow_open",stroke:"dotted"};break;case 87:this.$={type:"arrow",stroke:"thick"};break;case 88:this.$={type:"arrow_circle",stroke:"thick"};break;case 89:this.$={type:"arrow_cross",stroke:"thick"};break;case 90:this.$={type:"arrow_open",stroke:"thick"};break;case 91:this.$=a[u-1];break;case 110:case 111:this.$=a[u-4],r.addClass(a[u-2],a[u]);break;case 112:this.$=a[u-4],r.setClass(a[u-2],a[u]);break;case 113:this.$=a[u-4],r.setClickEvent(a[u-2],a[u],void 0,void 0);break;case 114:this.$=a[u-6],r.setClickEvent(a[u-4],a[u-2],void 0,a[u]);break;case 115:this.$=a[u-4],r.setClickEvent(a[u-2],void 0,a[u],void 0);break;case 116:this.$=a[u-6],r.setClickEvent(a[u-4],void 0,a[u-2],a[u]);break;case 117:this.$=a[u-4],r.addVertex(a[u-2],void 0,void 0,a[u]);break;case 118:case 119:case 120:this.$=a[u-4],r.updateLink(a[u-2],a[u]);break;case 122:this.$=[a[u]];break;case 123:a[u-2].push(a[u]),this.$=a[u-2];break;case 125:this.$=a[u-1]+a[u]}},table:[{3:1,4:2,9:n,10:r,12:i},{1:[3]},e(a,u,{5:6}),{4:7,9:n,10:r,12:i},{4:8,9:n,10:r,12:i},{10:[1,9]},{1:[2,1],6:10,7:11,8:o,9:s,10:c,11:l,13:h,18:f,23:16,25:17,26:18,27:19,28:20,29:21,30:d,33:23,35:29,44:30,45:32,46:p,71:g,72:m,73:y,74:v,75:b,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},e(a,[2,9]),e(a,[2,10]),{13:[1,46],15:[1,47],16:[1,48],17:[1,49],18:[1,50]},e(F,[2,3]),e(F,[2,4]),e(F,[2,5]),e(F,[2,6]),e(F,[2,7]),e(F,[2,8]),{8:L,9:B,11:N,24:51},{8:L,9:B,11:N,24:55},{8:L,9:B,11:N,24:56},{8:L,9:B,11:N,24:57},{8:L,9:B,11:N,24:58},{8:L,9:B,11:N,24:59},{8:L,9:B,10:I,11:N,12:O,13:R,15:P,16:q,17:j,18:U,24:61,30:Y,31:60,32:V,45:71,46:z,50:$,60:H,66:62,67:G,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},e(et,[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]},e(nt,[2,55],{45:32,21:113,44:114,10:rt,13:h,15:[1,112],18:f,36:[1,108],38:[1,109],40:[1,110],42:[1,111],46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T}),e(it,[2,57]),e(it,[2,59]),e(it,[2,60]),e(it,[2,61]),e(it,[2,62]),e(at,[2,150]),e(at,[2,151]),e(at,[2,152]),e(at,[2,153]),e(at,[2,154]),e(at,[2,155]),e(at,[2,156]),e(at,[2,157]),e(at,[2,158]),e(at,[2,159]),e(at,[2,160]),{8:ut,9:ot,10:rt,14:116,21:119},{8:ut,9:ot,10:rt,14:120,21:119},{8:ut,9:ot,10:rt,14:121,21:119},{8:ut,9:ot,10:rt,14:122,21:119},{8:ut,9:ot,10:rt,14:123,21:119},e(F,[2,30]),e(F,[2,38]),e(F,[2,39]),e(F,[2,40]),e(F,[2,31]),e(F,[2,32]),e(F,[2,33]),e(F,[2,34]),e(F,[2,35]),{8:L,9:B,10:I,11:N,12:O,13:R,15:P,16:q,17:j,18:U,24:124,30:Y,32:V,45:71,46:z,50:$,60:H,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},e(st,u,{5:126}),e(ct,[2,92]),e(ct,[2,94]),e(ct,[2,139]),e(ct,[2,140]),e(ct,[2,141]),e(ct,[2,142]),e(ct,[2,143]),e(ct,[2,144]),e(ct,[2,145]),e(ct,[2,146]),e(ct,[2,147]),e(ct,[2,148]),e(ct,[2,149]),e(ct,[2,97]),e(ct,[2,98]),e(ct,[2,99]),e(ct,[2,100]),e(ct,[2,101]),e(ct,[2,102]),e(ct,[2,103]),e(ct,[2,104]),e(ct,[2,105]),e(ct,[2,106]),e(ct,[2,107]),{13:h,18:f,33:127,35:29,44:30,45:32,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},e(lt,[2,66],{48:128,49:[1,129],65:[1,130]}),{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,31:131,32:V,45:71,46:z,50:$,60:H,66:62,67:G,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,31:132,32:V,45:71,46:z,50:$,60:H,66:62,67:G,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,31:133,32:V,45:71,46:z,50:$,60:H,66:62,67:G,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},e(ht,[2,79]),e(ht,[2,80]),e(ht,[2,81]),e(ht,[2,82]),e(ht,[2,83]),e(ht,[2,84]),e(ht,[2,85]),e(ht,[2,86]),e(ht,[2,87]),e(ht,[2,88]),e(ht,[2,89]),e(ht,[2,90]),{13:h,18:f,35:134,44:30,45:32,46:p,80:[1,135],81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{78:[1,136],81:[1,137]},{13:h,18:f,35:139,44:30,45:32,46:p,78:[1,138],81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{13:h,18:f,35:140,44:30,45:32,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{13:h,18:f,35:141,44:30,45:32,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,31:142,32:V,45:71,46:z,50:$,60:H,66:62,67:G,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,31:144,32:V,38:[1,143],45:71,46:z,50:$,60:H,66:62,67:G,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,31:145,32:V,45:71,46:z,50:$,60:H,66:62,67:G,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,31:146,32:V,45:71,46:z,50:$,60:H,66:62,67:G,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,31:147,32:V,45:71,46:z,50:$,60:H,66:62,67:G,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},e(nt,[2,56]),e(it,[2,58]),e(nt,[2,29],{21:148,10:rt}),e(a,[2,11]),e(a,[2,21]),e(a,[2,22]),{9:[1,149]},e(a,[2,12]),e(a,[2,13]),e(a,[2,14]),e(a,[2,15]),e(st,u,{5:150}),e(ct,[2,93]),{6:10,7:11,8:o,9:s,10:c,11:l,13:h,18:f,23:16,25:17,26:18,27:19,28:20,29:21,30:d,32:[1,151],33:23,35:29,44:30,45:32,46:p,71:g,72:m,73:y,74:v,75:b,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},e(et,[2,41]),e(lt,[2,63],{10:[1,152]}),{10:[1,153]},{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,31:154,32:V,45:71,46:z,50:$,60:H,66:62,67:G,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,45:71,46:z,50:$,51:[1,155],52:[1,156],53:[1,157],54:[1,158],60:H,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,45:71,46:z,50:$,56:[1,159],57:[1,160],58:[1,161],59:[1,162],60:H,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,45:71,46:z,50:$,60:H,61:[1,163],62:[1,164],63:[1,165],64:[1,166],66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:[1,167],13:h,18:f,44:114,45:32,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:[1,168]},{10:[1,169]},{10:[1,170]},{10:[1,171]},{10:[1,172],13:h,18:f,44:114,45:32,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:[1,173],13:h,18:f,44:114,45:32,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:[1,174],13:h,18:f,44:114,45:32,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:I,12:O,13:R,15:P,16:q,17:j, +18:U,30:Y,32:V,37:[1,175],45:71,46:z,50:$,60:H,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,31:176,32:V,45:71,46:z,50:$,60:H,66:62,67:G,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,39:[1,177],45:71,46:z,50:$,60:H,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,41:[1,178],45:71,46:z,50:$,60:H,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,43:[1,179],45:71,46:z,50:$,60:H,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,37:[1,180],45:71,46:z,50:$,60:H,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},e(nt,[2,28]),e(a,[2,23]),{6:10,7:11,8:o,9:s,10:c,11:l,13:h,18:f,23:16,25:17,26:18,27:19,28:20,29:21,30:d,32:[1,181],33:23,35:29,44:30,45:32,46:p,71:g,72:m,73:y,74:v,75:b,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},e(F,[2,37]),e(lt,[2,65]),e(lt,[2,64]),{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,45:71,46:z,50:$,60:H,65:[1,182],66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},e(lt,[2,67]),e(lt,[2,68]),e(lt,[2,69]),e(lt,[2,70]),e(lt,[2,71]),e(lt,[2,72]),e(lt,[2,73]),e(lt,[2,74]),e(lt,[2,75]),e(lt,[2,76]),e(lt,[2,77]),e(lt,[2,78]),{10:ft,46:dt,71:pt,79:183,80:gt,81:mt,83:yt,84:184,86:185,87:vt,88:bt,89:_t,90:xt,91:wt},{10:ft,46:dt,71:pt,79:197,80:gt,81:mt,83:yt,84:184,86:185,87:vt,88:bt,89:_t,90:xt,91:wt},{10:ft,46:dt,71:pt,79:198,80:gt,81:mt,83:yt,84:184,86:185,87:vt,88:bt,89:_t,90:xt,91:wt},{10:ft,46:dt,71:pt,79:199,80:gt,81:mt,83:yt,84:184,86:185,87:vt,88:bt,89:_t,90:xt,91:wt},{10:ft,46:dt,71:pt,79:200,80:gt,81:mt,83:yt,84:184,86:185,87:vt,88:bt,89:_t,90:xt,91:wt},{10:ft,46:dt,71:pt,79:201,80:gt,81:mt,83:yt,84:184,86:185,87:vt,88:bt,89:_t,90:xt,91:wt},{13:h,18:f,35:202,44:30,45:32,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},{13:h,18:f,35:203,44:30,45:32,46:p,67:[1,204],81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},e(nt,[2,43],{21:205,10:rt}),{10:I,12:O,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,39:[1,206],45:71,46:z,50:$,60:H,66:125,70:74,71:W,72:Z,73:X,74:J,75:K,77:64,78:Q,81:_,83:tt,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T},e(nt,[2,49],{21:207,10:rt}),e(nt,[2,47],{21:208,10:rt}),e(nt,[2,51],{21:209,10:rt}),e(nt,[2,53],{21:210,10:rt}),e(F,[2,36]),e([10,13,18,46,81,85,87,88,90,91,93,94,95,96,97],[2,91]),e(et,[2,117],{85:At}),e(Et,[2,122],{86:212,10:ft,46:dt,71:pt,80:gt,81:mt,83:yt,87:vt,88:bt,89:_t,90:xt,91:wt}),e(kt,[2,124]),e(kt,[2,126]),e(kt,[2,127]),e(kt,[2,128]),e(kt,[2,129]),e(kt,[2,130]),e(kt,[2,131]),e(kt,[2,132]),e(kt,[2,133]),e(kt,[2,134]),e(kt,[2,135]),e(kt,[2,136]),e(et,[2,118],{85:At}),e(et,[2,119],{85:At}),e(et,[2,120],{85:At}),e(et,[2,110],{85:At}),e(et,[2,111],{85:At}),e(et,[2,112],{45:32,44:114,13:h,18:f,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T}),e(et,[2,113],{45:32,44:114,10:[1,213],13:h,18:f,46:p,81:_,85:x,87:w,88:A,90:E,91:k,93:D,94:C,95:S,96:M,97:T}),e(et,[2,115],{10:[1,214]}),e(nt,[2,44]),{39:[1,215]},e(nt,[2,50]),e(nt,[2,48]),e(nt,[2,52]),e(nt,[2,54]),{10:ft,46:dt,71:pt,80:gt,81:mt,83:yt,84:216,86:185,87:vt,88:bt,89:_t,90:xt,91:wt},e(kt,[2,125]),{67:[1,217]},{67:[1,218]},e(nt,[2,45],{21:219,10:rt}),e(Et,[2,123],{86:212,10:ft,46:dt,71:pt,80:gt,81:mt,83:yt,87:vt,88:bt,89:_t,90:xt,91:wt}),e(et,[2,114]),e(et,[2,116]),e(nt,[2,46])],defaultActions:{},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;i.push(m);var y=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,x,w,A,E,k,D,C=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},S={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),x=a[_]&&a[_][v]),"undefined"==typeof x||!x.length||!x[0]){var M="";D=[];for(A in a[_])this.terminals_[A]&&A>l&&D.push("'"+this.terminals_[A]+"'");M=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(M,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:m,expected:D})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,b?(v=b,b=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,m=d.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[x[1]][1],S.$=r[r.length-E],S._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},y&&(S._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(S,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;E&&(n=n.slice(0,-1*E*2),r=r.slice(0,-1*E),i=i.slice(0,-1*E)),n.push(this.productions_[x[1]][0]),r.push(S.$),i.push(S._$),k=a[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},Ct=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:break;case 1:this.begin("string");break;case 2:this.popState();break;case 3:return"STR";case 4:return 71;case 5:return 78;case 6:return 72;case 7:return 73;case 8:return 74;case 9:return 75;case 10:return 12;case 11:return 30;case 12:return 32;case 13:return 13;case 14:return 13;case 15:return 13;case 16:return 13;case 17:return 13;case 18:return 13;case 19:return 81;case 20:return 90;case 21:return 88;case 22:return 8;case 23:return 85;case 24:return 97;case 25:return 16;case 26:return 15;case 27:return 17;case 28:return 18;case 29:return 53;case 30:return 51;case 31:return 52;case 32:return 54;case 33:return 58;case 34:return 56;case 35:return 57;case 36:return 59;case 37:return 58;case 38:return 56;case 39:return 57;case 40:return 59;case 41:return 63;case 42:return 61;case 43:return 62;case 44:return 64;case 45:return 50;case 46:return 55;case 47:return 60;case 48:return 40;case 49:return 41;case 50:return 46;case 51:return 91;case 52:return 95;case 53:return 83;case 54:return 96;case 55:return 96;case 56:return 87;case 57:return 93;case 58:return 94;case 59:return 65;case 60:return 38;case 61:return 39;case 62:return 36;case 63:return 37;case 64:return 42;case 65:return 43;case 66:return 100;case 67:return 9;case 68:return 10;case 69:return 11}},rules:[/^(?:%%[^\n]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\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)/,/^(?:$)/],conditions:{string:{rules:[2,3],inclusive:!1},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],inclusive:!0}}};return t}();return Dt.lexer=Ct,t.prototype=Dt,Dt.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:85,fs:1,path:84}],99:[function(t,e,n){(function(e){"use strict";var r=t("moment"),i=t("../../logger"),a=new i.Log,u="",o="",s=[],c=[],l="";n.clear=function(){s=[],c=[],l="",o="",g=0,h=void 0,f=void 0,b=[]},n.setDateFormat=function(t){u=t},n.getDateFormat=function(){return u},n.setTitle=function(t){o=t},n.getTitle=function(){return o},n.addSection=function(t){l=t,s.push(t)},n.getTasks=function(){for(var t=x(),e=10,n=0;!t&&e>n;)t=x(),n++;return c=b};var h,f,d=function(t,e,i){i=i.trim();var u=/^after\s+([\d\w\-]+)/,o=u.exec(i.trim());if(null!==o){var s=n.findTaskById(o[1]);if("undefined"==typeof s){var c=new Date;return c.setHours(0,0,0,0),c}return s.endTime}return r(i,e.trim(),!0).isValid()?r(i,e.trim(),!0).toDate():(a.debug("Invalid date:"+i),a.debug("With date format:"+e.trim()),new Date)},p=function(t,e,n){if(n=n.trim(),r(n,e.trim(),!0).isValid())return r(n,e.trim()).toDate();var i=r(t),a=/^([\d]+)([wdhms])/,u=a.exec(n.trim());if(null!==u){switch(u[2]){case"s":i.add(u[1],"seconds");break;case"m":i.add(u[1],"minutes");break;case"h":i.add(u[1],"hours");break;case"d":i.add(u[1],"days");break;case"w":i.add(u[1],"weeks")}return i.toDate()}return i.toDate()},g=0,m=function(t){return"undefined"==typeof t?(g+=1,"task"+g):t},y=function(t,e){var r;r=":"===e.substr(0,1)?e.substr(1,e.length):e;for(var i=r.split(","),a={},u=n.getDateFormat(),o=!0;o;)o=!1,i[0].match(/^\s*active\s*$/)&&(a.active=!0,i.shift(1),o=!0),i[0].match(/^\s*done\s*$/)&&(a.done=!0,i.shift(1),o=!0),i[0].match(/^\s*crit\s*$/)&&(a.crit=!0,i.shift(1),o=!0);var s;for(s=0;sn-e?n+i+1.5*u.sidePadding>o?e+r-5:n+r+5:(n-e)/2+e+r}).attr("y",function(t,r){return r*e+u.barHeight/2+(u.fontSize/2-2)+n}).attr("text-height",i).attr("class",function(t){for(var e=w(t.startTime),n=w(t.endTime),r=this.getBBox().width,i=0,a=0;an-e?n+r+1.5*u.sidePadding>o?"taskTextOutsideLeft taskTextOutside"+i+" "+s:"taskTextOutsideRight taskTextOutside"+i+" "+s:"taskText taskText"+i+" "+s})}function l(t,e,n,a){var o,s=[[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["h1 %I:%M",function(t){return t.getMinutes()}]],c=[["%Y",function(){return!0}]],l=[["%I:%M",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}]];"undefined"!=typeof u.axisFormatter&&(l=[],u.axisFormatter.forEach(function(t){var e=[];e[0]=t[0],e[1]=t[1],l.push(e)})),o=s.concat(l).concat(c);var h=i.svg.axis().scale(w).orient("bottom").tickSize(-a+e+u.gridLineStartPadding,0,0).tickFormat(i.time.format.multi(o));r>7&&230>r&&(h=h.ticks(i.time.monday.range)),b.append("g").attr("class","grid").attr("transform","translate("+t+", "+(a-50)+")").call(h).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em")}function h(t,e){for(var n=[],r=0,i=0;i0))return i[1]*t/2+e;for(var u=0;a>u;u++)return r+=n[a-1][1],i[1]*t/2+r*t+e}).attr("class",function(t){for(var e=0;er;++r)e.hasOwnProperty(t[r])||(e[t[r]]=!0,n.push(t[r]));return n}function p(t){for(var e=t.length,n={};e;)n[t[--e]]=(n[t[e]]||0)+1;return n}function g(t,e){return p(e)[t]||0}n.yy.clear(),n.parse(t);var m=document.getElementById(e);o=m.parentElement.offsetWidth,"undefined"==typeof o&&(o=1200),"undefined"!=typeof u.useWidth&&(o=u.useWidth);var y=n.yy.getTasks(),v=y.length*(u.barHeight+u.barGap)+2*u.topPadding;m.setAttribute("height","100%"),m.setAttribute("viewBox","0 0 "+o+" "+v);var b=i.select("#"+e),_=i.min(y,function(t){return t.startTime}),x=i.max(y,function(t){return t.endTime}),w=i.time.scale().domain([i.min(y,function(t){return t.startTime}),i.max(y,function(t){return t.endTime})]).rangeRound([0,o-150]),A=[];r=a.duration(x-_).asDays();for(var E=0;El&&D.push("'"+this.terminals_[A]+"'");M=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(M,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:m,expected:D})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,b?(v=b,b=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,m=d.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[x[1]][1],S.$=r[r.length-E],S._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},y&&(S._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(S,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;E&&(n=n.slice(0,-1*E*2),r=r.slice(0,-1*E),i=i.slice(0,-1*E)),n.push(this.productions_[x[1]][0]),r.push(S.$),i.push(S._$),k=a[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},s=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0, +this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 10;case 1:break;case 2:break;case 3:break;case 4:return 4;case 5:return 11;case 6:return"date";case 7:return 12;case 8:return 13;case 9:return 14;case 10:return 15;case 11:return":";case 12:return 6;case 13:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\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],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return t}();return o.lexer=s,t.prototype=o,o.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:85,fs:1,path:84}],102:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,2],r=[1,3],i=[1,4],a=[2,4],u=[1,9],o=[1,11],s=[1,12],c=[1,14],l=[1,15],h=[1,17],f=[1,18],d=[1,19],p=[1,20],g=[1,22],m=[1,23],y=[1,4,5,10,15,16,18,20,21,22,23,24,25,37],v=[4,5,10,15,16,18,20,21,22,23,25,37],b=[35,36,37],_=[1,67],x={trace:function(){},yy:{},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,text:19,loop:20,end:21,opt:22,alt:23,"else":24,note:25,placement:26,text2:27,over:28,actor_pair:29,spaceList:30,",":31,left_of:32,right_of:33,signaltype:34,"+":35,"-":36,ACTOR:37,SOLID_OPEN_ARROW:38,DOTTED_OPEN_ARROW:39,SOLID_ARROW:40,DOTTED_ARROW:41,SOLID_CROSS:42,DOTTED_CROSS:43,TXT:44,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",10:"participant",12:"AS",13:"restOfLine",15:"activate",16:"deactivate",18:"title",19:"text",20:"loop",21:"end",22:"opt",23:"alt",24:"else",25:"note",28:"over",31:",",32:"left_of",33:"right_of",35:"+",36:"-",37:"ACTOR",38:"SOLID_OPEN_ARROW",39:"DOTTED_OPEN_ARROW",40:"SOLID_ARROW",41:"DOTTED_ARROW",42:"SOLID_CROSS",43:"DOTTED_CROSS",44:"TXT"},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,4],[9,4],[9,4],[9,7],[17,4],[17,4],[30,2],[30,1],[29,3],[29,1],[26,1],[26,1],[14,5],[14,5],[14,4],[11,1],[34,1],[34,1],[34,1],[34,1],[34,1],[34,1],[27,1]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 3:return r.apply(a[u]),a[u];case 4:this.$=[];break;case 5:a[u-1].push(a[u]),this.$=a[u-1];break;case 6:case 7:this.$=a[u];break;case 8:this.$=[];break;case 9:a[u-3].description=a[u-1],this.$=a[u-3];break;case 10:this.$=a[u-1];break;case 12:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:a[u-1]};break;case 13:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:a[u-1]};break;case 16:a[u-1].unshift({type:"loopStart",loopText:a[u-2],signalType:r.LINETYPE.LOOP_START}),a[u-1].push({type:"loopEnd",loopText:a[u-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[u-1];break;case 17:a[u-1].unshift({type:"optStart",optText:a[u-2],signalType:r.LINETYPE.OPT_START}),a[u-1].push({type:"optEnd",optText:a[u-2],signalType:r.LINETYPE.OPT_END}),this.$=a[u-1];break;case 18:a[u-4].unshift({type:"altStart",altText:a[u-5],signalType:r.LINETYPE.ALT_START}),a[u-4].push({type:"else",altText:a[u-2],signalType:r.LINETYPE.ALT_ELSE}),a[u-4]=a[u-4].concat(a[u-1]),a[u-4].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=a[u-4];break;case 19:this.$=[a[u-1],{type:"addNote",placement:a[u-2],actor:a[u-1].actor,text:a[u]}];break;case 20:a[u-2]=[].concat(a[u-1],a[u-1]).slice(0,2),a[u-2][0]=a[u-2][0].actor,a[u-2][1]=a[u-2][1].actor,this.$=[a[u-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:a[u-2].slice(0,2),text:a[u]}];break;case 23:this.$=[a[u-2],a[u]];break;case 24:this.$=a[u];break;case 25:this.$=r.PLACEMENT.LEFTOF;break;case 26:this.$=r.PLACEMENT.RIGHTOF;break;case 27:this.$=[a[u-4],a[u-1],{type:"addMessage",from:a[u-4].actor,to:a[u-1].actor,signalType:a[u-3],msg:a[u]},{type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:a[u-1]}];break;case 28:this.$=[a[u-4],a[u-1],{type:"addMessage",from:a[u-4].actor,to:a[u-1].actor,signalType:a[u-3],msg:a[u]},{type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:a[u-4]}];break;case 29:this.$=[a[u-3],a[u-1],{type:"addMessage",from:a[u-3].actor,to:a[u-1].actor,signalType:a[u-2],msg:a[u]}];break;case 30:this.$={type:"addActor",actor:a[u]};break;case 31:this.$=r.LINETYPE.SOLID_OPEN;break;case 32:this.$=r.LINETYPE.DOTTED_OPEN;break;case 33:this.$=r.LINETYPE.SOLID;break;case 34:this.$=r.LINETYPE.DOTTED;break;case 35:this.$=r.LINETYPE.SOLID_CROSS;break;case 36:this.$=r.LINETYPE.DOTTED_CROSS;break;case 37:this.$=a[u].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},e([1,4,5,10,15,16,18,20,22,23,25,37],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:u,5:o,8:8,9:10,10:s,11:21,14:13,15:c,16:l,17:16,18:h,20:f,22:d,23:p,25:g,37:m},e(y,[2,5]),{9:24,10:s,11:21,14:13,15:c,16:l,17:16,18:h,20:f,22:d,23:p,25:g,37:m},e(y,[2,7]),e(y,[2,8]),{11:25,37:m},{5:[1,26]},{11:27,37:m},{11:28,37:m},{5:[1,29]},{4:[1,30]},{13:[1,31]},{13:[1,32]},{13:[1,33]},{34:34,38:[1,35],39:[1,36],40:[1,37],41:[1,38],42:[1,39],43:[1,40]},{26:41,28:[1,42],32:[1,43],33:[1,44]},e([5,12,31,38,39,40,41,42,43,44],[2,30]),e(y,[2,6]),{5:[1,46],12:[1,45]},e(y,[2,11]),{5:[1,47]},{5:[1,48]},e(y,[2,14]),{19:[1,49]},e(v,a,{7:50}),e(v,a,{7:51}),e([4,5,10,15,16,18,20,22,23,24,25,37],a,{7:52}),{11:55,35:[1,53],36:[1,54],37:m},e(b,[2,31]),e(b,[2,32]),e(b,[2,33]),e(b,[2,34]),e(b,[2,35]),e(b,[2,36]),{11:56,37:m},{11:58,29:57,37:m},{37:[2,25]},{37:[2,26]},{13:[1,59]},e(y,[2,10]),e(y,[2,12]),e(y,[2,13]),{5:[1,60]},{4:u,5:o,8:8,9:10,10:s,11:21,14:13,15:c,16:l,17:16,18:h,20:f,21:[1,61],22:d,23:p,25:g,37:m},{4:u,5:o,8:8,9:10,10:s,11:21,14:13,15:c,16:l,17:16,18:h,20:f,21:[1,62],22:d,23:p,25:g,37:m},{4:u,5:o,8:8,9:10,10:s,11:21,14:13,15:c,16:l,17:16,18:h,20:f,22:d,23:p,24:[1,63],25:g,37:m},{11:64,37:m},{11:65,37:m},{27:66,44:_},{27:68,44:_},{27:69,44:_},{31:[1,70],44:[2,24]},{5:[1,71]},e(y,[2,15]),e(y,[2,16]),e(y,[2,17]),{13:[1,72]},{27:73,44:_},{27:74,44:_},{5:[2,29]},{5:[2,37]},{5:[2,19]},{5:[2,20]},{11:75,37:m},e(y,[2,9]),e(v,a,{7:76}),{5:[2,27]},{5:[2,28]},{44:[2,23]},{4:u,5:o,8:8,9:10,10:s,11:21,14:13,15:c,16:l,17:16,18:h,20:f,21:[1,77],22:d,23:p,25:g,37:m},e(y,[2,18])],defaultActions:{5:[2,1],6:[2,2],43:[2,25],44:[2,26],66:[2,29],67:[2,37],68:[2,19],69:[2,20],73:[2,27],74:[2,28],75:[2,23]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;i.push(m);var y=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,x,w,A,E,k,D,C=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},S={};;){if(_=n[n.length-1],this.defaultActions[_]?x=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),x=a[_]&&a[_][v]),"undefined"==typeof x||!x.length||!x[0]){var M="";D=[];for(A in a[_])this.terminals_[A]&&A>l&&D.push("'"+this.terminals_[A]+"'");M=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(M,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:m,expected:D})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,b?(v=b,b=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,m=d.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[x[1]][1],S.$=r[r.length-E],S._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},y&&(S._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(S,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;E&&(n=n.slice(0,-1*E*2),r=r.slice(0,-1*E),i=i.slice(0,-1*E)),n.push(this.productions_[x[1]][0]),r.push(S.$),i.push(S._$),k=a[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},w=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:return this.begin("ID"),10;case 6:return this.begin("ALIAS"),37;case 7:return this.popState(),this.popState(),this.begin("LINE"),12;case 8:return this.popState(),this.popState(),5;case 9:return this.begin("LINE"),20;case 10:return this.begin("LINE"),22;case 11:return this.begin("LINE"),23;case 12:return this.begin("LINE"),24;case 13:return this.popState(),13;case 14:return 21;case 15:return 32;case 16:return 33;case 17:return 28;case 18:return 25;case 19:return this.begin("ID"),15;case 20:return this.begin("ID"),16;case 21:return 18;case 22:return 6;case 23:return 31;case 24:return 5;case 25:return e.yytext=e.yytext.trim(),37;case 26:return 40;case 27:return 41;case 28:return 38;case 29:return 39;case 30:return 42;case 31:return 43;case 32:return 44;case 33:return 35;case 34:return 36;case 35:return 5;case 36:return"INVALID"}},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,/^(?:[^#\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],conditions:{LINE:{rules:[2,3,13],inclusive:!1},ALIAS:{rules:[2,3,7,8],inclusive:!1},ID:{rules:[2,3,6],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],inclusive:!0}}};return t}();return x.lexer=w,t.prototype=x,x.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:85,fs:1,path:84}],103:[function(t,e,n){(function(e){"use strict";var r={},i=[],a=[],u=t("../../logger"),o=new u.Log;n.addActor=function(t,e,n){var i=r[t];i&&e===i.name&&null==n||(null==n&&(n=e),r[t]={name:e,description:n})},n.addMessage=function(t,e,n,r){i.push({from:t,to:e,message:n,answer:r})},n.addSignal=function(t,e,n,r){o.debug("Adding message from="+t+" to="+e+" message="+n+" type="+r),i.push({from:t,to:e,message:n,type:r})},n.getMessages=function(){return i},n.getActors=function(){return r},n.getActor=function(t){return r[t]},n.getActorKeys=function(){return Object.keys(r)},n.clear=function(){r={},i=[]},n.LINETYPE={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18},n.ARROWTYPE={FILLED:0,OPEN:1},n.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2},n.addNote=function(t,e,r){var u={actor:t,placement:e,message:r},o=[].concat(t,t);a.push(u),i.push({from:o[0],to:o[1],message:r,type:n.LINETYPE.NOTE,placement:e})},n.parseError=function(t,n){e.mermaidAPI.parseError(t,n)},n.apply=function(t){if(t instanceof Array)t.forEach(function(t){n.apply(t)});else switch(t.type){case"addActor":n.addActor(t.actor,t.actor,t.description);break;case"activeStart":n.addSignal(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":n.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":n.addNote(t.actor,t.placement,t.text);break;case"addMessage":n.addSignal(t.from,t.to,t.msg,t.signalType);break;case"loopStart":n.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":n.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":n.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":n.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":n.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":n.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":n.addSignal(void 0,void 0,void 0,t.signalType)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../logger":106}],104:[function(t,e,n){"use strict";var r=t("./parser/sequenceDiagram").parser;r.yy=t("./sequenceDb");var i=t("./svgDraw"),a=t("../../d3"),u=t("../../logger"),o=new u.Log,s={diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!1,bottomMarginAdj:1,activationWidth:10};n.bounds={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],init:function(){this.sequenceItems=[],this.activations=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,n,r){t[e]="undefined"==typeof t[e]?n:r(n,t[e])},updateBounds:function(t,e,r,i){function a(a){return function(c){o++;var l=u.sequenceItems.length-o+1;u.updateVal(c,"starty",e-l*s.boxMargin,Math.min),u.updateVal(c,"stopy",i+l*s.boxMargin,Math.max),u.updateVal(n.bounds.data,"startx",t-l*s.boxMargin,Math.min),u.updateVal(n.bounds.data,"stopx",r+l*s.boxMargin,Math.max),"activation"!=a&&(u.updateVal(c,"startx",t-l*s.boxMargin,Math.min),u.updateVal(c,"stopx",r+l*s.boxMargin,Math.max),u.updateVal(n.bounds.data,"starty",e-l*s.boxMargin,Math.min),u.updateVal(n.bounds.data,"stopy",i+l*s.boxMargin,Math.max))}}var u=this,o=0;this.sequenceItems.forEach(a()),this.activations.forEach(a("activation"))},insert:function(t,e,r,i){var a,u,o,s;a=Math.min(t,r),o=Math.max(t,r),u=Math.min(e,i),s=Math.max(e,i),this.updateVal(n.bounds.data,"startx",a,Math.min),this.updateVal(n.bounds.data,"starty",u,Math.min),this.updateVal(n.bounds.data,"stopx",o,Math.max),this.updateVal(n.bounds.data,"stopy",s,Math.max),this.updateBounds(a,u,o,s)},newActivation:function(t,e){var n=r.yy.getActors()[t.from.actor],a=h(t.from.actor).length,u=n.x+s.width/2+(a-1)*s.activationWidth/2;this.activations.push({startx:u,starty:this.verticalPos+2,stopx:u+s.activationWidth,stopy:void 0,actor:t.from.actor,anchored:i.anchorElement(e)})},endActivation:function(t){var e=this.activations.map(function(t){return t.actor}).lastIndexOf(t.from.actor),n=this.activations.splice(e,1)[0];return n},newLoop:function(t){this.sequenceItems.push({startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t})},endLoop:function(){var t=this.sequenceItems.pop();return t},addElseToLoop:function(t){var e=this.sequenceItems.pop();e.elsey=n.bounds.getVerticalPos(),e.elseText=t,this.sequenceItems.push(e)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}};var c=function(t,e,r,a,u){var o=i.getNoteRect();o.x=e,o.y=r,o.width=u||s.width,o["class"]="note";var c=t.append("g"),l=i.drawRect(c,o),h=i.getTextObj();h.x=e-4,h.y=r-13,h.textMargin=s.noteMargin,h.dy="1em",h.text=a.message,h["class"]="noteText";var f=i.drawText(c,h,o.width-s.noteMargin),d=f[0][0].getBBox().height;!u&&d>s.width?(f.remove(),c=t.append("g"),f=i.drawText(c,h,2*o.width-s.noteMargin),d=f[0][0].getBBox().height,l.attr("width",2*o.width),n.bounds.insert(e,r,e+2*o.width,r+2*s.noteMargin+d)):n.bounds.insert(e,r,e+o.width,r+2*s.noteMargin+d),l.attr("height",d+2*s.noteMargin),n.bounds.bumpVerticalPos(d+2*s.noteMargin)},l=function(t,e,i,a,u){var o,c=t.append("g"),l=e+(i-e)/2,h=c.append("text").attr("x",l).attr("y",a-7).style("text-anchor","middle").attr("class","messageText").text(u.message);o="undefined"!=typeof h[0][0].getBBox?h[0][0].getBBox().width:h[0][0].getBoundingClientRect();var f;if(e===i){f=c.append("path").attr("d","M "+e+","+a+" C "+(e+60)+","+(a-10)+" "+(e+60)+","+(a+30)+" "+e+","+(a+20)),n.bounds.bumpVerticalPos(30);var d=Math.max(o/2,100);n.bounds.insert(e-d,n.bounds.getVerticalPos()-10,i+d,n.bounds.getVerticalPos())}else f=c.append("line"),f.attr("x1",e),f.attr("y1",a),f.attr("x2",i),f.attr("y2",a),n.bounds.insert(e,n.bounds.getVerticalPos()-10,i,n.bounds.getVerticalPos());u.type===r.yy.LINETYPE.DOTTED||u.type===r.yy.LINETYPE.DOTTED_CROSS||u.type===r.yy.LINETYPE.DOTTED_OPEN?(f.style("stroke-dasharray","3, 3"),f.attr("class","messageLine1")):f.attr("class","messageLine0");var p="";s.arrowMarkerAbsolute&&(p=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,p=p.replace(/\(/g,"\\("),p=p.replace(/\)/g,"\\)")),f.attr("stroke-width",2),f.attr("stroke","black"),f.style("fill","none"),(u.type===r.yy.LINETYPE.SOLID||u.type===r.yy.LINETYPE.DOTTED)&&f.attr("marker-end","url("+p+"#arrowhead)"),(u.type===r.yy.LINETYPE.SOLID_CROSS||u.type===r.yy.LINETYPE.DOTTED_CROSS)&&f.attr("marker-end","url("+p+"#crosshead)")};e.exports.drawActors=function(t,e,r,a){var u;for(u=0;ue&&(r.starty=e-6,e+=12),i.drawActivation(m,r,e,s),n.bounds.insert(r.startx,e-10,r.stopx,e)}r.yy.clear(),r.parse(t+"\n"),n.bounds.init();var d,p,g,m=a.select("#"+u),y=r.yy.getActors(),v=r.yy.getActorKeys(),b=r.yy.getMessages();e.exports.drawActors(m,y,v,0),i.insertArrowHead(m),i.insertArrowCrossHead(m);var _;b.forEach(function(t){var e;switch(t.type){case r.yy.LINETYPE.NOTE:n.bounds.bumpVerticalPos(s.boxMargin),d=y[t.from].x,p=y[t.to].x,t.placement===r.yy.PLACEMENT.RIGHTOF?c(m,d+(s.width+s.actorMargin)/2,n.bounds.getVerticalPos(),t):t.placement===r.yy.PLACEMENT.LEFTOF?c(m,d-(s.width+s.actorMargin)/2,n.bounds.getVerticalPos(),t):t.to===t.from?c(m,d,n.bounds.getVerticalPos(),t):(g=Math.abs(d-p)+s.actorMargin,c(m,(d+p+s.width-g)/2,n.bounds.getVerticalPos(),t,g));break;case r.yy.LINETYPE.ACTIVE_START:n.bounds.newActivation(t,m);break;case r.yy.LINETYPE.ACTIVE_END:h(t,n.bounds.getVerticalPos());break;case r.yy.LINETYPE.LOOP_START:n.bounds.bumpVerticalPos(s.boxMargin),n.bounds.newLoop(t.message),n.bounds.bumpVerticalPos(s.boxMargin+s.boxTextMargin);break;case r.yy.LINETYPE.LOOP_END:e=n.bounds.endLoop(),i.drawLoop(m,e,"loop",s),n.bounds.bumpVerticalPos(s.boxMargin);break;case r.yy.LINETYPE.OPT_START:n.bounds.bumpVerticalPos(s.boxMargin),n.bounds.newLoop(t.message),n.bounds.bumpVerticalPos(s.boxMargin+s.boxTextMargin);break;case r.yy.LINETYPE.OPT_END:e=n.bounds.endLoop(),i.drawLoop(m,e,"opt",s),n.bounds.bumpVerticalPos(s.boxMargin);break;case r.yy.LINETYPE.ALT_START:n.bounds.bumpVerticalPos(s.boxMargin),n.bounds.newLoop(t.message),n.bounds.bumpVerticalPos(s.boxMargin+s.boxTextMargin);break;case r.yy.LINETYPE.ALT_ELSE:n.bounds.bumpVerticalPos(s.boxMargin),e=n.bounds.addElseToLoop(t.message),n.bounds.bumpVerticalPos(s.boxMargin);break;case r.yy.LINETYPE.ALT_END:e=n.bounds.endLoop(),i.drawLoop(m,e,"alt",s),n.bounds.bumpVerticalPos(s.boxMargin);break;default:try{_=t,n.bounds.bumpVerticalPos(s.messageMargin);var a=f(t.from),u=f(t.to),o=a[0]<=u[0]?1:0,v=a[0]/gi," "),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.attr("fill",e.fill),"undefined"!=typeof e["class"]&&i.attr("class",e["class"]);var a=i.append("tspan");return a.attr("x",e.x+2*e.textMargin),a.text(r),"undefined"!=typeof i.textwrap&&i.textwrap({x:e.x,y:e.y,width:n,height:1800},e.textMargin),i},n.drawLabel=function(t,e){var r=n.getNoteRect();r.x=e.x,r.y=e.y,r.width=50,r.height=20,r.fill="#526e52",r.stroke="none",r["class"]="labelBox",n.drawRect(t,r),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,e.fill="white",n.drawText(t,e)};var r=-1;n.drawActor=function(t,e,i,a,u){var o=e+u.width/2,s=t.append("g");0===i&&(r++,s.append("line").attr("id","actor"+r).attr("x1",o).attr("y1",5).attr("x2",o).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"));var c=n.getNoteRect();c.x=e,c.y=i,c.fill="#eaeaea",c.width=u.width,c.height=u.height,c["class"]="actor",c.rx=3,c.ry=3,n.drawRect(s,c),s.append("text").attr("x",o).attr("y",i+u.height/2+5).attr("class","actor").style("text-anchor","middle").text(a)},n.anchorElement=function(t){return t.append("g")},n.drawActivation=function(t,e,r){var i=n.getNoteRect(),a=e.anchored;i.x=e.startx,i.y=e.starty,i.fill="#f4f4f4",i.width=e.stopx-e.startx,i.height=r-e.starty,n.drawRect(a,i)},n.drawLoop=function(t,e,r,i){var a=t.append("g"),u=function(t,e,n,r){a.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",r).attr("stroke-width",2).attr("stroke","#526e52").attr("class","loopLine")};u(e.startx,e.starty,e.stopx,e.starty),u(e.stopx,e.starty,e.stopx,e.stopy),u(e.startx,e.stopy,e.stopx,e.stopy),u(e.startx,e.starty,e.startx,e.stopy), +"undefined"!=typeof e.elsey&&u(e.startx,e.elsey,e.stopx,e.elsey);var o=n.getTextObj();o.text=r,o.x=e.startx,o.y=e.starty,o.labelMargin=15,o["class"]="labelText",o.fill="white",n.drawLabel(a,o),o=n.getTextObj(),o.text="[ "+e.title+" ]",o.x=e.startx+(e.stopx-e.startx)/2,o.y=e.starty+1.5*i.boxMargin,o.anchor="middle",o["class"]="loopText",n.drawText(a,o),"undefined"!=typeof e.elseText&&(o.text="[ "+e.elseText+" ]",o.y=e.elsey+1.5*i.boxMargin,n.drawText(a,o))},n.insertArrowHead=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},n.insertArrowCrossHead=function(t){var e=t.append("defs"),n=e.append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.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"),n.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")},n.getTextObj=function(){var t={x:0,y:0,fill:"black","text-anchor":"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0};return t},n.getNoteRect=function(){var t={x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0};return t}},{}],106:[function(t,e,n){"use strict";function r(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getSeconds(),i=t.getMilliseconds();10>e&&(e="0"+e),10>n&&(n="0"+n),10>r&&(r="0"+r),100>i&&(i="0"+i),10>i&&(i="00"+i);var a=e+":"+n+":"+r+" ("+i+")";return a}function i(t){this.level=t,this.log=function(t,e){var n=this.level;return"undefined"==typeof n&&(n=u),e>=n&&"undefined"!=typeof console&&"undefined"!=typeof console.log?console.log("["+r(new Date)+"] "+t):void 0},this.trace=function(t){this.log(t,a.trace)},this.debug=function(t){this.log(t,a.debug)},this.info=function(t){this.log(t,a.info)},this.warn=function(t){this.log(t,a.warn)},this.error=function(t){this.log(t,a.error)}}var a={debug:1,info:2,warn:3,error:4,fatal:5,"default":5},u=a.error;n.setLogLevel=function(t){u=t},n.Log=i},{}],107:[function(t,e,n){(function(r){"use strict";var i=t("./logger"),a=new i.Log,u=t("./mermaidAPI"),o=0,s=t("he");e.exports.mermaidAPI=u;var c=function(){var t=u.getConfig();a.debug("Starting rendering diagrams");var e;arguments.length>=2?("undefined"!=typeof arguments[0]&&(r.mermaid.sequenceConfig=arguments[0]),e=arguments[1]):e=arguments[0];var n;"function"==typeof arguments[arguments.length-1]?(n=arguments[arguments.length-1],a.debug("Callback function found")):"undefined"!=typeof t.mermaid&&("function"==typeof t.mermaid.callback?(n=t.mermaid.callback,a.debug("Callback function found")):a.debug("No Callback function found")),e=void 0===e?document.querySelectorAll(".mermaid"):"string"==typeof e?document.querySelectorAll(e):e instanceof Node?[e]:e;var i;"undefined"!=typeof mermaid_config&&u.initialize(r.mermaid_config),a.debug("Start On Load before: "+r.mermaid.startOnLoad),"undefined"!=typeof r.mermaid.startOnLoad&&(a.debug("Start On Load inner: "+r.mermaid.startOnLoad),u.initialize({startOnLoad:r.mermaid.startOnLoad})),"undefined"!=typeof r.mermaid.ganttConfig&&u.initialize({gantt:r.mermaid.ganttConfig});var c,l=function(t,e){h.innerHTML=t,"undefined"!=typeof n&&n(f),e(h)};for(i=0;i0&&(r+=n.selectorText+" { "+n.style.cssText+"}\n")}}catch(l){"undefined"!=typeof n&&i.warn('Invalid CSS selector "'+n.selectorText+'"',l)}var h="",f="";for(var d in e)e.hasOwnProperty(d)&&"undefined"!=typeof d&&("default"===d?(e["default"].styles instanceof Array&&(h+="#"+t.id.trim()+" .node>rect { "+e[d].styles.join("; ")+"; }\n"),e["default"].nodeLabelStyles instanceof Array&&(h+="#"+t.id.trim()+" .node text { "+e[d].nodeLabelStyles.join("; ")+"; }\n"),e["default"].edgeLabelStyles instanceof Array&&(h+="#"+t.id.trim()+" .edgeLabel text { "+e[d].edgeLabelStyles.join("; ")+"; }\n"),e["default"].clusterStyles instanceof Array&&(h+="#"+t.id.trim()+" .cluster rect { "+e[d].clusterStyles.join("; ")+"; }\n")):e[d].styles instanceof Array&&(f+="#"+t.id.trim()+" ."+d+">rect, ."+d+">polygon, ."+d+">ellipse { "+e[d].styles.join("; ")+"; }\n"));if(""!==r||""!==h||""!==f){var p=document.createElement("style");p.setAttribute("type","text/css"),p.setAttribute("title","mermaid-svg-internal-css"),p.innerHTML="/* */\n",t.insertBefore(p,t.firstChild)}};n.cloneCssStyles=u},{"./logger":106}]},{},[107])(107)}); \ No newline at end of file diff --git a/dist/mermaid.slim.js b/dist/mermaid.slim.js index cd9079716..5f307b433 100644 --- a/dist/mermaid.slim.js +++ b/dist/mermaid.slim.js @@ -1,322 +1,6 @@ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.mermaid=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0 - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift('..'); - } - } - - return parts; -} - -// Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; -var splitPath = function(filename) { - return splitPathRe.exec(filename).slice(1); -}; - -// path.resolve([from ...], to) -// posix version -exports.resolve = function() { - var resolvedPath = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) ? arguments[i] : process.cwd(); - - // Skip empty and invalid entries - if (typeof path !== 'string') { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - continue; - } - - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; - } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path - resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { - return !!p; - }), !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; -}; - -// path.normalize(path) -// posix version -exports.normalize = function(path) { - var isAbsolute = exports.isAbsolute(path), - trailingSlash = substr(path, -1) === '/'; - - // Normalize the path - path = normalizeArray(filter(path.split('/'), function(p) { - return !!p; - }), !isAbsolute).join('/'); - - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - - return (isAbsolute ? '/' : '') + path; -}; - -// posix version -exports.isAbsolute = function(path) { - return path.charAt(0) === '/'; -}; - -// posix version -exports.join = function() { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(filter(paths, function(p, index) { - if (typeof p !== 'string') { - throw new TypeError('Arguments to path.join must be strings'); - } - return p; - }).join('/')); -}; - - -// path.relative(from, to) -// posix version -exports.relative = function(from, to) { - from = exports.resolve(from).substr(1); - to = exports.resolve(to).substr(1); - - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') break; - } - - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') break; - } - - if (start > end) return []; - return arr.slice(start, end - start + 1); - } - - var fromParts = trim(from.split('/')); - var toParts = trim(to.split('/')); - - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('/'); -}; - -exports.sep = '/'; -exports.delimiter = ':'; - -exports.dirname = function(path) { - var result = splitPath(path), - root = result[0], - dir = result[1]; - - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } - - return root + dir; -}; - - -exports.basename = function(path, ext) { - var f = splitPath(path)[2]; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -exports.extname = function(path) { - return splitPath(path)[3]; -}; - -function filter (xs, f) { - if (xs.filter) return xs.filter(f); - var res = []; - for (var i = 0; i < xs.length; i++) { - if (f(xs[i], i, xs)) res.push(xs[i]); - } - return res; -} - -// String.prototype.substr - negative index don't work in IE8 -var substr = 'ab'.substr(-1) === 'b' - ? function (str, start, len) { return str.substr(start, len) } - : function (str, start, len) { - if (start < 0) start = str.length + start; - return str.substr(start, len); - } -; - -}).call(this,require('_process')) -},{"_process":3}],3:[function(require,module,exports){ -// shim for using process in browser - -var process = module.exports = {}; - -process.nextTick = (function () { - var canSetImmediate = typeof window !== 'undefined' - && window.setImmediate; - var canMutationObserver = typeof window !== 'undefined' - && window.MutationObserver; - var canPost = typeof window !== 'undefined' - && window.postMessage && window.addEventListener - ; - - if (canSetImmediate) { - return function (f) { return window.setImmediate(f) }; - } - - var queue = []; - - if (canMutationObserver) { - var hiddenDiv = document.createElement("div"); - var observer = new MutationObserver(function () { - var queueList = queue.slice(); - queue.length = 0; - queueList.forEach(function (fn) { - fn(); - }); - }); - - observer.observe(hiddenDiv, { attributes: true }); - - return function nextTick(fn) { - if (!queue.length) { - hiddenDiv.setAttribute('yes', 'no'); - } - queue.push(fn); - }; - } - - if (canPost) { - window.addEventListener('message', function (ev) { - var source = ev.source; - if ((source === window || source === null) && ev.data === 'process-tick') { - ev.stopPropagation(); - if (queue.length > 0) { - var fn = queue.shift(); - fn(); - } - } - }, true); - - return function nextTick(fn) { - queue.push(fn); - window.postMessage('process-tick', '*'); - }; - } - - return function nextTick(fn) { - setTimeout(fn, 0); - }; -})(); - -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -// TODO(shtylman) -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; - -},{}],4:[function(require,module,exports){ /** * @license * Copyright (c) 2012-2013 Chris Pettitt @@ -348,7 +32,7 @@ module.exports = { version: require("./lib/version") }; -},{"./lib/dagre":11,"./lib/graphlib":12,"./lib/intersect":13,"./lib/render":28,"./lib/util":30,"./lib/version":31}],5:[function(require,module,exports){ +},{"./lib/dagre":9,"./lib/graphlib":10,"./lib/intersect":11,"./lib/render":26,"./lib/util":28,"./lib/version":29}],3:[function(require,module,exports){ var util = require("./util"); module.exports = { @@ -412,7 +96,7 @@ function undirected(parent, id, edge, type) { util.applyStyle(path, edge[type + "Style"]); } -},{"./util":30}],6:[function(require,module,exports){ +},{"./util":28}],4:[function(require,module,exports){ var util = require("./util"), addLabel = require("./label/add-label"); @@ -457,7 +141,7 @@ function createClusters(selection, g) { return svgClusters; } -},{"./label/add-label":21,"./util":30}],7:[function(require,module,exports){ +},{"./label/add-label":19,"./util":28}],5:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -494,7 +178,7 @@ function createEdgeLabels(selection, g) { return svgEdgeLabels; } -},{"./d3":10,"./label/add-label":21,"./lodash":24,"./util":30}],8:[function(require,module,exports){ +},{"./d3":8,"./label/add-label":19,"./lodash":22,"./util":28}],6:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -626,7 +310,7 @@ function exit(svgPaths, g) { }); } -},{"./d3":10,"./intersect/intersect-node":17,"./lodash":24,"./util":30}],9:[function(require,module,exports){ +},{"./d3":8,"./intersect/intersect-node":15,"./lodash":22,"./util":28}],7:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -686,11 +370,11 @@ function createNodes(selection, g, shapes) { return svgNodes; } -},{"./d3":10,"./label/add-label":21,"./lodash":24,"./util":30}],10:[function(require,module,exports){ +},{"./d3":8,"./label/add-label":19,"./lodash":22,"./util":28}],8:[function(require,module,exports){ // Stub to get D3 either via NPM or from the global object module.exports = window.d3; -},{}],11:[function(require,module,exports){ +},{}],9:[function(require,module,exports){ /* global window */ var dagre; @@ -707,7 +391,7 @@ if (!dagre) { module.exports = dagre; -},{"dagre":53}],12:[function(require,module,exports){ +},{"dagre":30}],10:[function(require,module,exports){ /* global window */ var graphlib; @@ -724,7 +408,7 @@ if (!graphlib) { module.exports = graphlib; -},{"graphlib":32}],13:[function(require,module,exports){ +},{"graphlib":60}],11:[function(require,module,exports){ module.exports = { node: require("./intersect-node"), circle: require("./intersect-circle"), @@ -733,7 +417,7 @@ module.exports = { rect: require("./intersect-rect") }; -},{"./intersect-circle":14,"./intersect-ellipse":15,"./intersect-node":17,"./intersect-polygon":18,"./intersect-rect":19}],14:[function(require,module,exports){ +},{"./intersect-circle":12,"./intersect-ellipse":13,"./intersect-node":15,"./intersect-polygon":16,"./intersect-rect":17}],12:[function(require,module,exports){ var intersectEllipse = require("./intersect-ellipse"); module.exports = intersectCircle; @@ -742,7 +426,7 @@ function intersectCircle(node, rx, point) { return intersectEllipse(node, rx, rx, point); } -},{"./intersect-ellipse":15}],15:[function(require,module,exports){ +},{"./intersect-ellipse":13}],13:[function(require,module,exports){ module.exports = intersectEllipse; function intersectEllipse(node, rx, ry, point) { @@ -769,7 +453,7 @@ function intersectEllipse(node, rx, ry, point) { } -},{}],16:[function(require,module,exports){ +},{}],14:[function(require,module,exports){ module.exports = intersectLine; /* @@ -841,14 +525,14 @@ function sameSign(r1, r2) { return r1 * r2 > 0; } -},{}],17:[function(require,module,exports){ +},{}],15:[function(require,module,exports){ module.exports = intersectNode; function intersectNode(node, point) { return node.intersect(point); } -},{}],18:[function(require,module,exports){ +},{}],16:[function(require,module,exports){ var intersectLine = require("./intersect-line"); module.exports = intersectPolygon; @@ -905,7 +589,7 @@ function intersectPolygon(node, polyPoints, point) { return intersections[0]; } -},{"./intersect-line":16}],19:[function(require,module,exports){ +},{"./intersect-line":14}],17:[function(require,module,exports){ module.exports = intersectRect; function intersectRect(node, point) { @@ -939,7 +623,7 @@ function intersectRect(node, point) { return {x: x + sx, y: y + sy}; } -},{}],20:[function(require,module,exports){ +},{}],18:[function(require,module,exports){ var util = require("../util"); module.exports = addHtmlLabel; @@ -984,7 +668,7 @@ function addHtmlLabel(root, node) { return fo; } -},{"../util":30}],21:[function(require,module,exports){ +},{"../util":28}],19:[function(require,module,exports){ var addTextLabel = require("./add-text-label"), addHtmlLabel = require("./add-html-label"), addSVGLabel = require("./add-svg-label"); @@ -1023,7 +707,7 @@ function addLabel(root, node, location) { return labelSvg; } -},{"./add-html-label":20,"./add-svg-label":22,"./add-text-label":23}],22:[function(require,module,exports){ +},{"./add-html-label":18,"./add-svg-label":20,"./add-text-label":21}],20:[function(require,module,exports){ var util = require("../util"); module.exports = addSVGLabel; @@ -1038,7 +722,7 @@ function addSVGLabel(root, node) { return domNode; } -},{"../util":30}],23:[function(require,module,exports){ +},{"../util":28}],21:[function(require,module,exports){ var util = require("../util"); module.exports = addTextLabel; @@ -1085,7 +769,7 @@ function processEscapeSequences(text) { return newText; } -},{"../util":30}],24:[function(require,module,exports){ +},{"../util":28}],22:[function(require,module,exports){ /* global window */ var lodash; @@ -1102,7 +786,7 @@ if (!lodash) { module.exports = lodash; -},{"lodash":52}],25:[function(require,module,exports){ +},{"lodash":81}],23:[function(require,module,exports){ "use strict"; var util = require("./util"), @@ -1138,7 +822,7 @@ function positionClusters(selection, g) { } -},{"./d3":10,"./util":30}],26:[function(require,module,exports){ +},{"./d3":8,"./util":28}],24:[function(require,module,exports){ "use strict"; var util = require("./util"), @@ -1162,7 +846,7 @@ function positionEdgeLabels(selection, g) { .attr("transform", translate); } -},{"./d3":10,"./lodash":24,"./util":30}],27:[function(require,module,exports){ +},{"./d3":8,"./lodash":22,"./util":28}],25:[function(require,module,exports){ "use strict"; var util = require("./util"), @@ -1185,7 +869,7 @@ function positionNodes(selection, g) { .attr("transform", translate); } -},{"./d3":10,"./util":30}],28:[function(require,module,exports){ +},{"./d3":8,"./util":28}],26:[function(require,module,exports){ var _ = require("./lodash"), layout = require("./dagre").layout; @@ -1354,7 +1038,7 @@ function createOrSelectGroup(root, name) { return selection; } -},{"./arrows":5,"./create-clusters":6,"./create-edge-labels":7,"./create-edge-paths":8,"./create-nodes":9,"./dagre":11,"./lodash":24,"./position-clusters":25,"./position-edge-labels":26,"./position-nodes":27,"./shapes":29}],29:[function(require,module,exports){ +},{"./arrows":3,"./create-clusters":4,"./create-edge-labels":5,"./create-edge-paths":6,"./create-nodes":7,"./dagre":9,"./lodash":22,"./position-clusters":23,"./position-edge-labels":24,"./position-nodes":25,"./shapes":27}],27:[function(require,module,exports){ "use strict"; var intersectRect = require("./intersect/intersect-rect"), @@ -1437,7 +1121,7 @@ function diamond(parent, bbox, node) { return shapeSvg; } -},{"./intersect/intersect-circle":14,"./intersect/intersect-ellipse":15,"./intersect/intersect-polygon":18,"./intersect/intersect-rect":19}],30:[function(require,module,exports){ +},{"./intersect/intersect-circle":12,"./intersect/intersect-ellipse":13,"./intersect/intersect-polygon":16,"./intersect/intersect-rect":17}],28:[function(require,module,exports){ var _ = require("./lodash"); // Public utility functions @@ -1493,10 +1177,2912 @@ function applyTransition(selection, g) { return selection; } -},{"./lodash":24}],31:[function(require,module,exports){ +},{"./lodash":22}],29:[function(require,module,exports){ module.exports = "0.4.10"; -},{}],32:[function(require,module,exports){ +},{}],30:[function(require,module,exports){ +/* +Copyright (c) 2012-2014 Chris Pettitt + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +module.exports = { + graphlib: require("./lib/graphlib"), + + layout: require("./lib/layout"), + debug: require("./lib/debug"), + util: { + time: require("./lib/util").time, + notime: require("./lib/util").notime + }, + version: require("./lib/version") +}; + +},{"./lib/debug":35,"./lib/graphlib":36,"./lib/layout":38,"./lib/util":58,"./lib/version":59}],31:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"), + greedyFAS = require("./greedy-fas"); + +module.exports = { + run: run, + undo: undo +}; + +function run(g) { + var fas = (g.graph().acyclicer === "greedy" + ? greedyFAS(g, weightFn(g)) + : dfsFAS(g)); + _.each(fas, function(e) { + var label = g.edge(e); + g.removeEdge(e); + label.forwardName = e.name; + label.reversed = true; + g.setEdge(e.w, e.v, label, _.uniqueId("rev")); + }); + + function weightFn(g) { + return function(e) { + return g.edge(e).weight; + }; + } +} + +function dfsFAS(g) { + var fas = [], + stack = {}, + visited = {}; + + function dfs(v) { + if (_.has(visited, v)) { + return; + } + visited[v] = true; + stack[v] = true; + _.each(g.outEdges(v), function(e) { + if (_.has(stack, e.w)) { + fas.push(e); + } else { + dfs(e.w); + } + }); + delete stack[v]; + } + + _.each(g.nodes(), dfs); + return fas; +} + +function undo(g) { + _.each(g.edges(), function(e) { + var label = g.edge(e); + if (label.reversed) { + g.removeEdge(e); + + var forwardName = label.forwardName; + delete label.reversed; + delete label.forwardName; + g.setEdge(e.w, e.v, label, forwardName); + } + }); +} + +},{"./greedy-fas":37,"./lodash":39}],32:[function(require,module,exports){ +var _ = require("./lodash"), + util = require("./util"); + +module.exports = addBorderSegments; + +function addBorderSegments(g) { + function dfs(v) { + var children = g.children(v), + node = g.node(v); + if (children.length) { + _.each(children, dfs); + } + + if (_.has(node, "minRank")) { + node.borderLeft = []; + node.borderRight = []; + for (var rank = node.minRank, maxRank = node.maxRank + 1; + rank < maxRank; + ++rank) { + addBorderNode(g, "borderLeft", "_bl", v, node, rank); + addBorderNode(g, "borderRight", "_br", v, node, rank); + } + } + } + + _.each(g.children(), dfs); +} + +function addBorderNode(g, prop, prefix, sg, sgNode, rank) { + var label = { width: 0, height: 0, rank: rank, borderType: prop }, + prev = sgNode[prop][rank - 1], + curr = util.addDummyNode(g, "border", label, prefix); + sgNode[prop][rank] = curr; + g.setParent(curr, sg); + if (prev) { + g.setEdge(prev, curr, { weight: 1 }); + } +} + +},{"./lodash":39,"./util":58}],33:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"); + +module.exports = { + adjust: adjust, + undo: undo +}; + +function adjust(g) { + var rankDir = g.graph().rankdir.toLowerCase(); + if (rankDir === "lr" || rankDir === "rl") { + swapWidthHeight(g); + } +} + +function undo(g) { + var rankDir = g.graph().rankdir.toLowerCase(); + if (rankDir === "bt" || rankDir === "rl") { + reverseY(g); + } + + if (rankDir === "lr" || rankDir === "rl") { + swapXY(g); + swapWidthHeight(g); + } +} + +function swapWidthHeight(g) { + _.each(g.nodes(), function(v) { swapWidthHeightOne(g.node(v)); }); + _.each(g.edges(), function(e) { swapWidthHeightOne(g.edge(e)); }); +} + +function swapWidthHeightOne(attrs) { + var w = attrs.width; + attrs.width = attrs.height; + attrs.height = w; +} + +function reverseY(g) { + _.each(g.nodes(), function(v) { reverseYOne(g.node(v)); }); + + _.each(g.edges(), function(e) { + var edge = g.edge(e); + _.each(edge.points, reverseYOne); + if (_.has(edge, "y")) { + reverseYOne(edge); + } + }); +} + +function reverseYOne(attrs) { + attrs.y = -attrs.y; +} + +function swapXY(g) { + _.each(g.nodes(), function(v) { swapXYOne(g.node(v)); }); + + _.each(g.edges(), function(e) { + var edge = g.edge(e); + _.each(edge.points, swapXYOne); + if (_.has(edge, "x")) { + swapXYOne(edge); + } + }); +} + +function swapXYOne(attrs) { + var x = attrs.x; + attrs.x = attrs.y; + attrs.y = x; +} + +},{"./lodash":39}],34:[function(require,module,exports){ +/* + * Simple doubly linked list implementation derived from Cormen, et al., + * "Introduction to Algorithms". + */ + +module.exports = List; + +function List() { + var sentinel = {}; + sentinel._next = sentinel._prev = sentinel; + this._sentinel = sentinel; +} + +List.prototype.dequeue = function() { + var sentinel = this._sentinel, + entry = sentinel._prev; + if (entry !== sentinel) { + unlink(entry); + return entry; + } +}; + +List.prototype.enqueue = function(entry) { + var sentinel = this._sentinel; + if (entry._prev && entry._next) { + unlink(entry); + } + entry._next = sentinel._next; + sentinel._next._prev = entry; + sentinel._next = entry; + entry._prev = sentinel; +}; + +List.prototype.toString = function() { + var strs = [], + sentinel = this._sentinel, + curr = sentinel._prev; + while (curr !== sentinel) { + strs.push(JSON.stringify(curr, filterOutLinks)); + curr = curr._prev; + } + return "[" + strs.join(", ") + "]"; +}; + +function unlink(entry) { + entry._prev._next = entry._next; + entry._next._prev = entry._prev; + delete entry._next; + delete entry._prev; +} + +function filterOutLinks(k, v) { + if (k !== "_next" && k !== "_prev") { + return v; + } +} + +},{}],35:[function(require,module,exports){ +var _ = require("./lodash"), + util = require("./util"), + Graph = require("./graphlib").Graph; + +module.exports = { + debugOrdering: debugOrdering +}; + +/* istanbul ignore next */ +function debugOrdering(g) { + var layerMatrix = util.buildLayerMatrix(g); + + var h = new Graph({ compound: true, multigraph: true }).setGraph({}); + + _.each(g.nodes(), function(v) { + h.setNode(v, { label: v }); + h.setParent(v, "layer" + g.node(v).rank); + }); + + _.each(g.edges(), function(e) { + h.setEdge(e.v, e.w, {}, e.name); + }); + + _.each(layerMatrix, function(layer, i) { + var layerV = "layer" + i; + h.setNode(layerV, { rank: "same" }); + _.reduce(layer, function(u, v) { + h.setEdge(u, v, { style: "invis" }); + return v; + }); + }); + + return h; +} + +},{"./graphlib":36,"./lodash":39,"./util":58}],36:[function(require,module,exports){ +/* global window */ + +var graphlib; + +if (typeof require === "function") { + try { + graphlib = require("graphlib"); + } catch (e) {} +} + +if (!graphlib) { + graphlib = window.graphlib; +} + +module.exports = graphlib; + +},{"graphlib":60}],37:[function(require,module,exports){ +var _ = require("./lodash"), + Graph = require("./graphlib").Graph, + List = require("./data/list"); + +/* + * A greedy heuristic for finding a feedback arc set for a graph. A feedback + * arc set is a set of edges that can be removed to make a graph acyclic. + * The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, "A fast and + * effective heuristic for the feedback arc set problem." This implementation + * adjusts that from the paper to allow for weighted edges. + */ +module.exports = greedyFAS; + +var DEFAULT_WEIGHT_FN = _.constant(1); + +function greedyFAS(g, weightFn) { + if (g.nodeCount() <= 1) { + return []; + } + var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN); + var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx); + + // Expand multi-edges + return _.flatten(_.map(results, function(e) { + return g.outEdges(e.v, e.w); + }), true); +} + +function doGreedyFAS(g, buckets, zeroIdx) { + var results = [], + sources = buckets[buckets.length - 1], + sinks = buckets[0]; + + var entry; + while (g.nodeCount()) { + while ((entry = sinks.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } + while ((entry = sources.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } + if (g.nodeCount()) { + for (var i = buckets.length - 2; i > 0; --i) { + entry = buckets[i].dequeue(); + if (entry) { + results = results.concat(removeNode(g, buckets, zeroIdx, entry, true)); + break; + } + } + } + } + + return results; +} + +function removeNode(g, buckets, zeroIdx, entry, collectPredecessors) { + var results = collectPredecessors ? [] : undefined; + + _.each(g.inEdges(entry.v), function(edge) { + var weight = g.edge(edge), + uEntry = g.node(edge.v); + + if (collectPredecessors) { + results.push({ v: edge.v, w: edge.w }); + } + + uEntry.out -= weight; + assignBucket(buckets, zeroIdx, uEntry); + }); + + _.each(g.outEdges(entry.v), function(edge) { + var weight = g.edge(edge), + w = edge.w, + wEntry = g.node(w); + wEntry["in"] -= weight; + assignBucket(buckets, zeroIdx, wEntry); + }); + + g.removeNode(entry.v); + + return results; +} + +function buildState(g, weightFn) { + var fasGraph = new Graph(), + maxIn = 0, + maxOut = 0; + + _.each(g.nodes(), function(v) { + fasGraph.setNode(v, { v: v, "in": 0, out: 0 }); + }); + + // Aggregate weights on nodes, but also sum the weights across multi-edges + // into a single edge for the fasGraph. + _.each(g.edges(), function(e) { + var prevWeight = fasGraph.edge(e.v, e.w) || 0, + weight = weightFn(e), + edgeWeight = prevWeight + weight; + fasGraph.setEdge(e.v, e.w, edgeWeight); + maxOut = Math.max(maxOut, fasGraph.node(e.v).out += weight); + maxIn = Math.max(maxIn, fasGraph.node(e.w)["in"] += weight); + }); + + var buckets = _.range(maxOut + maxIn + 3).map(function() { return new List(); }); + var zeroIdx = maxIn + 1; + + _.each(fasGraph.nodes(), function(v) { + assignBucket(buckets, zeroIdx, fasGraph.node(v)); + }); + + return { graph: fasGraph, buckets: buckets, zeroIdx: zeroIdx }; +} + +function assignBucket(buckets, zeroIdx, entry) { + if (!entry.out) { + buckets[0].enqueue(entry); + } else if (!entry["in"]) { + buckets[buckets.length - 1].enqueue(entry); + } else { + buckets[entry.out - entry["in"] + zeroIdx].enqueue(entry); + } +} + +},{"./data/list":34,"./graphlib":36,"./lodash":39}],38:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"), + acyclic = require("./acyclic"), + normalize = require("./normalize"), + rank = require("./rank"), + normalizeRanks = require("./util").normalizeRanks, + parentDummyChains = require("./parent-dummy-chains"), + removeEmptyRanks = require("./util").removeEmptyRanks, + nestingGraph = require("./nesting-graph"), + addBorderSegments = require("./add-border-segments"), + coordinateSystem = require("./coordinate-system"), + order = require("./order"), + position = require("./position"), + util = require("./util"), + Graph = require("./graphlib").Graph; + +module.exports = layout; + +function layout(g, opts) { + var time = opts && opts.debugTiming ? util.time : util.notime; + time("layout", function() { + var layoutGraph = time(" buildLayoutGraph", + function() { return buildLayoutGraph(g); }); + time(" runLayout", function() { runLayout(layoutGraph, time); }); + time(" updateInputGraph", function() { updateInputGraph(g, layoutGraph); }); + }); +} + +function runLayout(g, time) { + time(" makeSpaceForEdgeLabels", function() { makeSpaceForEdgeLabels(g); }); + time(" removeSelfEdges", function() { removeSelfEdges(g); }); + time(" acyclic", function() { acyclic.run(g); }); + time(" nestingGraph.run", function() { nestingGraph.run(g); }); + time(" rank", function() { rank(util.asNonCompoundGraph(g)); }); + time(" injectEdgeLabelProxies", function() { injectEdgeLabelProxies(g); }); + time(" removeEmptyRanks", function() { removeEmptyRanks(g); }); + time(" nestingGraph.cleanup", function() { nestingGraph.cleanup(g); }); + time(" normalizeRanks", function() { normalizeRanks(g); }); + time(" assignRankMinMax", function() { assignRankMinMax(g); }); + time(" removeEdgeLabelProxies", function() { removeEdgeLabelProxies(g); }); + time(" normalize.run", function() { normalize.run(g); }); + time(" parentDummyChains", function() { parentDummyChains(g); }); + time(" addBorderSegments", function() { addBorderSegments(g); }); + time(" order", function() { order(g); }); + time(" insertSelfEdges", function() { insertSelfEdges(g); }); + time(" adjustCoordinateSystem", function() { coordinateSystem.adjust(g); }); + time(" position", function() { position(g); }); + time(" positionSelfEdges", function() { positionSelfEdges(g); }); + time(" removeBorderNodes", function() { removeBorderNodes(g); }); + time(" normalize.undo", function() { normalize.undo(g); }); + time(" fixupEdgeLabelCoords", function() { fixupEdgeLabelCoords(g); }); + time(" undoCoordinateSystem", function() { coordinateSystem.undo(g); }); + time(" translateGraph", function() { translateGraph(g); }); + time(" assignNodeIntersects", function() { assignNodeIntersects(g); }); + time(" reversePoints", function() { reversePointsForReversedEdges(g); }); + time(" acyclic.undo", function() { acyclic.undo(g); }); +} + +/* + * Copies final layout information from the layout graph back to the input + * graph. This process only copies whitelisted attributes from the layout graph + * to the input graph, so it serves as a good place to determine what + * attributes can influence layout. + */ +function updateInputGraph(inputGraph, layoutGraph) { + _.each(inputGraph.nodes(), function(v) { + var inputLabel = inputGraph.node(v), + layoutLabel = layoutGraph.node(v); + + if (inputLabel) { + inputLabel.x = layoutLabel.x; + inputLabel.y = layoutLabel.y; + + if (layoutGraph.children(v).length) { + inputLabel.width = layoutLabel.width; + inputLabel.height = layoutLabel.height; + } + } + }); + + _.each(inputGraph.edges(), function(e) { + var inputLabel = inputGraph.edge(e), + layoutLabel = layoutGraph.edge(e); + + inputLabel.points = layoutLabel.points; + if (_.has(layoutLabel, "x")) { + inputLabel.x = layoutLabel.x; + inputLabel.y = layoutLabel.y; + } + }); + + inputGraph.graph().width = layoutGraph.graph().width; + inputGraph.graph().height = layoutGraph.graph().height; +} + +var graphNumAttrs = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], + graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, + graphAttrs = ["acyclicer", "ranker", "rankdir", "align"], + nodeNumAttrs = ["width", "height"], + nodeDefaults = { width: 0, height: 0 }, + edgeNumAttrs = ["minlen", "weight", "width", "height", "labeloffset"], + edgeDefaults = { + minlen: 1, weight: 1, width: 0, height: 0, + labeloffset: 10, labelpos: "r" + }, + edgeAttrs = ["labelpos"]; + +/* + * Constructs a new graph from the input graph, which can be used for layout. + * This process copies only whitelisted attributes from the input graph to the + * layout graph. Thus this function serves as a good place to determine what + * attributes can influence layout. + */ +function buildLayoutGraph(inputGraph) { + var g = new Graph({ multigraph: true, compound: true }), + graph = canonicalize(inputGraph.graph()); + + g.setGraph(_.merge({}, + graphDefaults, + selectNumberAttrs(graph, graphNumAttrs), + _.pick(graph, graphAttrs))); + + _.each(inputGraph.nodes(), function(v) { + var node = canonicalize(inputGraph.node(v)); + g.setNode(v, _.defaults(selectNumberAttrs(node, nodeNumAttrs), nodeDefaults)); + g.setParent(v, inputGraph.parent(v)); + }); + + _.each(inputGraph.edges(), function(e) { + var edge = canonicalize(inputGraph.edge(e)); + g.setEdge(e, _.merge({}, + edgeDefaults, + selectNumberAttrs(edge, edgeNumAttrs), + _.pick(edge, edgeAttrs))); + }); + + return g; +} + +/* + * This idea comes from the Gansner paper: to account for edge labels in our + * layout we split each rank in half by doubling minlen and halving ranksep. + * Then we can place labels at these mid-points between nodes. + * + * We also add some minimal padding to the width to push the label for the edge + * away from the edge itself a bit. + */ +function makeSpaceForEdgeLabels(g) { + var graph = g.graph(); + graph.ranksep /= 2; + _.each(g.edges(), function(e) { + var edge = g.edge(e); + edge.minlen *= 2; + if (edge.labelpos.toLowerCase() !== "c") { + if (graph.rankdir === "TB" || graph.rankdir === "BT") { + edge.width += edge.labeloffset; + } else { + edge.height += edge.labeloffset; + } + } + }); +} + +/* + * Creates temporary dummy nodes that capture the rank in which each edge's + * label is going to, if it has one of non-zero width and height. We do this + * so that we can safely remove empty ranks while preserving balance for the + * label's position. + */ +function injectEdgeLabelProxies(g) { + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (edge.width && edge.height) { + var v = g.node(e.v), + w = g.node(e.w), + label = { rank: (w.rank - v.rank) / 2 + v.rank, e: e }; + util.addDummyNode(g, "edge-proxy", label, "_ep"); + } + }); +} + +function assignRankMinMax(g) { + var maxRank = 0; + _.each(g.nodes(), function(v) { + var node = g.node(v); + if (node.borderTop) { + node.minRank = g.node(node.borderTop).rank; + node.maxRank = g.node(node.borderBottom).rank; + maxRank = _.max(maxRank, node.maxRank); + } + }); + g.graph().maxRank = maxRank; +} + +function removeEdgeLabelProxies(g) { + _.each(g.nodes(), function(v) { + var node = g.node(v); + if (node.dummy === "edge-proxy") { + g.edge(node.e).labelRank = node.rank; + g.removeNode(v); + } + }); +} + +function translateGraph(g) { + var minX = Number.POSITIVE_INFINITY, + maxX = 0, + minY = Number.POSITIVE_INFINITY, + maxY = 0, + graphLabel = g.graph(), + marginX = graphLabel.marginx || 0, + marginY = graphLabel.marginy || 0; + + function getExtremes(attrs) { + var x = attrs.x, + y = attrs.y, + w = attrs.width, + h = attrs.height; + minX = Math.min(minX, x - w / 2); + maxX = Math.max(maxX, x + w / 2); + minY = Math.min(minY, y - h / 2); + maxY = Math.max(maxY, y + h / 2); + } + + _.each(g.nodes(), function(v) { getExtremes(g.node(v)); }); + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (_.has(edge, "x")) { + getExtremes(edge); + } + }); + + minX -= marginX; + minY -= marginY; + + _.each(g.nodes(), function(v) { + var node = g.node(v); + node.x -= minX; + node.y -= minY; + }); + + _.each(g.edges(), function(e) { + var edge = g.edge(e); + _.each(edge.points, function(p) { + p.x -= minX; + p.y -= minY; + }); + if (_.has(edge, "x")) { edge.x -= minX; } + if (_.has(edge, "y")) { edge.y -= minY; } + }); + + graphLabel.width = maxX - minX + marginX; + graphLabel.height = maxY - minY + marginY; +} + +function assignNodeIntersects(g) { + _.each(g.edges(), function(e) { + var edge = g.edge(e), + nodeV = g.node(e.v), + nodeW = g.node(e.w), + p1, p2; + if (!edge.points) { + edge.points = []; + p1 = nodeW; + p2 = nodeV; + } else { + p1 = edge.points[0]; + p2 = edge.points[edge.points.length - 1]; + } + edge.points.unshift(util.intersectRect(nodeV, p1)); + edge.points.push(util.intersectRect(nodeW, p2)); + }); +} + +function fixupEdgeLabelCoords(g) { + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (_.has(edge, "x")) { + if (edge.labelpos === "l" || edge.labelpos === "r") { + edge.width -= edge.labeloffset; + } + switch (edge.labelpos) { + case "l": edge.x -= edge.width / 2 + edge.labeloffset; break; + case "r": edge.x += edge.width / 2 + edge.labeloffset; break; + } + } + }); +} + +function reversePointsForReversedEdges(g) { + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (edge.reversed) { + edge.points.reverse(); + } + }); +} + +function removeBorderNodes(g) { + _.each(g.nodes(), function(v) { + if (g.children(v).length) { + var node = g.node(v), + t = g.node(node.borderTop), + b = g.node(node.borderBottom), + l = g.node(_.last(node.borderLeft)), + r = g.node(_.last(node.borderRight)); + + node.width = Math.abs(r.x - l.x); + node.height = Math.abs(b.y - t.y); + node.x = l.x + node.width / 2; + node.y = t.y + node.height / 2; + } + }); + + _.each(g.nodes(), function(v) { + if (g.node(v).dummy === "border") { + g.removeNode(v); + } + }); +} + +function removeSelfEdges(g) { + _.each(g.edges(), function(e) { + if (e.v === e.w) { + var node = g.node(e.v); + if (!node.selfEdges) { + node.selfEdges = []; + } + node.selfEdges.push({ e: e, label: g.edge(e) }); + g.removeEdge(e); + } + }); +} + +function insertSelfEdges(g) { + var layers = util.buildLayerMatrix(g); + _.each(layers, function(layer) { + var orderShift = 0; + _.each(layer, function(v, i) { + var node = g.node(v); + node.order = i + orderShift; + _.each(node.selfEdges, function(selfEdge) { + util.addDummyNode(g, "selfedge", { + width: selfEdge.label.width, + height: selfEdge.label.height, + rank: node.rank, + order: i + (++orderShift), + e: selfEdge.e, + label: selfEdge.label + }, "_se"); + }); + delete node.selfEdges; + }); + }); +} + +function positionSelfEdges(g) { + _.each(g.nodes(), function(v) { + var node = g.node(v); + if (node.dummy === "selfedge") { + var selfNode = g.node(node.e.v), + x = selfNode.x + selfNode.width / 2, + y = selfNode.y, + dx = node.x - x, + dy = selfNode.height / 2; + g.setEdge(node.e, node.label); + g.removeNode(v); + node.label.points = [ + { x: x + 2 * dx / 3, y: y - dy }, + { x: x + 5 * dx / 6, y: y - dy }, + { x: x + dx , y: y }, + { x: x + 5 * dx / 6, y: y + dy }, + { x: x + 2 * dx / 3, y: y + dy }, + ]; + node.label.x = node.x; + node.label.y = node.y; + } + }); +} + +function selectNumberAttrs(obj, attrs) { + return _.mapValues(_.pick(obj, attrs), Number); +} + +function canonicalize(attrs) { + var newAttrs = {}; + _.each(attrs, function(v, k) { + newAttrs[k.toLowerCase()] = v; + }); + return newAttrs; +} + +},{"./acyclic":31,"./add-border-segments":32,"./coordinate-system":33,"./graphlib":36,"./lodash":39,"./nesting-graph":40,"./normalize":41,"./order":46,"./parent-dummy-chains":51,"./position":53,"./rank":55,"./util":58}],39:[function(require,module,exports){ +/* global window */ + +var lodash; + +if (typeof require === "function") { + try { + lodash = require("lodash"); + } catch (e) {} +} + +if (!lodash) { + lodash = window._; +} + +module.exports = lodash; + +},{"lodash":81}],40:[function(require,module,exports){ +var _ = require("./lodash"), + util = require("./util"); + +module.exports = { + run: run, + cleanup: cleanup +}; + +/* + * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs, + * adds appropriate edges to ensure that all cluster nodes are placed between + * these boundries, and ensures that the graph is connected. + * + * In addition we ensure, through the use of the minlen property, that nodes + * and subgraph border nodes to not end up on the same rank. + * + * Preconditions: + * + * 1. Input graph is a DAG + * 2. Nodes in the input graph has a minlen attribute + * + * Postconditions: + * + * 1. Input graph is connected. + * 2. Dummy nodes are added for the tops and bottoms of subgraphs. + * 3. The minlen attribute for nodes is adjusted to ensure nodes do not + * get placed on the same rank as subgraph border nodes. + * + * The nesting graph idea comes from Sander, "Layout of Compound Directed + * Graphs." + */ +function run(g) { + var root = util.addDummyNode(g, "root", {}, "_root"), + depths = treeDepths(g), + height = _.max(depths) - 1, + nodeSep = 2 * height + 1; + + g.graph().nestingRoot = root; + + // Multiply minlen by nodeSep to align nodes on non-border ranks. + _.each(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; }); + + // Calculate a weight that is sufficient to keep subgraphs vertically compact + var weight = sumWeights(g) + 1; + + // Create border nodes and link them up + _.each(g.children(), function(child) { + dfs(g, root, nodeSep, weight, height, depths, child); + }); + + // Save the multiplier for node layers for later removal of empty border + // layers. + g.graph().nodeRankFactor = nodeSep; +} + +function dfs(g, root, nodeSep, weight, height, depths, v) { + var children = g.children(v); + if (!children.length) { + if (v !== root) { + g.setEdge(root, v, { weight: 0, minlen: nodeSep }); + } + return; + } + + var top = util.addBorderNode(g, "_bt"), + bottom = util.addBorderNode(g, "_bb"), + label = g.node(v); + + g.setParent(top, v); + label.borderTop = top; + g.setParent(bottom, v); + label.borderBottom = bottom; + + _.each(children, function(child) { + dfs(g, root, nodeSep, weight, height, depths, child); + + var childNode = g.node(child), + childTop = childNode.borderTop ? childNode.borderTop : child, + childBottom = childNode.borderBottom ? childNode.borderBottom : child, + thisWeight = childNode.borderTop ? weight : 2 * weight, + minlen = childTop !== childBottom ? 1 : height - depths[v] + 1; + + g.setEdge(top, childTop, { + weight: thisWeight, + minlen: minlen, + nestingEdge: true + }); + + g.setEdge(childBottom, bottom, { + weight: thisWeight, + minlen: minlen, + nestingEdge: true + }); + }); + + if (!g.parent(v)) { + g.setEdge(root, top, { weight: 0, minlen: height + depths[v] }); + } +} + +function treeDepths(g) { + var depths = {}; + function dfs(v, depth) { + var children = g.children(v); + if (children && children.length) { + _.each(children, function(child) { + dfs(child, depth + 1); + }); + } + depths[v] = depth; + } + _.each(g.children(), function(v) { dfs(v, 1); }); + return depths; +} + +function sumWeights(g) { + return _.reduce(g.edges(), function(acc, e) { + return acc + g.edge(e).weight; + }, 0); +} + +function cleanup(g) { + var graphLabel = g.graph(); + g.removeNode(graphLabel.nestingRoot); + delete graphLabel.nestingRoot; + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (edge.nestingEdge) { + g.removeEdge(e); + } + }); +} + +},{"./lodash":39,"./util":58}],41:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"), + util = require("./util"); + +module.exports = { + run: run, + undo: undo +}; + +/* + * Breaks any long edges in the graph into short segments that span 1 layer + * each. This operation is undoable with the denormalize function. + * + * Pre-conditions: + * + * 1. The input graph is a DAG. + * 2. Each node in the graph has a "rank" property. + * + * Post-condition: + * + * 1. All edges in the graph have a length of 1. + * 2. Dummy nodes are added where edges have been split into segments. + * 3. The graph is augmented with a "dummyChains" attribute which contains + * the first dummy in each chain of dummy nodes produced. + */ +function run(g) { + g.graph().dummyChains = []; + _.each(g.edges(), function(edge) { normalizeEdge(g, edge); }); +} + +function normalizeEdge(g, e) { + var v = e.v, + vRank = g.node(v).rank, + w = e.w, + wRank = g.node(w).rank, + name = e.name, + edgeLabel = g.edge(e), + labelRank = edgeLabel.labelRank; + + if (wRank === vRank + 1) return; + + g.removeEdge(e); + + var dummy, attrs, i; + for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) { + edgeLabel.points = []; + attrs = { + width: 0, height: 0, + edgeLabel: edgeLabel, edgeObj: e, + rank: vRank + }; + dummy = util.addDummyNode(g, "edge", attrs, "_d"); + if (vRank === labelRank) { + attrs.width = edgeLabel.width; + attrs.height = edgeLabel.height; + attrs.dummy = "edge-label"; + attrs.labelpos = edgeLabel.labelpos; + } + g.setEdge(v, dummy, { weight: edgeLabel.weight }, name); + if (i === 0) { + g.graph().dummyChains.push(dummy); + } + v = dummy; + } + + g.setEdge(v, w, { weight: edgeLabel.weight }, name); +} + +function undo(g) { + _.each(g.graph().dummyChains, function(v) { + var node = g.node(v), + origLabel = node.edgeLabel, + w; + g.setEdge(node.edgeObj, origLabel); + while (node.dummy) { + w = g.successors(v)[0]; + g.removeNode(v); + origLabel.points.push({ x: node.x, y: node.y }); + if (node.dummy === "edge-label") { + origLabel.x = node.x; + origLabel.y = node.y; + origLabel.width = node.width; + origLabel.height = node.height; + } + v = w; + node = g.node(v); + } + }); +} + +},{"./lodash":39,"./util":58}],42:[function(require,module,exports){ +var _ = require("../lodash"); + +module.exports = addSubgraphConstraints; + +function addSubgraphConstraints(g, cg, vs) { + var prev = {}, + rootPrev; + + _.each(vs, function(v) { + var child = g.parent(v), + parent, + prevChild; + while (child) { + parent = g.parent(child); + if (parent) { + prevChild = prev[parent]; + prev[parent] = child; + } else { + prevChild = rootPrev; + rootPrev = child; + } + if (prevChild && prevChild !== child) { + cg.setEdge(prevChild, child); + return; + } + child = parent; + } + }); + + /* + function dfs(v) { + var children = v ? g.children(v) : g.children(); + if (children.length) { + var min = Number.POSITIVE_INFINITY, + subgraphs = []; + _.each(children, function(child) { + var childMin = dfs(child); + if (g.children(child).length) { + subgraphs.push({ v: child, order: childMin }); + } + min = Math.min(min, childMin); + }); + _.reduce(_.sortBy(subgraphs, "order"), function(prev, curr) { + cg.setEdge(prev.v, curr.v); + return curr; + }); + return min; + } + return g.node(v).order; + } + dfs(undefined); + */ +} + +},{"../lodash":39}],43:[function(require,module,exports){ +var _ = require("../lodash"); + +module.exports = barycenter; + +function barycenter(g, movable) { + return _.map(movable, function(v) { + var inV = g.inEdges(v); + if (!inV.length) { + return { v: v }; + } else { + var result = _.reduce(inV, function(acc, e) { + var edge = g.edge(e), + nodeU = g.node(e.v); + return { + sum: acc.sum + (edge.weight * nodeU.order), + weight: acc.weight + edge.weight + }; + }, { sum: 0, weight: 0 }); + + return { + v: v, + barycenter: result.sum / result.weight, + weight: result.weight + }; + } + }); +} + + +},{"../lodash":39}],44:[function(require,module,exports){ +var _ = require("../lodash"), + Graph = require("../graphlib").Graph; + +module.exports = buildLayerGraph; + +/* + * Constructs a graph that can be used to sort a layer of nodes. The graph will + * contain all base and subgraph nodes from the request layer in their original + * hierarchy and any edges that are incident on these nodes and are of the type + * requested by the "relationship" parameter. + * + * Nodes from the requested rank that do not have parents are assigned a root + * node in the output graph, which is set in the root graph attribute. This + * makes it easy to walk the hierarchy of movable nodes during ordering. + * + * Pre-conditions: + * + * 1. Input graph is a DAG + * 2. Base nodes in the input graph have a rank attribute + * 3. Subgraph nodes in the input graph has minRank and maxRank attributes + * 4. Edges have an assigned weight + * + * Post-conditions: + * + * 1. Output graph has all nodes in the movable rank with preserved + * hierarchy. + * 2. Root nodes in the movable layer are made children of the node + * indicated by the root attribute of the graph. + * 3. Non-movable nodes incident on movable nodes, selected by the + * relationship parameter, are included in the graph (without hierarchy). + * 4. Edges incident on movable nodes, selected by the relationship + * parameter, are added to the output graph. + * 5. The weights for copied edges are aggregated as need, since the output + * graph is not a multi-graph. + */ +function buildLayerGraph(g, rank, relationship) { + var root = createRootNode(g), + result = new Graph({ compound: true }).setGraph({ root: root }) + .setDefaultNodeLabel(function(v) { return g.node(v); }); + + _.each(g.nodes(), function(v) { + var node = g.node(v), + parent = g.parent(v); + + if (node.rank === rank || node.minRank <= rank && rank <= node.maxRank) { + result.setNode(v); + result.setParent(v, parent || root); + + // This assumes we have only short edges! + _.each(g[relationship](v), function(e) { + var u = e.v === v ? e.w : e.v, + edge = result.edge(u, v), + weight = !_.isUndefined(edge) ? edge.weight : 0; + result.setEdge(u, v, { weight: g.edge(e).weight + weight }); + }); + + if (_.has(node, "minRank")) { + result.setNode(v, { + borderLeft: node.borderLeft[rank], + borderRight: node.borderRight[rank] + }); + } + } + }); + + return result; +} + +function createRootNode(g) { + var v; + while (g.hasNode((v = _.uniqueId("_root")))); + return v; +} + +},{"../graphlib":36,"../lodash":39}],45:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"); + +module.exports = crossCount; + +/* + * A function that takes a layering (an array of layers, each with an array of + * ordererd nodes) and a graph and returns a weighted crossing count. + * + * Pre-conditions: + * + * 1. Input graph must be simple (not a multigraph), directed, and include + * only simple edges. + * 2. Edges in the input graph must have assigned weights. + * + * Post-conditions: + * + * 1. The graph and layering matrix are left unchanged. + * + * This algorithm is derived from Barth, et al., "Bilayer Cross Counting." + */ +function crossCount(g, layering) { + var cc = 0; + for (var i = 1; i < layering.length; ++i) { + cc += twoLayerCrossCount(g, layering[i-1], layering[i]); + } + return cc; +} + +function twoLayerCrossCount(g, northLayer, southLayer) { + // Sort all of the edges between the north and south layers by their position + // in the north layer and then the south. Map these edges to the position of + // their head in the south layer. + var southPos = _.zipObject(southLayer, + _.map(southLayer, function (v, i) { return i; })); + var southEntries = _.flatten(_.map(northLayer, function(v) { + return _.chain(g.outEdges(v)) + .map(function(e) { + return { pos: southPos[e.w], weight: g.edge(e).weight }; + }) + .sortBy("pos") + .value(); + }), true); + + // Build the accumulator tree + var firstIndex = 1; + while (firstIndex < southLayer.length) firstIndex <<= 1; + var treeSize = 2 * firstIndex - 1; + firstIndex -= 1; + var tree = _.map(new Array(treeSize), function() { return 0; }); + + // Calculate the weighted crossings + var cc = 0; + _.each(southEntries.forEach(function(entry) { + var index = entry.pos + firstIndex; + tree[index] += entry.weight; + var weightSum = 0; + while (index > 0) { + if (index % 2) { + weightSum += tree[index + 1]; + } + index = (index - 1) >> 1; + tree[index] += entry.weight; + } + cc += entry.weight * weightSum; + })); + + return cc; +} + +},{"../lodash":39}],46:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + initOrder = require("./init-order"), + crossCount = require("./cross-count"), + sortSubgraph = require("./sort-subgraph"), + buildLayerGraph = require("./build-layer-graph"), + addSubgraphConstraints = require("./add-subgraph-constraints"), + Graph = require("../graphlib").Graph, + util = require("../util"); + +module.exports = order; + +/* + * Applies heuristics to minimize edge crossings in the graph and sets the best + * order solution as an order attribute on each node. + * + * Pre-conditions: + * + * 1. Graph must be DAG + * 2. Graph nodes must be objects with a "rank" attribute + * 3. Graph edges must have the "weight" attribute + * + * Post-conditions: + * + * 1. Graph nodes will have an "order" attribute based on the results of the + * algorithm. + */ +function order(g) { + var maxRank = util.maxRank(g), + downLayerGraphs = buildLayerGraphs(g, _.range(1, maxRank + 1), "inEdges"), + upLayerGraphs = buildLayerGraphs(g, _.range(maxRank - 1, -1, -1), "outEdges"); + + var layering = initOrder(g); + assignOrder(g, layering); + + var bestCC = Number.POSITIVE_INFINITY, + best; + + for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) { + sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2); + + layering = util.buildLayerMatrix(g); + var cc = crossCount(g, layering); + if (cc < bestCC) { + lastBest = 0; + best = _.cloneDeep(layering); + bestCC = cc; + } + } + + assignOrder(g, best); +} + +function buildLayerGraphs(g, ranks, relationship) { + return _.map(ranks, function(rank) { + return buildLayerGraph(g, rank, relationship); + }); +} + +function sweepLayerGraphs(layerGraphs, biasRight) { + var cg = new Graph(); + _.each(layerGraphs, function(lg) { + var root = lg.graph().root; + var sorted = sortSubgraph(lg, root, cg, biasRight); + _.each(sorted.vs, function(v, i) { + lg.node(v).order = i; + }); + addSubgraphConstraints(lg, cg, sorted.vs); + }); +} + +function assignOrder(g, layering) { + _.each(layering, function(layer) { + _.each(layer, function(v, i) { + g.node(v).order = i; + }); + }); +} + +},{"../graphlib":36,"../lodash":39,"../util":58,"./add-subgraph-constraints":42,"./build-layer-graph":44,"./cross-count":45,"./init-order":47,"./sort-subgraph":49}],47:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"); + +module.exports = initOrder; + +/* + * Assigns an initial order value for each node by performing a DFS search + * starting from nodes in the first rank. Nodes are assigned an order in their + * rank as they are first visited. + * + * This approach comes from Gansner, et al., "A Technique for Drawing Directed + * Graphs." + * + * Returns a layering matrix with an array per layer and each layer sorted by + * the order of its nodes. + */ +function initOrder(g) { + var visited = {}, + simpleNodes = _.filter(g.nodes(), function(v) { + return !g.children(v).length; + }), + maxRank = _.max(_.map(simpleNodes, function(v) { return g.node(v).rank; })), + layers = _.map(_.range(maxRank + 1), function() { return []; }); + + function dfs(v) { + if (_.has(visited, v)) return; + visited[v] = true; + var node = g.node(v); + layers[node.rank].push(v); + _.each(g.successors(v), dfs); + } + + var orderedVs = _.sortBy(simpleNodes, function(v) { return g.node(v).rank; }); + _.each(orderedVs, dfs); + + return layers; +} + +},{"../lodash":39}],48:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"); + +module.exports = resolveConflicts; + +/* + * Given a list of entries of the form {v, barycenter, weight} and a + * constraint graph this function will resolve any conflicts between the + * constraint graph and the barycenters for the entries. If the barycenters for + * an entry would violate a constraint in the constraint graph then we coalesce + * the nodes in the conflict into a new node that respects the contraint and + * aggregates barycenter and weight information. + * + * This implementation is based on the description in Forster, "A Fast and + * Simple Hueristic for Constrained Two-Level Crossing Reduction," thought it + * differs in some specific details. + * + * Pre-conditions: + * + * 1. Each entry has the form {v, barycenter, weight}, or if the node has + * no barycenter, then {v}. + * + * Returns: + * + * A new list of entries of the form {vs, i, barycenter, weight}. The list + * `vs` may either be a singleton or it may be an aggregation of nodes + * ordered such that they do not violate constraints from the constraint + * graph. The property `i` is the lowest original index of any of the + * elements in `vs`. + */ +function resolveConflicts(entries, cg) { + var mappedEntries = {}; + _.each(entries, function(entry, i) { + var tmp = mappedEntries[entry.v] = { + indegree: 0, + "in": [], + out: [], + vs: [entry.v], + i: i + }; + if (!_.isUndefined(entry.barycenter)) { + tmp.barycenter = entry.barycenter; + tmp.weight = entry.weight; + } + }); + + _.each(cg.edges(), function(e) { + var entryV = mappedEntries[e.v], + entryW = mappedEntries[e.w]; + if (!_.isUndefined(entryV) && !_.isUndefined(entryW)) { + entryW.indegree++; + entryV.out.push(mappedEntries[e.w]); + } + }); + + var sourceSet = _.filter(mappedEntries, function(entry) { + return !entry.indegree; + }); + + return doResolveConflicts(sourceSet); +} + +function doResolveConflicts(sourceSet) { + var entries = []; + + function handleIn(vEntry) { + return function(uEntry) { + if (uEntry.merged) { + return; + } + if (_.isUndefined(uEntry.barycenter) || + _.isUndefined(vEntry.barycenter) || + uEntry.barycenter >= vEntry.barycenter) { + mergeEntries(vEntry, uEntry); + } + }; + } + + function handleOut(vEntry) { + return function(wEntry) { + wEntry["in"].push(vEntry); + if (--wEntry.indegree === 0) { + sourceSet.push(wEntry); + } + }; + } + + while (sourceSet.length) { + var entry = sourceSet.pop(); + entries.push(entry); + _.each(entry["in"].reverse(), handleIn(entry)); + _.each(entry.out, handleOut(entry)); + } + + return _.chain(entries) + .filter(function(entry) { return !entry.merged; }) + .map(function(entry) { + return _.pick(entry, ["vs", "i", "barycenter", "weight"]); + }) + .value(); +} + +function mergeEntries(target, source) { + var sum = 0, + weight = 0; + + if (target.weight) { + sum += target.barycenter * target.weight; + weight += target.weight; + } + + if (source.weight) { + sum += source.barycenter * source.weight; + weight += source.weight; + } + + target.vs = source.vs.concat(target.vs); + target.barycenter = sum / weight; + target.weight = weight; + target.i = Math.min(source.i, target.i); + source.merged = true; +} + +},{"../lodash":39}],49:[function(require,module,exports){ +var _ = require("../lodash"), + barycenter = require("./barycenter"), + resolveConflicts = require("./resolve-conflicts"), + sort = require("./sort"); + +module.exports = sortSubgraph; + +function sortSubgraph(g, v, cg, biasRight) { + var movable = g.children(v), + node = g.node(v), + bl = node ? node.borderLeft : undefined, + br = node ? node.borderRight: undefined, + subgraphs = {}; + + if (bl) { + movable = _.filter(movable, function(w) { + return w !== bl && w !== br; + }); + } + + var barycenters = barycenter(g, movable); + _.each(barycenters, function(entry) { + if (g.children(entry.v).length) { + var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight); + subgraphs[entry.v] = subgraphResult; + if (_.has(subgraphResult, "barycenter")) { + mergeBarycenters(entry, subgraphResult); + } + } + }); + + var entries = resolveConflicts(barycenters, cg); + expandSubgraphs(entries, subgraphs); + + var result = sort(entries, biasRight); + + if (bl) { + result.vs = _.flatten([bl, result.vs, br], true); + if (g.predecessors(bl).length) { + var blPred = g.node(g.predecessors(bl)[0]), + brPred = g.node(g.predecessors(br)[0]); + if (!_.has(result, "barycenter")) { + result.barycenter = 0; + result.weight = 0; + } + result.barycenter = (result.barycenter * result.weight + + blPred.order + brPred.order) / (result.weight + 2); + result.weight += 2; + } + } + + return result; +} + +function expandSubgraphs(entries, subgraphs) { + _.each(entries, function(entry) { + entry.vs = _.flatten(entry.vs.map(function(v) { + if (subgraphs[v]) { + return subgraphs[v].vs; + } + return v; + }), true); + }); +} + +function mergeBarycenters(target, other) { + if (!_.isUndefined(target.barycenter)) { + target.barycenter = (target.barycenter * target.weight + + other.barycenter * other.weight) / + (target.weight + other.weight); + target.weight += other.weight; + } else { + target.barycenter = other.barycenter; + target.weight = other.weight; + } +} + +},{"../lodash":39,"./barycenter":43,"./resolve-conflicts":48,"./sort":50}],50:[function(require,module,exports){ +var _ = require("../lodash"), + util = require("../util"); + +module.exports = sort; + +function sort(entries, biasRight) { + var parts = util.partition(entries, function(entry) { + return _.has(entry, "barycenter"); + }); + var sortable = parts.lhs, + unsortable = _.sortBy(parts.rhs, function(entry) { return -entry.i; }), + vs = [], + sum = 0, + weight = 0, + vsIndex = 0; + + sortable.sort(compareWithBias(!!biasRight)); + + vsIndex = consumeUnsortable(vs, unsortable, vsIndex); + + _.each(sortable, function (entry) { + vsIndex += entry.vs.length; + vs.push(entry.vs); + sum += entry.barycenter * entry.weight; + weight += entry.weight; + vsIndex = consumeUnsortable(vs, unsortable, vsIndex); + }); + + var result = { vs: _.flatten(vs, true) }; + if (weight) { + result.barycenter = sum / weight; + result.weight = weight; + } + return result; +} + +function consumeUnsortable(vs, unsortable, index) { + var last; + while (unsortable.length && (last = _.last(unsortable)).i <= index) { + unsortable.pop(); + vs.push(last.vs); + index++; + } + return index; +} + +function compareWithBias(bias) { + return function(entryV, entryW) { + if (entryV.barycenter < entryW.barycenter) { + return -1; + } else if (entryV.barycenter > entryW.barycenter) { + return 1; + } + + return !bias ? entryV.i - entryW.i : entryW.i - entryV.i; + }; +} + +},{"../lodash":39,"../util":58}],51:[function(require,module,exports){ +var _ = require("./lodash"); + +module.exports = parentDummyChains; + +function parentDummyChains(g) { + var postorderNums = postorder(g); + + _.each(g.graph().dummyChains, function(v) { + var node = g.node(v), + edgeObj = node.edgeObj, + pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w), + path = pathData.path, + lca = pathData.lca, + pathIdx = 0, + pathV = path[pathIdx], + ascending = true; + + while (v !== edgeObj.w) { + node = g.node(v); + + if (ascending) { + while ((pathV = path[pathIdx]) !== lca && + g.node(pathV).maxRank < node.rank) { + pathIdx++; + } + + if (pathV === lca) { + ascending = false; + } + } + + if (!ascending) { + while (pathIdx < path.length - 1 && + g.node(pathV = path[pathIdx + 1]).minRank <= node.rank) { + pathIdx++; + } + pathV = path[pathIdx]; + } + + g.setParent(v, pathV); + v = g.successors(v)[0]; + } + }); +} + +// Find a path from v to w through the lowest common ancestor (LCA). Return the +// full path and the LCA. +function findPath(g, postorderNums, v, w) { + var vPath = [], + wPath = [], + low = Math.min(postorderNums[v].low, postorderNums[w].low), + lim = Math.max(postorderNums[v].lim, postorderNums[w].lim), + parent, + lca; + + // Traverse up from v to find the LCA + parent = v; + do { + parent = g.parent(parent); + vPath.push(parent); + } while (parent && + (postorderNums[parent].low > low || lim > postorderNums[parent].lim)); + lca = parent; + + // Traverse from w to LCA + parent = w; + while ((parent = g.parent(parent)) !== lca) { + wPath.push(parent); + } + + return { path: vPath.concat(wPath.reverse()), lca: lca }; +} + +function postorder(g) { + var result = {}, + lim = 0; + + function dfs(v) { + var low = lim; + _.each(g.children(v), dfs); + result[v] = { low: low, lim: lim++ }; + } + _.each(g.children(), dfs); + + return result; +} + +},{"./lodash":39}],52:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + Graph = require("../graphlib").Graph, + util = require("../util"); + +/* + * This module provides coordinate assignment based on Brandes and Köpf, "Fast + * and Simple Horizontal Coordinate Assignment." + */ + +module.exports = { + positionX: positionX, + findType1Conflicts: findType1Conflicts, + findType2Conflicts: findType2Conflicts, + addConflict: addConflict, + hasConflict: hasConflict, + verticalAlignment: verticalAlignment, + horizontalCompaction: horizontalCompaction, + alignCoordinates: alignCoordinates, + findSmallestWidthAlignment: findSmallestWidthAlignment, + balance: balance +}; + +/* + * Marks all edges in the graph with a type-1 conflict with the "type1Conflict" + * property. A type-1 conflict is one where a non-inner segment crosses an + * inner segment. An inner segment is an edge with both incident nodes marked + * with the "dummy" property. + * + * This algorithm scans layer by layer, starting with the second, for type-1 + * conflicts between the current layer and the previous layer. For each layer + * it scans the nodes from left to right until it reaches one that is incident + * on an inner segment. It then scans predecessors to determine if they have + * edges that cross that inner segment. At the end a final scan is done for all + * nodes on the current rank to see if they cross the last visited inner + * segment. + * + * This algorithm (safely) assumes that a dummy node will only be incident on a + * single node in the layers being scanned. + */ +function findType1Conflicts(g, layering) { + var conflicts = {}; + + function visitLayer(prevLayer, layer) { + var + // last visited node in the previous layer that is incident on an inner + // segment. + k0 = 0, + // Tracks the last node in this layer scanned for crossings with a type-1 + // segment. + scanPos = 0, + prevLayerLength = prevLayer.length, + lastNode = _.last(layer); + + _.each(layer, function(v, i) { + var w = findOtherInnerSegmentNode(g, v), + k1 = w ? g.node(w).order : prevLayerLength; + + if (w || v === lastNode) { + _.each(layer.slice(scanPos, i +1), function(scanNode) { + _.each(g.predecessors(scanNode), function(u) { + var uLabel = g.node(u), + uPos = uLabel.order; + if ((uPos < k0 || k1 < uPos) && + !(uLabel.dummy && g.node(scanNode).dummy)) { + addConflict(conflicts, u, scanNode); + } + }); + }); + scanPos = i + 1; + k0 = k1; + } + }); + + return layer; + } + + _.reduce(layering, visitLayer); + return conflicts; +} + +function findType2Conflicts(g, layering) { + var conflicts = {}; + + function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) { + var v; + _.each(_.range(southPos, southEnd), function(i) { + v = south[i]; + if (g.node(v).dummy) { + _.each(g.predecessors(v), function(u) { + var uNode = g.node(u); + if (uNode.dummy && + (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) { + addConflict(conflicts, u, v); + } + }); + } + }); + } + + + function visitLayer(north, south) { + var prevNorthPos = -1, + nextNorthPos, + southPos = 0; + + _.each(south, function(v, southLookahead) { + if (g.node(v).dummy === "border") { + var predecessors = g.predecessors(v); + if (predecessors.length) { + nextNorthPos = g.node(predecessors[0]).order; + scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos); + southPos = southLookahead; + prevNorthPos = nextNorthPos; + } + } + scan(south, southPos, south.length, nextNorthPos, north.length); + }); + + return south; + } + + _.reduce(layering, visitLayer); + return conflicts; +} + +function findOtherInnerSegmentNode(g, v) { + if (g.node(v).dummy) { + return _.find(g.predecessors(v), function(u) { + return g.node(u).dummy; + }); + } +} + +function addConflict(conflicts, v, w) { + if (v > w) { + var tmp = v; + v = w; + w = tmp; + } + + var conflictsV = conflicts[v]; + if (!conflictsV) { + conflicts[v] = conflictsV = {}; + } + conflictsV[w] = true; +} + +function hasConflict(conflicts, v, w) { + if (v > w) { + var tmp = v; + v = w; + w = tmp; + } + return _.has(conflicts[v], w); +} + +/* + * Try to align nodes into vertical "blocks" where possible. This algorithm + * attempts to align a node with one of its median neighbors. If the edge + * connecting a neighbor is a type-1 conflict then we ignore that possibility. + * If a previous node has already formed a block with a node after the node + * we're trying to form a block with, we also ignore that possibility - our + * blocks would be split in that scenario. + */ +function verticalAlignment(g, layering, conflicts, neighborFn) { + var root = {}, + align = {}, + pos = {}; + + // We cache the position here based on the layering because the graph and + // layering may be out of sync. The layering matrix is manipulated to + // generate different extreme alignments. + _.each(layering, function(layer) { + _.each(layer, function(v, order) { + root[v] = v; + align[v] = v; + pos[v] = order; + }); + }); + + _.each(layering, function(layer) { + var prevIdx = -1; + _.each(layer, function(v) { + var ws = neighborFn(v); + if (ws.length) { + ws = _.sortBy(ws, function(w) { return pos[w]; }); + var mp = (ws.length - 1) / 2; + for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) { + var w = ws[i]; + if (align[v] === v && + prevIdx < pos[w] && + !hasConflict(conflicts, v, w)) { + align[w] = v; + align[v] = root[v] = root[w]; + prevIdx = pos[w]; + } + } + } + }); + }); + + return { root: root, align: align }; +} + +function horizontalCompaction(g, layering, root, align, reverseSep) { + // This portion of the algorithm differs from BK due to a number of problems. + // Instead of their algorithm we construct a new block graph and do two + // sweeps. The first sweep places blocks with the smallest possible + // coordinates. The second sweep removes unused space by moving blocks to the + // greatest coordinates without violating separation. + var xs = {}, + blockG = buildBlockGraph(g, layering, root, reverseSep); + + // First pass, assign smallest coordinates via DFS + var visited = {}; + function pass1(v) { + if (!_.has(visited, v)) { + visited[v] = true; + xs[v] = _.reduce(blockG.inEdges(v), function(max, e) { + pass1(e.v); + return Math.max(max, xs[e.v] + blockG.edge(e)); + }, 0); + } + } + _.each(blockG.nodes(), pass1); + + var borderType = reverseSep ? "borderLeft" : "borderRight"; + function pass2(v) { + if (visited[v] !== 2) { + visited[v]++; + var node = g.node(v); + var min = _.reduce(blockG.outEdges(v), function(min, e) { + pass2(e.w); + return Math.min(min, xs[e.w] - blockG.edge(e)); + }, Number.POSITIVE_INFINITY); + if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) { + xs[v] = Math.max(xs[v], min); + } + } + } + _.each(blockG.nodes(), pass2); + + // Assign x coordinates to all nodes + _.each(align, function(v) { + xs[v] = xs[root[v]]; + }); + + return xs; +} + + +function buildBlockGraph(g, layering, root, reverseSep) { + var blockGraph = new Graph(), + graphLabel = g.graph(), + sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep); + + _.each(layering, function(layer) { + var u; + _.each(layer, function(v) { + var vRoot = root[v]; + blockGraph.setNode(vRoot); + if (u) { + var uRoot = root[u], + prevMax = blockGraph.edge(uRoot, vRoot); + blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0)); + } + u = v; + }); + }); + + return blockGraph; +} + +/* + * Returns the alignment that has the smallest width of the given alignments. + */ +function findSmallestWidthAlignment(g, xss) { + return _.min(xss, function(xs) { + var min = _.min(xs, function(x, v) { return x - width(g, v) / 2; }), + max = _.max(xs, function(x, v) { return x + width(g, v) / 2; }); + return max - min; + }); +} + +/* + * Align the coordinates of each of the layout alignments such that + * left-biased alignments have their minimum coordinate at the same point as + * the minimum coordinate of the smallest width alignment and right-biased + * alignments have their maximum coordinate at the same point as the maximum + * coordinate of the smallest width alignment. + */ +function alignCoordinates(xss, alignTo) { + var alignToMin = _.min(alignTo), + alignToMax = _.max(alignTo); + + _.each(["u", "d"], function(vert) { + _.each(["l", "r"], function(horiz) { + var alignment = vert + horiz, + xs = xss[alignment], + delta; + if (xs === alignTo) return; + + delta = horiz === "l" ? alignToMin - _.min(xs) : alignToMax - _.max(xs); + + if (delta) { + xss[alignment] = _.mapValues(xs, function(x) { return x + delta; }); + } + }); + }); +} + +function balance(xss, align) { + return _.mapValues(xss.ul, function(ignore, v) { + if (align) { + return xss[align.toLowerCase()][v]; + } else { + var xs = _.sortBy(_.pluck(xss, v)); + return (xs[1] + xs[2]) / 2; + } + }); +} + +function positionX(g) { + var layering = util.buildLayerMatrix(g), + conflicts = _.merge(findType1Conflicts(g, layering), + findType2Conflicts(g, layering)); + + var xss = {}, + adjustedLayering; + _.each(["u", "d"], function(vert) { + adjustedLayering = vert === "u" ? layering : _.values(layering).reverse(); + _.each(["l", "r"], function(horiz) { + if (horiz === "r") { + adjustedLayering = _.map(adjustedLayering, function(inner) { + return _.values(inner).reverse(); + }); + } + + var neighborFn = _.bind(vert === "u" ? g.predecessors : g.successors, g); + var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn); + var xs = horizontalCompaction(g, adjustedLayering, + align.root, align.align, + horiz === "r"); + if (horiz === "r") { + xs = _.mapValues(xs, function(x) { return -x; }); + } + xss[vert + horiz] = xs; + }); + }); + + var smallestWidth = findSmallestWidthAlignment(g, xss); + alignCoordinates(xss, smallestWidth); + return balance(xss, g.graph().align); +} + +function sep(nodeSep, edgeSep, reverseSep) { + return function(g, v, w) { + var vLabel = g.node(v), + wLabel = g.node(w), + sum = 0, + delta; + + sum += vLabel.width / 2; + if (_.has(vLabel, "labelpos")) { + switch (vLabel.labelpos.toLowerCase()) { + case "l": delta = -vLabel.width / 2; break; + case "r": delta = vLabel.width / 2; break; + } + } + if (delta) { + sum += reverseSep ? delta : -delta; + } + delta = 0; + + sum += (vLabel.dummy ? edgeSep : nodeSep) / 2; + sum += (wLabel.dummy ? edgeSep : nodeSep) / 2; + + sum += wLabel.width / 2; + if (_.has(wLabel, "labelpos")) { + switch (wLabel.labelpos.toLowerCase()) { + case "l": delta = wLabel.width / 2; break; + case "r": delta = -wLabel.width / 2; break; + } + } + if (delta) { + sum += reverseSep ? delta : -delta; + } + delta = 0; + + return sum; + }; +} + +function width(g, v) { + return g.node(v).width; +} + +},{"../graphlib":36,"../lodash":39,"../util":58}],53:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + util = require("../util"), + positionX = require("./bk").positionX; + +module.exports = position; + +function position(g) { + g = util.asNonCompoundGraph(g); + + positionY(g); + _.each(positionX(g), function(x, v) { + g.node(v).x = x; + }); +} + +function positionY(g) { + var layering = util.buildLayerMatrix(g), + rankSep = g.graph().ranksep, + prevY = 0; + _.each(layering, function(layer) { + var maxHeight = _.max(_.map(layer, function(v) { return g.node(v).height; })); + _.each(layer, function(v) { + g.node(v).y = prevY + maxHeight / 2; + }); + prevY += maxHeight + rankSep; + }); +} + + +},{"../lodash":39,"../util":58,"./bk":52}],54:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + Graph = require("../graphlib").Graph, + slack = require("./util").slack; + +module.exports = feasibleTree; + +/* + * Constructs a spanning tree with tight edges and adjusted the input node's + * ranks to achieve this. A tight edge is one that is has a length that matches + * its "minlen" attribute. + * + * The basic structure for this function is derived from Gansner, et al., "A + * Technique for Drawing Directed Graphs." + * + * Pre-conditions: + * + * 1. Graph must be a DAG. + * 2. Graph must be connected. + * 3. Graph must have at least one node. + * 5. Graph nodes must have been previously assigned a "rank" property that + * respects the "minlen" property of incident edges. + * 6. Graph edges must have a "minlen" property. + * + * Post-conditions: + * + * - Graph nodes will have their rank adjusted to ensure that all edges are + * tight. + * + * Returns a tree (undirected graph) that is constructed using only "tight" + * edges. + */ +function feasibleTree(g) { + var t = new Graph({ directed: false }); + + // Choose arbitrary node from which to start our tree + var start = g.nodes()[0], + size = g.nodeCount(); + t.setNode(start, {}); + + var edge, delta; + while (tightTree(t, g) < size) { + edge = findMinSlackEdge(t, g); + delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge); + shiftRanks(t, g, delta); + } + + return t; +} + +/* + * Finds a maximal tree of tight edges and returns the number of nodes in the + * tree. + */ +function tightTree(t, g) { + function dfs(v) { + _.each(g.nodeEdges(v), function(e) { + var edgeV = e.v, + w = (v === edgeV) ? e.w : edgeV; + if (!t.hasNode(w) && !slack(g, e)) { + t.setNode(w, {}); + t.setEdge(v, w, {}); + dfs(w); + } + }); + } + + _.each(t.nodes(), dfs); + return t.nodeCount(); +} + +/* + * Finds the edge with the smallest slack that is incident on tree and returns + * it. + */ +function findMinSlackEdge(t, g) { + return _.min(g.edges(), function(e) { + if (t.hasNode(e.v) !== t.hasNode(e.w)) { + return slack(g, e); + } + }); +} + +function shiftRanks(t, g, delta) { + _.each(t.nodes(), function(v) { + g.node(v).rank += delta; + }); +} + +},{"../graphlib":36,"../lodash":39,"./util":57}],55:[function(require,module,exports){ +"use strict"; + +var rankUtil = require("./util"), + longestPath = rankUtil.longestPath, + feasibleTree = require("./feasible-tree"), + networkSimplex = require("./network-simplex"); + +module.exports = rank; + +/* + * Assigns a rank to each node in the input graph that respects the "minlen" + * constraint specified on edges between nodes. + * + * This basic structure is derived from Gansner, et al., "A Technique for + * Drawing Directed Graphs." + * + * Pre-conditions: + * + * 1. Graph must be a connected DAG + * 2. Graph nodes must be objects + * 3. Graph edges must have "weight" and "minlen" attributes + * + * Post-conditions: + * + * 1. Graph nodes will have a "rank" attribute based on the results of the + * algorithm. Ranks can start at any index (including negative), we'll + * fix them up later. + */ +function rank(g) { + switch(g.graph().ranker) { + case "network-simplex": networkSimplexRanker(g); break; + case "tight-tree": tightTreeRanker(g); break; + case "longest-path": longestPathRanker(g); break; + default: networkSimplexRanker(g); + } +} + +// A fast and simple ranker, but results are far from optimal. +var longestPathRanker = longestPath; + +function tightTreeRanker(g) { + longestPath(g); + feasibleTree(g); +} + +function networkSimplexRanker(g) { + networkSimplex(g); +} + +},{"./feasible-tree":54,"./network-simplex":56,"./util":57}],56:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + feasibleTree = require("./feasible-tree"), + slack = require("./util").slack, + initRank = require("./util").longestPath, + preorder = require("../graphlib").alg.preorder, + postorder = require("../graphlib").alg.postorder, + simplify = require("../util").simplify; + +module.exports = networkSimplex; + +// Expose some internals for testing purposes +networkSimplex.initLowLimValues = initLowLimValues; +networkSimplex.initCutValues = initCutValues; +networkSimplex.calcCutValue = calcCutValue; +networkSimplex.leaveEdge = leaveEdge; +networkSimplex.enterEdge = enterEdge; +networkSimplex.exchangeEdges = exchangeEdges; + +/* + * The network simplex algorithm assigns ranks to each node in the input graph + * and iteratively improves the ranking to reduce the length of edges. + * + * Preconditions: + * + * 1. The input graph must be a DAG. + * 2. All nodes in the graph must have an object value. + * 3. All edges in the graph must have "minlen" and "weight" attributes. + * + * Postconditions: + * + * 1. All nodes in the graph will have an assigned "rank" attribute that has + * been optimized by the network simplex algorithm. Ranks start at 0. + * + * + * A rough sketch of the algorithm is as follows: + * + * 1. Assign initial ranks to each node. We use the longest path algorithm, + * which assigns ranks to the lowest position possible. In general this + * leads to very wide bottom ranks and unnecessarily long edges. + * 2. Construct a feasible tight tree. A tight tree is one such that all + * edges in the tree have no slack (difference between length of edge + * and minlen for the edge). This by itself greatly improves the assigned + * rankings by shorting edges. + * 3. Iteratively find edges that have negative cut values. Generally a + * negative cut value indicates that the edge could be removed and a new + * tree edge could be added to produce a more compact graph. + * + * Much of the algorithms here are derived from Gansner, et al., "A Technique + * for Drawing Directed Graphs." The structure of the file roughly follows the + * structure of the overall algorithm. + */ +function networkSimplex(g) { + g = simplify(g); + initRank(g); + var t = feasibleTree(g); + initLowLimValues(t); + initCutValues(t, g); + + var e, f; + while ((e = leaveEdge(t))) { + f = enterEdge(t, g, e); + exchangeEdges(t, g, e, f); + } +} + +/* + * Initializes cut values for all edges in the tree. + */ +function initCutValues(t, g) { + var vs = postorder(t, t.nodes()); + vs = vs.slice(0, vs.length - 1); + _.each(vs, function(v) { + assignCutValue(t, g, v); + }); +} + +function assignCutValue(t, g, child) { + var childLab = t.node(child), + parent = childLab.parent; + t.edge(child, parent).cutvalue = calcCutValue(t, g, child); +} + +/* + * Given the tight tree, its graph, and a child in the graph calculate and + * return the cut value for the edge between the child and its parent. + */ +function calcCutValue(t, g, child) { + var childLab = t.node(child), + parent = childLab.parent, + // True if the child is on the tail end of the edge in the directed graph + childIsTail = true, + // The graph's view of the tree edge we're inspecting + graphEdge = g.edge(child, parent), + // The accumulated cut value for the edge between this node and its parent + cutValue = 0; + + if (!graphEdge) { + childIsTail = false; + graphEdge = g.edge(parent, child); + } + + cutValue = graphEdge.weight; + + _.each(g.nodeEdges(child), function(e) { + var isOutEdge = e.v === child, + other = isOutEdge ? e.w : e.v; + + if (other !== parent) { + var pointsToHead = isOutEdge === childIsTail, + otherWeight = g.edge(e).weight; + + cutValue += pointsToHead ? otherWeight : -otherWeight; + if (isTreeEdge(t, child, other)) { + var otherCutValue = t.edge(child, other).cutvalue; + cutValue += pointsToHead ? -otherCutValue : otherCutValue; + } + } + }); + + return cutValue; +} + +function initLowLimValues(tree, root) { + if (arguments.length < 2) { + root = tree.nodes()[0]; + } + dfsAssignLowLim(tree, {}, 1, root); +} + +function dfsAssignLowLim(tree, visited, nextLim, v, parent) { + var low = nextLim, + label = tree.node(v); + + visited[v] = true; + _.each(tree.neighbors(v), function(w) { + if (!_.has(visited, w)) { + nextLim = dfsAssignLowLim(tree, visited, nextLim, w, v); + } + }); + + label.low = low; + label.lim = nextLim++; + if (parent) { + label.parent = parent; + } else { + // TODO should be able to remove this when we incrementally update low lim + delete label.parent; + } + + return nextLim; +} + +function leaveEdge(tree) { + return _.find(tree.edges(), function(e) { + return tree.edge(e).cutvalue < 0; + }); +} + +function enterEdge(t, g, edge) { + var v = edge.v, + w = edge.w; + + // For the rest of this function we assume that v is the tail and w is the + // head, so if we don't have this edge in the graph we should flip it to + // match the correct orientation. + if (!g.hasEdge(v, w)) { + v = edge.w; + w = edge.v; + } + + var vLabel = t.node(v), + wLabel = t.node(w), + tailLabel = vLabel, + flip = false; + + // If the root is in the tail of the edge then we need to flip the logic that + // checks for the head and tail nodes in the candidates function below. + if (vLabel.lim > wLabel.lim) { + tailLabel = wLabel; + flip = true; + } + + var candidates = _.filter(g.edges(), function(edge) { + return flip === isDescendant(t, t.node(edge.v), tailLabel) && + flip !== isDescendant(t, t.node(edge.w), tailLabel); + }); + + return _.min(candidates, function(edge) { return slack(g, edge); }); +} + +function exchangeEdges(t, g, e, f) { + var v = e.v, + w = e.w; + t.removeEdge(v, w); + t.setEdge(f.v, f.w, {}); + initLowLimValues(t); + initCutValues(t, g); + updateRanks(t, g); +} + +function updateRanks(t, g) { + var root = _.find(t.nodes(), function(v) { return !g.node(v).parent; }), + vs = preorder(t, root); + vs = vs.slice(1); + _.each(vs, function(v) { + var parent = t.node(v).parent, + edge = g.edge(v, parent), + flipped = false; + + if (!edge) { + edge = g.edge(parent, v); + flipped = true; + } + + g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen); + }); +} + +/* + * Returns true if the edge is in the tree. + */ +function isTreeEdge(tree, u, v) { + return tree.hasEdge(u, v); +} + +/* + * Returns true if the specified node is descendant of the root node per the + * assigned low and lim attributes in the tree. + */ +function isDescendant(tree, vLabel, rootLabel) { + return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim; +} + +},{"../graphlib":36,"../lodash":39,"../util":58,"./feasible-tree":54,"./util":57}],57:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"); + +module.exports = { + longestPath: longestPath, + slack: slack +}; + +/* + * Initializes ranks for the input graph using the longest path algorithm. This + * algorithm scales well and is fast in practice, it yields rather poor + * solutions. Nodes are pushed to the lowest layer possible, leaving the bottom + * ranks wide and leaving edges longer than necessary. However, due to its + * speed, this algorithm is good for getting an initial ranking that can be fed + * into other algorithms. + * + * This algorithm does not normalize layers because it will be used by other + * algorithms in most cases. If using this algorithm directly, be sure to + * run normalize at the end. + * + * Pre-conditions: + * + * 1. Input graph is a DAG. + * 2. Input graph node labels can be assigned properties. + * + * Post-conditions: + * + * 1. Each node will be assign an (unnormalized) "rank" property. + */ +function longestPath(g) { + var visited = {}; + + function dfs(v) { + var label = g.node(v); + if (_.has(visited, v)) { + return label.rank; + } + visited[v] = true; + + var rank = _.min(_.map(g.outEdges(v), function(e) { + return dfs(e.w) - g.edge(e).minlen; + })); + + if (rank === Number.POSITIVE_INFINITY) { + rank = 0; + } + + return (label.rank = rank); + } + + _.each(g.sources(), dfs); +} + +/* + * Returns the amount of slack for the given edge. The slack is defined as the + * difference between the length of the edge and its minimum length. + */ +function slack(g, e) { + return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen; +} + +},{"../lodash":39}],58:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"), + Graph = require("./graphlib").Graph; + +module.exports = { + addDummyNode: addDummyNode, + simplify: simplify, + asNonCompoundGraph: asNonCompoundGraph, + successorWeights: successorWeights, + predecessorWeights: predecessorWeights, + intersectRect: intersectRect, + buildLayerMatrix: buildLayerMatrix, + normalizeRanks: normalizeRanks, + removeEmptyRanks: removeEmptyRanks, + addBorderNode: addBorderNode, + maxRank: maxRank, + partition: partition, + time: time, + notime: notime +}; + +/* + * Adds a dummy node to the graph and return v. + */ +function addDummyNode(g, type, attrs, name) { + var v; + do { + v = _.uniqueId(name); + } while (g.hasNode(v)); + + attrs.dummy = type; + g.setNode(v, attrs); + return v; +} + +/* + * Returns a new graph with only simple edges. Handles aggregation of data + * associated with multi-edges. + */ +function simplify(g) { + var simplified = new Graph().setGraph(g.graph()); + _.each(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); }); + _.each(g.edges(), function(e) { + var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 }, + label = g.edge(e); + simplified.setEdge(e.v, e.w, { + weight: simpleLabel.weight + label.weight, + minlen: Math.max(simpleLabel.minlen, label.minlen) + }); + }); + return simplified; +} + +function asNonCompoundGraph(g) { + var simplified = new Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph()); + _.each(g.nodes(), function(v) { + if (!g.children(v).length) { + simplified.setNode(v, g.node(v)); + } + }); + _.each(g.edges(), function(e) { + simplified.setEdge(e, g.edge(e)); + }); + return simplified; +} + +function successorWeights(g) { + var weightMap = _.map(g.nodes(), function(v) { + var sucs = {}; + _.each(g.outEdges(v), function(e) { + sucs[e.w] = (sucs[e.w] || 0) + g.edge(e).weight; + }); + return sucs; + }); + return _.zipObject(g.nodes(), weightMap); +} + +function predecessorWeights(g) { + var weightMap = _.map(g.nodes(), function(v) { + var preds = {}; + _.each(g.inEdges(v), function(e) { + preds[e.v] = (preds[e.v] || 0) + g.edge(e).weight; + }); + return preds; + }); + return _.zipObject(g.nodes(), weightMap); +} + +/* + * Finds where a line starting at point ({x, y}) would intersect a rectangle + * ({x, y, width, height}) if it were pointing at the rectangle's center. + */ +function intersectRect(rect, point) { + var x = rect.x; + var y = rect.y; + + // Rectangle intersection algorithm from: + // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes + var dx = point.x - x; + var dy = point.y - y; + var w = rect.width / 2; + var h = rect.height / 2; + + if (!dx && !dy) { + throw new Error("Not possible to find intersection inside of the rectangle"); + } + + var sx, sy; + if (Math.abs(dy) * w > Math.abs(dx) * h) { + // Intersection is top or bottom of rect. + if (dy < 0) { + h = -h; + } + sx = h * dx / dy; + sy = h; + } else { + // Intersection is left or right of rect. + if (dx < 0) { + w = -w; + } + sx = w; + sy = w * dy / dx; + } + + return { x: x + sx, y: y + sy }; +} + +/* + * Given a DAG with each node assigned "rank" and "order" properties, this + * function will produce a matrix with the ids of each node. + */ +function buildLayerMatrix(g) { + var layering = _.map(_.range(maxRank(g) + 1), function() { return []; }); + _.each(g.nodes(), function(v) { + var node = g.node(v), + rank = node.rank; + if (!_.isUndefined(rank)) { + layering[rank][node.order] = v; + } + }); + return layering; +} + +/* + * Adjusts the ranks for all nodes in the graph such that all nodes v have + * rank(v) >= 0 and at least one node w has rank(w) = 0. + */ +function normalizeRanks(g) { + var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); + _.each(g.nodes(), function(v) { + var node = g.node(v); + if (_.has(node, "rank")) { + node.rank -= min; + } + }); +} + +function removeEmptyRanks(g) { + // Ranks may not start at 0, so we need to offset them + var offset = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); + + var layers = []; + _.each(g.nodes(), function(v) { + var rank = g.node(v).rank - offset; + if (!layers[rank]) { + layers[rank] = []; + } + layers[rank].push(v); + }); + + var delta = 0, + nodeRankFactor = g.graph().nodeRankFactor; + _.each(layers, function(vs, i) { + if (_.isUndefined(vs) && i % nodeRankFactor !== 0) { + --delta; + } else if (delta) { + _.each(vs, function(v) { g.node(v).rank += delta; }); + } + }); +} + +function addBorderNode(g, prefix, rank, order) { + var node = { + width: 0, + height: 0 + }; + if (arguments.length >= 4) { + node.rank = rank; + node.order = order; + } + return addDummyNode(g, "border", node, prefix); +} + +function maxRank(g) { + return _.max(_.map(g.nodes(), function(v) { + var rank = g.node(v).rank; + if (!_.isUndefined(rank)) { + return rank; + } + })); +} + +/* + * Partition a collection into two groups: `lhs` and `rhs`. If the supplied + * function returns true for an entry it goes into `lhs`. Otherwise it goes + * into `rhs. + */ +function partition(collection, fn) { + var result = { lhs: [], rhs: [] }; + _.each(collection, function(value) { + if (fn(value)) { + result.lhs.push(value); + } else { + result.rhs.push(value); + } + }); + return result; +} + +/* + * Returns a new function that wraps `fn` with a timer. The wrapper logs the + * time it takes to execute the function. + */ +function time(name, fn) { + var start = _.now(); + try { + return fn(); + } finally { + console.log(name + " time: " + (_.now() - start) + "ms"); + } +} + +function notime(name, fn) { + return fn(); +} + +},{"./graphlib":36,"./lodash":39}],59:[function(require,module,exports){ +module.exports = "0.7.4"; + +},{}],60:[function(require,module,exports){ /** * Copyright (c) 2014, Chris Pettitt * All rights reserved. @@ -1536,7 +4122,7 @@ module.exports = { version: lib.version }; -},{"./lib":48,"./lib/alg":39,"./lib/json":49}],33:[function(require,module,exports){ +},{"./lib":76,"./lib/alg":67,"./lib/json":77}],61:[function(require,module,exports){ var _ = require("../lodash"); module.exports = components; @@ -1565,7 +4151,7 @@ function components(g) { return cmpts; } -},{"../lodash":50}],34:[function(require,module,exports){ +},{"../lodash":78}],62:[function(require,module,exports){ var _ = require("../lodash"); module.exports = dfs; @@ -1606,7 +4192,7 @@ function doDfs(g, v, postorder, visited, acc) { } } -},{"../lodash":50}],35:[function(require,module,exports){ +},{"../lodash":78}],63:[function(require,module,exports){ var dijkstra = require("./dijkstra"), _ = require("../lodash"); @@ -1618,7 +4204,7 @@ function dijkstraAll(g, weightFunc, edgeFunc) { }, {}); } -},{"../lodash":50,"./dijkstra":36}],36:[function(require,module,exports){ +},{"../lodash":78,"./dijkstra":64}],64:[function(require,module,exports){ var _ = require("../lodash"), PriorityQueue = require("../data/priority-queue"); @@ -1674,7 +4260,7 @@ function runDijkstra(g, source, weightFn, edgeFn) { return results; } -},{"../data/priority-queue":46,"../lodash":50}],37:[function(require,module,exports){ +},{"../data/priority-queue":74,"../lodash":78}],65:[function(require,module,exports){ var _ = require("../lodash"), tarjan = require("./tarjan"); @@ -1686,7 +4272,7 @@ function findCycles(g) { }); } -},{"../lodash":50,"./tarjan":44}],38:[function(require,module,exports){ +},{"../lodash":78,"./tarjan":72}],66:[function(require,module,exports){ var _ = require("../lodash"); module.exports = floydWarshall; @@ -1738,7 +4324,7 @@ function runFloydWarshall(g, weightFn, edgeFn) { return results; } -},{"../lodash":50}],39:[function(require,module,exports){ +},{"../lodash":78}],67:[function(require,module,exports){ module.exports = { components: require("./components"), dijkstra: require("./dijkstra"), @@ -1753,7 +4339,7 @@ module.exports = { topsort: require("./topsort") }; -},{"./components":33,"./dijkstra":36,"./dijkstra-all":35,"./find-cycles":37,"./floyd-warshall":38,"./is-acyclic":40,"./postorder":41,"./preorder":42,"./prim":43,"./tarjan":44,"./topsort":45}],40:[function(require,module,exports){ +},{"./components":61,"./dijkstra":64,"./dijkstra-all":63,"./find-cycles":65,"./floyd-warshall":66,"./is-acyclic":68,"./postorder":69,"./preorder":70,"./prim":71,"./tarjan":72,"./topsort":73}],68:[function(require,module,exports){ var topsort = require("./topsort"); module.exports = isAcyclic; @@ -1770,7 +4356,7 @@ function isAcyclic(g) { return true; } -},{"./topsort":45}],41:[function(require,module,exports){ +},{"./topsort":73}],69:[function(require,module,exports){ var dfs = require("./dfs"); module.exports = postorder; @@ -1779,7 +4365,7 @@ function postorder(g, vs) { return dfs(g, vs, "post"); } -},{"./dfs":34}],42:[function(require,module,exports){ +},{"./dfs":62}],70:[function(require,module,exports){ var dfs = require("./dfs"); module.exports = preorder; @@ -1788,7 +4374,7 @@ function preorder(g, vs) { return dfs(g, vs, "pre"); } -},{"./dfs":34}],43:[function(require,module,exports){ +},{"./dfs":62}],71:[function(require,module,exports){ var _ = require("../lodash"), Graph = require("../graph"), PriorityQueue = require("../data/priority-queue"); @@ -1842,7 +4428,7 @@ function prim(g, weightFunc) { return result; } -},{"../data/priority-queue":46,"../graph":47,"../lodash":50}],44:[function(require,module,exports){ +},{"../data/priority-queue":74,"../graph":75,"../lodash":78}],72:[function(require,module,exports){ var _ = require("../lodash"); module.exports = tarjan; @@ -1891,7 +4477,7 @@ function tarjan(g) { return results; } -},{"../lodash":50}],45:[function(require,module,exports){ +},{"../lodash":78}],73:[function(require,module,exports){ var _ = require("../lodash"); module.exports = topsort; @@ -1927,7 +4513,7 @@ function topsort(g) { function CycleException() {} -},{"../lodash":50}],46:[function(require,module,exports){ +},{"../lodash":78}],74:[function(require,module,exports){ var _ = require("../lodash"); module.exports = PriorityQueue; @@ -2081,7 +4667,7 @@ PriorityQueue.prototype._swap = function(i, j) { keyIndices[origArrI.key] = j; }; -},{"../lodash":50}],47:[function(require,module,exports){ +},{"../lodash":78}],75:[function(require,module,exports){ "use strict"; var _ = require("./lodash"); @@ -2602,14 +5188,14 @@ function edgeObjToId(isDirected, edgeObj) { return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name); } -},{"./lodash":50}],48:[function(require,module,exports){ +},{"./lodash":78}],76:[function(require,module,exports){ // Includes only the "core" of graphlib module.exports = { Graph: require("./graph"), version: require("./version") }; -},{"./graph":47,"./version":51}],49:[function(require,module,exports){ +},{"./graph":75,"./version":79}],77:[function(require,module,exports){ var _ = require("./lodash"), Graph = require("./graph"); @@ -2677,27 +5263,345 @@ function read(json) { return g; } -},{"./graph":47,"./lodash":50}],50:[function(require,module,exports){ -/* global window */ - -var lodash; - -if (typeof require === "function") { - try { - lodash = require("lodash"); - } catch (e) {} -} - -if (!lodash) { - lodash = window._; -} - -module.exports = lodash; - -},{"lodash":52}],51:[function(require,module,exports){ +},{"./graph":75,"./lodash":78}],78:[function(require,module,exports){ +module.exports=require(39) +},{"/Users/knut/source/mermaid/node_modules/dagre/lib/lodash.js":39,"lodash":81}],79:[function(require,module,exports){ module.exports = '1.0.7'; -},{}],52:[function(require,module,exports){ +},{}],80:[function(require,module,exports){ +(function (global){ +/*! http://mths.be/he v0.5.0 by @mathias | MIT license */ +;(function(root) { + + // Detect free variables `exports`. + var freeExports = typeof exports == 'object' && exports; + + // Detect free variable `module`. + var freeModule = typeof module == 'object' && module && + module.exports == freeExports && module; + + // Detect free variable `global`, from Node.js or Browserified code, + // and use it as `root`. + var freeGlobal = typeof global == 'object' && global; + if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { + root = freeGlobal; + } + + /*--------------------------------------------------------------------------*/ + + // All astral symbols. + var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; + // All ASCII symbols (not just printable ASCII) except those listed in the + // first column of the overrides table. + // http://whatwg.org/html/tokenization.html#table-charref-overrides + var regexAsciiWhitelist = /[\x01-\x7F]/g; + // All BMP symbols that are not ASCII newlines, printable ASCII symbols, or + // code points listed in the first column of the overrides table on + // http://whatwg.org/html/tokenization.html#table-charref-overrides. + var regexBmpWhitelist = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g; + + var regexEncodeNonAscii = /<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g; + var encodeMap = {'\xC1':'Aacute','\xE1':'aacute','\u0102':'Abreve','\u0103':'abreve','\u223E':'ac','\u223F':'acd','\u223E\u0333':'acE','\xC2':'Acirc','\xE2':'acirc','\xB4':'acute','\u0410':'Acy','\u0430':'acy','\xC6':'AElig','\xE6':'aelig','\u2061':'af','\uD835\uDD04':'Afr','\uD835\uDD1E':'afr','\xC0':'Agrave','\xE0':'agrave','\u2135':'aleph','\u0391':'Alpha','\u03B1':'alpha','\u0100':'Amacr','\u0101':'amacr','\u2A3F':'amalg','&':'amp','\u2A55':'andand','\u2A53':'And','\u2227':'and','\u2A5C':'andd','\u2A58':'andslope','\u2A5A':'andv','\u2220':'ang','\u29A4':'ange','\u29A8':'angmsdaa','\u29A9':'angmsdab','\u29AA':'angmsdac','\u29AB':'angmsdad','\u29AC':'angmsdae','\u29AD':'angmsdaf','\u29AE':'angmsdag','\u29AF':'angmsdah','\u2221':'angmsd','\u221F':'angrt','\u22BE':'angrtvb','\u299D':'angrtvbd','\u2222':'angsph','\xC5':'angst','\u237C':'angzarr','\u0104':'Aogon','\u0105':'aogon','\uD835\uDD38':'Aopf','\uD835\uDD52':'aopf','\u2A6F':'apacir','\u2248':'ap','\u2A70':'apE','\u224A':'ape','\u224B':'apid','\'':'apos','\xE5':'aring','\uD835\uDC9C':'Ascr','\uD835\uDCB6':'ascr','\u2254':'colone','*':'ast','\u224D':'CupCap','\xC3':'Atilde','\xE3':'atilde','\xC4':'Auml','\xE4':'auml','\u2233':'awconint','\u2A11':'awint','\u224C':'bcong','\u03F6':'bepsi','\u2035':'bprime','\u223D':'bsim','\u22CD':'bsime','\u2216':'setmn','\u2AE7':'Barv','\u22BD':'barvee','\u2305':'barwed','\u2306':'Barwed','\u23B5':'bbrk','\u23B6':'bbrktbrk','\u0411':'Bcy','\u0431':'bcy','\u201E':'bdquo','\u2235':'becaus','\u29B0':'bemptyv','\u212C':'Bscr','\u0392':'Beta','\u03B2':'beta','\u2136':'beth','\u226C':'twixt','\uD835\uDD05':'Bfr','\uD835\uDD1F':'bfr','\u22C2':'xcap','\u25EF':'xcirc','\u22C3':'xcup','\u2A00':'xodot','\u2A01':'xoplus','\u2A02':'xotime','\u2A06':'xsqcup','\u2605':'starf','\u25BD':'xdtri','\u25B3':'xutri','\u2A04':'xuplus','\u22C1':'Vee','\u22C0':'Wedge','\u290D':'rbarr','\u29EB':'lozf','\u25AA':'squf','\u25B4':'utrif','\u25BE':'dtrif','\u25C2':'ltrif','\u25B8':'rtrif','\u2423':'blank','\u2592':'blk12','\u2591':'blk14','\u2593':'blk34','\u2588':'block','=\u20E5':'bne','\u2261\u20E5':'bnequiv','\u2AED':'bNot','\u2310':'bnot','\uD835\uDD39':'Bopf','\uD835\uDD53':'bopf','\u22A5':'bot','\u22C8':'bowtie','\u29C9':'boxbox','\u2510':'boxdl','\u2555':'boxdL','\u2556':'boxDl','\u2557':'boxDL','\u250C':'boxdr','\u2552':'boxdR','\u2553':'boxDr','\u2554':'boxDR','\u2500':'boxh','\u2550':'boxH','\u252C':'boxhd','\u2564':'boxHd','\u2565':'boxhD','\u2566':'boxHD','\u2534':'boxhu','\u2567':'boxHu','\u2568':'boxhU','\u2569':'boxHU','\u229F':'minusb','\u229E':'plusb','\u22A0':'timesb','\u2518':'boxul','\u255B':'boxuL','\u255C':'boxUl','\u255D':'boxUL','\u2514':'boxur','\u2558':'boxuR','\u2559':'boxUr','\u255A':'boxUR','\u2502':'boxv','\u2551':'boxV','\u253C':'boxvh','\u256A':'boxvH','\u256B':'boxVh','\u256C':'boxVH','\u2524':'boxvl','\u2561':'boxvL','\u2562':'boxVl','\u2563':'boxVL','\u251C':'boxvr','\u255E':'boxvR','\u255F':'boxVr','\u2560':'boxVR','\u02D8':'breve','\xA6':'brvbar','\uD835\uDCB7':'bscr','\u204F':'bsemi','\u29C5':'bsolb','\\':'bsol','\u27C8':'bsolhsub','\u2022':'bull','\u224E':'bump','\u2AAE':'bumpE','\u224F':'bumpe','\u0106':'Cacute','\u0107':'cacute','\u2A44':'capand','\u2A49':'capbrcup','\u2A4B':'capcap','\u2229':'cap','\u22D2':'Cap','\u2A47':'capcup','\u2A40':'capdot','\u2145':'DD','\u2229\uFE00':'caps','\u2041':'caret','\u02C7':'caron','\u212D':'Cfr','\u2A4D':'ccaps','\u010C':'Ccaron','\u010D':'ccaron','\xC7':'Ccedil','\xE7':'ccedil','\u0108':'Ccirc','\u0109':'ccirc','\u2230':'Cconint','\u2A4C':'ccups','\u2A50':'ccupssm','\u010A':'Cdot','\u010B':'cdot','\xB8':'cedil','\u29B2':'cemptyv','\xA2':'cent','\xB7':'middot','\uD835\uDD20':'cfr','\u0427':'CHcy','\u0447':'chcy','\u2713':'check','\u03A7':'Chi','\u03C7':'chi','\u02C6':'circ','\u2257':'cire','\u21BA':'olarr','\u21BB':'orarr','\u229B':'oast','\u229A':'ocir','\u229D':'odash','\u2299':'odot','\xAE':'reg','\u24C8':'oS','\u2296':'ominus','\u2295':'oplus','\u2297':'otimes','\u25CB':'cir','\u29C3':'cirE','\u2A10':'cirfnint','\u2AEF':'cirmid','\u29C2':'cirscir','\u2232':'cwconint','\u201D':'rdquo','\u2019':'rsquo','\u2663':'clubs',':':'colon','\u2237':'Colon','\u2A74':'Colone',',':'comma','@':'commat','\u2201':'comp','\u2218':'compfn','\u2102':'Copf','\u2245':'cong','\u2A6D':'congdot','\u2261':'equiv','\u222E':'oint','\u222F':'Conint','\uD835\uDD54':'copf','\u2210':'coprod','\xA9':'copy','\u2117':'copysr','\u21B5':'crarr','\u2717':'cross','\u2A2F':'Cross','\uD835\uDC9E':'Cscr','\uD835\uDCB8':'cscr','\u2ACF':'csub','\u2AD1':'csube','\u2AD0':'csup','\u2AD2':'csupe','\u22EF':'ctdot','\u2938':'cudarrl','\u2935':'cudarrr','\u22DE':'cuepr','\u22DF':'cuesc','\u21B6':'cularr','\u293D':'cularrp','\u2A48':'cupbrcap','\u2A46':'cupcap','\u222A':'cup','\u22D3':'Cup','\u2A4A':'cupcup','\u228D':'cupdot','\u2A45':'cupor','\u222A\uFE00':'cups','\u21B7':'curarr','\u293C':'curarrm','\u22CE':'cuvee','\u22CF':'cuwed','\xA4':'curren','\u2231':'cwint','\u232D':'cylcty','\u2020':'dagger','\u2021':'Dagger','\u2138':'daleth','\u2193':'darr','\u21A1':'Darr','\u21D3':'dArr','\u2010':'dash','\u2AE4':'Dashv','\u22A3':'dashv','\u290F':'rBarr','\u02DD':'dblac','\u010E':'Dcaron','\u010F':'dcaron','\u0414':'Dcy','\u0434':'dcy','\u21CA':'ddarr','\u2146':'dd','\u2911':'DDotrahd','\u2A77':'eDDot','\xB0':'deg','\u2207':'Del','\u0394':'Delta','\u03B4':'delta','\u29B1':'demptyv','\u297F':'dfisht','\uD835\uDD07':'Dfr','\uD835\uDD21':'dfr','\u2965':'dHar','\u21C3':'dharl','\u21C2':'dharr','\u02D9':'dot','`':'grave','\u02DC':'tilde','\u22C4':'diam','\u2666':'diams','\xA8':'die','\u03DD':'gammad','\u22F2':'disin','\xF7':'div','\u22C7':'divonx','\u0402':'DJcy','\u0452':'djcy','\u231E':'dlcorn','\u230D':'dlcrop','$':'dollar','\uD835\uDD3B':'Dopf','\uD835\uDD55':'dopf','\u20DC':'DotDot','\u2250':'doteq','\u2251':'eDot','\u2238':'minusd','\u2214':'plusdo','\u22A1':'sdotb','\u21D0':'lArr','\u21D4':'iff','\u27F8':'xlArr','\u27FA':'xhArr','\u27F9':'xrArr','\u21D2':'rArr','\u22A8':'vDash','\u21D1':'uArr','\u21D5':'vArr','\u2225':'par','\u2913':'DownArrowBar','\u21F5':'duarr','\u0311':'DownBreve','\u2950':'DownLeftRightVector','\u295E':'DownLeftTeeVector','\u2956':'DownLeftVectorBar','\u21BD':'lhard','\u295F':'DownRightTeeVector','\u2957':'DownRightVectorBar','\u21C1':'rhard','\u21A7':'mapstodown','\u22A4':'top','\u2910':'RBarr','\u231F':'drcorn','\u230C':'drcrop','\uD835\uDC9F':'Dscr','\uD835\uDCB9':'dscr','\u0405':'DScy','\u0455':'dscy','\u29F6':'dsol','\u0110':'Dstrok','\u0111':'dstrok','\u22F1':'dtdot','\u25BF':'dtri','\u296F':'duhar','\u29A6':'dwangle','\u040F':'DZcy','\u045F':'dzcy','\u27FF':'dzigrarr','\xC9':'Eacute','\xE9':'eacute','\u2A6E':'easter','\u011A':'Ecaron','\u011B':'ecaron','\xCA':'Ecirc','\xEA':'ecirc','\u2256':'ecir','\u2255':'ecolon','\u042D':'Ecy','\u044D':'ecy','\u0116':'Edot','\u0117':'edot','\u2147':'ee','\u2252':'efDot','\uD835\uDD08':'Efr','\uD835\uDD22':'efr','\u2A9A':'eg','\xC8':'Egrave','\xE8':'egrave','\u2A96':'egs','\u2A98':'egsdot','\u2A99':'el','\u2208':'in','\u23E7':'elinters','\u2113':'ell','\u2A95':'els','\u2A97':'elsdot','\u0112':'Emacr','\u0113':'emacr','\u2205':'empty','\u25FB':'EmptySmallSquare','\u25AB':'EmptyVerySmallSquare','\u2004':'emsp13','\u2005':'emsp14','\u2003':'emsp','\u014A':'ENG','\u014B':'eng','\u2002':'ensp','\u0118':'Eogon','\u0119':'eogon','\uD835\uDD3C':'Eopf','\uD835\uDD56':'eopf','\u22D5':'epar','\u29E3':'eparsl','\u2A71':'eplus','\u03B5':'epsi','\u0395':'Epsilon','\u03F5':'epsiv','\u2242':'esim','\u2A75':'Equal','=':'equals','\u225F':'equest','\u21CC':'rlhar','\u2A78':'equivDD','\u29E5':'eqvparsl','\u2971':'erarr','\u2253':'erDot','\u212F':'escr','\u2130':'Escr','\u2A73':'Esim','\u0397':'Eta','\u03B7':'eta','\xD0':'ETH','\xF0':'eth','\xCB':'Euml','\xEB':'euml','\u20AC':'euro','!':'excl','\u2203':'exist','\u0424':'Fcy','\u0444':'fcy','\u2640':'female','\uFB03':'ffilig','\uFB00':'fflig','\uFB04':'ffllig','\uD835\uDD09':'Ffr','\uD835\uDD23':'ffr','\uFB01':'filig','\u25FC':'FilledSmallSquare','fj':'fjlig','\u266D':'flat','\uFB02':'fllig','\u25B1':'fltns','\u0192':'fnof','\uD835\uDD3D':'Fopf','\uD835\uDD57':'fopf','\u2200':'forall','\u22D4':'fork','\u2AD9':'forkv','\u2131':'Fscr','\u2A0D':'fpartint','\xBD':'half','\u2153':'frac13','\xBC':'frac14','\u2155':'frac15','\u2159':'frac16','\u215B':'frac18','\u2154':'frac23','\u2156':'frac25','\xBE':'frac34','\u2157':'frac35','\u215C':'frac38','\u2158':'frac45','\u215A':'frac56','\u215D':'frac58','\u215E':'frac78','\u2044':'frasl','\u2322':'frown','\uD835\uDCBB':'fscr','\u01F5':'gacute','\u0393':'Gamma','\u03B3':'gamma','\u03DC':'Gammad','\u2A86':'gap','\u011E':'Gbreve','\u011F':'gbreve','\u0122':'Gcedil','\u011C':'Gcirc','\u011D':'gcirc','\u0413':'Gcy','\u0433':'gcy','\u0120':'Gdot','\u0121':'gdot','\u2265':'ge','\u2267':'gE','\u2A8C':'gEl','\u22DB':'gel','\u2A7E':'ges','\u2AA9':'gescc','\u2A80':'gesdot','\u2A82':'gesdoto','\u2A84':'gesdotol','\u22DB\uFE00':'gesl','\u2A94':'gesles','\uD835\uDD0A':'Gfr','\uD835\uDD24':'gfr','\u226B':'gg','\u22D9':'Gg','\u2137':'gimel','\u0403':'GJcy','\u0453':'gjcy','\u2AA5':'gla','\u2277':'gl','\u2A92':'glE','\u2AA4':'glj','\u2A8A':'gnap','\u2A88':'gne','\u2269':'gnE','\u22E7':'gnsim','\uD835\uDD3E':'Gopf','\uD835\uDD58':'gopf','\u2AA2':'GreaterGreater','\u2273':'gsim','\uD835\uDCA2':'Gscr','\u210A':'gscr','\u2A8E':'gsime','\u2A90':'gsiml','\u2AA7':'gtcc','\u2A7A':'gtcir','>':'gt','\u22D7':'gtdot','\u2995':'gtlPar','\u2A7C':'gtquest','\u2978':'gtrarr','\u2269\uFE00':'gvnE','\u200A':'hairsp','\u210B':'Hscr','\u042A':'HARDcy','\u044A':'hardcy','\u2948':'harrcir','\u2194':'harr','\u21AD':'harrw','^':'Hat','\u210F':'hbar','\u0124':'Hcirc','\u0125':'hcirc','\u2665':'hearts','\u2026':'mldr','\u22B9':'hercon','\uD835\uDD25':'hfr','\u210C':'Hfr','\u2925':'searhk','\u2926':'swarhk','\u21FF':'hoarr','\u223B':'homtht','\u21A9':'larrhk','\u21AA':'rarrhk','\uD835\uDD59':'hopf','\u210D':'Hopf','\u2015':'horbar','\uD835\uDCBD':'hscr','\u0126':'Hstrok','\u0127':'hstrok','\u2043':'hybull','\xCD':'Iacute','\xED':'iacute','\u2063':'ic','\xCE':'Icirc','\xEE':'icirc','\u0418':'Icy','\u0438':'icy','\u0130':'Idot','\u0415':'IEcy','\u0435':'iecy','\xA1':'iexcl','\uD835\uDD26':'ifr','\u2111':'Im','\xCC':'Igrave','\xEC':'igrave','\u2148':'ii','\u2A0C':'qint','\u222D':'tint','\u29DC':'iinfin','\u2129':'iiota','\u0132':'IJlig','\u0133':'ijlig','\u012A':'Imacr','\u012B':'imacr','\u2110':'Iscr','\u0131':'imath','\u22B7':'imof','\u01B5':'imped','\u2105':'incare','\u221E':'infin','\u29DD':'infintie','\u22BA':'intcal','\u222B':'int','\u222C':'Int','\u2124':'Zopf','\u2A17':'intlarhk','\u2A3C':'iprod','\u2062':'it','\u0401':'IOcy','\u0451':'iocy','\u012E':'Iogon','\u012F':'iogon','\uD835\uDD40':'Iopf','\uD835\uDD5A':'iopf','\u0399':'Iota','\u03B9':'iota','\xBF':'iquest','\uD835\uDCBE':'iscr','\u22F5':'isindot','\u22F9':'isinE','\u22F4':'isins','\u22F3':'isinsv','\u0128':'Itilde','\u0129':'itilde','\u0406':'Iukcy','\u0456':'iukcy','\xCF':'Iuml','\xEF':'iuml','\u0134':'Jcirc','\u0135':'jcirc','\u0419':'Jcy','\u0439':'jcy','\uD835\uDD0D':'Jfr','\uD835\uDD27':'jfr','\u0237':'jmath','\uD835\uDD41':'Jopf','\uD835\uDD5B':'jopf','\uD835\uDCA5':'Jscr','\uD835\uDCBF':'jscr','\u0408':'Jsercy','\u0458':'jsercy','\u0404':'Jukcy','\u0454':'jukcy','\u039A':'Kappa','\u03BA':'kappa','\u03F0':'kappav','\u0136':'Kcedil','\u0137':'kcedil','\u041A':'Kcy','\u043A':'kcy','\uD835\uDD0E':'Kfr','\uD835\uDD28':'kfr','\u0138':'kgreen','\u0425':'KHcy','\u0445':'khcy','\u040C':'KJcy','\u045C':'kjcy','\uD835\uDD42':'Kopf','\uD835\uDD5C':'kopf','\uD835\uDCA6':'Kscr','\uD835\uDCC0':'kscr','\u21DA':'lAarr','\u0139':'Lacute','\u013A':'lacute','\u29B4':'laemptyv','\u2112':'Lscr','\u039B':'Lambda','\u03BB':'lambda','\u27E8':'lang','\u27EA':'Lang','\u2991':'langd','\u2A85':'lap','\xAB':'laquo','\u21E4':'larrb','\u291F':'larrbfs','\u2190':'larr','\u219E':'Larr','\u291D':'larrfs','\u21AB':'larrlp','\u2939':'larrpl','\u2973':'larrsim','\u21A2':'larrtl','\u2919':'latail','\u291B':'lAtail','\u2AAB':'lat','\u2AAD':'late','\u2AAD\uFE00':'lates','\u290C':'lbarr','\u290E':'lBarr','\u2772':'lbbrk','{':'lcub','[':'lsqb','\u298B':'lbrke','\u298F':'lbrksld','\u298D':'lbrkslu','\u013D':'Lcaron','\u013E':'lcaron','\u013B':'Lcedil','\u013C':'lcedil','\u2308':'lceil','\u041B':'Lcy','\u043B':'lcy','\u2936':'ldca','\u201C':'ldquo','\u2967':'ldrdhar','\u294B':'ldrushar','\u21B2':'ldsh','\u2264':'le','\u2266':'lE','\u21C6':'lrarr','\u27E6':'lobrk','\u2961':'LeftDownTeeVector','\u2959':'LeftDownVectorBar','\u230A':'lfloor','\u21BC':'lharu','\u21C7':'llarr','\u21CB':'lrhar','\u294E':'LeftRightVector','\u21A4':'mapstoleft','\u295A':'LeftTeeVector','\u22CB':'lthree','\u29CF':'LeftTriangleBar','\u22B2':'vltri','\u22B4':'ltrie','\u2951':'LeftUpDownVector','\u2960':'LeftUpTeeVector','\u2958':'LeftUpVectorBar','\u21BF':'uharl','\u2952':'LeftVectorBar','\u2A8B':'lEg','\u22DA':'leg','\u2A7D':'les','\u2AA8':'lescc','\u2A7F':'lesdot','\u2A81':'lesdoto','\u2A83':'lesdotor','\u22DA\uFE00':'lesg','\u2A93':'lesges','\u22D6':'ltdot','\u2276':'lg','\u2AA1':'LessLess','\u2272':'lsim','\u297C':'lfisht','\uD835\uDD0F':'Lfr','\uD835\uDD29':'lfr','\u2A91':'lgE','\u2962':'lHar','\u296A':'lharul','\u2584':'lhblk','\u0409':'LJcy','\u0459':'ljcy','\u226A':'ll','\u22D8':'Ll','\u296B':'llhard','\u25FA':'lltri','\u013F':'Lmidot','\u0140':'lmidot','\u23B0':'lmoust','\u2A89':'lnap','\u2A87':'lne','\u2268':'lnE','\u22E6':'lnsim','\u27EC':'loang','\u21FD':'loarr','\u27F5':'xlarr','\u27F7':'xharr','\u27FC':'xmap','\u27F6':'xrarr','\u21AC':'rarrlp','\u2985':'lopar','\uD835\uDD43':'Lopf','\uD835\uDD5D':'lopf','\u2A2D':'loplus','\u2A34':'lotimes','\u2217':'lowast','_':'lowbar','\u2199':'swarr','\u2198':'searr','\u25CA':'loz','(':'lpar','\u2993':'lparlt','\u296D':'lrhard','\u200E':'lrm','\u22BF':'lrtri','\u2039':'lsaquo','\uD835\uDCC1':'lscr','\u21B0':'lsh','\u2A8D':'lsime','\u2A8F':'lsimg','\u2018':'lsquo','\u201A':'sbquo','\u0141':'Lstrok','\u0142':'lstrok','\u2AA6':'ltcc','\u2A79':'ltcir','<':'lt','\u22C9':'ltimes','\u2976':'ltlarr','\u2A7B':'ltquest','\u25C3':'ltri','\u2996':'ltrPar','\u294A':'lurdshar','\u2966':'luruhar','\u2268\uFE00':'lvnE','\xAF':'macr','\u2642':'male','\u2720':'malt','\u2905':'Map','\u21A6':'map','\u21A5':'mapstoup','\u25AE':'marker','\u2A29':'mcomma','\u041C':'Mcy','\u043C':'mcy','\u2014':'mdash','\u223A':'mDDot','\u205F':'MediumSpace','\u2133':'Mscr','\uD835\uDD10':'Mfr','\uD835\uDD2A':'mfr','\u2127':'mho','\xB5':'micro','\u2AF0':'midcir','\u2223':'mid','\u2212':'minus','\u2A2A':'minusdu','\u2213':'mp','\u2ADB':'mlcp','\u22A7':'models','\uD835\uDD44':'Mopf','\uD835\uDD5E':'mopf','\uD835\uDCC2':'mscr','\u039C':'Mu','\u03BC':'mu','\u22B8':'mumap','\u0143':'Nacute','\u0144':'nacute','\u2220\u20D2':'nang','\u2249':'nap','\u2A70\u0338':'napE','\u224B\u0338':'napid','\u0149':'napos','\u266E':'natur','\u2115':'Nopf','\xA0':'nbsp','\u224E\u0338':'nbump','\u224F\u0338':'nbumpe','\u2A43':'ncap','\u0147':'Ncaron','\u0148':'ncaron','\u0145':'Ncedil','\u0146':'ncedil','\u2247':'ncong','\u2A6D\u0338':'ncongdot','\u2A42':'ncup','\u041D':'Ncy','\u043D':'ncy','\u2013':'ndash','\u2924':'nearhk','\u2197':'nearr','\u21D7':'neArr','\u2260':'ne','\u2250\u0338':'nedot','\u200B':'ZeroWidthSpace','\u2262':'nequiv','\u2928':'toea','\u2242\u0338':'nesim','\n':'NewLine','\u2204':'nexist','\uD835\uDD11':'Nfr','\uD835\uDD2B':'nfr','\u2267\u0338':'ngE','\u2271':'nge','\u2A7E\u0338':'nges','\u22D9\u0338':'nGg','\u2275':'ngsim','\u226B\u20D2':'nGt','\u226F':'ngt','\u226B\u0338':'nGtv','\u21AE':'nharr','\u21CE':'nhArr','\u2AF2':'nhpar','\u220B':'ni','\u22FC':'nis','\u22FA':'nisd','\u040A':'NJcy','\u045A':'njcy','\u219A':'nlarr','\u21CD':'nlArr','\u2025':'nldr','\u2266\u0338':'nlE','\u2270':'nle','\u2A7D\u0338':'nles','\u226E':'nlt','\u22D8\u0338':'nLl','\u2274':'nlsim','\u226A\u20D2':'nLt','\u22EA':'nltri','\u22EC':'nltrie','\u226A\u0338':'nLtv','\u2224':'nmid','\u2060':'NoBreak','\uD835\uDD5F':'nopf','\u2AEC':'Not','\xAC':'not','\u226D':'NotCupCap','\u2226':'npar','\u2209':'notin','\u2279':'ntgl','\u22F5\u0338':'notindot','\u22F9\u0338':'notinE','\u22F7':'notinvb','\u22F6':'notinvc','\u29CF\u0338':'NotLeftTriangleBar','\u2278':'ntlg','\u2AA2\u0338':'NotNestedGreaterGreater','\u2AA1\u0338':'NotNestedLessLess','\u220C':'notni','\u22FE':'notnivb','\u22FD':'notnivc','\u2280':'npr','\u2AAF\u0338':'npre','\u22E0':'nprcue','\u29D0\u0338':'NotRightTriangleBar','\u22EB':'nrtri','\u22ED':'nrtrie','\u228F\u0338':'NotSquareSubset','\u22E2':'nsqsube','\u2290\u0338':'NotSquareSuperset','\u22E3':'nsqsupe','\u2282\u20D2':'vnsub','\u2288':'nsube','\u2281':'nsc','\u2AB0\u0338':'nsce','\u22E1':'nsccue','\u227F\u0338':'NotSucceedsTilde','\u2283\u20D2':'vnsup','\u2289':'nsupe','\u2241':'nsim','\u2244':'nsime','\u2AFD\u20E5':'nparsl','\u2202\u0338':'npart','\u2A14':'npolint','\u2933\u0338':'nrarrc','\u219B':'nrarr','\u21CF':'nrArr','\u219D\u0338':'nrarrw','\uD835\uDCA9':'Nscr','\uD835\uDCC3':'nscr','\u2284':'nsub','\u2AC5\u0338':'nsubE','\u2285':'nsup','\u2AC6\u0338':'nsupE','\xD1':'Ntilde','\xF1':'ntilde','\u039D':'Nu','\u03BD':'nu','#':'num','\u2116':'numero','\u2007':'numsp','\u224D\u20D2':'nvap','\u22AC':'nvdash','\u22AD':'nvDash','\u22AE':'nVdash','\u22AF':'nVDash','\u2265\u20D2':'nvge','>\u20D2':'nvgt','\u2904':'nvHarr','\u29DE':'nvinfin','\u2902':'nvlArr','\u2264\u20D2':'nvle','<\u20D2':'nvlt','\u22B4\u20D2':'nvltrie','\u2903':'nvrArr','\u22B5\u20D2':'nvrtrie','\u223C\u20D2':'nvsim','\u2923':'nwarhk','\u2196':'nwarr','\u21D6':'nwArr','\u2927':'nwnear','\xD3':'Oacute','\xF3':'oacute','\xD4':'Ocirc','\xF4':'ocirc','\u041E':'Ocy','\u043E':'ocy','\u0150':'Odblac','\u0151':'odblac','\u2A38':'odiv','\u29BC':'odsold','\u0152':'OElig','\u0153':'oelig','\u29BF':'ofcir','\uD835\uDD12':'Ofr','\uD835\uDD2C':'ofr','\u02DB':'ogon','\xD2':'Ograve','\xF2':'ograve','\u29C1':'ogt','\u29B5':'ohbar','\u03A9':'ohm','\u29BE':'olcir','\u29BB':'olcross','\u203E':'oline','\u29C0':'olt','\u014C':'Omacr','\u014D':'omacr','\u03C9':'omega','\u039F':'Omicron','\u03BF':'omicron','\u29B6':'omid','\uD835\uDD46':'Oopf','\uD835\uDD60':'oopf','\u29B7':'opar','\u29B9':'operp','\u2A54':'Or','\u2228':'or','\u2A5D':'ord','\u2134':'oscr','\xAA':'ordf','\xBA':'ordm','\u22B6':'origof','\u2A56':'oror','\u2A57':'orslope','\u2A5B':'orv','\uD835\uDCAA':'Oscr','\xD8':'Oslash','\xF8':'oslash','\u2298':'osol','\xD5':'Otilde','\xF5':'otilde','\u2A36':'otimesas','\u2A37':'Otimes','\xD6':'Ouml','\xF6':'ouml','\u233D':'ovbar','\u23DE':'OverBrace','\u23B4':'tbrk','\u23DC':'OverParenthesis','\xB6':'para','\u2AF3':'parsim','\u2AFD':'parsl','\u2202':'part','\u041F':'Pcy','\u043F':'pcy','%':'percnt','.':'period','\u2030':'permil','\u2031':'pertenk','\uD835\uDD13':'Pfr','\uD835\uDD2D':'pfr','\u03A6':'Phi','\u03C6':'phi','\u03D5':'phiv','\u260E':'phone','\u03A0':'Pi','\u03C0':'pi','\u03D6':'piv','\u210E':'planckh','\u2A23':'plusacir','\u2A22':'pluscir','+':'plus','\u2A25':'plusdu','\u2A72':'pluse','\xB1':'pm','\u2A26':'plussim','\u2A27':'plustwo','\u2A15':'pointint','\uD835\uDD61':'popf','\u2119':'Popf','\xA3':'pound','\u2AB7':'prap','\u2ABB':'Pr','\u227A':'pr','\u227C':'prcue','\u2AAF':'pre','\u227E':'prsim','\u2AB9':'prnap','\u2AB5':'prnE','\u22E8':'prnsim','\u2AB3':'prE','\u2032':'prime','\u2033':'Prime','\u220F':'prod','\u232E':'profalar','\u2312':'profline','\u2313':'profsurf','\u221D':'prop','\u22B0':'prurel','\uD835\uDCAB':'Pscr','\uD835\uDCC5':'pscr','\u03A8':'Psi','\u03C8':'psi','\u2008':'puncsp','\uD835\uDD14':'Qfr','\uD835\uDD2E':'qfr','\uD835\uDD62':'qopf','\u211A':'Qopf','\u2057':'qprime','\uD835\uDCAC':'Qscr','\uD835\uDCC6':'qscr','\u2A16':'quatint','?':'quest','"':'quot','\u21DB':'rAarr','\u223D\u0331':'race','\u0154':'Racute','\u0155':'racute','\u221A':'Sqrt','\u29B3':'raemptyv','\u27E9':'rang','\u27EB':'Rang','\u2992':'rangd','\u29A5':'range','\xBB':'raquo','\u2975':'rarrap','\u21E5':'rarrb','\u2920':'rarrbfs','\u2933':'rarrc','\u2192':'rarr','\u21A0':'Rarr','\u291E':'rarrfs','\u2945':'rarrpl','\u2974':'rarrsim','\u2916':'Rarrtl','\u21A3':'rarrtl','\u219D':'rarrw','\u291A':'ratail','\u291C':'rAtail','\u2236':'ratio','\u2773':'rbbrk','}':'rcub',']':'rsqb','\u298C':'rbrke','\u298E':'rbrksld','\u2990':'rbrkslu','\u0158':'Rcaron','\u0159':'rcaron','\u0156':'Rcedil','\u0157':'rcedil','\u2309':'rceil','\u0420':'Rcy','\u0440':'rcy','\u2937':'rdca','\u2969':'rdldhar','\u21B3':'rdsh','\u211C':'Re','\u211B':'Rscr','\u211D':'Ropf','\u25AD':'rect','\u297D':'rfisht','\u230B':'rfloor','\uD835\uDD2F':'rfr','\u2964':'rHar','\u21C0':'rharu','\u296C':'rharul','\u03A1':'Rho','\u03C1':'rho','\u03F1':'rhov','\u21C4':'rlarr','\u27E7':'robrk','\u295D':'RightDownTeeVector','\u2955':'RightDownVectorBar','\u21C9':'rrarr','\u22A2':'vdash','\u295B':'RightTeeVector','\u22CC':'rthree','\u29D0':'RightTriangleBar','\u22B3':'vrtri','\u22B5':'rtrie','\u294F':'RightUpDownVector','\u295C':'RightUpTeeVector','\u2954':'RightUpVectorBar','\u21BE':'uharr','\u2953':'RightVectorBar','\u02DA':'ring','\u200F':'rlm','\u23B1':'rmoust','\u2AEE':'rnmid','\u27ED':'roang','\u21FE':'roarr','\u2986':'ropar','\uD835\uDD63':'ropf','\u2A2E':'roplus','\u2A35':'rotimes','\u2970':'RoundImplies',')':'rpar','\u2994':'rpargt','\u2A12':'rppolint','\u203A':'rsaquo','\uD835\uDCC7':'rscr','\u21B1':'rsh','\u22CA':'rtimes','\u25B9':'rtri','\u29CE':'rtriltri','\u29F4':'RuleDelayed','\u2968':'ruluhar','\u211E':'rx','\u015A':'Sacute','\u015B':'sacute','\u2AB8':'scap','\u0160':'Scaron','\u0161':'scaron','\u2ABC':'Sc','\u227B':'sc','\u227D':'sccue','\u2AB0':'sce','\u2AB4':'scE','\u015E':'Scedil','\u015F':'scedil','\u015C':'Scirc','\u015D':'scirc','\u2ABA':'scnap','\u2AB6':'scnE','\u22E9':'scnsim','\u2A13':'scpolint','\u227F':'scsim','\u0421':'Scy','\u0441':'scy','\u22C5':'sdot','\u2A66':'sdote','\u21D8':'seArr','\xA7':'sect',';':'semi','\u2929':'tosa','\u2736':'sext','\uD835\uDD16':'Sfr','\uD835\uDD30':'sfr','\u266F':'sharp','\u0429':'SHCHcy','\u0449':'shchcy','\u0428':'SHcy','\u0448':'shcy','\u2191':'uarr','\xAD':'shy','\u03A3':'Sigma','\u03C3':'sigma','\u03C2':'sigmaf','\u223C':'sim','\u2A6A':'simdot','\u2243':'sime','\u2A9E':'simg','\u2AA0':'simgE','\u2A9D':'siml','\u2A9F':'simlE','\u2246':'simne','\u2A24':'simplus','\u2972':'simrarr','\u2A33':'smashp','\u29E4':'smeparsl','\u2323':'smile','\u2AAA':'smt','\u2AAC':'smte','\u2AAC\uFE00':'smtes','\u042C':'SOFTcy','\u044C':'softcy','\u233F':'solbar','\u29C4':'solb','/':'sol','\uD835\uDD4A':'Sopf','\uD835\uDD64':'sopf','\u2660':'spades','\u2293':'sqcap','\u2293\uFE00':'sqcaps','\u2294':'sqcup','\u2294\uFE00':'sqcups','\u228F':'sqsub','\u2291':'sqsube','\u2290':'sqsup','\u2292':'sqsupe','\u25A1':'squ','\uD835\uDCAE':'Sscr','\uD835\uDCC8':'sscr','\u22C6':'Star','\u2606':'star','\u2282':'sub','\u22D0':'Sub','\u2ABD':'subdot','\u2AC5':'subE','\u2286':'sube','\u2AC3':'subedot','\u2AC1':'submult','\u2ACB':'subnE','\u228A':'subne','\u2ABF':'subplus','\u2979':'subrarr','\u2AC7':'subsim','\u2AD5':'subsub','\u2AD3':'subsup','\u2211':'sum','\u266A':'sung','\xB9':'sup1','\xB2':'sup2','\xB3':'sup3','\u2283':'sup','\u22D1':'Sup','\u2ABE':'supdot','\u2AD8':'supdsub','\u2AC6':'supE','\u2287':'supe','\u2AC4':'supedot','\u27C9':'suphsol','\u2AD7':'suphsub','\u297B':'suplarr','\u2AC2':'supmult','\u2ACC':'supnE','\u228B':'supne','\u2AC0':'supplus','\u2AC8':'supsim','\u2AD4':'supsub','\u2AD6':'supsup','\u21D9':'swArr','\u292A':'swnwar','\xDF':'szlig','\t':'Tab','\u2316':'target','\u03A4':'Tau','\u03C4':'tau','\u0164':'Tcaron','\u0165':'tcaron','\u0162':'Tcedil','\u0163':'tcedil','\u0422':'Tcy','\u0442':'tcy','\u20DB':'tdot','\u2315':'telrec','\uD835\uDD17':'Tfr','\uD835\uDD31':'tfr','\u2234':'there4','\u0398':'Theta','\u03B8':'theta','\u03D1':'thetav','\u205F\u200A':'ThickSpace','\u2009':'thinsp','\xDE':'THORN','\xFE':'thorn','\u2A31':'timesbar','\xD7':'times','\u2A30':'timesd','\u2336':'topbot','\u2AF1':'topcir','\uD835\uDD4B':'Topf','\uD835\uDD65':'topf','\u2ADA':'topfork','\u2034':'tprime','\u2122':'trade','\u25B5':'utri','\u225C':'trie','\u25EC':'tridot','\u2A3A':'triminus','\u2A39':'triplus','\u29CD':'trisb','\u2A3B':'tritime','\u23E2':'trpezium','\uD835\uDCAF':'Tscr','\uD835\uDCC9':'tscr','\u0426':'TScy','\u0446':'tscy','\u040B':'TSHcy','\u045B':'tshcy','\u0166':'Tstrok','\u0167':'tstrok','\xDA':'Uacute','\xFA':'uacute','\u219F':'Uarr','\u2949':'Uarrocir','\u040E':'Ubrcy','\u045E':'ubrcy','\u016C':'Ubreve','\u016D':'ubreve','\xDB':'Ucirc','\xFB':'ucirc','\u0423':'Ucy','\u0443':'ucy','\u21C5':'udarr','\u0170':'Udblac','\u0171':'udblac','\u296E':'udhar','\u297E':'ufisht','\uD835\uDD18':'Ufr','\uD835\uDD32':'ufr','\xD9':'Ugrave','\xF9':'ugrave','\u2963':'uHar','\u2580':'uhblk','\u231C':'ulcorn','\u230F':'ulcrop','\u25F8':'ultri','\u016A':'Umacr','\u016B':'umacr','\u23DF':'UnderBrace','\u23DD':'UnderParenthesis','\u228E':'uplus','\u0172':'Uogon','\u0173':'uogon','\uD835\uDD4C':'Uopf','\uD835\uDD66':'uopf','\u2912':'UpArrowBar','\u2195':'varr','\u03C5':'upsi','\u03D2':'Upsi','\u03A5':'Upsilon','\u21C8':'uuarr','\u231D':'urcorn','\u230E':'urcrop','\u016E':'Uring','\u016F':'uring','\u25F9':'urtri','\uD835\uDCB0':'Uscr','\uD835\uDCCA':'uscr','\u22F0':'utdot','\u0168':'Utilde','\u0169':'utilde','\xDC':'Uuml','\xFC':'uuml','\u29A7':'uwangle','\u299C':'vangrt','\u228A\uFE00':'vsubne','\u2ACB\uFE00':'vsubnE','\u228B\uFE00':'vsupne','\u2ACC\uFE00':'vsupnE','\u2AE8':'vBar','\u2AEB':'Vbar','\u2AE9':'vBarv','\u0412':'Vcy','\u0432':'vcy','\u22A9':'Vdash','\u22AB':'VDash','\u2AE6':'Vdashl','\u22BB':'veebar','\u225A':'veeeq','\u22EE':'vellip','|':'vert','\u2016':'Vert','\u2758':'VerticalSeparator','\u2240':'wr','\uD835\uDD19':'Vfr','\uD835\uDD33':'vfr','\uD835\uDD4D':'Vopf','\uD835\uDD67':'vopf','\uD835\uDCB1':'Vscr','\uD835\uDCCB':'vscr','\u22AA':'Vvdash','\u299A':'vzigzag','\u0174':'Wcirc','\u0175':'wcirc','\u2A5F':'wedbar','\u2259':'wedgeq','\u2118':'wp','\uD835\uDD1A':'Wfr','\uD835\uDD34':'wfr','\uD835\uDD4E':'Wopf','\uD835\uDD68':'wopf','\uD835\uDCB2':'Wscr','\uD835\uDCCC':'wscr','\uD835\uDD1B':'Xfr','\uD835\uDD35':'xfr','\u039E':'Xi','\u03BE':'xi','\u22FB':'xnis','\uD835\uDD4F':'Xopf','\uD835\uDD69':'xopf','\uD835\uDCB3':'Xscr','\uD835\uDCCD':'xscr','\xDD':'Yacute','\xFD':'yacute','\u042F':'YAcy','\u044F':'yacy','\u0176':'Ycirc','\u0177':'ycirc','\u042B':'Ycy','\u044B':'ycy','\xA5':'yen','\uD835\uDD1C':'Yfr','\uD835\uDD36':'yfr','\u0407':'YIcy','\u0457':'yicy','\uD835\uDD50':'Yopf','\uD835\uDD6A':'yopf','\uD835\uDCB4':'Yscr','\uD835\uDCCE':'yscr','\u042E':'YUcy','\u044E':'yucy','\xFF':'yuml','\u0178':'Yuml','\u0179':'Zacute','\u017A':'zacute','\u017D':'Zcaron','\u017E':'zcaron','\u0417':'Zcy','\u0437':'zcy','\u017B':'Zdot','\u017C':'zdot','\u2128':'Zfr','\u0396':'Zeta','\u03B6':'zeta','\uD835\uDD37':'zfr','\u0416':'ZHcy','\u0436':'zhcy','\u21DD':'zigrarr','\uD835\uDD6B':'zopf','\uD835\uDCB5':'Zscr','\uD835\uDCCF':'zscr','\u200D':'zwj','\u200C':'zwnj'}; + + var regexEscape = /["&'<>`]/g; + var escapeMap = { + '"': '"', + '&': '&', + '\'': ''', + '<': '<', + // See https://mathiasbynens.be/notes/ambiguous-ampersands: in HTML, the + // following is not strictly necessary unless it’s part of a tag or an + // unquoted attribute value. We’re only escaping it to support those + // situations, and for XML support. + '>': '>', + // In Internet Explorer ≤ 8, the backtick character can be used + // to break out of (un)quoted attribute values or HTML comments. + // See http://html5sec.org/#102, http://html5sec.org/#108, and + // http://html5sec.org/#133. + '`': '`' + }; + + var regexInvalidEntity = /&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/; + var regexInvalidRawCodePoint = /[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + var regexDecode = /&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|iacute|Uacute|plusmn|otilde|Otilde|Agrave|agrave|yacute|Yacute|oslash|Oslash|Atilde|atilde|brvbar|Ccedil|ccedil|ograve|curren|divide|Eacute|eacute|Ograve|oacute|Egrave|egrave|ugrave|frac12|frac14|frac34|Ugrave|Oacute|Iacute|ntilde|Ntilde|uacute|middot|Igrave|igrave|iquest|aacute|laquo|THORN|micro|iexcl|icirc|Icirc|Acirc|ucirc|ecirc|Ocirc|ocirc|Ecirc|Ucirc|aring|Aring|aelig|AElig|acute|pound|raquo|acirc|times|thorn|szlig|cedil|COPY|Auml|ordf|ordm|uuml|macr|Uuml|auml|Ouml|ouml|para|nbsp|Euml|quot|QUOT|euml|yuml|cent|sect|copy|sup1|sup2|sup3|Iuml|iuml|shy|eth|reg|not|yen|amp|AMP|REG|uml|ETH|deg|gt|GT|LT|lt)([=a-zA-Z0-9])?/g; + var decodeMap = {'Aacute':'\xC1','aacute':'\xE1','Abreve':'\u0102','abreve':'\u0103','ac':'\u223E','acd':'\u223F','acE':'\u223E\u0333','Acirc':'\xC2','acirc':'\xE2','acute':'\xB4','Acy':'\u0410','acy':'\u0430','AElig':'\xC6','aelig':'\xE6','af':'\u2061','Afr':'\uD835\uDD04','afr':'\uD835\uDD1E','Agrave':'\xC0','agrave':'\xE0','alefsym':'\u2135','aleph':'\u2135','Alpha':'\u0391','alpha':'\u03B1','Amacr':'\u0100','amacr':'\u0101','amalg':'\u2A3F','amp':'&','AMP':'&','andand':'\u2A55','And':'\u2A53','and':'\u2227','andd':'\u2A5C','andslope':'\u2A58','andv':'\u2A5A','ang':'\u2220','ange':'\u29A4','angle':'\u2220','angmsdaa':'\u29A8','angmsdab':'\u29A9','angmsdac':'\u29AA','angmsdad':'\u29AB','angmsdae':'\u29AC','angmsdaf':'\u29AD','angmsdag':'\u29AE','angmsdah':'\u29AF','angmsd':'\u2221','angrt':'\u221F','angrtvb':'\u22BE','angrtvbd':'\u299D','angsph':'\u2222','angst':'\xC5','angzarr':'\u237C','Aogon':'\u0104','aogon':'\u0105','Aopf':'\uD835\uDD38','aopf':'\uD835\uDD52','apacir':'\u2A6F','ap':'\u2248','apE':'\u2A70','ape':'\u224A','apid':'\u224B','apos':'\'','ApplyFunction':'\u2061','approx':'\u2248','approxeq':'\u224A','Aring':'\xC5','aring':'\xE5','Ascr':'\uD835\uDC9C','ascr':'\uD835\uDCB6','Assign':'\u2254','ast':'*','asymp':'\u2248','asympeq':'\u224D','Atilde':'\xC3','atilde':'\xE3','Auml':'\xC4','auml':'\xE4','awconint':'\u2233','awint':'\u2A11','backcong':'\u224C','backepsilon':'\u03F6','backprime':'\u2035','backsim':'\u223D','backsimeq':'\u22CD','Backslash':'\u2216','Barv':'\u2AE7','barvee':'\u22BD','barwed':'\u2305','Barwed':'\u2306','barwedge':'\u2305','bbrk':'\u23B5','bbrktbrk':'\u23B6','bcong':'\u224C','Bcy':'\u0411','bcy':'\u0431','bdquo':'\u201E','becaus':'\u2235','because':'\u2235','Because':'\u2235','bemptyv':'\u29B0','bepsi':'\u03F6','bernou':'\u212C','Bernoullis':'\u212C','Beta':'\u0392','beta':'\u03B2','beth':'\u2136','between':'\u226C','Bfr':'\uD835\uDD05','bfr':'\uD835\uDD1F','bigcap':'\u22C2','bigcirc':'\u25EF','bigcup':'\u22C3','bigodot':'\u2A00','bigoplus':'\u2A01','bigotimes':'\u2A02','bigsqcup':'\u2A06','bigstar':'\u2605','bigtriangledown':'\u25BD','bigtriangleup':'\u25B3','biguplus':'\u2A04','bigvee':'\u22C1','bigwedge':'\u22C0','bkarow':'\u290D','blacklozenge':'\u29EB','blacksquare':'\u25AA','blacktriangle':'\u25B4','blacktriangledown':'\u25BE','blacktriangleleft':'\u25C2','blacktriangleright':'\u25B8','blank':'\u2423','blk12':'\u2592','blk14':'\u2591','blk34':'\u2593','block':'\u2588','bne':'=\u20E5','bnequiv':'\u2261\u20E5','bNot':'\u2AED','bnot':'\u2310','Bopf':'\uD835\uDD39','bopf':'\uD835\uDD53','bot':'\u22A5','bottom':'\u22A5','bowtie':'\u22C8','boxbox':'\u29C9','boxdl':'\u2510','boxdL':'\u2555','boxDl':'\u2556','boxDL':'\u2557','boxdr':'\u250C','boxdR':'\u2552','boxDr':'\u2553','boxDR':'\u2554','boxh':'\u2500','boxH':'\u2550','boxhd':'\u252C','boxHd':'\u2564','boxhD':'\u2565','boxHD':'\u2566','boxhu':'\u2534','boxHu':'\u2567','boxhU':'\u2568','boxHU':'\u2569','boxminus':'\u229F','boxplus':'\u229E','boxtimes':'\u22A0','boxul':'\u2518','boxuL':'\u255B','boxUl':'\u255C','boxUL':'\u255D','boxur':'\u2514','boxuR':'\u2558','boxUr':'\u2559','boxUR':'\u255A','boxv':'\u2502','boxV':'\u2551','boxvh':'\u253C','boxvH':'\u256A','boxVh':'\u256B','boxVH':'\u256C','boxvl':'\u2524','boxvL':'\u2561','boxVl':'\u2562','boxVL':'\u2563','boxvr':'\u251C','boxvR':'\u255E','boxVr':'\u255F','boxVR':'\u2560','bprime':'\u2035','breve':'\u02D8','Breve':'\u02D8','brvbar':'\xA6','bscr':'\uD835\uDCB7','Bscr':'\u212C','bsemi':'\u204F','bsim':'\u223D','bsime':'\u22CD','bsolb':'\u29C5','bsol':'\\','bsolhsub':'\u27C8','bull':'\u2022','bullet':'\u2022','bump':'\u224E','bumpE':'\u2AAE','bumpe':'\u224F','Bumpeq':'\u224E','bumpeq':'\u224F','Cacute':'\u0106','cacute':'\u0107','capand':'\u2A44','capbrcup':'\u2A49','capcap':'\u2A4B','cap':'\u2229','Cap':'\u22D2','capcup':'\u2A47','capdot':'\u2A40','CapitalDifferentialD':'\u2145','caps':'\u2229\uFE00','caret':'\u2041','caron':'\u02C7','Cayleys':'\u212D','ccaps':'\u2A4D','Ccaron':'\u010C','ccaron':'\u010D','Ccedil':'\xC7','ccedil':'\xE7','Ccirc':'\u0108','ccirc':'\u0109','Cconint':'\u2230','ccups':'\u2A4C','ccupssm':'\u2A50','Cdot':'\u010A','cdot':'\u010B','cedil':'\xB8','Cedilla':'\xB8','cemptyv':'\u29B2','cent':'\xA2','centerdot':'\xB7','CenterDot':'\xB7','cfr':'\uD835\uDD20','Cfr':'\u212D','CHcy':'\u0427','chcy':'\u0447','check':'\u2713','checkmark':'\u2713','Chi':'\u03A7','chi':'\u03C7','circ':'\u02C6','circeq':'\u2257','circlearrowleft':'\u21BA','circlearrowright':'\u21BB','circledast':'\u229B','circledcirc':'\u229A','circleddash':'\u229D','CircleDot':'\u2299','circledR':'\xAE','circledS':'\u24C8','CircleMinus':'\u2296','CirclePlus':'\u2295','CircleTimes':'\u2297','cir':'\u25CB','cirE':'\u29C3','cire':'\u2257','cirfnint':'\u2A10','cirmid':'\u2AEF','cirscir':'\u29C2','ClockwiseContourIntegral':'\u2232','CloseCurlyDoubleQuote':'\u201D','CloseCurlyQuote':'\u2019','clubs':'\u2663','clubsuit':'\u2663','colon':':','Colon':'\u2237','Colone':'\u2A74','colone':'\u2254','coloneq':'\u2254','comma':',','commat':'@','comp':'\u2201','compfn':'\u2218','complement':'\u2201','complexes':'\u2102','cong':'\u2245','congdot':'\u2A6D','Congruent':'\u2261','conint':'\u222E','Conint':'\u222F','ContourIntegral':'\u222E','copf':'\uD835\uDD54','Copf':'\u2102','coprod':'\u2210','Coproduct':'\u2210','copy':'\xA9','COPY':'\xA9','copysr':'\u2117','CounterClockwiseContourIntegral':'\u2233','crarr':'\u21B5','cross':'\u2717','Cross':'\u2A2F','Cscr':'\uD835\uDC9E','cscr':'\uD835\uDCB8','csub':'\u2ACF','csube':'\u2AD1','csup':'\u2AD0','csupe':'\u2AD2','ctdot':'\u22EF','cudarrl':'\u2938','cudarrr':'\u2935','cuepr':'\u22DE','cuesc':'\u22DF','cularr':'\u21B6','cularrp':'\u293D','cupbrcap':'\u2A48','cupcap':'\u2A46','CupCap':'\u224D','cup':'\u222A','Cup':'\u22D3','cupcup':'\u2A4A','cupdot':'\u228D','cupor':'\u2A45','cups':'\u222A\uFE00','curarr':'\u21B7','curarrm':'\u293C','curlyeqprec':'\u22DE','curlyeqsucc':'\u22DF','curlyvee':'\u22CE','curlywedge':'\u22CF','curren':'\xA4','curvearrowleft':'\u21B6','curvearrowright':'\u21B7','cuvee':'\u22CE','cuwed':'\u22CF','cwconint':'\u2232','cwint':'\u2231','cylcty':'\u232D','dagger':'\u2020','Dagger':'\u2021','daleth':'\u2138','darr':'\u2193','Darr':'\u21A1','dArr':'\u21D3','dash':'\u2010','Dashv':'\u2AE4','dashv':'\u22A3','dbkarow':'\u290F','dblac':'\u02DD','Dcaron':'\u010E','dcaron':'\u010F','Dcy':'\u0414','dcy':'\u0434','ddagger':'\u2021','ddarr':'\u21CA','DD':'\u2145','dd':'\u2146','DDotrahd':'\u2911','ddotseq':'\u2A77','deg':'\xB0','Del':'\u2207','Delta':'\u0394','delta':'\u03B4','demptyv':'\u29B1','dfisht':'\u297F','Dfr':'\uD835\uDD07','dfr':'\uD835\uDD21','dHar':'\u2965','dharl':'\u21C3','dharr':'\u21C2','DiacriticalAcute':'\xB4','DiacriticalDot':'\u02D9','DiacriticalDoubleAcute':'\u02DD','DiacriticalGrave':'`','DiacriticalTilde':'\u02DC','diam':'\u22C4','diamond':'\u22C4','Diamond':'\u22C4','diamondsuit':'\u2666','diams':'\u2666','die':'\xA8','DifferentialD':'\u2146','digamma':'\u03DD','disin':'\u22F2','div':'\xF7','divide':'\xF7','divideontimes':'\u22C7','divonx':'\u22C7','DJcy':'\u0402','djcy':'\u0452','dlcorn':'\u231E','dlcrop':'\u230D','dollar':'$','Dopf':'\uD835\uDD3B','dopf':'\uD835\uDD55','Dot':'\xA8','dot':'\u02D9','DotDot':'\u20DC','doteq':'\u2250','doteqdot':'\u2251','DotEqual':'\u2250','dotminus':'\u2238','dotplus':'\u2214','dotsquare':'\u22A1','doublebarwedge':'\u2306','DoubleContourIntegral':'\u222F','DoubleDot':'\xA8','DoubleDownArrow':'\u21D3','DoubleLeftArrow':'\u21D0','DoubleLeftRightArrow':'\u21D4','DoubleLeftTee':'\u2AE4','DoubleLongLeftArrow':'\u27F8','DoubleLongLeftRightArrow':'\u27FA','DoubleLongRightArrow':'\u27F9','DoubleRightArrow':'\u21D2','DoubleRightTee':'\u22A8','DoubleUpArrow':'\u21D1','DoubleUpDownArrow':'\u21D5','DoubleVerticalBar':'\u2225','DownArrowBar':'\u2913','downarrow':'\u2193','DownArrow':'\u2193','Downarrow':'\u21D3','DownArrowUpArrow':'\u21F5','DownBreve':'\u0311','downdownarrows':'\u21CA','downharpoonleft':'\u21C3','downharpoonright':'\u21C2','DownLeftRightVector':'\u2950','DownLeftTeeVector':'\u295E','DownLeftVectorBar':'\u2956','DownLeftVector':'\u21BD','DownRightTeeVector':'\u295F','DownRightVectorBar':'\u2957','DownRightVector':'\u21C1','DownTeeArrow':'\u21A7','DownTee':'\u22A4','drbkarow':'\u2910','drcorn':'\u231F','drcrop':'\u230C','Dscr':'\uD835\uDC9F','dscr':'\uD835\uDCB9','DScy':'\u0405','dscy':'\u0455','dsol':'\u29F6','Dstrok':'\u0110','dstrok':'\u0111','dtdot':'\u22F1','dtri':'\u25BF','dtrif':'\u25BE','duarr':'\u21F5','duhar':'\u296F','dwangle':'\u29A6','DZcy':'\u040F','dzcy':'\u045F','dzigrarr':'\u27FF','Eacute':'\xC9','eacute':'\xE9','easter':'\u2A6E','Ecaron':'\u011A','ecaron':'\u011B','Ecirc':'\xCA','ecirc':'\xEA','ecir':'\u2256','ecolon':'\u2255','Ecy':'\u042D','ecy':'\u044D','eDDot':'\u2A77','Edot':'\u0116','edot':'\u0117','eDot':'\u2251','ee':'\u2147','efDot':'\u2252','Efr':'\uD835\uDD08','efr':'\uD835\uDD22','eg':'\u2A9A','Egrave':'\xC8','egrave':'\xE8','egs':'\u2A96','egsdot':'\u2A98','el':'\u2A99','Element':'\u2208','elinters':'\u23E7','ell':'\u2113','els':'\u2A95','elsdot':'\u2A97','Emacr':'\u0112','emacr':'\u0113','empty':'\u2205','emptyset':'\u2205','EmptySmallSquare':'\u25FB','emptyv':'\u2205','EmptyVerySmallSquare':'\u25AB','emsp13':'\u2004','emsp14':'\u2005','emsp':'\u2003','ENG':'\u014A','eng':'\u014B','ensp':'\u2002','Eogon':'\u0118','eogon':'\u0119','Eopf':'\uD835\uDD3C','eopf':'\uD835\uDD56','epar':'\u22D5','eparsl':'\u29E3','eplus':'\u2A71','epsi':'\u03B5','Epsilon':'\u0395','epsilon':'\u03B5','epsiv':'\u03F5','eqcirc':'\u2256','eqcolon':'\u2255','eqsim':'\u2242','eqslantgtr':'\u2A96','eqslantless':'\u2A95','Equal':'\u2A75','equals':'=','EqualTilde':'\u2242','equest':'\u225F','Equilibrium':'\u21CC','equiv':'\u2261','equivDD':'\u2A78','eqvparsl':'\u29E5','erarr':'\u2971','erDot':'\u2253','escr':'\u212F','Escr':'\u2130','esdot':'\u2250','Esim':'\u2A73','esim':'\u2242','Eta':'\u0397','eta':'\u03B7','ETH':'\xD0','eth':'\xF0','Euml':'\xCB','euml':'\xEB','euro':'\u20AC','excl':'!','exist':'\u2203','Exists':'\u2203','expectation':'\u2130','exponentiale':'\u2147','ExponentialE':'\u2147','fallingdotseq':'\u2252','Fcy':'\u0424','fcy':'\u0444','female':'\u2640','ffilig':'\uFB03','fflig':'\uFB00','ffllig':'\uFB04','Ffr':'\uD835\uDD09','ffr':'\uD835\uDD23','filig':'\uFB01','FilledSmallSquare':'\u25FC','FilledVerySmallSquare':'\u25AA','fjlig':'fj','flat':'\u266D','fllig':'\uFB02','fltns':'\u25B1','fnof':'\u0192','Fopf':'\uD835\uDD3D','fopf':'\uD835\uDD57','forall':'\u2200','ForAll':'\u2200','fork':'\u22D4','forkv':'\u2AD9','Fouriertrf':'\u2131','fpartint':'\u2A0D','frac12':'\xBD','frac13':'\u2153','frac14':'\xBC','frac15':'\u2155','frac16':'\u2159','frac18':'\u215B','frac23':'\u2154','frac25':'\u2156','frac34':'\xBE','frac35':'\u2157','frac38':'\u215C','frac45':'\u2158','frac56':'\u215A','frac58':'\u215D','frac78':'\u215E','frasl':'\u2044','frown':'\u2322','fscr':'\uD835\uDCBB','Fscr':'\u2131','gacute':'\u01F5','Gamma':'\u0393','gamma':'\u03B3','Gammad':'\u03DC','gammad':'\u03DD','gap':'\u2A86','Gbreve':'\u011E','gbreve':'\u011F','Gcedil':'\u0122','Gcirc':'\u011C','gcirc':'\u011D','Gcy':'\u0413','gcy':'\u0433','Gdot':'\u0120','gdot':'\u0121','ge':'\u2265','gE':'\u2267','gEl':'\u2A8C','gel':'\u22DB','geq':'\u2265','geqq':'\u2267','geqslant':'\u2A7E','gescc':'\u2AA9','ges':'\u2A7E','gesdot':'\u2A80','gesdoto':'\u2A82','gesdotol':'\u2A84','gesl':'\u22DB\uFE00','gesles':'\u2A94','Gfr':'\uD835\uDD0A','gfr':'\uD835\uDD24','gg':'\u226B','Gg':'\u22D9','ggg':'\u22D9','gimel':'\u2137','GJcy':'\u0403','gjcy':'\u0453','gla':'\u2AA5','gl':'\u2277','glE':'\u2A92','glj':'\u2AA4','gnap':'\u2A8A','gnapprox':'\u2A8A','gne':'\u2A88','gnE':'\u2269','gneq':'\u2A88','gneqq':'\u2269','gnsim':'\u22E7','Gopf':'\uD835\uDD3E','gopf':'\uD835\uDD58','grave':'`','GreaterEqual':'\u2265','GreaterEqualLess':'\u22DB','GreaterFullEqual':'\u2267','GreaterGreater':'\u2AA2','GreaterLess':'\u2277','GreaterSlantEqual':'\u2A7E','GreaterTilde':'\u2273','Gscr':'\uD835\uDCA2','gscr':'\u210A','gsim':'\u2273','gsime':'\u2A8E','gsiml':'\u2A90','gtcc':'\u2AA7','gtcir':'\u2A7A','gt':'>','GT':'>','Gt':'\u226B','gtdot':'\u22D7','gtlPar':'\u2995','gtquest':'\u2A7C','gtrapprox':'\u2A86','gtrarr':'\u2978','gtrdot':'\u22D7','gtreqless':'\u22DB','gtreqqless':'\u2A8C','gtrless':'\u2277','gtrsim':'\u2273','gvertneqq':'\u2269\uFE00','gvnE':'\u2269\uFE00','Hacek':'\u02C7','hairsp':'\u200A','half':'\xBD','hamilt':'\u210B','HARDcy':'\u042A','hardcy':'\u044A','harrcir':'\u2948','harr':'\u2194','hArr':'\u21D4','harrw':'\u21AD','Hat':'^','hbar':'\u210F','Hcirc':'\u0124','hcirc':'\u0125','hearts':'\u2665','heartsuit':'\u2665','hellip':'\u2026','hercon':'\u22B9','hfr':'\uD835\uDD25','Hfr':'\u210C','HilbertSpace':'\u210B','hksearow':'\u2925','hkswarow':'\u2926','hoarr':'\u21FF','homtht':'\u223B','hookleftarrow':'\u21A9','hookrightarrow':'\u21AA','hopf':'\uD835\uDD59','Hopf':'\u210D','horbar':'\u2015','HorizontalLine':'\u2500','hscr':'\uD835\uDCBD','Hscr':'\u210B','hslash':'\u210F','Hstrok':'\u0126','hstrok':'\u0127','HumpDownHump':'\u224E','HumpEqual':'\u224F','hybull':'\u2043','hyphen':'\u2010','Iacute':'\xCD','iacute':'\xED','ic':'\u2063','Icirc':'\xCE','icirc':'\xEE','Icy':'\u0418','icy':'\u0438','Idot':'\u0130','IEcy':'\u0415','iecy':'\u0435','iexcl':'\xA1','iff':'\u21D4','ifr':'\uD835\uDD26','Ifr':'\u2111','Igrave':'\xCC','igrave':'\xEC','ii':'\u2148','iiiint':'\u2A0C','iiint':'\u222D','iinfin':'\u29DC','iiota':'\u2129','IJlig':'\u0132','ijlig':'\u0133','Imacr':'\u012A','imacr':'\u012B','image':'\u2111','ImaginaryI':'\u2148','imagline':'\u2110','imagpart':'\u2111','imath':'\u0131','Im':'\u2111','imof':'\u22B7','imped':'\u01B5','Implies':'\u21D2','incare':'\u2105','in':'\u2208','infin':'\u221E','infintie':'\u29DD','inodot':'\u0131','intcal':'\u22BA','int':'\u222B','Int':'\u222C','integers':'\u2124','Integral':'\u222B','intercal':'\u22BA','Intersection':'\u22C2','intlarhk':'\u2A17','intprod':'\u2A3C','InvisibleComma':'\u2063','InvisibleTimes':'\u2062','IOcy':'\u0401','iocy':'\u0451','Iogon':'\u012E','iogon':'\u012F','Iopf':'\uD835\uDD40','iopf':'\uD835\uDD5A','Iota':'\u0399','iota':'\u03B9','iprod':'\u2A3C','iquest':'\xBF','iscr':'\uD835\uDCBE','Iscr':'\u2110','isin':'\u2208','isindot':'\u22F5','isinE':'\u22F9','isins':'\u22F4','isinsv':'\u22F3','isinv':'\u2208','it':'\u2062','Itilde':'\u0128','itilde':'\u0129','Iukcy':'\u0406','iukcy':'\u0456','Iuml':'\xCF','iuml':'\xEF','Jcirc':'\u0134','jcirc':'\u0135','Jcy':'\u0419','jcy':'\u0439','Jfr':'\uD835\uDD0D','jfr':'\uD835\uDD27','jmath':'\u0237','Jopf':'\uD835\uDD41','jopf':'\uD835\uDD5B','Jscr':'\uD835\uDCA5','jscr':'\uD835\uDCBF','Jsercy':'\u0408','jsercy':'\u0458','Jukcy':'\u0404','jukcy':'\u0454','Kappa':'\u039A','kappa':'\u03BA','kappav':'\u03F0','Kcedil':'\u0136','kcedil':'\u0137','Kcy':'\u041A','kcy':'\u043A','Kfr':'\uD835\uDD0E','kfr':'\uD835\uDD28','kgreen':'\u0138','KHcy':'\u0425','khcy':'\u0445','KJcy':'\u040C','kjcy':'\u045C','Kopf':'\uD835\uDD42','kopf':'\uD835\uDD5C','Kscr':'\uD835\uDCA6','kscr':'\uD835\uDCC0','lAarr':'\u21DA','Lacute':'\u0139','lacute':'\u013A','laemptyv':'\u29B4','lagran':'\u2112','Lambda':'\u039B','lambda':'\u03BB','lang':'\u27E8','Lang':'\u27EA','langd':'\u2991','langle':'\u27E8','lap':'\u2A85','Laplacetrf':'\u2112','laquo':'\xAB','larrb':'\u21E4','larrbfs':'\u291F','larr':'\u2190','Larr':'\u219E','lArr':'\u21D0','larrfs':'\u291D','larrhk':'\u21A9','larrlp':'\u21AB','larrpl':'\u2939','larrsim':'\u2973','larrtl':'\u21A2','latail':'\u2919','lAtail':'\u291B','lat':'\u2AAB','late':'\u2AAD','lates':'\u2AAD\uFE00','lbarr':'\u290C','lBarr':'\u290E','lbbrk':'\u2772','lbrace':'{','lbrack':'[','lbrke':'\u298B','lbrksld':'\u298F','lbrkslu':'\u298D','Lcaron':'\u013D','lcaron':'\u013E','Lcedil':'\u013B','lcedil':'\u013C','lceil':'\u2308','lcub':'{','Lcy':'\u041B','lcy':'\u043B','ldca':'\u2936','ldquo':'\u201C','ldquor':'\u201E','ldrdhar':'\u2967','ldrushar':'\u294B','ldsh':'\u21B2','le':'\u2264','lE':'\u2266','LeftAngleBracket':'\u27E8','LeftArrowBar':'\u21E4','leftarrow':'\u2190','LeftArrow':'\u2190','Leftarrow':'\u21D0','LeftArrowRightArrow':'\u21C6','leftarrowtail':'\u21A2','LeftCeiling':'\u2308','LeftDoubleBracket':'\u27E6','LeftDownTeeVector':'\u2961','LeftDownVectorBar':'\u2959','LeftDownVector':'\u21C3','LeftFloor':'\u230A','leftharpoondown':'\u21BD','leftharpoonup':'\u21BC','leftleftarrows':'\u21C7','leftrightarrow':'\u2194','LeftRightArrow':'\u2194','Leftrightarrow':'\u21D4','leftrightarrows':'\u21C6','leftrightharpoons':'\u21CB','leftrightsquigarrow':'\u21AD','LeftRightVector':'\u294E','LeftTeeArrow':'\u21A4','LeftTee':'\u22A3','LeftTeeVector':'\u295A','leftthreetimes':'\u22CB','LeftTriangleBar':'\u29CF','LeftTriangle':'\u22B2','LeftTriangleEqual':'\u22B4','LeftUpDownVector':'\u2951','LeftUpTeeVector':'\u2960','LeftUpVectorBar':'\u2958','LeftUpVector':'\u21BF','LeftVectorBar':'\u2952','LeftVector':'\u21BC','lEg':'\u2A8B','leg':'\u22DA','leq':'\u2264','leqq':'\u2266','leqslant':'\u2A7D','lescc':'\u2AA8','les':'\u2A7D','lesdot':'\u2A7F','lesdoto':'\u2A81','lesdotor':'\u2A83','lesg':'\u22DA\uFE00','lesges':'\u2A93','lessapprox':'\u2A85','lessdot':'\u22D6','lesseqgtr':'\u22DA','lesseqqgtr':'\u2A8B','LessEqualGreater':'\u22DA','LessFullEqual':'\u2266','LessGreater':'\u2276','lessgtr':'\u2276','LessLess':'\u2AA1','lesssim':'\u2272','LessSlantEqual':'\u2A7D','LessTilde':'\u2272','lfisht':'\u297C','lfloor':'\u230A','Lfr':'\uD835\uDD0F','lfr':'\uD835\uDD29','lg':'\u2276','lgE':'\u2A91','lHar':'\u2962','lhard':'\u21BD','lharu':'\u21BC','lharul':'\u296A','lhblk':'\u2584','LJcy':'\u0409','ljcy':'\u0459','llarr':'\u21C7','ll':'\u226A','Ll':'\u22D8','llcorner':'\u231E','Lleftarrow':'\u21DA','llhard':'\u296B','lltri':'\u25FA','Lmidot':'\u013F','lmidot':'\u0140','lmoustache':'\u23B0','lmoust':'\u23B0','lnap':'\u2A89','lnapprox':'\u2A89','lne':'\u2A87','lnE':'\u2268','lneq':'\u2A87','lneqq':'\u2268','lnsim':'\u22E6','loang':'\u27EC','loarr':'\u21FD','lobrk':'\u27E6','longleftarrow':'\u27F5','LongLeftArrow':'\u27F5','Longleftarrow':'\u27F8','longleftrightarrow':'\u27F7','LongLeftRightArrow':'\u27F7','Longleftrightarrow':'\u27FA','longmapsto':'\u27FC','longrightarrow':'\u27F6','LongRightArrow':'\u27F6','Longrightarrow':'\u27F9','looparrowleft':'\u21AB','looparrowright':'\u21AC','lopar':'\u2985','Lopf':'\uD835\uDD43','lopf':'\uD835\uDD5D','loplus':'\u2A2D','lotimes':'\u2A34','lowast':'\u2217','lowbar':'_','LowerLeftArrow':'\u2199','LowerRightArrow':'\u2198','loz':'\u25CA','lozenge':'\u25CA','lozf':'\u29EB','lpar':'(','lparlt':'\u2993','lrarr':'\u21C6','lrcorner':'\u231F','lrhar':'\u21CB','lrhard':'\u296D','lrm':'\u200E','lrtri':'\u22BF','lsaquo':'\u2039','lscr':'\uD835\uDCC1','Lscr':'\u2112','lsh':'\u21B0','Lsh':'\u21B0','lsim':'\u2272','lsime':'\u2A8D','lsimg':'\u2A8F','lsqb':'[','lsquo':'\u2018','lsquor':'\u201A','Lstrok':'\u0141','lstrok':'\u0142','ltcc':'\u2AA6','ltcir':'\u2A79','lt':'<','LT':'<','Lt':'\u226A','ltdot':'\u22D6','lthree':'\u22CB','ltimes':'\u22C9','ltlarr':'\u2976','ltquest':'\u2A7B','ltri':'\u25C3','ltrie':'\u22B4','ltrif':'\u25C2','ltrPar':'\u2996','lurdshar':'\u294A','luruhar':'\u2966','lvertneqq':'\u2268\uFE00','lvnE':'\u2268\uFE00','macr':'\xAF','male':'\u2642','malt':'\u2720','maltese':'\u2720','Map':'\u2905','map':'\u21A6','mapsto':'\u21A6','mapstodown':'\u21A7','mapstoleft':'\u21A4','mapstoup':'\u21A5','marker':'\u25AE','mcomma':'\u2A29','Mcy':'\u041C','mcy':'\u043C','mdash':'\u2014','mDDot':'\u223A','measuredangle':'\u2221','MediumSpace':'\u205F','Mellintrf':'\u2133','Mfr':'\uD835\uDD10','mfr':'\uD835\uDD2A','mho':'\u2127','micro':'\xB5','midast':'*','midcir':'\u2AF0','mid':'\u2223','middot':'\xB7','minusb':'\u229F','minus':'\u2212','minusd':'\u2238','minusdu':'\u2A2A','MinusPlus':'\u2213','mlcp':'\u2ADB','mldr':'\u2026','mnplus':'\u2213','models':'\u22A7','Mopf':'\uD835\uDD44','mopf':'\uD835\uDD5E','mp':'\u2213','mscr':'\uD835\uDCC2','Mscr':'\u2133','mstpos':'\u223E','Mu':'\u039C','mu':'\u03BC','multimap':'\u22B8','mumap':'\u22B8','nabla':'\u2207','Nacute':'\u0143','nacute':'\u0144','nang':'\u2220\u20D2','nap':'\u2249','napE':'\u2A70\u0338','napid':'\u224B\u0338','napos':'\u0149','napprox':'\u2249','natural':'\u266E','naturals':'\u2115','natur':'\u266E','nbsp':'\xA0','nbump':'\u224E\u0338','nbumpe':'\u224F\u0338','ncap':'\u2A43','Ncaron':'\u0147','ncaron':'\u0148','Ncedil':'\u0145','ncedil':'\u0146','ncong':'\u2247','ncongdot':'\u2A6D\u0338','ncup':'\u2A42','Ncy':'\u041D','ncy':'\u043D','ndash':'\u2013','nearhk':'\u2924','nearr':'\u2197','neArr':'\u21D7','nearrow':'\u2197','ne':'\u2260','nedot':'\u2250\u0338','NegativeMediumSpace':'\u200B','NegativeThickSpace':'\u200B','NegativeThinSpace':'\u200B','NegativeVeryThinSpace':'\u200B','nequiv':'\u2262','nesear':'\u2928','nesim':'\u2242\u0338','NestedGreaterGreater':'\u226B','NestedLessLess':'\u226A','NewLine':'\n','nexist':'\u2204','nexists':'\u2204','Nfr':'\uD835\uDD11','nfr':'\uD835\uDD2B','ngE':'\u2267\u0338','nge':'\u2271','ngeq':'\u2271','ngeqq':'\u2267\u0338','ngeqslant':'\u2A7E\u0338','nges':'\u2A7E\u0338','nGg':'\u22D9\u0338','ngsim':'\u2275','nGt':'\u226B\u20D2','ngt':'\u226F','ngtr':'\u226F','nGtv':'\u226B\u0338','nharr':'\u21AE','nhArr':'\u21CE','nhpar':'\u2AF2','ni':'\u220B','nis':'\u22FC','nisd':'\u22FA','niv':'\u220B','NJcy':'\u040A','njcy':'\u045A','nlarr':'\u219A','nlArr':'\u21CD','nldr':'\u2025','nlE':'\u2266\u0338','nle':'\u2270','nleftarrow':'\u219A','nLeftarrow':'\u21CD','nleftrightarrow':'\u21AE','nLeftrightarrow':'\u21CE','nleq':'\u2270','nleqq':'\u2266\u0338','nleqslant':'\u2A7D\u0338','nles':'\u2A7D\u0338','nless':'\u226E','nLl':'\u22D8\u0338','nlsim':'\u2274','nLt':'\u226A\u20D2','nlt':'\u226E','nltri':'\u22EA','nltrie':'\u22EC','nLtv':'\u226A\u0338','nmid':'\u2224','NoBreak':'\u2060','NonBreakingSpace':'\xA0','nopf':'\uD835\uDD5F','Nopf':'\u2115','Not':'\u2AEC','not':'\xAC','NotCongruent':'\u2262','NotCupCap':'\u226D','NotDoubleVerticalBar':'\u2226','NotElement':'\u2209','NotEqual':'\u2260','NotEqualTilde':'\u2242\u0338','NotExists':'\u2204','NotGreater':'\u226F','NotGreaterEqual':'\u2271','NotGreaterFullEqual':'\u2267\u0338','NotGreaterGreater':'\u226B\u0338','NotGreaterLess':'\u2279','NotGreaterSlantEqual':'\u2A7E\u0338','NotGreaterTilde':'\u2275','NotHumpDownHump':'\u224E\u0338','NotHumpEqual':'\u224F\u0338','notin':'\u2209','notindot':'\u22F5\u0338','notinE':'\u22F9\u0338','notinva':'\u2209','notinvb':'\u22F7','notinvc':'\u22F6','NotLeftTriangleBar':'\u29CF\u0338','NotLeftTriangle':'\u22EA','NotLeftTriangleEqual':'\u22EC','NotLess':'\u226E','NotLessEqual':'\u2270','NotLessGreater':'\u2278','NotLessLess':'\u226A\u0338','NotLessSlantEqual':'\u2A7D\u0338','NotLessTilde':'\u2274','NotNestedGreaterGreater':'\u2AA2\u0338','NotNestedLessLess':'\u2AA1\u0338','notni':'\u220C','notniva':'\u220C','notnivb':'\u22FE','notnivc':'\u22FD','NotPrecedes':'\u2280','NotPrecedesEqual':'\u2AAF\u0338','NotPrecedesSlantEqual':'\u22E0','NotReverseElement':'\u220C','NotRightTriangleBar':'\u29D0\u0338','NotRightTriangle':'\u22EB','NotRightTriangleEqual':'\u22ED','NotSquareSubset':'\u228F\u0338','NotSquareSubsetEqual':'\u22E2','NotSquareSuperset':'\u2290\u0338','NotSquareSupersetEqual':'\u22E3','NotSubset':'\u2282\u20D2','NotSubsetEqual':'\u2288','NotSucceeds':'\u2281','NotSucceedsEqual':'\u2AB0\u0338','NotSucceedsSlantEqual':'\u22E1','NotSucceedsTilde':'\u227F\u0338','NotSuperset':'\u2283\u20D2','NotSupersetEqual':'\u2289','NotTilde':'\u2241','NotTildeEqual':'\u2244','NotTildeFullEqual':'\u2247','NotTildeTilde':'\u2249','NotVerticalBar':'\u2224','nparallel':'\u2226','npar':'\u2226','nparsl':'\u2AFD\u20E5','npart':'\u2202\u0338','npolint':'\u2A14','npr':'\u2280','nprcue':'\u22E0','nprec':'\u2280','npreceq':'\u2AAF\u0338','npre':'\u2AAF\u0338','nrarrc':'\u2933\u0338','nrarr':'\u219B','nrArr':'\u21CF','nrarrw':'\u219D\u0338','nrightarrow':'\u219B','nRightarrow':'\u21CF','nrtri':'\u22EB','nrtrie':'\u22ED','nsc':'\u2281','nsccue':'\u22E1','nsce':'\u2AB0\u0338','Nscr':'\uD835\uDCA9','nscr':'\uD835\uDCC3','nshortmid':'\u2224','nshortparallel':'\u2226','nsim':'\u2241','nsime':'\u2244','nsimeq':'\u2244','nsmid':'\u2224','nspar':'\u2226','nsqsube':'\u22E2','nsqsupe':'\u22E3','nsub':'\u2284','nsubE':'\u2AC5\u0338','nsube':'\u2288','nsubset':'\u2282\u20D2','nsubseteq':'\u2288','nsubseteqq':'\u2AC5\u0338','nsucc':'\u2281','nsucceq':'\u2AB0\u0338','nsup':'\u2285','nsupE':'\u2AC6\u0338','nsupe':'\u2289','nsupset':'\u2283\u20D2','nsupseteq':'\u2289','nsupseteqq':'\u2AC6\u0338','ntgl':'\u2279','Ntilde':'\xD1','ntilde':'\xF1','ntlg':'\u2278','ntriangleleft':'\u22EA','ntrianglelefteq':'\u22EC','ntriangleright':'\u22EB','ntrianglerighteq':'\u22ED','Nu':'\u039D','nu':'\u03BD','num':'#','numero':'\u2116','numsp':'\u2007','nvap':'\u224D\u20D2','nvdash':'\u22AC','nvDash':'\u22AD','nVdash':'\u22AE','nVDash':'\u22AF','nvge':'\u2265\u20D2','nvgt':'>\u20D2','nvHarr':'\u2904','nvinfin':'\u29DE','nvlArr':'\u2902','nvle':'\u2264\u20D2','nvlt':'<\u20D2','nvltrie':'\u22B4\u20D2','nvrArr':'\u2903','nvrtrie':'\u22B5\u20D2','nvsim':'\u223C\u20D2','nwarhk':'\u2923','nwarr':'\u2196','nwArr':'\u21D6','nwarrow':'\u2196','nwnear':'\u2927','Oacute':'\xD3','oacute':'\xF3','oast':'\u229B','Ocirc':'\xD4','ocirc':'\xF4','ocir':'\u229A','Ocy':'\u041E','ocy':'\u043E','odash':'\u229D','Odblac':'\u0150','odblac':'\u0151','odiv':'\u2A38','odot':'\u2299','odsold':'\u29BC','OElig':'\u0152','oelig':'\u0153','ofcir':'\u29BF','Ofr':'\uD835\uDD12','ofr':'\uD835\uDD2C','ogon':'\u02DB','Ograve':'\xD2','ograve':'\xF2','ogt':'\u29C1','ohbar':'\u29B5','ohm':'\u03A9','oint':'\u222E','olarr':'\u21BA','olcir':'\u29BE','olcross':'\u29BB','oline':'\u203E','olt':'\u29C0','Omacr':'\u014C','omacr':'\u014D','Omega':'\u03A9','omega':'\u03C9','Omicron':'\u039F','omicron':'\u03BF','omid':'\u29B6','ominus':'\u2296','Oopf':'\uD835\uDD46','oopf':'\uD835\uDD60','opar':'\u29B7','OpenCurlyDoubleQuote':'\u201C','OpenCurlyQuote':'\u2018','operp':'\u29B9','oplus':'\u2295','orarr':'\u21BB','Or':'\u2A54','or':'\u2228','ord':'\u2A5D','order':'\u2134','orderof':'\u2134','ordf':'\xAA','ordm':'\xBA','origof':'\u22B6','oror':'\u2A56','orslope':'\u2A57','orv':'\u2A5B','oS':'\u24C8','Oscr':'\uD835\uDCAA','oscr':'\u2134','Oslash':'\xD8','oslash':'\xF8','osol':'\u2298','Otilde':'\xD5','otilde':'\xF5','otimesas':'\u2A36','Otimes':'\u2A37','otimes':'\u2297','Ouml':'\xD6','ouml':'\xF6','ovbar':'\u233D','OverBar':'\u203E','OverBrace':'\u23DE','OverBracket':'\u23B4','OverParenthesis':'\u23DC','para':'\xB6','parallel':'\u2225','par':'\u2225','parsim':'\u2AF3','parsl':'\u2AFD','part':'\u2202','PartialD':'\u2202','Pcy':'\u041F','pcy':'\u043F','percnt':'%','period':'.','permil':'\u2030','perp':'\u22A5','pertenk':'\u2031','Pfr':'\uD835\uDD13','pfr':'\uD835\uDD2D','Phi':'\u03A6','phi':'\u03C6','phiv':'\u03D5','phmmat':'\u2133','phone':'\u260E','Pi':'\u03A0','pi':'\u03C0','pitchfork':'\u22D4','piv':'\u03D6','planck':'\u210F','planckh':'\u210E','plankv':'\u210F','plusacir':'\u2A23','plusb':'\u229E','pluscir':'\u2A22','plus':'+','plusdo':'\u2214','plusdu':'\u2A25','pluse':'\u2A72','PlusMinus':'\xB1','plusmn':'\xB1','plussim':'\u2A26','plustwo':'\u2A27','pm':'\xB1','Poincareplane':'\u210C','pointint':'\u2A15','popf':'\uD835\uDD61','Popf':'\u2119','pound':'\xA3','prap':'\u2AB7','Pr':'\u2ABB','pr':'\u227A','prcue':'\u227C','precapprox':'\u2AB7','prec':'\u227A','preccurlyeq':'\u227C','Precedes':'\u227A','PrecedesEqual':'\u2AAF','PrecedesSlantEqual':'\u227C','PrecedesTilde':'\u227E','preceq':'\u2AAF','precnapprox':'\u2AB9','precneqq':'\u2AB5','precnsim':'\u22E8','pre':'\u2AAF','prE':'\u2AB3','precsim':'\u227E','prime':'\u2032','Prime':'\u2033','primes':'\u2119','prnap':'\u2AB9','prnE':'\u2AB5','prnsim':'\u22E8','prod':'\u220F','Product':'\u220F','profalar':'\u232E','profline':'\u2312','profsurf':'\u2313','prop':'\u221D','Proportional':'\u221D','Proportion':'\u2237','propto':'\u221D','prsim':'\u227E','prurel':'\u22B0','Pscr':'\uD835\uDCAB','pscr':'\uD835\uDCC5','Psi':'\u03A8','psi':'\u03C8','puncsp':'\u2008','Qfr':'\uD835\uDD14','qfr':'\uD835\uDD2E','qint':'\u2A0C','qopf':'\uD835\uDD62','Qopf':'\u211A','qprime':'\u2057','Qscr':'\uD835\uDCAC','qscr':'\uD835\uDCC6','quaternions':'\u210D','quatint':'\u2A16','quest':'?','questeq':'\u225F','quot':'"','QUOT':'"','rAarr':'\u21DB','race':'\u223D\u0331','Racute':'\u0154','racute':'\u0155','radic':'\u221A','raemptyv':'\u29B3','rang':'\u27E9','Rang':'\u27EB','rangd':'\u2992','range':'\u29A5','rangle':'\u27E9','raquo':'\xBB','rarrap':'\u2975','rarrb':'\u21E5','rarrbfs':'\u2920','rarrc':'\u2933','rarr':'\u2192','Rarr':'\u21A0','rArr':'\u21D2','rarrfs':'\u291E','rarrhk':'\u21AA','rarrlp':'\u21AC','rarrpl':'\u2945','rarrsim':'\u2974','Rarrtl':'\u2916','rarrtl':'\u21A3','rarrw':'\u219D','ratail':'\u291A','rAtail':'\u291C','ratio':'\u2236','rationals':'\u211A','rbarr':'\u290D','rBarr':'\u290F','RBarr':'\u2910','rbbrk':'\u2773','rbrace':'}','rbrack':']','rbrke':'\u298C','rbrksld':'\u298E','rbrkslu':'\u2990','Rcaron':'\u0158','rcaron':'\u0159','Rcedil':'\u0156','rcedil':'\u0157','rceil':'\u2309','rcub':'}','Rcy':'\u0420','rcy':'\u0440','rdca':'\u2937','rdldhar':'\u2969','rdquo':'\u201D','rdquor':'\u201D','rdsh':'\u21B3','real':'\u211C','realine':'\u211B','realpart':'\u211C','reals':'\u211D','Re':'\u211C','rect':'\u25AD','reg':'\xAE','REG':'\xAE','ReverseElement':'\u220B','ReverseEquilibrium':'\u21CB','ReverseUpEquilibrium':'\u296F','rfisht':'\u297D','rfloor':'\u230B','rfr':'\uD835\uDD2F','Rfr':'\u211C','rHar':'\u2964','rhard':'\u21C1','rharu':'\u21C0','rharul':'\u296C','Rho':'\u03A1','rho':'\u03C1','rhov':'\u03F1','RightAngleBracket':'\u27E9','RightArrowBar':'\u21E5','rightarrow':'\u2192','RightArrow':'\u2192','Rightarrow':'\u21D2','RightArrowLeftArrow':'\u21C4','rightarrowtail':'\u21A3','RightCeiling':'\u2309','RightDoubleBracket':'\u27E7','RightDownTeeVector':'\u295D','RightDownVectorBar':'\u2955','RightDownVector':'\u21C2','RightFloor':'\u230B','rightharpoondown':'\u21C1','rightharpoonup':'\u21C0','rightleftarrows':'\u21C4','rightleftharpoons':'\u21CC','rightrightarrows':'\u21C9','rightsquigarrow':'\u219D','RightTeeArrow':'\u21A6','RightTee':'\u22A2','RightTeeVector':'\u295B','rightthreetimes':'\u22CC','RightTriangleBar':'\u29D0','RightTriangle':'\u22B3','RightTriangleEqual':'\u22B5','RightUpDownVector':'\u294F','RightUpTeeVector':'\u295C','RightUpVectorBar':'\u2954','RightUpVector':'\u21BE','RightVectorBar':'\u2953','RightVector':'\u21C0','ring':'\u02DA','risingdotseq':'\u2253','rlarr':'\u21C4','rlhar':'\u21CC','rlm':'\u200F','rmoustache':'\u23B1','rmoust':'\u23B1','rnmid':'\u2AEE','roang':'\u27ED','roarr':'\u21FE','robrk':'\u27E7','ropar':'\u2986','ropf':'\uD835\uDD63','Ropf':'\u211D','roplus':'\u2A2E','rotimes':'\u2A35','RoundImplies':'\u2970','rpar':')','rpargt':'\u2994','rppolint':'\u2A12','rrarr':'\u21C9','Rrightarrow':'\u21DB','rsaquo':'\u203A','rscr':'\uD835\uDCC7','Rscr':'\u211B','rsh':'\u21B1','Rsh':'\u21B1','rsqb':']','rsquo':'\u2019','rsquor':'\u2019','rthree':'\u22CC','rtimes':'\u22CA','rtri':'\u25B9','rtrie':'\u22B5','rtrif':'\u25B8','rtriltri':'\u29CE','RuleDelayed':'\u29F4','ruluhar':'\u2968','rx':'\u211E','Sacute':'\u015A','sacute':'\u015B','sbquo':'\u201A','scap':'\u2AB8','Scaron':'\u0160','scaron':'\u0161','Sc':'\u2ABC','sc':'\u227B','sccue':'\u227D','sce':'\u2AB0','scE':'\u2AB4','Scedil':'\u015E','scedil':'\u015F','Scirc':'\u015C','scirc':'\u015D','scnap':'\u2ABA','scnE':'\u2AB6','scnsim':'\u22E9','scpolint':'\u2A13','scsim':'\u227F','Scy':'\u0421','scy':'\u0441','sdotb':'\u22A1','sdot':'\u22C5','sdote':'\u2A66','searhk':'\u2925','searr':'\u2198','seArr':'\u21D8','searrow':'\u2198','sect':'\xA7','semi':';','seswar':'\u2929','setminus':'\u2216','setmn':'\u2216','sext':'\u2736','Sfr':'\uD835\uDD16','sfr':'\uD835\uDD30','sfrown':'\u2322','sharp':'\u266F','SHCHcy':'\u0429','shchcy':'\u0449','SHcy':'\u0428','shcy':'\u0448','ShortDownArrow':'\u2193','ShortLeftArrow':'\u2190','shortmid':'\u2223','shortparallel':'\u2225','ShortRightArrow':'\u2192','ShortUpArrow':'\u2191','shy':'\xAD','Sigma':'\u03A3','sigma':'\u03C3','sigmaf':'\u03C2','sigmav':'\u03C2','sim':'\u223C','simdot':'\u2A6A','sime':'\u2243','simeq':'\u2243','simg':'\u2A9E','simgE':'\u2AA0','siml':'\u2A9D','simlE':'\u2A9F','simne':'\u2246','simplus':'\u2A24','simrarr':'\u2972','slarr':'\u2190','SmallCircle':'\u2218','smallsetminus':'\u2216','smashp':'\u2A33','smeparsl':'\u29E4','smid':'\u2223','smile':'\u2323','smt':'\u2AAA','smte':'\u2AAC','smtes':'\u2AAC\uFE00','SOFTcy':'\u042C','softcy':'\u044C','solbar':'\u233F','solb':'\u29C4','sol':'/','Sopf':'\uD835\uDD4A','sopf':'\uD835\uDD64','spades':'\u2660','spadesuit':'\u2660','spar':'\u2225','sqcap':'\u2293','sqcaps':'\u2293\uFE00','sqcup':'\u2294','sqcups':'\u2294\uFE00','Sqrt':'\u221A','sqsub':'\u228F','sqsube':'\u2291','sqsubset':'\u228F','sqsubseteq':'\u2291','sqsup':'\u2290','sqsupe':'\u2292','sqsupset':'\u2290','sqsupseteq':'\u2292','square':'\u25A1','Square':'\u25A1','SquareIntersection':'\u2293','SquareSubset':'\u228F','SquareSubsetEqual':'\u2291','SquareSuperset':'\u2290','SquareSupersetEqual':'\u2292','SquareUnion':'\u2294','squarf':'\u25AA','squ':'\u25A1','squf':'\u25AA','srarr':'\u2192','Sscr':'\uD835\uDCAE','sscr':'\uD835\uDCC8','ssetmn':'\u2216','ssmile':'\u2323','sstarf':'\u22C6','Star':'\u22C6','star':'\u2606','starf':'\u2605','straightepsilon':'\u03F5','straightphi':'\u03D5','strns':'\xAF','sub':'\u2282','Sub':'\u22D0','subdot':'\u2ABD','subE':'\u2AC5','sube':'\u2286','subedot':'\u2AC3','submult':'\u2AC1','subnE':'\u2ACB','subne':'\u228A','subplus':'\u2ABF','subrarr':'\u2979','subset':'\u2282','Subset':'\u22D0','subseteq':'\u2286','subseteqq':'\u2AC5','SubsetEqual':'\u2286','subsetneq':'\u228A','subsetneqq':'\u2ACB','subsim':'\u2AC7','subsub':'\u2AD5','subsup':'\u2AD3','succapprox':'\u2AB8','succ':'\u227B','succcurlyeq':'\u227D','Succeeds':'\u227B','SucceedsEqual':'\u2AB0','SucceedsSlantEqual':'\u227D','SucceedsTilde':'\u227F','succeq':'\u2AB0','succnapprox':'\u2ABA','succneqq':'\u2AB6','succnsim':'\u22E9','succsim':'\u227F','SuchThat':'\u220B','sum':'\u2211','Sum':'\u2211','sung':'\u266A','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','sup':'\u2283','Sup':'\u22D1','supdot':'\u2ABE','supdsub':'\u2AD8','supE':'\u2AC6','supe':'\u2287','supedot':'\u2AC4','Superset':'\u2283','SupersetEqual':'\u2287','suphsol':'\u27C9','suphsub':'\u2AD7','suplarr':'\u297B','supmult':'\u2AC2','supnE':'\u2ACC','supne':'\u228B','supplus':'\u2AC0','supset':'\u2283','Supset':'\u22D1','supseteq':'\u2287','supseteqq':'\u2AC6','supsetneq':'\u228B','supsetneqq':'\u2ACC','supsim':'\u2AC8','supsub':'\u2AD4','supsup':'\u2AD6','swarhk':'\u2926','swarr':'\u2199','swArr':'\u21D9','swarrow':'\u2199','swnwar':'\u292A','szlig':'\xDF','Tab':'\t','target':'\u2316','Tau':'\u03A4','tau':'\u03C4','tbrk':'\u23B4','Tcaron':'\u0164','tcaron':'\u0165','Tcedil':'\u0162','tcedil':'\u0163','Tcy':'\u0422','tcy':'\u0442','tdot':'\u20DB','telrec':'\u2315','Tfr':'\uD835\uDD17','tfr':'\uD835\uDD31','there4':'\u2234','therefore':'\u2234','Therefore':'\u2234','Theta':'\u0398','theta':'\u03B8','thetasym':'\u03D1','thetav':'\u03D1','thickapprox':'\u2248','thicksim':'\u223C','ThickSpace':'\u205F\u200A','ThinSpace':'\u2009','thinsp':'\u2009','thkap':'\u2248','thksim':'\u223C','THORN':'\xDE','thorn':'\xFE','tilde':'\u02DC','Tilde':'\u223C','TildeEqual':'\u2243','TildeFullEqual':'\u2245','TildeTilde':'\u2248','timesbar':'\u2A31','timesb':'\u22A0','times':'\xD7','timesd':'\u2A30','tint':'\u222D','toea':'\u2928','topbot':'\u2336','topcir':'\u2AF1','top':'\u22A4','Topf':'\uD835\uDD4B','topf':'\uD835\uDD65','topfork':'\u2ADA','tosa':'\u2929','tprime':'\u2034','trade':'\u2122','TRADE':'\u2122','triangle':'\u25B5','triangledown':'\u25BF','triangleleft':'\u25C3','trianglelefteq':'\u22B4','triangleq':'\u225C','triangleright':'\u25B9','trianglerighteq':'\u22B5','tridot':'\u25EC','trie':'\u225C','triminus':'\u2A3A','TripleDot':'\u20DB','triplus':'\u2A39','trisb':'\u29CD','tritime':'\u2A3B','trpezium':'\u23E2','Tscr':'\uD835\uDCAF','tscr':'\uD835\uDCC9','TScy':'\u0426','tscy':'\u0446','TSHcy':'\u040B','tshcy':'\u045B','Tstrok':'\u0166','tstrok':'\u0167','twixt':'\u226C','twoheadleftarrow':'\u219E','twoheadrightarrow':'\u21A0','Uacute':'\xDA','uacute':'\xFA','uarr':'\u2191','Uarr':'\u219F','uArr':'\u21D1','Uarrocir':'\u2949','Ubrcy':'\u040E','ubrcy':'\u045E','Ubreve':'\u016C','ubreve':'\u016D','Ucirc':'\xDB','ucirc':'\xFB','Ucy':'\u0423','ucy':'\u0443','udarr':'\u21C5','Udblac':'\u0170','udblac':'\u0171','udhar':'\u296E','ufisht':'\u297E','Ufr':'\uD835\uDD18','ufr':'\uD835\uDD32','Ugrave':'\xD9','ugrave':'\xF9','uHar':'\u2963','uharl':'\u21BF','uharr':'\u21BE','uhblk':'\u2580','ulcorn':'\u231C','ulcorner':'\u231C','ulcrop':'\u230F','ultri':'\u25F8','Umacr':'\u016A','umacr':'\u016B','uml':'\xA8','UnderBar':'_','UnderBrace':'\u23DF','UnderBracket':'\u23B5','UnderParenthesis':'\u23DD','Union':'\u22C3','UnionPlus':'\u228E','Uogon':'\u0172','uogon':'\u0173','Uopf':'\uD835\uDD4C','uopf':'\uD835\uDD66','UpArrowBar':'\u2912','uparrow':'\u2191','UpArrow':'\u2191','Uparrow':'\u21D1','UpArrowDownArrow':'\u21C5','updownarrow':'\u2195','UpDownArrow':'\u2195','Updownarrow':'\u21D5','UpEquilibrium':'\u296E','upharpoonleft':'\u21BF','upharpoonright':'\u21BE','uplus':'\u228E','UpperLeftArrow':'\u2196','UpperRightArrow':'\u2197','upsi':'\u03C5','Upsi':'\u03D2','upsih':'\u03D2','Upsilon':'\u03A5','upsilon':'\u03C5','UpTeeArrow':'\u21A5','UpTee':'\u22A5','upuparrows':'\u21C8','urcorn':'\u231D','urcorner':'\u231D','urcrop':'\u230E','Uring':'\u016E','uring':'\u016F','urtri':'\u25F9','Uscr':'\uD835\uDCB0','uscr':'\uD835\uDCCA','utdot':'\u22F0','Utilde':'\u0168','utilde':'\u0169','utri':'\u25B5','utrif':'\u25B4','uuarr':'\u21C8','Uuml':'\xDC','uuml':'\xFC','uwangle':'\u29A7','vangrt':'\u299C','varepsilon':'\u03F5','varkappa':'\u03F0','varnothing':'\u2205','varphi':'\u03D5','varpi':'\u03D6','varpropto':'\u221D','varr':'\u2195','vArr':'\u21D5','varrho':'\u03F1','varsigma':'\u03C2','varsubsetneq':'\u228A\uFE00','varsubsetneqq':'\u2ACB\uFE00','varsupsetneq':'\u228B\uFE00','varsupsetneqq':'\u2ACC\uFE00','vartheta':'\u03D1','vartriangleleft':'\u22B2','vartriangleright':'\u22B3','vBar':'\u2AE8','Vbar':'\u2AEB','vBarv':'\u2AE9','Vcy':'\u0412','vcy':'\u0432','vdash':'\u22A2','vDash':'\u22A8','Vdash':'\u22A9','VDash':'\u22AB','Vdashl':'\u2AE6','veebar':'\u22BB','vee':'\u2228','Vee':'\u22C1','veeeq':'\u225A','vellip':'\u22EE','verbar':'|','Verbar':'\u2016','vert':'|','Vert':'\u2016','VerticalBar':'\u2223','VerticalLine':'|','VerticalSeparator':'\u2758','VerticalTilde':'\u2240','VeryThinSpace':'\u200A','Vfr':'\uD835\uDD19','vfr':'\uD835\uDD33','vltri':'\u22B2','vnsub':'\u2282\u20D2','vnsup':'\u2283\u20D2','Vopf':'\uD835\uDD4D','vopf':'\uD835\uDD67','vprop':'\u221D','vrtri':'\u22B3','Vscr':'\uD835\uDCB1','vscr':'\uD835\uDCCB','vsubnE':'\u2ACB\uFE00','vsubne':'\u228A\uFE00','vsupnE':'\u2ACC\uFE00','vsupne':'\u228B\uFE00','Vvdash':'\u22AA','vzigzag':'\u299A','Wcirc':'\u0174','wcirc':'\u0175','wedbar':'\u2A5F','wedge':'\u2227','Wedge':'\u22C0','wedgeq':'\u2259','weierp':'\u2118','Wfr':'\uD835\uDD1A','wfr':'\uD835\uDD34','Wopf':'\uD835\uDD4E','wopf':'\uD835\uDD68','wp':'\u2118','wr':'\u2240','wreath':'\u2240','Wscr':'\uD835\uDCB2','wscr':'\uD835\uDCCC','xcap':'\u22C2','xcirc':'\u25EF','xcup':'\u22C3','xdtri':'\u25BD','Xfr':'\uD835\uDD1B','xfr':'\uD835\uDD35','xharr':'\u27F7','xhArr':'\u27FA','Xi':'\u039E','xi':'\u03BE','xlarr':'\u27F5','xlArr':'\u27F8','xmap':'\u27FC','xnis':'\u22FB','xodot':'\u2A00','Xopf':'\uD835\uDD4F','xopf':'\uD835\uDD69','xoplus':'\u2A01','xotime':'\u2A02','xrarr':'\u27F6','xrArr':'\u27F9','Xscr':'\uD835\uDCB3','xscr':'\uD835\uDCCD','xsqcup':'\u2A06','xuplus':'\u2A04','xutri':'\u25B3','xvee':'\u22C1','xwedge':'\u22C0','Yacute':'\xDD','yacute':'\xFD','YAcy':'\u042F','yacy':'\u044F','Ycirc':'\u0176','ycirc':'\u0177','Ycy':'\u042B','ycy':'\u044B','yen':'\xA5','Yfr':'\uD835\uDD1C','yfr':'\uD835\uDD36','YIcy':'\u0407','yicy':'\u0457','Yopf':'\uD835\uDD50','yopf':'\uD835\uDD6A','Yscr':'\uD835\uDCB4','yscr':'\uD835\uDCCE','YUcy':'\u042E','yucy':'\u044E','yuml':'\xFF','Yuml':'\u0178','Zacute':'\u0179','zacute':'\u017A','Zcaron':'\u017D','zcaron':'\u017E','Zcy':'\u0417','zcy':'\u0437','Zdot':'\u017B','zdot':'\u017C','zeetrf':'\u2128','ZeroWidthSpace':'\u200B','Zeta':'\u0396','zeta':'\u03B6','zfr':'\uD835\uDD37','Zfr':'\u2128','ZHcy':'\u0416','zhcy':'\u0436','zigrarr':'\u21DD','zopf':'\uD835\uDD6B','Zopf':'\u2124','Zscr':'\uD835\uDCB5','zscr':'\uD835\uDCCF','zwj':'\u200D','zwnj':'\u200C'}; + var decodeMapLegacy = {'Aacute':'\xC1','aacute':'\xE1','Acirc':'\xC2','acirc':'\xE2','acute':'\xB4','AElig':'\xC6','aelig':'\xE6','Agrave':'\xC0','agrave':'\xE0','amp':'&','AMP':'&','Aring':'\xC5','aring':'\xE5','Atilde':'\xC3','atilde':'\xE3','Auml':'\xC4','auml':'\xE4','brvbar':'\xA6','Ccedil':'\xC7','ccedil':'\xE7','cedil':'\xB8','cent':'\xA2','copy':'\xA9','COPY':'\xA9','curren':'\xA4','deg':'\xB0','divide':'\xF7','Eacute':'\xC9','eacute':'\xE9','Ecirc':'\xCA','ecirc':'\xEA','Egrave':'\xC8','egrave':'\xE8','ETH':'\xD0','eth':'\xF0','Euml':'\xCB','euml':'\xEB','frac12':'\xBD','frac14':'\xBC','frac34':'\xBE','gt':'>','GT':'>','Iacute':'\xCD','iacute':'\xED','Icirc':'\xCE','icirc':'\xEE','iexcl':'\xA1','Igrave':'\xCC','igrave':'\xEC','iquest':'\xBF','Iuml':'\xCF','iuml':'\xEF','laquo':'\xAB','lt':'<','LT':'<','macr':'\xAF','micro':'\xB5','middot':'\xB7','nbsp':'\xA0','not':'\xAC','Ntilde':'\xD1','ntilde':'\xF1','Oacute':'\xD3','oacute':'\xF3','Ocirc':'\xD4','ocirc':'\xF4','Ograve':'\xD2','ograve':'\xF2','ordf':'\xAA','ordm':'\xBA','Oslash':'\xD8','oslash':'\xF8','Otilde':'\xD5','otilde':'\xF5','Ouml':'\xD6','ouml':'\xF6','para':'\xB6','plusmn':'\xB1','pound':'\xA3','quot':'"','QUOT':'"','raquo':'\xBB','reg':'\xAE','REG':'\xAE','sect':'\xA7','shy':'\xAD','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','szlig':'\xDF','THORN':'\xDE','thorn':'\xFE','times':'\xD7','Uacute':'\xDA','uacute':'\xFA','Ucirc':'\xDB','ucirc':'\xFB','Ugrave':'\xD9','ugrave':'\xF9','uml':'\xA8','Uuml':'\xDC','uuml':'\xFC','Yacute':'\xDD','yacute':'\xFD','yen':'\xA5','yuml':'\xFF'}; + var decodeMapNumeric = {'0':'\uFFFD','128':'\u20AC','130':'\u201A','131':'\u0192','132':'\u201E','133':'\u2026','134':'\u2020','135':'\u2021','136':'\u02C6','137':'\u2030','138':'\u0160','139':'\u2039','140':'\u0152','142':'\u017D','145':'\u2018','146':'\u2019','147':'\u201C','148':'\u201D','149':'\u2022','150':'\u2013','151':'\u2014','152':'\u02DC','153':'\u2122','154':'\u0161','155':'\u203A','156':'\u0153','158':'\u017E','159':'\u0178'}; + var invalidReferenceCodePoints = [1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65000,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]; + + /*--------------------------------------------------------------------------*/ + + var stringFromCharCode = String.fromCharCode; + + var object = {}; + var hasOwnProperty = object.hasOwnProperty; + var has = function(object, propertyName) { + return hasOwnProperty.call(object, propertyName); + }; + + var contains = function(array, value) { + var index = -1; + var length = array.length; + while (++index < length) { + if (array[index] == value) { + return true; + } + } + return false; + }; + + var merge = function(options, defaults) { + if (!options) { + return defaults; + } + var result = {}; + var key; + for (key in defaults) { + // A `hasOwnProperty` check is not needed here, since only recognized + // option names are used anyway. Any others are ignored. + result[key] = has(options, key) ? options[key] : defaults[key]; + } + return result; + }; + + // Modified version of `ucs2encode`; see http://mths.be/punycode. + var codePointToSymbol = function(codePoint, strict) { + var output = ''; + if ((codePoint >= 0xD800 && codePoint <= 0xDFFF) || codePoint > 0x10FFFF) { + // See issue #4: + // “Otherwise, if the number is in the range 0xD800 to 0xDFFF or is + // greater than 0x10FFFF, then this is a parse error. Return a U+FFFD + // REPLACEMENT CHARACTER.” + if (strict) { + parseError('character reference outside the permissible Unicode range'); + } + return '\uFFFD'; + } + if (has(decodeMapNumeric, codePoint)) { + if (strict) { + parseError('disallowed character reference'); + } + return decodeMapNumeric[codePoint]; + } + if (strict && contains(invalidReferenceCodePoints, codePoint)) { + parseError('disallowed character reference'); + } + if (codePoint > 0xFFFF) { + codePoint -= 0x10000; + output += stringFromCharCode(codePoint >>> 10 & 0x3FF | 0xD800); + codePoint = 0xDC00 | codePoint & 0x3FF; + } + output += stringFromCharCode(codePoint); + return output; + }; + + var hexEscape = function(symbol) { + return '&#x' + symbol.charCodeAt(0).toString(16).toUpperCase() + ';'; + }; + + var parseError = function(message) { + throw Error('Parse error: ' + message); + }; + + /*--------------------------------------------------------------------------*/ + + var encode = function(string, options) { + options = merge(options, encode.options); + var strict = options.strict; + if (strict && regexInvalidRawCodePoint.test(string)) { + parseError('forbidden code point'); + } + var encodeEverything = options.encodeEverything; + var useNamedReferences = options.useNamedReferences; + var allowUnsafeSymbols = options.allowUnsafeSymbols; + if (encodeEverything) { + // Encode ASCII symbols. + string = string.replace(regexAsciiWhitelist, function(symbol) { + // Use named references if requested & possible. + if (useNamedReferences && has(encodeMap, symbol)) { + return '&' + encodeMap[symbol] + ';'; + } + return hexEscape(symbol); + }); + // Shorten a few escapes that represent two symbols, of which at least one + // is within the ASCII range. + if (useNamedReferences) { + string = string + .replace(/>\u20D2/g, '>⃒') + .replace(/<\u20D2/g, '<⃒') + .replace(/fj/g, 'fj'); + } + // Encode non-ASCII symbols. + if (useNamedReferences) { + // Encode non-ASCII symbols that can be replaced with a named reference. + string = string.replace(regexEncodeNonAscii, function(string) { + // Note: there is no need to check `has(encodeMap, string)` here. + return '&' + encodeMap[string] + ';'; + }); + } + // Note: any remaining non-ASCII symbols are handled outside of the `if`. + } else if (useNamedReferences) { + // Apply named character references. + // Encode `<>"'&` using named character references. + if (!allowUnsafeSymbols) { + string = string.replace(regexEscape, function(string) { + return '&' + encodeMap[string] + ';'; // no need to check `has()` here + }); + } + // Shorten escapes that represent two symbols, of which at least one is + // `<>"'&`. + string = string + .replace(/>\u20D2/g, '>⃒') + .replace(/<\u20D2/g, '<⃒'); + // Encode non-ASCII symbols that can be replaced with a named reference. + string = string.replace(regexEncodeNonAscii, function(string) { + // Note: there is no need to check `has(encodeMap, string)` here. + return '&' + encodeMap[string] + ';'; + }); + } else if (!allowUnsafeSymbols) { + // Encode `<>"'&` using hexadecimal escapes, now that they’re not handled + // using named character references. + string = string.replace(regexEscape, hexEscape); + } + return string + // Encode astral symbols. + .replace(regexAstralSymbols, function($0) { + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + var high = $0.charCodeAt(0); + var low = $0.charCodeAt(1); + var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000; + return '&#x' + codePoint.toString(16).toUpperCase() + ';'; + }) + // Encode any remaining BMP symbols that are not printable ASCII symbols + // using a hexadecimal escape. + .replace(regexBmpWhitelist, hexEscape); + }; + // Expose default options (so they can be overridden globally). + encode.options = { + 'allowUnsafeSymbols': false, + 'encodeEverything': false, + 'strict': false, + 'useNamedReferences': false + }; + + var decode = function(html, options) { + options = merge(options, decode.options); + var strict = options.strict; + if (strict && regexInvalidEntity.test(html)) { + parseError('malformed character reference'); + } + return html.replace(regexDecode, function($0, $1, $2, $3, $4, $5, $6, $7) { + var codePoint; + var semicolon; + var hexDigits; + var reference; + var next; + if ($1) { + // Decode decimal escapes, e.g. `𝌆`. + codePoint = $1; + semicolon = $2; + if (strict && !semicolon) { + parseError('character reference was not terminated by a semicolon'); + } + return codePointToSymbol(codePoint, strict); + } + if ($3) { + // Decode hexadecimal escapes, e.g. `𝌆`. + hexDigits = $3; + semicolon = $4; + if (strict && !semicolon) { + parseError('character reference was not terminated by a semicolon'); + } + codePoint = parseInt(hexDigits, 16); + return codePointToSymbol(codePoint, strict); + } + if ($5) { + // Decode named character references with trailing `;`, e.g. `©`. + reference = $5; + if (has(decodeMap, reference)) { + return decodeMap[reference]; + } else { + // Ambiguous ampersand; see http://mths.be/notes/ambiguous-ampersands. + if (strict) { + parseError( + 'named character reference was not terminated by a semicolon' + ); + } + return $0; + } + } + // If we’re still here, it’s a legacy reference for sure. No need for an + // extra `if` check. + // Decode named character references without trailing `;`, e.g. `&` + // This is only a parse error if it gets converted to `&`, or if it is + // followed by `=` in an attribute context. + reference = $6; + next = $7; + if (next && options.isAttributeValue) { + if (strict && next == '=') { + parseError('`&` did not start a character reference'); + } + return $0; + } else { + if (strict) { + parseError( + 'named character reference was not terminated by a semicolon' + ); + } + // Note: there is no need to check `has(decodeMapLegacy, reference)`. + return decodeMapLegacy[reference] + (next || ''); + } + }); + }; + // Expose default options (so they can be overridden globally). + decode.options = { + 'isAttributeValue': false, + 'strict': false + }; + + var escape = function(string) { + return string.replace(regexEscape, function($0) { + // Note: there is no need to check `has(escapeMap, $0)` here. + return escapeMap[$0]; + }); + }; + + /*--------------------------------------------------------------------------*/ + + var he = { + 'version': '0.5.0', + 'encode': encode, + 'decode': decode, + 'escape': escape, + 'unescape': decode + }; + + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define(function() { + return he; + }); + } else if (freeExports && !freeExports.nodeType) { + if (freeModule) { // in Node.js or RingoJS v0.8.0+ + freeModule.exports = he; + } else { // in Narwhal or RingoJS v0.7.0- + for (var key in he) { + has(he, key) && (freeExports[key] = he[key]); + } + } + } else { // in Rhino or a web browser + root.he = he; + } + +}(this)); + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],81:[function(require,module,exports){ (function (global){ /** * @license @@ -15052,3276 +17956,14 @@ module.exports = '1.0.7'; }.call(this)); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],53:[function(require,module,exports){ -/* -Copyright (c) 2012-2014 Chris Pettitt - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -module.exports = { - graphlib: require("./lib/graphlib"), - - layout: require("./lib/layout"), - debug: require("./lib/debug"), - util: { - time: require("./lib/util").time, - notime: require("./lib/util").notime - }, - version: require("./lib/version") -}; - -},{"./lib/debug":58,"./lib/graphlib":59,"./lib/layout":61,"./lib/util":81,"./lib/version":82}],54:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"), - greedyFAS = require("./greedy-fas"); - -module.exports = { - run: run, - undo: undo -}; - -function run(g) { - var fas = (g.graph().acyclicer === "greedy" - ? greedyFAS(g, weightFn(g)) - : dfsFAS(g)); - _.each(fas, function(e) { - var label = g.edge(e); - g.removeEdge(e); - label.forwardName = e.name; - label.reversed = true; - g.setEdge(e.w, e.v, label, _.uniqueId("rev")); - }); - - function weightFn(g) { - return function(e) { - return g.edge(e).weight; - }; - } -} - -function dfsFAS(g) { - var fas = [], - stack = {}, - visited = {}; - - function dfs(v) { - if (_.has(visited, v)) { - return; - } - visited[v] = true; - stack[v] = true; - _.each(g.outEdges(v), function(e) { - if (_.has(stack, e.w)) { - fas.push(e); - } else { - dfs(e.w); - } - }); - delete stack[v]; - } - - _.each(g.nodes(), dfs); - return fas; -} - -function undo(g) { - _.each(g.edges(), function(e) { - var label = g.edge(e); - if (label.reversed) { - g.removeEdge(e); - - var forwardName = label.forwardName; - delete label.reversed; - delete label.forwardName; - g.setEdge(e.w, e.v, label, forwardName); - } - }); -} - -},{"./greedy-fas":60,"./lodash":62}],55:[function(require,module,exports){ -var _ = require("./lodash"), - util = require("./util"); - -module.exports = addBorderSegments; - -function addBorderSegments(g) { - function dfs(v) { - var children = g.children(v), - node = g.node(v); - if (children.length) { - _.each(children, dfs); - } - - if (_.has(node, "minRank")) { - node.borderLeft = []; - node.borderRight = []; - for (var rank = node.minRank, maxRank = node.maxRank + 1; - rank < maxRank; - ++rank) { - addBorderNode(g, "borderLeft", "_bl", v, node, rank); - addBorderNode(g, "borderRight", "_br", v, node, rank); - } - } - } - - _.each(g.children(), dfs); -} - -function addBorderNode(g, prop, prefix, sg, sgNode, rank) { - var label = { width: 0, height: 0, rank: rank, borderType: prop }, - prev = sgNode[prop][rank - 1], - curr = util.addDummyNode(g, "border", label, prefix); - sgNode[prop][rank] = curr; - g.setParent(curr, sg); - if (prev) { - g.setEdge(prev, curr, { weight: 1 }); - } -} - -},{"./lodash":62,"./util":81}],56:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"); - -module.exports = { - adjust: adjust, - undo: undo -}; - -function adjust(g) { - var rankDir = g.graph().rankdir.toLowerCase(); - if (rankDir === "lr" || rankDir === "rl") { - swapWidthHeight(g); - } -} - -function undo(g) { - var rankDir = g.graph().rankdir.toLowerCase(); - if (rankDir === "bt" || rankDir === "rl") { - reverseY(g); - } - - if (rankDir === "lr" || rankDir === "rl") { - swapXY(g); - swapWidthHeight(g); - } -} - -function swapWidthHeight(g) { - _.each(g.nodes(), function(v) { swapWidthHeightOne(g.node(v)); }); - _.each(g.edges(), function(e) { swapWidthHeightOne(g.edge(e)); }); -} - -function swapWidthHeightOne(attrs) { - var w = attrs.width; - attrs.width = attrs.height; - attrs.height = w; -} - -function reverseY(g) { - _.each(g.nodes(), function(v) { reverseYOne(g.node(v)); }); - - _.each(g.edges(), function(e) { - var edge = g.edge(e); - _.each(edge.points, reverseYOne); - if (_.has(edge, "y")) { - reverseYOne(edge); - } - }); -} - -function reverseYOne(attrs) { - attrs.y = -attrs.y; -} - -function swapXY(g) { - _.each(g.nodes(), function(v) { swapXYOne(g.node(v)); }); - - _.each(g.edges(), function(e) { - var edge = g.edge(e); - _.each(edge.points, swapXYOne); - if (_.has(edge, "x")) { - swapXYOne(edge); - } - }); -} - -function swapXYOne(attrs) { - var x = attrs.x; - attrs.x = attrs.y; - attrs.y = x; -} - -},{"./lodash":62}],57:[function(require,module,exports){ -/* - * Simple doubly linked list implementation derived from Cormen, et al., - * "Introduction to Algorithms". - */ - -module.exports = List; - -function List() { - var sentinel = {}; - sentinel._next = sentinel._prev = sentinel; - this._sentinel = sentinel; -} - -List.prototype.dequeue = function() { - var sentinel = this._sentinel, - entry = sentinel._prev; - if (entry !== sentinel) { - unlink(entry); - return entry; - } -}; - -List.prototype.enqueue = function(entry) { - var sentinel = this._sentinel; - if (entry._prev && entry._next) { - unlink(entry); - } - entry._next = sentinel._next; - sentinel._next._prev = entry; - sentinel._next = entry; - entry._prev = sentinel; -}; - -List.prototype.toString = function() { - var strs = [], - sentinel = this._sentinel, - curr = sentinel._prev; - while (curr !== sentinel) { - strs.push(JSON.stringify(curr, filterOutLinks)); - curr = curr._prev; - } - return "[" + strs.join(", ") + "]"; -}; - -function unlink(entry) { - entry._prev._next = entry._next; - entry._next._prev = entry._prev; - delete entry._next; - delete entry._prev; -} - -function filterOutLinks(k, v) { - if (k !== "_next" && k !== "_prev") { - return v; - } -} - -},{}],58:[function(require,module,exports){ -var _ = require("./lodash"), - util = require("./util"), - Graph = require("./graphlib").Graph; - -module.exports = { - debugOrdering: debugOrdering -}; - -/* istanbul ignore next */ -function debugOrdering(g) { - var layerMatrix = util.buildLayerMatrix(g); - - var h = new Graph({ compound: true, multigraph: true }).setGraph({}); - - _.each(g.nodes(), function(v) { - h.setNode(v, { label: v }); - h.setParent(v, "layer" + g.node(v).rank); - }); - - _.each(g.edges(), function(e) { - h.setEdge(e.v, e.w, {}, e.name); - }); - - _.each(layerMatrix, function(layer, i) { - var layerV = "layer" + i; - h.setNode(layerV, { rank: "same" }); - _.reduce(layer, function(u, v) { - h.setEdge(u, v, { style: "invis" }); - return v; - }); - }); - - return h; -} - -},{"./graphlib":59,"./lodash":62,"./util":81}],59:[function(require,module,exports){ -/* global window */ - -var graphlib; - -if (typeof require === "function") { - try { - graphlib = require("graphlib"); - } catch (e) {} -} - -if (!graphlib) { - graphlib = window.graphlib; -} - -module.exports = graphlib; - -},{"graphlib":83}],60:[function(require,module,exports){ -var _ = require("./lodash"), - Graph = require("./graphlib").Graph, - List = require("./data/list"); - -/* - * A greedy heuristic for finding a feedback arc set for a graph. A feedback - * arc set is a set of edges that can be removed to make a graph acyclic. - * The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, "A fast and - * effective heuristic for the feedback arc set problem." This implementation - * adjusts that from the paper to allow for weighted edges. - */ -module.exports = greedyFAS; - -var DEFAULT_WEIGHT_FN = _.constant(1); - -function greedyFAS(g, weightFn) { - if (g.nodeCount() <= 1) { - return []; - } - var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN); - var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx); - - // Expand multi-edges - return _.flatten(_.map(results, function(e) { - return g.outEdges(e.v, e.w); - }), true); -} - -function doGreedyFAS(g, buckets, zeroIdx) { - var results = [], - sources = buckets[buckets.length - 1], - sinks = buckets[0]; - - var entry; - while (g.nodeCount()) { - while ((entry = sinks.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } - while ((entry = sources.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } - if (g.nodeCount()) { - for (var i = buckets.length - 2; i > 0; --i) { - entry = buckets[i].dequeue(); - if (entry) { - results = results.concat(removeNode(g, buckets, zeroIdx, entry, true)); - break; - } - } - } - } - - return results; -} - -function removeNode(g, buckets, zeroIdx, entry, collectPredecessors) { - var results = collectPredecessors ? [] : undefined; - - _.each(g.inEdges(entry.v), function(edge) { - var weight = g.edge(edge), - uEntry = g.node(edge.v); - - if (collectPredecessors) { - results.push({ v: edge.v, w: edge.w }); - } - - uEntry.out -= weight; - assignBucket(buckets, zeroIdx, uEntry); - }); - - _.each(g.outEdges(entry.v), function(edge) { - var weight = g.edge(edge), - w = edge.w, - wEntry = g.node(w); - wEntry["in"] -= weight; - assignBucket(buckets, zeroIdx, wEntry); - }); - - g.removeNode(entry.v); - - return results; -} - -function buildState(g, weightFn) { - var fasGraph = new Graph(), - maxIn = 0, - maxOut = 0; - - _.each(g.nodes(), function(v) { - fasGraph.setNode(v, { v: v, "in": 0, out: 0 }); - }); - - // Aggregate weights on nodes, but also sum the weights across multi-edges - // into a single edge for the fasGraph. - _.each(g.edges(), function(e) { - var prevWeight = fasGraph.edge(e.v, e.w) || 0, - weight = weightFn(e), - edgeWeight = prevWeight + weight; - fasGraph.setEdge(e.v, e.w, edgeWeight); - maxOut = Math.max(maxOut, fasGraph.node(e.v).out += weight); - maxIn = Math.max(maxIn, fasGraph.node(e.w)["in"] += weight); - }); - - var buckets = _.range(maxOut + maxIn + 3).map(function() { return new List(); }); - var zeroIdx = maxIn + 1; - - _.each(fasGraph.nodes(), function(v) { - assignBucket(buckets, zeroIdx, fasGraph.node(v)); - }); - - return { graph: fasGraph, buckets: buckets, zeroIdx: zeroIdx }; -} - -function assignBucket(buckets, zeroIdx, entry) { - if (!entry.out) { - buckets[0].enqueue(entry); - } else if (!entry["in"]) { - buckets[buckets.length - 1].enqueue(entry); - } else { - buckets[entry.out - entry["in"] + zeroIdx].enqueue(entry); - } -} - -},{"./data/list":57,"./graphlib":59,"./lodash":62}],61:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"), - acyclic = require("./acyclic"), - normalize = require("./normalize"), - rank = require("./rank"), - normalizeRanks = require("./util").normalizeRanks, - parentDummyChains = require("./parent-dummy-chains"), - removeEmptyRanks = require("./util").removeEmptyRanks, - nestingGraph = require("./nesting-graph"), - addBorderSegments = require("./add-border-segments"), - coordinateSystem = require("./coordinate-system"), - order = require("./order"), - position = require("./position"), - util = require("./util"), - Graph = require("./graphlib").Graph; - -module.exports = layout; - -function layout(g, opts) { - var time = opts && opts.debugTiming ? util.time : util.notime; - time("layout", function() { - var layoutGraph = time(" buildLayoutGraph", - function() { return buildLayoutGraph(g); }); - time(" runLayout", function() { runLayout(layoutGraph, time); }); - time(" updateInputGraph", function() { updateInputGraph(g, layoutGraph); }); - }); -} - -function runLayout(g, time) { - time(" makeSpaceForEdgeLabels", function() { makeSpaceForEdgeLabels(g); }); - time(" removeSelfEdges", function() { removeSelfEdges(g); }); - time(" acyclic", function() { acyclic.run(g); }); - time(" nestingGraph.run", function() { nestingGraph.run(g); }); - time(" rank", function() { rank(util.asNonCompoundGraph(g)); }); - time(" injectEdgeLabelProxies", function() { injectEdgeLabelProxies(g); }); - time(" removeEmptyRanks", function() { removeEmptyRanks(g); }); - time(" nestingGraph.cleanup", function() { nestingGraph.cleanup(g); }); - time(" normalizeRanks", function() { normalizeRanks(g); }); - time(" assignRankMinMax", function() { assignRankMinMax(g); }); - time(" removeEdgeLabelProxies", function() { removeEdgeLabelProxies(g); }); - time(" normalize.run", function() { normalize.run(g); }); - time(" parentDummyChains", function() { parentDummyChains(g); }); - time(" addBorderSegments", function() { addBorderSegments(g); }); - time(" order", function() { order(g); }); - time(" insertSelfEdges", function() { insertSelfEdges(g); }); - time(" adjustCoordinateSystem", function() { coordinateSystem.adjust(g); }); - time(" position", function() { position(g); }); - time(" positionSelfEdges", function() { positionSelfEdges(g); }); - time(" removeBorderNodes", function() { removeBorderNodes(g); }); - time(" normalize.undo", function() { normalize.undo(g); }); - time(" fixupEdgeLabelCoords", function() { fixupEdgeLabelCoords(g); }); - time(" undoCoordinateSystem", function() { coordinateSystem.undo(g); }); - time(" translateGraph", function() { translateGraph(g); }); - time(" assignNodeIntersects", function() { assignNodeIntersects(g); }); - time(" reversePoints", function() { reversePointsForReversedEdges(g); }); - time(" acyclic.undo", function() { acyclic.undo(g); }); -} - -/* - * Copies final layout information from the layout graph back to the input - * graph. This process only copies whitelisted attributes from the layout graph - * to the input graph, so it serves as a good place to determine what - * attributes can influence layout. - */ -function updateInputGraph(inputGraph, layoutGraph) { - _.each(inputGraph.nodes(), function(v) { - var inputLabel = inputGraph.node(v), - layoutLabel = layoutGraph.node(v); - - if (inputLabel) { - inputLabel.x = layoutLabel.x; - inputLabel.y = layoutLabel.y; - - if (layoutGraph.children(v).length) { - inputLabel.width = layoutLabel.width; - inputLabel.height = layoutLabel.height; - } - } - }); - - _.each(inputGraph.edges(), function(e) { - var inputLabel = inputGraph.edge(e), - layoutLabel = layoutGraph.edge(e); - - inputLabel.points = layoutLabel.points; - if (_.has(layoutLabel, "x")) { - inputLabel.x = layoutLabel.x; - inputLabel.y = layoutLabel.y; - } - }); - - inputGraph.graph().width = layoutGraph.graph().width; - inputGraph.graph().height = layoutGraph.graph().height; -} - -var graphNumAttrs = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], - graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, - graphAttrs = ["acyclicer", "ranker", "rankdir", "align"], - nodeNumAttrs = ["width", "height"], - nodeDefaults = { width: 0, height: 0 }, - edgeNumAttrs = ["minlen", "weight", "width", "height", "labeloffset"], - edgeDefaults = { - minlen: 1, weight: 1, width: 0, height: 0, - labeloffset: 10, labelpos: "r" - }, - edgeAttrs = ["labelpos"]; - -/* - * Constructs a new graph from the input graph, which can be used for layout. - * This process copies only whitelisted attributes from the input graph to the - * layout graph. Thus this function serves as a good place to determine what - * attributes can influence layout. - */ -function buildLayoutGraph(inputGraph) { - var g = new Graph({ multigraph: true, compound: true }), - graph = canonicalize(inputGraph.graph()); - - g.setGraph(_.merge({}, - graphDefaults, - selectNumberAttrs(graph, graphNumAttrs), - _.pick(graph, graphAttrs))); - - _.each(inputGraph.nodes(), function(v) { - var node = canonicalize(inputGraph.node(v)); - g.setNode(v, _.defaults(selectNumberAttrs(node, nodeNumAttrs), nodeDefaults)); - g.setParent(v, inputGraph.parent(v)); - }); - - _.each(inputGraph.edges(), function(e) { - var edge = canonicalize(inputGraph.edge(e)); - g.setEdge(e, _.merge({}, - edgeDefaults, - selectNumberAttrs(edge, edgeNumAttrs), - _.pick(edge, edgeAttrs))); - }); - - return g; -} - -/* - * This idea comes from the Gansner paper: to account for edge labels in our - * layout we split each rank in half by doubling minlen and halving ranksep. - * Then we can place labels at these mid-points between nodes. - * - * We also add some minimal padding to the width to push the label for the edge - * away from the edge itself a bit. - */ -function makeSpaceForEdgeLabels(g) { - var graph = g.graph(); - graph.ranksep /= 2; - _.each(g.edges(), function(e) { - var edge = g.edge(e); - edge.minlen *= 2; - if (edge.labelpos.toLowerCase() !== "c") { - if (graph.rankdir === "TB" || graph.rankdir === "BT") { - edge.width += edge.labeloffset; - } else { - edge.height += edge.labeloffset; - } - } - }); -} - -/* - * Creates temporary dummy nodes that capture the rank in which each edge's - * label is going to, if it has one of non-zero width and height. We do this - * so that we can safely remove empty ranks while preserving balance for the - * label's position. - */ -function injectEdgeLabelProxies(g) { - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (edge.width && edge.height) { - var v = g.node(e.v), - w = g.node(e.w), - label = { rank: (w.rank - v.rank) / 2 + v.rank, e: e }; - util.addDummyNode(g, "edge-proxy", label, "_ep"); - } - }); -} - -function assignRankMinMax(g) { - var maxRank = 0; - _.each(g.nodes(), function(v) { - var node = g.node(v); - if (node.borderTop) { - node.minRank = g.node(node.borderTop).rank; - node.maxRank = g.node(node.borderBottom).rank; - maxRank = _.max(maxRank, node.maxRank); - } - }); - g.graph().maxRank = maxRank; -} - -function removeEdgeLabelProxies(g) { - _.each(g.nodes(), function(v) { - var node = g.node(v); - if (node.dummy === "edge-proxy") { - g.edge(node.e).labelRank = node.rank; - g.removeNode(v); - } - }); -} - -function translateGraph(g) { - var minX = Number.POSITIVE_INFINITY, - maxX = 0, - minY = Number.POSITIVE_INFINITY, - maxY = 0, - graphLabel = g.graph(), - marginX = graphLabel.marginx || 0, - marginY = graphLabel.marginy || 0; - - function getExtremes(attrs) { - var x = attrs.x, - y = attrs.y, - w = attrs.width, - h = attrs.height; - minX = Math.min(minX, x - w / 2); - maxX = Math.max(maxX, x + w / 2); - minY = Math.min(minY, y - h / 2); - maxY = Math.max(maxY, y + h / 2); - } - - _.each(g.nodes(), function(v) { getExtremes(g.node(v)); }); - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (_.has(edge, "x")) { - getExtremes(edge); - } - }); - - minX -= marginX; - minY -= marginY; - - _.each(g.nodes(), function(v) { - var node = g.node(v); - node.x -= minX; - node.y -= minY; - }); - - _.each(g.edges(), function(e) { - var edge = g.edge(e); - _.each(edge.points, function(p) { - p.x -= minX; - p.y -= minY; - }); - if (_.has(edge, "x")) { edge.x -= minX; } - if (_.has(edge, "y")) { edge.y -= minY; } - }); - - graphLabel.width = maxX - minX + marginX; - graphLabel.height = maxY - minY + marginY; -} - -function assignNodeIntersects(g) { - _.each(g.edges(), function(e) { - var edge = g.edge(e), - nodeV = g.node(e.v), - nodeW = g.node(e.w), - p1, p2; - if (!edge.points) { - edge.points = []; - p1 = nodeW; - p2 = nodeV; - } else { - p1 = edge.points[0]; - p2 = edge.points[edge.points.length - 1]; - } - edge.points.unshift(util.intersectRect(nodeV, p1)); - edge.points.push(util.intersectRect(nodeW, p2)); - }); -} - -function fixupEdgeLabelCoords(g) { - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (_.has(edge, "x")) { - if (edge.labelpos === "l" || edge.labelpos === "r") { - edge.width -= edge.labeloffset; - } - switch (edge.labelpos) { - case "l": edge.x -= edge.width / 2 + edge.labeloffset; break; - case "r": edge.x += edge.width / 2 + edge.labeloffset; break; - } - } - }); -} - -function reversePointsForReversedEdges(g) { - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (edge.reversed) { - edge.points.reverse(); - } - }); -} - -function removeBorderNodes(g) { - _.each(g.nodes(), function(v) { - if (g.children(v).length) { - var node = g.node(v), - t = g.node(node.borderTop), - b = g.node(node.borderBottom), - l = g.node(_.last(node.borderLeft)), - r = g.node(_.last(node.borderRight)); - - node.width = Math.abs(r.x - l.x); - node.height = Math.abs(b.y - t.y); - node.x = l.x + node.width / 2; - node.y = t.y + node.height / 2; - } - }); - - _.each(g.nodes(), function(v) { - if (g.node(v).dummy === "border") { - g.removeNode(v); - } - }); -} - -function removeSelfEdges(g) { - _.each(g.edges(), function(e) { - if (e.v === e.w) { - var node = g.node(e.v); - if (!node.selfEdges) { - node.selfEdges = []; - } - node.selfEdges.push({ e: e, label: g.edge(e) }); - g.removeEdge(e); - } - }); -} - -function insertSelfEdges(g) { - var layers = util.buildLayerMatrix(g); - _.each(layers, function(layer) { - var orderShift = 0; - _.each(layer, function(v, i) { - var node = g.node(v); - node.order = i + orderShift; - _.each(node.selfEdges, function(selfEdge) { - util.addDummyNode(g, "selfedge", { - width: selfEdge.label.width, - height: selfEdge.label.height, - rank: node.rank, - order: i + (++orderShift), - e: selfEdge.e, - label: selfEdge.label - }, "_se"); - }); - delete node.selfEdges; - }); - }); -} - -function positionSelfEdges(g) { - _.each(g.nodes(), function(v) { - var node = g.node(v); - if (node.dummy === "selfedge") { - var selfNode = g.node(node.e.v), - x = selfNode.x + selfNode.width / 2, - y = selfNode.y, - dx = node.x - x, - dy = selfNode.height / 2; - g.setEdge(node.e, node.label); - g.removeNode(v); - node.label.points = [ - { x: x + 2 * dx / 3, y: y - dy }, - { x: x + 5 * dx / 6, y: y - dy }, - { x: x + dx , y: y }, - { x: x + 5 * dx / 6, y: y + dy }, - { x: x + 2 * dx / 3, y: y + dy }, - ]; - node.label.x = node.x; - node.label.y = node.y; - } - }); -} - -function selectNumberAttrs(obj, attrs) { - return _.mapValues(_.pick(obj, attrs), Number); -} - -function canonicalize(attrs) { - var newAttrs = {}; - _.each(attrs, function(v, k) { - newAttrs[k.toLowerCase()] = v; - }); - return newAttrs; -} - -},{"./acyclic":54,"./add-border-segments":55,"./coordinate-system":56,"./graphlib":59,"./lodash":62,"./nesting-graph":63,"./normalize":64,"./order":69,"./parent-dummy-chains":74,"./position":76,"./rank":78,"./util":81}],62:[function(require,module,exports){ -module.exports=require(50) -},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\lodash.js":50,"lodash":103}],63:[function(require,module,exports){ -var _ = require("./lodash"), - util = require("./util"); - -module.exports = { - run: run, - cleanup: cleanup -}; - -/* - * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs, - * adds appropriate edges to ensure that all cluster nodes are placed between - * these boundries, and ensures that the graph is connected. - * - * In addition we ensure, through the use of the minlen property, that nodes - * and subgraph border nodes to not end up on the same rank. - * - * Preconditions: - * - * 1. Input graph is a DAG - * 2. Nodes in the input graph has a minlen attribute - * - * Postconditions: - * - * 1. Input graph is connected. - * 2. Dummy nodes are added for the tops and bottoms of subgraphs. - * 3. The minlen attribute for nodes is adjusted to ensure nodes do not - * get placed on the same rank as subgraph border nodes. - * - * The nesting graph idea comes from Sander, "Layout of Compound Directed - * Graphs." - */ -function run(g) { - var root = util.addDummyNode(g, "root", {}, "_root"), - depths = treeDepths(g), - height = _.max(depths) - 1, - nodeSep = 2 * height + 1; - - g.graph().nestingRoot = root; - - // Multiply minlen by nodeSep to align nodes on non-border ranks. - _.each(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; }); - - // Calculate a weight that is sufficient to keep subgraphs vertically compact - var weight = sumWeights(g) + 1; - - // Create border nodes and link them up - _.each(g.children(), function(child) { - dfs(g, root, nodeSep, weight, height, depths, child); - }); - - // Save the multiplier for node layers for later removal of empty border - // layers. - g.graph().nodeRankFactor = nodeSep; -} - -function dfs(g, root, nodeSep, weight, height, depths, v) { - var children = g.children(v); - if (!children.length) { - if (v !== root) { - g.setEdge(root, v, { weight: 0, minlen: nodeSep }); - } - return; - } - - var top = util.addBorderNode(g, "_bt"), - bottom = util.addBorderNode(g, "_bb"), - label = g.node(v); - - g.setParent(top, v); - label.borderTop = top; - g.setParent(bottom, v); - label.borderBottom = bottom; - - _.each(children, function(child) { - dfs(g, root, nodeSep, weight, height, depths, child); - - var childNode = g.node(child), - childTop = childNode.borderTop ? childNode.borderTop : child, - childBottom = childNode.borderBottom ? childNode.borderBottom : child, - thisWeight = childNode.borderTop ? weight : 2 * weight, - minlen = childTop !== childBottom ? 1 : height - depths[v] + 1; - - g.setEdge(top, childTop, { - weight: thisWeight, - minlen: minlen, - nestingEdge: true - }); - - g.setEdge(childBottom, bottom, { - weight: thisWeight, - minlen: minlen, - nestingEdge: true - }); - }); - - if (!g.parent(v)) { - g.setEdge(root, top, { weight: 0, minlen: height + depths[v] }); - } -} - -function treeDepths(g) { - var depths = {}; - function dfs(v, depth) { - var children = g.children(v); - if (children && children.length) { - _.each(children, function(child) { - dfs(child, depth + 1); - }); - } - depths[v] = depth; - } - _.each(g.children(), function(v) { dfs(v, 1); }); - return depths; -} - -function sumWeights(g) { - return _.reduce(g.edges(), function(acc, e) { - return acc + g.edge(e).weight; - }, 0); -} - -function cleanup(g) { - var graphLabel = g.graph(); - g.removeNode(graphLabel.nestingRoot); - delete graphLabel.nestingRoot; - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (edge.nestingEdge) { - g.removeEdge(e); - } - }); -} - -},{"./lodash":62,"./util":81}],64:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"), - util = require("./util"); - -module.exports = { - run: run, - undo: undo -}; - -/* - * Breaks any long edges in the graph into short segments that span 1 layer - * each. This operation is undoable with the denormalize function. - * - * Pre-conditions: - * - * 1. The input graph is a DAG. - * 2. Each node in the graph has a "rank" property. - * - * Post-condition: - * - * 1. All edges in the graph have a length of 1. - * 2. Dummy nodes are added where edges have been split into segments. - * 3. The graph is augmented with a "dummyChains" attribute which contains - * the first dummy in each chain of dummy nodes produced. - */ -function run(g) { - g.graph().dummyChains = []; - _.each(g.edges(), function(edge) { normalizeEdge(g, edge); }); -} - -function normalizeEdge(g, e) { - var v = e.v, - vRank = g.node(v).rank, - w = e.w, - wRank = g.node(w).rank, - name = e.name, - edgeLabel = g.edge(e), - labelRank = edgeLabel.labelRank; - - if (wRank === vRank + 1) return; - - g.removeEdge(e); - - var dummy, attrs, i; - for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) { - edgeLabel.points = []; - attrs = { - width: 0, height: 0, - edgeLabel: edgeLabel, edgeObj: e, - rank: vRank - }; - dummy = util.addDummyNode(g, "edge", attrs, "_d"); - if (vRank === labelRank) { - attrs.width = edgeLabel.width; - attrs.height = edgeLabel.height; - attrs.dummy = "edge-label"; - attrs.labelpos = edgeLabel.labelpos; - } - g.setEdge(v, dummy, { weight: edgeLabel.weight }, name); - if (i === 0) { - g.graph().dummyChains.push(dummy); - } - v = dummy; - } - - g.setEdge(v, w, { weight: edgeLabel.weight }, name); -} - -function undo(g) { - _.each(g.graph().dummyChains, function(v) { - var node = g.node(v), - origLabel = node.edgeLabel, - w; - g.setEdge(node.edgeObj, origLabel); - while (node.dummy) { - w = g.successors(v)[0]; - g.removeNode(v); - origLabel.points.push({ x: node.x, y: node.y }); - if (node.dummy === "edge-label") { - origLabel.x = node.x; - origLabel.y = node.y; - origLabel.width = node.width; - origLabel.height = node.height; - } - v = w; - node = g.node(v); - } - }); -} - -},{"./lodash":62,"./util":81}],65:[function(require,module,exports){ -var _ = require("../lodash"); - -module.exports = addSubgraphConstraints; - -function addSubgraphConstraints(g, cg, vs) { - var prev = {}, - rootPrev; - - _.each(vs, function(v) { - var child = g.parent(v), - parent, - prevChild; - while (child) { - parent = g.parent(child); - if (parent) { - prevChild = prev[parent]; - prev[parent] = child; - } else { - prevChild = rootPrev; - rootPrev = child; - } - if (prevChild && prevChild !== child) { - cg.setEdge(prevChild, child); - return; - } - child = parent; - } - }); - - /* - function dfs(v) { - var children = v ? g.children(v) : g.children(); - if (children.length) { - var min = Number.POSITIVE_INFINITY, - subgraphs = []; - _.each(children, function(child) { - var childMin = dfs(child); - if (g.children(child).length) { - subgraphs.push({ v: child, order: childMin }); - } - min = Math.min(min, childMin); - }); - _.reduce(_.sortBy(subgraphs, "order"), function(prev, curr) { - cg.setEdge(prev.v, curr.v); - return curr; - }); - return min; - } - return g.node(v).order; - } - dfs(undefined); - */ -} - -},{"../lodash":62}],66:[function(require,module,exports){ -var _ = require("../lodash"); - -module.exports = barycenter; - -function barycenter(g, movable) { - return _.map(movable, function(v) { - var inV = g.inEdges(v); - if (!inV.length) { - return { v: v }; - } else { - var result = _.reduce(inV, function(acc, e) { - var edge = g.edge(e), - nodeU = g.node(e.v); - return { - sum: acc.sum + (edge.weight * nodeU.order), - weight: acc.weight + edge.weight - }; - }, { sum: 0, weight: 0 }); - - return { - v: v, - barycenter: result.sum / result.weight, - weight: result.weight - }; - } - }); -} - - -},{"../lodash":62}],67:[function(require,module,exports){ -var _ = require("../lodash"), - Graph = require("../graphlib").Graph; - -module.exports = buildLayerGraph; - -/* - * Constructs a graph that can be used to sort a layer of nodes. The graph will - * contain all base and subgraph nodes from the request layer in their original - * hierarchy and any edges that are incident on these nodes and are of the type - * requested by the "relationship" parameter. - * - * Nodes from the requested rank that do not have parents are assigned a root - * node in the output graph, which is set in the root graph attribute. This - * makes it easy to walk the hierarchy of movable nodes during ordering. - * - * Pre-conditions: - * - * 1. Input graph is a DAG - * 2. Base nodes in the input graph have a rank attribute - * 3. Subgraph nodes in the input graph has minRank and maxRank attributes - * 4. Edges have an assigned weight - * - * Post-conditions: - * - * 1. Output graph has all nodes in the movable rank with preserved - * hierarchy. - * 2. Root nodes in the movable layer are made children of the node - * indicated by the root attribute of the graph. - * 3. Non-movable nodes incident on movable nodes, selected by the - * relationship parameter, are included in the graph (without hierarchy). - * 4. Edges incident on movable nodes, selected by the relationship - * parameter, are added to the output graph. - * 5. The weights for copied edges are aggregated as need, since the output - * graph is not a multi-graph. - */ -function buildLayerGraph(g, rank, relationship) { - var root = createRootNode(g), - result = new Graph({ compound: true }).setGraph({ root: root }) - .setDefaultNodeLabel(function(v) { return g.node(v); }); - - _.each(g.nodes(), function(v) { - var node = g.node(v), - parent = g.parent(v); - - if (node.rank === rank || node.minRank <= rank && rank <= node.maxRank) { - result.setNode(v); - result.setParent(v, parent || root); - - // This assumes we have only short edges! - _.each(g[relationship](v), function(e) { - var u = e.v === v ? e.w : e.v, - edge = result.edge(u, v), - weight = !_.isUndefined(edge) ? edge.weight : 0; - result.setEdge(u, v, { weight: g.edge(e).weight + weight }); - }); - - if (_.has(node, "minRank")) { - result.setNode(v, { - borderLeft: node.borderLeft[rank], - borderRight: node.borderRight[rank] - }); - } - } - }); - - return result; -} - -function createRootNode(g) { - var v; - while (g.hasNode((v = _.uniqueId("_root")))); - return v; -} - -},{"../graphlib":59,"../lodash":62}],68:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"); - -module.exports = crossCount; - -/* - * A function that takes a layering (an array of layers, each with an array of - * ordererd nodes) and a graph and returns a weighted crossing count. - * - * Pre-conditions: - * - * 1. Input graph must be simple (not a multigraph), directed, and include - * only simple edges. - * 2. Edges in the input graph must have assigned weights. - * - * Post-conditions: - * - * 1. The graph and layering matrix are left unchanged. - * - * This algorithm is derived from Barth, et al., "Bilayer Cross Counting." - */ -function crossCount(g, layering) { - var cc = 0; - for (var i = 1; i < layering.length; ++i) { - cc += twoLayerCrossCount(g, layering[i-1], layering[i]); - } - return cc; -} - -function twoLayerCrossCount(g, northLayer, southLayer) { - // Sort all of the edges between the north and south layers by their position - // in the north layer and then the south. Map these edges to the position of - // their head in the south layer. - var southPos = _.zipObject(southLayer, - _.map(southLayer, function (v, i) { return i; })); - var southEntries = _.flatten(_.map(northLayer, function(v) { - return _.chain(g.outEdges(v)) - .map(function(e) { - return { pos: southPos[e.w], weight: g.edge(e).weight }; - }) - .sortBy("pos") - .value(); - }), true); - - // Build the accumulator tree - var firstIndex = 1; - while (firstIndex < southLayer.length) firstIndex <<= 1; - var treeSize = 2 * firstIndex - 1; - firstIndex -= 1; - var tree = _.map(new Array(treeSize), function() { return 0; }); - - // Calculate the weighted crossings - var cc = 0; - _.each(southEntries.forEach(function(entry) { - var index = entry.pos + firstIndex; - tree[index] += entry.weight; - var weightSum = 0; - while (index > 0) { - if (index % 2) { - weightSum += tree[index + 1]; - } - index = (index - 1) >> 1; - tree[index] += entry.weight; - } - cc += entry.weight * weightSum; - })); - - return cc; -} - -},{"../lodash":62}],69:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - initOrder = require("./init-order"), - crossCount = require("./cross-count"), - sortSubgraph = require("./sort-subgraph"), - buildLayerGraph = require("./build-layer-graph"), - addSubgraphConstraints = require("./add-subgraph-constraints"), - Graph = require("../graphlib").Graph, - util = require("../util"); - -module.exports = order; - -/* - * Applies heuristics to minimize edge crossings in the graph and sets the best - * order solution as an order attribute on each node. - * - * Pre-conditions: - * - * 1. Graph must be DAG - * 2. Graph nodes must be objects with a "rank" attribute - * 3. Graph edges must have the "weight" attribute - * - * Post-conditions: - * - * 1. Graph nodes will have an "order" attribute based on the results of the - * algorithm. - */ -function order(g) { - var maxRank = util.maxRank(g), - downLayerGraphs = buildLayerGraphs(g, _.range(1, maxRank + 1), "inEdges"), - upLayerGraphs = buildLayerGraphs(g, _.range(maxRank - 1, -1, -1), "outEdges"); - - var layering = initOrder(g); - assignOrder(g, layering); - - var bestCC = Number.POSITIVE_INFINITY, - best; - - for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) { - sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2); - - layering = util.buildLayerMatrix(g); - var cc = crossCount(g, layering); - if (cc < bestCC) { - lastBest = 0; - best = _.cloneDeep(layering); - bestCC = cc; - } - } - - assignOrder(g, best); -} - -function buildLayerGraphs(g, ranks, relationship) { - return _.map(ranks, function(rank) { - return buildLayerGraph(g, rank, relationship); - }); -} - -function sweepLayerGraphs(layerGraphs, biasRight) { - var cg = new Graph(); - _.each(layerGraphs, function(lg) { - var root = lg.graph().root; - var sorted = sortSubgraph(lg, root, cg, biasRight); - _.each(sorted.vs, function(v, i) { - lg.node(v).order = i; - }); - addSubgraphConstraints(lg, cg, sorted.vs); - }); -} - -function assignOrder(g, layering) { - _.each(layering, function(layer) { - _.each(layer, function(v, i) { - g.node(v).order = i; - }); - }); -} - -},{"../graphlib":59,"../lodash":62,"../util":81,"./add-subgraph-constraints":65,"./build-layer-graph":67,"./cross-count":68,"./init-order":70,"./sort-subgraph":72}],70:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"); - -module.exports = initOrder; - -/* - * Assigns an initial order value for each node by performing a DFS search - * starting from nodes in the first rank. Nodes are assigned an order in their - * rank as they are first visited. - * - * This approach comes from Gansner, et al., "A Technique for Drawing Directed - * Graphs." - * - * Returns a layering matrix with an array per layer and each layer sorted by - * the order of its nodes. - */ -function initOrder(g) { - var visited = {}, - simpleNodes = _.filter(g.nodes(), function(v) { - return !g.children(v).length; - }), - maxRank = _.max(_.map(simpleNodes, function(v) { return g.node(v).rank; })), - layers = _.map(_.range(maxRank + 1), function() { return []; }); - - function dfs(v) { - if (_.has(visited, v)) return; - visited[v] = true; - var node = g.node(v); - layers[node.rank].push(v); - _.each(g.successors(v), dfs); - } - - var orderedVs = _.sortBy(simpleNodes, function(v) { return g.node(v).rank; }); - _.each(orderedVs, dfs); - - return layers; -} - -},{"../lodash":62}],71:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"); - -module.exports = resolveConflicts; - -/* - * Given a list of entries of the form {v, barycenter, weight} and a - * constraint graph this function will resolve any conflicts between the - * constraint graph and the barycenters for the entries. If the barycenters for - * an entry would violate a constraint in the constraint graph then we coalesce - * the nodes in the conflict into a new node that respects the contraint and - * aggregates barycenter and weight information. - * - * This implementation is based on the description in Forster, "A Fast and - * Simple Hueristic for Constrained Two-Level Crossing Reduction," thought it - * differs in some specific details. - * - * Pre-conditions: - * - * 1. Each entry has the form {v, barycenter, weight}, or if the node has - * no barycenter, then {v}. - * - * Returns: - * - * A new list of entries of the form {vs, i, barycenter, weight}. The list - * `vs` may either be a singleton or it may be an aggregation of nodes - * ordered such that they do not violate constraints from the constraint - * graph. The property `i` is the lowest original index of any of the - * elements in `vs`. - */ -function resolveConflicts(entries, cg) { - var mappedEntries = {}; - _.each(entries, function(entry, i) { - var tmp = mappedEntries[entry.v] = { - indegree: 0, - "in": [], - out: [], - vs: [entry.v], - i: i - }; - if (!_.isUndefined(entry.barycenter)) { - tmp.barycenter = entry.barycenter; - tmp.weight = entry.weight; - } - }); - - _.each(cg.edges(), function(e) { - var entryV = mappedEntries[e.v], - entryW = mappedEntries[e.w]; - if (!_.isUndefined(entryV) && !_.isUndefined(entryW)) { - entryW.indegree++; - entryV.out.push(mappedEntries[e.w]); - } - }); - - var sourceSet = _.filter(mappedEntries, function(entry) { - return !entry.indegree; - }); - - return doResolveConflicts(sourceSet); -} - -function doResolveConflicts(sourceSet) { - var entries = []; - - function handleIn(vEntry) { - return function(uEntry) { - if (uEntry.merged) { - return; - } - if (_.isUndefined(uEntry.barycenter) || - _.isUndefined(vEntry.barycenter) || - uEntry.barycenter >= vEntry.barycenter) { - mergeEntries(vEntry, uEntry); - } - }; - } - - function handleOut(vEntry) { - return function(wEntry) { - wEntry["in"].push(vEntry); - if (--wEntry.indegree === 0) { - sourceSet.push(wEntry); - } - }; - } - - while (sourceSet.length) { - var entry = sourceSet.pop(); - entries.push(entry); - _.each(entry["in"].reverse(), handleIn(entry)); - _.each(entry.out, handleOut(entry)); - } - - return _.chain(entries) - .filter(function(entry) { return !entry.merged; }) - .map(function(entry) { - return _.pick(entry, ["vs", "i", "barycenter", "weight"]); - }) - .value(); -} - -function mergeEntries(target, source) { - var sum = 0, - weight = 0; - - if (target.weight) { - sum += target.barycenter * target.weight; - weight += target.weight; - } - - if (source.weight) { - sum += source.barycenter * source.weight; - weight += source.weight; - } - - target.vs = source.vs.concat(target.vs); - target.barycenter = sum / weight; - target.weight = weight; - target.i = Math.min(source.i, target.i); - source.merged = true; -} - -},{"../lodash":62}],72:[function(require,module,exports){ -var _ = require("../lodash"), - barycenter = require("./barycenter"), - resolveConflicts = require("./resolve-conflicts"), - sort = require("./sort"); - -module.exports = sortSubgraph; - -function sortSubgraph(g, v, cg, biasRight) { - var movable = g.children(v), - node = g.node(v), - bl = node ? node.borderLeft : undefined, - br = node ? node.borderRight: undefined, - subgraphs = {}; - - if (bl) { - movable = _.filter(movable, function(w) { - return w !== bl && w !== br; - }); - } - - var barycenters = barycenter(g, movable); - _.each(barycenters, function(entry) { - if (g.children(entry.v).length) { - var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight); - subgraphs[entry.v] = subgraphResult; - if (_.has(subgraphResult, "barycenter")) { - mergeBarycenters(entry, subgraphResult); - } - } - }); - - var entries = resolveConflicts(barycenters, cg); - expandSubgraphs(entries, subgraphs); - - var result = sort(entries, biasRight); - - if (bl) { - result.vs = _.flatten([bl, result.vs, br], true); - if (g.predecessors(bl).length) { - var blPred = g.node(g.predecessors(bl)[0]), - brPred = g.node(g.predecessors(br)[0]); - if (!_.has(result, "barycenter")) { - result.barycenter = 0; - result.weight = 0; - } - result.barycenter = (result.barycenter * result.weight + - blPred.order + brPred.order) / (result.weight + 2); - result.weight += 2; - } - } - - return result; -} - -function expandSubgraphs(entries, subgraphs) { - _.each(entries, function(entry) { - entry.vs = _.flatten(entry.vs.map(function(v) { - if (subgraphs[v]) { - return subgraphs[v].vs; - } - return v; - }), true); - }); -} - -function mergeBarycenters(target, other) { - if (!_.isUndefined(target.barycenter)) { - target.barycenter = (target.barycenter * target.weight + - other.barycenter * other.weight) / - (target.weight + other.weight); - target.weight += other.weight; - } else { - target.barycenter = other.barycenter; - target.weight = other.weight; - } -} - -},{"../lodash":62,"./barycenter":66,"./resolve-conflicts":71,"./sort":73}],73:[function(require,module,exports){ -var _ = require("../lodash"), - util = require("../util"); - -module.exports = sort; - -function sort(entries, biasRight) { - var parts = util.partition(entries, function(entry) { - return _.has(entry, "barycenter"); - }); - var sortable = parts.lhs, - unsortable = _.sortBy(parts.rhs, function(entry) { return -entry.i; }), - vs = [], - sum = 0, - weight = 0, - vsIndex = 0; - - sortable.sort(compareWithBias(!!biasRight)); - - vsIndex = consumeUnsortable(vs, unsortable, vsIndex); - - _.each(sortable, function (entry) { - vsIndex += entry.vs.length; - vs.push(entry.vs); - sum += entry.barycenter * entry.weight; - weight += entry.weight; - vsIndex = consumeUnsortable(vs, unsortable, vsIndex); - }); - - var result = { vs: _.flatten(vs, true) }; - if (weight) { - result.barycenter = sum / weight; - result.weight = weight; - } - return result; -} - -function consumeUnsortable(vs, unsortable, index) { - var last; - while (unsortable.length && (last = _.last(unsortable)).i <= index) { - unsortable.pop(); - vs.push(last.vs); - index++; - } - return index; -} - -function compareWithBias(bias) { - return function(entryV, entryW) { - if (entryV.barycenter < entryW.barycenter) { - return -1; - } else if (entryV.barycenter > entryW.barycenter) { - return 1; - } - - return !bias ? entryV.i - entryW.i : entryW.i - entryV.i; - }; -} - -},{"../lodash":62,"../util":81}],74:[function(require,module,exports){ -var _ = require("./lodash"); - -module.exports = parentDummyChains; - -function parentDummyChains(g) { - var postorderNums = postorder(g); - - _.each(g.graph().dummyChains, function(v) { - var node = g.node(v), - edgeObj = node.edgeObj, - pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w), - path = pathData.path, - lca = pathData.lca, - pathIdx = 0, - pathV = path[pathIdx], - ascending = true; - - while (v !== edgeObj.w) { - node = g.node(v); - - if (ascending) { - while ((pathV = path[pathIdx]) !== lca && - g.node(pathV).maxRank < node.rank) { - pathIdx++; - } - - if (pathV === lca) { - ascending = false; - } - } - - if (!ascending) { - while (pathIdx < path.length - 1 && - g.node(pathV = path[pathIdx + 1]).minRank <= node.rank) { - pathIdx++; - } - pathV = path[pathIdx]; - } - - g.setParent(v, pathV); - v = g.successors(v)[0]; - } - }); -} - -// Find a path from v to w through the lowest common ancestor (LCA). Return the -// full path and the LCA. -function findPath(g, postorderNums, v, w) { - var vPath = [], - wPath = [], - low = Math.min(postorderNums[v].low, postorderNums[w].low), - lim = Math.max(postorderNums[v].lim, postorderNums[w].lim), - parent, - lca; - - // Traverse up from v to find the LCA - parent = v; - do { - parent = g.parent(parent); - vPath.push(parent); - } while (parent && - (postorderNums[parent].low > low || lim > postorderNums[parent].lim)); - lca = parent; - - // Traverse from w to LCA - parent = w; - while ((parent = g.parent(parent)) !== lca) { - wPath.push(parent); - } - - return { path: vPath.concat(wPath.reverse()), lca: lca }; -} - -function postorder(g) { - var result = {}, - lim = 0; - - function dfs(v) { - var low = lim; - _.each(g.children(v), dfs); - result[v] = { low: low, lim: lim++ }; - } - _.each(g.children(), dfs); - - return result; -} - -},{"./lodash":62}],75:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - Graph = require("../graphlib").Graph, - util = require("../util"); - -/* - * This module provides coordinate assignment based on Brandes and Köpf, "Fast - * and Simple Horizontal Coordinate Assignment." - */ - -module.exports = { - positionX: positionX, - findType1Conflicts: findType1Conflicts, - findType2Conflicts: findType2Conflicts, - addConflict: addConflict, - hasConflict: hasConflict, - verticalAlignment: verticalAlignment, - horizontalCompaction: horizontalCompaction, - alignCoordinates: alignCoordinates, - findSmallestWidthAlignment: findSmallestWidthAlignment, - balance: balance -}; - -/* - * Marks all edges in the graph with a type-1 conflict with the "type1Conflict" - * property. A type-1 conflict is one where a non-inner segment crosses an - * inner segment. An inner segment is an edge with both incident nodes marked - * with the "dummy" property. - * - * This algorithm scans layer by layer, starting with the second, for type-1 - * conflicts between the current layer and the previous layer. For each layer - * it scans the nodes from left to right until it reaches one that is incident - * on an inner segment. It then scans predecessors to determine if they have - * edges that cross that inner segment. At the end a final scan is done for all - * nodes on the current rank to see if they cross the last visited inner - * segment. - * - * This algorithm (safely) assumes that a dummy node will only be incident on a - * single node in the layers being scanned. - */ -function findType1Conflicts(g, layering) { - var conflicts = {}; - - function visitLayer(prevLayer, layer) { - var - // last visited node in the previous layer that is incident on an inner - // segment. - k0 = 0, - // Tracks the last node in this layer scanned for crossings with a type-1 - // segment. - scanPos = 0, - prevLayerLength = prevLayer.length, - lastNode = _.last(layer); - - _.each(layer, function(v, i) { - var w = findOtherInnerSegmentNode(g, v), - k1 = w ? g.node(w).order : prevLayerLength; - - if (w || v === lastNode) { - _.each(layer.slice(scanPos, i +1), function(scanNode) { - _.each(g.predecessors(scanNode), function(u) { - var uLabel = g.node(u), - uPos = uLabel.order; - if ((uPos < k0 || k1 < uPos) && - !(uLabel.dummy && g.node(scanNode).dummy)) { - addConflict(conflicts, u, scanNode); - } - }); - }); - scanPos = i + 1; - k0 = k1; - } - }); - - return layer; - } - - _.reduce(layering, visitLayer); - return conflicts; -} - -function findType2Conflicts(g, layering) { - var conflicts = {}; - - function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) { - var v; - _.each(_.range(southPos, southEnd), function(i) { - v = south[i]; - if (g.node(v).dummy) { - _.each(g.predecessors(v), function(u) { - var uNode = g.node(u); - if (uNode.dummy && - (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) { - addConflict(conflicts, u, v); - } - }); - } - }); - } - - - function visitLayer(north, south) { - var prevNorthPos = -1, - nextNorthPos, - southPos = 0; - - _.each(south, function(v, southLookahead) { - if (g.node(v).dummy === "border") { - var predecessors = g.predecessors(v); - if (predecessors.length) { - nextNorthPos = g.node(predecessors[0]).order; - scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos); - southPos = southLookahead; - prevNorthPos = nextNorthPos; - } - } - scan(south, southPos, south.length, nextNorthPos, north.length); - }); - - return south; - } - - _.reduce(layering, visitLayer); - return conflicts; -} - -function findOtherInnerSegmentNode(g, v) { - if (g.node(v).dummy) { - return _.find(g.predecessors(v), function(u) { - return g.node(u).dummy; - }); - } -} - -function addConflict(conflicts, v, w) { - if (v > w) { - var tmp = v; - v = w; - w = tmp; - } - - var conflictsV = conflicts[v]; - if (!conflictsV) { - conflicts[v] = conflictsV = {}; - } - conflictsV[w] = true; -} - -function hasConflict(conflicts, v, w) { - if (v > w) { - var tmp = v; - v = w; - w = tmp; - } - return _.has(conflicts[v], w); -} - -/* - * Try to align nodes into vertical "blocks" where possible. This algorithm - * attempts to align a node with one of its median neighbors. If the edge - * connecting a neighbor is a type-1 conflict then we ignore that possibility. - * If a previous node has already formed a block with a node after the node - * we're trying to form a block with, we also ignore that possibility - our - * blocks would be split in that scenario. - */ -function verticalAlignment(g, layering, conflicts, neighborFn) { - var root = {}, - align = {}, - pos = {}; - - // We cache the position here based on the layering because the graph and - // layering may be out of sync. The layering matrix is manipulated to - // generate different extreme alignments. - _.each(layering, function(layer) { - _.each(layer, function(v, order) { - root[v] = v; - align[v] = v; - pos[v] = order; - }); - }); - - _.each(layering, function(layer) { - var prevIdx = -1; - _.each(layer, function(v) { - var ws = neighborFn(v); - if (ws.length) { - ws = _.sortBy(ws, function(w) { return pos[w]; }); - var mp = (ws.length - 1) / 2; - for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) { - var w = ws[i]; - if (align[v] === v && - prevIdx < pos[w] && - !hasConflict(conflicts, v, w)) { - align[w] = v; - align[v] = root[v] = root[w]; - prevIdx = pos[w]; - } - } - } - }); - }); - - return { root: root, align: align }; -} - -function horizontalCompaction(g, layering, root, align, reverseSep) { - // This portion of the algorithm differs from BK due to a number of problems. - // Instead of their algorithm we construct a new block graph and do two - // sweeps. The first sweep places blocks with the smallest possible - // coordinates. The second sweep removes unused space by moving blocks to the - // greatest coordinates without violating separation. - var xs = {}, - blockG = buildBlockGraph(g, layering, root, reverseSep); - - // First pass, assign smallest coordinates via DFS - var visited = {}; - function pass1(v) { - if (!_.has(visited, v)) { - visited[v] = true; - xs[v] = _.reduce(blockG.inEdges(v), function(max, e) { - pass1(e.v); - return Math.max(max, xs[e.v] + blockG.edge(e)); - }, 0); - } - } - _.each(blockG.nodes(), pass1); - - var borderType = reverseSep ? "borderLeft" : "borderRight"; - function pass2(v) { - if (visited[v] !== 2) { - visited[v]++; - var node = g.node(v); - var min = _.reduce(blockG.outEdges(v), function(min, e) { - pass2(e.w); - return Math.min(min, xs[e.w] - blockG.edge(e)); - }, Number.POSITIVE_INFINITY); - if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) { - xs[v] = Math.max(xs[v], min); - } - } - } - _.each(blockG.nodes(), pass2); - - // Assign x coordinates to all nodes - _.each(align, function(v) { - xs[v] = xs[root[v]]; - }); - - return xs; -} - - -function buildBlockGraph(g, layering, root, reverseSep) { - var blockGraph = new Graph(), - graphLabel = g.graph(), - sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep); - - _.each(layering, function(layer) { - var u; - _.each(layer, function(v) { - var vRoot = root[v]; - blockGraph.setNode(vRoot); - if (u) { - var uRoot = root[u], - prevMax = blockGraph.edge(uRoot, vRoot); - blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0)); - } - u = v; - }); - }); - - return blockGraph; -} - -/* - * Returns the alignment that has the smallest width of the given alignments. - */ -function findSmallestWidthAlignment(g, xss) { - return _.min(xss, function(xs) { - var min = _.min(xs, function(x, v) { return x - width(g, v) / 2; }), - max = _.max(xs, function(x, v) { return x + width(g, v) / 2; }); - return max - min; - }); -} - -/* - * Align the coordinates of each of the layout alignments such that - * left-biased alignments have their minimum coordinate at the same point as - * the minimum coordinate of the smallest width alignment and right-biased - * alignments have their maximum coordinate at the same point as the maximum - * coordinate of the smallest width alignment. - */ -function alignCoordinates(xss, alignTo) { - var alignToMin = _.min(alignTo), - alignToMax = _.max(alignTo); - - _.each(["u", "d"], function(vert) { - _.each(["l", "r"], function(horiz) { - var alignment = vert + horiz, - xs = xss[alignment], - delta; - if (xs === alignTo) return; - - delta = horiz === "l" ? alignToMin - _.min(xs) : alignToMax - _.max(xs); - - if (delta) { - xss[alignment] = _.mapValues(xs, function(x) { return x + delta; }); - } - }); - }); -} - -function balance(xss, align) { - return _.mapValues(xss.ul, function(ignore, v) { - if (align) { - return xss[align.toLowerCase()][v]; - } else { - var xs = _.sortBy(_.pluck(xss, v)); - return (xs[1] + xs[2]) / 2; - } - }); -} - -function positionX(g) { - var layering = util.buildLayerMatrix(g), - conflicts = _.merge(findType1Conflicts(g, layering), - findType2Conflicts(g, layering)); - - var xss = {}, - adjustedLayering; - _.each(["u", "d"], function(vert) { - adjustedLayering = vert === "u" ? layering : _.values(layering).reverse(); - _.each(["l", "r"], function(horiz) { - if (horiz === "r") { - adjustedLayering = _.map(adjustedLayering, function(inner) { - return _.values(inner).reverse(); - }); - } - - var neighborFn = _.bind(vert === "u" ? g.predecessors : g.successors, g); - var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn); - var xs = horizontalCompaction(g, adjustedLayering, - align.root, align.align, - horiz === "r"); - if (horiz === "r") { - xs = _.mapValues(xs, function(x) { return -x; }); - } - xss[vert + horiz] = xs; - }); - }); - - var smallestWidth = findSmallestWidthAlignment(g, xss); - alignCoordinates(xss, smallestWidth); - return balance(xss, g.graph().align); -} - -function sep(nodeSep, edgeSep, reverseSep) { - return function(g, v, w) { - var vLabel = g.node(v), - wLabel = g.node(w), - sum = 0, - delta; - - sum += vLabel.width / 2; - if (_.has(vLabel, "labelpos")) { - switch (vLabel.labelpos.toLowerCase()) { - case "l": delta = -vLabel.width / 2; break; - case "r": delta = vLabel.width / 2; break; - } - } - if (delta) { - sum += reverseSep ? delta : -delta; - } - delta = 0; - - sum += (vLabel.dummy ? edgeSep : nodeSep) / 2; - sum += (wLabel.dummy ? edgeSep : nodeSep) / 2; - - sum += wLabel.width / 2; - if (_.has(wLabel, "labelpos")) { - switch (wLabel.labelpos.toLowerCase()) { - case "l": delta = wLabel.width / 2; break; - case "r": delta = -wLabel.width / 2; break; - } - } - if (delta) { - sum += reverseSep ? delta : -delta; - } - delta = 0; - - return sum; - }; -} - -function width(g, v) { - return g.node(v).width; -} - -},{"../graphlib":59,"../lodash":62,"../util":81}],76:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - util = require("../util"), - positionX = require("./bk").positionX; - -module.exports = position; - -function position(g) { - g = util.asNonCompoundGraph(g); - - positionY(g); - _.each(positionX(g), function(x, v) { - g.node(v).x = x; - }); -} - -function positionY(g) { - var layering = util.buildLayerMatrix(g), - rankSep = g.graph().ranksep, - prevY = 0; - _.each(layering, function(layer) { - var maxHeight = _.max(_.map(layer, function(v) { return g.node(v).height; })); - _.each(layer, function(v) { - g.node(v).y = prevY + maxHeight / 2; - }); - prevY += maxHeight + rankSep; - }); -} - - -},{"../lodash":62,"../util":81,"./bk":75}],77:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - Graph = require("../graphlib").Graph, - slack = require("./util").slack; - -module.exports = feasibleTree; - -/* - * Constructs a spanning tree with tight edges and adjusted the input node's - * ranks to achieve this. A tight edge is one that is has a length that matches - * its "minlen" attribute. - * - * The basic structure for this function is derived from Gansner, et al., "A - * Technique for Drawing Directed Graphs." - * - * Pre-conditions: - * - * 1. Graph must be a DAG. - * 2. Graph must be connected. - * 3. Graph must have at least one node. - * 5. Graph nodes must have been previously assigned a "rank" property that - * respects the "minlen" property of incident edges. - * 6. Graph edges must have a "minlen" property. - * - * Post-conditions: - * - * - Graph nodes will have their rank adjusted to ensure that all edges are - * tight. - * - * Returns a tree (undirected graph) that is constructed using only "tight" - * edges. - */ -function feasibleTree(g) { - var t = new Graph({ directed: false }); - - // Choose arbitrary node from which to start our tree - var start = g.nodes()[0], - size = g.nodeCount(); - t.setNode(start, {}); - - var edge, delta; - while (tightTree(t, g) < size) { - edge = findMinSlackEdge(t, g); - delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge); - shiftRanks(t, g, delta); - } - - return t; -} - -/* - * Finds a maximal tree of tight edges and returns the number of nodes in the - * tree. - */ -function tightTree(t, g) { - function dfs(v) { - _.each(g.nodeEdges(v), function(e) { - var edgeV = e.v, - w = (v === edgeV) ? e.w : edgeV; - if (!t.hasNode(w) && !slack(g, e)) { - t.setNode(w, {}); - t.setEdge(v, w, {}); - dfs(w); - } - }); - } - - _.each(t.nodes(), dfs); - return t.nodeCount(); -} - -/* - * Finds the edge with the smallest slack that is incident on tree and returns - * it. - */ -function findMinSlackEdge(t, g) { - return _.min(g.edges(), function(e) { - if (t.hasNode(e.v) !== t.hasNode(e.w)) { - return slack(g, e); - } - }); -} - -function shiftRanks(t, g, delta) { - _.each(t.nodes(), function(v) { - g.node(v).rank += delta; - }); -} - -},{"../graphlib":59,"../lodash":62,"./util":80}],78:[function(require,module,exports){ -"use strict"; - -var rankUtil = require("./util"), - longestPath = rankUtil.longestPath, - feasibleTree = require("./feasible-tree"), - networkSimplex = require("./network-simplex"); - -module.exports = rank; - -/* - * Assigns a rank to each node in the input graph that respects the "minlen" - * constraint specified on edges between nodes. - * - * This basic structure is derived from Gansner, et al., "A Technique for - * Drawing Directed Graphs." - * - * Pre-conditions: - * - * 1. Graph must be a connected DAG - * 2. Graph nodes must be objects - * 3. Graph edges must have "weight" and "minlen" attributes - * - * Post-conditions: - * - * 1. Graph nodes will have a "rank" attribute based on the results of the - * algorithm. Ranks can start at any index (including negative), we'll - * fix them up later. - */ -function rank(g) { - switch(g.graph().ranker) { - case "network-simplex": networkSimplexRanker(g); break; - case "tight-tree": tightTreeRanker(g); break; - case "longest-path": longestPathRanker(g); break; - default: networkSimplexRanker(g); - } -} - -// A fast and simple ranker, but results are far from optimal. -var longestPathRanker = longestPath; - -function tightTreeRanker(g) { - longestPath(g); - feasibleTree(g); -} - -function networkSimplexRanker(g) { - networkSimplex(g); -} - -},{"./feasible-tree":77,"./network-simplex":79,"./util":80}],79:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - feasibleTree = require("./feasible-tree"), - slack = require("./util").slack, - initRank = require("./util").longestPath, - preorder = require("../graphlib").alg.preorder, - postorder = require("../graphlib").alg.postorder, - simplify = require("../util").simplify; - -module.exports = networkSimplex; - -// Expose some internals for testing purposes -networkSimplex.initLowLimValues = initLowLimValues; -networkSimplex.initCutValues = initCutValues; -networkSimplex.calcCutValue = calcCutValue; -networkSimplex.leaveEdge = leaveEdge; -networkSimplex.enterEdge = enterEdge; -networkSimplex.exchangeEdges = exchangeEdges; - -/* - * The network simplex algorithm assigns ranks to each node in the input graph - * and iteratively improves the ranking to reduce the length of edges. - * - * Preconditions: - * - * 1. The input graph must be a DAG. - * 2. All nodes in the graph must have an object value. - * 3. All edges in the graph must have "minlen" and "weight" attributes. - * - * Postconditions: - * - * 1. All nodes in the graph will have an assigned "rank" attribute that has - * been optimized by the network simplex algorithm. Ranks start at 0. - * - * - * A rough sketch of the algorithm is as follows: - * - * 1. Assign initial ranks to each node. We use the longest path algorithm, - * which assigns ranks to the lowest position possible. In general this - * leads to very wide bottom ranks and unnecessarily long edges. - * 2. Construct a feasible tight tree. A tight tree is one such that all - * edges in the tree have no slack (difference between length of edge - * and minlen for the edge). This by itself greatly improves the assigned - * rankings by shorting edges. - * 3. Iteratively find edges that have negative cut values. Generally a - * negative cut value indicates that the edge could be removed and a new - * tree edge could be added to produce a more compact graph. - * - * Much of the algorithms here are derived from Gansner, et al., "A Technique - * for Drawing Directed Graphs." The structure of the file roughly follows the - * structure of the overall algorithm. - */ -function networkSimplex(g) { - g = simplify(g); - initRank(g); - var t = feasibleTree(g); - initLowLimValues(t); - initCutValues(t, g); - - var e, f; - while ((e = leaveEdge(t))) { - f = enterEdge(t, g, e); - exchangeEdges(t, g, e, f); - } -} - -/* - * Initializes cut values for all edges in the tree. - */ -function initCutValues(t, g) { - var vs = postorder(t, t.nodes()); - vs = vs.slice(0, vs.length - 1); - _.each(vs, function(v) { - assignCutValue(t, g, v); - }); -} - -function assignCutValue(t, g, child) { - var childLab = t.node(child), - parent = childLab.parent; - t.edge(child, parent).cutvalue = calcCutValue(t, g, child); -} - -/* - * Given the tight tree, its graph, and a child in the graph calculate and - * return the cut value for the edge between the child and its parent. - */ -function calcCutValue(t, g, child) { - var childLab = t.node(child), - parent = childLab.parent, - // True if the child is on the tail end of the edge in the directed graph - childIsTail = true, - // The graph's view of the tree edge we're inspecting - graphEdge = g.edge(child, parent), - // The accumulated cut value for the edge between this node and its parent - cutValue = 0; - - if (!graphEdge) { - childIsTail = false; - graphEdge = g.edge(parent, child); - } - - cutValue = graphEdge.weight; - - _.each(g.nodeEdges(child), function(e) { - var isOutEdge = e.v === child, - other = isOutEdge ? e.w : e.v; - - if (other !== parent) { - var pointsToHead = isOutEdge === childIsTail, - otherWeight = g.edge(e).weight; - - cutValue += pointsToHead ? otherWeight : -otherWeight; - if (isTreeEdge(t, child, other)) { - var otherCutValue = t.edge(child, other).cutvalue; - cutValue += pointsToHead ? -otherCutValue : otherCutValue; - } - } - }); - - return cutValue; -} - -function initLowLimValues(tree, root) { - if (arguments.length < 2) { - root = tree.nodes()[0]; - } - dfsAssignLowLim(tree, {}, 1, root); -} - -function dfsAssignLowLim(tree, visited, nextLim, v, parent) { - var low = nextLim, - label = tree.node(v); - - visited[v] = true; - _.each(tree.neighbors(v), function(w) { - if (!_.has(visited, w)) { - nextLim = dfsAssignLowLim(tree, visited, nextLim, w, v); - } - }); - - label.low = low; - label.lim = nextLim++; - if (parent) { - label.parent = parent; - } else { - // TODO should be able to remove this when we incrementally update low lim - delete label.parent; - } - - return nextLim; -} - -function leaveEdge(tree) { - return _.find(tree.edges(), function(e) { - return tree.edge(e).cutvalue < 0; - }); -} - -function enterEdge(t, g, edge) { - var v = edge.v, - w = edge.w; - - // For the rest of this function we assume that v is the tail and w is the - // head, so if we don't have this edge in the graph we should flip it to - // match the correct orientation. - if (!g.hasEdge(v, w)) { - v = edge.w; - w = edge.v; - } - - var vLabel = t.node(v), - wLabel = t.node(w), - tailLabel = vLabel, - flip = false; - - // If the root is in the tail of the edge then we need to flip the logic that - // checks for the head and tail nodes in the candidates function below. - if (vLabel.lim > wLabel.lim) { - tailLabel = wLabel; - flip = true; - } - - var candidates = _.filter(g.edges(), function(edge) { - return flip === isDescendant(t, t.node(edge.v), tailLabel) && - flip !== isDescendant(t, t.node(edge.w), tailLabel); - }); - - return _.min(candidates, function(edge) { return slack(g, edge); }); -} - -function exchangeEdges(t, g, e, f) { - var v = e.v, - w = e.w; - t.removeEdge(v, w); - t.setEdge(f.v, f.w, {}); - initLowLimValues(t); - initCutValues(t, g); - updateRanks(t, g); -} - -function updateRanks(t, g) { - var root = _.find(t.nodes(), function(v) { return !g.node(v).parent; }), - vs = preorder(t, root); - vs = vs.slice(1); - _.each(vs, function(v) { - var parent = t.node(v).parent, - edge = g.edge(v, parent), - flipped = false; - - if (!edge) { - edge = g.edge(parent, v); - flipped = true; - } - - g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen); - }); -} - -/* - * Returns true if the edge is in the tree. - */ -function isTreeEdge(tree, u, v) { - return tree.hasEdge(u, v); -} - -/* - * Returns true if the specified node is descendant of the root node per the - * assigned low and lim attributes in the tree. - */ -function isDescendant(tree, vLabel, rootLabel) { - return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim; -} - -},{"../graphlib":59,"../lodash":62,"../util":81,"./feasible-tree":77,"./util":80}],80:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"); - -module.exports = { - longestPath: longestPath, - slack: slack -}; - -/* - * Initializes ranks for the input graph using the longest path algorithm. This - * algorithm scales well and is fast in practice, it yields rather poor - * solutions. Nodes are pushed to the lowest layer possible, leaving the bottom - * ranks wide and leaving edges longer than necessary. However, due to its - * speed, this algorithm is good for getting an initial ranking that can be fed - * into other algorithms. - * - * This algorithm does not normalize layers because it will be used by other - * algorithms in most cases. If using this algorithm directly, be sure to - * run normalize at the end. - * - * Pre-conditions: - * - * 1. Input graph is a DAG. - * 2. Input graph node labels can be assigned properties. - * - * Post-conditions: - * - * 1. Each node will be assign an (unnormalized) "rank" property. - */ -function longestPath(g) { - var visited = {}; - - function dfs(v) { - var label = g.node(v); - if (_.has(visited, v)) { - return label.rank; - } - visited[v] = true; - - var rank = _.min(_.map(g.outEdges(v), function(e) { - return dfs(e.w) - g.edge(e).minlen; - })); - - if (rank === Number.POSITIVE_INFINITY) { - rank = 0; - } - - return (label.rank = rank); - } - - _.each(g.sources(), dfs); -} - -/* - * Returns the amount of slack for the given edge. The slack is defined as the - * difference between the length of the edge and its minimum length. - */ -function slack(g, e) { - return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen; -} - -},{"../lodash":62}],81:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"), - Graph = require("./graphlib").Graph; - -module.exports = { - addDummyNode: addDummyNode, - simplify: simplify, - asNonCompoundGraph: asNonCompoundGraph, - successorWeights: successorWeights, - predecessorWeights: predecessorWeights, - intersectRect: intersectRect, - buildLayerMatrix: buildLayerMatrix, - normalizeRanks: normalizeRanks, - removeEmptyRanks: removeEmptyRanks, - addBorderNode: addBorderNode, - maxRank: maxRank, - partition: partition, - time: time, - notime: notime -}; - -/* - * Adds a dummy node to the graph and return v. - */ -function addDummyNode(g, type, attrs, name) { - var v; - do { - v = _.uniqueId(name); - } while (g.hasNode(v)); - - attrs.dummy = type; - g.setNode(v, attrs); - return v; -} - -/* - * Returns a new graph with only simple edges. Handles aggregation of data - * associated with multi-edges. - */ -function simplify(g) { - var simplified = new Graph().setGraph(g.graph()); - _.each(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); }); - _.each(g.edges(), function(e) { - var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 }, - label = g.edge(e); - simplified.setEdge(e.v, e.w, { - weight: simpleLabel.weight + label.weight, - minlen: Math.max(simpleLabel.minlen, label.minlen) - }); - }); - return simplified; -} - -function asNonCompoundGraph(g) { - var simplified = new Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph()); - _.each(g.nodes(), function(v) { - if (!g.children(v).length) { - simplified.setNode(v, g.node(v)); - } - }); - _.each(g.edges(), function(e) { - simplified.setEdge(e, g.edge(e)); - }); - return simplified; -} - -function successorWeights(g) { - var weightMap = _.map(g.nodes(), function(v) { - var sucs = {}; - _.each(g.outEdges(v), function(e) { - sucs[e.w] = (sucs[e.w] || 0) + g.edge(e).weight; - }); - return sucs; - }); - return _.zipObject(g.nodes(), weightMap); -} - -function predecessorWeights(g) { - var weightMap = _.map(g.nodes(), function(v) { - var preds = {}; - _.each(g.inEdges(v), function(e) { - preds[e.v] = (preds[e.v] || 0) + g.edge(e).weight; - }); - return preds; - }); - return _.zipObject(g.nodes(), weightMap); -} - -/* - * Finds where a line starting at point ({x, y}) would intersect a rectangle - * ({x, y, width, height}) if it were pointing at the rectangle's center. - */ -function intersectRect(rect, point) { - var x = rect.x; - var y = rect.y; - - // Rectangle intersection algorithm from: - // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes - var dx = point.x - x; - var dy = point.y - y; - var w = rect.width / 2; - var h = rect.height / 2; - - if (!dx && !dy) { - throw new Error("Not possible to find intersection inside of the rectangle"); - } - - var sx, sy; - if (Math.abs(dy) * w > Math.abs(dx) * h) { - // Intersection is top or bottom of rect. - if (dy < 0) { - h = -h; - } - sx = h * dx / dy; - sy = h; - } else { - // Intersection is left or right of rect. - if (dx < 0) { - w = -w; - } - sx = w; - sy = w * dy / dx; - } - - return { x: x + sx, y: y + sy }; -} - -/* - * Given a DAG with each node assigned "rank" and "order" properties, this - * function will produce a matrix with the ids of each node. - */ -function buildLayerMatrix(g) { - var layering = _.map(_.range(maxRank(g) + 1), function() { return []; }); - _.each(g.nodes(), function(v) { - var node = g.node(v), - rank = node.rank; - if (!_.isUndefined(rank)) { - layering[rank][node.order] = v; - } - }); - return layering; -} - -/* - * Adjusts the ranks for all nodes in the graph such that all nodes v have - * rank(v) >= 0 and at least one node w has rank(w) = 0. - */ -function normalizeRanks(g) { - var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); - _.each(g.nodes(), function(v) { - var node = g.node(v); - if (_.has(node, "rank")) { - node.rank -= min; - } - }); -} - -function removeEmptyRanks(g) { - // Ranks may not start at 0, so we need to offset them - var offset = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); - - var layers = []; - _.each(g.nodes(), function(v) { - var rank = g.node(v).rank - offset; - if (!layers[rank]) { - layers[rank] = []; - } - layers[rank].push(v); - }); - - var delta = 0, - nodeRankFactor = g.graph().nodeRankFactor; - _.each(layers, function(vs, i) { - if (_.isUndefined(vs) && i % nodeRankFactor !== 0) { - --delta; - } else if (delta) { - _.each(vs, function(v) { g.node(v).rank += delta; }); - } - }); -} - -function addBorderNode(g, prefix, rank, order) { - var node = { - width: 0, - height: 0 - }; - if (arguments.length >= 4) { - node.rank = rank; - node.order = order; - } - return addDummyNode(g, "border", node, prefix); -} - -function maxRank(g) { - return _.max(_.map(g.nodes(), function(v) { - var rank = g.node(v).rank; - if (!_.isUndefined(rank)) { - return rank; - } - })); -} - -/* - * Partition a collection into two groups: `lhs` and `rhs`. If the supplied - * function returns true for an entry it goes into `lhs`. Otherwise it goes - * into `rhs. - */ -function partition(collection, fn) { - var result = { lhs: [], rhs: [] }; - _.each(collection, function(value) { - if (fn(value)) { - result.lhs.push(value); - } else { - result.rhs.push(value); - } - }); - return result; -} - -/* - * Returns a new function that wraps `fn` with a timer. The wrapper logs the - * time it takes to execute the function. - */ -function time(name, fn) { - var start = _.now(); - try { - return fn(); - } finally { - console.log(name + " time: " + (_.now() - start) + "ms"); - } -} - -function notime(name, fn) { - return fn(); -} - -},{"./graphlib":59,"./lodash":62}],82:[function(require,module,exports){ -module.exports = "0.7.4"; - -},{}],83:[function(require,module,exports){ -module.exports=require(32) -},{"./lib":99,"./lib/alg":90,"./lib/json":100,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\index.js":32}],84:[function(require,module,exports){ -module.exports=require(33) -},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\components.js":33}],85:[function(require,module,exports){ -module.exports=require(34) -},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dfs.js":34}],86:[function(require,module,exports){ -module.exports=require(35) -},{"../lodash":101,"./dijkstra":87,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dijkstra-all.js":35}],87:[function(require,module,exports){ -module.exports=require(36) -},{"../data/priority-queue":97,"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dijkstra.js":36}],88:[function(require,module,exports){ -module.exports=require(37) -},{"../lodash":101,"./tarjan":95,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\find-cycles.js":37}],89:[function(require,module,exports){ -module.exports=require(38) -},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\floyd-warshall.js":38}],90:[function(require,module,exports){ -module.exports=require(39) -},{"./components":84,"./dijkstra":87,"./dijkstra-all":86,"./find-cycles":88,"./floyd-warshall":89,"./is-acyclic":91,"./postorder":92,"./preorder":93,"./prim":94,"./tarjan":95,"./topsort":96,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\index.js":39}],91:[function(require,module,exports){ -module.exports=require(40) -},{"./topsort":96,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\is-acyclic.js":40}],92:[function(require,module,exports){ -module.exports=require(41) -},{"./dfs":85,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\postorder.js":41}],93:[function(require,module,exports){ -module.exports=require(42) -},{"./dfs":85,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\preorder.js":42}],94:[function(require,module,exports){ -module.exports=require(43) -},{"../data/priority-queue":97,"../graph":98,"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\prim.js":43}],95:[function(require,module,exports){ -module.exports=require(44) -},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\tarjan.js":44}],96:[function(require,module,exports){ -module.exports=require(45) -},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\topsort.js":45}],97:[function(require,module,exports){ -module.exports=require(46) -},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\data\\priority-queue.js":46}],98:[function(require,module,exports){ -module.exports=require(47) -},{"./lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\graph.js":47}],99:[function(require,module,exports){ -module.exports=require(48) -},{"./graph":98,"./version":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\index.js":48}],100:[function(require,module,exports){ -module.exports=require(49) -},{"./graph":98,"./lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\json.js":49}],101:[function(require,module,exports){ -module.exports=require(50) -},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\lodash.js":50,"lodash":103}],102:[function(require,module,exports){ -module.exports=require(51) -},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\version.js":51}],103:[function(require,module,exports){ -module.exports=require(52) -},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\lodash\\index.js":52}],104:[function(require,module,exports){ -(function (global){ -/*! http://mths.be/he v0.5.0 by @mathias | MIT license */ -;(function(root) { - - // Detect free variables `exports`. - var freeExports = typeof exports == 'object' && exports; - - // Detect free variable `module`. - var freeModule = typeof module == 'object' && module && - module.exports == freeExports && module; - - // Detect free variable `global`, from Node.js or Browserified code, - // and use it as `root`. - var freeGlobal = typeof global == 'object' && global; - if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { - root = freeGlobal; - } - - /*--------------------------------------------------------------------------*/ - - // All astral symbols. - var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; - // All ASCII symbols (not just printable ASCII) except those listed in the - // first column of the overrides table. - // http://whatwg.org/html/tokenization.html#table-charref-overrides - var regexAsciiWhitelist = /[\x01-\x7F]/g; - // All BMP symbols that are not ASCII newlines, printable ASCII symbols, or - // code points listed in the first column of the overrides table on - // http://whatwg.org/html/tokenization.html#table-charref-overrides. - var regexBmpWhitelist = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g; - - var regexEncodeNonAscii = /<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g; - var encodeMap = {'\xC1':'Aacute','\xE1':'aacute','\u0102':'Abreve','\u0103':'abreve','\u223E':'ac','\u223F':'acd','\u223E\u0333':'acE','\xC2':'Acirc','\xE2':'acirc','\xB4':'acute','\u0410':'Acy','\u0430':'acy','\xC6':'AElig','\xE6':'aelig','\u2061':'af','\uD835\uDD04':'Afr','\uD835\uDD1E':'afr','\xC0':'Agrave','\xE0':'agrave','\u2135':'aleph','\u0391':'Alpha','\u03B1':'alpha','\u0100':'Amacr','\u0101':'amacr','\u2A3F':'amalg','&':'amp','\u2A55':'andand','\u2A53':'And','\u2227':'and','\u2A5C':'andd','\u2A58':'andslope','\u2A5A':'andv','\u2220':'ang','\u29A4':'ange','\u29A8':'angmsdaa','\u29A9':'angmsdab','\u29AA':'angmsdac','\u29AB':'angmsdad','\u29AC':'angmsdae','\u29AD':'angmsdaf','\u29AE':'angmsdag','\u29AF':'angmsdah','\u2221':'angmsd','\u221F':'angrt','\u22BE':'angrtvb','\u299D':'angrtvbd','\u2222':'angsph','\xC5':'angst','\u237C':'angzarr','\u0104':'Aogon','\u0105':'aogon','\uD835\uDD38':'Aopf','\uD835\uDD52':'aopf','\u2A6F':'apacir','\u2248':'ap','\u2A70':'apE','\u224A':'ape','\u224B':'apid','\'':'apos','\xE5':'aring','\uD835\uDC9C':'Ascr','\uD835\uDCB6':'ascr','\u2254':'colone','*':'ast','\u224D':'CupCap','\xC3':'Atilde','\xE3':'atilde','\xC4':'Auml','\xE4':'auml','\u2233':'awconint','\u2A11':'awint','\u224C':'bcong','\u03F6':'bepsi','\u2035':'bprime','\u223D':'bsim','\u22CD':'bsime','\u2216':'setmn','\u2AE7':'Barv','\u22BD':'barvee','\u2305':'barwed','\u2306':'Barwed','\u23B5':'bbrk','\u23B6':'bbrktbrk','\u0411':'Bcy','\u0431':'bcy','\u201E':'bdquo','\u2235':'becaus','\u29B0':'bemptyv','\u212C':'Bscr','\u0392':'Beta','\u03B2':'beta','\u2136':'beth','\u226C':'twixt','\uD835\uDD05':'Bfr','\uD835\uDD1F':'bfr','\u22C2':'xcap','\u25EF':'xcirc','\u22C3':'xcup','\u2A00':'xodot','\u2A01':'xoplus','\u2A02':'xotime','\u2A06':'xsqcup','\u2605':'starf','\u25BD':'xdtri','\u25B3':'xutri','\u2A04':'xuplus','\u22C1':'Vee','\u22C0':'Wedge','\u290D':'rbarr','\u29EB':'lozf','\u25AA':'squf','\u25B4':'utrif','\u25BE':'dtrif','\u25C2':'ltrif','\u25B8':'rtrif','\u2423':'blank','\u2592':'blk12','\u2591':'blk14','\u2593':'blk34','\u2588':'block','=\u20E5':'bne','\u2261\u20E5':'bnequiv','\u2AED':'bNot','\u2310':'bnot','\uD835\uDD39':'Bopf','\uD835\uDD53':'bopf','\u22A5':'bot','\u22C8':'bowtie','\u29C9':'boxbox','\u2510':'boxdl','\u2555':'boxdL','\u2556':'boxDl','\u2557':'boxDL','\u250C':'boxdr','\u2552':'boxdR','\u2553':'boxDr','\u2554':'boxDR','\u2500':'boxh','\u2550':'boxH','\u252C':'boxhd','\u2564':'boxHd','\u2565':'boxhD','\u2566':'boxHD','\u2534':'boxhu','\u2567':'boxHu','\u2568':'boxhU','\u2569':'boxHU','\u229F':'minusb','\u229E':'plusb','\u22A0':'timesb','\u2518':'boxul','\u255B':'boxuL','\u255C':'boxUl','\u255D':'boxUL','\u2514':'boxur','\u2558':'boxuR','\u2559':'boxUr','\u255A':'boxUR','\u2502':'boxv','\u2551':'boxV','\u253C':'boxvh','\u256A':'boxvH','\u256B':'boxVh','\u256C':'boxVH','\u2524':'boxvl','\u2561':'boxvL','\u2562':'boxVl','\u2563':'boxVL','\u251C':'boxvr','\u255E':'boxvR','\u255F':'boxVr','\u2560':'boxVR','\u02D8':'breve','\xA6':'brvbar','\uD835\uDCB7':'bscr','\u204F':'bsemi','\u29C5':'bsolb','\\':'bsol','\u27C8':'bsolhsub','\u2022':'bull','\u224E':'bump','\u2AAE':'bumpE','\u224F':'bumpe','\u0106':'Cacute','\u0107':'cacute','\u2A44':'capand','\u2A49':'capbrcup','\u2A4B':'capcap','\u2229':'cap','\u22D2':'Cap','\u2A47':'capcup','\u2A40':'capdot','\u2145':'DD','\u2229\uFE00':'caps','\u2041':'caret','\u02C7':'caron','\u212D':'Cfr','\u2A4D':'ccaps','\u010C':'Ccaron','\u010D':'ccaron','\xC7':'Ccedil','\xE7':'ccedil','\u0108':'Ccirc','\u0109':'ccirc','\u2230':'Cconint','\u2A4C':'ccups','\u2A50':'ccupssm','\u010A':'Cdot','\u010B':'cdot','\xB8':'cedil','\u29B2':'cemptyv','\xA2':'cent','\xB7':'middot','\uD835\uDD20':'cfr','\u0427':'CHcy','\u0447':'chcy','\u2713':'check','\u03A7':'Chi','\u03C7':'chi','\u02C6':'circ','\u2257':'cire','\u21BA':'olarr','\u21BB':'orarr','\u229B':'oast','\u229A':'ocir','\u229D':'odash','\u2299':'odot','\xAE':'reg','\u24C8':'oS','\u2296':'ominus','\u2295':'oplus','\u2297':'otimes','\u25CB':'cir','\u29C3':'cirE','\u2A10':'cirfnint','\u2AEF':'cirmid','\u29C2':'cirscir','\u2232':'cwconint','\u201D':'rdquo','\u2019':'rsquo','\u2663':'clubs',':':'colon','\u2237':'Colon','\u2A74':'Colone',',':'comma','@':'commat','\u2201':'comp','\u2218':'compfn','\u2102':'Copf','\u2245':'cong','\u2A6D':'congdot','\u2261':'equiv','\u222E':'oint','\u222F':'Conint','\uD835\uDD54':'copf','\u2210':'coprod','\xA9':'copy','\u2117':'copysr','\u21B5':'crarr','\u2717':'cross','\u2A2F':'Cross','\uD835\uDC9E':'Cscr','\uD835\uDCB8':'cscr','\u2ACF':'csub','\u2AD1':'csube','\u2AD0':'csup','\u2AD2':'csupe','\u22EF':'ctdot','\u2938':'cudarrl','\u2935':'cudarrr','\u22DE':'cuepr','\u22DF':'cuesc','\u21B6':'cularr','\u293D':'cularrp','\u2A48':'cupbrcap','\u2A46':'cupcap','\u222A':'cup','\u22D3':'Cup','\u2A4A':'cupcup','\u228D':'cupdot','\u2A45':'cupor','\u222A\uFE00':'cups','\u21B7':'curarr','\u293C':'curarrm','\u22CE':'cuvee','\u22CF':'cuwed','\xA4':'curren','\u2231':'cwint','\u232D':'cylcty','\u2020':'dagger','\u2021':'Dagger','\u2138':'daleth','\u2193':'darr','\u21A1':'Darr','\u21D3':'dArr','\u2010':'dash','\u2AE4':'Dashv','\u22A3':'dashv','\u290F':'rBarr','\u02DD':'dblac','\u010E':'Dcaron','\u010F':'dcaron','\u0414':'Dcy','\u0434':'dcy','\u21CA':'ddarr','\u2146':'dd','\u2911':'DDotrahd','\u2A77':'eDDot','\xB0':'deg','\u2207':'Del','\u0394':'Delta','\u03B4':'delta','\u29B1':'demptyv','\u297F':'dfisht','\uD835\uDD07':'Dfr','\uD835\uDD21':'dfr','\u2965':'dHar','\u21C3':'dharl','\u21C2':'dharr','\u02D9':'dot','`':'grave','\u02DC':'tilde','\u22C4':'diam','\u2666':'diams','\xA8':'die','\u03DD':'gammad','\u22F2':'disin','\xF7':'div','\u22C7':'divonx','\u0402':'DJcy','\u0452':'djcy','\u231E':'dlcorn','\u230D':'dlcrop','$':'dollar','\uD835\uDD3B':'Dopf','\uD835\uDD55':'dopf','\u20DC':'DotDot','\u2250':'doteq','\u2251':'eDot','\u2238':'minusd','\u2214':'plusdo','\u22A1':'sdotb','\u21D0':'lArr','\u21D4':'iff','\u27F8':'xlArr','\u27FA':'xhArr','\u27F9':'xrArr','\u21D2':'rArr','\u22A8':'vDash','\u21D1':'uArr','\u21D5':'vArr','\u2225':'par','\u2913':'DownArrowBar','\u21F5':'duarr','\u0311':'DownBreve','\u2950':'DownLeftRightVector','\u295E':'DownLeftTeeVector','\u2956':'DownLeftVectorBar','\u21BD':'lhard','\u295F':'DownRightTeeVector','\u2957':'DownRightVectorBar','\u21C1':'rhard','\u21A7':'mapstodown','\u22A4':'top','\u2910':'RBarr','\u231F':'drcorn','\u230C':'drcrop','\uD835\uDC9F':'Dscr','\uD835\uDCB9':'dscr','\u0405':'DScy','\u0455':'dscy','\u29F6':'dsol','\u0110':'Dstrok','\u0111':'dstrok','\u22F1':'dtdot','\u25BF':'dtri','\u296F':'duhar','\u29A6':'dwangle','\u040F':'DZcy','\u045F':'dzcy','\u27FF':'dzigrarr','\xC9':'Eacute','\xE9':'eacute','\u2A6E':'easter','\u011A':'Ecaron','\u011B':'ecaron','\xCA':'Ecirc','\xEA':'ecirc','\u2256':'ecir','\u2255':'ecolon','\u042D':'Ecy','\u044D':'ecy','\u0116':'Edot','\u0117':'edot','\u2147':'ee','\u2252':'efDot','\uD835\uDD08':'Efr','\uD835\uDD22':'efr','\u2A9A':'eg','\xC8':'Egrave','\xE8':'egrave','\u2A96':'egs','\u2A98':'egsdot','\u2A99':'el','\u2208':'in','\u23E7':'elinters','\u2113':'ell','\u2A95':'els','\u2A97':'elsdot','\u0112':'Emacr','\u0113':'emacr','\u2205':'empty','\u25FB':'EmptySmallSquare','\u25AB':'EmptyVerySmallSquare','\u2004':'emsp13','\u2005':'emsp14','\u2003':'emsp','\u014A':'ENG','\u014B':'eng','\u2002':'ensp','\u0118':'Eogon','\u0119':'eogon','\uD835\uDD3C':'Eopf','\uD835\uDD56':'eopf','\u22D5':'epar','\u29E3':'eparsl','\u2A71':'eplus','\u03B5':'epsi','\u0395':'Epsilon','\u03F5':'epsiv','\u2242':'esim','\u2A75':'Equal','=':'equals','\u225F':'equest','\u21CC':'rlhar','\u2A78':'equivDD','\u29E5':'eqvparsl','\u2971':'erarr','\u2253':'erDot','\u212F':'escr','\u2130':'Escr','\u2A73':'Esim','\u0397':'Eta','\u03B7':'eta','\xD0':'ETH','\xF0':'eth','\xCB':'Euml','\xEB':'euml','\u20AC':'euro','!':'excl','\u2203':'exist','\u0424':'Fcy','\u0444':'fcy','\u2640':'female','\uFB03':'ffilig','\uFB00':'fflig','\uFB04':'ffllig','\uD835\uDD09':'Ffr','\uD835\uDD23':'ffr','\uFB01':'filig','\u25FC':'FilledSmallSquare','fj':'fjlig','\u266D':'flat','\uFB02':'fllig','\u25B1':'fltns','\u0192':'fnof','\uD835\uDD3D':'Fopf','\uD835\uDD57':'fopf','\u2200':'forall','\u22D4':'fork','\u2AD9':'forkv','\u2131':'Fscr','\u2A0D':'fpartint','\xBD':'half','\u2153':'frac13','\xBC':'frac14','\u2155':'frac15','\u2159':'frac16','\u215B':'frac18','\u2154':'frac23','\u2156':'frac25','\xBE':'frac34','\u2157':'frac35','\u215C':'frac38','\u2158':'frac45','\u215A':'frac56','\u215D':'frac58','\u215E':'frac78','\u2044':'frasl','\u2322':'frown','\uD835\uDCBB':'fscr','\u01F5':'gacute','\u0393':'Gamma','\u03B3':'gamma','\u03DC':'Gammad','\u2A86':'gap','\u011E':'Gbreve','\u011F':'gbreve','\u0122':'Gcedil','\u011C':'Gcirc','\u011D':'gcirc','\u0413':'Gcy','\u0433':'gcy','\u0120':'Gdot','\u0121':'gdot','\u2265':'ge','\u2267':'gE','\u2A8C':'gEl','\u22DB':'gel','\u2A7E':'ges','\u2AA9':'gescc','\u2A80':'gesdot','\u2A82':'gesdoto','\u2A84':'gesdotol','\u22DB\uFE00':'gesl','\u2A94':'gesles','\uD835\uDD0A':'Gfr','\uD835\uDD24':'gfr','\u226B':'gg','\u22D9':'Gg','\u2137':'gimel','\u0403':'GJcy','\u0453':'gjcy','\u2AA5':'gla','\u2277':'gl','\u2A92':'glE','\u2AA4':'glj','\u2A8A':'gnap','\u2A88':'gne','\u2269':'gnE','\u22E7':'gnsim','\uD835\uDD3E':'Gopf','\uD835\uDD58':'gopf','\u2AA2':'GreaterGreater','\u2273':'gsim','\uD835\uDCA2':'Gscr','\u210A':'gscr','\u2A8E':'gsime','\u2A90':'gsiml','\u2AA7':'gtcc','\u2A7A':'gtcir','>':'gt','\u22D7':'gtdot','\u2995':'gtlPar','\u2A7C':'gtquest','\u2978':'gtrarr','\u2269\uFE00':'gvnE','\u200A':'hairsp','\u210B':'Hscr','\u042A':'HARDcy','\u044A':'hardcy','\u2948':'harrcir','\u2194':'harr','\u21AD':'harrw','^':'Hat','\u210F':'hbar','\u0124':'Hcirc','\u0125':'hcirc','\u2665':'hearts','\u2026':'mldr','\u22B9':'hercon','\uD835\uDD25':'hfr','\u210C':'Hfr','\u2925':'searhk','\u2926':'swarhk','\u21FF':'hoarr','\u223B':'homtht','\u21A9':'larrhk','\u21AA':'rarrhk','\uD835\uDD59':'hopf','\u210D':'Hopf','\u2015':'horbar','\uD835\uDCBD':'hscr','\u0126':'Hstrok','\u0127':'hstrok','\u2043':'hybull','\xCD':'Iacute','\xED':'iacute','\u2063':'ic','\xCE':'Icirc','\xEE':'icirc','\u0418':'Icy','\u0438':'icy','\u0130':'Idot','\u0415':'IEcy','\u0435':'iecy','\xA1':'iexcl','\uD835\uDD26':'ifr','\u2111':'Im','\xCC':'Igrave','\xEC':'igrave','\u2148':'ii','\u2A0C':'qint','\u222D':'tint','\u29DC':'iinfin','\u2129':'iiota','\u0132':'IJlig','\u0133':'ijlig','\u012A':'Imacr','\u012B':'imacr','\u2110':'Iscr','\u0131':'imath','\u22B7':'imof','\u01B5':'imped','\u2105':'incare','\u221E':'infin','\u29DD':'infintie','\u22BA':'intcal','\u222B':'int','\u222C':'Int','\u2124':'Zopf','\u2A17':'intlarhk','\u2A3C':'iprod','\u2062':'it','\u0401':'IOcy','\u0451':'iocy','\u012E':'Iogon','\u012F':'iogon','\uD835\uDD40':'Iopf','\uD835\uDD5A':'iopf','\u0399':'Iota','\u03B9':'iota','\xBF':'iquest','\uD835\uDCBE':'iscr','\u22F5':'isindot','\u22F9':'isinE','\u22F4':'isins','\u22F3':'isinsv','\u0128':'Itilde','\u0129':'itilde','\u0406':'Iukcy','\u0456':'iukcy','\xCF':'Iuml','\xEF':'iuml','\u0134':'Jcirc','\u0135':'jcirc','\u0419':'Jcy','\u0439':'jcy','\uD835\uDD0D':'Jfr','\uD835\uDD27':'jfr','\u0237':'jmath','\uD835\uDD41':'Jopf','\uD835\uDD5B':'jopf','\uD835\uDCA5':'Jscr','\uD835\uDCBF':'jscr','\u0408':'Jsercy','\u0458':'jsercy','\u0404':'Jukcy','\u0454':'jukcy','\u039A':'Kappa','\u03BA':'kappa','\u03F0':'kappav','\u0136':'Kcedil','\u0137':'kcedil','\u041A':'Kcy','\u043A':'kcy','\uD835\uDD0E':'Kfr','\uD835\uDD28':'kfr','\u0138':'kgreen','\u0425':'KHcy','\u0445':'khcy','\u040C':'KJcy','\u045C':'kjcy','\uD835\uDD42':'Kopf','\uD835\uDD5C':'kopf','\uD835\uDCA6':'Kscr','\uD835\uDCC0':'kscr','\u21DA':'lAarr','\u0139':'Lacute','\u013A':'lacute','\u29B4':'laemptyv','\u2112':'Lscr','\u039B':'Lambda','\u03BB':'lambda','\u27E8':'lang','\u27EA':'Lang','\u2991':'langd','\u2A85':'lap','\xAB':'laquo','\u21E4':'larrb','\u291F':'larrbfs','\u2190':'larr','\u219E':'Larr','\u291D':'larrfs','\u21AB':'larrlp','\u2939':'larrpl','\u2973':'larrsim','\u21A2':'larrtl','\u2919':'latail','\u291B':'lAtail','\u2AAB':'lat','\u2AAD':'late','\u2AAD\uFE00':'lates','\u290C':'lbarr','\u290E':'lBarr','\u2772':'lbbrk','{':'lcub','[':'lsqb','\u298B':'lbrke','\u298F':'lbrksld','\u298D':'lbrkslu','\u013D':'Lcaron','\u013E':'lcaron','\u013B':'Lcedil','\u013C':'lcedil','\u2308':'lceil','\u041B':'Lcy','\u043B':'lcy','\u2936':'ldca','\u201C':'ldquo','\u2967':'ldrdhar','\u294B':'ldrushar','\u21B2':'ldsh','\u2264':'le','\u2266':'lE','\u21C6':'lrarr','\u27E6':'lobrk','\u2961':'LeftDownTeeVector','\u2959':'LeftDownVectorBar','\u230A':'lfloor','\u21BC':'lharu','\u21C7':'llarr','\u21CB':'lrhar','\u294E':'LeftRightVector','\u21A4':'mapstoleft','\u295A':'LeftTeeVector','\u22CB':'lthree','\u29CF':'LeftTriangleBar','\u22B2':'vltri','\u22B4':'ltrie','\u2951':'LeftUpDownVector','\u2960':'LeftUpTeeVector','\u2958':'LeftUpVectorBar','\u21BF':'uharl','\u2952':'LeftVectorBar','\u2A8B':'lEg','\u22DA':'leg','\u2A7D':'les','\u2AA8':'lescc','\u2A7F':'lesdot','\u2A81':'lesdoto','\u2A83':'lesdotor','\u22DA\uFE00':'lesg','\u2A93':'lesges','\u22D6':'ltdot','\u2276':'lg','\u2AA1':'LessLess','\u2272':'lsim','\u297C':'lfisht','\uD835\uDD0F':'Lfr','\uD835\uDD29':'lfr','\u2A91':'lgE','\u2962':'lHar','\u296A':'lharul','\u2584':'lhblk','\u0409':'LJcy','\u0459':'ljcy','\u226A':'ll','\u22D8':'Ll','\u296B':'llhard','\u25FA':'lltri','\u013F':'Lmidot','\u0140':'lmidot','\u23B0':'lmoust','\u2A89':'lnap','\u2A87':'lne','\u2268':'lnE','\u22E6':'lnsim','\u27EC':'loang','\u21FD':'loarr','\u27F5':'xlarr','\u27F7':'xharr','\u27FC':'xmap','\u27F6':'xrarr','\u21AC':'rarrlp','\u2985':'lopar','\uD835\uDD43':'Lopf','\uD835\uDD5D':'lopf','\u2A2D':'loplus','\u2A34':'lotimes','\u2217':'lowast','_':'lowbar','\u2199':'swarr','\u2198':'searr','\u25CA':'loz','(':'lpar','\u2993':'lparlt','\u296D':'lrhard','\u200E':'lrm','\u22BF':'lrtri','\u2039':'lsaquo','\uD835\uDCC1':'lscr','\u21B0':'lsh','\u2A8D':'lsime','\u2A8F':'lsimg','\u2018':'lsquo','\u201A':'sbquo','\u0141':'Lstrok','\u0142':'lstrok','\u2AA6':'ltcc','\u2A79':'ltcir','<':'lt','\u22C9':'ltimes','\u2976':'ltlarr','\u2A7B':'ltquest','\u25C3':'ltri','\u2996':'ltrPar','\u294A':'lurdshar','\u2966':'luruhar','\u2268\uFE00':'lvnE','\xAF':'macr','\u2642':'male','\u2720':'malt','\u2905':'Map','\u21A6':'map','\u21A5':'mapstoup','\u25AE':'marker','\u2A29':'mcomma','\u041C':'Mcy','\u043C':'mcy','\u2014':'mdash','\u223A':'mDDot','\u205F':'MediumSpace','\u2133':'Mscr','\uD835\uDD10':'Mfr','\uD835\uDD2A':'mfr','\u2127':'mho','\xB5':'micro','\u2AF0':'midcir','\u2223':'mid','\u2212':'minus','\u2A2A':'minusdu','\u2213':'mp','\u2ADB':'mlcp','\u22A7':'models','\uD835\uDD44':'Mopf','\uD835\uDD5E':'mopf','\uD835\uDCC2':'mscr','\u039C':'Mu','\u03BC':'mu','\u22B8':'mumap','\u0143':'Nacute','\u0144':'nacute','\u2220\u20D2':'nang','\u2249':'nap','\u2A70\u0338':'napE','\u224B\u0338':'napid','\u0149':'napos','\u266E':'natur','\u2115':'Nopf','\xA0':'nbsp','\u224E\u0338':'nbump','\u224F\u0338':'nbumpe','\u2A43':'ncap','\u0147':'Ncaron','\u0148':'ncaron','\u0145':'Ncedil','\u0146':'ncedil','\u2247':'ncong','\u2A6D\u0338':'ncongdot','\u2A42':'ncup','\u041D':'Ncy','\u043D':'ncy','\u2013':'ndash','\u2924':'nearhk','\u2197':'nearr','\u21D7':'neArr','\u2260':'ne','\u2250\u0338':'nedot','\u200B':'ZeroWidthSpace','\u2262':'nequiv','\u2928':'toea','\u2242\u0338':'nesim','\n':'NewLine','\u2204':'nexist','\uD835\uDD11':'Nfr','\uD835\uDD2B':'nfr','\u2267\u0338':'ngE','\u2271':'nge','\u2A7E\u0338':'nges','\u22D9\u0338':'nGg','\u2275':'ngsim','\u226B\u20D2':'nGt','\u226F':'ngt','\u226B\u0338':'nGtv','\u21AE':'nharr','\u21CE':'nhArr','\u2AF2':'nhpar','\u220B':'ni','\u22FC':'nis','\u22FA':'nisd','\u040A':'NJcy','\u045A':'njcy','\u219A':'nlarr','\u21CD':'nlArr','\u2025':'nldr','\u2266\u0338':'nlE','\u2270':'nle','\u2A7D\u0338':'nles','\u226E':'nlt','\u22D8\u0338':'nLl','\u2274':'nlsim','\u226A\u20D2':'nLt','\u22EA':'nltri','\u22EC':'nltrie','\u226A\u0338':'nLtv','\u2224':'nmid','\u2060':'NoBreak','\uD835\uDD5F':'nopf','\u2AEC':'Not','\xAC':'not','\u226D':'NotCupCap','\u2226':'npar','\u2209':'notin','\u2279':'ntgl','\u22F5\u0338':'notindot','\u22F9\u0338':'notinE','\u22F7':'notinvb','\u22F6':'notinvc','\u29CF\u0338':'NotLeftTriangleBar','\u2278':'ntlg','\u2AA2\u0338':'NotNestedGreaterGreater','\u2AA1\u0338':'NotNestedLessLess','\u220C':'notni','\u22FE':'notnivb','\u22FD':'notnivc','\u2280':'npr','\u2AAF\u0338':'npre','\u22E0':'nprcue','\u29D0\u0338':'NotRightTriangleBar','\u22EB':'nrtri','\u22ED':'nrtrie','\u228F\u0338':'NotSquareSubset','\u22E2':'nsqsube','\u2290\u0338':'NotSquareSuperset','\u22E3':'nsqsupe','\u2282\u20D2':'vnsub','\u2288':'nsube','\u2281':'nsc','\u2AB0\u0338':'nsce','\u22E1':'nsccue','\u227F\u0338':'NotSucceedsTilde','\u2283\u20D2':'vnsup','\u2289':'nsupe','\u2241':'nsim','\u2244':'nsime','\u2AFD\u20E5':'nparsl','\u2202\u0338':'npart','\u2A14':'npolint','\u2933\u0338':'nrarrc','\u219B':'nrarr','\u21CF':'nrArr','\u219D\u0338':'nrarrw','\uD835\uDCA9':'Nscr','\uD835\uDCC3':'nscr','\u2284':'nsub','\u2AC5\u0338':'nsubE','\u2285':'nsup','\u2AC6\u0338':'nsupE','\xD1':'Ntilde','\xF1':'ntilde','\u039D':'Nu','\u03BD':'nu','#':'num','\u2116':'numero','\u2007':'numsp','\u224D\u20D2':'nvap','\u22AC':'nvdash','\u22AD':'nvDash','\u22AE':'nVdash','\u22AF':'nVDash','\u2265\u20D2':'nvge','>\u20D2':'nvgt','\u2904':'nvHarr','\u29DE':'nvinfin','\u2902':'nvlArr','\u2264\u20D2':'nvle','<\u20D2':'nvlt','\u22B4\u20D2':'nvltrie','\u2903':'nvrArr','\u22B5\u20D2':'nvrtrie','\u223C\u20D2':'nvsim','\u2923':'nwarhk','\u2196':'nwarr','\u21D6':'nwArr','\u2927':'nwnear','\xD3':'Oacute','\xF3':'oacute','\xD4':'Ocirc','\xF4':'ocirc','\u041E':'Ocy','\u043E':'ocy','\u0150':'Odblac','\u0151':'odblac','\u2A38':'odiv','\u29BC':'odsold','\u0152':'OElig','\u0153':'oelig','\u29BF':'ofcir','\uD835\uDD12':'Ofr','\uD835\uDD2C':'ofr','\u02DB':'ogon','\xD2':'Ograve','\xF2':'ograve','\u29C1':'ogt','\u29B5':'ohbar','\u03A9':'ohm','\u29BE':'olcir','\u29BB':'olcross','\u203E':'oline','\u29C0':'olt','\u014C':'Omacr','\u014D':'omacr','\u03C9':'omega','\u039F':'Omicron','\u03BF':'omicron','\u29B6':'omid','\uD835\uDD46':'Oopf','\uD835\uDD60':'oopf','\u29B7':'opar','\u29B9':'operp','\u2A54':'Or','\u2228':'or','\u2A5D':'ord','\u2134':'oscr','\xAA':'ordf','\xBA':'ordm','\u22B6':'origof','\u2A56':'oror','\u2A57':'orslope','\u2A5B':'orv','\uD835\uDCAA':'Oscr','\xD8':'Oslash','\xF8':'oslash','\u2298':'osol','\xD5':'Otilde','\xF5':'otilde','\u2A36':'otimesas','\u2A37':'Otimes','\xD6':'Ouml','\xF6':'ouml','\u233D':'ovbar','\u23DE':'OverBrace','\u23B4':'tbrk','\u23DC':'OverParenthesis','\xB6':'para','\u2AF3':'parsim','\u2AFD':'parsl','\u2202':'part','\u041F':'Pcy','\u043F':'pcy','%':'percnt','.':'period','\u2030':'permil','\u2031':'pertenk','\uD835\uDD13':'Pfr','\uD835\uDD2D':'pfr','\u03A6':'Phi','\u03C6':'phi','\u03D5':'phiv','\u260E':'phone','\u03A0':'Pi','\u03C0':'pi','\u03D6':'piv','\u210E':'planckh','\u2A23':'plusacir','\u2A22':'pluscir','+':'plus','\u2A25':'plusdu','\u2A72':'pluse','\xB1':'pm','\u2A26':'plussim','\u2A27':'plustwo','\u2A15':'pointint','\uD835\uDD61':'popf','\u2119':'Popf','\xA3':'pound','\u2AB7':'prap','\u2ABB':'Pr','\u227A':'pr','\u227C':'prcue','\u2AAF':'pre','\u227E':'prsim','\u2AB9':'prnap','\u2AB5':'prnE','\u22E8':'prnsim','\u2AB3':'prE','\u2032':'prime','\u2033':'Prime','\u220F':'prod','\u232E':'profalar','\u2312':'profline','\u2313':'profsurf','\u221D':'prop','\u22B0':'prurel','\uD835\uDCAB':'Pscr','\uD835\uDCC5':'pscr','\u03A8':'Psi','\u03C8':'psi','\u2008':'puncsp','\uD835\uDD14':'Qfr','\uD835\uDD2E':'qfr','\uD835\uDD62':'qopf','\u211A':'Qopf','\u2057':'qprime','\uD835\uDCAC':'Qscr','\uD835\uDCC6':'qscr','\u2A16':'quatint','?':'quest','"':'quot','\u21DB':'rAarr','\u223D\u0331':'race','\u0154':'Racute','\u0155':'racute','\u221A':'Sqrt','\u29B3':'raemptyv','\u27E9':'rang','\u27EB':'Rang','\u2992':'rangd','\u29A5':'range','\xBB':'raquo','\u2975':'rarrap','\u21E5':'rarrb','\u2920':'rarrbfs','\u2933':'rarrc','\u2192':'rarr','\u21A0':'Rarr','\u291E':'rarrfs','\u2945':'rarrpl','\u2974':'rarrsim','\u2916':'Rarrtl','\u21A3':'rarrtl','\u219D':'rarrw','\u291A':'ratail','\u291C':'rAtail','\u2236':'ratio','\u2773':'rbbrk','}':'rcub',']':'rsqb','\u298C':'rbrke','\u298E':'rbrksld','\u2990':'rbrkslu','\u0158':'Rcaron','\u0159':'rcaron','\u0156':'Rcedil','\u0157':'rcedil','\u2309':'rceil','\u0420':'Rcy','\u0440':'rcy','\u2937':'rdca','\u2969':'rdldhar','\u21B3':'rdsh','\u211C':'Re','\u211B':'Rscr','\u211D':'Ropf','\u25AD':'rect','\u297D':'rfisht','\u230B':'rfloor','\uD835\uDD2F':'rfr','\u2964':'rHar','\u21C0':'rharu','\u296C':'rharul','\u03A1':'Rho','\u03C1':'rho','\u03F1':'rhov','\u21C4':'rlarr','\u27E7':'robrk','\u295D':'RightDownTeeVector','\u2955':'RightDownVectorBar','\u21C9':'rrarr','\u22A2':'vdash','\u295B':'RightTeeVector','\u22CC':'rthree','\u29D0':'RightTriangleBar','\u22B3':'vrtri','\u22B5':'rtrie','\u294F':'RightUpDownVector','\u295C':'RightUpTeeVector','\u2954':'RightUpVectorBar','\u21BE':'uharr','\u2953':'RightVectorBar','\u02DA':'ring','\u200F':'rlm','\u23B1':'rmoust','\u2AEE':'rnmid','\u27ED':'roang','\u21FE':'roarr','\u2986':'ropar','\uD835\uDD63':'ropf','\u2A2E':'roplus','\u2A35':'rotimes','\u2970':'RoundImplies',')':'rpar','\u2994':'rpargt','\u2A12':'rppolint','\u203A':'rsaquo','\uD835\uDCC7':'rscr','\u21B1':'rsh','\u22CA':'rtimes','\u25B9':'rtri','\u29CE':'rtriltri','\u29F4':'RuleDelayed','\u2968':'ruluhar','\u211E':'rx','\u015A':'Sacute','\u015B':'sacute','\u2AB8':'scap','\u0160':'Scaron','\u0161':'scaron','\u2ABC':'Sc','\u227B':'sc','\u227D':'sccue','\u2AB0':'sce','\u2AB4':'scE','\u015E':'Scedil','\u015F':'scedil','\u015C':'Scirc','\u015D':'scirc','\u2ABA':'scnap','\u2AB6':'scnE','\u22E9':'scnsim','\u2A13':'scpolint','\u227F':'scsim','\u0421':'Scy','\u0441':'scy','\u22C5':'sdot','\u2A66':'sdote','\u21D8':'seArr','\xA7':'sect',';':'semi','\u2929':'tosa','\u2736':'sext','\uD835\uDD16':'Sfr','\uD835\uDD30':'sfr','\u266F':'sharp','\u0429':'SHCHcy','\u0449':'shchcy','\u0428':'SHcy','\u0448':'shcy','\u2191':'uarr','\xAD':'shy','\u03A3':'Sigma','\u03C3':'sigma','\u03C2':'sigmaf','\u223C':'sim','\u2A6A':'simdot','\u2243':'sime','\u2A9E':'simg','\u2AA0':'simgE','\u2A9D':'siml','\u2A9F':'simlE','\u2246':'simne','\u2A24':'simplus','\u2972':'simrarr','\u2A33':'smashp','\u29E4':'smeparsl','\u2323':'smile','\u2AAA':'smt','\u2AAC':'smte','\u2AAC\uFE00':'smtes','\u042C':'SOFTcy','\u044C':'softcy','\u233F':'solbar','\u29C4':'solb','/':'sol','\uD835\uDD4A':'Sopf','\uD835\uDD64':'sopf','\u2660':'spades','\u2293':'sqcap','\u2293\uFE00':'sqcaps','\u2294':'sqcup','\u2294\uFE00':'sqcups','\u228F':'sqsub','\u2291':'sqsube','\u2290':'sqsup','\u2292':'sqsupe','\u25A1':'squ','\uD835\uDCAE':'Sscr','\uD835\uDCC8':'sscr','\u22C6':'Star','\u2606':'star','\u2282':'sub','\u22D0':'Sub','\u2ABD':'subdot','\u2AC5':'subE','\u2286':'sube','\u2AC3':'subedot','\u2AC1':'submult','\u2ACB':'subnE','\u228A':'subne','\u2ABF':'subplus','\u2979':'subrarr','\u2AC7':'subsim','\u2AD5':'subsub','\u2AD3':'subsup','\u2211':'sum','\u266A':'sung','\xB9':'sup1','\xB2':'sup2','\xB3':'sup3','\u2283':'sup','\u22D1':'Sup','\u2ABE':'supdot','\u2AD8':'supdsub','\u2AC6':'supE','\u2287':'supe','\u2AC4':'supedot','\u27C9':'suphsol','\u2AD7':'suphsub','\u297B':'suplarr','\u2AC2':'supmult','\u2ACC':'supnE','\u228B':'supne','\u2AC0':'supplus','\u2AC8':'supsim','\u2AD4':'supsub','\u2AD6':'supsup','\u21D9':'swArr','\u292A':'swnwar','\xDF':'szlig','\t':'Tab','\u2316':'target','\u03A4':'Tau','\u03C4':'tau','\u0164':'Tcaron','\u0165':'tcaron','\u0162':'Tcedil','\u0163':'tcedil','\u0422':'Tcy','\u0442':'tcy','\u20DB':'tdot','\u2315':'telrec','\uD835\uDD17':'Tfr','\uD835\uDD31':'tfr','\u2234':'there4','\u0398':'Theta','\u03B8':'theta','\u03D1':'thetav','\u205F\u200A':'ThickSpace','\u2009':'thinsp','\xDE':'THORN','\xFE':'thorn','\u2A31':'timesbar','\xD7':'times','\u2A30':'timesd','\u2336':'topbot','\u2AF1':'topcir','\uD835\uDD4B':'Topf','\uD835\uDD65':'topf','\u2ADA':'topfork','\u2034':'tprime','\u2122':'trade','\u25B5':'utri','\u225C':'trie','\u25EC':'tridot','\u2A3A':'triminus','\u2A39':'triplus','\u29CD':'trisb','\u2A3B':'tritime','\u23E2':'trpezium','\uD835\uDCAF':'Tscr','\uD835\uDCC9':'tscr','\u0426':'TScy','\u0446':'tscy','\u040B':'TSHcy','\u045B':'tshcy','\u0166':'Tstrok','\u0167':'tstrok','\xDA':'Uacute','\xFA':'uacute','\u219F':'Uarr','\u2949':'Uarrocir','\u040E':'Ubrcy','\u045E':'ubrcy','\u016C':'Ubreve','\u016D':'ubreve','\xDB':'Ucirc','\xFB':'ucirc','\u0423':'Ucy','\u0443':'ucy','\u21C5':'udarr','\u0170':'Udblac','\u0171':'udblac','\u296E':'udhar','\u297E':'ufisht','\uD835\uDD18':'Ufr','\uD835\uDD32':'ufr','\xD9':'Ugrave','\xF9':'ugrave','\u2963':'uHar','\u2580':'uhblk','\u231C':'ulcorn','\u230F':'ulcrop','\u25F8':'ultri','\u016A':'Umacr','\u016B':'umacr','\u23DF':'UnderBrace','\u23DD':'UnderParenthesis','\u228E':'uplus','\u0172':'Uogon','\u0173':'uogon','\uD835\uDD4C':'Uopf','\uD835\uDD66':'uopf','\u2912':'UpArrowBar','\u2195':'varr','\u03C5':'upsi','\u03D2':'Upsi','\u03A5':'Upsilon','\u21C8':'uuarr','\u231D':'urcorn','\u230E':'urcrop','\u016E':'Uring','\u016F':'uring','\u25F9':'urtri','\uD835\uDCB0':'Uscr','\uD835\uDCCA':'uscr','\u22F0':'utdot','\u0168':'Utilde','\u0169':'utilde','\xDC':'Uuml','\xFC':'uuml','\u29A7':'uwangle','\u299C':'vangrt','\u228A\uFE00':'vsubne','\u2ACB\uFE00':'vsubnE','\u228B\uFE00':'vsupne','\u2ACC\uFE00':'vsupnE','\u2AE8':'vBar','\u2AEB':'Vbar','\u2AE9':'vBarv','\u0412':'Vcy','\u0432':'vcy','\u22A9':'Vdash','\u22AB':'VDash','\u2AE6':'Vdashl','\u22BB':'veebar','\u225A':'veeeq','\u22EE':'vellip','|':'vert','\u2016':'Vert','\u2758':'VerticalSeparator','\u2240':'wr','\uD835\uDD19':'Vfr','\uD835\uDD33':'vfr','\uD835\uDD4D':'Vopf','\uD835\uDD67':'vopf','\uD835\uDCB1':'Vscr','\uD835\uDCCB':'vscr','\u22AA':'Vvdash','\u299A':'vzigzag','\u0174':'Wcirc','\u0175':'wcirc','\u2A5F':'wedbar','\u2259':'wedgeq','\u2118':'wp','\uD835\uDD1A':'Wfr','\uD835\uDD34':'wfr','\uD835\uDD4E':'Wopf','\uD835\uDD68':'wopf','\uD835\uDCB2':'Wscr','\uD835\uDCCC':'wscr','\uD835\uDD1B':'Xfr','\uD835\uDD35':'xfr','\u039E':'Xi','\u03BE':'xi','\u22FB':'xnis','\uD835\uDD4F':'Xopf','\uD835\uDD69':'xopf','\uD835\uDCB3':'Xscr','\uD835\uDCCD':'xscr','\xDD':'Yacute','\xFD':'yacute','\u042F':'YAcy','\u044F':'yacy','\u0176':'Ycirc','\u0177':'ycirc','\u042B':'Ycy','\u044B':'ycy','\xA5':'yen','\uD835\uDD1C':'Yfr','\uD835\uDD36':'yfr','\u0407':'YIcy','\u0457':'yicy','\uD835\uDD50':'Yopf','\uD835\uDD6A':'yopf','\uD835\uDCB4':'Yscr','\uD835\uDCCE':'yscr','\u042E':'YUcy','\u044E':'yucy','\xFF':'yuml','\u0178':'Yuml','\u0179':'Zacute','\u017A':'zacute','\u017D':'Zcaron','\u017E':'zcaron','\u0417':'Zcy','\u0437':'zcy','\u017B':'Zdot','\u017C':'zdot','\u2128':'Zfr','\u0396':'Zeta','\u03B6':'zeta','\uD835\uDD37':'zfr','\u0416':'ZHcy','\u0436':'zhcy','\u21DD':'zigrarr','\uD835\uDD6B':'zopf','\uD835\uDCB5':'Zscr','\uD835\uDCCF':'zscr','\u200D':'zwj','\u200C':'zwnj'}; - - var regexEscape = /["&'<>`]/g; - var escapeMap = { - '"': '"', - '&': '&', - '\'': ''', - '<': '<', - // See https://mathiasbynens.be/notes/ambiguous-ampersands: in HTML, the - // following is not strictly necessary unless it’s part of a tag or an - // unquoted attribute value. We’re only escaping it to support those - // situations, and for XML support. - '>': '>', - // In Internet Explorer ≤ 8, the backtick character can be used - // to break out of (un)quoted attribute values or HTML comments. - // See http://html5sec.org/#102, http://html5sec.org/#108, and - // http://html5sec.org/#133. - '`': '`' - }; - - var regexInvalidEntity = /&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/; - var regexInvalidRawCodePoint = /[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; - var regexDecode = /&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|iacute|Uacute|plusmn|otilde|Otilde|Agrave|agrave|yacute|Yacute|oslash|Oslash|Atilde|atilde|brvbar|Ccedil|ccedil|ograve|curren|divide|Eacute|eacute|Ograve|oacute|Egrave|egrave|ugrave|frac12|frac14|frac34|Ugrave|Oacute|Iacute|ntilde|Ntilde|uacute|middot|Igrave|igrave|iquest|aacute|laquo|THORN|micro|iexcl|icirc|Icirc|Acirc|ucirc|ecirc|Ocirc|ocirc|Ecirc|Ucirc|aring|Aring|aelig|AElig|acute|pound|raquo|acirc|times|thorn|szlig|cedil|COPY|Auml|ordf|ordm|uuml|macr|Uuml|auml|Ouml|ouml|para|nbsp|Euml|quot|QUOT|euml|yuml|cent|sect|copy|sup1|sup2|sup3|Iuml|iuml|shy|eth|reg|not|yen|amp|AMP|REG|uml|ETH|deg|gt|GT|LT|lt)([=a-zA-Z0-9])?/g; - var decodeMap = {'Aacute':'\xC1','aacute':'\xE1','Abreve':'\u0102','abreve':'\u0103','ac':'\u223E','acd':'\u223F','acE':'\u223E\u0333','Acirc':'\xC2','acirc':'\xE2','acute':'\xB4','Acy':'\u0410','acy':'\u0430','AElig':'\xC6','aelig':'\xE6','af':'\u2061','Afr':'\uD835\uDD04','afr':'\uD835\uDD1E','Agrave':'\xC0','agrave':'\xE0','alefsym':'\u2135','aleph':'\u2135','Alpha':'\u0391','alpha':'\u03B1','Amacr':'\u0100','amacr':'\u0101','amalg':'\u2A3F','amp':'&','AMP':'&','andand':'\u2A55','And':'\u2A53','and':'\u2227','andd':'\u2A5C','andslope':'\u2A58','andv':'\u2A5A','ang':'\u2220','ange':'\u29A4','angle':'\u2220','angmsdaa':'\u29A8','angmsdab':'\u29A9','angmsdac':'\u29AA','angmsdad':'\u29AB','angmsdae':'\u29AC','angmsdaf':'\u29AD','angmsdag':'\u29AE','angmsdah':'\u29AF','angmsd':'\u2221','angrt':'\u221F','angrtvb':'\u22BE','angrtvbd':'\u299D','angsph':'\u2222','angst':'\xC5','angzarr':'\u237C','Aogon':'\u0104','aogon':'\u0105','Aopf':'\uD835\uDD38','aopf':'\uD835\uDD52','apacir':'\u2A6F','ap':'\u2248','apE':'\u2A70','ape':'\u224A','apid':'\u224B','apos':'\'','ApplyFunction':'\u2061','approx':'\u2248','approxeq':'\u224A','Aring':'\xC5','aring':'\xE5','Ascr':'\uD835\uDC9C','ascr':'\uD835\uDCB6','Assign':'\u2254','ast':'*','asymp':'\u2248','asympeq':'\u224D','Atilde':'\xC3','atilde':'\xE3','Auml':'\xC4','auml':'\xE4','awconint':'\u2233','awint':'\u2A11','backcong':'\u224C','backepsilon':'\u03F6','backprime':'\u2035','backsim':'\u223D','backsimeq':'\u22CD','Backslash':'\u2216','Barv':'\u2AE7','barvee':'\u22BD','barwed':'\u2305','Barwed':'\u2306','barwedge':'\u2305','bbrk':'\u23B5','bbrktbrk':'\u23B6','bcong':'\u224C','Bcy':'\u0411','bcy':'\u0431','bdquo':'\u201E','becaus':'\u2235','because':'\u2235','Because':'\u2235','bemptyv':'\u29B0','bepsi':'\u03F6','bernou':'\u212C','Bernoullis':'\u212C','Beta':'\u0392','beta':'\u03B2','beth':'\u2136','between':'\u226C','Bfr':'\uD835\uDD05','bfr':'\uD835\uDD1F','bigcap':'\u22C2','bigcirc':'\u25EF','bigcup':'\u22C3','bigodot':'\u2A00','bigoplus':'\u2A01','bigotimes':'\u2A02','bigsqcup':'\u2A06','bigstar':'\u2605','bigtriangledown':'\u25BD','bigtriangleup':'\u25B3','biguplus':'\u2A04','bigvee':'\u22C1','bigwedge':'\u22C0','bkarow':'\u290D','blacklozenge':'\u29EB','blacksquare':'\u25AA','blacktriangle':'\u25B4','blacktriangledown':'\u25BE','blacktriangleleft':'\u25C2','blacktriangleright':'\u25B8','blank':'\u2423','blk12':'\u2592','blk14':'\u2591','blk34':'\u2593','block':'\u2588','bne':'=\u20E5','bnequiv':'\u2261\u20E5','bNot':'\u2AED','bnot':'\u2310','Bopf':'\uD835\uDD39','bopf':'\uD835\uDD53','bot':'\u22A5','bottom':'\u22A5','bowtie':'\u22C8','boxbox':'\u29C9','boxdl':'\u2510','boxdL':'\u2555','boxDl':'\u2556','boxDL':'\u2557','boxdr':'\u250C','boxdR':'\u2552','boxDr':'\u2553','boxDR':'\u2554','boxh':'\u2500','boxH':'\u2550','boxhd':'\u252C','boxHd':'\u2564','boxhD':'\u2565','boxHD':'\u2566','boxhu':'\u2534','boxHu':'\u2567','boxhU':'\u2568','boxHU':'\u2569','boxminus':'\u229F','boxplus':'\u229E','boxtimes':'\u22A0','boxul':'\u2518','boxuL':'\u255B','boxUl':'\u255C','boxUL':'\u255D','boxur':'\u2514','boxuR':'\u2558','boxUr':'\u2559','boxUR':'\u255A','boxv':'\u2502','boxV':'\u2551','boxvh':'\u253C','boxvH':'\u256A','boxVh':'\u256B','boxVH':'\u256C','boxvl':'\u2524','boxvL':'\u2561','boxVl':'\u2562','boxVL':'\u2563','boxvr':'\u251C','boxvR':'\u255E','boxVr':'\u255F','boxVR':'\u2560','bprime':'\u2035','breve':'\u02D8','Breve':'\u02D8','brvbar':'\xA6','bscr':'\uD835\uDCB7','Bscr':'\u212C','bsemi':'\u204F','bsim':'\u223D','bsime':'\u22CD','bsolb':'\u29C5','bsol':'\\','bsolhsub':'\u27C8','bull':'\u2022','bullet':'\u2022','bump':'\u224E','bumpE':'\u2AAE','bumpe':'\u224F','Bumpeq':'\u224E','bumpeq':'\u224F','Cacute':'\u0106','cacute':'\u0107','capand':'\u2A44','capbrcup':'\u2A49','capcap':'\u2A4B','cap':'\u2229','Cap':'\u22D2','capcup':'\u2A47','capdot':'\u2A40','CapitalDifferentialD':'\u2145','caps':'\u2229\uFE00','caret':'\u2041','caron':'\u02C7','Cayleys':'\u212D','ccaps':'\u2A4D','Ccaron':'\u010C','ccaron':'\u010D','Ccedil':'\xC7','ccedil':'\xE7','Ccirc':'\u0108','ccirc':'\u0109','Cconint':'\u2230','ccups':'\u2A4C','ccupssm':'\u2A50','Cdot':'\u010A','cdot':'\u010B','cedil':'\xB8','Cedilla':'\xB8','cemptyv':'\u29B2','cent':'\xA2','centerdot':'\xB7','CenterDot':'\xB7','cfr':'\uD835\uDD20','Cfr':'\u212D','CHcy':'\u0427','chcy':'\u0447','check':'\u2713','checkmark':'\u2713','Chi':'\u03A7','chi':'\u03C7','circ':'\u02C6','circeq':'\u2257','circlearrowleft':'\u21BA','circlearrowright':'\u21BB','circledast':'\u229B','circledcirc':'\u229A','circleddash':'\u229D','CircleDot':'\u2299','circledR':'\xAE','circledS':'\u24C8','CircleMinus':'\u2296','CirclePlus':'\u2295','CircleTimes':'\u2297','cir':'\u25CB','cirE':'\u29C3','cire':'\u2257','cirfnint':'\u2A10','cirmid':'\u2AEF','cirscir':'\u29C2','ClockwiseContourIntegral':'\u2232','CloseCurlyDoubleQuote':'\u201D','CloseCurlyQuote':'\u2019','clubs':'\u2663','clubsuit':'\u2663','colon':':','Colon':'\u2237','Colone':'\u2A74','colone':'\u2254','coloneq':'\u2254','comma':',','commat':'@','comp':'\u2201','compfn':'\u2218','complement':'\u2201','complexes':'\u2102','cong':'\u2245','congdot':'\u2A6D','Congruent':'\u2261','conint':'\u222E','Conint':'\u222F','ContourIntegral':'\u222E','copf':'\uD835\uDD54','Copf':'\u2102','coprod':'\u2210','Coproduct':'\u2210','copy':'\xA9','COPY':'\xA9','copysr':'\u2117','CounterClockwiseContourIntegral':'\u2233','crarr':'\u21B5','cross':'\u2717','Cross':'\u2A2F','Cscr':'\uD835\uDC9E','cscr':'\uD835\uDCB8','csub':'\u2ACF','csube':'\u2AD1','csup':'\u2AD0','csupe':'\u2AD2','ctdot':'\u22EF','cudarrl':'\u2938','cudarrr':'\u2935','cuepr':'\u22DE','cuesc':'\u22DF','cularr':'\u21B6','cularrp':'\u293D','cupbrcap':'\u2A48','cupcap':'\u2A46','CupCap':'\u224D','cup':'\u222A','Cup':'\u22D3','cupcup':'\u2A4A','cupdot':'\u228D','cupor':'\u2A45','cups':'\u222A\uFE00','curarr':'\u21B7','curarrm':'\u293C','curlyeqprec':'\u22DE','curlyeqsucc':'\u22DF','curlyvee':'\u22CE','curlywedge':'\u22CF','curren':'\xA4','curvearrowleft':'\u21B6','curvearrowright':'\u21B7','cuvee':'\u22CE','cuwed':'\u22CF','cwconint':'\u2232','cwint':'\u2231','cylcty':'\u232D','dagger':'\u2020','Dagger':'\u2021','daleth':'\u2138','darr':'\u2193','Darr':'\u21A1','dArr':'\u21D3','dash':'\u2010','Dashv':'\u2AE4','dashv':'\u22A3','dbkarow':'\u290F','dblac':'\u02DD','Dcaron':'\u010E','dcaron':'\u010F','Dcy':'\u0414','dcy':'\u0434','ddagger':'\u2021','ddarr':'\u21CA','DD':'\u2145','dd':'\u2146','DDotrahd':'\u2911','ddotseq':'\u2A77','deg':'\xB0','Del':'\u2207','Delta':'\u0394','delta':'\u03B4','demptyv':'\u29B1','dfisht':'\u297F','Dfr':'\uD835\uDD07','dfr':'\uD835\uDD21','dHar':'\u2965','dharl':'\u21C3','dharr':'\u21C2','DiacriticalAcute':'\xB4','DiacriticalDot':'\u02D9','DiacriticalDoubleAcute':'\u02DD','DiacriticalGrave':'`','DiacriticalTilde':'\u02DC','diam':'\u22C4','diamond':'\u22C4','Diamond':'\u22C4','diamondsuit':'\u2666','diams':'\u2666','die':'\xA8','DifferentialD':'\u2146','digamma':'\u03DD','disin':'\u22F2','div':'\xF7','divide':'\xF7','divideontimes':'\u22C7','divonx':'\u22C7','DJcy':'\u0402','djcy':'\u0452','dlcorn':'\u231E','dlcrop':'\u230D','dollar':'$','Dopf':'\uD835\uDD3B','dopf':'\uD835\uDD55','Dot':'\xA8','dot':'\u02D9','DotDot':'\u20DC','doteq':'\u2250','doteqdot':'\u2251','DotEqual':'\u2250','dotminus':'\u2238','dotplus':'\u2214','dotsquare':'\u22A1','doublebarwedge':'\u2306','DoubleContourIntegral':'\u222F','DoubleDot':'\xA8','DoubleDownArrow':'\u21D3','DoubleLeftArrow':'\u21D0','DoubleLeftRightArrow':'\u21D4','DoubleLeftTee':'\u2AE4','DoubleLongLeftArrow':'\u27F8','DoubleLongLeftRightArrow':'\u27FA','DoubleLongRightArrow':'\u27F9','DoubleRightArrow':'\u21D2','DoubleRightTee':'\u22A8','DoubleUpArrow':'\u21D1','DoubleUpDownArrow':'\u21D5','DoubleVerticalBar':'\u2225','DownArrowBar':'\u2913','downarrow':'\u2193','DownArrow':'\u2193','Downarrow':'\u21D3','DownArrowUpArrow':'\u21F5','DownBreve':'\u0311','downdownarrows':'\u21CA','downharpoonleft':'\u21C3','downharpoonright':'\u21C2','DownLeftRightVector':'\u2950','DownLeftTeeVector':'\u295E','DownLeftVectorBar':'\u2956','DownLeftVector':'\u21BD','DownRightTeeVector':'\u295F','DownRightVectorBar':'\u2957','DownRightVector':'\u21C1','DownTeeArrow':'\u21A7','DownTee':'\u22A4','drbkarow':'\u2910','drcorn':'\u231F','drcrop':'\u230C','Dscr':'\uD835\uDC9F','dscr':'\uD835\uDCB9','DScy':'\u0405','dscy':'\u0455','dsol':'\u29F6','Dstrok':'\u0110','dstrok':'\u0111','dtdot':'\u22F1','dtri':'\u25BF','dtrif':'\u25BE','duarr':'\u21F5','duhar':'\u296F','dwangle':'\u29A6','DZcy':'\u040F','dzcy':'\u045F','dzigrarr':'\u27FF','Eacute':'\xC9','eacute':'\xE9','easter':'\u2A6E','Ecaron':'\u011A','ecaron':'\u011B','Ecirc':'\xCA','ecirc':'\xEA','ecir':'\u2256','ecolon':'\u2255','Ecy':'\u042D','ecy':'\u044D','eDDot':'\u2A77','Edot':'\u0116','edot':'\u0117','eDot':'\u2251','ee':'\u2147','efDot':'\u2252','Efr':'\uD835\uDD08','efr':'\uD835\uDD22','eg':'\u2A9A','Egrave':'\xC8','egrave':'\xE8','egs':'\u2A96','egsdot':'\u2A98','el':'\u2A99','Element':'\u2208','elinters':'\u23E7','ell':'\u2113','els':'\u2A95','elsdot':'\u2A97','Emacr':'\u0112','emacr':'\u0113','empty':'\u2205','emptyset':'\u2205','EmptySmallSquare':'\u25FB','emptyv':'\u2205','EmptyVerySmallSquare':'\u25AB','emsp13':'\u2004','emsp14':'\u2005','emsp':'\u2003','ENG':'\u014A','eng':'\u014B','ensp':'\u2002','Eogon':'\u0118','eogon':'\u0119','Eopf':'\uD835\uDD3C','eopf':'\uD835\uDD56','epar':'\u22D5','eparsl':'\u29E3','eplus':'\u2A71','epsi':'\u03B5','Epsilon':'\u0395','epsilon':'\u03B5','epsiv':'\u03F5','eqcirc':'\u2256','eqcolon':'\u2255','eqsim':'\u2242','eqslantgtr':'\u2A96','eqslantless':'\u2A95','Equal':'\u2A75','equals':'=','EqualTilde':'\u2242','equest':'\u225F','Equilibrium':'\u21CC','equiv':'\u2261','equivDD':'\u2A78','eqvparsl':'\u29E5','erarr':'\u2971','erDot':'\u2253','escr':'\u212F','Escr':'\u2130','esdot':'\u2250','Esim':'\u2A73','esim':'\u2242','Eta':'\u0397','eta':'\u03B7','ETH':'\xD0','eth':'\xF0','Euml':'\xCB','euml':'\xEB','euro':'\u20AC','excl':'!','exist':'\u2203','Exists':'\u2203','expectation':'\u2130','exponentiale':'\u2147','ExponentialE':'\u2147','fallingdotseq':'\u2252','Fcy':'\u0424','fcy':'\u0444','female':'\u2640','ffilig':'\uFB03','fflig':'\uFB00','ffllig':'\uFB04','Ffr':'\uD835\uDD09','ffr':'\uD835\uDD23','filig':'\uFB01','FilledSmallSquare':'\u25FC','FilledVerySmallSquare':'\u25AA','fjlig':'fj','flat':'\u266D','fllig':'\uFB02','fltns':'\u25B1','fnof':'\u0192','Fopf':'\uD835\uDD3D','fopf':'\uD835\uDD57','forall':'\u2200','ForAll':'\u2200','fork':'\u22D4','forkv':'\u2AD9','Fouriertrf':'\u2131','fpartint':'\u2A0D','frac12':'\xBD','frac13':'\u2153','frac14':'\xBC','frac15':'\u2155','frac16':'\u2159','frac18':'\u215B','frac23':'\u2154','frac25':'\u2156','frac34':'\xBE','frac35':'\u2157','frac38':'\u215C','frac45':'\u2158','frac56':'\u215A','frac58':'\u215D','frac78':'\u215E','frasl':'\u2044','frown':'\u2322','fscr':'\uD835\uDCBB','Fscr':'\u2131','gacute':'\u01F5','Gamma':'\u0393','gamma':'\u03B3','Gammad':'\u03DC','gammad':'\u03DD','gap':'\u2A86','Gbreve':'\u011E','gbreve':'\u011F','Gcedil':'\u0122','Gcirc':'\u011C','gcirc':'\u011D','Gcy':'\u0413','gcy':'\u0433','Gdot':'\u0120','gdot':'\u0121','ge':'\u2265','gE':'\u2267','gEl':'\u2A8C','gel':'\u22DB','geq':'\u2265','geqq':'\u2267','geqslant':'\u2A7E','gescc':'\u2AA9','ges':'\u2A7E','gesdot':'\u2A80','gesdoto':'\u2A82','gesdotol':'\u2A84','gesl':'\u22DB\uFE00','gesles':'\u2A94','Gfr':'\uD835\uDD0A','gfr':'\uD835\uDD24','gg':'\u226B','Gg':'\u22D9','ggg':'\u22D9','gimel':'\u2137','GJcy':'\u0403','gjcy':'\u0453','gla':'\u2AA5','gl':'\u2277','glE':'\u2A92','glj':'\u2AA4','gnap':'\u2A8A','gnapprox':'\u2A8A','gne':'\u2A88','gnE':'\u2269','gneq':'\u2A88','gneqq':'\u2269','gnsim':'\u22E7','Gopf':'\uD835\uDD3E','gopf':'\uD835\uDD58','grave':'`','GreaterEqual':'\u2265','GreaterEqualLess':'\u22DB','GreaterFullEqual':'\u2267','GreaterGreater':'\u2AA2','GreaterLess':'\u2277','GreaterSlantEqual':'\u2A7E','GreaterTilde':'\u2273','Gscr':'\uD835\uDCA2','gscr':'\u210A','gsim':'\u2273','gsime':'\u2A8E','gsiml':'\u2A90','gtcc':'\u2AA7','gtcir':'\u2A7A','gt':'>','GT':'>','Gt':'\u226B','gtdot':'\u22D7','gtlPar':'\u2995','gtquest':'\u2A7C','gtrapprox':'\u2A86','gtrarr':'\u2978','gtrdot':'\u22D7','gtreqless':'\u22DB','gtreqqless':'\u2A8C','gtrless':'\u2277','gtrsim':'\u2273','gvertneqq':'\u2269\uFE00','gvnE':'\u2269\uFE00','Hacek':'\u02C7','hairsp':'\u200A','half':'\xBD','hamilt':'\u210B','HARDcy':'\u042A','hardcy':'\u044A','harrcir':'\u2948','harr':'\u2194','hArr':'\u21D4','harrw':'\u21AD','Hat':'^','hbar':'\u210F','Hcirc':'\u0124','hcirc':'\u0125','hearts':'\u2665','heartsuit':'\u2665','hellip':'\u2026','hercon':'\u22B9','hfr':'\uD835\uDD25','Hfr':'\u210C','HilbertSpace':'\u210B','hksearow':'\u2925','hkswarow':'\u2926','hoarr':'\u21FF','homtht':'\u223B','hookleftarrow':'\u21A9','hookrightarrow':'\u21AA','hopf':'\uD835\uDD59','Hopf':'\u210D','horbar':'\u2015','HorizontalLine':'\u2500','hscr':'\uD835\uDCBD','Hscr':'\u210B','hslash':'\u210F','Hstrok':'\u0126','hstrok':'\u0127','HumpDownHump':'\u224E','HumpEqual':'\u224F','hybull':'\u2043','hyphen':'\u2010','Iacute':'\xCD','iacute':'\xED','ic':'\u2063','Icirc':'\xCE','icirc':'\xEE','Icy':'\u0418','icy':'\u0438','Idot':'\u0130','IEcy':'\u0415','iecy':'\u0435','iexcl':'\xA1','iff':'\u21D4','ifr':'\uD835\uDD26','Ifr':'\u2111','Igrave':'\xCC','igrave':'\xEC','ii':'\u2148','iiiint':'\u2A0C','iiint':'\u222D','iinfin':'\u29DC','iiota':'\u2129','IJlig':'\u0132','ijlig':'\u0133','Imacr':'\u012A','imacr':'\u012B','image':'\u2111','ImaginaryI':'\u2148','imagline':'\u2110','imagpart':'\u2111','imath':'\u0131','Im':'\u2111','imof':'\u22B7','imped':'\u01B5','Implies':'\u21D2','incare':'\u2105','in':'\u2208','infin':'\u221E','infintie':'\u29DD','inodot':'\u0131','intcal':'\u22BA','int':'\u222B','Int':'\u222C','integers':'\u2124','Integral':'\u222B','intercal':'\u22BA','Intersection':'\u22C2','intlarhk':'\u2A17','intprod':'\u2A3C','InvisibleComma':'\u2063','InvisibleTimes':'\u2062','IOcy':'\u0401','iocy':'\u0451','Iogon':'\u012E','iogon':'\u012F','Iopf':'\uD835\uDD40','iopf':'\uD835\uDD5A','Iota':'\u0399','iota':'\u03B9','iprod':'\u2A3C','iquest':'\xBF','iscr':'\uD835\uDCBE','Iscr':'\u2110','isin':'\u2208','isindot':'\u22F5','isinE':'\u22F9','isins':'\u22F4','isinsv':'\u22F3','isinv':'\u2208','it':'\u2062','Itilde':'\u0128','itilde':'\u0129','Iukcy':'\u0406','iukcy':'\u0456','Iuml':'\xCF','iuml':'\xEF','Jcirc':'\u0134','jcirc':'\u0135','Jcy':'\u0419','jcy':'\u0439','Jfr':'\uD835\uDD0D','jfr':'\uD835\uDD27','jmath':'\u0237','Jopf':'\uD835\uDD41','jopf':'\uD835\uDD5B','Jscr':'\uD835\uDCA5','jscr':'\uD835\uDCBF','Jsercy':'\u0408','jsercy':'\u0458','Jukcy':'\u0404','jukcy':'\u0454','Kappa':'\u039A','kappa':'\u03BA','kappav':'\u03F0','Kcedil':'\u0136','kcedil':'\u0137','Kcy':'\u041A','kcy':'\u043A','Kfr':'\uD835\uDD0E','kfr':'\uD835\uDD28','kgreen':'\u0138','KHcy':'\u0425','khcy':'\u0445','KJcy':'\u040C','kjcy':'\u045C','Kopf':'\uD835\uDD42','kopf':'\uD835\uDD5C','Kscr':'\uD835\uDCA6','kscr':'\uD835\uDCC0','lAarr':'\u21DA','Lacute':'\u0139','lacute':'\u013A','laemptyv':'\u29B4','lagran':'\u2112','Lambda':'\u039B','lambda':'\u03BB','lang':'\u27E8','Lang':'\u27EA','langd':'\u2991','langle':'\u27E8','lap':'\u2A85','Laplacetrf':'\u2112','laquo':'\xAB','larrb':'\u21E4','larrbfs':'\u291F','larr':'\u2190','Larr':'\u219E','lArr':'\u21D0','larrfs':'\u291D','larrhk':'\u21A9','larrlp':'\u21AB','larrpl':'\u2939','larrsim':'\u2973','larrtl':'\u21A2','latail':'\u2919','lAtail':'\u291B','lat':'\u2AAB','late':'\u2AAD','lates':'\u2AAD\uFE00','lbarr':'\u290C','lBarr':'\u290E','lbbrk':'\u2772','lbrace':'{','lbrack':'[','lbrke':'\u298B','lbrksld':'\u298F','lbrkslu':'\u298D','Lcaron':'\u013D','lcaron':'\u013E','Lcedil':'\u013B','lcedil':'\u013C','lceil':'\u2308','lcub':'{','Lcy':'\u041B','lcy':'\u043B','ldca':'\u2936','ldquo':'\u201C','ldquor':'\u201E','ldrdhar':'\u2967','ldrushar':'\u294B','ldsh':'\u21B2','le':'\u2264','lE':'\u2266','LeftAngleBracket':'\u27E8','LeftArrowBar':'\u21E4','leftarrow':'\u2190','LeftArrow':'\u2190','Leftarrow':'\u21D0','LeftArrowRightArrow':'\u21C6','leftarrowtail':'\u21A2','LeftCeiling':'\u2308','LeftDoubleBracket':'\u27E6','LeftDownTeeVector':'\u2961','LeftDownVectorBar':'\u2959','LeftDownVector':'\u21C3','LeftFloor':'\u230A','leftharpoondown':'\u21BD','leftharpoonup':'\u21BC','leftleftarrows':'\u21C7','leftrightarrow':'\u2194','LeftRightArrow':'\u2194','Leftrightarrow':'\u21D4','leftrightarrows':'\u21C6','leftrightharpoons':'\u21CB','leftrightsquigarrow':'\u21AD','LeftRightVector':'\u294E','LeftTeeArrow':'\u21A4','LeftTee':'\u22A3','LeftTeeVector':'\u295A','leftthreetimes':'\u22CB','LeftTriangleBar':'\u29CF','LeftTriangle':'\u22B2','LeftTriangleEqual':'\u22B4','LeftUpDownVector':'\u2951','LeftUpTeeVector':'\u2960','LeftUpVectorBar':'\u2958','LeftUpVector':'\u21BF','LeftVectorBar':'\u2952','LeftVector':'\u21BC','lEg':'\u2A8B','leg':'\u22DA','leq':'\u2264','leqq':'\u2266','leqslant':'\u2A7D','lescc':'\u2AA8','les':'\u2A7D','lesdot':'\u2A7F','lesdoto':'\u2A81','lesdotor':'\u2A83','lesg':'\u22DA\uFE00','lesges':'\u2A93','lessapprox':'\u2A85','lessdot':'\u22D6','lesseqgtr':'\u22DA','lesseqqgtr':'\u2A8B','LessEqualGreater':'\u22DA','LessFullEqual':'\u2266','LessGreater':'\u2276','lessgtr':'\u2276','LessLess':'\u2AA1','lesssim':'\u2272','LessSlantEqual':'\u2A7D','LessTilde':'\u2272','lfisht':'\u297C','lfloor':'\u230A','Lfr':'\uD835\uDD0F','lfr':'\uD835\uDD29','lg':'\u2276','lgE':'\u2A91','lHar':'\u2962','lhard':'\u21BD','lharu':'\u21BC','lharul':'\u296A','lhblk':'\u2584','LJcy':'\u0409','ljcy':'\u0459','llarr':'\u21C7','ll':'\u226A','Ll':'\u22D8','llcorner':'\u231E','Lleftarrow':'\u21DA','llhard':'\u296B','lltri':'\u25FA','Lmidot':'\u013F','lmidot':'\u0140','lmoustache':'\u23B0','lmoust':'\u23B0','lnap':'\u2A89','lnapprox':'\u2A89','lne':'\u2A87','lnE':'\u2268','lneq':'\u2A87','lneqq':'\u2268','lnsim':'\u22E6','loang':'\u27EC','loarr':'\u21FD','lobrk':'\u27E6','longleftarrow':'\u27F5','LongLeftArrow':'\u27F5','Longleftarrow':'\u27F8','longleftrightarrow':'\u27F7','LongLeftRightArrow':'\u27F7','Longleftrightarrow':'\u27FA','longmapsto':'\u27FC','longrightarrow':'\u27F6','LongRightArrow':'\u27F6','Longrightarrow':'\u27F9','looparrowleft':'\u21AB','looparrowright':'\u21AC','lopar':'\u2985','Lopf':'\uD835\uDD43','lopf':'\uD835\uDD5D','loplus':'\u2A2D','lotimes':'\u2A34','lowast':'\u2217','lowbar':'_','LowerLeftArrow':'\u2199','LowerRightArrow':'\u2198','loz':'\u25CA','lozenge':'\u25CA','lozf':'\u29EB','lpar':'(','lparlt':'\u2993','lrarr':'\u21C6','lrcorner':'\u231F','lrhar':'\u21CB','lrhard':'\u296D','lrm':'\u200E','lrtri':'\u22BF','lsaquo':'\u2039','lscr':'\uD835\uDCC1','Lscr':'\u2112','lsh':'\u21B0','Lsh':'\u21B0','lsim':'\u2272','lsime':'\u2A8D','lsimg':'\u2A8F','lsqb':'[','lsquo':'\u2018','lsquor':'\u201A','Lstrok':'\u0141','lstrok':'\u0142','ltcc':'\u2AA6','ltcir':'\u2A79','lt':'<','LT':'<','Lt':'\u226A','ltdot':'\u22D6','lthree':'\u22CB','ltimes':'\u22C9','ltlarr':'\u2976','ltquest':'\u2A7B','ltri':'\u25C3','ltrie':'\u22B4','ltrif':'\u25C2','ltrPar':'\u2996','lurdshar':'\u294A','luruhar':'\u2966','lvertneqq':'\u2268\uFE00','lvnE':'\u2268\uFE00','macr':'\xAF','male':'\u2642','malt':'\u2720','maltese':'\u2720','Map':'\u2905','map':'\u21A6','mapsto':'\u21A6','mapstodown':'\u21A7','mapstoleft':'\u21A4','mapstoup':'\u21A5','marker':'\u25AE','mcomma':'\u2A29','Mcy':'\u041C','mcy':'\u043C','mdash':'\u2014','mDDot':'\u223A','measuredangle':'\u2221','MediumSpace':'\u205F','Mellintrf':'\u2133','Mfr':'\uD835\uDD10','mfr':'\uD835\uDD2A','mho':'\u2127','micro':'\xB5','midast':'*','midcir':'\u2AF0','mid':'\u2223','middot':'\xB7','minusb':'\u229F','minus':'\u2212','minusd':'\u2238','minusdu':'\u2A2A','MinusPlus':'\u2213','mlcp':'\u2ADB','mldr':'\u2026','mnplus':'\u2213','models':'\u22A7','Mopf':'\uD835\uDD44','mopf':'\uD835\uDD5E','mp':'\u2213','mscr':'\uD835\uDCC2','Mscr':'\u2133','mstpos':'\u223E','Mu':'\u039C','mu':'\u03BC','multimap':'\u22B8','mumap':'\u22B8','nabla':'\u2207','Nacute':'\u0143','nacute':'\u0144','nang':'\u2220\u20D2','nap':'\u2249','napE':'\u2A70\u0338','napid':'\u224B\u0338','napos':'\u0149','napprox':'\u2249','natural':'\u266E','naturals':'\u2115','natur':'\u266E','nbsp':'\xA0','nbump':'\u224E\u0338','nbumpe':'\u224F\u0338','ncap':'\u2A43','Ncaron':'\u0147','ncaron':'\u0148','Ncedil':'\u0145','ncedil':'\u0146','ncong':'\u2247','ncongdot':'\u2A6D\u0338','ncup':'\u2A42','Ncy':'\u041D','ncy':'\u043D','ndash':'\u2013','nearhk':'\u2924','nearr':'\u2197','neArr':'\u21D7','nearrow':'\u2197','ne':'\u2260','nedot':'\u2250\u0338','NegativeMediumSpace':'\u200B','NegativeThickSpace':'\u200B','NegativeThinSpace':'\u200B','NegativeVeryThinSpace':'\u200B','nequiv':'\u2262','nesear':'\u2928','nesim':'\u2242\u0338','NestedGreaterGreater':'\u226B','NestedLessLess':'\u226A','NewLine':'\n','nexist':'\u2204','nexists':'\u2204','Nfr':'\uD835\uDD11','nfr':'\uD835\uDD2B','ngE':'\u2267\u0338','nge':'\u2271','ngeq':'\u2271','ngeqq':'\u2267\u0338','ngeqslant':'\u2A7E\u0338','nges':'\u2A7E\u0338','nGg':'\u22D9\u0338','ngsim':'\u2275','nGt':'\u226B\u20D2','ngt':'\u226F','ngtr':'\u226F','nGtv':'\u226B\u0338','nharr':'\u21AE','nhArr':'\u21CE','nhpar':'\u2AF2','ni':'\u220B','nis':'\u22FC','nisd':'\u22FA','niv':'\u220B','NJcy':'\u040A','njcy':'\u045A','nlarr':'\u219A','nlArr':'\u21CD','nldr':'\u2025','nlE':'\u2266\u0338','nle':'\u2270','nleftarrow':'\u219A','nLeftarrow':'\u21CD','nleftrightarrow':'\u21AE','nLeftrightarrow':'\u21CE','nleq':'\u2270','nleqq':'\u2266\u0338','nleqslant':'\u2A7D\u0338','nles':'\u2A7D\u0338','nless':'\u226E','nLl':'\u22D8\u0338','nlsim':'\u2274','nLt':'\u226A\u20D2','nlt':'\u226E','nltri':'\u22EA','nltrie':'\u22EC','nLtv':'\u226A\u0338','nmid':'\u2224','NoBreak':'\u2060','NonBreakingSpace':'\xA0','nopf':'\uD835\uDD5F','Nopf':'\u2115','Not':'\u2AEC','not':'\xAC','NotCongruent':'\u2262','NotCupCap':'\u226D','NotDoubleVerticalBar':'\u2226','NotElement':'\u2209','NotEqual':'\u2260','NotEqualTilde':'\u2242\u0338','NotExists':'\u2204','NotGreater':'\u226F','NotGreaterEqual':'\u2271','NotGreaterFullEqual':'\u2267\u0338','NotGreaterGreater':'\u226B\u0338','NotGreaterLess':'\u2279','NotGreaterSlantEqual':'\u2A7E\u0338','NotGreaterTilde':'\u2275','NotHumpDownHump':'\u224E\u0338','NotHumpEqual':'\u224F\u0338','notin':'\u2209','notindot':'\u22F5\u0338','notinE':'\u22F9\u0338','notinva':'\u2209','notinvb':'\u22F7','notinvc':'\u22F6','NotLeftTriangleBar':'\u29CF\u0338','NotLeftTriangle':'\u22EA','NotLeftTriangleEqual':'\u22EC','NotLess':'\u226E','NotLessEqual':'\u2270','NotLessGreater':'\u2278','NotLessLess':'\u226A\u0338','NotLessSlantEqual':'\u2A7D\u0338','NotLessTilde':'\u2274','NotNestedGreaterGreater':'\u2AA2\u0338','NotNestedLessLess':'\u2AA1\u0338','notni':'\u220C','notniva':'\u220C','notnivb':'\u22FE','notnivc':'\u22FD','NotPrecedes':'\u2280','NotPrecedesEqual':'\u2AAF\u0338','NotPrecedesSlantEqual':'\u22E0','NotReverseElement':'\u220C','NotRightTriangleBar':'\u29D0\u0338','NotRightTriangle':'\u22EB','NotRightTriangleEqual':'\u22ED','NotSquareSubset':'\u228F\u0338','NotSquareSubsetEqual':'\u22E2','NotSquareSuperset':'\u2290\u0338','NotSquareSupersetEqual':'\u22E3','NotSubset':'\u2282\u20D2','NotSubsetEqual':'\u2288','NotSucceeds':'\u2281','NotSucceedsEqual':'\u2AB0\u0338','NotSucceedsSlantEqual':'\u22E1','NotSucceedsTilde':'\u227F\u0338','NotSuperset':'\u2283\u20D2','NotSupersetEqual':'\u2289','NotTilde':'\u2241','NotTildeEqual':'\u2244','NotTildeFullEqual':'\u2247','NotTildeTilde':'\u2249','NotVerticalBar':'\u2224','nparallel':'\u2226','npar':'\u2226','nparsl':'\u2AFD\u20E5','npart':'\u2202\u0338','npolint':'\u2A14','npr':'\u2280','nprcue':'\u22E0','nprec':'\u2280','npreceq':'\u2AAF\u0338','npre':'\u2AAF\u0338','nrarrc':'\u2933\u0338','nrarr':'\u219B','nrArr':'\u21CF','nrarrw':'\u219D\u0338','nrightarrow':'\u219B','nRightarrow':'\u21CF','nrtri':'\u22EB','nrtrie':'\u22ED','nsc':'\u2281','nsccue':'\u22E1','nsce':'\u2AB0\u0338','Nscr':'\uD835\uDCA9','nscr':'\uD835\uDCC3','nshortmid':'\u2224','nshortparallel':'\u2226','nsim':'\u2241','nsime':'\u2244','nsimeq':'\u2244','nsmid':'\u2224','nspar':'\u2226','nsqsube':'\u22E2','nsqsupe':'\u22E3','nsub':'\u2284','nsubE':'\u2AC5\u0338','nsube':'\u2288','nsubset':'\u2282\u20D2','nsubseteq':'\u2288','nsubseteqq':'\u2AC5\u0338','nsucc':'\u2281','nsucceq':'\u2AB0\u0338','nsup':'\u2285','nsupE':'\u2AC6\u0338','nsupe':'\u2289','nsupset':'\u2283\u20D2','nsupseteq':'\u2289','nsupseteqq':'\u2AC6\u0338','ntgl':'\u2279','Ntilde':'\xD1','ntilde':'\xF1','ntlg':'\u2278','ntriangleleft':'\u22EA','ntrianglelefteq':'\u22EC','ntriangleright':'\u22EB','ntrianglerighteq':'\u22ED','Nu':'\u039D','nu':'\u03BD','num':'#','numero':'\u2116','numsp':'\u2007','nvap':'\u224D\u20D2','nvdash':'\u22AC','nvDash':'\u22AD','nVdash':'\u22AE','nVDash':'\u22AF','nvge':'\u2265\u20D2','nvgt':'>\u20D2','nvHarr':'\u2904','nvinfin':'\u29DE','nvlArr':'\u2902','nvle':'\u2264\u20D2','nvlt':'<\u20D2','nvltrie':'\u22B4\u20D2','nvrArr':'\u2903','nvrtrie':'\u22B5\u20D2','nvsim':'\u223C\u20D2','nwarhk':'\u2923','nwarr':'\u2196','nwArr':'\u21D6','nwarrow':'\u2196','nwnear':'\u2927','Oacute':'\xD3','oacute':'\xF3','oast':'\u229B','Ocirc':'\xD4','ocirc':'\xF4','ocir':'\u229A','Ocy':'\u041E','ocy':'\u043E','odash':'\u229D','Odblac':'\u0150','odblac':'\u0151','odiv':'\u2A38','odot':'\u2299','odsold':'\u29BC','OElig':'\u0152','oelig':'\u0153','ofcir':'\u29BF','Ofr':'\uD835\uDD12','ofr':'\uD835\uDD2C','ogon':'\u02DB','Ograve':'\xD2','ograve':'\xF2','ogt':'\u29C1','ohbar':'\u29B5','ohm':'\u03A9','oint':'\u222E','olarr':'\u21BA','olcir':'\u29BE','olcross':'\u29BB','oline':'\u203E','olt':'\u29C0','Omacr':'\u014C','omacr':'\u014D','Omega':'\u03A9','omega':'\u03C9','Omicron':'\u039F','omicron':'\u03BF','omid':'\u29B6','ominus':'\u2296','Oopf':'\uD835\uDD46','oopf':'\uD835\uDD60','opar':'\u29B7','OpenCurlyDoubleQuote':'\u201C','OpenCurlyQuote':'\u2018','operp':'\u29B9','oplus':'\u2295','orarr':'\u21BB','Or':'\u2A54','or':'\u2228','ord':'\u2A5D','order':'\u2134','orderof':'\u2134','ordf':'\xAA','ordm':'\xBA','origof':'\u22B6','oror':'\u2A56','orslope':'\u2A57','orv':'\u2A5B','oS':'\u24C8','Oscr':'\uD835\uDCAA','oscr':'\u2134','Oslash':'\xD8','oslash':'\xF8','osol':'\u2298','Otilde':'\xD5','otilde':'\xF5','otimesas':'\u2A36','Otimes':'\u2A37','otimes':'\u2297','Ouml':'\xD6','ouml':'\xF6','ovbar':'\u233D','OverBar':'\u203E','OverBrace':'\u23DE','OverBracket':'\u23B4','OverParenthesis':'\u23DC','para':'\xB6','parallel':'\u2225','par':'\u2225','parsim':'\u2AF3','parsl':'\u2AFD','part':'\u2202','PartialD':'\u2202','Pcy':'\u041F','pcy':'\u043F','percnt':'%','period':'.','permil':'\u2030','perp':'\u22A5','pertenk':'\u2031','Pfr':'\uD835\uDD13','pfr':'\uD835\uDD2D','Phi':'\u03A6','phi':'\u03C6','phiv':'\u03D5','phmmat':'\u2133','phone':'\u260E','Pi':'\u03A0','pi':'\u03C0','pitchfork':'\u22D4','piv':'\u03D6','planck':'\u210F','planckh':'\u210E','plankv':'\u210F','plusacir':'\u2A23','plusb':'\u229E','pluscir':'\u2A22','plus':'+','plusdo':'\u2214','plusdu':'\u2A25','pluse':'\u2A72','PlusMinus':'\xB1','plusmn':'\xB1','plussim':'\u2A26','plustwo':'\u2A27','pm':'\xB1','Poincareplane':'\u210C','pointint':'\u2A15','popf':'\uD835\uDD61','Popf':'\u2119','pound':'\xA3','prap':'\u2AB7','Pr':'\u2ABB','pr':'\u227A','prcue':'\u227C','precapprox':'\u2AB7','prec':'\u227A','preccurlyeq':'\u227C','Precedes':'\u227A','PrecedesEqual':'\u2AAF','PrecedesSlantEqual':'\u227C','PrecedesTilde':'\u227E','preceq':'\u2AAF','precnapprox':'\u2AB9','precneqq':'\u2AB5','precnsim':'\u22E8','pre':'\u2AAF','prE':'\u2AB3','precsim':'\u227E','prime':'\u2032','Prime':'\u2033','primes':'\u2119','prnap':'\u2AB9','prnE':'\u2AB5','prnsim':'\u22E8','prod':'\u220F','Product':'\u220F','profalar':'\u232E','profline':'\u2312','profsurf':'\u2313','prop':'\u221D','Proportional':'\u221D','Proportion':'\u2237','propto':'\u221D','prsim':'\u227E','prurel':'\u22B0','Pscr':'\uD835\uDCAB','pscr':'\uD835\uDCC5','Psi':'\u03A8','psi':'\u03C8','puncsp':'\u2008','Qfr':'\uD835\uDD14','qfr':'\uD835\uDD2E','qint':'\u2A0C','qopf':'\uD835\uDD62','Qopf':'\u211A','qprime':'\u2057','Qscr':'\uD835\uDCAC','qscr':'\uD835\uDCC6','quaternions':'\u210D','quatint':'\u2A16','quest':'?','questeq':'\u225F','quot':'"','QUOT':'"','rAarr':'\u21DB','race':'\u223D\u0331','Racute':'\u0154','racute':'\u0155','radic':'\u221A','raemptyv':'\u29B3','rang':'\u27E9','Rang':'\u27EB','rangd':'\u2992','range':'\u29A5','rangle':'\u27E9','raquo':'\xBB','rarrap':'\u2975','rarrb':'\u21E5','rarrbfs':'\u2920','rarrc':'\u2933','rarr':'\u2192','Rarr':'\u21A0','rArr':'\u21D2','rarrfs':'\u291E','rarrhk':'\u21AA','rarrlp':'\u21AC','rarrpl':'\u2945','rarrsim':'\u2974','Rarrtl':'\u2916','rarrtl':'\u21A3','rarrw':'\u219D','ratail':'\u291A','rAtail':'\u291C','ratio':'\u2236','rationals':'\u211A','rbarr':'\u290D','rBarr':'\u290F','RBarr':'\u2910','rbbrk':'\u2773','rbrace':'}','rbrack':']','rbrke':'\u298C','rbrksld':'\u298E','rbrkslu':'\u2990','Rcaron':'\u0158','rcaron':'\u0159','Rcedil':'\u0156','rcedil':'\u0157','rceil':'\u2309','rcub':'}','Rcy':'\u0420','rcy':'\u0440','rdca':'\u2937','rdldhar':'\u2969','rdquo':'\u201D','rdquor':'\u201D','rdsh':'\u21B3','real':'\u211C','realine':'\u211B','realpart':'\u211C','reals':'\u211D','Re':'\u211C','rect':'\u25AD','reg':'\xAE','REG':'\xAE','ReverseElement':'\u220B','ReverseEquilibrium':'\u21CB','ReverseUpEquilibrium':'\u296F','rfisht':'\u297D','rfloor':'\u230B','rfr':'\uD835\uDD2F','Rfr':'\u211C','rHar':'\u2964','rhard':'\u21C1','rharu':'\u21C0','rharul':'\u296C','Rho':'\u03A1','rho':'\u03C1','rhov':'\u03F1','RightAngleBracket':'\u27E9','RightArrowBar':'\u21E5','rightarrow':'\u2192','RightArrow':'\u2192','Rightarrow':'\u21D2','RightArrowLeftArrow':'\u21C4','rightarrowtail':'\u21A3','RightCeiling':'\u2309','RightDoubleBracket':'\u27E7','RightDownTeeVector':'\u295D','RightDownVectorBar':'\u2955','RightDownVector':'\u21C2','RightFloor':'\u230B','rightharpoondown':'\u21C1','rightharpoonup':'\u21C0','rightleftarrows':'\u21C4','rightleftharpoons':'\u21CC','rightrightarrows':'\u21C9','rightsquigarrow':'\u219D','RightTeeArrow':'\u21A6','RightTee':'\u22A2','RightTeeVector':'\u295B','rightthreetimes':'\u22CC','RightTriangleBar':'\u29D0','RightTriangle':'\u22B3','RightTriangleEqual':'\u22B5','RightUpDownVector':'\u294F','RightUpTeeVector':'\u295C','RightUpVectorBar':'\u2954','RightUpVector':'\u21BE','RightVectorBar':'\u2953','RightVector':'\u21C0','ring':'\u02DA','risingdotseq':'\u2253','rlarr':'\u21C4','rlhar':'\u21CC','rlm':'\u200F','rmoustache':'\u23B1','rmoust':'\u23B1','rnmid':'\u2AEE','roang':'\u27ED','roarr':'\u21FE','robrk':'\u27E7','ropar':'\u2986','ropf':'\uD835\uDD63','Ropf':'\u211D','roplus':'\u2A2E','rotimes':'\u2A35','RoundImplies':'\u2970','rpar':')','rpargt':'\u2994','rppolint':'\u2A12','rrarr':'\u21C9','Rrightarrow':'\u21DB','rsaquo':'\u203A','rscr':'\uD835\uDCC7','Rscr':'\u211B','rsh':'\u21B1','Rsh':'\u21B1','rsqb':']','rsquo':'\u2019','rsquor':'\u2019','rthree':'\u22CC','rtimes':'\u22CA','rtri':'\u25B9','rtrie':'\u22B5','rtrif':'\u25B8','rtriltri':'\u29CE','RuleDelayed':'\u29F4','ruluhar':'\u2968','rx':'\u211E','Sacute':'\u015A','sacute':'\u015B','sbquo':'\u201A','scap':'\u2AB8','Scaron':'\u0160','scaron':'\u0161','Sc':'\u2ABC','sc':'\u227B','sccue':'\u227D','sce':'\u2AB0','scE':'\u2AB4','Scedil':'\u015E','scedil':'\u015F','Scirc':'\u015C','scirc':'\u015D','scnap':'\u2ABA','scnE':'\u2AB6','scnsim':'\u22E9','scpolint':'\u2A13','scsim':'\u227F','Scy':'\u0421','scy':'\u0441','sdotb':'\u22A1','sdot':'\u22C5','sdote':'\u2A66','searhk':'\u2925','searr':'\u2198','seArr':'\u21D8','searrow':'\u2198','sect':'\xA7','semi':';','seswar':'\u2929','setminus':'\u2216','setmn':'\u2216','sext':'\u2736','Sfr':'\uD835\uDD16','sfr':'\uD835\uDD30','sfrown':'\u2322','sharp':'\u266F','SHCHcy':'\u0429','shchcy':'\u0449','SHcy':'\u0428','shcy':'\u0448','ShortDownArrow':'\u2193','ShortLeftArrow':'\u2190','shortmid':'\u2223','shortparallel':'\u2225','ShortRightArrow':'\u2192','ShortUpArrow':'\u2191','shy':'\xAD','Sigma':'\u03A3','sigma':'\u03C3','sigmaf':'\u03C2','sigmav':'\u03C2','sim':'\u223C','simdot':'\u2A6A','sime':'\u2243','simeq':'\u2243','simg':'\u2A9E','simgE':'\u2AA0','siml':'\u2A9D','simlE':'\u2A9F','simne':'\u2246','simplus':'\u2A24','simrarr':'\u2972','slarr':'\u2190','SmallCircle':'\u2218','smallsetminus':'\u2216','smashp':'\u2A33','smeparsl':'\u29E4','smid':'\u2223','smile':'\u2323','smt':'\u2AAA','smte':'\u2AAC','smtes':'\u2AAC\uFE00','SOFTcy':'\u042C','softcy':'\u044C','solbar':'\u233F','solb':'\u29C4','sol':'/','Sopf':'\uD835\uDD4A','sopf':'\uD835\uDD64','spades':'\u2660','spadesuit':'\u2660','spar':'\u2225','sqcap':'\u2293','sqcaps':'\u2293\uFE00','sqcup':'\u2294','sqcups':'\u2294\uFE00','Sqrt':'\u221A','sqsub':'\u228F','sqsube':'\u2291','sqsubset':'\u228F','sqsubseteq':'\u2291','sqsup':'\u2290','sqsupe':'\u2292','sqsupset':'\u2290','sqsupseteq':'\u2292','square':'\u25A1','Square':'\u25A1','SquareIntersection':'\u2293','SquareSubset':'\u228F','SquareSubsetEqual':'\u2291','SquareSuperset':'\u2290','SquareSupersetEqual':'\u2292','SquareUnion':'\u2294','squarf':'\u25AA','squ':'\u25A1','squf':'\u25AA','srarr':'\u2192','Sscr':'\uD835\uDCAE','sscr':'\uD835\uDCC8','ssetmn':'\u2216','ssmile':'\u2323','sstarf':'\u22C6','Star':'\u22C6','star':'\u2606','starf':'\u2605','straightepsilon':'\u03F5','straightphi':'\u03D5','strns':'\xAF','sub':'\u2282','Sub':'\u22D0','subdot':'\u2ABD','subE':'\u2AC5','sube':'\u2286','subedot':'\u2AC3','submult':'\u2AC1','subnE':'\u2ACB','subne':'\u228A','subplus':'\u2ABF','subrarr':'\u2979','subset':'\u2282','Subset':'\u22D0','subseteq':'\u2286','subseteqq':'\u2AC5','SubsetEqual':'\u2286','subsetneq':'\u228A','subsetneqq':'\u2ACB','subsim':'\u2AC7','subsub':'\u2AD5','subsup':'\u2AD3','succapprox':'\u2AB8','succ':'\u227B','succcurlyeq':'\u227D','Succeeds':'\u227B','SucceedsEqual':'\u2AB0','SucceedsSlantEqual':'\u227D','SucceedsTilde':'\u227F','succeq':'\u2AB0','succnapprox':'\u2ABA','succneqq':'\u2AB6','succnsim':'\u22E9','succsim':'\u227F','SuchThat':'\u220B','sum':'\u2211','Sum':'\u2211','sung':'\u266A','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','sup':'\u2283','Sup':'\u22D1','supdot':'\u2ABE','supdsub':'\u2AD8','supE':'\u2AC6','supe':'\u2287','supedot':'\u2AC4','Superset':'\u2283','SupersetEqual':'\u2287','suphsol':'\u27C9','suphsub':'\u2AD7','suplarr':'\u297B','supmult':'\u2AC2','supnE':'\u2ACC','supne':'\u228B','supplus':'\u2AC0','supset':'\u2283','Supset':'\u22D1','supseteq':'\u2287','supseteqq':'\u2AC6','supsetneq':'\u228B','supsetneqq':'\u2ACC','supsim':'\u2AC8','supsub':'\u2AD4','supsup':'\u2AD6','swarhk':'\u2926','swarr':'\u2199','swArr':'\u21D9','swarrow':'\u2199','swnwar':'\u292A','szlig':'\xDF','Tab':'\t','target':'\u2316','Tau':'\u03A4','tau':'\u03C4','tbrk':'\u23B4','Tcaron':'\u0164','tcaron':'\u0165','Tcedil':'\u0162','tcedil':'\u0163','Tcy':'\u0422','tcy':'\u0442','tdot':'\u20DB','telrec':'\u2315','Tfr':'\uD835\uDD17','tfr':'\uD835\uDD31','there4':'\u2234','therefore':'\u2234','Therefore':'\u2234','Theta':'\u0398','theta':'\u03B8','thetasym':'\u03D1','thetav':'\u03D1','thickapprox':'\u2248','thicksim':'\u223C','ThickSpace':'\u205F\u200A','ThinSpace':'\u2009','thinsp':'\u2009','thkap':'\u2248','thksim':'\u223C','THORN':'\xDE','thorn':'\xFE','tilde':'\u02DC','Tilde':'\u223C','TildeEqual':'\u2243','TildeFullEqual':'\u2245','TildeTilde':'\u2248','timesbar':'\u2A31','timesb':'\u22A0','times':'\xD7','timesd':'\u2A30','tint':'\u222D','toea':'\u2928','topbot':'\u2336','topcir':'\u2AF1','top':'\u22A4','Topf':'\uD835\uDD4B','topf':'\uD835\uDD65','topfork':'\u2ADA','tosa':'\u2929','tprime':'\u2034','trade':'\u2122','TRADE':'\u2122','triangle':'\u25B5','triangledown':'\u25BF','triangleleft':'\u25C3','trianglelefteq':'\u22B4','triangleq':'\u225C','triangleright':'\u25B9','trianglerighteq':'\u22B5','tridot':'\u25EC','trie':'\u225C','triminus':'\u2A3A','TripleDot':'\u20DB','triplus':'\u2A39','trisb':'\u29CD','tritime':'\u2A3B','trpezium':'\u23E2','Tscr':'\uD835\uDCAF','tscr':'\uD835\uDCC9','TScy':'\u0426','tscy':'\u0446','TSHcy':'\u040B','tshcy':'\u045B','Tstrok':'\u0166','tstrok':'\u0167','twixt':'\u226C','twoheadleftarrow':'\u219E','twoheadrightarrow':'\u21A0','Uacute':'\xDA','uacute':'\xFA','uarr':'\u2191','Uarr':'\u219F','uArr':'\u21D1','Uarrocir':'\u2949','Ubrcy':'\u040E','ubrcy':'\u045E','Ubreve':'\u016C','ubreve':'\u016D','Ucirc':'\xDB','ucirc':'\xFB','Ucy':'\u0423','ucy':'\u0443','udarr':'\u21C5','Udblac':'\u0170','udblac':'\u0171','udhar':'\u296E','ufisht':'\u297E','Ufr':'\uD835\uDD18','ufr':'\uD835\uDD32','Ugrave':'\xD9','ugrave':'\xF9','uHar':'\u2963','uharl':'\u21BF','uharr':'\u21BE','uhblk':'\u2580','ulcorn':'\u231C','ulcorner':'\u231C','ulcrop':'\u230F','ultri':'\u25F8','Umacr':'\u016A','umacr':'\u016B','uml':'\xA8','UnderBar':'_','UnderBrace':'\u23DF','UnderBracket':'\u23B5','UnderParenthesis':'\u23DD','Union':'\u22C3','UnionPlus':'\u228E','Uogon':'\u0172','uogon':'\u0173','Uopf':'\uD835\uDD4C','uopf':'\uD835\uDD66','UpArrowBar':'\u2912','uparrow':'\u2191','UpArrow':'\u2191','Uparrow':'\u21D1','UpArrowDownArrow':'\u21C5','updownarrow':'\u2195','UpDownArrow':'\u2195','Updownarrow':'\u21D5','UpEquilibrium':'\u296E','upharpoonleft':'\u21BF','upharpoonright':'\u21BE','uplus':'\u228E','UpperLeftArrow':'\u2196','UpperRightArrow':'\u2197','upsi':'\u03C5','Upsi':'\u03D2','upsih':'\u03D2','Upsilon':'\u03A5','upsilon':'\u03C5','UpTeeArrow':'\u21A5','UpTee':'\u22A5','upuparrows':'\u21C8','urcorn':'\u231D','urcorner':'\u231D','urcrop':'\u230E','Uring':'\u016E','uring':'\u016F','urtri':'\u25F9','Uscr':'\uD835\uDCB0','uscr':'\uD835\uDCCA','utdot':'\u22F0','Utilde':'\u0168','utilde':'\u0169','utri':'\u25B5','utrif':'\u25B4','uuarr':'\u21C8','Uuml':'\xDC','uuml':'\xFC','uwangle':'\u29A7','vangrt':'\u299C','varepsilon':'\u03F5','varkappa':'\u03F0','varnothing':'\u2205','varphi':'\u03D5','varpi':'\u03D6','varpropto':'\u221D','varr':'\u2195','vArr':'\u21D5','varrho':'\u03F1','varsigma':'\u03C2','varsubsetneq':'\u228A\uFE00','varsubsetneqq':'\u2ACB\uFE00','varsupsetneq':'\u228B\uFE00','varsupsetneqq':'\u2ACC\uFE00','vartheta':'\u03D1','vartriangleleft':'\u22B2','vartriangleright':'\u22B3','vBar':'\u2AE8','Vbar':'\u2AEB','vBarv':'\u2AE9','Vcy':'\u0412','vcy':'\u0432','vdash':'\u22A2','vDash':'\u22A8','Vdash':'\u22A9','VDash':'\u22AB','Vdashl':'\u2AE6','veebar':'\u22BB','vee':'\u2228','Vee':'\u22C1','veeeq':'\u225A','vellip':'\u22EE','verbar':'|','Verbar':'\u2016','vert':'|','Vert':'\u2016','VerticalBar':'\u2223','VerticalLine':'|','VerticalSeparator':'\u2758','VerticalTilde':'\u2240','VeryThinSpace':'\u200A','Vfr':'\uD835\uDD19','vfr':'\uD835\uDD33','vltri':'\u22B2','vnsub':'\u2282\u20D2','vnsup':'\u2283\u20D2','Vopf':'\uD835\uDD4D','vopf':'\uD835\uDD67','vprop':'\u221D','vrtri':'\u22B3','Vscr':'\uD835\uDCB1','vscr':'\uD835\uDCCB','vsubnE':'\u2ACB\uFE00','vsubne':'\u228A\uFE00','vsupnE':'\u2ACC\uFE00','vsupne':'\u228B\uFE00','Vvdash':'\u22AA','vzigzag':'\u299A','Wcirc':'\u0174','wcirc':'\u0175','wedbar':'\u2A5F','wedge':'\u2227','Wedge':'\u22C0','wedgeq':'\u2259','weierp':'\u2118','Wfr':'\uD835\uDD1A','wfr':'\uD835\uDD34','Wopf':'\uD835\uDD4E','wopf':'\uD835\uDD68','wp':'\u2118','wr':'\u2240','wreath':'\u2240','Wscr':'\uD835\uDCB2','wscr':'\uD835\uDCCC','xcap':'\u22C2','xcirc':'\u25EF','xcup':'\u22C3','xdtri':'\u25BD','Xfr':'\uD835\uDD1B','xfr':'\uD835\uDD35','xharr':'\u27F7','xhArr':'\u27FA','Xi':'\u039E','xi':'\u03BE','xlarr':'\u27F5','xlArr':'\u27F8','xmap':'\u27FC','xnis':'\u22FB','xodot':'\u2A00','Xopf':'\uD835\uDD4F','xopf':'\uD835\uDD69','xoplus':'\u2A01','xotime':'\u2A02','xrarr':'\u27F6','xrArr':'\u27F9','Xscr':'\uD835\uDCB3','xscr':'\uD835\uDCCD','xsqcup':'\u2A06','xuplus':'\u2A04','xutri':'\u25B3','xvee':'\u22C1','xwedge':'\u22C0','Yacute':'\xDD','yacute':'\xFD','YAcy':'\u042F','yacy':'\u044F','Ycirc':'\u0176','ycirc':'\u0177','Ycy':'\u042B','ycy':'\u044B','yen':'\xA5','Yfr':'\uD835\uDD1C','yfr':'\uD835\uDD36','YIcy':'\u0407','yicy':'\u0457','Yopf':'\uD835\uDD50','yopf':'\uD835\uDD6A','Yscr':'\uD835\uDCB4','yscr':'\uD835\uDCCE','YUcy':'\u042E','yucy':'\u044E','yuml':'\xFF','Yuml':'\u0178','Zacute':'\u0179','zacute':'\u017A','Zcaron':'\u017D','zcaron':'\u017E','Zcy':'\u0417','zcy':'\u0437','Zdot':'\u017B','zdot':'\u017C','zeetrf':'\u2128','ZeroWidthSpace':'\u200B','Zeta':'\u0396','zeta':'\u03B6','zfr':'\uD835\uDD37','Zfr':'\u2128','ZHcy':'\u0416','zhcy':'\u0436','zigrarr':'\u21DD','zopf':'\uD835\uDD6B','Zopf':'\u2124','Zscr':'\uD835\uDCB5','zscr':'\uD835\uDCCF','zwj':'\u200D','zwnj':'\u200C'}; - var decodeMapLegacy = {'Aacute':'\xC1','aacute':'\xE1','Acirc':'\xC2','acirc':'\xE2','acute':'\xB4','AElig':'\xC6','aelig':'\xE6','Agrave':'\xC0','agrave':'\xE0','amp':'&','AMP':'&','Aring':'\xC5','aring':'\xE5','Atilde':'\xC3','atilde':'\xE3','Auml':'\xC4','auml':'\xE4','brvbar':'\xA6','Ccedil':'\xC7','ccedil':'\xE7','cedil':'\xB8','cent':'\xA2','copy':'\xA9','COPY':'\xA9','curren':'\xA4','deg':'\xB0','divide':'\xF7','Eacute':'\xC9','eacute':'\xE9','Ecirc':'\xCA','ecirc':'\xEA','Egrave':'\xC8','egrave':'\xE8','ETH':'\xD0','eth':'\xF0','Euml':'\xCB','euml':'\xEB','frac12':'\xBD','frac14':'\xBC','frac34':'\xBE','gt':'>','GT':'>','Iacute':'\xCD','iacute':'\xED','Icirc':'\xCE','icirc':'\xEE','iexcl':'\xA1','Igrave':'\xCC','igrave':'\xEC','iquest':'\xBF','Iuml':'\xCF','iuml':'\xEF','laquo':'\xAB','lt':'<','LT':'<','macr':'\xAF','micro':'\xB5','middot':'\xB7','nbsp':'\xA0','not':'\xAC','Ntilde':'\xD1','ntilde':'\xF1','Oacute':'\xD3','oacute':'\xF3','Ocirc':'\xD4','ocirc':'\xF4','Ograve':'\xD2','ograve':'\xF2','ordf':'\xAA','ordm':'\xBA','Oslash':'\xD8','oslash':'\xF8','Otilde':'\xD5','otilde':'\xF5','Ouml':'\xD6','ouml':'\xF6','para':'\xB6','plusmn':'\xB1','pound':'\xA3','quot':'"','QUOT':'"','raquo':'\xBB','reg':'\xAE','REG':'\xAE','sect':'\xA7','shy':'\xAD','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','szlig':'\xDF','THORN':'\xDE','thorn':'\xFE','times':'\xD7','Uacute':'\xDA','uacute':'\xFA','Ucirc':'\xDB','ucirc':'\xFB','Ugrave':'\xD9','ugrave':'\xF9','uml':'\xA8','Uuml':'\xDC','uuml':'\xFC','Yacute':'\xDD','yacute':'\xFD','yen':'\xA5','yuml':'\xFF'}; - var decodeMapNumeric = {'0':'\uFFFD','128':'\u20AC','130':'\u201A','131':'\u0192','132':'\u201E','133':'\u2026','134':'\u2020','135':'\u2021','136':'\u02C6','137':'\u2030','138':'\u0160','139':'\u2039','140':'\u0152','142':'\u017D','145':'\u2018','146':'\u2019','147':'\u201C','148':'\u201D','149':'\u2022','150':'\u2013','151':'\u2014','152':'\u02DC','153':'\u2122','154':'\u0161','155':'\u203A','156':'\u0153','158':'\u017E','159':'\u0178'}; - var invalidReferenceCodePoints = [1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65000,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]; - - /*--------------------------------------------------------------------------*/ - - var stringFromCharCode = String.fromCharCode; - - var object = {}; - var hasOwnProperty = object.hasOwnProperty; - var has = function(object, propertyName) { - return hasOwnProperty.call(object, propertyName); - }; - - var contains = function(array, value) { - var index = -1; - var length = array.length; - while (++index < length) { - if (array[index] == value) { - return true; - } - } - return false; - }; - - var merge = function(options, defaults) { - if (!options) { - return defaults; - } - var result = {}; - var key; - for (key in defaults) { - // A `hasOwnProperty` check is not needed here, since only recognized - // option names are used anyway. Any others are ignored. - result[key] = has(options, key) ? options[key] : defaults[key]; - } - return result; - }; - - // Modified version of `ucs2encode`; see http://mths.be/punycode. - var codePointToSymbol = function(codePoint, strict) { - var output = ''; - if ((codePoint >= 0xD800 && codePoint <= 0xDFFF) || codePoint > 0x10FFFF) { - // See issue #4: - // “Otherwise, if the number is in the range 0xD800 to 0xDFFF or is - // greater than 0x10FFFF, then this is a parse error. Return a U+FFFD - // REPLACEMENT CHARACTER.” - if (strict) { - parseError('character reference outside the permissible Unicode range'); - } - return '\uFFFD'; - } - if (has(decodeMapNumeric, codePoint)) { - if (strict) { - parseError('disallowed character reference'); - } - return decodeMapNumeric[codePoint]; - } - if (strict && contains(invalidReferenceCodePoints, codePoint)) { - parseError('disallowed character reference'); - } - if (codePoint > 0xFFFF) { - codePoint -= 0x10000; - output += stringFromCharCode(codePoint >>> 10 & 0x3FF | 0xD800); - codePoint = 0xDC00 | codePoint & 0x3FF; - } - output += stringFromCharCode(codePoint); - return output; - }; - - var hexEscape = function(symbol) { - return '&#x' + symbol.charCodeAt(0).toString(16).toUpperCase() + ';'; - }; - - var parseError = function(message) { - throw Error('Parse error: ' + message); - }; - - /*--------------------------------------------------------------------------*/ - - var encode = function(string, options) { - options = merge(options, encode.options); - var strict = options.strict; - if (strict && regexInvalidRawCodePoint.test(string)) { - parseError('forbidden code point'); - } - var encodeEverything = options.encodeEverything; - var useNamedReferences = options.useNamedReferences; - var allowUnsafeSymbols = options.allowUnsafeSymbols; - if (encodeEverything) { - // Encode ASCII symbols. - string = string.replace(regexAsciiWhitelist, function(symbol) { - // Use named references if requested & possible. - if (useNamedReferences && has(encodeMap, symbol)) { - return '&' + encodeMap[symbol] + ';'; - } - return hexEscape(symbol); - }); - // Shorten a few escapes that represent two symbols, of which at least one - // is within the ASCII range. - if (useNamedReferences) { - string = string - .replace(/>\u20D2/g, '>⃒') - .replace(/<\u20D2/g, '<⃒') - .replace(/fj/g, 'fj'); - } - // Encode non-ASCII symbols. - if (useNamedReferences) { - // Encode non-ASCII symbols that can be replaced with a named reference. - string = string.replace(regexEncodeNonAscii, function(string) { - // Note: there is no need to check `has(encodeMap, string)` here. - return '&' + encodeMap[string] + ';'; - }); - } - // Note: any remaining non-ASCII symbols are handled outside of the `if`. - } else if (useNamedReferences) { - // Apply named character references. - // Encode `<>"'&` using named character references. - if (!allowUnsafeSymbols) { - string = string.replace(regexEscape, function(string) { - return '&' + encodeMap[string] + ';'; // no need to check `has()` here - }); - } - // Shorten escapes that represent two symbols, of which at least one is - // `<>"'&`. - string = string - .replace(/>\u20D2/g, '>⃒') - .replace(/<\u20D2/g, '<⃒'); - // Encode non-ASCII symbols that can be replaced with a named reference. - string = string.replace(regexEncodeNonAscii, function(string) { - // Note: there is no need to check `has(encodeMap, string)` here. - return '&' + encodeMap[string] + ';'; - }); - } else if (!allowUnsafeSymbols) { - // Encode `<>"'&` using hexadecimal escapes, now that they’re not handled - // using named character references. - string = string.replace(regexEscape, hexEscape); - } - return string - // Encode astral symbols. - .replace(regexAstralSymbols, function($0) { - // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - var high = $0.charCodeAt(0); - var low = $0.charCodeAt(1); - var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000; - return '&#x' + codePoint.toString(16).toUpperCase() + ';'; - }) - // Encode any remaining BMP symbols that are not printable ASCII symbols - // using a hexadecimal escape. - .replace(regexBmpWhitelist, hexEscape); - }; - // Expose default options (so they can be overridden globally). - encode.options = { - 'allowUnsafeSymbols': false, - 'encodeEverything': false, - 'strict': false, - 'useNamedReferences': false - }; - - var decode = function(html, options) { - options = merge(options, decode.options); - var strict = options.strict; - if (strict && regexInvalidEntity.test(html)) { - parseError('malformed character reference'); - } - return html.replace(regexDecode, function($0, $1, $2, $3, $4, $5, $6, $7) { - var codePoint; - var semicolon; - var hexDigits; - var reference; - var next; - if ($1) { - // Decode decimal escapes, e.g. `𝌆`. - codePoint = $1; - semicolon = $2; - if (strict && !semicolon) { - parseError('character reference was not terminated by a semicolon'); - } - return codePointToSymbol(codePoint, strict); - } - if ($3) { - // Decode hexadecimal escapes, e.g. `𝌆`. - hexDigits = $3; - semicolon = $4; - if (strict && !semicolon) { - parseError('character reference was not terminated by a semicolon'); - } - codePoint = parseInt(hexDigits, 16); - return codePointToSymbol(codePoint, strict); - } - if ($5) { - // Decode named character references with trailing `;`, e.g. `©`. - reference = $5; - if (has(decodeMap, reference)) { - return decodeMap[reference]; - } else { - // Ambiguous ampersand; see http://mths.be/notes/ambiguous-ampersands. - if (strict) { - parseError( - 'named character reference was not terminated by a semicolon' - ); - } - return $0; - } - } - // If we’re still here, it’s a legacy reference for sure. No need for an - // extra `if` check. - // Decode named character references without trailing `;`, e.g. `&` - // This is only a parse error if it gets converted to `&`, or if it is - // followed by `=` in an attribute context. - reference = $6; - next = $7; - if (next && options.isAttributeValue) { - if (strict && next == '=') { - parseError('`&` did not start a character reference'); - } - return $0; - } else { - if (strict) { - parseError( - 'named character reference was not terminated by a semicolon' - ); - } - // Note: there is no need to check `has(decodeMapLegacy, reference)`. - return decodeMapLegacy[reference] + (next || ''); - } - }); - }; - // Expose default options (so they can be overridden globally). - decode.options = { - 'isAttributeValue': false, - 'strict': false - }; - - var escape = function(string) { - return string.replace(regexEscape, function($0) { - // Note: there is no need to check `has(escapeMap, $0)` here. - return escapeMap[$0]; - }); - }; - - /*--------------------------------------------------------------------------*/ - - var he = { - 'version': '0.5.0', - 'encode': encode, - 'decode': decode, - 'escape': escape, - 'unescape': decode - }; - - // Some AMD build optimizers, like r.js, check for specific condition patterns - // like the following: - if ( - typeof define == 'function' && - typeof define.amd == 'object' && - define.amd - ) { - define(function() { - return he; - }); - } else if (freeExports && !freeExports.nodeType) { - if (freeModule) { // in Node.js or RingoJS v0.8.0+ - freeModule.exports = he; - } else { // in Narwhal or RingoJS v0.7.0- - for (var key in he) { - has(he, key) && (freeExports[key] = he[key]); - } - } - } else { // in Rhino or a web browser - root.he = he; - } - -}(this)); - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],105:[function(require,module,exports){ +},{}],82:[function(require,module,exports){ //! moment.js -//! version : 2.10.6 +//! version : 2.12.0 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com -(function (global, factory) { +;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory() @@ -18340,7 +17982,7 @@ module.exports=require(52) } function isArray(input) { - return Object.prototype.toString.call(input) === '[object Array]'; + return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; } function isDate(input) { @@ -18438,39 +18080,45 @@ module.exports=require(52) return m; } + function isUndefined(input) { + return input === void 0; + } + + // Plugins that add properties should also add the key here (null value), + // so we can properly clone ourselves. var momentProperties = utils_hooks__hooks.momentProperties = []; function copyConfig(to, from) { var i, prop, val; - if (typeof from._isAMomentObject !== 'undefined') { + if (!isUndefined(from._isAMomentObject)) { to._isAMomentObject = from._isAMomentObject; } - if (typeof from._i !== 'undefined') { + if (!isUndefined(from._i)) { to._i = from._i; } - if (typeof from._f !== 'undefined') { + if (!isUndefined(from._f)) { to._f = from._f; } - if (typeof from._l !== 'undefined') { + if (!isUndefined(from._l)) { to._l = from._l; } - if (typeof from._strict !== 'undefined') { + if (!isUndefined(from._strict)) { to._strict = from._strict; } - if (typeof from._tzm !== 'undefined') { + if (!isUndefined(from._tzm)) { to._tzm = from._tzm; } - if (typeof from._isUTC !== 'undefined') { + if (!isUndefined(from._isUTC)) { to._isUTC = from._isUTC; } - if (typeof from._offset !== 'undefined') { + if (!isUndefined(from._offset)) { to._offset = from._offset; } - if (typeof from._pf !== 'undefined') { + if (!isUndefined(from._pf)) { to._pf = getParsingFlags(from); } - if (typeof from._locale !== 'undefined') { + if (!isUndefined(from._locale)) { to._locale = from._locale; } @@ -18478,7 +18126,7 @@ module.exports=require(52) for (i in momentProperties) { prop = momentProperties[i]; val = from[prop]; - if (typeof val !== 'undefined') { + if (!isUndefined(val)) { to[prop] = val; } } @@ -18525,6 +18173,7 @@ module.exports=require(52) return value; } + // compare two arrays, return the number of differences function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), @@ -18539,9 +18188,85 @@ module.exports=require(52) return diffs + lengthDiff; } - function Locale() { + function warn(msg) { + if (utils_hooks__hooks.suppressDeprecationWarnings === false && + (typeof console !== 'undefined') && console.warn) { + console.warn('Deprecation warning: ' + msg); + } } + function deprecate(msg, fn) { + var firstTime = true; + + return extend(function () { + if (firstTime) { + warn(msg + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\n' + (new Error()).stack); + firstTime = false; + } + return fn.apply(this, arguments); + }, fn); + } + + var deprecations = {}; + + function deprecateSimple(name, msg) { + if (!deprecations[name]) { + warn(msg); + deprecations[name] = true; + } + } + + utils_hooks__hooks.suppressDeprecationWarnings = false; + + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + + function isObject(input) { + return Object.prototype.toString.call(input) === '[object Object]'; + } + + function locale_set__set (config) { + var prop, i; + for (i in config) { + prop = config[i]; + if (isFunction(prop)) { + this[i] = prop; + } else { + this['_' + i] = prop; + } + } + this._config = config; + // Lenient ordinal parsing accepts just a number in addition to + // number + (possibly) stuff coming from _ordinalParseLenient. + this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source); + } + + function mergeConfigs(parentConfig, childConfig) { + var res = extend({}, parentConfig), prop; + for (prop in childConfig) { + if (hasOwnProp(childConfig, prop)) { + if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { + res[prop] = {}; + extend(res[prop], parentConfig[prop]); + extend(res[prop], childConfig[prop]); + } else if (childConfig[prop] != null) { + res[prop] = childConfig[prop]; + } else { + delete res[prop]; + } + } + } + return res; + } + + function Locale(config) { + if (config != null) { + this.set(config); + } + } + + // internal storage for locale config files var locales = {}; var globalLocale; @@ -18579,7 +18304,7 @@ module.exports=require(52) function loadLocale(name) { var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node - if (!locales[name] && typeof module !== 'undefined' && + if (!locales[name] && (typeof module !== 'undefined') && module && module.exports) { try { oldLocale = globalLocale._abbr; @@ -18598,7 +18323,7 @@ module.exports=require(52) function locale_locales__getSetGlobalLocale (key, values) { var data; if (key) { - if (typeof values === 'undefined') { + if (isUndefined(values)) { data = locale_locales__getLocale(key); } else { @@ -18614,11 +18339,25 @@ module.exports=require(52) return globalLocale._abbr; } - function defineLocale (name, values) { - if (values !== null) { - values.abbr = name; - locales[name] = locales[name] || new Locale(); - locales[name].set(values); + function defineLocale (name, config) { + if (config !== null) { + config.abbr = name; + if (locales[name] != null) { + deprecateSimple('defineLocaleOverride', + 'use moment.updateLocale(localeName, config) to change ' + + 'an existing locale. moment.defineLocale(localeName, ' + + 'config) should only be used for creating a new locale'); + config = mergeConfigs(locales[name]._config, config); + } else if (config.parentLocale != null) { + if (locales[config.parentLocale] != null) { + config = mergeConfigs(locales[config.parentLocale]._config, config); + } else { + // treat as if there is no base config + deprecateSimple('parentLocaleUndefined', + 'specified parentLocale is not defined yet'); + } + } + locales[name] = new Locale(config); // backwards compat for now: also set the locale locale_locales__getSetGlobalLocale(name); @@ -18631,6 +18370,31 @@ module.exports=require(52) } } + function updateLocale(name, config) { + if (config != null) { + var locale; + if (locales[name] != null) { + config = mergeConfigs(locales[name]._config, config); + } + locale = new Locale(config); + locale.parentLocale = locales[name]; + locales[name] = locale; + + // backwards compat for now: also set the locale + locale_locales__getSetGlobalLocale(name); + } else { + // pass null for config to unupdate, useful for tests + if (locales[name] != null) { + if (locales[name].parentLocale != null) { + locales[name] = locales[name].parentLocale; + } else if (locales[name] != null) { + delete locales[name]; + } + } + } + return locales[name]; + } + // returns locale data function locale_locales__getLocale (key) { var locale; @@ -18655,6 +18419,10 @@ module.exports=require(52) return chooseLocale(key); } + function locale_locales__listLocales() { + return Object.keys(locales); + } + var aliases = {}; function addUnitAlias (unit, shorthand) { @@ -18696,11 +18464,14 @@ module.exports=require(52) } function get_set__get (mom, unit) { - return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit](); + return mom.isValid() ? + mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; } function get_set__set (mom, unit, value) { - return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + if (mom.isValid()) { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + } } // MOMENTS @@ -18713,7 +18484,7 @@ module.exports=require(52) } } else { units = normalizeUnits(units); - if (typeof this[units] === 'function') { + if (isFunction(this[units])) { return this[units](value); } } @@ -18728,7 +18499,7 @@ module.exports=require(52) Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; } - var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; + var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; @@ -18824,6 +18595,8 @@ module.exports=require(52) var match4 = /\d{4}/; // 0000 - 9999 var match6 = /[+-]?\d{6}/; // -999999 - 999999 var match1to2 = /\d\d?/; // 0 - 99 + var match3to4 = /\d\d\d\d?/; // 999 - 9999 + var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 var match1to3 = /\d{1,3}/; // 0 - 999 var match1to4 = /\d{1,4}/; // 0 - 9999 var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 @@ -18832,23 +18605,19 @@ module.exports=require(52) var matchSigned = /[+-]?\d+/; // -inf - inf var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z + var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. + // includes scottish gaelic two word and hyphenated months var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; + var regexes = {}; - function isFunction (sth) { - // https://github.com/moment/moment/issues/2325 - return typeof sth === 'function' && - Object.prototype.toString.call(sth) === '[object Function]'; - } - - function addRegexToken (token, regex, strictRegex) { - regexes[token] = isFunction(regex) ? regex : function (isStrict) { + regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { return (isStrict && strictRegex) ? strictRegex : regex; }; } @@ -18863,9 +18632,13 @@ module.exports=require(52) // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function unescapeFormat(s) { - return s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { + return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; - }).replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + })); + } + + function regexEscape(s) { + return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } var tokens = {}; @@ -18905,6 +18678,8 @@ module.exports=require(52) var MINUTE = 4; var SECOND = 5; var MILLISECOND = 6; + var WEEK = 7; + var WEEKDAY = 8; function daysInMonth(year, month) { return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); @@ -18932,8 +18707,12 @@ module.exports=require(52) addRegexToken('M', match1to2); addRegexToken('MM', match1to2, match2); - addRegexToken('MMM', matchWord); - addRegexToken('MMMM', matchWord); + addRegexToken('MMM', function (isStrict, locale) { + return locale.monthsShortRegex(isStrict); + }); + addRegexToken('MMMM', function (isStrict, locale) { + return locale.monthsRegex(isStrict); + }); addParseToken(['M', 'MM'], function (input, array) { array[MONTH] = toInt(input) - 1; @@ -18951,14 +18730,17 @@ module.exports=require(52) // LOCALES + var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/; var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); - function localeMonths (m) { - return this._months[m.month()]; + function localeMonths (m, format) { + return isArray(this._months) ? this._months[m.month()] : + this._months[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); - function localeMonthsShort (m) { - return this._monthsShort[m.month()]; + function localeMonthsShort (m, format) { + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : + this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } function localeMonthsParse (monthName, format, strict) { @@ -18997,12 +18779,20 @@ module.exports=require(52) function setMonth (mom, value) { var dayOfMonth; - // TODO: Move this out of here! + if (!mom.isValid()) { + // No op + return mom; + } + if (typeof value === 'string') { - value = mom.localeData().monthsParse(value); - // TODO: Another silent failure? - if (typeof value !== 'number') { - return mom; + if (/^\d+$/.test(value)) { + value = toInt(value); + } else { + value = mom.localeData().monthsParse(value); + // TODO: Another silent failure? + if (typeof value !== 'number') { + return mom; + } } } @@ -19025,6 +18815,72 @@ module.exports=require(52) return daysInMonth(this.year(), this.month()); } + var defaultMonthsShortRegex = matchWord; + function monthsShortRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsShortStrictRegex; + } else { + return this._monthsShortRegex; + } + } else { + return this._monthsShortStrictRegex && isStrict ? + this._monthsShortStrictRegex : this._monthsShortRegex; + } + } + + var defaultMonthsRegex = matchWord; + function monthsRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsStrictRegex; + } else { + return this._monthsRegex; + } + } else { + return this._monthsStrictRegex && isStrict ? + this._monthsStrictRegex : this._monthsRegex; + } + } + + function computeMonthsParse () { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var shortPieces = [], longPieces = [], mixedPieces = [], + i, mom; + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + mom = create_utc__createUTC([2000, i]); + shortPieces.push(this.monthsShort(mom, '')); + longPieces.push(this.months(mom, '')); + mixedPieces.push(this.months(mom, '')); + mixedPieces.push(this.monthsShort(mom, '')); + } + // Sorting makes sure if one month (or abbr) is a prefix of another it + // will match the longer piece. + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + for (i = 0; i < 12; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + + this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._monthsShortRegex = this._monthsRegex; + this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')$', 'i'); + this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')$', 'i'); + } + function checkOverflow (m) { var overflow; var a = m._a; @@ -19042,6 +18898,12 @@ module.exports=require(52) if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { overflow = DATE; } + if (getParsingFlags(m)._overflowWeeks && overflow === -1) { + overflow = WEEK; + } + if (getParsingFlags(m)._overflowWeekday && overflow === -1) { + overflow = WEEKDAY; + } getParsingFlags(m).overflow = overflow; } @@ -19049,51 +18911,39 @@ module.exports=require(52) return m; } - function warn(msg) { - if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { - console.warn('Deprecation warning: ' + msg); - } - } + // iso 8601 regex + // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) + var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; + var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; - function deprecate(msg, fn) { - var firstTime = true; - - return extend(function () { - if (firstTime) { - warn(msg + '\n' + (new Error()).stack); - firstTime = false; - } - return fn.apply(this, arguments); - }, fn); - } - - var deprecations = {}; - - function deprecateSimple(name, msg) { - if (!deprecations[name]) { - warn(msg); - deprecations[name] = true; - } - } - - utils_hooks__hooks.suppressDeprecationWarnings = false; - - var from_string__isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; + var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; var isoDates = [ - ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], - ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], - ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], - ['GGGG-[W]WW', /\d{4}-W\d{2}/], - ['YYYY-DDD', /\d{4}-\d{3}/] + ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], + ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], + ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], + ['GGGG-[W]WW', /\d{4}-W\d\d/, false], + ['YYYY-DDD', /\d{4}-\d{3}/], + ['YYYY-MM', /\d{4}-\d\d/, false], + ['YYYYYYMMDD', /[+-]\d{10}/], + ['YYYYMMDD', /\d{8}/], + // YYYYMM is NOT allowed by the standard + ['GGGG[W]WWE', /\d{4}W\d{3}/], + ['GGGG[W]WW', /\d{4}W\d{2}/, false], + ['YYYYDDD', /\d{7}/] ]; // iso time formats and regexes var isoTimes = [ - ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], - ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], - ['HH:mm', /(T| )\d\d:\d\d/], - ['HH', /(T| )\d\d/] + ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], + ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], + ['HH:mm:ss', /\d\d:\d\d:\d\d/], + ['HH:mm', /\d\d:\d\d/], + ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], + ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], + ['HHmmss', /\d\d\d\d\d\d/], + ['HHmm', /\d\d\d\d/], + ['HH', /\d\d/] ]; var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; @@ -19102,26 +18952,49 @@ module.exports=require(52) function configFromISO(config) { var i, l, string = config._i, - match = from_string__isoRegex.exec(string); + match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), + allowTime, dateFormat, timeFormat, tzFormat; if (match) { getParsingFlags(config).iso = true; + for (i = 0, l = isoDates.length; i < l; i++) { - if (isoDates[i][1].exec(string)) { - config._f = isoDates[i][0]; + if (isoDates[i][1].exec(match[1])) { + dateFormat = isoDates[i][0]; + allowTime = isoDates[i][2] !== false; break; } } - for (i = 0, l = isoTimes.length; i < l; i++) { - if (isoTimes[i][1].exec(string)) { - // match[6] should be 'T' or space - config._f += (match[6] || ' ') + isoTimes[i][0]; - break; + if (dateFormat == null) { + config._isValid = false; + return; + } + if (match[3]) { + for (i = 0, l = isoTimes.length; i < l; i++) { + if (isoTimes[i][1].exec(match[3])) { + // match[2] should be 'T' or space + timeFormat = (match[2] || ' ') + isoTimes[i][0]; + break; + } + } + if (timeFormat == null) { + config._isValid = false; + return; } } - if (string.match(matchOffset)) { - config._f += 'Z'; + if (!allowTime && timeFormat != null) { + config._isValid = false; + return; } + if (match[4]) { + if (tzRegex.exec(match[4])) { + tzFormat = 'Z'; + } else { + config._isValid = false; + return; + } + } + config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; @@ -19159,8 +19032,8 @@ module.exports=require(52) //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply var date = new Date(y, m, d, h, M, s, ms); - //the date constructor doesn't accept years < 1970 - if (y < 1970) { + //the date constructor remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { date.setFullYear(y); } return date; @@ -19168,12 +19041,21 @@ module.exports=require(52) function createUTCDate (y) { var date = new Date(Date.UTC.apply(null, arguments)); - if (y < 1970) { + + //the Date.UTC function remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } return date; } + // FORMATTING + + addFormatToken('Y', 0, 0, function () { + var y = this.year(); + return y <= 9999 ? '' + y : '+' + y; + }); + addFormatToken(0, ['YY', 2], 0, function () { return this.year() % 100; }); @@ -19201,6 +19083,9 @@ module.exports=require(52) addParseToken('YY', function (input, array) { array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input); }); + addParseToken('Y', function (input, array) { + array[YEAR] = parseInt(input, 10); + }); // HELPERS @@ -19226,124 +19111,66 @@ module.exports=require(52) return isLeapYear(this.year()); } - addFormatToken('w', ['ww', 2], 'wo', 'week'); - addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + // start-of-first-week - start-of-year + function firstWeekOffset(year, dow, doy) { + var // first-week day -- which january is always in the first week (4 for iso, 1 for other) + fwd = 7 + dow - doy, + // first-week day local weekday -- which local weekday is fwd + fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; - // ALIASES - - addUnitAlias('week', 'w'); - addUnitAlias('isoWeek', 'W'); - - // PARSING - - addRegexToken('w', match1to2); - addRegexToken('ww', match1to2, match2); - addRegexToken('W', match1to2); - addRegexToken('WW', match1to2, match2); - - addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { - week[token.substr(0, 1)] = toInt(input); - }); - - // HELPERS - - // firstDayOfWeek 0 = sun, 6 = sat - // the day of the week that starts the week - // (usually sunday or monday) - // firstDayOfWeekOfYear 0 = sun, 6 = sat - // the first week is the week that contains the first - // of this day of the week - // (eg. ISO weeks use thursday (4)) - function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { - var end = firstDayOfWeekOfYear - firstDayOfWeek, - daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), - adjustedMoment; - - - if (daysToDayOfWeek > end) { - daysToDayOfWeek -= 7; - } - - if (daysToDayOfWeek < end - 7) { - daysToDayOfWeek += 7; - } - - adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd'); - return { - week: Math.ceil(adjustedMoment.dayOfYear() / 7), - year: adjustedMoment.year() - }; + return -fwdlw + fwd - 1; } - // LOCALES - - function localeWeek (mom) { - return weekOfYear(mom, this._week.dow, this._week.doy).week; - } - - var defaultLocaleWeek = { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - }; - - function localeFirstDayOfWeek () { - return this._week.dow; - } - - function localeFirstDayOfYear () { - return this._week.doy; - } - - // MOMENTS - - function getSetWeek (input) { - var week = this.localeData().week(this); - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - function getSetISOWeek (input) { - var week = weekOfYear(this, 1, 4).week; - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); - - // ALIASES - - addUnitAlias('dayOfYear', 'DDD'); - - // PARSING - - addRegexToken('DDD', match1to3); - addRegexToken('DDDD', match3); - addParseToken(['DDD', 'DDDD'], function (input, array, config) { - config._dayOfYear = toInt(input); - }); - - // HELPERS - //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { - var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear; - if (d < firstDayOfWeek) { - d += 7; + function dayOfYearFromWeeks(year, week, weekday, dow, doy) { + var localWeekday = (7 + weekday - dow) % 7, + weekOffset = firstWeekOffset(year, dow, doy), + dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, + resYear, resDayOfYear; + + if (dayOfYear <= 0) { + resYear = year - 1; + resDayOfYear = daysInYear(resYear) + dayOfYear; + } else if (dayOfYear > daysInYear(year)) { + resYear = year + 1; + resDayOfYear = dayOfYear - daysInYear(year); + } else { + resYear = year; + resDayOfYear = dayOfYear; } - weekday = weekday != null ? 1 * weekday : firstDayOfWeek; - - dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday; - return { - year: dayOfYear > 0 ? year : year - 1, - dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear + year: resYear, + dayOfYear: resDayOfYear }; } - // MOMENTS + function weekOfYear(mom, dow, doy) { + var weekOffset = firstWeekOffset(mom.year(), dow, doy), + week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, + resWeek, resYear; - function getSetDayOfYear (input) { - var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; - return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + if (week < 1) { + resYear = mom.year() - 1; + resWeek = week + weeksInYear(resYear, dow, doy); + } else if (week > weeksInYear(mom.year(), dow, doy)) { + resWeek = week - weeksInYear(mom.year(), dow, doy); + resYear = mom.year() + 1; + } else { + resYear = mom.year(); + resWeek = week; + } + + return { + week: resWeek, + year: resYear + }; + } + + function weeksInYear(year, dow, doy) { + var weekOffset = firstWeekOffset(year, dow, doy), + weekOffsetNext = firstWeekOffset(year + 1, dow, doy); + return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; } // Pick the first defined of two or three arguments. @@ -19358,11 +19185,12 @@ module.exports=require(52) } function currentDateArray(config) { - var now = new Date(); + // hooks is actually the exported moment object + var nowValue = new Date(utils_hooks__hooks.now()); if (config._useUTC) { - return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()]; + return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; } - return [now.getFullYear(), now.getMonth(), now.getDate()]; + return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; } // convert an array to a date. @@ -19432,7 +19260,7 @@ module.exports=require(52) } function dayOfYearFromWeekInfo(config) { - var w, weekYear, week, weekday, dow, doy, temp; + var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; w = config._w; if (w.GG != null || w.W != null || w.E != null) { @@ -19446,6 +19274,9 @@ module.exports=require(52) weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year); week = defaults(w.W, 1); weekday = defaults(w.E, 1); + if (weekday < 1 || weekday > 7) { + weekdayOverflow = true; + } } else { dow = config._locale._week.dow; doy = config._locale._week.doy; @@ -19456,23 +19287,32 @@ module.exports=require(52) if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; - if (weekday < dow) { - ++week; + if (weekday < 0 || weekday > 6) { + weekdayOverflow = true; } } else if (w.e != null) { // local weekday -- counting starts from begining of week weekday = w.e + dow; + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; + } } else { // default to begining of week weekday = dow; } } - temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow); - - config._a[YEAR] = temp.year; - config._dayOfYear = temp.dayOfYear; + if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { + getParsingFlags(config)._overflowWeeks = true; + } else if (weekdayOverflow != null) { + getParsingFlags(config)._overflowWeekday = true; + } else { + temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); + config._a[YEAR] = temp.year; + config._dayOfYear = temp.dayOfYear; + } } + // constant that refers to the ISO standard utils_hooks__hooks.ISO_8601 = function () {}; // date from string and format string @@ -19497,6 +19337,8 @@ module.exports=require(52) for (i = 0; i < tokens.length; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; + // console.log('token', token, 'parsedInput', parsedInput, + // 'regex', getParseRegexForToken(token, config)); if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { @@ -19565,6 +19407,7 @@ module.exports=require(52) } } + // date from string and array of format strings function configFromStringAndArray(config) { var tempConfig, bestMoment, @@ -19615,7 +19458,9 @@ module.exports=require(52) } var i = normalizeObjectUnits(config._i); - config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond]; + config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { + return obj && parseInt(obj, 10); + }); configFromArray(config); } @@ -19657,13 +19502,17 @@ module.exports=require(52) configFromInput(config); } + if (!valid__isValid(config)) { + config._d = null; + } + return config; } function configFromInput(config) { var input = config._i; if (input === undefined) { - config._d = new Date(); + config._d = new Date(utils_hooks__hooks.now()); } else if (isDate(input)) { config._d = new Date(+input); } else if (typeof input === 'string') { @@ -19707,18 +19556,26 @@ module.exports=require(52) } var prototypeMin = deprecate( - 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', + 'moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); - return other < this ? this : other; + if (this.isValid() && other.isValid()) { + return other < this ? this : other; + } else { + return valid__createInvalid(); + } } ); var prototypeMax = deprecate( - 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', + 'moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); - return other > this ? this : other; + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return valid__createInvalid(); + } } ); @@ -19757,6 +19614,10 @@ module.exports=require(52) return pickBy('isAfter', args); } + var now = function () { + return Date.now ? Date.now() : +(new Date()); + }; + function Duration (duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, @@ -19796,6 +19657,8 @@ module.exports=require(52) return obj instanceof Duration; } + // FORMATTING + function offset (token, separator) { addFormatToken(token, 0, 0, function () { var offset = this.utcOffset(); @@ -19813,11 +19676,11 @@ module.exports=require(52) // PARSING - addRegexToken('Z', matchOffset); - addRegexToken('ZZ', matchOffset); + addRegexToken('Z', matchShortOffset); + addRegexToken('ZZ', matchShortOffset); addParseToken(['Z', 'ZZ'], function (input, array, config) { config._useUTC = true; - config._tzm = offsetFromString(input); + config._tzm = offsetFromString(matchShortOffset, input); }); // HELPERS @@ -19827,8 +19690,8 @@ module.exports=require(52) // '-1530' > ['-15', '30'] var chunkOffset = /([\+\-]|\d\d)/gi; - function offsetFromString(string) { - var matches = ((string || '').match(matchOffset) || []); + function offsetFromString(matcher, string) { + var matches = ((string || '').match(matcher) || []); var chunk = matches[matches.length - 1] || []; var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; var minutes = +(parts[1] * 60) + toInt(parts[2]); @@ -19878,11 +19741,13 @@ module.exports=require(52) function getSetOffset (input, keepLocalTime) { var offset = this._offset || 0, localAdjust; + if (!this.isValid()) { + return input != null ? this : NaN; + } if (input != null) { if (typeof input === 'string') { - input = offsetFromString(input); - } - if (Math.abs(input) < 16) { + input = offsetFromString(matchShortOffset, input); + } else if (Math.abs(input) < 16) { input = input * 60; } if (!this._isUTC && keepLocalTime) { @@ -19942,12 +19807,15 @@ module.exports=require(52) if (this._tzm) { this.utcOffset(this._tzm); } else if (typeof this._i === 'string') { - this.utcOffset(offsetFromString(this._i)); + this.utcOffset(offsetFromString(matchOffset, this._i)); } return this; } function hasAlignedHourOffset (input) { + if (!this.isValid()) { + return false; + } input = input ? local__createLocal(input).utcOffset() : 0; return (this.utcOffset() - input) % 60 === 0; @@ -19961,7 +19829,7 @@ module.exports=require(52) } function isDaylightSavingTimeShifted () { - if (typeof this._isDSTShifted !== 'undefined') { + if (!isUndefined(this._isDSTShifted)) { return this._isDSTShifted; } @@ -19982,22 +19850,24 @@ module.exports=require(52) } function isLocal () { - return !this._isUTC; + return this.isValid() ? !this._isUTC : false; } function isUtcOffset () { - return this._isUTC; + return this.isValid() ? this._isUTC : false; } function isUtc () { - return this._isUTC && this._offset === 0; + return this.isValid() ? this._isUTC && this._offset === 0 : false; } - var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; + // ASP.NET json date format regex + var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/; // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere - var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; + // and further modified to allow for strings containing both week and day + var isoRegex = /^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/; function create__createDuration (input, key) { var duration = input, @@ -20030,16 +19900,16 @@ module.exports=require(52) s : toInt(match[SECOND]) * sign, ms : toInt(match[MILLISECOND]) * sign }; - } else if (!!(match = create__isoRegex.exec(input))) { + } else if (!!(match = isoRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; duration = { y : parseIso(match[2], sign), M : parseIso(match[3], sign), - d : parseIso(match[4], sign), - h : parseIso(match[5], sign), - m : parseIso(match[6], sign), - s : parseIso(match[7], sign), - w : parseIso(match[8], sign) + w : parseIso(match[4], sign), + d : parseIso(match[5], sign), + h : parseIso(match[6], sign), + m : parseIso(match[7], sign), + s : parseIso(match[8], sign) }; } else if (duration == null) {// checks for null or undefined duration = {}; @@ -20087,6 +19957,10 @@ module.exports=require(52) function momentsDifference(base, other) { var res; + if (!(base.isValid() && other.isValid())) { + return {milliseconds: 0, months: 0}; + } + other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); @@ -20099,6 +19973,15 @@ module.exports=require(52) return res; } + function absRound (number) { + if (number < 0) { + return Math.round(-1 * number) * -1; + } else { + return Math.round(number); + } + } + + // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { var dur, tmp; @@ -20117,8 +20000,14 @@ module.exports=require(52) function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, - days = duration._days, - months = duration._months; + days = absRound(duration._days), + months = absRound(duration._months); + + if (!mom.isValid()) { + // No op + return; + } + updateOffset = updateOffset == null ? true : updateOffset; if (milliseconds) { @@ -20150,7 +20039,10 @@ module.exports=require(52) diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; - return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now))); + + var output = formats && (isFunction(formats[format]) ? formats[format]() : formats[format]); + + return this.format(output || this.localeData().calendar(format, this, local__createLocal(now))); } function clone () { @@ -20158,26 +20050,28 @@ module.exports=require(52) } function isAfter (input, units) { - var inputMs; - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this > +input; + return +this > +localInput; } else { - inputMs = isMoment(input) ? +input : +local__createLocal(input); - return inputMs < +this.clone().startOf(units); + return +localInput < +this.clone().startOf(units); } } function isBefore (input, units) { - var inputMs; - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this < +input; + return +this < +localInput; } else { - inputMs = isMoment(input) ? +input : +local__createLocal(input); - return +this.clone().endOf(units) < inputMs; + return +this.clone().endOf(units) < +localInput; } } @@ -20186,22 +20080,45 @@ module.exports=require(52) } function isSame (input, units) { - var inputMs; + var localInput = isMoment(input) ? input : local__createLocal(input), + inputMs; + if (!(this.isValid() && localInput.isValid())) { + return false; + } units = normalizeUnits(units || 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this === +input; + return +this === +localInput; } else { - inputMs = +local__createLocal(input); + inputMs = +localInput; return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units)); } } + function isSameOrAfter (input, units) { + return this.isSame(input, units) || this.isAfter(input,units); + } + + function isSameOrBefore (input, units) { + return this.isSame(input, units) || this.isBefore(input,units); + } + function diff (input, units, asFloat) { - var that = cloneWithOffset(input, this), - zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4, + var that, + zoneDelta, delta, output; + if (!this.isValid()) { + return NaN; + } + + that = cloneWithOffset(input, this); + + if (!that.isValid()) { + return NaN; + } + + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + units = normalizeUnits(units); if (units === 'year' || units === 'month' || units === 'quarter') { @@ -20252,7 +20169,7 @@ module.exports=require(52) function moment_format__toISOString () { var m = this.clone().utc(); if (0 < m.year() && m.year() <= 9999) { - if ('function' === typeof Date.prototype.toISOString) { + if (isFunction(Date.prototype.toISOString)) { // native implementation is ~50x faster, use it when we can return this.toDate().toISOString(); } else { @@ -20269,10 +20186,13 @@ module.exports=require(52) } function from (time, withoutSuffix) { - if (!this.isValid()) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { return this.localeData().invalidDate(); } - return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); } function fromNow (withoutSuffix) { @@ -20280,16 +20200,22 @@ module.exports=require(52) } function to (time, withoutSuffix) { - if (!this.isValid()) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { return this.localeData().invalidDate(); } - return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); } function toNow (withoutSuffix) { return this.to(local__createLocal(), withoutSuffix); } + // If passed a locale key, it will set the locale for this + // instance. Otherwise, it will return the locale configuration + // variables for this instance. function locale (key) { var newLocaleData; @@ -20400,6 +20326,11 @@ module.exports=require(52) }; } + function toJSON () { + // new Date(NaN).toJSON() === null + return this.isValid() ? this.toISOString() : null; + } + function moment_valid__isValid () { return valid__isValid(this); } @@ -20412,6 +20343,18 @@ module.exports=require(52) return getParsingFlags(this).overflow; } + function creationData() { + return { + input: this._i, + format: this._f, + locale: this._locale, + isUTC: this._isUTC, + strict: this._strict + }; + } + + // FORMATTING + addFormatToken(0, ['gg', 2], 0, function () { return this.weekYear() % 100; }); @@ -20453,22 +20396,20 @@ module.exports=require(52) week[token] = utils_hooks__hooks.parseTwoDigitYear(input); }); - // HELPERS - - function weeksInYear(year, dow, doy) { - return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week; - } - // MOMENTS function getSetWeekYear (input) { - var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; - return input == null ? year : this.add((input - year), 'y'); + return getSetWeekYearHelper.call(this, + input, + this.week(), + this.weekday(), + this.localeData()._week.dow, + this.localeData()._week.doy); } function getSetISOWeekYear (input) { - var year = weekOfYear(this, 1, 4).year; - return input == null ? year : this.add((input - year), 'y'); + return getSetWeekYearHelper.call(this, + input, this.isoWeek(), this.isoWeekday(), 1, 4); } function getISOWeeksInYear () { @@ -20480,7 +20421,32 @@ module.exports=require(52) return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } - addFormatToken('Q', 0, 0, 'quarter'); + function getSetWeekYearHelper(input, week, weekday, dow, doy) { + var weeksTarget; + if (input == null) { + return weekOfYear(this, dow, doy).year; + } else { + weeksTarget = weeksInYear(input, dow, doy); + if (week > weeksTarget) { + week = weeksTarget; + } + return setWeekAll.call(this, input, week, weekday, dow, doy); + } + } + + function setWeekAll(weekYear, week, weekday, dow, doy) { + var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), + date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); + + this.year(date.getUTCFullYear()); + this.month(date.getUTCMonth()); + this.date(date.getUTCDate()); + return this; + } + + // FORMATTING + + addFormatToken('Q', 0, 'Qo', 'quarter'); // ALIASES @@ -20499,6 +20465,62 @@ module.exports=require(52) return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); } + // FORMATTING + + addFormatToken('w', ['ww', 2], 'wo', 'week'); + addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + + // ALIASES + + addUnitAlias('week', 'w'); + addUnitAlias('isoWeek', 'W'); + + // PARSING + + addRegexToken('w', match1to2); + addRegexToken('ww', match1to2, match2); + addRegexToken('W', match1to2); + addRegexToken('WW', match1to2, match2); + + addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { + week[token.substr(0, 1)] = toInt(input); + }); + + // HELPERS + + // LOCALES + + function localeWeek (mom) { + return weekOfYear(mom, this._week.dow, this._week.doy).week; + } + + var defaultLocaleWeek = { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. + }; + + function localeFirstDayOfWeek () { + return this._week.dow; + } + + function localeFirstDayOfYear () { + return this._week.doy; + } + + // MOMENTS + + function getSetWeek (input) { + var week = this.localeData().week(this); + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + function getSetISOWeek (input) { + var week = weekOfYear(this, 1, 4).week; + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + // FORMATTING + addFormatToken('D', ['DD', 2], 'Do', 'date'); // ALIASES @@ -20522,6 +20544,8 @@ module.exports=require(52) var getSetDayOfMonth = makeGetSet('Date', true); + // FORMATTING + addFormatToken('d', 0, 'do', 'day'); addFormatToken('dd', 0, 0, function (format) { @@ -20554,8 +20578,8 @@ module.exports=require(52) addRegexToken('ddd', matchWord); addRegexToken('dddd', matchWord); - addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) { - var weekday = config._locale.weekdaysParse(input); + addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { + var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid if (weekday != null) { week.d = weekday; @@ -20590,8 +20614,9 @@ module.exports=require(52) // LOCALES var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); - function localeWeekdays (m) { - return this._weekdays[m.day()]; + function localeWeekdays (m, format) { + return isArray(this._weekdays) ? this._weekdays[m.day()] : + this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()]; } var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); @@ -20604,20 +20629,37 @@ module.exports=require(52) return this._weekdaysMin[m.day()]; } - function localeWeekdaysParse (weekdayName) { + function localeWeekdaysParse (weekdayName, format, strict) { var i, mom, regex; - this._weekdaysParse = this._weekdaysParse || []; + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._minWeekdaysParse = []; + this._shortWeekdaysParse = []; + this._fullWeekdaysParse = []; + } for (i = 0; i < 7; i++) { // make the regex if we don't have it already + + mom = local__createLocal([2000, 1]).day(i); + if (strict && !this._fullWeekdaysParse[i]) { + this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); + this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); + this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i'); + } if (!this._weekdaysParse[i]) { - mom = local__createLocal([2000, 1]).day(i); regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex - if (this._weekdaysParse[i].test(weekdayName)) { + if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { return i; } } @@ -20626,6 +20668,9 @@ module.exports=require(52) // MOMENTS function getSetDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); if (input != null) { input = parseWeekday(input, this.localeData()); @@ -20636,20 +20681,73 @@ module.exports=require(52) } function getSetLocaleDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); } function getSetISODayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); } - addFormatToken('H', ['HH', 2], 0, 'hour'); - addFormatToken('h', ['hh', 2], 0, function () { + // FORMATTING + + addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); + + // ALIASES + + addUnitAlias('dayOfYear', 'DDD'); + + // PARSING + + addRegexToken('DDD', match1to3); + addRegexToken('DDDD', match3); + addParseToken(['DDD', 'DDDD'], function (input, array, config) { + config._dayOfYear = toInt(input); + }); + + // HELPERS + + // MOMENTS + + function getSetDayOfYear (input) { + var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; + return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + } + + // FORMATTING + + function hFormat() { return this.hours() % 12 || 12; + } + + addFormatToken('H', ['HH', 2], 0, 'hour'); + addFormatToken('h', ['hh', 2], 0, hFormat); + + addFormatToken('hmm', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); + }); + + addFormatToken('hmmss', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); + }); + + addFormatToken('Hmm', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2); + }); + + addFormatToken('Hmmss', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); }); function meridiem (token, lowercase) { @@ -20678,6 +20776,11 @@ module.exports=require(52) addRegexToken('HH', match1to2, match2); addRegexToken('hh', match1to2, match2); + addRegexToken('hmm', match3to4); + addRegexToken('hmmss', match5to6); + addRegexToken('Hmm', match3to4); + addRegexToken('Hmmss', match5to6); + addParseToken(['H', 'HH'], HOUR); addParseToken(['a', 'A'], function (input, array, config) { config._isPm = config._locale.isPM(input); @@ -20687,6 +20790,32 @@ module.exports=require(52) array[HOUR] = toInt(input); getParsingFlags(config).bigHour = true; }); + addParseToken('hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('Hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + }); + addParseToken('Hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + }); // LOCALES @@ -20714,6 +20843,8 @@ module.exports=require(52) // this rule. var getSetHour = makeGetSet('Hours', true); + // FORMATTING + addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES @@ -20730,6 +20861,8 @@ module.exports=require(52) var getSetMinute = makeGetSet('Minutes', false); + // FORMATTING + addFormatToken('s', ['ss', 2], 0, 'second'); // ALIASES @@ -20746,6 +20879,8 @@ module.exports=require(52) var getSetSecond = makeGetSet('Seconds', false); + // FORMATTING + addFormatToken('S', 0, 0, function () { return ~~(this.millisecond() / 100); }); @@ -20801,6 +20936,8 @@ module.exports=require(52) var getSetMillisecond = makeGetSet('Milliseconds', false); + // FORMATTING + addFormatToken('z', 0, 0, 'zoneAbbr'); addFormatToken('zz', 0, 0, 'zoneName'); @@ -20816,40 +20953,43 @@ module.exports=require(52) var momentPrototype__proto = Moment.prototype; - momentPrototype__proto.add = add_subtract__add; - momentPrototype__proto.calendar = moment_calendar__calendar; - momentPrototype__proto.clone = clone; - momentPrototype__proto.diff = diff; - momentPrototype__proto.endOf = endOf; - momentPrototype__proto.format = format; - momentPrototype__proto.from = from; - momentPrototype__proto.fromNow = fromNow; - momentPrototype__proto.to = to; - momentPrototype__proto.toNow = toNow; - momentPrototype__proto.get = getSet; - momentPrototype__proto.invalidAt = invalidAt; - momentPrototype__proto.isAfter = isAfter; - momentPrototype__proto.isBefore = isBefore; - momentPrototype__proto.isBetween = isBetween; - momentPrototype__proto.isSame = isSame; - momentPrototype__proto.isValid = moment_valid__isValid; - momentPrototype__proto.lang = lang; - momentPrototype__proto.locale = locale; - momentPrototype__proto.localeData = localeData; - momentPrototype__proto.max = prototypeMax; - momentPrototype__proto.min = prototypeMin; - momentPrototype__proto.parsingFlags = parsingFlags; - momentPrototype__proto.set = getSet; - momentPrototype__proto.startOf = startOf; - momentPrototype__proto.subtract = add_subtract__subtract; - momentPrototype__proto.toArray = toArray; - momentPrototype__proto.toObject = toObject; - momentPrototype__proto.toDate = toDate; - momentPrototype__proto.toISOString = moment_format__toISOString; - momentPrototype__proto.toJSON = moment_format__toISOString; - momentPrototype__proto.toString = toString; - momentPrototype__proto.unix = unix; - momentPrototype__proto.valueOf = to_type__valueOf; + momentPrototype__proto.add = add_subtract__add; + momentPrototype__proto.calendar = moment_calendar__calendar; + momentPrototype__proto.clone = clone; + momentPrototype__proto.diff = diff; + momentPrototype__proto.endOf = endOf; + momentPrototype__proto.format = format; + momentPrototype__proto.from = from; + momentPrototype__proto.fromNow = fromNow; + momentPrototype__proto.to = to; + momentPrototype__proto.toNow = toNow; + momentPrototype__proto.get = getSet; + momentPrototype__proto.invalidAt = invalidAt; + momentPrototype__proto.isAfter = isAfter; + momentPrototype__proto.isBefore = isBefore; + momentPrototype__proto.isBetween = isBetween; + momentPrototype__proto.isSame = isSame; + momentPrototype__proto.isSameOrAfter = isSameOrAfter; + momentPrototype__proto.isSameOrBefore = isSameOrBefore; + momentPrototype__proto.isValid = moment_valid__isValid; + momentPrototype__proto.lang = lang; + momentPrototype__proto.locale = locale; + momentPrototype__proto.localeData = localeData; + momentPrototype__proto.max = prototypeMax; + momentPrototype__proto.min = prototypeMin; + momentPrototype__proto.parsingFlags = parsingFlags; + momentPrototype__proto.set = getSet; + momentPrototype__proto.startOf = startOf; + momentPrototype__proto.subtract = add_subtract__subtract; + momentPrototype__proto.toArray = toArray; + momentPrototype__proto.toObject = toObject; + momentPrototype__proto.toDate = toDate; + momentPrototype__proto.toISOString = moment_format__toISOString; + momentPrototype__proto.toJSON = toJSON; + momentPrototype__proto.toString = toString; + momentPrototype__proto.unix = unix; + momentPrototype__proto.valueOf = to_type__valueOf; + momentPrototype__proto.creationData = creationData; // Year momentPrototype__proto.year = getSetYear; @@ -20935,7 +21075,7 @@ module.exports=require(52) function locale_calendar__calendar (key, mom, now) { var output = this._calendar[key]; - return typeof output === 'function' ? output.call(mom, now) : output; + return isFunction(output) ? output.call(mom, now) : output; } var defaultLongDateFormat = { @@ -20997,29 +21137,14 @@ module.exports=require(52) function relative__relativeTime (number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; - return (typeof output === 'function') ? + return (isFunction(output)) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } function pastFuture (diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); - } - - function locale_set__set (config) { - var prop, i; - for (i in config) { - prop = config[i]; - if (typeof prop === 'function') { - this[i] = prop; - } else { - this['_' + i] = prop; - } - } - // Lenient ordinal parsing accepts just a number in addition to - // number + (possibly) stuff coming from _ordinalParseLenient. - this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source); + return isFunction(format) ? format(output) : format.replace(/%s/i, output); } var prototype__proto = Locale.prototype; @@ -21041,11 +21166,15 @@ module.exports=require(52) prototype__proto.set = locale_set__set; // Month - prototype__proto.months = localeMonths; - prototype__proto._months = defaultLocaleMonths; - prototype__proto.monthsShort = localeMonthsShort; - prototype__proto._monthsShort = defaultLocaleMonthsShort; - prototype__proto.monthsParse = localeMonthsParse; + prototype__proto.months = localeMonths; + prototype__proto._months = defaultLocaleMonths; + prototype__proto.monthsShort = localeMonthsShort; + prototype__proto._monthsShort = defaultLocaleMonthsShort; + prototype__proto.monthsParse = localeMonthsParse; + prototype__proto._monthsRegex = defaultMonthsRegex; + prototype__proto.monthsRegex = monthsRegex; + prototype__proto._monthsShortRegex = defaultMonthsShortRegex; + prototype__proto.monthsShortRegex = monthsShortRegex; // Week prototype__proto.week = localeWeek; @@ -21333,15 +21462,15 @@ module.exports=require(52) var years = round(duration.as('y')); var a = seconds < thresholds.s && ['s', seconds] || - minutes === 1 && ['m'] || + minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || - hours === 1 && ['h'] || + hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || - days === 1 && ['d'] || + days <= 1 && ['d'] || days < thresholds.d && ['dd', days] || - months === 1 && ['M'] || + months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || - years === 1 && ['y'] || ['yy', years]; + years <= 1 && ['y'] || ['yy', years]; a[2] = withoutSuffix; a[3] = +posNegDuration > 0; @@ -21462,6 +21591,8 @@ module.exports=require(52) // Side effect imports + // FORMATTING + addFormatToken('X', 0, 0, 'unix'); addFormatToken('x', 0, 0, 'valueOf'); @@ -21479,13 +21610,14 @@ module.exports=require(52) // Side effect imports - utils_hooks__hooks.version = '2.10.6'; + utils_hooks__hooks.version = '2.12.0'; setHookCallback(local__createLocal); utils_hooks__hooks.fn = momentPrototype; utils_hooks__hooks.min = min; utils_hooks__hooks.max = max; + utils_hooks__hooks.now = now; utils_hooks__hooks.utc = create_utc__createUTC; utils_hooks__hooks.unix = moment__createUnix; utils_hooks__hooks.months = lists__listMonths; @@ -21501,16 +21633,335 @@ module.exports=require(52) utils_hooks__hooks.monthsShort = lists__listMonthsShort; utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin; utils_hooks__hooks.defineLocale = defineLocale; + utils_hooks__hooks.updateLocale = updateLocale; + utils_hooks__hooks.locales = locale_locales__listLocales; utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort; utils_hooks__hooks.normalizeUnits = normalizeUnits; utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold; + utils_hooks__hooks.prototype = momentPrototype; var _moment = utils_hooks__hooks; return _moment; })); -},{}],106:[function(require,module,exports){ +},{}],83:[function(require,module,exports){ +(function (process){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// resolves . and .. elements in a path array with directory names there +// must be no slashes, empty elements, or device names (c:\) in the array +// (so also no leading and trailing slashes - it does not distinguish +// relative and absolute paths) +function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + + return parts; +} + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var splitPath = function(filename) { + return splitPathRe.exec(filename).slice(1); +}; + +// path.resolve([from ...], to) +// posix version +exports.resolve = function() { + var resolvedPath = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) ? arguments[i] : process.cwd(); + + // Skip empty and invalid entries + if (typeof path !== 'string') { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { + return !!p; + }), !resolvedAbsolute).join('/'); + + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; +}; + +// path.normalize(path) +// posix version +exports.normalize = function(path) { + var isAbsolute = exports.isAbsolute(path), + trailingSlash = substr(path, -1) === '/'; + + // Normalize the path + path = normalizeArray(filter(path.split('/'), function(p) { + return !!p; + }), !isAbsolute).join('/'); + + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + + return (isAbsolute ? '/' : '') + path; +}; + +// posix version +exports.isAbsolute = function(path) { + return path.charAt(0) === '/'; +}; + +// posix version +exports.join = function() { + var paths = Array.prototype.slice.call(arguments, 0); + return exports.normalize(filter(paths, function(p, index) { + if (typeof p !== 'string') { + throw new TypeError('Arguments to path.join must be strings'); + } + return p; + }).join('/')); +}; + + +// path.relative(from, to) +// posix version +exports.relative = function(from, to) { + from = exports.resolve(from).substr(1); + to = exports.resolve(to).substr(1); + + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('/'); +}; + +exports.sep = '/'; +exports.delimiter = ':'; + +exports.dirname = function(path) { + var result = splitPath(path), + root = result[0], + dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; +}; + + +exports.basename = function(path, ext) { + var f = splitPath(path)[2]; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +}; + + +exports.extname = function(path) { + return splitPath(path)[3]; +}; + +function filter (xs, f) { + if (xs.filter) return xs.filter(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + if (f(xs[i], i, xs)) res.push(xs[i]); + } + return res; +} + +// String.prototype.substr - negative index don't work in IE8 +var substr = 'ab'.substr(-1) === 'b' + ? function (str, start, len) { return str.substr(start, len) } + : function (str, start, len) { + if (start < 0) start = str.length + start; + return str.substr(start, len); + } +; + +}).call(this,require('_process')) +},{"_process":84}],84:[function(require,module,exports){ +// shim for using process in browser + +var process = module.exports = {}; + +process.nextTick = (function () { + var canSetImmediate = typeof window !== 'undefined' + && window.setImmediate; + var canMutationObserver = typeof window !== 'undefined' + && window.MutationObserver; + var canPost = typeof window !== 'undefined' + && window.postMessage && window.addEventListener + ; + + if (canSetImmediate) { + return function (f) { return window.setImmediate(f) }; + } + + var queue = []; + + if (canMutationObserver) { + var hiddenDiv = document.createElement("div"); + var observer = new MutationObserver(function () { + var queueList = queue.slice(); + queue.length = 0; + queueList.forEach(function (fn) { + fn(); + }); + }); + + observer.observe(hiddenDiv, { attributes: true }); + + return function nextTick(fn) { + if (!queue.length) { + hiddenDiv.setAttribute('yes', 'no'); + } + queue.push(fn); + }; + } + + if (canPost) { + window.addEventListener('message', function (ev) { + var source = ev.source; + if ((source === window || source === null) && ev.data === 'process-tick') { + ev.stopPropagation(); + if (queue.length > 0) { + var fn = queue.shift(); + fn(); + } + } + }, true); + + return function nextTick(fn) { + queue.push(fn); + window.postMessage('process-tick', '*'); + }; + } + + return function nextTick(fn) { + setTimeout(fn, 0); + }; +})(); + +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +// TODO(shtylman) +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; + +},{}],85:[function(require,module,exports){ module.exports={ "name": "mermaid", "version": "0.5.8", @@ -21620,7 +22071,7 @@ module.exports={ "marked": "^0.3.2", "mock-browser": "^0.91.34", "path": "^0.4.9", - "phantomjs": "^1.9.18", + "phantomjs": "^2.1.3", "proxyquire": "^1.7.3", "proxyquire-universal": "^1.0.8", "proxyquireify": "^3.0.0", @@ -21635,7 +22086,7 @@ module.exports={ } } -},{}],107:[function(require,module,exports){ +},{}],86:[function(require,module,exports){ /* global window */ //log.debug('Setting up d3'); 'use strict'; @@ -22106,7 +22557,7 @@ module.exports = d3; })(); /* jshint ignore:end */ -},{"d3":"d3"}],108:[function(require,module,exports){ +},{"d3":"d3"}],87:[function(require,module,exports){ 'use strict'; var Logger = require('../../logger'); @@ -22193,7 +22644,7 @@ exports.relationType = { DEPENDENCY: 3 }; -},{"../../logger":126}],109:[function(require,module,exports){ +},{"../../logger":105}],88:[function(require,module,exports){ /** * Created by knut on 14-11-23. */ @@ -22502,7 +22953,7 @@ module.exports.draw = function (text, id) { //diagram.attr('viewBox', (box.startx-conf.diagramMarginX) + ' -' +conf.diagramMarginY + ' ' + width + ' ' + height); }; -},{"../../d3":107,"../../logger":126,"./classDb":108,"./parser/classDiagram":110,"dagre":53}],110:[function(require,module,exports){ +},{"../../d3":86,"../../logger":105,"./classDb":87,"./parser/classDiagram":89,"dagre":30}],89:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -23304,7 +23755,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],111:[function(require,module,exports){ +},{"_process":84,"fs":1,"path":83}],90:[function(require,module,exports){ (function (global){ /** * Created by knut on 15-01-14. @@ -23339,7 +23790,7 @@ exports.parseError = function (err, hash) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../logger":126}],112:[function(require,module,exports){ +},{"../../logger":105}],91:[function(require,module,exports){ /** * Created by knut on 14-12-11. */ @@ -23374,7 +23825,7 @@ exports.draw = function (txt, id, ver) { /* var box = exports.bounds.getBounds(); - var height = box.stopy-box.starty+2*conf.diagramMarginY; + var height = box.stopy-box.starty+2*conf.diagramMarginY; var width = box.stopx-box.startx+2*conf.diagramMarginX;*/ svg.attr('height', 100); @@ -23382,7 +23833,7 @@ exports.draw = function (txt, id, ver) { //svg.attr('viewBox', '0 0 300 150'); }; -},{"../../d3":107,"../../logger":126,"./exampleDb":111,"./parser/example.js":113}],113:[function(require,module,exports){ +},{"../../d3":86,"../../logger":105,"./exampleDb":90,"./parser/example.js":92}],92:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -24028,7 +24479,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],114:[function(require,module,exports){ +},{"_process":84,"fs":1,"path":83}],93:[function(require,module,exports){ /* global window */ 'use strict'; @@ -24052,7 +24503,7 @@ if (!dagreD3) { module.exports = dagreD3; -},{"../../logger":126,"dagre-d3":4}],115:[function(require,module,exports){ +},{"../../logger":105,"dagre-d3":2}],94:[function(require,module,exports){ /** * Created by knut on 14-12-11. */ @@ -24525,7 +24976,7 @@ exports.draw = function (text, id, isDot) { } }; -},{"../../d3":107,"../../logger":126,"./dagre-d3":114,"./graphDb":116,"./parser/dot":117,"./parser/flow":118}],116:[function(require,module,exports){ +},{"../../d3":86,"../../logger":105,"./dagre-d3":93,"./graphDb":95,"./parser/dot":96,"./parser/flow":97}],95:[function(require,module,exports){ (function (global){ /** * Created by knut on 14-11-03. @@ -24914,7 +25365,7 @@ exports.parseError = function (err, hash) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../d3":107,"../../logger":126}],117:[function(require,module,exports){ +},{"../../d3":86,"../../logger":105}],96:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -25745,7 +26196,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],118:[function(require,module,exports){ +},{"_process":84,"fs":1,"path":83}],97:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -26855,7 +27306,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],119:[function(require,module,exports){ +},{"_process":84,"fs":1,"path":83}],98:[function(require,module,exports){ (function (global){ /** * Created by knut on 15-01-14. @@ -27242,7 +27693,7 @@ exports.parseError = function (err, hash) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../logger":126,"moment":105}],120:[function(require,module,exports){ +},{"../../logger":105,"moment":82}],99:[function(require,module,exports){ 'use strict'; var gantt = require('./parser/gantt').parser; @@ -27596,7 +28047,7 @@ module.exports.draw = function (text, id) { } }; -},{"../../d3":107,"./ganttDb":119,"./parser/gantt":121,"moment":105}],121:[function(require,module,exports){ +},{"../../d3":86,"./ganttDb":98,"./parser/gantt":100,"moment":82}],100:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -28279,9 +28730,9 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],122:[function(require,module,exports){ +},{"_process":84,"fs":1,"path":83}],101:[function(require,module,exports){ (function (process){ -/* parser generated by jison 0.4.15 */ +/* parser generated by jison 0.4.17 */ /* Returns a Parser object of the following structure: @@ -28360,63 +28811,75 @@ var sequenceDiagram = (function () { var o = function o(k, v, _o, l) { for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v);return _o; }, - $V0 = [2, 2], - $V1 = [1, 5], - $V2 = [1, 7], - $V3 = [1, 8], - $V4 = [1, 11], - $V5 = [1, 12], - $V6 = [1, 13], + $V0 = [1, 2], + $V1 = [1, 3], + $V2 = [1, 4], + $V3 = [2, 4], + $V4 = [1, 9], + $V5 = [1, 11], + $V6 = [1, 12], $V7 = [1, 14], - $V8 = [1, 16], + $V8 = [1, 15], $V9 = [1, 17], - $Va = [1, 7, 9, 10, 16, 18, 19, 20, 21, 22, 23, 33], - $Vb = [7, 9, 10, 16, 18, 19, 20, 21, 23, 33], - $Vc = [1, 53]; + $Va = [1, 18], + $Vb = [1, 19], + $Vc = [1, 20], + $Vd = [1, 22], + $Ve = [1, 23], + $Vf = [1, 4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 24, 25, 37], + $Vg = [4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 25, 37], + $Vh = [35, 36, 37], + $Vi = [1, 67]; var parser = { trace: function trace() {}, yy: {}, - symbols_: { "error": 2, "start": 3, "SD": 4, "document": 5, "line": 6, "SPACE": 7, "statement": 8, "NL": 9, "participant": 10, "actor": 11, "AS": 12, "restOfLine": 13, "signal": 14, "note_statement": 15, "title": 16, "text": 17, "loop": 18, "end": 19, "opt": 20, "alt": 21, "else": 22, "note": 23, "placement": 24, "text2": 25, "over": 26, "actor_pair": 27, "spaceList": 28, ",": 29, "left_of": 30, "right_of": 31, "signaltype": 32, "ACTOR": 33, "SOLID_OPEN_ARROW": 34, "DOTTED_OPEN_ARROW": 35, "SOLID_ARROW": 36, "DOTTED_ARROW": 37, "SOLID_CROSS": 38, "DOTTED_CROSS": 39, "TXT": 40, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "SD", 7: "SPACE", 9: "NL", 10: "participant", 12: "AS", 13: "restOfLine", 16: "title", 17: "text", 18: "loop", 19: "end", 20: "opt", 21: "alt", 22: "else", 23: "note", 26: "over", 29: ",", 30: "left_of", 31: "right_of", 33: "ACTOR", 34: "SOLID_OPEN_ARROW", 35: "DOTTED_OPEN_ARROW", 36: "SOLID_ARROW", 37: "DOTTED_ARROW", 38: "SOLID_CROSS", 39: "DOTTED_CROSS", 40: "TXT" }, - productions_: [0, [3, 2], [5, 0], [5, 2], [6, 2], [6, 1], [6, 1], [8, 5], [8, 3], [8, 2], [8, 2], [8, 4], [8, 4], [8, 4], [8, 7], [15, 4], [15, 4], [28, 2], [28, 1], [27, 3], [27, 1], [24, 1], [24, 1], [14, 4], [11, 1], [32, 1], [32, 1], [32, 1], [32, 1], [32, 1], [32, 1], [25, 1]], + 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, "text": 19, "loop": 20, "end": 21, "opt": 22, "alt": 23, "else": 24, "note": 25, "placement": 26, "text2": 27, "over": 28, "actor_pair": 29, "spaceList": 30, ",": 31, "left_of": 32, "right_of": 33, "signaltype": 34, "+": 35, "-": 36, "ACTOR": 37, "SOLID_OPEN_ARROW": 38, "DOTTED_OPEN_ARROW": 39, "SOLID_ARROW": 40, "DOTTED_ARROW": 41, "SOLID_CROSS": 42, "DOTTED_CROSS": 43, "TXT": 44, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 4: "SPACE", 5: "NL", 6: "SD", 10: "participant", 12: "AS", 13: "restOfLine", 15: "activate", 16: "deactivate", 18: "title", 19: "text", 20: "loop", 21: "end", 22: "opt", 23: "alt", 24: "else", 25: "note", 28: "over", 31: ",", 32: "left_of", 33: "right_of", 35: "+", 36: "-", 37: "ACTOR", 38: "SOLID_OPEN_ARROW", 39: "DOTTED_OPEN_ARROW", 40: "SOLID_ARROW", 41: "DOTTED_ARROW", 42: "SOLID_CROSS", 43: "DOTTED_CROSS", 44: "TXT" }, + 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, 4], [9, 4], [9, 4], [9, 7], [17, 4], [17, 4], [30, 2], [30, 1], [29, 3], [29, 1], [26, 1], [26, 1], [14, 5], [14, 5], [14, 4], [11, 1], [34, 1], [34, 1], [34, 1], [34, 1], [34, 1], [34, 1], [27, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, /* action[1] */$$, /* vstack */_$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { - case 1: + case 3: yy.apply($$[$0]);return $$[$0]; break; - case 2: + case 4: this.$ = []; break; - case 3: + case 5: $$[$0 - 1].push($$[$0]);this.$ = $$[$0 - 1]; break; - case 4:case 5: + case 6:case 7: this.$ = $$[$0]; break; - case 6: + case 8: this.$ = []; break; - case 7: + case 9: $$[$0 - 3].description = $$[$0 - 1];this.$ = $$[$0 - 3]; break; - case 8: + case 10: this.$ = $$[$0 - 1]; break; case 12: + this.$ = { type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] }; + break; + case 13: + this.$ = { type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 1] }; + break; + case 16: $$[$0 - 1].unshift({ type: 'loopStart', loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_START }); $$[$0 - 1].push({ type: 'loopEnd', loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_END }); this.$ = $$[$0 - 1]; break; - case 13: + case 17: $$[$0 - 1].unshift({ type: 'optStart', optText: $$[$0 - 2], signalType: yy.LINETYPE.OPT_START }); $$[$0 - 1].push({ type: 'optEnd', optText: $$[$0 - 2], signalType: yy.LINETYPE.OPT_END }); this.$ = $$[$0 - 1]; break; - case 14: + case 18: // Alt start $$[$0 - 4].unshift({ type: 'altStart', altText: $$[$0 - 5], signalType: yy.LINETYPE.ALT_START }); @@ -28430,11 +28893,11 @@ var sequenceDiagram = (function () { this.$ = $$[$0 - 4]; break; - case 15: + case 19: this.$ = [$$[$0 - 1], { type: 'addNote', placement: $$[$0 - 2], actor: $$[$0 - 1].actor, text: $$[$0] }]; break; - case 16: + case 20: // Coerce actor_pair into a [to, from, ...] array $$[$0 - 2] = [].concat($$[$0 - 1], $$[$0 - 1]).slice(0, 2); @@ -28442,49 +28905,55 @@ var sequenceDiagram = (function () { $$[$0 - 2][1] = $$[$0 - 2][1].actor; this.$ = [$$[$0 - 1], { type: 'addNote', placement: yy.PLACEMENT.OVER, actor: $$[$0 - 2].slice(0, 2), text: $$[$0] }]; break; - case 19: + case 23: this.$ = [$$[$0 - 2], $$[$0]]; break; - case 20: + case 24: this.$ = $$[$0]; break; - case 21: + case 25: this.$ = yy.PLACEMENT.LEFTOF; break; - case 22: + case 26: this.$ = yy.PLACEMENT.RIGHTOF; break; - case 23: - this.$ = [$$[$0 - 3], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }]; - break; - case 24: - this.$ = { type: 'addActor', actor: $$[$0] }; - break; - case 25: - this.$ = yy.LINETYPE.SOLID_OPEN; - break; - case 26: - this.$ = yy.LINETYPE.DOTTED_OPEN; - break; case 27: - this.$ = yy.LINETYPE.SOLID; + this.$ = [$$[$0 - 4], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, { type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] }]; break; case 28: - this.$ = yy.LINETYPE.DOTTED; + this.$ = [$$[$0 - 4], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, { type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 4] }]; break; case 29: - this.$ = yy.LINETYPE.SOLID_CROSS; + this.$ = [$$[$0 - 3], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }]; break; case 30: - this.$ = yy.LINETYPE.DOTTED_CROSS; + this.$ = { type: 'addActor', actor: $$[$0] }; break; case 31: + this.$ = yy.LINETYPE.SOLID_OPEN; + break; + case 32: + this.$ = yy.LINETYPE.DOTTED_OPEN; + break; + case 33: + this.$ = yy.LINETYPE.SOLID; + break; + case 34: + this.$ = yy.LINETYPE.DOTTED; + break; + case 35: + this.$ = yy.LINETYPE.SOLID_CROSS; + break; + case 36: + this.$ = yy.LINETYPE.DOTTED_CROSS; + break; + case 37: this.$ = $$[$0].substring(1).trim().replace(/\\n/gm, "\n"); break; } }, - table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o([1, 7, 9, 10, 16, 18, 20, 21, 23, 33], $V0, { 5: 3 }), { 1: [2, 1], 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, o($Va, [2, 3]), { 8: 18, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, o($Va, [2, 5]), o($Va, [2, 6]), { 11: 19, 33: $V9 }, { 9: [1, 20] }, { 9: [1, 21] }, { 7: [1, 22] }, { 13: [1, 23] }, { 13: [1, 24] }, { 13: [1, 25] }, { 32: 26, 34: [1, 27], 35: [1, 28], 36: [1, 29], 37: [1, 30], 38: [1, 31], 39: [1, 32] }, { 24: 33, 26: [1, 34], 30: [1, 35], 31: [1, 36] }, o([9, 12, 29, 34, 35, 36, 37, 38, 39, 40], [2, 24]), o($Va, [2, 4]), { 9: [1, 38], 12: [1, 37] }, o($Va, [2, 9]), o($Va, [2, 10]), { 17: [1, 39] }, o($Vb, $V0, { 5: 40 }), o($Vb, $V0, { 5: 41 }), o([7, 9, 10, 16, 18, 20, 21, 22, 23, 33], $V0, { 5: 42 }), { 11: 43, 33: $V9 }, { 33: [2, 25] }, { 33: [2, 26] }, { 33: [2, 27] }, { 33: [2, 28] }, { 33: [2, 29] }, { 33: [2, 30] }, { 11: 44, 33: $V9 }, { 11: 46, 27: 45, 33: $V9 }, { 33: [2, 21] }, { 33: [2, 22] }, { 13: [1, 47] }, o($Va, [2, 8]), { 9: [1, 48] }, { 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 19: [1, 49], 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, { 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 19: [1, 50], 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, { 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 20: $V6, 21: $V7, 22: [1, 51], 23: $V8, 33: $V9 }, { 25: 52, 40: $Vc }, { 25: 54, 40: $Vc }, { 25: 55, 40: $Vc }, { 29: [1, 56], 40: [2, 20] }, { 9: [1, 57] }, o($Va, [2, 11]), o($Va, [2, 12]), o($Va, [2, 13]), { 13: [1, 58] }, { 9: [2, 23] }, { 9: [2, 31] }, { 9: [2, 15] }, { 9: [2, 16] }, { 11: 59, 33: $V9 }, o($Va, [2, 7]), o($Vb, $V0, { 5: 60 }), { 40: [2, 19] }, { 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 19: [1, 61], 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, o($Va, [2, 14])], - defaultActions: { 27: [2, 25], 28: [2, 26], 29: [2, 27], 30: [2, 28], 31: [2, 29], 32: [2, 30], 35: [2, 21], 36: [2, 22], 52: [2, 23], 53: [2, 31], 54: [2, 15], 55: [2, 16], 59: [2, 19] }, + 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, 37], $V3, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, o($Vf, [2, 5]), { 9: 24, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, o($Vf, [2, 7]), o($Vf, [2, 8]), { 11: 25, 37: $Ve }, { 5: [1, 26] }, { 11: 27, 37: $Ve }, { 11: 28, 37: $Ve }, { 5: [1, 29] }, { 4: [1, 30] }, { 13: [1, 31] }, { 13: [1, 32] }, { 13: [1, 33] }, { 34: 34, 38: [1, 35], 39: [1, 36], 40: [1, 37], 41: [1, 38], 42: [1, 39], 43: [1, 40] }, { 26: 41, 28: [1, 42], 32: [1, 43], 33: [1, 44] }, o([5, 12, 31, 38, 39, 40, 41, 42, 43, 44], [2, 30]), o($Vf, [2, 6]), { 5: [1, 46], 12: [1, 45] }, o($Vf, [2, 11]), { 5: [1, 47] }, { 5: [1, 48] }, o($Vf, [2, 14]), { 19: [1, 49] }, o($Vg, $V3, { 7: 50 }), o($Vg, $V3, { 7: 51 }), o([4, 5, 10, 15, 16, 18, 20, 22, 23, 24, 25, 37], $V3, { 7: 52 }), { 11: 55, 35: [1, 53], 36: [1, 54], 37: $Ve }, o($Vh, [2, 31]), o($Vh, [2, 32]), o($Vh, [2, 33]), o($Vh, [2, 34]), o($Vh, [2, 35]), o($Vh, [2, 36]), { 11: 56, 37: $Ve }, { 11: 58, 29: 57, 37: $Ve }, { 37: [2, 25] }, { 37: [2, 26] }, { 13: [1, 59] }, o($Vf, [2, 10]), o($Vf, [2, 12]), o($Vf, [2, 13]), { 5: [1, 60] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 61], 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 62], 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 24: [1, 63], 25: $Vd, 37: $Ve }, { 11: 64, 37: $Ve }, { 11: 65, 37: $Ve }, { 27: 66, 44: $Vi }, { 27: 68, 44: $Vi }, { 27: 69, 44: $Vi }, { 31: [1, 70], 44: [2, 24] }, { 5: [1, 71] }, o($Vf, [2, 15]), o($Vf, [2, 16]), o($Vf, [2, 17]), { 13: [1, 72] }, { 27: 73, 44: $Vi }, { 27: 74, 44: $Vi }, { 5: [2, 29] }, { 5: [2, 37] }, { 5: [2, 19] }, { 5: [2, 20] }, { 11: 75, 37: $Ve }, o($Vf, [2, 9]), o($Vg, $V3, { 7: 76 }), { 5: [2, 27] }, { 5: [2, 28] }, { 44: [2, 23] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 77], 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, o($Vf, [2, 18])], + defaultActions: { 5: [2, 1], 6: [2, 2], 43: [2, 25], 44: [2, 26], 66: [2, 29], 67: [2, 37], 68: [2, 19], 69: [2, 20], 73: [2, 27], 74: [2, 28], 75: [2, 23] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); @@ -28494,7 +28963,7 @@ var sequenceDiagram = (function () { this.hash = hash; }; - _parseError.prototype = new Error(); + _parseError.prototype = Error; throw new _parseError(str, hash); } @@ -28964,7 +29433,7 @@ var sequenceDiagram = (function () { var YYSTATE = YY_START; switch ($avoiding_name_collisions) { case 0: - return 9; + return 5; break; case 1: /* skip all whitespace */ @@ -28982,70 +29451,70 @@ var sequenceDiagram = (function () { this.begin('ID');return 10; break; case 6: - this.begin('ALIAS');return 33; + this.begin('ALIAS');return 37; break; case 7: this.popState();this.popState();this.begin('LINE');return 12; break; case 8: - this.popState();this.popState();return 9; + this.popState();this.popState();return 5; break; case 9: - this.begin('LINE');return 18; - break; - case 10: this.begin('LINE');return 20; break; + case 10: + this.begin('LINE');return 22; + break; case 11: - this.begin('LINE');return 21; + this.begin('LINE');return 23; break; case 12: - this.begin('LINE');return 22; + this.begin('LINE');return 24; break; case 13: this.popState();return 13; break; case 14: - return 19; + return 21; break; case 15: - return 30; + return 32; break; case 16: - return 31; - break; - case 17: - return 26; - break; - case 18: - return 23; - break; - case 19: - return 16; - break; - case 20: - return 4; - break; - case 21: - return 29; - break; - case 22: - return 9; - break; - case 23: return 33; break; + case 17: + return 28; + break; + case 18: + return 25; + break; + case 19: + this.begin('ID');return 15; + break; + case 20: + this.begin('ID');return 16; + break; + case 21: + return 18; + break; + case 22: + return 6; + break; + case 23: + return 31; + break; case 24: - return 36; + return 5; break; case 25: - return 37; + yy_.yytext = yy_.yytext.trim();return 37; break; case 26: - return 34; + return 40; break; case 27: - return 35; + return 41; break; case 28: return 38; @@ -29054,18 +29523,30 @@ var sequenceDiagram = (function () { return 39; break; case 30: - return 40; + return 42; break; case 31: - return 9; + return 43; break; case 32: + return 44; + break; + case 33: + return 35; + break; + case 34: + return 36; + break; + case 35: + return 5; + break; + case 36: return 'INVALID'; break; } }, - 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, /^(?:[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:title\b)/i, /^(?:sequenceDiagram\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\->:\n,;]+)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?::[^#\n;]+)/i, /^(?:$)/i, /^(?:.)/i], - conditions: { "LINE": { "rules": [2, 3, 13], "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, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], "inclusive": true } } + 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, /^(?:[^#\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], + conditions: { "LINE": { "rules": [2, 3, 13], "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, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36], "inclusive": true } } }; return lexer; })(); @@ -29097,7 +29578,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],123:[function(require,module,exports){ +},{"_process":84,"fs":1,"path":83}],102:[function(require,module,exports){ (function (global){ /** * Created by knut on 14-11-19. @@ -29166,7 +29647,9 @@ exports.LINETYPE = { ALT_ELSE: 13, ALT_END: 14, OPT_START: 15, - OPT_END: 16 + OPT_END: 16, + ACTIVE_START: 17, + ACTIVE_END: 18 }; exports.ARROWTYPE = { @@ -29200,11 +29683,17 @@ exports.apply = function (param) { exports.apply(item); }); } else { - // log.debug(param); + // console.info(param); switch (param.type) { case 'addActor': exports.addActor(param.actor, param.actor, param.description); break; + case 'activeStart': + exports.addSignal(param.actor, undefined, undefined, param.signalType); + break; + case 'activeEnd': + exports.addSignal(param.actor, undefined, undefined, param.signalType); + break; case 'addNote': exports.addNote(param.actor, param.placement, param.text); break; @@ -29243,7 +29732,7 @@ exports.apply = function (param) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../logger":126}],124:[function(require,module,exports){ +},{"../../logger":105}],103:[function(require,module,exports){ /** * Created by knut on 14-11-23. */ @@ -29263,7 +29752,7 @@ var conf = { diagramMarginY: 10, // Margin between actors actorMargin: 50, - // Width of actor moxes + // Width of actor boxes width: 150, // Height of actor boxes height: 65, @@ -29277,7 +29766,10 @@ var conf = { mirrorActors: false, // Depending on css styling this might need adjustment // Prolongs the edge of the diagram downwards - bottomMarginAdj: 1 + bottomMarginAdj: 1, + + // width of activation box + activationWidth: 10 }; //var bb = getBBox('path'); @@ -29290,9 +29782,11 @@ exports.bounds = { }, verticalPos: 0, - list: [], + sequenceItems: [], + activations: [], init: function init() { - this.list = []; + this.sequenceItems = []; + this.activations = []; this.data = { startx: undefined, stopx: undefined, @@ -29308,24 +29802,33 @@ exports.bounds = { obj[key] = fun(val, obj[key]); } }, - updateLoops: function updateLoops(startx, starty, stopx, stopy) { + updateBounds: function updateBounds(startx, starty, stopx, stopy) { var _self = this; var cnt = 0; - this.list.forEach(function (loop) { - cnt++; - // The loop list is a stack so the biggest margins in the beginning of the list - var n = _self.list.length - cnt + 1; + function updateFn(type) { + return function updateItemBounds(item) { + cnt++; + // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems + var n = _self.sequenceItems.length - cnt + 1; - _self.updateVal(loop, 'startx', startx - n * conf.boxMargin, Math.min); - _self.updateVal(loop, 'starty', starty - n * conf.boxMargin, Math.min); - _self.updateVal(loop, 'stopx', stopx + n * conf.boxMargin, Math.max); - _self.updateVal(loop, 'stopy', stopy + n * conf.boxMargin, Math.max); + _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min); + _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max); - _self.updateVal(exports.bounds.data, 'startx', startx - n * conf.boxMargin, Math.min); - _self.updateVal(exports.bounds.data, 'starty', starty - n * conf.boxMargin, Math.min); - _self.updateVal(exports.bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max); - _self.updateVal(exports.bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max); - }); + _self.updateVal(exports.bounds.data, 'startx', startx - n * conf.boxMargin, Math.min); + _self.updateVal(exports.bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max); + + if (!(type == 'activation')) { + _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min); + _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max); + + _self.updateVal(exports.bounds.data, 'starty', starty - n * conf.boxMargin, Math.min); + _self.updateVal(exports.bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max); + } + }; + } + + this.sequenceItems.forEach(updateFn()); + this.activations.forEach(updateFn('activation')); }, insert: function insert(startx, starty, stopx, stopy) { @@ -29341,21 +29844,37 @@ exports.bounds = { this.updateVal(exports.bounds.data, 'stopx', _stopx, Math.max); this.updateVal(exports.bounds.data, 'stopy', _stopy, Math.max); - this.updateLoops(_startx, _starty, _stopx, _stopy); + this.updateBounds(_startx, _starty, _stopx, _stopy); + }, + newActivation: function newActivation(message, diagram) { + var actorRect = sq.yy.getActors()[message.from.actor]; + var stackedSize = actorActivations(message.from.actor).length; + var x = actorRect.x + conf.width / 2 + (stackedSize - 1) * conf.activationWidth / 2; + this.activations.push({ startx: x, starty: this.verticalPos + 2, stopx: x + conf.activationWidth, stopy: undefined, + actor: message.from.actor, + anchored: svgDraw.anchorElement(diagram) + }); + }, + endActivation: function endActivation(message) { + // find most recent activation for given actor + var lastActorActivationIdx = this.activations.map(function (activation) { + return activation.actor; + }).lastIndexOf(message.from.actor); + var activation = this.activations.splice(lastActorActivationIdx, 1)[0]; + return activation; }, newLoop: function newLoop(title) { - this.list.push({ startx: undefined, starty: this.verticalPos, stopx: undefined, stopy: undefined, title: title }); + this.sequenceItems.push({ startx: undefined, starty: this.verticalPos, stopx: undefined, stopy: undefined, title: title }); }, endLoop: function endLoop() { - var loop = this.list.pop(); - //loop.stopy = exports.bounds.getVerticalPos(); + var loop = this.sequenceItems.pop(); return loop; }, addElseToLoop: function addElseToLoop(message) { - var loop = this.list.pop(); + var loop = this.sequenceItems.pop(); loop.elsey = exports.bounds.getVerticalPos(); loop.elseText = message; - this.list.push(loop); + this.sequenceItems.push(loop); }, bumpVerticalPos: function bumpVerticalPos(bump) { this.verticalPos = this.verticalPos + bump; @@ -29491,7 +30010,7 @@ module.exports.drawActors = function (diagram, actors, actorKeys, verticalPos) { // Add some rendering data to the object actors[key].x = i * conf.actorMargin + i * conf.width; actors[key].y = verticalPos; - actors[key].width = conf.diagramMarginY; + actors[key].width = conf.diagramMarginX; actors[key].height = conf.diagramMarginY; // Draw the box with the attached line @@ -29511,6 +30030,27 @@ module.exports.setConf = function (cnf) { conf[key] = cnf[key]; }); }; + +var actorActivations = function actorActivations(actor) { + return module.exports.bounds.activations.filter(function (activation) { + return activation.actor == actor; + }); +}; + +var actorFlowVerticaBounds = function actorFlowVerticaBounds(actor) { + // handle multiple stacked activations for same actor + var actors = sq.yy.getActors(); + var activations = actorActivations(actor); + + var left = activations.reduce(function (acc, activation) { + return Math.min(acc, activation.startx); + }, actors[actor].x + conf.width / 2); + var right = activations.reduce(function (acc, activation) { + return Math.max(acc, activation.stopx); + }, actors[actor].x + conf.width / 2); + return [left, right]; +}; + /** * Draws a flowchart in the tag with id: id based on the graph definition in text. * @param text @@ -29537,6 +30077,19 @@ module.exports.draw = function (text, id) { svgDraw.insertArrowHead(diagram); svgDraw.insertArrowCrossHead(diagram); + function activeEnd(msg, verticalPos) { + var activationData = exports.bounds.endActivation(msg); + if (activationData.starty + 18 > verticalPos) { + activationData.starty = verticalPos - 6; + verticalPos += 12; + } + svgDraw.drawActivation(diagram, activationData, verticalPos, conf); + + exports.bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos); + } + + var lastMsg; + // Draw the messages/signals messages.forEach(function (msg) { var loopData; @@ -29561,6 +30114,12 @@ module.exports.draw = function (text, id) { drawNote(diagram, (startx + stopx + conf.width - forceWidth) / 2, exports.bounds.getVerticalPos(), msg, forceWidth); } break; + case sq.yy.LINETYPE.ACTIVE_START: + exports.bounds.newActivation(msg, diagram); + break; + case sq.yy.LINETYPE.ACTIVE_END: + activeEnd(msg, exports.bounds.getVerticalPos()); + break; case sq.yy.LINETYPE.LOOP_START: exports.bounds.bumpVerticalPos(conf.boxMargin); exports.bounds.newLoop(msg.message); @@ -29602,12 +30161,23 @@ module.exports.draw = function (text, id) { exports.bounds.bumpVerticalPos(conf.boxMargin); break; default: - exports.bounds.bumpVerticalPos(conf.messageMargin); - startx = actors[msg.from].x + conf.width / 2; - stopx = actors[msg.to].x + conf.width / 2; - - drawMessage(diagram, startx, stopx, exports.bounds.getVerticalPos(), msg); + try { + lastMsg = msg; + exports.bounds.bumpVerticalPos(conf.messageMargin); + var fromBounds = actorFlowVerticaBounds(msg.from); + var toBounds = actorFlowVerticaBounds(msg.to); + var fromIdx = fromBounds[0] <= toBounds[0] ? 1 : 0; + var toIdx = fromBounds[0] < toBounds[0] ? 0 : 1; + startx = fromBounds[fromIdx]; + stopx = toBounds[toIdx]; + var verticalPos = exports.bounds.getVerticalPos(); + drawMessage(diagram, startx, stopx, verticalPos, msg); + var allBounds = fromBounds.concat(toBounds); + exports.bounds.insert(Math.min.apply(null, allBounds), verticalPos, Math.max.apply(null, allBounds), verticalPos); + } catch (e) { + console.error('error while drawing message', e); + } } }); @@ -29642,7 +30212,7 @@ module.exports.draw = function (text, id) { diagram.attr('viewBox', box.startx - conf.diagramMarginX + ' -' + conf.diagramMarginY + ' ' + width + ' ' + height); }; -},{"../../d3":107,"../../logger":126,"./parser/sequenceDiagram":122,"./sequenceDb":123,"./svgDraw":125}],125:[function(require,module,exports){ +},{"../../d3":86,"../../logger":105,"./parser/sequenceDiagram":101,"./sequenceDb":102,"./svgDraw":104}],104:[function(require,module,exports){ /** * Created by knut on 14-12-20. */ @@ -29754,6 +30324,26 @@ exports.drawActor = function (elem, left, verticalPos, description, conf) { .attr('x', center).attr('y', verticalPos + conf.height / 2 + 5).attr('class', 'actor').style('text-anchor', 'middle').text(description); }; +exports.anchorElement = function (elem) { + return elem.append('g'); +}; +/** + * Draws an actor in the diagram with the attaced line + * @param elem - element to append activation rect + * @param bounds - activation box bounds + * @param verticalPos - precise y cooridnate of bottom activation box edge + */ +exports.drawActivation = function (elem, bounds, verticalPos) { + var rect = exports.getNoteRect(); + var g = bounds.anchored; + rect.x = bounds.startx; + rect.y = bounds.starty; + rect.fill = '#f4f4f4'; + rect.width = bounds.stopx - bounds.startx; + rect.height = verticalPos - bounds.starty; + exports.drawRect(g, rect); +}; + /** * Draws an actor in the diagram with the attaced line * @param center - The center of the the actor @@ -29850,7 +30440,7 @@ exports.getNoteRect = function () { return rect; }; -},{}],126:[function(require,module,exports){ +},{}],105:[function(require,module,exports){ /** * #logger * logger = require('logger').create() @@ -29950,7 +30540,7 @@ function Log(level) { exports.Log = Log; -},{}],127:[function(require,module,exports){ +},{}],106:[function(require,module,exports){ (function (global){ /** * Web page integration module for the mermaid framework. It uses the mermaidAPI for mermaid functionality and to render @@ -30207,7 +30797,7 @@ if (typeof document !== 'undefined') { //})); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../package.json":106,"./logger":126,"./mermaidAPI":128,"he":104}],128:[function(require,module,exports){ +},{"../package.json":85,"./logger":105,"./mermaidAPI":107,"he":80}],107:[function(require,module,exports){ (function (global){ /** * --- @@ -30744,7 +31334,7 @@ global.mermaidAPI = { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../package.json":106,"./d3":107,"./diagrams/classDiagram/classDb":108,"./diagrams/classDiagram/classRenderer":109,"./diagrams/classDiagram/parser/classDiagram":110,"./diagrams/example/exampleDb":111,"./diagrams/example/exampleRenderer":112,"./diagrams/example/parser/example":113,"./diagrams/flowchart/flowRenderer":115,"./diagrams/flowchart/graphDb":116,"./diagrams/flowchart/parser/dot":117,"./diagrams/flowchart/parser/flow":118,"./diagrams/gantt/ganttDb":119,"./diagrams/gantt/ganttRenderer":120,"./diagrams/gantt/parser/gantt":121,"./diagrams/sequenceDiagram/parser/sequenceDiagram":122,"./diagrams/sequenceDiagram/sequenceDb":123,"./diagrams/sequenceDiagram/sequenceRenderer":124,"./logger":126,"./utils":129}],129:[function(require,module,exports){ +},{"../package.json":85,"./d3":86,"./diagrams/classDiagram/classDb":87,"./diagrams/classDiagram/classRenderer":88,"./diagrams/classDiagram/parser/classDiagram":89,"./diagrams/example/exampleDb":90,"./diagrams/example/exampleRenderer":91,"./diagrams/example/parser/example":92,"./diagrams/flowchart/flowRenderer":94,"./diagrams/flowchart/graphDb":95,"./diagrams/flowchart/parser/dot":96,"./diagrams/flowchart/parser/flow":97,"./diagrams/gantt/ganttDb":98,"./diagrams/gantt/ganttRenderer":99,"./diagrams/gantt/parser/gantt":100,"./diagrams/sequenceDiagram/parser/sequenceDiagram":101,"./diagrams/sequenceDiagram/sequenceDb":102,"./diagrams/sequenceDiagram/sequenceRenderer":103,"./logger":105,"./utils":108}],108:[function(require,module,exports){ /** * Created by knut on 14-11-23. */ @@ -30884,5 +31474,5 @@ var cloneCssStyles = function cloneCssStyles(svg, classes) { exports.cloneCssStyles = cloneCssStyles; -},{"./logger":126}]},{},[127])(127) +},{"./logger":105}]},{},[106])(106) }); \ No newline at end of file diff --git a/dist/mermaid.slim.min.js b/dist/mermaid.slim.min.js index 53b61e17b..d32376084 100644 --- a/dist/mermaid.slim.min.js +++ b/dist/mermaid.slim.min.js @@ -1,13 +1,14 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.mermaid=t()}}(function(){var define,module,exports;return function t(e,r,n){function i(s,o){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!o&&u)return u(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,t,e,r,n)}return r[s].exports}for(var a="function"==typeof require&&require,s=0;s=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;a--){var s=a>=0?arguments[a]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,i="/"===s.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),a="/"===s(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),a=n(e.split("/")),s=Math.min(i.length,a.length),o=s,u=0;s>u;u++)if(i[u]!==a[u]){o=u;break}for(var c=[],u=o;ue&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:3}],3:[function(t,e){function r(){}var n=e.exports={};n.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.MutationObserver,r="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};var n=[];if(e){var i=document.createElement("div"),a=new MutationObserver(function(){var t=n.slice();n.length=0,t.forEach(function(t){t()})});return a.observe(i,{attributes:!0}),function(t){n.length||i.setAttribute("yes","no"),n.push(t)}}return r?(window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.on=r,n.addListener=r,n.once=r,n.off=r,n.removeListener=r,n.removeAllListeners=r,n.emit=r,n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},{}],4:[function(t,e){e.exports={graphlib:t("./lib/graphlib"),dagre:t("./lib/dagre"),intersect:t("./lib/intersect"),render:t("./lib/render"),util:t("./lib/util"),version:t("./lib/version")}},{"./lib/dagre":11,"./lib/graphlib":12,"./lib/intersect":13,"./lib/render":28,"./lib/util":30,"./lib/version":31}],5:[function(t,e){function r(t,e,r,n){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=i.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(s,r[n+"Style"])}function n(t,e,r,n){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=i.append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(s,r[n+"Style"])}function i(t,e,r,n){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=i.append("path").attr("d","M 0 5 L 10 5").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(s,r[n+"Style"])}var a=t("./util");e.exports={"default":r,normal:r,vee:n,undirected:i}},{"./util":30}],6:[function(t,e){function r(t,e){var r=e.nodes().filter(function(t){return n.isSubgraph(e,t)}),a=t.selectAll("g.cluster").data(r,function(t){return t});return a.selectAll("*").remove(),a.enter().append("g").attr("class","cluster").attr("id",function(t){var r=e.node(t);return r.id}).style("opacity",0),n.applyTransition(a,e).style("opacity",1),a.each(function(t){var r=e.node(t),n=d3.select(this);d3.select(this).append("rect");var a=n.append("g").attr("class","label");i(a,r,r.clusterLabelPos)}),a.selectAll("rect").each(function(t){var r=e.node(t),i=d3.select(this);n.applyStyle(i,r.style)}),n.applyTransition(a.exit(),e).style("opacity",0).remove(),a}var n=t("./util"),i=t("./label/add-label");e.exports=r},{"./label/add-label":21,"./util":30}],7:[function(t,e){"use strict";function r(t,e){var r=t.selectAll("g.edgeLabel").data(e.edges(),function(t){return a.edgeToId(t)}).classed("update",!0);return r.selectAll("*").remove(),r.enter().append("g").classed("edgeLabel",!0).style("opacity",0),r.each(function(t){var r=e.edge(t),a=i(s.select(this),e.edge(t),0,0).classed("label",!0),o=a.node().getBBox();r.labelId&&a.attr("id",r.labelId),n.has(r,"width")||(r.width=o.width),n.has(r,"height")||(r.height=o.height)}),a.applyTransition(r.exit(),e).style("opacity",0).remove(),r}var n=t("./lodash"),i=t("./label/add-label"),a=t("./util"),s=t("./d3");e.exports=r},{"./d3":10,"./label/add-label":21,"./lodash":24,"./util":30}],8:[function(t,e){"use strict";function r(t,e,r){var i=t.selectAll("g.edgePath").data(e.edges(),function(t){return l.edgeToId(t)}).classed("update",!0);return s(i,e),o(i,e),l.applyTransition(i,e).style("opacity",1),i.each(function(t){var r=h.select(this),n=e.edge(t);n.elem=this,n.id&&r.attr("id",n.id),l.applyClass(r,n["class"],(r.classed("update")?"update ":"")+"edgePath")}),i.selectAll("path.path").each(function(t){var r=e.edge(t);r.arrowheadId=u.uniqueId("arrowhead");var i=h.select(this).attr("marker-end",function(){return"url(#"+r.arrowheadId+")"}).style("fill","none");l.applyTransition(i,e).attr("d",function(t){return n(e,t)}),l.applyStyle(i,r.style)}),i.selectAll("defs *").remove(),i.selectAll("defs").each(function(t){var n=e.edge(t),i=r[n.arrowhead];i(h.select(this),n.arrowheadId,n,"arrowhead")}),i}function n(t,e){var r=t.edge(e),n=t.node(e.v),a=t.node(e.w),s=r.points.slice(1,r.points.length-1);return s.unshift(c(n,s[0])),s.push(c(a,s[s.length-1])),i(r,s)}function i(t,e){var r=h.svg.line().x(function(t){return t.x}).y(function(t){return t.y});return u.has(t,"lineInterpolate")&&r.interpolate(t.lineInterpolate),u.has(t,"lineTension")&&r.tension(Number(t.lineTension)),r(e)}function a(t){var e=t.getBBox(),r=t.getTransformToElement(t.ownerSVGElement).translate(e.width/2,e.height/2);return{x:r.e,y:r.f}}function s(t,e){var r=t.enter().append("g").attr("class","edgePath").style("opacity",0);r.append("path").attr("class","path").attr("d",function(t){var r=e.edge(t),n=e.node(t.v).elem,s=u.range(r.points.length).map(function(){return a(n)});return i(r,s)}),r.append("defs")}function o(t,e){var r=t.exit();l.applyTransition(r,e).style("opacity",0).remove(),l.applyTransition(r.select("path.path"),e).attr("d",function(t){var r=e.node(t.v);if(r){var n=u.range(this.pathSegList.length).map(function(){return r});return i({},n)}return h.select(this).attr("d")})}var u=t("./lodash"),c=t("./intersect/intersect-node"),l=t("./util"),h=t("./d3");e.exports=r},{"./d3":10,"./intersect/intersect-node":17,"./lodash":24,"./util":30}],9:[function(t,e){"use strict";function r(t,e,r){var o=e.nodes().filter(function(t){return!a.isSubgraph(e,t)}),u=t.selectAll("g.node").data(o,function(t){return t}).classed("update",!0);return u.selectAll("*").remove(),u.enter().append("g").attr("class","node").style("opacity",0),u.each(function(t){var o=e.node(t),u=s.select(this),c=u.append("g").attr("class","label"),l=i(c,o),h=r[o.shape],d=n.pick(l.node().getBBox(),"width","height");o.elem=this,o.id&&u.attr("id",o.id),o.labelId&&c.attr("id",o.labelId),a.applyClass(u,o["class"],(u.classed("update")?"update ":"")+"node"),n.has(o,"width")&&(d.width=o.width),n.has(o,"height")&&(d.height=o.height),d.width+=o.paddingLeft+o.paddingRight,d.height+=o.paddingTop+o.paddingBottom,c.attr("transform","translate("+(o.paddingLeft-o.paddingRight)/2+","+(o.paddingTop-o.paddingBottom)/2+")");var f=h(s.select(this),d,o);a.applyStyle(f,o.style);var p=f.node().getBBox();o.width=p.width,o.height=p.height}),a.applyTransition(u.exit(),e).style("opacity",0).remove(),u}var n=t("./lodash"),i=t("./label/add-label"),a=t("./util"),s=t("./d3");e.exports=r},{"./d3":10,"./label/add-label":21,"./lodash":24,"./util":30}],10:[function(t,e){e.exports=window.d3},{}],11:[function(t,e){var r;if(t)try{r=t("dagre")}catch(n){}r||(r=window.dagre),e.exports=r},{dagre:53}],12:[function(t,e){var r;if(t)try{r=t("graphlib")}catch(n){}r||(r=window.graphlib),e.exports=r},{graphlib:32}],13:[function(t,e){e.exports={node:t("./intersect-node"),circle:t("./intersect-circle"),ellipse:t("./intersect-ellipse"),polygon:t("./intersect-polygon"),rect:t("./intersect-rect")}},{"./intersect-circle":14,"./intersect-ellipse":15,"./intersect-node":17,"./intersect-polygon":18,"./intersect-rect":19}],14:[function(t,e){function r(t,e,r){return n(t,e,e,r)}var n=t("./intersect-ellipse");e.exports=r},{"./intersect-ellipse":15}],15:[function(t,e){function r(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,u=Math.sqrt(e*e*o*o+r*r*s*s),c=Math.abs(e*r*s/u);n.xm?(m-y)/g:(m+y)/g,m=s*c-a*l,b=0>m?(m-y)/g:(m+y)/g,{x:v,y:b})}function n(t,e){return t*e>0}e.exports=r},{}],17:[function(t,e){function r(t,e){return t.intersect(e)}e.exports=r},{}],18:[function(t,e){function r(t,e,r){var i=t.x,a=t.y,s=[],o=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY;e.forEach(function(t){o=Math.min(o,t.x),u=Math.min(u,t.y)});for(var c=i-t.width/2-o,l=a-t.height/2-u,h=0;h1&&s.sort(function(t,e){var n=t.x-r.x,i=t.y-r.y,a=Math.sqrt(n*n+i*i),s=e.x-r.x,o=e.y-r.y,u=Math.sqrt(s*s+o*o);return u>a?-1:a===u?0:1}),s[0]):(console.log("NO INTERSECTION FOUND, RETURN NODE CENTER",t),t)}var n=t("./intersect-line");e.exports=r},{"./intersect-line":16}],19:[function(t,e){function r(t,e){var r,n,i=t.x,a=t.y,s=e.x-i,o=e.y-a,u=t.width/2,c=t.height/2;return Math.abs(o)*u>Math.abs(s)*c?(0>o&&(c=-c),r=0===o?0:c*s/o,n=c):(0>s&&(u=-u),r=u,n=0===s?0:u*o/s),{x:i+r,y:a+n}}e.exports=r},{}],20:[function(t,e){function r(t,e){var r=t.append("foreignObject").attr("width","100000"),i=r.append("xhtml:div"),a=e.label;switch(typeof a){case"function":i.insert(a);break;case"object":i.insert(function(){return a});break;default:i.html(a)}n.applyStyle(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap");var s,o;return i.each(function(){s=this.clientWidth,o=this.clientHeight}),r.attr("width",s).attr("height",o),r}var n=t("../util");e.exports=r},{"../util":30}],21:[function(t,e){function r(t,e,r){var s=e.label,o=t.append("g");"svg"===e.labelType?a(o,e):"string"!=typeof s||"html"===e.labelType?i(o,e):n(o,e);var u,c=o.node().getBBox();switch(r){case"top":u=-e.height/2;break;case"bottom":u=e.height/2-c.height;break;default:u=-c.height/2}return o.attr("transform","translate("+-c.width/2+","+u+")"),o}var n=t("./add-text-label"),i=t("./add-html-label"),a=t("./add-svg-label");e.exports=r},{"./add-html-label":20,"./add-svg-label":22,"./add-text-label":23}],22:[function(t,e){function r(t,e){var r=t;return r.node().appendChild(e.label),n.applyStyle(r,e.labelStyle),r}var n=t("../util");e.exports=r},{"../util":30}],23:[function(t,e){function r(t,e){for(var r=t.append("text"),a=n(e.label).split("\n"),s=0;sa)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+a);c0&&(i=u.removeMin(),s=o[i],s.distance!==Number.POSITIVE_INFINITY);)n(i).forEach(c);return o}var i=t("../lodash"),a=t("../data/priority-queue");e.exports=r;var s=i.constant(1)},{"../data/priority-queue":46,"../lodash":50}],37:[function(t,e){function r(t){return n.filter(i(t),function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})}var n=t("../lodash"),i=t("./tarjan");e.exports=r},{"../lodash":50,"./tarjan":44}],38:[function(t,e){function r(t,e,r){return n(t,e||a,r||function(e){return t.outEdges(e)})}function n(t,e,r){var n={},i=t.nodes();return i.forEach(function(t){n[t]={},n[t][t]={distance:0},i.forEach(function(e){t!==e&&(n[t][e]={distance:Number.POSITIVE_INFINITY})}),r(t).forEach(function(r){var i=r.v===t?r.w:r.v,a=e(r);n[t][i]={distance:a,predecessor:t}})}),i.forEach(function(t){var e=n[t];i.forEach(function(r){var a=n[r];i.forEach(function(r){var n=a[t],i=e[r],s=a[r],o=n.distance+i.distance;oi&&(u[r]=s,c.decrease(r,i))}}var s,o=new i,u={},c=new a;if(0===t.nodeCount())return o;n.each(t.nodes(),function(t){c.add(t,Number.POSITIVE_INFINITY),o.setNode(t)}),c.decrease(t.nodes()[0],0);for(var l=!1;c.size()>0;){if(s=c.removeMin(),n.has(u,s))o.setEdge(s,u[s]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(s).forEach(r)}return o}var n=t("../lodash"),i=t("../graph"),a=t("../data/priority-queue");e.exports=r},{"../data/priority-queue":46,"../graph":47,"../lodash":50}],44:[function(t,e){function r(t){function e(o){var u=a[o]={onStack:!0,lowlink:r,index:r++};if(i.push(o),t.successors(o).forEach(function(t){n.has(a,t)?a[t].onStack&&(u.lowlink=Math.min(u.lowlink,a[t].index)):(e(t),u.lowlink=Math.min(u.lowlink,a[t].lowlink))}),u.lowlink===u.index){var c,l=[];do c=i.pop(),a[c].onStack=!1,l.push(c);while(o!==c);s.push(l)}}var r=0,i=[],a={},s=[];return t.nodes().forEach(function(t){n.has(a,t)||e(t)}),s}var n=t("../lodash");e.exports=r},{"../lodash":50}],45:[function(t,e){function r(t){function e(o){if(i.has(a,o))throw new n;i.has(r,o)||(a[o]=!0,r[o]=!0,i.each(t.predecessors(o),e),delete a[o],s.push(o))}var r={},a={},s=[];if(i.each(t.sinks(),e),i.size(r)!==t.nodeCount())throw new n;return s}function n(){}var i=t("../lodash");e.exports=r,r.CycleException=n},{"../lodash":50}],46:[function(t,e){function r(){this._arr=[],this._keyIndices={}}var n=t("../lodash");e.exports=r,r.prototype.size=function(){return this._arr.length},r.prototype.keys=function(){return this._arr.map(function(t){return t.key})},r.prototype.has=function(t){return n.has(this._keyIndices,t)},r.prototype.priority=function(t){var e=this._keyIndices[t];return void 0!==e?this._arr[e].priority:void 0},r.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},r.prototype.add=function(t,e){var r=this._keyIndices;if(t=String(t),!n.has(r,t)){var i=this._arr,a=i.length;return r[t]=a,i.push({key:t,priority:e}),this._decrease(a),!0}return!1},r.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},r.prototype.decrease=function(t,e){var r=this._keyIndices[t];if(e>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[r].priority+" New: "+e);this._arr[r].priority=e,this._decrease(r)},r.prototype._heapify=function(t){var e=this._arr,r=2*t,n=r+1,i=t;r>1,!(r[e].prioritya){var s=i;i=a,a=s}return i+h+a+h+(u.isUndefined(n)?c:n)}function s(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function o(t,e){return a(t,e.v,e.w,e.name)}var u=t("./lodash");e.exports=r;var c="\x00",l="\x00",h="";r.prototype._nodeCount=0,r.prototype._edgeCount=0,r.prototype.isDirected=function(){return this._isDirected},r.prototype.isMultigraph=function(){return this._isMultigraph},r.prototype.isCompound=function(){return this._isCompound},r.prototype.setGraph=function(t){return this._label=t,this},r.prototype.graph=function(){return this._label},r.prototype.setDefaultNodeLabel=function(t){return u.isFunction(t)||(t=u.constant(t)),this._defaultNodeLabelFn=t,this},r.prototype.nodeCount=function(){return this._nodeCount},r.prototype.nodes=function(){return u.keys(this._nodes)},r.prototype.sources=function(){return u.filter(this.nodes(),function(t){return u.isEmpty(this._in[t])},this)},r.prototype.sinks=function(){return u.filter(this.nodes(),function(t){return u.isEmpty(this._out[t])},this)},r.prototype.setNodes=function(t,e){var r=arguments;return u.each(t,function(t){r.length>1?this.setNode(t,e):this.setNode(t)},this),this},r.prototype.setNode=function(t,e){return u.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=l,this._children[t]={},this._children[l][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},r.prototype.node=function(t){return this._nodes[t]},r.prototype.hasNode=function(t){return u.has(this._nodes,t)},r.prototype.removeNode=function(t){var e=this;if(u.has(this._nodes,t)){var r=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],u.each(this.children(t),function(t){this.setParent(t)},this),delete this._children[t]),u.each(u.keys(this._in[t]),r),delete this._in[t],delete this._preds[t],u.each(u.keys(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},r.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(u.isUndefined(e))e=l;else{e+="";for(var r=e;!u.isUndefined(r);r=this.parent(r))if(r===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},r.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},r.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==l)return e}},r.prototype.children=function(t){if(u.isUndefined(t)&&(t=l),this._isCompound){var e=this._children[t];if(e)return u.keys(e)}else{if(t===l)return this.nodes();if(this.hasNode(t))return[]}},r.prototype.predecessors=function(t){var e=this._preds[t];return e?u.keys(e):void 0},r.prototype.successors=function(t){var e=this._sucs[t];return e?u.keys(e):void 0},r.prototype.neighbors=function(t){var e=this.predecessors(t);return e?u.union(e,this.successors(t)):void 0},r.prototype.filterNodes=function(t){function e(t){var a=n.parent(t);return void 0===a||r.hasNode(a)?(i[t]=a,a):a in i?i[a]:e(a)}var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph()),u.each(this._nodes,function(e,n){t(n)&&r.setNode(n,e)},this),u.each(this._edgeObjs,function(t){r.hasNode(t.v)&&r.hasNode(t.w)&&r.setEdge(t,this.edge(t))},this);var n=this,i={};return this._isCompound&&u.each(r.nodes(),function(t){r.setParent(t,e(t))}),r},r.prototype.setDefaultEdgeLabel=function(t){return u.isFunction(t)||(t=u.constant(t)),this._defaultEdgeLabelFn=t,this},r.prototype.edgeCount=function(){return this._edgeCount},r.prototype.edges=function(){return u.values(this._edgeObjs)},r.prototype.setPath=function(t,e){var r=this,n=arguments;return u.reduce(t,function(t,i){return n.length>1?r.setEdge(t,i,e):r.setEdge(t,i),i}),this},r.prototype.setEdge=function(){var t,e,r,i,o=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(t=c.v,e=c.w,r=c.name,2===arguments.length&&(i=arguments[1],o=!0)):(t=c,e=arguments[1],r=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,e=""+e,u.isUndefined(r)||(r=""+r);var l=a(this._isDirected,t,e,r);if(u.has(this._edgeLabels,l))return o&&(this._edgeLabels[l]=i),this;if(!u.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=o?i:this._defaultEdgeLabelFn(t,e,r);var h=s(this._isDirected,t,e,r);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[l]=h,n(this._preds[e],t),n(this._sucs[t],e),this._in[e][l]=h,this._out[t][l]=h,this._edgeCount++,this},r.prototype.edge=function(t,e,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,r);return this._edgeLabels[n]},r.prototype.hasEdge=function(t,e,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,r);return u.has(this._edgeLabels,n)},r.prototype.removeEdge=function(t,e,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,r),s=this._edgeObjs[n];return s&&(t=s.v,e=s.w,delete this._edgeLabels[n],delete this._edgeObjs[n],i(this._preds[e],t),i(this._sucs[t],e),delete this._in[e][n],delete this._out[t][n],this._edgeCount--),this},r.prototype.inEdges=function(t,e){var r=this._in[t];if(r){var n=u.values(r);return e?u.filter(n,function(t){return t.v===e}):n}},r.prototype.outEdges=function(t,e){var r=this._out[t];if(r){ -var n=u.values(r);return e?u.filter(n,function(t){return t.w===e}):n}},r.prototype.nodeEdges=function(t,e){var r=this.inEdges(t,e);return r?r.concat(this.outEdges(t,e)):void 0}},{"./lodash":50}],48:[function(t,e){e.exports={Graph:t("./graph"),version:t("./version")}},{"./graph":47,"./version":51}],49:[function(t,e){function r(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:n(t),edges:i(t)};return s.isUndefined(t.graph())||(e.value=s.clone(t.graph())),e}function n(t){return s.map(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return s.isUndefined(r)||(i.value=r),s.isUndefined(n)||(i.parent=n),i})}function i(t){return s.map(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return s.isUndefined(e.name)||(n.name=e.name),s.isUndefined(r)||(n.value=r),n})}function a(t){var e=new o(t.options).setGraph(t.value);return s.each(t.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),s.each(t.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}var s=t("./lodash"),o=t("./graph");e.exports={write:r,read:a}},{"./graph":47,"./lodash":50}],50:[function(t,e){var r;if("function"==typeof t)try{r=t("lodash")}catch(n){}r||(r=window._),e.exports=r},{lodash:52}],51:[function(t,e){e.exports="1.0.7"},{}],52:[function(t,e,r){(function(t){(function(){function n(t,e){if(t!==e){var r=null===t,n=t===k,i=t===t,a=null===e,s=e===k,o=e===e;if(t>e&&!a||!i||r&&!s&&o||n&&o)return 1;if(e>t&&!r||!o||a&&!n&&i||s&&i)return-1}return 0}function i(t,e,r){for(var n=t.length,i=r?n:-1;r?i--:++i-1;);return r}function c(t,e){for(var r=t.length;r--&&e.indexOf(t.charAt(r))>-1;);return r}function l(t,e){return n(t.criteria,e.criteria)||t.index-e.index}function h(t,e,r){for(var i=-1,a=t.criteria,s=e.criteria,o=a.length,u=r.length;++i=u)return c;var l=r[i];return c*("asc"===l||l===!0?1:-1)}}return t.index-e.index}function d(t){return Vt[t]}function f(t){return $t[t]}function p(t,e,r){return e?t=zt[t]:r&&(t=Zt[t]),"\\"+t}function g(t){return"\\"+Zt[t]}function y(t,e,r){for(var n=t.length,i=e+(r?0:-1);r?i--:++i=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function b(t,e){for(var r=-1,n=t.length,i=-1,a=[];++re,i=r?t.length:0,a=$r(0,i,this.__views__),s=a.start,o=a.end,u=o-s,c=n?o:s-1,l=this.__iteratees__,h=l.length,d=0,f=ws(u,this.__takeCount__);if(!r||j>i||i==u&&f==u)return rr(n&&r?t.reverse():t,this.__actions__);var p=[];t:for(;u--&&f>d;){c+=e;for(var g=-1,y=t[c];++g=j?pr(e):null,c=e.length;u&&(s=Kt,o=!1,e=u);t:for(;++ir&&(r=-r>i?0:i+r),n=n===k||n>i?i:+n||0,0>n&&(n+=i),i=r>n?0:n>>>0,r>>>=0;i>r;)t[r++]=e;return t}function Ce(t,e){var r=[];return Ns(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r}function Fe(t,e,r,n){var i;return r(t,function(t,r,a){return e(t,r,a)?(i=n?r:t,!1):void 0}),i}function Te(t,e,r,n){n||(n=[]);for(var i=-1,a=t.length;++in;)t=t[e[n++]];return n&&n==i?t:k}}function Ne(t,e,r,n,i,a){return t===e?!0:null==t||null==e||!Ii(t)&&!m(e)?t!==t&&e!==e:Me(t,e,Ne,r,n,i,a)}function Me(t,e,r,n,i,a,s){var o=To(t),u=To(e),c=H,l=H;o||(c=rs.call(t),c==$?c=Q:c!=Q&&(o=Gi(t))),u||(l=rs.call(e),l==$?l=Q:l!=Q&&(u=Gi(e)));var h=c==Q,d=l==Q,f=c==l;if(f&&!o&&!h)return Rr(t,e,c);if(!i){var p=h&&ts.call(t,"__wrapped__"),g=d&&ts.call(e,"__wrapped__");if(p||g)return r(p?t.value():t,g?e.value():e,n,i,a,s)}if(!f)return!1;a||(a=[]),s||(s=[]);for(var y=a.length;y--;)if(a[y]==t)return s[y]==e;a.push(t),s.push(e);var m=(o?Pr:qr)(t,e,r,n,i,a,s);return a.pop(),s.pop(),m}function Pe(t,e,r){var n=e.length,i=n,a=!r;if(null==t)return!i;for(t=hn(t);n--;){var s=e[n];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++ne&&(e=-e>i?0:i+e),r=r===k||r>i?i:+r||0,0>r&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=ja(i);++n=j,u=o?pr():null,c=[];u?(n=Kt,s=!1):(o=!1,u=e?[]:c);t:for(;++r=i){for(;i>n;){var a=n+i>>>1,s=t[a];(r?e>=s:e>s)&&null!==s?n=a+1:i=a}return i}return ir(t,e,Ca,r)}function ir(t,e,r,n){e=r(e);for(var i=0,a=t?t.length:0,s=e!==e,o=null===e,u=e===k;a>i;){var c=ms((i+a)/2),l=r(t[c]),h=l!==k,d=l===l;if(s)var f=d||n;else f=o?d&&h&&(n||null!=l):u?d&&(n||h):null==l?!1:n?e>=l:e>l;f?i=c+1:a=c}return ws(a,Ts)}function ar(t,e,r){if("function"!=typeof t)return Ca;if(e===k)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 3:return function(r,n,i){return t.call(e,r,n,i)};case 4:return function(r,n,i,a){return t.call(e,r,n,i,a)};case 5:return function(r,n,i,a,s){return t.call(e,r,n,i,a,s)}}return function(){return t.apply(e,arguments)}}function sr(t){var e=new as(t.byteLength),r=new fs(e);return r.set(new fs(t)),e}function or(t,e,r){for(var n=r.length,i=-1,a=As(t.length-n,0),s=-1,o=e.length,u=ja(o+a);++s2?r[i-2]:k,s=i>2?r[2]:k,o=i>1?r[i-1]:k;for("function"==typeof a?(a=ar(a,o,5),i-=2):(a="function"==typeof o?o:k,i-=a?1:0),s&&Jr(r[0],r[1],s)&&(a=3>i?k:a,i=1);++n-1?r[s]:k}return Fe(r,n,t)}}function Ar(t){return function(e,r,n){return e&&e.length?(r=jr(r,n,3),i(e,r,t)):-1}}function wr(t){return function(e,r,n){return r=jr(r,n,3),Fe(e,r,t,!0)}}function xr(t){return function(){for(var e,r=arguments.length,n=t?r:-1,i=0,a=ja(r);t?n--:++n=j)return e.plant(n).value();for(var i=0,s=r?a[i].apply(this,t):n;++iv){var E=o?te(o):k,D=As(c-v,0),T=p?x:k,S=p?k:x,B=p?A:k,I=p?k:A;e|=p?L:O,e&=~(p?O:L),g||(e&=~(C|F));var N=[t,e,r,B,T,I,S,E,u,D],M=Br.apply(k,N);return tn(t)&&Ys(M,N),M.placeholder=w,M}}var P=d?r:this,R=f?P[t]:t;return o&&(A=un(A,o)),h&&u=e||!bs(e))return"";var i=e-n;return r=null==r?" ":r+"",ya(r,gs(i/r.length)).slice(0,i)}function Or(t,e,r,n){function i(){for(var e=-1,o=arguments.length,u=-1,c=n.length,l=ja(c+o);++uu))return!1;for(;++o-1&&t%1==0&&e>t}function Jr(t,e,r){if(!Ii(r))return!1;var n=typeof e;if("number"==n?Xr(r)&&Kr(e,r.length):"string"==n&&e in r){var i=r[e];return t===t?t===i:i!==i}return!1}function Qr(t,e){var r=typeof t;if("string"==r&&kt.test(t)||"number"==r)return!0;if(To(t))return!1;var n=!Et.test(t);return n||null!=e&&t in hn(e)}function tn(t){var r=Ur(t);if(!(r in K.prototype))return!1;var n=e[r];if(t===n)return!0;var i=js(n);return!!i&&t===i[0]}function en(t){return"number"==typeof t&&t>-1&&t%1==0&&Bs>=t}function rn(t){return t===t&&!Ii(t)}function nn(t,e){var r=t[1],n=e[1],i=r|n,a=I>i,s=n==I&&r==S||n==I&&r==N&&t[7].length<=e[8]||n==(I|N)&&r==S;if(!a&&!s)return t;n&C&&(t[2]=e[2],i|=r&C?0:T);var o=e[3];if(o){var u=t[3];t[3]=u?or(u,o,e[4]):te(o),t[4]=u?b(t[3],V):te(e[4])}return o=e[5],o&&(u=t[5],t[5]=u?ur(u,o,e[6]):te(o),t[6]=u?b(t[5],V):te(e[6])),o=e[7],o&&(t[7]=te(o)),n&I&&(t[8]=null==t[8]?e[8]:ws(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}function an(t,e){return t===k?e:So(t,e,an)}function sn(t,e){t=hn(t);for(var r=-1,n=e.length,i={};++rn;)s[++a]=ze(t,n,n+=e);return s}function gn(t){for(var e=-1,r=t?t.length:0,n=-1,i=[];++ee?0:e)):[]}function mn(t,e,r){var n=t?t.length:0;return n?((r?Jr(t,e,r):null==e)&&(e=1),e=n-(+e||0),ze(t,0,0>e?0:e)):[]}function vn(t,e,r){return t&&t.length?er(t,jr(e,r,3),!0,!0):[]}function bn(t,e,r){return t&&t.length?er(t,jr(e,r,3),!0):[]}function _n(t,e,r,n){var i=t?t.length:0;return i?(r&&"number"!=typeof r&&Jr(t,e,r)&&(r=0,n=i),De(t,e,r,n)):[]}function An(t){return t?t[0]:k}function wn(t,e,r){var n=t?t.length:0;return r&&Jr(t,e,r)&&(e=!1),n?Te(t,e):[]}function xn(t){var e=t?t.length:0;return e?Te(t,!0):[]}function En(t,e,r){var n=t?t.length:0;if(!n)return-1;if("number"==typeof r)r=0>r?As(n+r,0):r;else if(r){var i=nr(t,e);return n>i&&(e===e?e===t[i]:t[i]!==t[i])?i:-1}return a(t,e,r||0)}function kn(t){return mn(t,1)}function Dn(t){var e=t?t.length:0;return e?t[e-1]:k}function Cn(t,e,r){var n=t?t.length:0;if(!n)return-1;var i=n;if("number"==typeof r)i=(0>r?As(n+r,0):ws(r||0,n-1))+1;else if(r){i=nr(t,e,!0)-1;var a=t[i];return(e===e?e===a:a!==a)?i:-1}if(e!==e)return y(t,i,!0);for(;i--;)if(t[i]===e)return i;return-1}function Fn(){var t=arguments,e=t[0];if(!e||!e.length)return e;for(var r=0,n=Yr(),i=t.length;++r-1;)ds.call(e,a,1);return e}function Tn(t,e,r){var n=[];if(!t||!t.length)return n;var i=-1,a=[],s=t.length;for(e=jr(e,r,3);++ie?0:e)):[]}function On(t,e,r){var n=t?t.length:0;return n?((r?Jr(t,e,r):null==e)&&(e=1),e=n-(+e||0),ze(t,0>e?0:e)):[]}function In(t,e,r){return t&&t.length?er(t,jr(e,r,3),!1,!0):[]}function Nn(t,e,r){return t&&t.length?er(t,jr(e,r,3)):[]}function Mn(t,e,r,n){var i=t?t.length:0;if(!i)return[];null!=e&&"boolean"!=typeof e&&(n=r,r=Jr(t,e,n)?k:e,e=!1);var s=jr();return(null!=r||s!==_e)&&(r=s(r,n,3)),e&&Yr()==a?_(t,r):Qe(t,r)}function Pn(t){if(!t||!t.length)return[];var e=-1,r=0;t=oe(t,function(t){return Xr(t)?(r=As(t.length,r),!0):void 0});for(var n=ja(r);++er?As(i+r,0):r||0,"string"==typeof t||!To(t)&&Yi(t)?i>=r&&t.indexOf(e,r)>-1:!!i&&Yr(t,e,r)>-1}function ti(t,e,r){var n=To(t)?ue:Re;return e=jr(e,r,3),n(t,e)}function ei(t,e){return ti(t,Oa(e))}function ri(t,e,r){var n=To(t)?oe:Ce;return e=jr(e,r,3),n(t,function(t,r,n){return!e(t,r,n)})}function ni(t,e,r){if(r?Jr(t,e,r):null==e){t=ln(t);var n=t.length;return n>0?t[He(0,n-1)]:k}var i=-1,a=Wi(t),n=a.length,s=n-1;for(e=ws(0>e?0:+e||0,n);++i0&&(r=e.apply(this,arguments)),1>=t&&(e=k),r}}function fi(t,e,r){function n(){f&&ss(f),c&&ss(c),g=0,c=f=p=k}function i(e,r){r&&ss(r),c=f=p=k,e&&(g=go(),l=t.apply(d,u),f||c||(u=d=k))}function a(){var t=e-(go()-h);0>=t||t>e?i(p,c):f=hs(a,t)}function s(){i(m,f)}function o(){if(u=arguments,h=go(),d=this,p=m&&(f||!v),y===!1)var r=v&&!f;else{c||v||(g=h);var n=y-(h-g),i=0>=n||n>y;i?(c&&(c=ss(c)),g=h,l=t.apply(d,u)):c||(c=hs(s,n))}return i&&f?f=ss(f):f||e===y||(f=hs(a,e)),r&&(i=!0,l=t.apply(d,u)),!i||f||c||(u=d=k),l}var u,c,l,h,d,f,p,g=0,y=!1,m=!0;if("function"!=typeof t)throw new Za(G);if(e=0>e?0:+e||0,r===!0){var v=!0;m=!1}else Ii(r)&&(v=!!r.leading,y="maxWait"in r&&As(+r.maxWait||0,e),m="trailing"in r?!!r.trailing:m);return o.cancel=n,o}function pi(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new Za(G);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s),s};return r.cache=new pi.Cache,r}function gi(t){if("function"!=typeof t)throw new Za(G);return function(){return!t.apply(this,arguments)}}function yi(t){return di(2,t)}function mi(t,e){if("function"!=typeof t)throw new Za(G);return e=As(e===k?t.length-1:+e||0,0),function(){for(var r=arguments,n=-1,i=As(r.length-e,0),a=ja(i);++ne}function Ei(t,e){return t>=e}function ki(t){return m(t)&&Xr(t)&&ts.call(t,"callee")&&!cs.call(t,"callee")}function Di(t){return t===!0||t===!1||m(t)&&rs.call(t)==W}function Ci(t){return m(t)&&rs.call(t)==z}function Fi(t){return!!t&&1===t.nodeType&&m(t)&&!ji(t)}function Ti(t){return null==t?!0:Xr(t)&&(To(t)||Yi(t)||ki(t)||m(t)&&Oi(t.splice))?!t.length:!jo(t).length}function Si(t,e,r,n){r="function"==typeof r?ar(r,n,3):k;var i=r?r(t,e):k;return i===k?Ne(t,e,r):!!i}function Bi(t){return m(t)&&"string"==typeof t.message&&rs.call(t)==Z}function Li(t){return"number"==typeof t&&bs(t)}function Oi(t){return Ii(t)&&rs.call(t)==X}function Ii(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Ni(t,e,r,n){return r="function"==typeof r?ar(r,n,3):k,Pe(t,Gr(e),r)}function Mi(t){return qi(t)&&t!=+t}function Pi(t){return null==t?!1:Oi(t)?is.test(Qa.call(t)):m(t)&&It.test(t)}function Ri(t){return null===t}function qi(t){return"number"==typeof t||m(t)&&rs.call(t)==J}function ji(t){var e;if(!m(t)||rs.call(t)!=Q||ki(t)||!ts.call(t,"constructor")&&(e=t.constructor,"function"==typeof e&&!(e instanceof e)))return!1;var r;return Se(t,function(t,e){r=e}),r===k||ts.call(t,r)}function Ui(t){return Ii(t)&&rs.call(t)==tt}function Yi(t){return"string"==typeof t||m(t)&&rs.call(t)==rt}function Gi(t){return m(t)&&en(t.length)&&!!Yt[rs.call(t)]}function Vi(t){return t===k}function $i(t,e){return e>t}function Hi(t,e){return e>=t}function Wi(t){var e=t?Us(t):0;return en(e)?e?te(t):[]:aa(t)}function zi(t){return be(t,ta(t))}function Zi(t,e,r){var n=Is(t);return r&&Jr(t,e,r)&&(e=k),e?me(n,e):n}function Xi(t){return Oe(t,ta(t))}function Ki(t,e,r){var n=null==t?k:Ie(t,dn(e),e+"");return n===k?r:n}function Ji(t,e){if(null==t)return!1;var r=ts.call(t,e);if(!r&&!Qr(e)){if(e=dn(e),t=1==e.length?t:Ie(t,ze(e,0,-1)),null==t)return!1;e=Dn(e),r=ts.call(t,e)}return r||en(t.length)&&Kr(e,t.length)&&(To(t)||ki(t))}function Qi(t,e,r){r&&Jr(t,e,r)&&(e=k);for(var n=-1,i=jo(t),a=i.length,s={};++n0;++nm?(m-y)/g:(m+y)/g,m=s*c-a*l,b=0>m?(m-y)/g:(m+y)/g,{x:v,y:b})}function n(t,e){return t*e>0}e.exports=r},{}],15:[function(t,e){function r(t,e){return t.intersect(e)}e.exports=r},{}],16:[function(t,e){function r(t,e,r){var i=t.x,a=t.y,s=[],o=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY;e.forEach(function(t){o=Math.min(o,t.x),u=Math.min(u,t.y)});for(var c=i-t.width/2-o,l=a-t.height/2-u,h=0;h1&&s.sort(function(t,e){var n=t.x-r.x,i=t.y-r.y,a=Math.sqrt(n*n+i*i),s=e.x-r.x,o=e.y-r.y,u=Math.sqrt(s*s+o*o);return u>a?-1:a===u?0:1}),s[0]):(console.log("NO INTERSECTION FOUND, RETURN NODE CENTER",t),t)}var n=t("./intersect-line");e.exports=r},{"./intersect-line":14}],17:[function(t,e){function r(t,e){var r,n,i=t.x,a=t.y,s=e.x-i,o=e.y-a,u=t.width/2,c=t.height/2;return Math.abs(o)*u>Math.abs(s)*c?(0>o&&(c=-c),r=0===o?0:c*s/o,n=c):(0>s&&(u=-u),r=u,n=0===s?0:u*o/s),{x:i+r,y:a+n}}e.exports=r},{}],18:[function(t,e){function r(t,e){var r=t.append("foreignObject").attr("width","100000"),i=r.append("xhtml:div"),a=e.label;switch(typeof a){case"function":i.insert(a);break;case"object":i.insert(function(){return a});break;default:i.html(a)}n.applyStyle(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap");var s,o;return i.each(function(){s=this.clientWidth,o=this.clientHeight}),r.attr("width",s).attr("height",o),r}var n=t("../util");e.exports=r},{"../util":28}],19:[function(t,e){function r(t,e,r){var s=e.label,o=t.append("g");"svg"===e.labelType?a(o,e):"string"!=typeof s||"html"===e.labelType?i(o,e):n(o,e);var u,c=o.node().getBBox();switch(r){case"top":u=-e.height/2;break;case"bottom":u=e.height/2-c.height;break;default:u=-c.height/2}return o.attr("transform","translate("+-c.width/2+","+u+")"),o}var n=t("./add-text-label"),i=t("./add-html-label"),a=t("./add-svg-label");e.exports=r},{"./add-html-label":18,"./add-svg-label":20,"./add-text-label":21}],20:[function(t,e){function r(t,e){var r=t;return r.node().appendChild(e.label),n.applyStyle(r,e.labelStyle),r}var n=t("../util");e.exports=r},{"../util":28}],21:[function(t,e){function r(t,e){for(var r=t.append("text"),a=n(e.label).split("\n"),s=0;so;++o)n(t,"borderLeft","_bl",r,s,o),n(t,"borderRight","_br",r,s,o)}}i.each(t.children(),e)}function n(t,e,r,n,i,s){var o={width:0,height:0,rank:s,borderType:e},u=i[e][s-1],c=a.addDummyNode(t,"border",o,r);i[e][s]=c,t.setParent(c,n),u&&t.setEdge(u,c,{weight:1})}var i=t("./lodash"),a=t("./util");e.exports=r},{"./lodash":39,"./util":58}],33:[function(t,e){"use strict";function r(t){var e=t.graph().rankdir.toLowerCase();("lr"===e||"rl"===e)&&i(t)}function n(t){var e=t.graph().rankdir.toLowerCase();("bt"===e||"rl"===e)&&s(t),("lr"===e||"rl"===e)&&(u(t),i(t))}function i(t){l.each(t.nodes(),function(e){a(t.node(e))}),l.each(t.edges(),function(e){a(t.edge(e))})}function a(t){var e=t.width;t.width=t.height,t.height=e}function s(t){l.each(t.nodes(),function(e){o(t.node(e))}),l.each(t.edges(),function(e){var r=t.edge(e);l.each(r.points,o),l.has(r,"y")&&o(r)})}function o(t){t.y=-t.y}function u(t){l.each(t.nodes(),function(e){c(t.node(e))}),l.each(t.edges(),function(e){var r=t.edge(e);l.each(r.points,c),l.has(r,"x")&&c(r)})}function c(t){var e=t.x;t.x=t.y,t.y=e}var l=t("./lodash");e.exports={adjust:r,undo:n}},{"./lodash":39}],34:[function(t,e){function r(){var t={};t._next=t._prev=t,this._sentinel=t}function n(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function i(t,e){return"_next"!==t&&"_prev"!==t?e:void 0}e.exports=r,r.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;return e!==t?(n(e),e):void 0},r.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&n(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},r.prototype.toString=function(){for(var t=[],e=this._sentinel,r=e._prev;r!==e;)t.push(JSON.stringify(r,i)),r=r._prev;return"["+t.join(", ")+"]"}},{}],35:[function(t,e){function r(t){var e=i.buildLayerMatrix(t),r=new a({compound:!0,multigraph:!0}).setGraph({});return n.each(t.nodes(),function(e){r.setNode(e,{label:e}),r.setParent(e,"layer"+t.node(e).rank)}),n.each(t.edges(),function(t){r.setEdge(t.v,t.w,{},t.name)}),n.each(e,function(t,e){var i="layer"+e;r.setNode(i,{rank:"same"}),n.reduce(t,function(t,e){return r.setEdge(t,e,{style:"invis"}),e})}),r}var n=t("./lodash"),i=t("./util"),a=t("./graphlib").Graph;e.exports={debugOrdering:r}},{"./graphlib":36,"./lodash":39,"./util":58}],36:[function(t,e){var r;if("function"==typeof t)try{r=t("graphlib")}catch(n){}r||(r=window.graphlib),e.exports=r},{graphlib:60}],37:[function(t,e){function r(t,e){if(t.nodeCount()<=1)return[];var r=a(t,e||l),i=n(r.graph,r.buckets,r.zeroIdx);return o.flatten(o.map(i,function(e){return t.outEdges(e.v,e.w)}),!0)}function n(t,e,r){for(var n,a=[],s=e[e.length-1],o=e[0];t.nodeCount();){for(;n=o.dequeue();)i(t,e,r,n);for(;n=s.dequeue();)i(t,e,r,n);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(n=e[u].dequeue()){a=a.concat(i(t,e,r,n,!0));break}}return a}function i(t,e,r,n,i){var a=i?[]:void 0;return o.each(t.inEdges(n.v),function(n){var o=t.edge(n),u=t.node(n.v);i&&a.push({v:n.v,w:n.w}),u.out-=o,s(e,r,u)}),o.each(t.outEdges(n.v),function(n){var i=t.edge(n),a=n.w,o=t.node(a);o["in"]-=i,s(e,r,o)}),t.removeNode(n.v),a}function a(t,e){var r=new u,n=0,i=0;o.each(t.nodes(),function(t){r.setNode(t,{v:t,"in":0,out:0})}),o.each(t.edges(),function(t){var a=r.edge(t.v,t.w)||0,s=e(t),o=a+s;r.setEdge(t.v,t.w,o),i=Math.max(i,r.node(t.v).out+=s),n=Math.max(n,r.node(t.w)["in"]+=s)});var a=o.range(i+n+3).map(function(){return new c}),l=n+1;return o.each(r.nodes(),function(t){s(a,l,r.node(t))}),{graph:r,buckets:a,zeroIdx:l}}function s(t,e,r){r.out?r["in"]?t[r.out-r["in"]+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}var o=t("./lodash"),u=t("./graphlib").Graph,c=t("./data/list");e.exports=r;var l=o.constant(1)},{"./data/list":34,"./graphlib":36,"./lodash":39}],38:[function(t,e){"use strict";function r(t,e){var r=e&&e.debugTiming?L.time:L.notime;r("layout",function(){var e=r(" buildLayoutGraph",function(){return a(t)});r(" runLayout",function(){n(e,r)}),r(" updateInputGraph",function(){i(t,e)})})}function n(t,e){e(" makeSpaceForEdgeLabels",function(){s(t)}),e(" removeSelfEdges",function(){g(t)}),e(" acyclic",function(){A.run(t)}),e(" nestingGraph.run",function(){C.run(t)}),e(" rank",function(){x(L.asNonCompoundGraph(t))}),e(" injectEdgeLabelProxies",function(){o(t)}),e(" removeEmptyRanks",function(){D(t)}),e(" nestingGraph.cleanup",function(){C.cleanup(t)}),e(" normalizeRanks",function(){E(t)}),e(" assignRankMinMax",function(){u(t)}),e(" removeEdgeLabelProxies",function(){c(t)}),e(" normalize.run",function(){w.run(t)}),e(" parentDummyChains",function(){k(t)}),e(" addBorderSegments",function(){F(t)}),e(" order",function(){S(t)}),e(" insertSelfEdges",function(){y(t)}),e(" adjustCoordinateSystem",function(){T.adjust(t)}),e(" position",function(){B(t)}),e(" positionSelfEdges",function(){m(t)}),e(" removeBorderNodes",function(){p(t)}),e(" normalize.undo",function(){w.undo(t)}),e(" fixupEdgeLabelCoords",function(){d(t)}),e(" undoCoordinateSystem",function(){T.undo(t)}),e(" translateGraph",function(){l(t)}),e(" assignNodeIntersects",function(){h(t)}),e(" reversePoints",function(){f(t)}),e(" acyclic.undo",function(){A.undo(t)})}function i(t,e){_.each(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),_.each(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,_.has(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function a(t){var e=new I({multigraph:!0,compound:!0}),r=b(t.graph());return e.setGraph(_.merge({},N,v(r,O),_.pick(r,M))),_.each(t.nodes(),function(r){var n=b(t.node(r));e.setNode(r,_.defaults(v(n,R),P)),e.setParent(r,t.parent(r))}),_.each(t.edges(),function(r){var n=b(t.edge(r));e.setEdge(r,_.merge({},j,v(n,q),_.pick(n,U)))}),e}function s(t){var e=t.graph();e.ranksep/=2,_.each(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function o(t){_.each(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e:e};L.addDummyNode(t,"edge-proxy",a,"_ep")}})}function u(t){var e=0;_.each(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=_.max(e,n.maxRank))}),t.graph().maxRank=e}function c(t){_.each(t.nodes(),function(e){var r=t.node(e);"edge-proxy"===r.dummy&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function l(t){function e(t){var e=t.x,s=t.y,o=t.width,u=t.height;r=Math.min(r,e-o/2),n=Math.max(n,e+o/2),i=Math.min(i,s-u/2),a=Math.max(a,s+u/2)}var r=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,a=0,s=t.graph(),o=s.marginx||0,u=s.marginy||0;_.each(t.nodes(),function(r){e(t.node(r))}),_.each(t.edges(),function(r){var n=t.edge(r);_.has(n,"x")&&e(n)}),r-=o,i-=u,_.each(t.nodes(),function(e){var n=t.node(e);n.x-=r,n.y-=i}),_.each(t.edges(),function(e){var n=t.edge(e);_.each(n.points,function(t){t.x-=r,t.y-=i}),_.has(n,"x")&&(n.x-=r),_.has(n,"y")&&(n.y-=i)}),s.width=n-r+o,s.height=a-i+u}function h(t){_.each(t.edges(),function(e){var r,n,i=t.edge(e),a=t.node(e.v),s=t.node(e.w);i.points?(r=i.points[0],n=i.points[i.points.length-1]):(i.points=[],r=s,n=a),i.points.unshift(L.intersectRect(a,r)),i.points.push(L.intersectRect(s,n))})}function d(t){_.each(t.edges(),function(e){var r=t.edge(e);if(_.has(r,"x"))switch(("l"===r.labelpos||"r"===r.labelpos)&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}function f(t){_.each(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function p(t){_.each(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(_.last(r.borderLeft)),s=t.node(_.last(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),_.each(t.nodes(),function(e){"border"===t.node(e).dummy&&t.removeNode(e)})}function g(t){_.each(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}function y(t){var e=L.buildLayerMatrix(t);_.each(e,function(e){var r=0;_.each(e,function(e,n){var i=t.node(e);i.order=n+r,_.each(i.selfEdges,function(e){L.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:n+ ++r,e:e.e,label:e.label},"_se")}),delete i.selfEdges})})}function m(t){_.each(t.nodes(),function(e){var r=t.node(e);if("selfedge"===r.dummy){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function v(t,e){return _.mapValues(_.pick(t,e),Number)}function b(t){var e={};return _.each(t,function(t,r){e[r.toLowerCase()]=t}),e}var _=t("./lodash"),A=t("./acyclic"),w=t("./normalize"),x=t("./rank"),E=t("./util").normalizeRanks,k=t("./parent-dummy-chains"),D=t("./util").removeEmptyRanks,C=t("./nesting-graph"),F=t("./add-border-segments"),T=t("./coordinate-system"),S=t("./order"),B=t("./position"),L=t("./util"),I=t("./graphlib").Graph;e.exports=r;var O=["nodesep","edgesep","ranksep","marginx","marginy"],N={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},M=["acyclicer","ranker","rankdir","align"],R=["width","height"],P={width:0,height:0},q=["minlen","weight","width","height","labeloffset"],j={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},U=["labelpos"]},{"./acyclic":31,"./add-border-segments":32,"./coordinate-system":33,"./graphlib":36,"./lodash":39,"./nesting-graph":40,"./normalize":41,"./order":46,"./parent-dummy-chains":51,"./position":53,"./rank":55,"./util":58}],39:[function(t,e){var r;if("function"==typeof t)try{r=t("lodash")}catch(n){}r||(r=window._),e.exports=r},{lodash:81}],40:[function(t,e){function r(t){var e=u.addDummyNode(t,"root",{},"_root"),r=i(t),s=o.max(r)-1,c=2*s+1;t.graph().nestingRoot=e,o.each(t.edges(),function(e){t.edge(e).minlen*=c});var l=a(t)+1;o.each(t.children(),function(i){n(t,e,c,l,s,r,i)}),t.graph().nodeRankFactor=c}function n(t,e,r,i,a,s,c){var l=t.children(c);if(!l.length)return void(c!==e&&t.setEdge(e,c,{weight:0,minlen:r}));var h=u.addBorderNode(t,"_bt"),d=u.addBorderNode(t,"_bb"),f=t.node(c);t.setParent(h,c),f.borderTop=h,t.setParent(d,c),f.borderBottom=d,o.each(l,function(o){n(t,e,r,i,a,s,o);var u=t.node(o),l=u.borderTop?u.borderTop:o,f=u.borderBottom?u.borderBottom:o,p=u.borderTop?i:2*i,g=l!==f?1:a-s[c]+1;t.setEdge(h,l,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(f,d,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(c)||t.setEdge(e,h,{weight:0,minlen:a+s[c]})}function i(t){function e(n,i){var a=t.children(n);a&&a.length&&o.each(a,function(t){e(t,i+1)}),r[n]=i}var r={};return o.each(t.children(),function(t){e(t,1)}),r}function a(t){return o.reduce(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function s(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,o.each(t.edges(),function(e){var r=t.edge(e);r.nestingEdge&&t.removeEdge(e)})}var o=t("./lodash"),u=t("./util");e.exports={run:r,cleanup:s}},{"./lodash":39,"./util":58}],41:[function(t,e){"use strict";function r(t){t.graph().dummyChains=[],a.each(t.edges(),function(e){n(t,e)})}function n(t,e){var r=e.v,n=t.node(r).rank,i=e.w,a=t.node(i).rank,o=e.name,u=t.edge(e),c=u.labelRank;if(a!==n+1){t.removeEdge(e);var l,h,d;for(d=0,++n;a>n;++d,++n)u.points=[],h={width:0,height:0,edgeLabel:u,edgeObj:e,rank:n},l=s.addDummyNode(t,"edge",h,"_d"),n===c&&(h.width=u.width,h.height=u.height,h.dummy="edge-label",h.labelpos=u.labelpos),t.setEdge(r,l,{weight:u.weight},o),0===d&&t.graph().dummyChains.push(l),r=l;t.setEdge(r,i,{weight:u.weight},o)}}function i(t){a.each(t.graph().dummyChains,function(e){var r,n=t.node(e),i=n.edgeLabel;for(t.setEdge(n.edgeObj,i);n.dummy;)r=t.successors(e)[0],t.removeNode(e),i.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),e=r,n=t.node(e)})}var a=t("./lodash"),s=t("./util");e.exports={run:r,undo:i}},{"./lodash":39,"./util":58}],42:[function(t,e){function r(t,e,r){var i,a={};n.each(r,function(r){for(var n,s,o=t.parent(r);o;){if(n=t.parent(o),n?(s=a[n],a[n]=o):(s=i,i=o),s&&s!==o)return void e.setEdge(s,o);o=n}})}var n=t("../lodash");e.exports=r},{"../lodash":39}],43:[function(t,e){function r(t,e){return n.map(e,function(e){var r=t.inEdges(e);if(r.length){var i=n.reduce(r,function(e,r){var n=t.edge(r),i=t.node(r.v);return{sum:e.sum+n.weight*i.order,weight:e.weight+n.weight}},{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}})}var n=t("../lodash");e.exports=r},{"../lodash":39}],44:[function(t,e){function r(t,e,r){var s=n(t),o=new a({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(e){return t.node(e)});return i.each(t.nodes(),function(n){var a=t.node(n),u=t.parent(n);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(o.setNode(n),o.setParent(n,u||s),i.each(t[r](n),function(e){var r=e.v===n?e.w:e.v,a=o.edge(r,n),s=i.isUndefined(a)?0:a.weight;o.setEdge(r,n,{weight:t.edge(e).weight+s})}),i.has(a,"minRank")&&o.setNode(n,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),o}function n(t){for(var e;t.hasNode(e=i.uniqueId("_root")););return e}var i=t("../lodash"),a=t("../graphlib").Graph;e.exports=r},{"../graphlib":36,"../lodash":39}],45:[function(t,e){"use strict";function r(t,e){for(var r=0,i=1;i0;)e%2&&(r+=u[e+1]),e=e-1>>1,u[e]+=t.weight;c+=t.weight*r})),c}var i=t("../lodash");e.exports=r},{"../lodash":39}],46:[function(t,e){"use strict";function r(t){var e=f.maxRank(t),r=n(t,s.range(1,e+1),"inEdges"),c=n(t,s.range(e-1,-1,-1),"outEdges"),l=o(t);a(t,l);for(var h,d=Number.POSITIVE_INFINITY,p=0,g=0;4>g;++p,++g){i(p%2?r:c,p%4>=2),l=f.buildLayerMatrix(t);var y=u(t,l);d>y&&(g=0,h=s.cloneDeep(l),d=y)}a(t,h)}function n(t,e,r){return s.map(e,function(e){return l(t,e,r)})}function i(t,e){var r=new d;s.each(t,function(t){var n=t.graph().root,i=c(t,n,r,e); -for(var o in t)s&&Kr(o,e)||"constructor"==o&&(i||!ts.call(t,o))||a.push(o);return a}function ea(t){t=hn(t);for(var e=-1,r=jo(t),n=r.length,i=ja(n);++e=ws(e,r)&&tr?0:+r||0,n),r-=e.length,r>=0&&t.indexOf(e,r)==r}function da(t){return t=o(t),t&&_t.test(t)?t.replace(vt,f):t}function fa(t){return t=o(t),t&&Ft.test(t)?t.replace(Ct,p):t||"(?:)"}function pa(t,e,r){t=o(t),e=+e;var n=t.length;if(n>=e||!bs(e))return t;var i=(e-n)/2,a=ms(i),s=gs(i);return r=Lr("",s,r),r.slice(0,a)+t+r}function ga(t,e,r){return(r?Jr(t,e,r):null==e)?e=0:e&&(e=+e),t=ba(t),Es(t,e||(Ot.test(t)?16:10))}function ya(t,e){var r="";if(t=o(t),e=+e,1>e||!t||!bs(e))return r;do e%2&&(r+=t),e=ms(e/2),t+=t;while(e);return r}function ma(t,e,r){return t=o(t),r=null==r?0:ws(0>r?0:+r||0,t.length),t.lastIndexOf(e,r)==r}function va(t,r,n){var i=e.templateSettings;n&&Jr(t,r,n)&&(r=n=k),t=o(t),r=ye(me({},n||r),i,ge);var a,s,u=ye(me({},r.imports),i.imports,ge),c=jo(u),l=tr(u,c),h=0,d=r.interpolate||Pt,f="__p += '",p=Wa((r.escape||Pt).source+"|"+d.source+"|"+(d===xt?Bt:Pt).source+"|"+(r.evaluate||Pt).source+"|$","g"),y="//# sourceURL="+("sourceURL"in r?r.sourceURL:"lodash.templateSources["+ ++Ut+"]")+"\n";t.replace(p,function(e,r,n,i,o,u){return n||(n=i),f+=t.slice(h,u).replace(Rt,g),r&&(a=!0,f+="' +\n__e("+r+") +\n'"),o&&(s=!0,f+="';\n"+o+";\n__p += '"),n&&(f+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),h=u+e.length,e}),f+="';\n";var m=r.variable;m||(f="with (obj) {\n"+f+"\n}\n"),f=(s?f.replace(pt,""):f).replace(gt,"$1").replace(yt,"$1;"),f="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var v=Ko(function(){return Ga(c,y+"return "+f).apply(k,l)});if(v.source=f,Bi(v))throw v;return v}function ba(t,e,r){var n=t;return(t=o(t))?(r?Jr(n,e,r):null==e)?t.slice(A(t),w(t)+1):(e+="",t.slice(u(t,e),c(t,e)+1)):t}function _a(t,e,r){var n=t;return t=o(t),t?t.slice((r?Jr(n,e,r):null==e)?A(t):u(t,e+"")):t}function Aa(t,e,r){var n=t;return t=o(t),t?(r?Jr(n,e,r):null==e)?t.slice(0,w(t)+1):t.slice(0,c(t,e+"")+1):t}function wa(t,e,r){r&&Jr(t,e,r)&&(e=k);var n=M,i=P;if(null!=e)if(Ii(e)){var a="separator"in e?e.separator:a;n="length"in e?+e.length||0:n,i="omission"in e?o(e.omission):i}else n=+e||0;if(t=o(t),n>=t.length)return t;var s=n-i.length;if(1>s)return i;var u=t.slice(0,s);if(null==a)return u+i;if(Ui(a)){if(t.slice(s).search(a)){var c,l,h=t.slice(0,s);for(a.global||(a=Wa(a.source,(Lt.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(h);)l=c.index;u=u.slice(0,null==l?s:l)}}else if(t.indexOf(a,s)!=s){var d=u.lastIndexOf(a);d>-1&&(u=u.slice(0,d))}return u+i}function xa(t){return t=o(t),t&&bt.test(t)?t.replace(mt,x):t}function Ea(t,e,r){return r&&Jr(t,e,r)&&(e=k),t=o(t),t.match(e||qt)||[]}function ka(t,e,r){return r&&Jr(t,e,r)&&(e=k),m(t)?Fa(t):_e(t,e)}function Da(t){return function(){return t}}function Ca(t){return t}function Fa(t){return qe(Ae(t,!0))}function Ta(t,e){return je(t,Ae(e,!0))}function Sa(t,e,r){if(null==r){var n=Ii(e),i=n?jo(e):k,a=i&&i.length?Oe(e,i):k;(a?a.length:n)||(a=!1,r=e,e=t,t=this)}a||(a=Oe(e,jo(e)));var s=!0,o=-1,u=Oi(t),c=a.length;r===!1?s=!1:Ii(r)&&"chain"in r&&(s=r.chain);for(;++ot||!bs(t))return[];var n=-1,i=ja(ws(t,Fs));for(e=ar(e,r,1);++nn?i[n]=e(n):e(n);return i}function Pa(t){var e=++es;return o(t)+e}function Ra(t,e){return(+t||0)+(+e||0)}function qa(t,e,r){return r&&Jr(t,e,r)&&(e=k),e=jr(e,r,3),1==e.length?fe(To(t)?t:ln(t),e):Je(t,e)}t=t?ne.defaults(re.Object(),t,ne.pick(re,jt)):re;{var ja=t.Array,Ua=t.Date,Ya=t.Error,Ga=t.Function,Va=t.Math,$a=t.Number,Ha=t.Object,Wa=t.RegExp,za=t.String,Za=t.TypeError,Xa=ja.prototype,Ka=Ha.prototype,Ja=za.prototype,Qa=Ga.prototype.toString,ts=Ka.hasOwnProperty,es=0,rs=Ka.toString,ns=re._,is=Wa("^"+Qa.call(ts).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),as=t.ArrayBuffer,ss=t.clearTimeout,os=t.parseFloat,us=Va.pow,cs=Ka.propertyIsEnumerable,ls=Vr(t,"Set"),hs=t.setTimeout,ds=Xa.splice,fs=t.Uint8Array,ps=Vr(t,"WeakMap"),gs=Va.ceil,ys=Vr(Ha,"create"),ms=Va.floor,vs=Vr(ja,"isArray"),bs=t.isFinite,_s=Vr(Ha,"keys"),As=Va.max,ws=Va.min,xs=Vr(Ua,"now"),Es=t.parseInt,ks=Va.random,Ds=$a.NEGATIVE_INFINITY,Cs=$a.POSITIVE_INFINITY,Fs=4294967295,Ts=Fs-1,Ss=Fs>>>1,Bs=9007199254740991,Ls=ps&&new ps,Os={};e.support={}}e.templateSettings={escape:At,evaluate:wt,interpolate:xt,variable:"",imports:{_:e}};var Is=function(){function t(){}return function(e){if(Ii(e)){t.prototype=e;var r=new t;t.prototype=k}return r||{}}}(),Ns=hr(Be),Ms=hr(Le,!0),Ps=dr(),Rs=dr(!0),qs=Ls?function(t,e){return Ls.set(t,e),t}:Ca,js=Ls?function(t){return Ls.get(t)}:La,Us=Ge("length"),Ys=function(){var t=0,e=0;return function(r,n){var i=go(),a=q-(i-e);if(e=i,a>0){if(++t>=R)return r}else t=0;return qs(r,n)}}(),Gs=mi(function(t,e){return m(t)&&Xr(t)?xe(t,Te(e,!1,!0)):[]}),Vs=Ar(),$s=Ar(!0),Hs=mi(function(t){for(var e=t.length,r=e,n=ja(h),i=Yr(),s=i==a,o=[];r--;){var u=t[r]=Xr(u=t[r])?u:[];n[r]=s&&u.length>=120?pr(r&&u):null}var c=t[0],l=-1,h=c?c.length:0,d=n[0];t:for(;++l2?t[e-2]:k,n=e>1?t[e-1]:k;return e>2&&"function"==typeof r?e-=2:(r=e>1&&"function"==typeof n?(--e,n):k,n=k),t.length=e,Rn(t,r,n)}),to=mi(function(t){return t=Te(t),this.thru(function(e){return Qt(To(e)?e:[hn(e)],t)})}),eo=mi(function(t,e){return ve(t,Te(e))}),ro=cr(function(t,e,r){ts.call(t,r)?++t[r]:t[r]=1}),no=_r(Ns),io=_r(Ms,!0),ao=Er(ee,Ns),so=Er(ie,Ms),oo=cr(function(t,e,r){ts.call(t,r)?t[r].push(e):t[r]=[e]}),uo=cr(function(t,e,r){t[r]=e}),co=mi(function(t,e,r){var n=-1,i="function"==typeof e,a=Qr(e),s=Xr(t)?ja(t.length):[];return Ns(t,function(t){var o=i?e:a&&null!=t?t[e]:k;s[++n]=o?o.apply(t,r):Zr(t,e,r)}),s}),lo=cr(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]}),ho=Sr(le,Ns),fo=Sr(he,Ms),po=mi(function(t,e){if(null==t)return[];var r=e[2];return r&&Jr(e[0],e[1],r)&&(e.length=1),Ke(t,Te(e),[])}),go=xs||function(){return(new Ua).getTime()},yo=mi(function(t,e,r){var n=C;if(r.length){var i=b(r,yo.placeholder);n|=L}return Mr(t,n,e,r,i)}),mo=mi(function(t,e){e=e.length?Te(e):Xi(t);for(var r=-1,n=e.length;++r0||0>e)?new K(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==k&&(e=+e||0,r=0>e?r.dropRight(-e):r.take(e-t)),r)},K.prototype.takeRightWhile=function(t,e){return this.reverse().takeWhile(t,e).reverse()},K.prototype.toArray=function(){return this.take(Cs)},Be(K.prototype,function(t,r){var n=/^(?:filter|map|reject)|While$/.test(r),i=/^(?:first|last)$/.test(r),a=e[i?"take"+("last"==r?"Right":""):r];a&&(e.prototype[r]=function(){var e=i?[1]:arguments,r=this.__chain__,s=this.__wrapped__,o=!!this.__actions__.length,u=s instanceof K,c=e[0],l=u||To(s);l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=function(t){return i&&r?a(t,1)[0]:a.apply(k,ce([t],e))},d={func:Gn,args:[h],thisArg:k},f=u&&!o;if(i&&!r)return f?(s=s.clone(),s.__actions__.push(d),t.call(s)):a.call(k,this.value())[0];if(!i&&l){s=f?s:new K(this);var p=t.apply(s,e);return p.__actions__.push(d),new v(p,r)}return this.thru(h)})}),ee(["join","pop","push","replace","shift","sort","splice","split","unshift"],function(t){var r=(/^(?:replace|split)$/.test(t)?Ja:Xa)[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:join|pop|replace|shift)$/.test(t);e.prototype[t]=function(){var t=arguments;return i&&!this.__chain__?r.apply(this.value(),t):this[n](function(e){return r.apply(e,t)})}}),Be(K.prototype,function(t,r){var n=e[r];if(n){var i=n.name,a=Os[i]||(Os[i]=[]);a.push({name:r,func:n})}}),Os[Br(k,F).name]=[{name:"wrapper",func:k}],K.prototype.clone=et,K.prototype.reverse=nt,K.prototype.value=Vt,e.prototype.chain=Vn,e.prototype.commit=$n,e.prototype.concat=to,e.prototype.plant=Hn,e.prototype.reverse=Wn,e.prototype.toString=zn,e.prototype.run=e.prototype.toJSON=e.prototype.valueOf=e.prototype.value=Zn,e.prototype.collect=e.prototype.map,e.prototype.head=e.prototype.first,e.prototype.select=e.prototype.filter,e.prototype.tail=e.prototype.rest,e}var k,D="3.10.1",C=1,F=2,T=4,S=8,B=16,L=32,O=64,I=128,N=256,M=30,P="...",R=150,q=16,j=200,U=1,Y=2,G="Expected a function",V="__lodash_placeholder__",$="[object Arguments]",H="[object Array]",W="[object Boolean]",z="[object Date]",Z="[object Error]",X="[object Function]",K="[object Map]",J="[object Number]",Q="[object Object]",tt="[object RegExp]",et="[object Set]",rt="[object String]",nt="[object WeakMap]",it="[object ArrayBuffer]",at="[object Float32Array]",st="[object Float64Array]",ot="[object Int8Array]",ut="[object Int16Array]",ct="[object Int32Array]",lt="[object Uint8Array]",ht="[object Uint8ClampedArray]",dt="[object Uint16Array]",ft="[object Uint32Array]",pt=/\b__p \+= '';/g,gt=/\b(__p \+=) '' \+/g,yt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mt=/&(?:amp|lt|gt|quot|#39|#96);/g,vt=/[&<>"'`]/g,bt=RegExp(mt.source),_t=RegExp(vt.source),At=/<%-([\s\S]+?)%>/g,wt=/<%([\s\S]+?)%>/g,xt=/<%=([\s\S]+?)%>/g,Et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,kt=/^\w*$/,Dt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,Ct=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,Ft=RegExp(Ct.source),Tt=/[\u0300-\u036f\ufe20-\ufe23]/g,St=/\\(\\)?/g,Bt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Lt=/\w*$/,Ot=/^0[xX]/,It=/^\[object .+?Constructor\]$/,Nt=/^\d+$/,Mt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Pt=/($^)/,Rt=/['\n\r\u2028\u2029\\]/g,qt=function(){var t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",e="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(t+"+(?="+t+e+")|"+t+"?"+e+"|"+t+"+|[0-9]+","g")}(),jt=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Ut=-1,Yt={};Yt[at]=Yt[st]=Yt[ot]=Yt[ut]=Yt[ct]=Yt[lt]=Yt[ht]=Yt[dt]=Yt[ft]=!0,Yt[$]=Yt[H]=Yt[it]=Yt[W]=Yt[z]=Yt[Z]=Yt[X]=Yt[K]=Yt[J]=Yt[Q]=Yt[tt]=Yt[et]=Yt[rt]=Yt[nt]=!1;var Gt={};Gt[$]=Gt[H]=Gt[it]=Gt[W]=Gt[z]=Gt[at]=Gt[st]=Gt[ot]=Gt[ut]=Gt[ct]=Gt[J]=Gt[Q]=Gt[tt]=Gt[rt]=Gt[lt]=Gt[ht]=Gt[dt]=Gt[ft]=!0,Gt[Z]=Gt[X]=Gt[K]=Gt[et]=Gt[nt]=!1;var Vt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},$t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ht={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Wt={"function":!0,object:!0},zt={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Zt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Xt=Wt[typeof r]&&r&&!r.nodeType&&r,Kt=Wt[typeof e]&&e&&!e.nodeType&&e,Jt=Xt&&Kt&&"object"==typeof t&&t&&t.Object&&t,Qt=Wt[typeof self]&&self&&self.Object&&self,te=Wt[typeof window]&&window&&window.Object&&window,ee=Kt&&Kt.exports===Xt&&Xt,re=Jt||te!==(this&&this.window)&&te||Qt||this,ne=E();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(re._=ne,define(function(){return ne})):Xt&&Kt?ee?(Kt.exports=ne)._=ne:Xt._=ne:re._=ne}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],53:[function(t,e){e.exports={graphlib:t("./lib/graphlib"),layout:t("./lib/layout"),debug:t("./lib/debug"),util:{time:t("./lib/util").time,notime:t("./lib/util").notime},version:t("./lib/version")}},{"./lib/debug":58,"./lib/graphlib":59,"./lib/layout":61,"./lib/util":81,"./lib/version":82}],54:[function(t,e){"use strict";function r(t){function e(t){return function(e){return t.edge(e).weight}}var r="greedy"===t.graph().acyclicer?s(t,e(t)):n(t);a.each(r,function(e){var r=t.edge(e);t.removeEdge(e),r.forwardName=e.name,r.reversed=!0,t.setEdge(e.w,e.v,r,a.uniqueId("rev"))})}function n(t){function e(s){a.has(i,s)||(i[s]=!0,n[s]=!0,a.each(t.outEdges(s),function(t){a.has(n,t.w)?r.push(t):e(t.w)}),delete n[s])}var r=[],n={},i={};return a.each(t.nodes(),e),r}function i(t){a.each(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}var a=t("./lodash"),s=t("./greedy-fas");e.exports={run:r,undo:i}},{"./greedy-fas":60,"./lodash":62}],55:[function(t,e){function r(t){function e(r){var a=t.children(r),s=t.node(r);if(a.length&&i.each(a,e),i.has(s,"minRank")){s.borderLeft=[],s.borderRight=[];for(var o=s.minRank,u=s.maxRank+1;u>o;++o)n(t,"borderLeft","_bl",r,s,o),n(t,"borderRight","_br",r,s,o)}}i.each(t.children(),e)}function n(t,e,r,n,i,s){var o={width:0,height:0,rank:s,borderType:e},u=i[e][s-1],c=a.addDummyNode(t,"border",o,r);i[e][s]=c,t.setParent(c,n),u&&t.setEdge(u,c,{weight:1})}var i=t("./lodash"),a=t("./util");e.exports=r},{"./lodash":62,"./util":81}],56:[function(t,e){"use strict";function r(t){var e=t.graph().rankdir.toLowerCase();("lr"===e||"rl"===e)&&i(t)}function n(t){var e=t.graph().rankdir.toLowerCase();("bt"===e||"rl"===e)&&s(t),("lr"===e||"rl"===e)&&(u(t),i(t))}function i(t){l.each(t.nodes(),function(e){a(t.node(e))}),l.each(t.edges(),function(e){a(t.edge(e))})}function a(t){var e=t.width;t.width=t.height,t.height=e}function s(t){l.each(t.nodes(),function(e){o(t.node(e))}),l.each(t.edges(),function(e){var r=t.edge(e);l.each(r.points,o),l.has(r,"y")&&o(r)})}function o(t){t.y=-t.y}function u(t){l.each(t.nodes(),function(e){c(t.node(e))}),l.each(t.edges(),function(e){var r=t.edge(e);l.each(r.points,c),l.has(r,"x")&&c(r)})}function c(t){var e=t.x;t.x=t.y,t.y=e}var l=t("./lodash");e.exports={adjust:r,undo:n}},{"./lodash":62}],57:[function(t,e){function r(){var t={};t._next=t._prev=t,this._sentinel=t}function n(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function i(t,e){return"_next"!==t&&"_prev"!==t?e:void 0}e.exports=r,r.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;return e!==t?(n(e),e):void 0},r.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&n(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},r.prototype.toString=function(){for(var t=[],e=this._sentinel,r=e._prev;r!==e;)t.push(JSON.stringify(r,i)),r=r._prev;return"["+t.join(", ")+"]"}},{}],58:[function(t,e){function r(t){var e=i.buildLayerMatrix(t),r=new a({compound:!0,multigraph:!0}).setGraph({});return n.each(t.nodes(),function(e){r.setNode(e,{label:e}),r.setParent(e,"layer"+t.node(e).rank)}),n.each(t.edges(),function(t){r.setEdge(t.v,t.w,{},t.name)}),n.each(e,function(t,e){var i="layer"+e;r.setNode(i,{rank:"same"}),n.reduce(t,function(t,e){return r.setEdge(t,e,{style:"invis"}),e})}),r}var n=t("./lodash"),i=t("./util"),a=t("./graphlib").Graph;e.exports={debugOrdering:r}},{"./graphlib":59,"./lodash":62,"./util":81}],59:[function(t,e){var r;if("function"==typeof t)try{r=t("graphlib")}catch(n){}r||(r=window.graphlib),e.exports=r},{graphlib:83}],60:[function(t,e){function r(t,e){if(t.nodeCount()<=1)return[];var r=a(t,e||l),i=n(r.graph,r.buckets,r.zeroIdx);return o.flatten(o.map(i,function(e){return t.outEdges(e.v,e.w)}),!0)}function n(t,e,r){for(var n,a=[],s=e[e.length-1],o=e[0];t.nodeCount();){for(;n=o.dequeue();)i(t,e,r,n);for(;n=s.dequeue();)i(t,e,r,n);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(n=e[u].dequeue()){a=a.concat(i(t,e,r,n,!0));break}}return a}function i(t,e,r,n,i){var a=i?[]:void 0;return o.each(t.inEdges(n.v),function(n){var o=t.edge(n),u=t.node(n.v);i&&a.push({v:n.v,w:n.w}),u.out-=o,s(e,r,u)}),o.each(t.outEdges(n.v),function(n){var i=t.edge(n),a=n.w,o=t.node(a);o["in"]-=i,s(e,r,o)}),t.removeNode(n.v),a}function a(t,e){var r=new u,n=0,i=0;o.each(t.nodes(),function(t){r.setNode(t,{v:t,"in":0,out:0})}),o.each(t.edges(),function(t){var a=r.edge(t.v,t.w)||0,s=e(t),o=a+s;r.setEdge(t.v,t.w,o),i=Math.max(i,r.node(t.v).out+=s),n=Math.max(n,r.node(t.w)["in"]+=s)});var a=o.range(i+n+3).map(function(){return new c}),l=n+1;return o.each(r.nodes(),function(t){s(a,l,r.node(t))}),{graph:r,buckets:a,zeroIdx:l}}function s(t,e,r){r.out?r["in"]?t[r.out-r["in"]+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}var o=t("./lodash"),u=t("./graphlib").Graph,c=t("./data/list");e.exports=r;var l=o.constant(1)},{"./data/list":57,"./graphlib":59,"./lodash":62}],61:[function(t,e){"use strict";function r(t,e){var r=e&&e.debugTiming?L.time:L.notime;r("layout",function(){var e=r(" buildLayoutGraph",function(){return a(t)});r(" runLayout",function(){n(e,r)}),r(" updateInputGraph",function(){i(t,e)})})}function n(t,e){e(" makeSpaceForEdgeLabels",function(){s(t)}),e(" removeSelfEdges",function(){g(t)}),e(" acyclic",function(){A.run(t)}),e(" nestingGraph.run",function(){C.run(t)}),e(" rank",function(){x(L.asNonCompoundGraph(t))}),e(" injectEdgeLabelProxies",function(){o(t)}),e(" removeEmptyRanks",function(){D(t)}),e(" nestingGraph.cleanup",function(){C.cleanup(t)}),e(" normalizeRanks",function(){E(t)}),e(" assignRankMinMax",function(){u(t)}),e(" removeEdgeLabelProxies",function(){c(t)}),e(" normalize.run",function(){w.run(t)}),e(" parentDummyChains",function(){k(t)}),e(" addBorderSegments",function(){F(t)}),e(" order",function(){S(t)}),e(" insertSelfEdges",function(){y(t)}),e(" adjustCoordinateSystem",function(){T.adjust(t)}),e(" position",function(){B(t)}),e(" positionSelfEdges",function(){m(t)}),e(" removeBorderNodes",function(){p(t)}),e(" normalize.undo",function(){w.undo(t)}),e(" fixupEdgeLabelCoords",function(){d(t)}),e(" undoCoordinateSystem",function(){T.undo(t)}),e(" translateGraph",function(){l(t)}),e(" assignNodeIntersects",function(){h(t)}),e(" reversePoints",function(){f(t)}),e(" acyclic.undo",function(){A.undo(t)})}function i(t,e){_.each(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),_.each(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,_.has(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function a(t){var e=new O({multigraph:!0,compound:!0}),r=b(t.graph());return e.setGraph(_.merge({},N,v(r,I),_.pick(r,M))),_.each(t.nodes(),function(r){var n=b(t.node(r));e.setNode(r,_.defaults(v(n,P),R)),e.setParent(r,t.parent(r))}),_.each(t.edges(),function(r){var n=b(t.edge(r));e.setEdge(r,_.merge({},j,v(n,q),_.pick(n,U)))}),e}function s(t){var e=t.graph();e.ranksep/=2,_.each(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function o(t){_.each(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e:e};L.addDummyNode(t,"edge-proxy",a,"_ep")}})}function u(t){var e=0;_.each(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=_.max(e,n.maxRank))}),t.graph().maxRank=e}function c(t){_.each(t.nodes(),function(e){var r=t.node(e);"edge-proxy"===r.dummy&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function l(t){function e(t){var e=t.x,s=t.y,o=t.width,u=t.height;r=Math.min(r,e-o/2),n=Math.max(n,e+o/2),i=Math.min(i,s-u/2),a=Math.max(a,s+u/2)}var r=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,a=0,s=t.graph(),o=s.marginx||0,u=s.marginy||0;_.each(t.nodes(),function(r){e(t.node(r))}),_.each(t.edges(),function(r){var n=t.edge(r);_.has(n,"x")&&e(n)}),r-=o,i-=u,_.each(t.nodes(),function(e){var n=t.node(e);n.x-=r,n.y-=i}),_.each(t.edges(),function(e){var n=t.edge(e);_.each(n.points,function(t){t.x-=r,t.y-=i}),_.has(n,"x")&&(n.x-=r),_.has(n,"y")&&(n.y-=i)}),s.width=n-r+o,s.height=a-i+u}function h(t){_.each(t.edges(),function(e){var r,n,i=t.edge(e),a=t.node(e.v),s=t.node(e.w);i.points?(r=i.points[0],n=i.points[i.points.length-1]):(i.points=[],r=s,n=a),i.points.unshift(L.intersectRect(a,r)),i.points.push(L.intersectRect(s,n))})}function d(t){_.each(t.edges(),function(e){var r=t.edge(e);if(_.has(r,"x"))switch(("l"===r.labelpos||"r"===r.labelpos)&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}function f(t){_.each(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function p(t){_.each(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(_.last(r.borderLeft)),s=t.node(_.last(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),_.each(t.nodes(),function(e){"border"===t.node(e).dummy&&t.removeNode(e)})}function g(t){_.each(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}function y(t){var e=L.buildLayerMatrix(t);_.each(e,function(e){var r=0;_.each(e,function(e,n){var i=t.node(e);i.order=n+r,_.each(i.selfEdges,function(e){L.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:n+ ++r,e:e.e,label:e.label},"_se")}),delete i.selfEdges})})}function m(t){_.each(t.nodes(),function(e){var r=t.node(e);if("selfedge"===r.dummy){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function v(t,e){return _.mapValues(_.pick(t,e),Number)}function b(t){var e={};return _.each(t,function(t,r){e[r.toLowerCase()]=t}),e}var _=t("./lodash"),A=t("./acyclic"),w=t("./normalize"),x=t("./rank"),E=t("./util").normalizeRanks,k=t("./parent-dummy-chains"),D=t("./util").removeEmptyRanks,C=t("./nesting-graph"),F=t("./add-border-segments"),T=t("./coordinate-system"),S=t("./order"),B=t("./position"),L=t("./util"),O=t("./graphlib").Graph;e.exports=r;var I=["nodesep","edgesep","ranksep","marginx","marginy"],N={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},M=["acyclicer","ranker","rankdir","align"],P=["width","height"],R={width:0,height:0},q=["minlen","weight","width","height","labeloffset"],j={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},U=["labelpos"]},{"./acyclic":54,"./add-border-segments":55,"./coordinate-system":56,"./graphlib":59,"./lodash":62,"./nesting-graph":63,"./normalize":64,"./order":69,"./parent-dummy-chains":74,"./position":76,"./rank":78,"./util":81}],62:[function(t,e){e.exports=t(50)},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\lodash.js":50,lodash:103}],63:[function(t,e){function r(t){var e=u.addDummyNode(t,"root",{},"_root"),r=i(t),s=o.max(r)-1,c=2*s+1;t.graph().nestingRoot=e,o.each(t.edges(),function(e){t.edge(e).minlen*=c});var l=a(t)+1;o.each(t.children(),function(i){n(t,e,c,l,s,r,i)}),t.graph().nodeRankFactor=c}function n(t,e,r,i,a,s,c){var l=t.children(c);if(!l.length)return void(c!==e&&t.setEdge(e,c,{ -weight:0,minlen:r}));var h=u.addBorderNode(t,"_bt"),d=u.addBorderNode(t,"_bb"),f=t.node(c);t.setParent(h,c),f.borderTop=h,t.setParent(d,c),f.borderBottom=d,o.each(l,function(o){n(t,e,r,i,a,s,o);var u=t.node(o),l=u.borderTop?u.borderTop:o,f=u.borderBottom?u.borderBottom:o,p=u.borderTop?i:2*i,g=l!==f?1:a-s[c]+1;t.setEdge(h,l,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(f,d,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(c)||t.setEdge(e,h,{weight:0,minlen:a+s[c]})}function i(t){function e(n,i){var a=t.children(n);a&&a.length&&o.each(a,function(t){e(t,i+1)}),r[n]=i}var r={};return o.each(t.children(),function(t){e(t,1)}),r}function a(t){return o.reduce(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function s(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,o.each(t.edges(),function(e){var r=t.edge(e);r.nestingEdge&&t.removeEdge(e)})}var o=t("./lodash"),u=t("./util");e.exports={run:r,cleanup:s}},{"./lodash":62,"./util":81}],64:[function(t,e){"use strict";function r(t){t.graph().dummyChains=[],a.each(t.edges(),function(e){n(t,e)})}function n(t,e){var r=e.v,n=t.node(r).rank,i=e.w,a=t.node(i).rank,o=e.name,u=t.edge(e),c=u.labelRank;if(a!==n+1){t.removeEdge(e);var l,h,d;for(d=0,++n;a>n;++d,++n)u.points=[],h={width:0,height:0,edgeLabel:u,edgeObj:e,rank:n},l=s.addDummyNode(t,"edge",h,"_d"),n===c&&(h.width=u.width,h.height=u.height,h.dummy="edge-label",h.labelpos=u.labelpos),t.setEdge(r,l,{weight:u.weight},o),0===d&&t.graph().dummyChains.push(l),r=l;t.setEdge(r,i,{weight:u.weight},o)}}function i(t){a.each(t.graph().dummyChains,function(e){var r,n=t.node(e),i=n.edgeLabel;for(t.setEdge(n.edgeObj,i);n.dummy;)r=t.successors(e)[0],t.removeNode(e),i.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),e=r,n=t.node(e)})}var a=t("./lodash"),s=t("./util");e.exports={run:r,undo:i}},{"./lodash":62,"./util":81}],65:[function(t,e){function r(t,e,r){var i,a={};n.each(r,function(r){for(var n,s,o=t.parent(r);o;){if(n=t.parent(o),n?(s=a[n],a[n]=o):(s=i,i=o),s&&s!==o)return void e.setEdge(s,o);o=n}})}var n=t("../lodash");e.exports=r},{"../lodash":62}],66:[function(t,e){function r(t,e){return n.map(e,function(e){var r=t.inEdges(e);if(r.length){var i=n.reduce(r,function(e,r){var n=t.edge(r),i=t.node(r.v);return{sum:e.sum+n.weight*i.order,weight:e.weight+n.weight}},{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}})}var n=t("../lodash");e.exports=r},{"../lodash":62}],67:[function(t,e){function r(t,e,r){var s=n(t),o=new a({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(e){return t.node(e)});return i.each(t.nodes(),function(n){var a=t.node(n),u=t.parent(n);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(o.setNode(n),o.setParent(n,u||s),i.each(t[r](n),function(e){var r=e.v===n?e.w:e.v,a=o.edge(r,n),s=i.isUndefined(a)?0:a.weight;o.setEdge(r,n,{weight:t.edge(e).weight+s})}),i.has(a,"minRank")&&o.setNode(n,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),o}function n(t){for(var e;t.hasNode(e=i.uniqueId("_root")););return e}var i=t("../lodash"),a=t("../graphlib").Graph;e.exports=r},{"../graphlib":59,"../lodash":62}],68:[function(t,e){"use strict";function r(t,e){for(var r=0,i=1;i0;)e%2&&(r+=u[e+1]),e=e-1>>1,u[e]+=t.weight;c+=t.weight*r})),c}var i=t("../lodash");e.exports=r},{"../lodash":62}],69:[function(t,e){"use strict";function r(t){var e=f.maxRank(t),r=n(t,s.range(1,e+1),"inEdges"),c=n(t,s.range(e-1,-1,-1),"outEdges"),l=o(t);a(t,l);for(var h,d=Number.POSITIVE_INFINITY,p=0,g=0;4>g;++p,++g){i(p%2?r:c,p%4>=2),l=f.buildLayerMatrix(t);var y=u(t,l);d>y&&(g=0,h=s.cloneDeep(l),d=y)}a(t,h)}function n(t,e,r){return s.map(e,function(e){return l(t,e,r)})}function i(t,e){var r=new d;s.each(t,function(t){var n=t.graph().root,i=c(t,n,r,e);s.each(i.vs,function(e,r){t.node(e).order=r}),h(t,r,i.vs)})}function a(t,e){s.each(e,function(e){s.each(e,function(e,r){t.node(e).order=r})})}var s=t("../lodash"),o=t("./init-order"),u=t("./cross-count"),c=t("./sort-subgraph"),l=t("./build-layer-graph"),h=t("./add-subgraph-constraints"),d=t("../graphlib").Graph,f=t("../util");e.exports=r},{"../graphlib":59,"../lodash":62,"../util":81,"./add-subgraph-constraints":65,"./build-layer-graph":67,"./cross-count":68,"./init-order":70,"./sort-subgraph":72}],70:[function(t,e){"use strict";function r(t){function e(i){if(!n.has(r,i)){r[i]=!0;var a=t.node(i);s[a.rank].push(i),n.each(t.successors(i),e)}}var r={},i=n.filter(t.nodes(),function(e){return!t.children(e).length}),a=n.max(n.map(i,function(e){return t.node(e).rank})),s=n.map(n.range(a+1),function(){return[]}),o=n.sortBy(i,function(e){return t.node(e).rank});return n.each(o,e),s}var n=t("../lodash");e.exports=r},{"../lodash":62}],71:[function(t,e){"use strict";function r(t,e){var r={};a.each(t,function(t,e){var n=r[t.v]={indegree:0,"in":[],out:[],vs:[t.v],i:e};a.isUndefined(t.barycenter)||(n.barycenter=t.barycenter,n.weight=t.weight)}),a.each(e.edges(),function(t){var e=r[t.v],n=r[t.w];a.isUndefined(e)||a.isUndefined(n)||(n.indegree++,e.out.push(r[t.w]))});var i=a.filter(r,function(t){return!t.indegree});return n(i)}function n(t){function e(t){return function(e){e.merged||(a.isUndefined(e.barycenter)||a.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&i(t,e)}}function r(e){return function(r){r["in"].push(e),0===--r.indegree&&t.push(r)}}for(var n=[];t.length;){var s=t.pop();n.push(s),a.each(s["in"].reverse(),e(s)),a.each(s.out,r(s))}return a.chain(n).filter(function(t){return!t.merged}).map(function(t){return a.pick(t,["vs","i","barycenter","weight"])}).value()}function i(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}var a=t("../lodash");e.exports=r},{"../lodash":62}],72:[function(t,e){function r(t,e,c,l){var h=t.children(e),d=t.node(e),f=d?d.borderLeft:void 0,p=d?d.borderRight:void 0,g={};f&&(h=a.filter(h,function(t){return t!==f&&t!==p}));var y=s(t,h);a.each(y,function(e){if(t.children(e.v).length){var n=r(t,e.v,c,l);g[e.v]=n,a.has(n,"barycenter")&&i(e,n)}});var m=o(y,c);n(m,g);var v=u(m,l);if(f&&(v.vs=a.flatten([f,v.vs,p],!0),t.predecessors(f).length)){var b=t.node(t.predecessors(f)[0]),_=t.node(t.predecessors(p)[0]);a.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+b.order+_.order)/(v.weight+2),v.weight+=2}return v}function n(t,e){a.each(t,function(t){t.vs=a.flatten(t.vs.map(function(t){return e[t]?e[t].vs:t}),!0)})}function i(t,e){a.isUndefined(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}var a=t("../lodash"),s=t("./barycenter"),o=t("./resolve-conflicts"),u=t("./sort");e.exports=r},{"../lodash":62,"./barycenter":66,"./resolve-conflicts":71,"./sort":73}],73:[function(t,e){function r(t,e){var r=s.partition(t,function(t){return a.has(t,"barycenter")}),o=r.lhs,u=a.sortBy(r.rhs,function(t){return-t.i}),c=[],l=0,h=0,d=0;o.sort(i(!!e)),d=n(c,u,d),a.each(o,function(t){d+=t.vs.length,c.push(t.vs),l+=t.barycenter*t.weight,h+=t.weight,d=n(c,u,d)});var f={vs:a.flatten(c,!0)};return h&&(f.barycenter=l/h,f.weight=h),f}function n(t,e,r){for(var n;e.length&&(n=a.last(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function i(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}var a=t("../lodash"),s=t("../util");e.exports=r},{"../lodash":62,"../util":81}],74:[function(t,e){function r(t){var e=i(t);a.each(t.graph().dummyChains,function(r){for(var i=t.node(r),a=i.edgeObj,s=n(t,e,a.v,a.w),o=s.path,u=s.lca,c=0,l=o[c],h=!0;r!==a.w;){if(i=t.node(r),h){for(;(l=o[c])!==u&&t.node(l).maxRanku||c>e[i].lim));for(a=i,i=n;(i=t.parent(i))!==a;)o.push(i);return{path:s.concat(o.reverse()),lca:a}}function i(t){function e(i){var s=n;a.each(t.children(i),e),r[i]={low:s,lim:n++}}var r={},n=0;return a.each(t.children(),e),r}var a=t("./lodash");e.exports=r},{"./lodash":62}],75:[function(t,e){"use strict";function r(t,e){function r(e,r){var s=0,o=0,u=e.length,c=y.last(r);return y.each(r,function(e,l){var h=i(t,e),d=h?t.node(h).order:u;(h||e===c)&&(y.each(r.slice(o,l+1),function(e){y.each(t.predecessors(e),function(r){var i=t.node(r),o=i.order;!(s>o||o>d)||i.dummy&&t.node(e).dummy||a(n,r,e)})}),o=l+1,s=d)}),r}var n={};return y.reduce(e,r),n}function n(t,e){function r(e,r,n,s,o){var u;y.each(y.range(r,n),function(r){u=e[r],t.node(u).dummy&&y.each(t.predecessors(u),function(e){var r=t.node(e);r.dummy&&(r.ordero)&&a(i,e,u)})})}function n(e,n){var i,a=-1,s=0;return y.each(n,function(o,u){if("border"===t.node(o).dummy){var c=t.predecessors(o);c.length&&(i=t.node(c[0]).order,r(n,s,u,a,i),s=u,a=i)}r(n,s,n.length,i,e.length)}),n}var i={};return y.reduce(e,n),i}function i(t,e){return t.node(e).dummy?y.find(t.predecessors(e),function(e){return t.node(e).dummy}):void 0}function a(t,e,r){if(e>r){var n=e;e=r,r=n}var i=t[e];i||(t[e]=i={}),i[r]=!0}function s(t,e,r){if(e>r){var n=e;e=r,r=n}return y.has(t[e],r)}function o(t,e,r,n){var i={},a={},o={};return y.each(e,function(t){y.each(t,function(t,e){i[t]=t,a[t]=t,o[t]=e})}),y.each(e,function(t){var e=-1;y.each(t,function(t){var u=n(t);if(u.length){u=y.sortBy(u,function(t){return o[t]});for(var c=(u.length-1)/2,l=Math.floor(c),h=Math.ceil(c);h>=l;++l){var d=u[l];a[t]===t&&es.lim&&(o=s,u=!0);var c=p.filter(e.edges(),function(e){return u===f(t,t.node(e.v),o)&&u!==f(t,t.node(e.w),o)});return p.min(c,function(t){return y(e,t)})}function l(t,e,r,i){var a=r.v,o=r.w;t.removeEdge(a,o),t.setEdge(i.v,i.w,{}),s(t),n(t,e),h(t,e)}function h(t,e){var r=p.find(t.nodes(),function(t){return!e.node(t).parent}),n=v(t,r);n=n.slice(1),p.each(n,function(r){var n=t.node(r).parent,i=e.edge(r,n),a=!1;i||(i=e.edge(n,r),a=!0),e.node(r).rank=e.node(n).rank+(a?i.minlen:-i.minlen)})}function d(t,e,r){return t.hasEdge(e,r)}function f(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}var p=t("../lodash"),g=t("./feasible-tree"),y=t("./util").slack,m=t("./util").longestPath,v=t("../graphlib").alg.preorder,b=t("../graphlib").alg.postorder,_=t("../util").simplify;e.exports=r,r.initLowLimValues=s,r.initCutValues=n,r.calcCutValue=a,r.leaveEdge=u,r.enterEdge=c,r.exchangeEdges=l},{"../graphlib":59,"../lodash":62,"../util":81,"./feasible-tree":77,"./util":80}],80:[function(t,e){"use strict";function r(t){function e(n){var a=t.node(n);if(i.has(r,n))return a.rank;r[n]=!0;var s=i.min(i.map(t.outEdges(n),function(r){return e(r.w)-t.edge(r).minlen}));return s===Number.POSITIVE_INFINITY&&(s=0),a.rank=s}var r={};i.each(t.sources(),e)}function n(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var i=t("../lodash");e.exports={longestPath:r,slack:n}},{"../lodash":62}],81:[function(t,e){"use strict";function r(t,e,r,n){var i;do i=y.uniqueId(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function n(t){var e=(new m).setGraph(t.graph());return y.each(t.nodes(),function(r){e.setNode(r,t.node(r))}),y.each(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function i(t){var e=new m({multigraph:t.isMultigraph()}).setGraph(t.graph());return y.each(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),y.each(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function a(t){var e=y.map(t.nodes(),function(e){var r={};return y.each(t.outEdges(e),function(e){r[e.w]=(r[e.w]||0)+t.edge(e).weight}),r});return y.zipObject(t.nodes(),e)}function s(t){var e=y.map(t.nodes(),function(e){var r={};return y.each(t.inEdges(e),function(e){r[e.v]=(r[e.v]||0)+t.edge(e).weight}),r});return y.zipObject(t.nodes(),e)}function o(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var u,c;return Math.abs(a)*s>Math.abs(i)*o?(0>a&&(o=-o),u=o*i/a,c=o):(0>i&&(s=-s),u=s,c=s*a/i),{x:r+u,y:n+c}}function u(t){var e=y.map(y.range(d(t)+1),function(){return[]});return y.each(t.nodes(),function(r){var n=t.node(r),i=n.rank;y.isUndefined(i)||(e[i][n.order]=r)}),e}function c(t){var e=y.min(y.map(t.nodes(),function(e){return t.node(e).rank}));y.each(t.nodes(),function(r){var n=t.node(r);y.has(n,"rank")&&(n.rank-=e)})}function l(t){var e=y.min(y.map(t.nodes(),function(e){return t.node(e).rank})),r=[];y.each(t.nodes(),function(n){var i=t.node(n).rank-e;r[i]||(r[i]=[]),r[i].push(n)});var n=0,i=t.graph().nodeRankFactor;y.each(r,function(e,r){y.isUndefined(e)&&r%i!==0?--n:n&&y.each(e,function(e){t.node(e).rank+=n})})}function h(t,e,n,i){var a={width:0,height:0};return arguments.length>=4&&(a.rank=n,a.order=i),r(t,"border",a,e)}function d(t){return y.max(y.map(t.nodes(),function(e){var r=t.node(e).rank;return y.isUndefined(r)?void 0:r}))}function f(t,e){var r={lhs:[],rhs:[]};return y.each(t,function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r}function p(t,e){var r=y.now();try{return e()}finally{console.log(t+" time: "+(y.now()-r)+"ms")}}function g(t,e){return e()}var y=t("./lodash"),m=t("./graphlib").Graph;e.exports={addDummyNode:r,simplify:n,asNonCompoundGraph:i,successorWeights:a,predecessorWeights:s,intersectRect:o,buildLayerMatrix:u,normalizeRanks:c,removeEmptyRanks:l,addBorderNode:h,maxRank:d,partition:f,time:p,notime:g}},{"./graphlib":59,"./lodash":62}],82:[function(t,e){e.exports="0.7.4"},{}],83:[function(t,e){e.exports=t(32)},{"./lib":99,"./lib/alg":90,"./lib/json":100,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\index.js":32}],84:[function(t,e){e.exports=t(33)},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\components.js":33}],85:[function(t,e){e.exports=t(34)},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dfs.js":34}],86:[function(t,e){e.exports=t(35)},{"../lodash":101,"./dijkstra":87,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dijkstra-all.js":35}],87:[function(t,e){e.exports=t(36)},{"../data/priority-queue":97,"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dijkstra.js":36}],88:[function(t,e){e.exports=t(37)},{"../lodash":101,"./tarjan":95,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\find-cycles.js":37}],89:[function(t,e){e.exports=t(38)},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\floyd-warshall.js":38}],90:[function(t,e){e.exports=t(39)},{"./components":84,"./dijkstra":87,"./dijkstra-all":86,"./find-cycles":88,"./floyd-warshall":89,"./is-acyclic":91,"./postorder":92,"./preorder":93,"./prim":94,"./tarjan":95,"./topsort":96,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\index.js":39}],91:[function(t,e){e.exports=t(40)},{"./topsort":96,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\is-acyclic.js":40}],92:[function(t,e){e.exports=t(41)},{"./dfs":85,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\postorder.js":41}],93:[function(t,e){e.exports=t(42)},{"./dfs":85,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\preorder.js":42}],94:[function(t,e){e.exports=t(43)},{"../data/priority-queue":97,"../graph":98,"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\prim.js":43}],95:[function(t,e){e.exports=t(44)},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\tarjan.js":44}],96:[function(t,e){e.exports=t(45)},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\topsort.js":45}],97:[function(t,e){e.exports=t(46)},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\data\\priority-queue.js":46}],98:[function(t,e){e.exports=t(47)},{"./lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\graph.js":47}],99:[function(t,e){e.exports=t(48)},{"./graph":98,"./version":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\index.js":48}],100:[function(t,e){e.exports=t(49)},{"./graph":98,"./lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\json.js":49}],101:[function(t,e){e.exports=t(50)},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\lodash.js":50,lodash:103}],102:[function(t,e){e.exports=t(51)},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\version.js":51}],103:[function(t,e){e.exports=t(52)},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\lodash\\index.js":52}],104:[function(t,e,r){(function(t){!function(n){var i="object"==typeof r&&r,a="object"==typeof e&&e&&e.exports==i&&e,s="object"==typeof t&&t;(s.global===s||s.window===s)&&(n=s);var o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=/[\x01-\x7F]/g,c=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,l=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,h={"Á":"Aacute","á":"aacute","Ă":"Abreve","ă":"abreve","∾":"ac","∿":"acd","∾̳":"acE","Â":"Acirc","â":"acirc","´":"acute","А":"Acy","а":"acy","Æ":"AElig","æ":"aelig","⁡":"af","𝔄":"Afr","𝔞":"afr","À":"Agrave","à":"agrave","ℵ":"aleph","Α":"Alpha","α":"alpha","Ā":"Amacr","ā":"amacr","⨿":"amalg","&":"amp","⩕":"andand","⩓":"And","∧":"and","⩜":"andd","⩘":"andslope","⩚":"andv","∠":"ang","⦤":"ange","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","∡":"angmsd","∟":"angrt","⊾":"angrtvb","⦝":"angrtvbd","∢":"angsph","Å":"angst","⍼":"angzarr","Ą":"Aogon","ą":"aogon","𝔸":"Aopf","𝕒":"aopf","⩯":"apacir","≈":"ap","⩰":"apE","≊":"ape","≋":"apid","'":"apos","å":"aring","𝒜":"Ascr","𝒶":"ascr","≔":"colone","*":"ast","≍":"CupCap","Ã":"Atilde","ã":"atilde","Ä":"Auml","ä":"auml","∳":"awconint","⨑":"awint","≌":"bcong","϶":"bepsi","‵":"bprime","∽":"bsim","⋍":"bsime","∖":"setmn","⫧":"Barv","⊽":"barvee","⌅":"barwed","⌆":"Barwed","⎵":"bbrk","⎶":"bbrktbrk","Б":"Bcy","б":"bcy","„":"bdquo","∵":"becaus","⦰":"bemptyv","ℬ":"Bscr","Β":"Beta","β":"beta","ℶ":"beth","≬":"twixt","𝔅":"Bfr","𝔟":"bfr","⋂":"xcap","◯":"xcirc","⋃":"xcup","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨆":"xsqcup","★":"starf","▽":"xdtri","△":"xutri","⨄":"xuplus","⋁":"Vee","⋀":"Wedge","⤍":"rbarr","⧫":"lozf","▪":"squf","▴":"utrif","▾":"dtrif","◂":"ltrif","▸":"rtrif","␣":"blank","▒":"blk12","░":"blk14","▓":"blk34","█":"block","=⃥":"bne","≡⃥":"bnequiv","⫭":"bNot","⌐":"bnot","𝔹":"Bopf","𝕓":"bopf","⊥":"bot","⋈":"bowtie","⧉":"boxbox","┐":"boxdl","╕":"boxdL","╖":"boxDl","╗":"boxDL","┌":"boxdr","╒":"boxdR","╓":"boxDr","╔":"boxDR","─":"boxh","═":"boxH","┬":"boxhd","╤":"boxHd","╥":"boxhD","╦":"boxHD","┴":"boxhu","╧":"boxHu","╨":"boxhU","╩":"boxHU","⊟":"minusb","⊞":"plusb","⊠":"timesb","┘":"boxul","╛":"boxuL","╜":"boxUl","╝":"boxUL","└":"boxur","╘":"boxuR","╙":"boxUr","╚":"boxUR","│":"boxv","║":"boxV","┼":"boxvh","╪":"boxvH","╫":"boxVh","╬":"boxVH","┤":"boxvl","╡":"boxvL","╢":"boxVl","╣":"boxVL","├":"boxvr","╞":"boxvR","╟":"boxVr","╠":"boxVR","˘":"breve","¦":"brvbar","𝒷":"bscr","⁏":"bsemi","⧅":"bsolb","\\":"bsol","⟈":"bsolhsub","•":"bull","≎":"bump","⪮":"bumpE","≏":"bumpe","Ć":"Cacute","ć":"cacute","⩄":"capand","⩉":"capbrcup","⩋":"capcap","∩":"cap","⋒":"Cap","⩇":"capcup","⩀":"capdot","ⅅ":"DD","∩︀":"caps","⁁":"caret","ˇ":"caron","ℭ":"Cfr","⩍":"ccaps","Č":"Ccaron","č":"ccaron","Ç":"Ccedil","ç":"ccedil","Ĉ":"Ccirc","ĉ":"ccirc","∰":"Cconint","⩌":"ccups","⩐":"ccupssm","Ċ":"Cdot","ċ":"cdot","¸":"cedil","⦲":"cemptyv","¢":"cent","·":"middot","𝔠":"cfr","Ч":"CHcy","ч":"chcy","✓":"check","Χ":"Chi","χ":"chi","ˆ":"circ","≗":"cire","↺":"olarr","↻":"orarr","⊛":"oast","⊚":"ocir","⊝":"odash","⊙":"odot","®":"reg","Ⓢ":"oS","⊖":"ominus","⊕":"oplus","⊗":"otimes","○":"cir","⧃":"cirE","⨐":"cirfnint","⫯":"cirmid","⧂":"cirscir","∲":"cwconint","”":"rdquo","’":"rsquo","♣":"clubs",":":"colon","∷":"Colon","⩴":"Colone",",":"comma","@":"commat","∁":"comp","∘":"compfn","ℂ":"Copf","≅":"cong","⩭":"congdot","≡":"equiv","∮":"oint","∯":"Conint","𝕔":"copf","∐":"coprod","©":"copy","℗":"copysr","↵":"crarr","✗":"cross","⨯":"Cross","𝒞":"Cscr","𝒸":"cscr","⫏":"csub","⫑":"csube","⫐":"csup","⫒":"csupe","⋯":"ctdot","⤸":"cudarrl","⤵":"cudarrr","⋞":"cuepr","⋟":"cuesc","↶":"cularr","⤽":"cularrp","⩈":"cupbrcap","⩆":"cupcap","∪":"cup","⋓":"Cup","⩊":"cupcup","⊍":"cupdot","⩅":"cupor","∪︀":"cups","↷":"curarr","⤼":"curarrm","⋎":"cuvee","⋏":"cuwed","¤":"curren","∱":"cwint","⌭":"cylcty","†":"dagger","‡":"Dagger","ℸ":"daleth","↓":"darr","↡":"Darr","⇓":"dArr","‐":"dash","⫤":"Dashv","⊣":"dashv","⤏":"rBarr","˝":"dblac","Ď":"Dcaron","ď":"dcaron","Д":"Dcy","д":"dcy","⇊":"ddarr","ⅆ":"dd","⤑":"DDotrahd","⩷":"eDDot","°":"deg","∇":"Del","Δ":"Delta","δ":"delta","⦱":"demptyv","⥿":"dfisht","𝔇":"Dfr","𝔡":"dfr","⥥":"dHar","⇃":"dharl","⇂":"dharr","˙":"dot","`":"grave","˜":"tilde","⋄":"diam","♦":"diams","¨":"die","ϝ":"gammad","⋲":"disin","÷":"div","⋇":"divonx","Ђ":"DJcy","ђ":"djcy","⌞":"dlcorn","⌍":"dlcrop",$:"dollar","𝔻":"Dopf","𝕕":"dopf","⃜":"DotDot","≐":"doteq","≑":"eDot","∸":"minusd","∔":"plusdo","⊡":"sdotb","⇐":"lArr","⇔":"iff","⟸":"xlArr","⟺":"xhArr","⟹":"xrArr","⇒":"rArr","⊨":"vDash","⇑":"uArr","⇕":"vArr","∥":"par","⤓":"DownArrowBar","⇵":"duarr","̑":"DownBreve","⥐":"DownLeftRightVector","⥞":"DownLeftTeeVector","⥖":"DownLeftVectorBar","↽":"lhard","⥟":"DownRightTeeVector","⥗":"DownRightVectorBar","⇁":"rhard","↧":"mapstodown","⊤":"top","⤐":"RBarr","⌟":"drcorn","⌌":"drcrop","𝒟":"Dscr","𝒹":"dscr","Ѕ":"DScy","ѕ":"dscy","⧶":"dsol","Đ":"Dstrok","đ":"dstrok","⋱":"dtdot","▿":"dtri","⥯":"duhar","⦦":"dwangle","Џ":"DZcy","џ":"dzcy","⟿":"dzigrarr","É":"Eacute","é":"eacute","⩮":"easter","Ě":"Ecaron","ě":"ecaron","Ê":"Ecirc","ê":"ecirc","≖":"ecir","≕":"ecolon","Э":"Ecy","э":"ecy","Ė":"Edot","ė":"edot","ⅇ":"ee","≒":"efDot","𝔈":"Efr","𝔢":"efr","⪚":"eg","È":"Egrave","è":"egrave","⪖":"egs","⪘":"egsdot","⪙":"el","∈":"in","⏧":"elinters","ℓ":"ell","⪕":"els","⪗":"elsdot","Ē":"Emacr","ē":"emacr","∅":"empty","◻":"EmptySmallSquare","▫":"EmptyVerySmallSquare"," ":"emsp13"," ":"emsp14"," ":"emsp","Ŋ":"ENG","ŋ":"eng"," ":"ensp","Ę":"Eogon","ę":"eogon","𝔼":"Eopf","𝕖":"eopf","⋕":"epar","⧣":"eparsl","⩱":"eplus","ε":"epsi","Ε":"Epsilon","ϵ":"epsiv","≂":"esim","⩵":"Equal","=":"equals","≟":"equest","⇌":"rlhar","⩸":"equivDD","⧥":"eqvparsl","⥱":"erarr","≓":"erDot","ℯ":"escr","ℰ":"Escr","⩳":"Esim","Η":"Eta","η":"eta","Ð":"ETH","ð":"eth","Ë":"Euml","ë":"euml","€":"euro","!":"excl","∃":"exist","Ф":"Fcy","ф":"fcy","♀":"female","ffi":"ffilig","ff":"fflig","ffl":"ffllig","𝔉":"Ffr","𝔣":"ffr","fi":"filig","◼":"FilledSmallSquare",fj:"fjlig","♭":"flat","fl":"fllig","▱":"fltns","ƒ":"fnof","𝔽":"Fopf","𝕗":"fopf","∀":"forall","⋔":"fork","⫙":"forkv", -"ℱ":"Fscr","⨍":"fpartint","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","⅔":"frac23","⅖":"frac25","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","⁄":"frasl","⌢":"frown","𝒻":"fscr","ǵ":"gacute","Γ":"Gamma","γ":"gamma","Ϝ":"Gammad","⪆":"gap","Ğ":"Gbreve","ğ":"gbreve","Ģ":"Gcedil","Ĝ":"Gcirc","ĝ":"gcirc","Г":"Gcy","г":"gcy","Ġ":"Gdot","ġ":"gdot","≥":"ge","≧":"gE","⪌":"gEl","⋛":"gel","⩾":"ges","⪩":"gescc","⪀":"gesdot","⪂":"gesdoto","⪄":"gesdotol","⋛︀":"gesl","⪔":"gesles","𝔊":"Gfr","𝔤":"gfr","≫":"gg","⋙":"Gg","ℷ":"gimel","Ѓ":"GJcy","ѓ":"gjcy","⪥":"gla","≷":"gl","⪒":"glE","⪤":"glj","⪊":"gnap","⪈":"gne","≩":"gnE","⋧":"gnsim","𝔾":"Gopf","𝕘":"gopf","⪢":"GreaterGreater","≳":"gsim","𝒢":"Gscr","ℊ":"gscr","⪎":"gsime","⪐":"gsiml","⪧":"gtcc","⩺":"gtcir",">":"gt","⋗":"gtdot","⦕":"gtlPar","⩼":"gtquest","⥸":"gtrarr","≩︀":"gvnE"," ":"hairsp","ℋ":"Hscr","Ъ":"HARDcy","ъ":"hardcy","⥈":"harrcir","↔":"harr","↭":"harrw","^":"Hat","ℏ":"hbar","Ĥ":"Hcirc","ĥ":"hcirc","♥":"hearts","…":"mldr","⊹":"hercon","𝔥":"hfr","ℌ":"Hfr","⤥":"searhk","⤦":"swarhk","⇿":"hoarr","∻":"homtht","↩":"larrhk","↪":"rarrhk","𝕙":"hopf","ℍ":"Hopf","―":"horbar","𝒽":"hscr","Ħ":"Hstrok","ħ":"hstrok","⁃":"hybull","Í":"Iacute","í":"iacute","⁣":"ic","Î":"Icirc","î":"icirc","И":"Icy","и":"icy","İ":"Idot","Е":"IEcy","е":"iecy","¡":"iexcl","𝔦":"ifr","ℑ":"Im","Ì":"Igrave","ì":"igrave","ⅈ":"ii","⨌":"qint","∭":"tint","⧜":"iinfin","℩":"iiota","IJ":"IJlig","ij":"ijlig","Ī":"Imacr","ī":"imacr","ℐ":"Iscr","ı":"imath","⊷":"imof","Ƶ":"imped","℅":"incare","∞":"infin","⧝":"infintie","⊺":"intcal","∫":"int","∬":"Int","ℤ":"Zopf","⨗":"intlarhk","⨼":"iprod","⁢":"it","Ё":"IOcy","ё":"iocy","Į":"Iogon","į":"iogon","𝕀":"Iopf","𝕚":"iopf","Ι":"Iota","ι":"iota","¿":"iquest","𝒾":"iscr","⋵":"isindot","⋹":"isinE","⋴":"isins","⋳":"isinsv","Ĩ":"Itilde","ĩ":"itilde","І":"Iukcy","і":"iukcy","Ï":"Iuml","ï":"iuml","Ĵ":"Jcirc","ĵ":"jcirc","Й":"Jcy","й":"jcy","𝔍":"Jfr","𝔧":"jfr","ȷ":"jmath","𝕁":"Jopf","𝕛":"jopf","𝒥":"Jscr","𝒿":"jscr","Ј":"Jsercy","ј":"jsercy","Є":"Jukcy","є":"jukcy","Κ":"Kappa","κ":"kappa","ϰ":"kappav","Ķ":"Kcedil","ķ":"kcedil","К":"Kcy","к":"kcy","𝔎":"Kfr","𝔨":"kfr","ĸ":"kgreen","Х":"KHcy","х":"khcy","Ќ":"KJcy","ќ":"kjcy","𝕂":"Kopf","𝕜":"kopf","𝒦":"Kscr","𝓀":"kscr","⇚":"lAarr","Ĺ":"Lacute","ĺ":"lacute","⦴":"laemptyv","ℒ":"Lscr","Λ":"Lambda","λ":"lambda","⟨":"lang","⟪":"Lang","⦑":"langd","⪅":"lap","«":"laquo","⇤":"larrb","⤟":"larrbfs","←":"larr","↞":"Larr","⤝":"larrfs","↫":"larrlp","⤹":"larrpl","⥳":"larrsim","↢":"larrtl","⤙":"latail","⤛":"lAtail","⪫":"lat","⪭":"late","⪭︀":"lates","⤌":"lbarr","⤎":"lBarr","❲":"lbbrk","{":"lcub","[":"lsqb","⦋":"lbrke","⦏":"lbrksld","⦍":"lbrkslu","Ľ":"Lcaron","ľ":"lcaron","Ļ":"Lcedil","ļ":"lcedil","⌈":"lceil","Л":"Lcy","л":"lcy","⤶":"ldca","“":"ldquo","⥧":"ldrdhar","⥋":"ldrushar","↲":"ldsh","≤":"le","≦":"lE","⇆":"lrarr","⟦":"lobrk","⥡":"LeftDownTeeVector","⥙":"LeftDownVectorBar","⌊":"lfloor","↼":"lharu","⇇":"llarr","⇋":"lrhar","⥎":"LeftRightVector","↤":"mapstoleft","⥚":"LeftTeeVector","⋋":"lthree","⧏":"LeftTriangleBar","⊲":"vltri","⊴":"ltrie","⥑":"LeftUpDownVector","⥠":"LeftUpTeeVector","⥘":"LeftUpVectorBar","↿":"uharl","⥒":"LeftVectorBar","⪋":"lEg","⋚":"leg","⩽":"les","⪨":"lescc","⩿":"lesdot","⪁":"lesdoto","⪃":"lesdotor","⋚︀":"lesg","⪓":"lesges","⋖":"ltdot","≶":"lg","⪡":"LessLess","≲":"lsim","⥼":"lfisht","𝔏":"Lfr","𝔩":"lfr","⪑":"lgE","⥢":"lHar","⥪":"lharul","▄":"lhblk","Љ":"LJcy","љ":"ljcy","≪":"ll","⋘":"Ll","⥫":"llhard","◺":"lltri","Ŀ":"Lmidot","ŀ":"lmidot","⎰":"lmoust","⪉":"lnap","⪇":"lne","≨":"lnE","⋦":"lnsim","⟬":"loang","⇽":"loarr","⟵":"xlarr","⟷":"xharr","⟼":"xmap","⟶":"xrarr","↬":"rarrlp","⦅":"lopar","𝕃":"Lopf","𝕝":"lopf","⨭":"loplus","⨴":"lotimes","∗":"lowast",_:"lowbar","↙":"swarr","↘":"searr","◊":"loz","(":"lpar","⦓":"lparlt","⥭":"lrhard","‎":"lrm","⊿":"lrtri","‹":"lsaquo","𝓁":"lscr","↰":"lsh","⪍":"lsime","⪏":"lsimg","‘":"lsquo","‚":"sbquo","Ł":"Lstrok","ł":"lstrok","⪦":"ltcc","⩹":"ltcir","<":"lt","⋉":"ltimes","⥶":"ltlarr","⩻":"ltquest","◃":"ltri","⦖":"ltrPar","⥊":"lurdshar","⥦":"luruhar","≨︀":"lvnE","¯":"macr","♂":"male","✠":"malt","⤅":"Map","↦":"map","↥":"mapstoup","▮":"marker","⨩":"mcomma","М":"Mcy","м":"mcy","—":"mdash","∺":"mDDot"," ":"MediumSpace","ℳ":"Mscr","𝔐":"Mfr","𝔪":"mfr","℧":"mho","µ":"micro","⫰":"midcir","∣":"mid","−":"minus","⨪":"minusdu","∓":"mp","⫛":"mlcp","⊧":"models","𝕄":"Mopf","𝕞":"mopf","𝓂":"mscr","Μ":"Mu","μ":"mu","⊸":"mumap","Ń":"Nacute","ń":"nacute","∠⃒":"nang","≉":"nap","⩰̸":"napE","≋̸":"napid","ʼn":"napos","♮":"natur","ℕ":"Nopf"," ":"nbsp","≎̸":"nbump","≏̸":"nbumpe","⩃":"ncap","Ň":"Ncaron","ň":"ncaron","Ņ":"Ncedil","ņ":"ncedil","≇":"ncong","⩭̸":"ncongdot","⩂":"ncup","Н":"Ncy","н":"ncy","–":"ndash","⤤":"nearhk","↗":"nearr","⇗":"neArr","≠":"ne","≐̸":"nedot","​":"ZeroWidthSpace","≢":"nequiv","⤨":"toea","≂̸":"nesim","\n":"NewLine","∄":"nexist","𝔑":"Nfr","𝔫":"nfr","≧̸":"ngE","≱":"nge","⩾̸":"nges","⋙̸":"nGg","≵":"ngsim","≫⃒":"nGt","≯":"ngt","≫̸":"nGtv","↮":"nharr","⇎":"nhArr","⫲":"nhpar","∋":"ni","⋼":"nis","⋺":"nisd","Њ":"NJcy","њ":"njcy","↚":"nlarr","⇍":"nlArr","‥":"nldr","≦̸":"nlE","≰":"nle","⩽̸":"nles","≮":"nlt","⋘̸":"nLl","≴":"nlsim","≪⃒":"nLt","⋪":"nltri","⋬":"nltrie","≪̸":"nLtv","∤":"nmid","⁠":"NoBreak","𝕟":"nopf","⫬":"Not","¬":"not","≭":"NotCupCap","∦":"npar","∉":"notin","≹":"ntgl","⋵̸":"notindot","⋹̸":"notinE","⋷":"notinvb","⋶":"notinvc","⧏̸":"NotLeftTriangleBar","≸":"ntlg","⪢̸":"NotNestedGreaterGreater","⪡̸":"NotNestedLessLess","∌":"notni","⋾":"notnivb","⋽":"notnivc","⊀":"npr","⪯̸":"npre","⋠":"nprcue","⧐̸":"NotRightTriangleBar","⋫":"nrtri","⋭":"nrtrie","⊏̸":"NotSquareSubset","⋢":"nsqsube","⊐̸":"NotSquareSuperset","⋣":"nsqsupe","⊂⃒":"vnsub","⊈":"nsube","⊁":"nsc","⪰̸":"nsce","⋡":"nsccue","≿̸":"NotSucceedsTilde","⊃⃒":"vnsup","⊉":"nsupe","≁":"nsim","≄":"nsime","⫽⃥":"nparsl","∂̸":"npart","⨔":"npolint","⤳̸":"nrarrc","↛":"nrarr","⇏":"nrArr","↝̸":"nrarrw","𝒩":"Nscr","𝓃":"nscr","⊄":"nsub","⫅̸":"nsubE","⊅":"nsup","⫆̸":"nsupE","Ñ":"Ntilde","ñ":"ntilde","Ν":"Nu","ν":"nu","#":"num","№":"numero"," ":"numsp","≍⃒":"nvap","⊬":"nvdash","⊭":"nvDash","⊮":"nVdash","⊯":"nVDash","≥⃒":"nvge",">⃒":"nvgt","⤄":"nvHarr","⧞":"nvinfin","⤂":"nvlArr","≤⃒":"nvle","<⃒":"nvlt","⊴⃒":"nvltrie","⤃":"nvrArr","⊵⃒":"nvrtrie","∼⃒":"nvsim","⤣":"nwarhk","↖":"nwarr","⇖":"nwArr","⤧":"nwnear","Ó":"Oacute","ó":"oacute","Ô":"Ocirc","ô":"ocirc","О":"Ocy","о":"ocy","Ő":"Odblac","ő":"odblac","⨸":"odiv","⦼":"odsold","Œ":"OElig","œ":"oelig","⦿":"ofcir","𝔒":"Ofr","𝔬":"ofr","˛":"ogon","Ò":"Ograve","ò":"ograve","⧁":"ogt","⦵":"ohbar","Ω":"ohm","⦾":"olcir","⦻":"olcross","‾":"oline","⧀":"olt","Ō":"Omacr","ō":"omacr","ω":"omega","Ο":"Omicron","ο":"omicron","⦶":"omid","𝕆":"Oopf","𝕠":"oopf","⦷":"opar","⦹":"operp","⩔":"Or","∨":"or","⩝":"ord","ℴ":"oscr","ª":"ordf","º":"ordm","⊶":"origof","⩖":"oror","⩗":"orslope","⩛":"orv","𝒪":"Oscr","Ø":"Oslash","ø":"oslash","⊘":"osol","Õ":"Otilde","õ":"otilde","⨶":"otimesas","⨷":"Otimes","Ö":"Ouml","ö":"ouml","⌽":"ovbar","⏞":"OverBrace","⎴":"tbrk","⏜":"OverParenthesis","¶":"para","⫳":"parsim","⫽":"parsl","∂":"part","П":"Pcy","п":"pcy","%":"percnt",".":"period","‰":"permil","‱":"pertenk","𝔓":"Pfr","𝔭":"pfr","Φ":"Phi","φ":"phi","ϕ":"phiv","☎":"phone","Π":"Pi","π":"pi","ϖ":"piv","ℎ":"planckh","⨣":"plusacir","⨢":"pluscir","+":"plus","⨥":"plusdu","⩲":"pluse","±":"pm","⨦":"plussim","⨧":"plustwo","⨕":"pointint","𝕡":"popf","ℙ":"Popf","£":"pound","⪷":"prap","⪻":"Pr","≺":"pr","≼":"prcue","⪯":"pre","≾":"prsim","⪹":"prnap","⪵":"prnE","⋨":"prnsim","⪳":"prE","′":"prime","″":"Prime","∏":"prod","⌮":"profalar","⌒":"profline","⌓":"profsurf","∝":"prop","⊰":"prurel","𝒫":"Pscr","𝓅":"pscr","Ψ":"Psi","ψ":"psi"," ":"puncsp","𝔔":"Qfr","𝔮":"qfr","𝕢":"qopf","ℚ":"Qopf","⁗":"qprime","𝒬":"Qscr","𝓆":"qscr","⨖":"quatint","?":"quest",'"':"quot","⇛":"rAarr","∽̱":"race","Ŕ":"Racute","ŕ":"racute","√":"Sqrt","⦳":"raemptyv","⟩":"rang","⟫":"Rang","⦒":"rangd","⦥":"range","»":"raquo","⥵":"rarrap","⇥":"rarrb","⤠":"rarrbfs","⤳":"rarrc","→":"rarr","↠":"Rarr","⤞":"rarrfs","⥅":"rarrpl","⥴":"rarrsim","⤖":"Rarrtl","↣":"rarrtl","↝":"rarrw","⤚":"ratail","⤜":"rAtail","∶":"ratio","❳":"rbbrk","}":"rcub","]":"rsqb","⦌":"rbrke","⦎":"rbrksld","⦐":"rbrkslu","Ř":"Rcaron","ř":"rcaron","Ŗ":"Rcedil","ŗ":"rcedil","⌉":"rceil","Р":"Rcy","р":"rcy","⤷":"rdca","⥩":"rdldhar","↳":"rdsh","ℜ":"Re","ℛ":"Rscr","ℝ":"Ropf","▭":"rect","⥽":"rfisht","⌋":"rfloor","𝔯":"rfr","⥤":"rHar","⇀":"rharu","⥬":"rharul","Ρ":"Rho","ρ":"rho","ϱ":"rhov","⇄":"rlarr","⟧":"robrk","⥝":"RightDownTeeVector","⥕":"RightDownVectorBar","⇉":"rrarr","⊢":"vdash","⥛":"RightTeeVector","⋌":"rthree","⧐":"RightTriangleBar","⊳":"vrtri","⊵":"rtrie","⥏":"RightUpDownVector","⥜":"RightUpTeeVector","⥔":"RightUpVectorBar","↾":"uharr","⥓":"RightVectorBar","˚":"ring","‏":"rlm","⎱":"rmoust","⫮":"rnmid","⟭":"roang","⇾":"roarr","⦆":"ropar","𝕣":"ropf","⨮":"roplus","⨵":"rotimes","⥰":"RoundImplies",")":"rpar","⦔":"rpargt","⨒":"rppolint","›":"rsaquo","𝓇":"rscr","↱":"rsh","⋊":"rtimes","▹":"rtri","⧎":"rtriltri","⧴":"RuleDelayed","⥨":"ruluhar","℞":"rx","Ś":"Sacute","ś":"sacute","⪸":"scap","Š":"Scaron","š":"scaron","⪼":"Sc","≻":"sc","≽":"sccue","⪰":"sce","⪴":"scE","Ş":"Scedil","ş":"scedil","Ŝ":"Scirc","ŝ":"scirc","⪺":"scnap","⪶":"scnE","⋩":"scnsim","⨓":"scpolint","≿":"scsim","С":"Scy","с":"scy","⋅":"sdot","⩦":"sdote","⇘":"seArr","§":"sect",";":"semi","⤩":"tosa","✶":"sext","𝔖":"Sfr","𝔰":"sfr","♯":"sharp","Щ":"SHCHcy","щ":"shchcy","Ш":"SHcy","ш":"shcy","↑":"uarr","­":"shy","Σ":"Sigma","σ":"sigma","ς":"sigmaf","∼":"sim","⩪":"simdot","≃":"sime","⪞":"simg","⪠":"simgE","⪝":"siml","⪟":"simlE","≆":"simne","⨤":"simplus","⥲":"simrarr","⨳":"smashp","⧤":"smeparsl","⌣":"smile","⪪":"smt","⪬":"smte","⪬︀":"smtes","Ь":"SOFTcy","ь":"softcy","⌿":"solbar","⧄":"solb","/":"sol","𝕊":"Sopf","𝕤":"sopf","♠":"spades","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊏":"sqsub","⊑":"sqsube","⊐":"sqsup","⊒":"sqsupe","□":"squ","𝒮":"Sscr","𝓈":"sscr","⋆":"Star","☆":"star","⊂":"sub","⋐":"Sub","⪽":"subdot","⫅":"subE","⊆":"sube","⫃":"subedot","⫁":"submult","⫋":"subnE","⊊":"subne","⪿":"subplus","⥹":"subrarr","⫇":"subsim","⫕":"subsub","⫓":"subsup","∑":"sum","♪":"sung","¹":"sup1","²":"sup2","³":"sup3","⊃":"sup","⋑":"Sup","⪾":"supdot","⫘":"supdsub","⫆":"supE","⊇":"supe","⫄":"supedot","⟉":"suphsol","⫗":"suphsub","⥻":"suplarr","⫂":"supmult","⫌":"supnE","⊋":"supne","⫀":"supplus","⫈":"supsim","⫔":"supsub","⫖":"supsup","⇙":"swArr","⤪":"swnwar","ß":"szlig"," ":"Tab","⌖":"target","Τ":"Tau","τ":"tau","Ť":"Tcaron","ť":"tcaron","Ţ":"Tcedil","ţ":"tcedil","Т":"Tcy","т":"tcy","⃛":"tdot","⌕":"telrec","𝔗":"Tfr","𝔱":"tfr","∴":"there4","Θ":"Theta","θ":"theta","ϑ":"thetav","  ":"ThickSpace"," ":"thinsp","Þ":"THORN","þ":"thorn","⨱":"timesbar","×":"times","⨰":"timesd","⌶":"topbot","⫱":"topcir","𝕋":"Topf","𝕥":"topf","⫚":"topfork","‴":"tprime","™":"trade","▵":"utri","≜":"trie","◬":"tridot","⨺":"triminus","⨹":"triplus","⧍":"trisb","⨻":"tritime","⏢":"trpezium","𝒯":"Tscr","𝓉":"tscr","Ц":"TScy","ц":"tscy","Ћ":"TSHcy","ћ":"tshcy","Ŧ":"Tstrok","ŧ":"tstrok","Ú":"Uacute","ú":"uacute","↟":"Uarr","⥉":"Uarrocir","Ў":"Ubrcy","ў":"ubrcy","Ŭ":"Ubreve","ŭ":"ubreve","Û":"Ucirc","û":"ucirc","У":"Ucy","у":"ucy","⇅":"udarr","Ű":"Udblac","ű":"udblac","⥮":"udhar","⥾":"ufisht","𝔘":"Ufr","𝔲":"ufr","Ù":"Ugrave","ù":"ugrave","⥣":"uHar","▀":"uhblk","⌜":"ulcorn","⌏":"ulcrop","◸":"ultri","Ū":"Umacr","ū":"umacr","⏟":"UnderBrace","⏝":"UnderParenthesis","⊎":"uplus","Ų":"Uogon","ų":"uogon","𝕌":"Uopf","𝕦":"uopf","⤒":"UpArrowBar","↕":"varr","υ":"upsi","ϒ":"Upsi","Υ":"Upsilon","⇈":"uuarr","⌝":"urcorn","⌎":"urcrop","Ů":"Uring","ů":"uring","◹":"urtri","𝒰":"Uscr","𝓊":"uscr","⋰":"utdot","Ũ":"Utilde","ũ":"utilde","Ü":"Uuml","ü":"uuml","⦧":"uwangle","⦜":"vangrt","⊊︀":"vsubne","⫋︀":"vsubnE","⊋︀":"vsupne","⫌︀":"vsupnE","⫨":"vBar","⫫":"Vbar","⫩":"vBarv","В":"Vcy","в":"vcy","⊩":"Vdash","⊫":"VDash","⫦":"Vdashl","⊻":"veebar","≚":"veeeq","⋮":"vellip","|":"vert","‖":"Vert","❘":"VerticalSeparator","≀":"wr","𝔙":"Vfr","𝔳":"vfr","𝕍":"Vopf","𝕧":"vopf","𝒱":"Vscr","𝓋":"vscr","⊪":"Vvdash","⦚":"vzigzag","Ŵ":"Wcirc","ŵ":"wcirc","⩟":"wedbar","≙":"wedgeq","℘":"wp","𝔚":"Wfr","𝔴":"wfr","𝕎":"Wopf","𝕨":"wopf","𝒲":"Wscr","𝓌":"wscr","𝔛":"Xfr","𝔵":"xfr","Ξ":"Xi","ξ":"xi","⋻":"xnis","𝕏":"Xopf","𝕩":"xopf","𝒳":"Xscr","𝓍":"xscr","Ý":"Yacute","ý":"yacute","Я":"YAcy","я":"yacy","Ŷ":"Ycirc","ŷ":"ycirc","Ы":"Ycy","ы":"ycy","¥":"yen","𝔜":"Yfr","𝔶":"yfr","Ї":"YIcy","ї":"yicy","𝕐":"Yopf","𝕪":"yopf","𝒴":"Yscr","𝓎":"yscr","Ю":"YUcy","ю":"yucy","ÿ":"yuml","Ÿ":"Yuml","Ź":"Zacute","ź":"zacute","Ž":"Zcaron","ž":"zcaron","З":"Zcy","з":"zcy","Ż":"Zdot","ż":"zdot","ℨ":"Zfr","Ζ":"Zeta","ζ":"zeta","𝔷":"zfr","Ж":"ZHcy","ж":"zhcy","⇝":"zigrarr","𝕫":"zopf","𝒵":"Zscr","𝓏":"zscr","‍":"zwj","‌":"zwnj"},d=/["&'<>`]/g,f={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},p=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,g=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|iacute|Uacute|plusmn|otilde|Otilde|Agrave|agrave|yacute|Yacute|oslash|Oslash|Atilde|atilde|brvbar|Ccedil|ccedil|ograve|curren|divide|Eacute|eacute|Ograve|oacute|Egrave|egrave|ugrave|frac12|frac14|frac34|Ugrave|Oacute|Iacute|ntilde|Ntilde|uacute|middot|Igrave|igrave|iquest|aacute|laquo|THORN|micro|iexcl|icirc|Icirc|Acirc|ucirc|ecirc|Ocirc|ocirc|Ecirc|Ucirc|aring|Aring|aelig|AElig|acute|pound|raquo|acirc|times|thorn|szlig|cedil|COPY|Auml|ordf|ordm|uuml|macr|Uuml|auml|Ouml|ouml|para|nbsp|Euml|quot|QUOT|euml|yuml|cent|sect|copy|sup1|sup2|sup3|Iuml|iuml|shy|eth|reg|not|yen|amp|AMP|REG|uml|ETH|deg|gt|GT|LT|lt)([=a-zA-Z0-9])?/g,m={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅","in":"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺","int":"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬", -Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"},v={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"},b={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},_=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],A=String.fromCharCode,w={},x=w.hasOwnProperty,E=function(t,e){return x.call(t,e)},k=function(t,e){for(var r=-1,n=t.length;++r=55296&&57343>=t||t>1114111?(e&&T("character reference outside the permissible Unicode range"),"�"):E(b,t)?(e&&T("disallowed character reference"),b[t]):(e&&k(_,t)&&T("disallowed character reference"),t>65535&&(t-=65536,r+=A(t>>>10&1023|55296),t=56320|1023&t),r+=A(t))},F=function(t){return"&#x"+t.charCodeAt(0).toString(16).toUpperCase()+";"},T=function(t){throw Error("Parse error: "+t)},S=function(t,e){e=D(e,S.options);var r=e.strict;r&&g.test(t)&&T("forbidden code point");var n=e.encodeEverything,i=e.useNamedReferences,a=e.allowUnsafeSymbols;return n?(t=t.replace(u,function(t){return i&&E(h,t)?"&"+h[t]+";":F(t)}),i&&(t=t.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),i&&(t=t.replace(l,function(t){return"&"+h[t]+";"}))):i?(a||(t=t.replace(d,function(t){return"&"+h[t]+";"})),t=t.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒"),t=t.replace(l,function(t){return"&"+h[t]+";"})):a||(t=t.replace(d,F)),t.replace(o,function(t){var e=t.charCodeAt(0),r=t.charCodeAt(1),n=1024*(e-55296)+r-56320+65536;return"&#x"+n.toString(16).toUpperCase()+";"}).replace(c,F)};S.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1};var B=function(t,e){e=D(e,B.options);var r=e.strict;return r&&p.test(t)&&T("malformed character reference"),t.replace(y,function(t,n,i,a,s,o,u,c){var l,h,d,f,p;return n?(l=n,h=i,r&&!h&&T("character reference was not terminated by a semicolon"),C(l,r)):a?(d=a,h=s,r&&!h&&T("character reference was not terminated by a semicolon"),l=parseInt(d,16),C(l,r)):o?(f=o,E(m,f)?m[f]:(r&&T("named character reference was not terminated by a semicolon"),t)):(f=u,p=c,p&&e.isAttributeValue?(r&&"="==p&&T("`&` did not start a character reference"),t):(r&&T("named character reference was not terminated by a semicolon"),v[f]+(p||"")))})};B.options={isAttributeValue:!1,strict:!1};var L=function(t){return t.replace(d,function(t){return f[t]})},O={version:"0.5.0",encode:S,decode:B,escape:L,unescape:B};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return O});else if(i&&!i.nodeType)if(a)a.exports=O;else for(var I in O)E(O,I)&&(i[I]=O[I]);else n.he=O}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],105:[function(t,e,r){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?e.exports=n():"function"==typeof define&&define.amd?define(n):t.moment=n()}(this,function(){"use strict";function r(){return Nr.apply(null,arguments)}function n(t){Nr=t}function i(t){return"[object Array]"===Object.prototype.toString.call(t)}function a(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function s(t,e){var r,n=[];for(r=0;r0)for(r in Pr)n=Pr[r],i=e[n],"undefined"!=typeof i&&(t[n]=i);return t}function g(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():0/0),Rr===!1&&(Rr=!0,r.updateOffset(this),Rr=!1)}function y(t){return t instanceof g||null!=t&&null!=t._isAMomentObject}function m(t){return 0>t?Math.ceil(t):Math.floor(t)}function v(t){var e=+t,r=0;return 0!==e&&isFinite(e)&&(r=m(e)),r}function b(t,e,r){var n,i=Math.min(t.length,e.length),a=Math.abs(t.length-e.length),s=0;for(n=0;i>n;n++)(r&&t[n]!==e[n]||!r&&v(t[n])!==v(e[n]))&&s++;return s+a}function _(){}function A(t){return t?t.toLowerCase().replace("_","-"):t}function w(t){for(var e,r,n,i,a=0;a0;){if(n=x(i.slice(0,e).join("-")))return n;if(r&&r.length>=e&&b(i,r,!0)>=e-1)break;e--}a++}return null}function x(r){var n=null;if(!qr[r]&&"undefined"!=typeof e&&e&&e.exports)try{n=Mr._abbr,t("./locale/"+r),E(n)}catch(i){}return qr[r]}function E(t,e){var r;return t&&(r="undefined"==typeof e?D(t):k(t,e),r&&(Mr=r)),Mr._abbr}function k(t,e){return null!==e?(e.abbr=t,qr[t]=qr[t]||new _,qr[t].set(e),E(t),qr[t]):(delete qr[t],null)}function D(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Mr;if(!i(t)){if(e=x(t))return e;t=[t]}return w(t)}function C(t,e){var r=t.toLowerCase();jr[r]=jr[r+"s"]=jr[e]=t}function F(t){return"string"==typeof t?jr[t]||jr[t.toLowerCase()]:void 0}function T(t){var e,r,n={};for(r in t)o(t,r)&&(e=F(r),e&&(n[e]=t[r]));return n}function S(t,e){return function(n){return null!=n?(L(this,t,n),r.updateOffset(this,e),this):B(this,t)}}function B(t,e){return t._d["get"+(t._isUTC?"UTC":"")+e]()}function L(t,e,r){return t._d["set"+(t._isUTC?"UTC":"")+e](r)}function O(t,e){var r;if("object"==typeof t)for(r in t)this.set(r,t[r]);else if(t=F(t),"function"==typeof this[t])return this[t](e);return this}function I(t,e,r){var n=""+Math.abs(t),i=e-n.length,a=t>=0;return(a?r?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}function N(t,e,r,n){var i=n;"string"==typeof n&&(i=function(){return this[n]()}),t&&(Vr[t]=i),e&&(Vr[e[0]]=function(){return I(i.apply(this,arguments),e[1],e[2])}),r&&(Vr[r]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function M(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function P(t){var e,r,n=t.match(Ur);for(e=0,r=n.length;r>e;e++)n[e]=Vr[n[e]]?Vr[n[e]]:M(n[e]);return function(i){var a="";for(e=0;r>e;e++)a+=n[e]instanceof Function?n[e].call(i,t):n[e];return a}}function R(t,e){return t.isValid()?(e=q(e,t.localeData()),Gr[e]=Gr[e]||P(e),Gr[e](t)):t.localeData().invalidDate()}function q(t,e){function r(t){return e.longDateFormat(t)||t}var n=5;for(Yr.lastIndex=0;n>=0&&Yr.test(t);)t=t.replace(Yr,r),Yr.lastIndex=0,n-=1;return t}function j(t){return"function"==typeof t&&"[object Function]"===Object.prototype.toString.call(t)}function U(t,e,r){sn[t]=j(e)?e:function(t){return t&&r?r:e}}function Y(t,e){return o(sn,t)?sn[t](e._strict,e._locale):new RegExp(G(t))}function G(t){return t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,r,n,i){return e||r||n||i}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function V(t,e){var r,n=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(n=function(t,r){r[e]=v(t)}),r=0;rn;n++){if(i=c([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),r||this._monthsParse[n]||(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(a.replace(".",""),"i")),r&&"MMMM"===e&&this._longMonthsParse[n].test(t))return n;if(r&&"MMM"===e&&this._shortMonthsParse[n].test(t))return n;if(!r&&this._monthsParse[n].test(t))return n}}function K(t,e){var r;return"string"==typeof e&&(e=t.localeData().monthsParse(e),"number"!=typeof e)?t:(r=Math.min(t.date(),W(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,r),t)}function J(t){return null!=t?(K(this,t),r.updateOffset(this,!0),this):B(this,"Month")}function Q(){return W(this.year(),this.month())}function tt(t){var e,r=t._a;return r&&-2===h(t).overflow&&(e=r[cn]<0||r[cn]>11?cn:r[ln]<1||r[ln]>W(r[un],r[cn])?ln:r[hn]<0||r[hn]>24||24===r[hn]&&(0!==r[dn]||0!==r[fn]||0!==r[pn])?hn:r[dn]<0||r[dn]>59?dn:r[fn]<0||r[fn]>59?fn:r[pn]<0||r[pn]>999?pn:-1,h(t)._overflowDayOfYear&&(un>e||e>ln)&&(e=ln),h(t).overflow=e),t}function et(t){r.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function rt(t,e){var r=!0;return u(function(){return r&&(et(t+"\n"+(new Error).stack),r=!1),e.apply(this,arguments)},e)}function nt(t,e){mn[t]||(et(e),mn[t]=!0)}function it(t){var e,r,n=t._i,i=vn.exec(n);if(i){for(h(t).iso=!0,e=0,r=bn.length;r>e;e++)if(bn[e][1].exec(n)){t._f=bn[e][0];break}for(e=0,r=_n.length;r>e;e++)if(_n[e][1].exec(n)){t._f+=(i[6]||" ")+_n[e][0];break}n.match(rn)&&(t._f+="Z"),xt(t)}else t._isValid=!1}function at(t){var e=An.exec(t._i);return null!==e?void(t._d=new Date(+e[1])):(it(t),void(t._isValid===!1&&(delete t._isValid,r.createFromInputFallback(t))))}function st(t,e,r,n,i,a,s){var o=new Date(t,e,r,n,i,a,s);return 1970>t&&o.setFullYear(t),o}function ot(t){var e=new Date(Date.UTC.apply(null,arguments));return 1970>t&&e.setUTCFullYear(t),e}function ut(t){return ct(t)?366:365}function ct(t){return t%4===0&&t%100!==0||t%400===0}function lt(){return ct(this.year())}function ht(t,e,r){var n,i=r-e,a=r-t.day();return a>i&&(a-=7),i-7>a&&(a+=7),n=Bt(t).add(a,"d"),{week:Math.ceil(n.dayOfYear()/7),year:n.year()}}function dt(t){return ht(t,this._week.dow,this._week.doy).week}function ft(){return this._week.dow}function pt(){return this._week.doy}function gt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function yt(t){var e=ht(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function mt(t,e,r,n,i){var a,s=6+i-n,o=ot(t,0,1+s),u=o.getUTCDay();return i>u&&(u+=7),r=null!=r?1*r:i,a=1+s+7*(e-1)-u+r,{year:a>0?t:t-1,dayOfYear:a>0?a:ut(t-1)+a}}function vt(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function bt(t,e,r){return null!=t?t:null!=e?e:r}function _t(t){var e=new Date;return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function At(t){var e,r,n,i,a=[];if(!t._d){for(n=_t(t),t._w&&null==t._a[ln]&&null==t._a[cn]&&wt(t),t._dayOfYear&&(i=bt(t._a[un],n[un]),t._dayOfYear>ut(i)&&(h(t)._overflowDayOfYear=!0),r=ot(i,0,t._dayOfYear),t._a[cn]=r.getUTCMonth(),t._a[ln]=r.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=a[e]=n[e];for(;7>e;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[hn]&&0===t._a[dn]&&0===t._a[fn]&&0===t._a[pn]&&(t._nextDay=!0,t._a[hn]=0),t._d=(t._useUTC?ot:st).apply(null,a),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[hn]=24)}}function wt(t){var e,r,n,i,a,s,o;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(a=1,s=4,r=bt(e.GG,t._a[un],ht(Bt(),1,4).year),n=bt(e.W,1),i=bt(e.E,1)):(a=t._locale._week.dow,s=t._locale._week.doy,r=bt(e.gg,t._a[un],ht(Bt(),a,s).year),n=bt(e.w,1),null!=e.d?(i=e.d,a>i&&++n):i=null!=e.e?e.e+a:a),o=mt(r,n,i,s,a),t._a[un]=o.year,t._dayOfYear=o.dayOfYear}function xt(t){if(t._f===r.ISO_8601)return void it(t);t._a=[],h(t).empty=!0;var e,n,i,a,s,o=""+t._i,u=o.length,c=0;for(i=q(t._f,t._locale).match(Ur)||[],e=0;e0&&h(t).unusedInput.push(s),o=o.slice(o.indexOf(n)+n.length),c+=n.length),Vr[a]?(n?h(t).empty=!1:h(t).unusedTokens.push(a),H(a,n,t)):t._strict&&!n&&h(t).unusedTokens.push(a);h(t).charsLeftOver=u-c,o.length>0&&h(t).unusedInput.push(o),h(t).bigHour===!0&&t._a[hn]<=12&&t._a[hn]>0&&(h(t).bigHour=void 0),t._a[hn]=Et(t._locale,t._a[hn],t._meridiem),At(t),tt(t)}function Et(t,e,r){var n;return null==r?e:null!=t.meridiemHour?t.meridiemHour(e,r):null!=t.isPM?(n=t.isPM(r),n&&12>e&&(e+=12),n||12!==e||(e=0),e):e}function kt(t){var e,r,n,i,a;if(0===t._f.length)return h(t).invalidFormat=!0,void(t._d=new Date(0/0));for(i=0;ia)&&(n=a,r=e));u(t,r||e)}function Dt(t){if(!t._d){var e=T(t._i);t._a=[e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],At(t)}}function Ct(t){var e=new g(tt(Ft(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Ft(t){var e=t._i,r=t._f;return t._locale=t._locale||D(t._l),null===e||void 0===r&&""===e?f({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),y(e)?new g(tt(e)):(i(r)?kt(t):r?xt(t):a(e)?t._d=e:Tt(t),t))}function Tt(t){var e=t._i;void 0===e?t._d=new Date:a(e)?t._d=new Date(+e):"string"==typeof e?at(t):i(e)?(t._a=s(e.slice(0),function(t){return parseInt(t,10)}),At(t)):"object"==typeof e?Dt(t):"number"==typeof e?t._d=new Date(e):r.createFromInputFallback(t)}function St(t,e,r,n,i){var a={};return"boolean"==typeof r&&(n=r,r=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=r,a._i=t,a._f=e,a._strict=n,Ct(a)}function Bt(t,e,r,n){return St(t,e,r,n,!1)}function Lt(t,e){var r,n;if(1===e.length&&i(e[0])&&(e=e[0]),!e.length)return Bt();for(r=e[0],n=1;nt&&(t=-t,r="-"),r+I(~~(t/60),2)+e+I(~~t%60,2)})}function Rt(t){var e=(t||"").match(rn)||[],r=e[e.length-1]||[],n=(r+"").match(Dn)||["-",0,0],i=+(60*n[1])+v(n[2]);return"+"===n[0]?i:-i}function qt(t,e){var n,i;return e._isUTC?(n=e.clone(),i=(y(t)||a(t)?+t:+Bt(t))-+n,n._d.setTime(+n._d+i),r.updateOffset(n,!1),n):Bt(t).local()}function jt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Ut(t,e){var n,i=this._offset||0;return null!=t?("string"==typeof t&&(t=Rt(t)),Math.abs(t)<16&&(t=60*t),!this._isUTC&&e&&(n=jt(this)),this._offset=t,this._isUTC=!0,null!=n&&this.add(n,"m"),i!==t&&(!e||this._changeInProgress?ne(this,Jt(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:jt(this)}function Yt(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Gt(t){return this.utcOffset(0,t)}function Vt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(jt(this),"m")),this}function $t(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Rt(this._i)),this}function Ht(t){return t=t?Bt(t).utcOffset():0,(this.utcOffset()-t)%60===0}function Wt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function zt(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var t={};if(p(t,this),t=Ft(t),t._a){var e=t._isUTC?c(t._a):Bt(t._a);this._isDSTShifted=this.isValid()&&b(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Zt(){return!this._isUTC}function Xt(){return this._isUTC}function Kt(){return this._isUTC&&0===this._offset}function Jt(t,e){var r,n,i,a=t,s=null;return Mt(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(a={},e?a[e]=t:a.milliseconds=t):(s=Cn.exec(t))?(r="-"===s[1]?-1:1,a={y:0,d:v(s[ln])*r,h:v(s[hn])*r,m:v(s[dn])*r,s:v(s[fn])*r,ms:v(s[pn])*r}):(s=Fn.exec(t))?(r="-"===s[1]?-1:1,a={y:Qt(s[2],r),M:Qt(s[3],r),d:Qt(s[4],r),h:Qt(s[5],r),m:Qt(s[6],r),s:Qt(s[7],r),w:Qt(s[8],r)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(i=ee(Bt(a.from),Bt(a.to)),a={},a.ms=i.milliseconds,a.M=i.months),n=new Nt(a),Mt(t)&&o(t,"_locale")&&(n._locale=t._locale),n}function Qt(t,e){var r=t&&parseFloat(t.replace(",","."));return(isNaN(r)?0:r)*e}function te(t,e){var r={milliseconds:0,months:0};return r.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(r.months,"M").isAfter(e)&&--r.months,r.milliseconds=+e-+t.clone().add(r.months,"M"),r}function ee(t,e){var r;return e=qt(e,t),t.isBefore(e)?r=te(t,e):(r=te(e,t),r.milliseconds=-r.milliseconds,r.months=-r.months),r}function re(t,e){return function(r,n){var i,a;return null===n||isNaN(+n)||(nt(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),a=r,r=n,n=a),r="string"==typeof r?+r:r,i=Jt(r,n),ne(this,i,t),this}}function ne(t,e,n,i){var a=e._milliseconds,s=e._days,o=e._months;i=null==i?!0:i,a&&t._d.setTime(+t._d+a*n),s&&L(t,"Date",B(t,"Date")+s*n),o&&K(t,B(t,"Month")+o*n),i&&r.updateOffset(t,s||o)}function ie(t,e){var r=t||Bt(),n=qt(r,this).startOf("day"),i=this.diff(n,"days",!0),a=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse";return this.format(e&&e[a]||this.localeData().calendar(a,this,Bt(r)))}function ae(){return new g(this)}function se(t,e){var r;return e=F("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=y(t)?t:Bt(t),+this>+t):(r=y(t)?+t:+Bt(t),r<+this.clone().startOf(e))}function oe(t,e){var r;return e=F("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=y(t)?t:Bt(t),+t>+this):(r=y(t)?+t:+Bt(t),+this.clone().endOf(e)e-a?(r=t.clone().add(i-1,"months"),n=(e-a)/(a-r)):(r=t.clone().add(i+1,"months"),n=(e-a)/(r-a)),-(i+n)}function de(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function fe(){var t=this.clone().utc();return 0e;e++)if(this._weekdaysParse[e]||(r=Bt([2e3,1]).day(e),n="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[e]=new RegExp(n.replace(".",""),"i")),this._weekdaysParse[e].test(t))return e}function Ge(t){var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Re(t,this.localeData()),this.add(t-e,"d")):e}function Ve(t){var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function $e(t){return null==t?this.day()||7:this.day(this.day()%7?t:t-7)}function He(t,e){N(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function We(t,e){return e._meridiemParse}function ze(t){return"p"===(t+"").toLowerCase().charAt(0)}function Ze(t,e,r){return t>11?r?"pm":"PM":r?"am":"AM"}function Xe(t,e){e[pn]=v(1e3*("0."+t))}function Ke(){return this._isUTC?"UTC":""}function Je(){return this._isUTC?"Coordinated Universal Time":""}function Qe(t){return Bt(1e3*t)}function tr(){return Bt.apply(null,arguments).parseZone()}function er(t,e,r){var n=this._calendar[t];return"function"==typeof n?n.call(e,r):n}function rr(t){var e=this._longDateFormat[t],r=this._longDateFormat[t.toUpperCase()];return e||!r?e:(this._longDateFormat[t]=r.replace(/MMMM|MM|DD|dddd/g,function(t){ -return t.slice(1)}),this._longDateFormat[t])}function nr(){return this._invalidDate}function ir(t){return this._ordinal.replace("%d",t)}function ar(t){return t}function sr(t,e,r,n){var i=this._relativeTime[r];return"function"==typeof i?i(t,e,r,n):i.replace(/%d/i,t)}function or(t,e){var r=this._relativeTime[t>0?"future":"past"];return"function"==typeof r?r(e):r.replace(/%s/i,e)}function ur(t){var e,r;for(r in t)e=t[r],"function"==typeof e?this[r]=e:this["_"+r]=e;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function cr(t,e,r,n){var i=D(),a=c().set(n,e);return i[r](a,t)}function lr(t,e,r,n,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return cr(t,e,r,i);var a,s=[];for(a=0;n>a;a++)s[a]=cr(t,a,r,i);return s}function hr(t,e){return lr(t,e,"months",12,"month")}function dr(t,e){return lr(t,e,"monthsShort",12,"month")}function fr(t,e){return lr(t,e,"weekdays",7,"day")}function pr(t,e){return lr(t,e,"weekdaysShort",7,"day")}function gr(t,e){return lr(t,e,"weekdaysMin",7,"day")}function yr(){var t=this._data;return this._milliseconds=Kn(this._milliseconds),this._days=Kn(this._days),this._months=Kn(this._months),t.milliseconds=Kn(t.milliseconds),t.seconds=Kn(t.seconds),t.minutes=Kn(t.minutes),t.hours=Kn(t.hours),t.months=Kn(t.months),t.years=Kn(t.years),this}function mr(t,e,r,n){var i=Jt(e,r);return t._milliseconds+=n*i._milliseconds,t._days+=n*i._days,t._months+=n*i._months,t._bubble()}function vr(t,e){return mr(this,t,e,1)}function br(t,e){return mr(this,t,e,-1)}function _r(t){return 0>t?Math.floor(t):Math.ceil(t)}function Ar(){var t,e,r,n,i,a=this._milliseconds,s=this._days,o=this._months,u=this._data;return a>=0&&s>=0&&o>=0||0>=a&&0>=s&&0>=o||(a+=864e5*_r(xr(o)+s),s=0,o=0),u.milliseconds=a%1e3,t=m(a/1e3),u.seconds=t%60,e=m(t/60),u.minutes=e%60,r=m(e/60),u.hours=r%24,s+=m(r/24),i=m(wr(s)),o+=i,s-=_r(xr(i)),n=m(o/12),o%=12,u.days=s,u.months=o,u.years=n,this}function wr(t){return 4800*t/146097}function xr(t){return 146097*t/4800}function Er(t){var e,r,n=this._milliseconds;if(t=F(t),"month"===t||"year"===t)return e=this._days+n/864e5,r=this._months+wr(e),"month"===t?r:r/12;switch(e=this._days+Math.round(xr(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}}function kr(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*v(this._months/12)}function Dr(t){return function(){return this.as(t)}}function Cr(t){return t=F(t),this[t+"s"]()}function Fr(t){return function(){return this._data[t]}}function Tr(){return m(this.days()/7)}function Sr(t,e,r,n,i){return i.relativeTime(e||1,!!r,t,n)}function Br(t,e,r){var n=Jt(t).abs(),i=fi(n.as("s")),a=fi(n.as("m")),s=fi(n.as("h")),o=fi(n.as("d")),u=fi(n.as("M")),c=fi(n.as("y")),l=i0,l[4]=r,Sr.apply(null,l)}function Lr(t,e){return void 0===pi[t]?!1:void 0===e?pi[t]:(pi[t]=e,!0)}function Or(t){var e=this.localeData(),r=Br(this,!t,e);return t&&(r=e.pastFuture(+this,r)),e.postformat(r)}function Ir(){var t,e,r,n=gi(this._milliseconds)/1e3,i=gi(this._days),a=gi(this._months);t=m(n/60),e=m(t/60),n%=60,t%=60,r=m(a/12),a%=12;var s=r,o=a,u=i,c=e,l=t,h=n,d=this.asSeconds();return d?(0>d?"-":"")+"P"+(s?s+"Y":"")+(o?o+"M":"")+(u?u+"D":"")+(c||l||h?"T":"")+(c?c+"H":"")+(l?l+"M":"")+(h?h+"S":""):"P0D"}var Nr,Mr,Pr=r.momentProperties=[],Rr=!1,qr={},jr={},Ur=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Yr=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Gr={},Vr={},$r=/\d/,Hr=/\d\d/,Wr=/\d{3}/,zr=/\d{4}/,Zr=/[+-]?\d{6}/,Xr=/\d\d?/,Kr=/\d{1,3}/,Jr=/\d{1,4}/,Qr=/[+-]?\d{1,6}/,tn=/\d+/,en=/[+-]?\d+/,rn=/Z|[+-]\d\d:?\d\d/gi,nn=/[+-]?\d+(\.\d{1,3})?/,an=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,sn={},on={},un=0,cn=1,ln=2,hn=3,dn=4,fn=5,pn=6;N("M",["MM",2],"Mo",function(){return this.month()+1}),N("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),N("MMMM",0,0,function(t){return this.localeData().months(this,t)}),C("month","M"),U("M",Xr),U("MM",Xr,Hr),U("MMM",an),U("MMMM",an),V(["M","MM"],function(t,e){e[cn]=v(t)-1}),V(["MMM","MMMM"],function(t,e,r,n){var i=r._locale.monthsParse(t,n,r._strict);null!=i?e[cn]=i:h(r).invalidMonth=t});var gn="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),yn="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),mn={};r.suppressDeprecationWarnings=!1;var vn=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,bn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],_n=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],An=/^\/?Date\((\-?\d+)/i;r.createFromInputFallback=rt("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),N(0,["YY",2],0,function(){return this.year()%100}),N(0,["YYYY",4],0,"year"),N(0,["YYYYY",5],0,"year"),N(0,["YYYYYY",6,!0],0,"year"),C("year","y"),U("Y",en),U("YY",Xr,Hr),U("YYYY",Jr,zr),U("YYYYY",Qr,Zr),U("YYYYYY",Qr,Zr),V(["YYYYY","YYYYYY"],un),V("YYYY",function(t,e){e[un]=2===t.length?r.parseTwoDigitYear(t):v(t)}),V("YY",function(t,e){e[un]=r.parseTwoDigitYear(t)}),r.parseTwoDigitYear=function(t){return v(t)+(v(t)>68?1900:2e3)};var wn=S("FullYear",!1);N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),C("week","w"),C("isoWeek","W"),U("w",Xr),U("ww",Xr,Hr),U("W",Xr),U("WW",Xr,Hr),$(["w","ww","W","WW"],function(t,e,r,n){e[n.substr(0,1)]=v(t)});var xn={dow:0,doy:6};N("DDD",["DDDD",3],"DDDo","dayOfYear"),C("dayOfYear","DDD"),U("DDD",Kr),U("DDDD",Wr),V(["DDD","DDDD"],function(t,e,r){r._dayOfYear=v(t)}),r.ISO_8601=function(){};var En=rt("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Bt.apply(null,arguments);return this>t?this:t}),kn=rt("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Bt.apply(null,arguments);return t>this?this:t});Pt("Z",":"),Pt("ZZ",""),U("Z",rn),U("ZZ",rn),V(["Z","ZZ"],function(t,e,r){r._useUTC=!0,r._tzm=Rt(t)});var Dn=/([\+\-]|\d\d)/gi;r.updateOffset=function(){};var Cn=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Fn=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Jt.fn=Nt.prototype;var Tn=re(1,"add"),Sn=re(-1,"subtract");r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Bn=rt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});N(0,["gg",2],0,function(){return this.weekYear()%100}),N(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Be("gggg","weekYear"),Be("ggggg","weekYear"),Be("GGGG","isoWeekYear"),Be("GGGGG","isoWeekYear"),C("weekYear","gg"),C("isoWeekYear","GG"),U("G",en),U("g",en),U("GG",Xr,Hr),U("gg",Xr,Hr),U("GGGG",Jr,zr),U("gggg",Jr,zr),U("GGGGG",Qr,Zr),U("ggggg",Qr,Zr),$(["gggg","ggggg","GGGG","GGGGG"],function(t,e,r,n){e[n.substr(0,2)]=v(t)}),$(["gg","GG"],function(t,e,n,i){e[i]=r.parseTwoDigitYear(t)}),N("Q",0,0,"quarter"),C("quarter","Q"),U("Q",$r),V("Q",function(t,e){e[cn]=3*(v(t)-1)}),N("D",["DD",2],"Do","date"),C("date","D"),U("D",Xr),U("DD",Xr,Hr),U("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),V(["D","DD"],ln),V("Do",function(t,e){e[ln]=v(t.match(Xr)[0],10)});var Ln=S("Date",!0);N("d",0,"do","day"),N("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),N("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),N("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),C("day","d"),C("weekday","e"),C("isoWeekday","E"),U("d",Xr),U("e",Xr),U("E",Xr),U("dd",an),U("ddd",an),U("dddd",an),$(["dd","ddd","dddd"],function(t,e,r){var n=r._locale.weekdaysParse(t);null!=n?e.d=n:h(r).invalidWeekday=t}),$(["d","e","E"],function(t,e,r,n){e[n]=v(t)});var On="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),In="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Nn="Su_Mo_Tu_We_Th_Fr_Sa".split("_");N("H",["HH",2],0,"hour"),N("h",["hh",2],0,function(){return this.hours()%12||12}),He("a",!0),He("A",!1),C("hour","h"),U("a",We),U("A",We),U("H",Xr),U("h",Xr),U("HH",Xr,Hr),U("hh",Xr,Hr),V(["H","HH"],hn),V(["a","A"],function(t,e,r){r._isPm=r._locale.isPM(t),r._meridiem=t}),V(["h","hh"],function(t,e,r){e[hn]=v(t),h(r).bigHour=!0});var Mn=/[ap]\.?m?\.?/i,Pn=S("Hours",!0);N("m",["mm",2],0,"minute"),C("minute","m"),U("m",Xr),U("mm",Xr,Hr),V(["m","mm"],dn);var Rn=S("Minutes",!1);N("s",["ss",2],0,"second"),C("second","s"),U("s",Xr),U("ss",Xr,Hr),V(["s","ss"],fn);var qn=S("Seconds",!1);N("S",0,0,function(){return~~(this.millisecond()/100)}),N(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,function(){return 10*this.millisecond()}),N(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),N(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),N(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),N(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),N(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),C("millisecond","ms"),U("S",Kr,$r),U("SS",Kr,Hr),U("SSS",Kr,Wr);var jn;for(jn="SSSS";jn.length<=9;jn+="S")U(jn,tn);for(jn="S";jn.length<=9;jn+="S")V(jn,Xe);var Un=S("Milliseconds",!1);N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");var Yn=g.prototype;Yn.add=Tn,Yn.calendar=ie,Yn.clone=ae,Yn.diff=le,Yn.endOf=we,Yn.format=pe,Yn.from=ge,Yn.fromNow=ye,Yn.to=me,Yn.toNow=ve,Yn.get=O,Yn.invalidAt=Se,Yn.isAfter=se,Yn.isBefore=oe,Yn.isBetween=ue,Yn.isSame=ce,Yn.isValid=Fe,Yn.lang=Bn,Yn.locale=be,Yn.localeData=_e,Yn.max=kn,Yn.min=En,Yn.parsingFlags=Te,Yn.set=O,Yn.startOf=Ae,Yn.subtract=Sn,Yn.toArray=De,Yn.toObject=Ce,Yn.toDate=ke,Yn.toISOString=fe,Yn.toJSON=fe,Yn.toString=de,Yn.unix=Ee,Yn.valueOf=xe,Yn.year=wn,Yn.isLeapYear=lt,Yn.weekYear=Oe,Yn.isoWeekYear=Ie,Yn.quarter=Yn.quarters=Pe,Yn.month=J,Yn.daysInMonth=Q,Yn.week=Yn.weeks=gt,Yn.isoWeek=Yn.isoWeeks=yt,Yn.weeksInYear=Me,Yn.isoWeeksInYear=Ne,Yn.date=Ln,Yn.day=Yn.days=Ge,Yn.weekday=Ve,Yn.isoWeekday=$e,Yn.dayOfYear=vt,Yn.hour=Yn.hours=Pn,Yn.minute=Yn.minutes=Rn,Yn.second=Yn.seconds=qn,Yn.millisecond=Yn.milliseconds=Un,Yn.utcOffset=Ut,Yn.utc=Gt,Yn.local=Vt,Yn.parseZone=$t,Yn.hasAlignedHourOffset=Ht,Yn.isDST=Wt,Yn.isDSTShifted=zt,Yn.isLocal=Zt,Yn.isUtcOffset=Xt,Yn.isUtc=Kt,Yn.isUTC=Kt,Yn.zoneAbbr=Ke,Yn.zoneName=Je,Yn.dates=rt("dates accessor is deprecated. Use date instead.",Ln),Yn.months=rt("months accessor is deprecated. Use month instead",J),Yn.years=rt("years accessor is deprecated. Use year instead",wn),Yn.zone=rt("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Yt);var Gn=Yn,Vn={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},$n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Hn="Invalid date",Wn="%d",zn=/\d{1,2}/,Zn={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Xn=_.prototype;Xn._calendar=Vn,Xn.calendar=er,Xn._longDateFormat=$n,Xn.longDateFormat=rr,Xn._invalidDate=Hn,Xn.invalidDate=nr,Xn._ordinal=Wn,Xn.ordinal=ir,Xn._ordinalParse=zn,Xn.preparse=ar,Xn.postformat=ar,Xn._relativeTime=Zn,Xn.relativeTime=sr,Xn.pastFuture=or,Xn.set=ur,Xn.months=z,Xn._months=gn,Xn.monthsShort=Z,Xn._monthsShort=yn,Xn.monthsParse=X,Xn.week=dt,Xn._week=xn,Xn.firstDayOfYear=pt,Xn.firstDayOfWeek=ft,Xn.weekdays=qe,Xn._weekdays=On,Xn.weekdaysMin=Ue,Xn._weekdaysMin=Nn,Xn.weekdaysShort=je,Xn._weekdaysShort=In,Xn.weekdaysParse=Ye,Xn.isPM=ze,Xn._meridiemParse=Mn,Xn.meridiem=Ze,E("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,r=1===v(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+r}}),r.lang=rt("moment.lang is deprecated. Use moment.locale instead.",E),r.langData=rt("moment.langData is deprecated. Use moment.localeData instead.",D);var Kn=Math.abs,Jn=Dr("ms"),Qn=Dr("s"),ti=Dr("m"),ei=Dr("h"),ri=Dr("d"),ni=Dr("w"),ii=Dr("M"),ai=Dr("y"),si=Fr("milliseconds"),oi=Fr("seconds"),ui=Fr("minutes"),ci=Fr("hours"),li=Fr("days"),hi=Fr("months"),di=Fr("years"),fi=Math.round,pi={s:45,m:45,h:22,d:26,M:11},gi=Math.abs,yi=Nt.prototype;yi.abs=yr,yi.add=vr,yi.subtract=br,yi.as=Er,yi.asMilliseconds=Jn,yi.asSeconds=Qn,yi.asMinutes=ti,yi.asHours=ei,yi.asDays=ri,yi.asWeeks=ni,yi.asMonths=ii,yi.asYears=ai,yi.valueOf=kr,yi._bubble=Ar,yi.get=Cr,yi.milliseconds=si,yi.seconds=oi,yi.minutes=ui,yi.hours=ci,yi.days=li,yi.weeks=Tr,yi.months=hi,yi.years=di,yi.humanize=Or,yi.toISOString=Ir,yi.toString=Ir,yi.toJSON=Ir,yi.locale=be,yi.localeData=_e,yi.toIsoString=rt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ir),yi.lang=Bn,N("X",0,0,"unix"),N("x",0,0,"valueOf"),U("x",en),U("X",nn),V("X",function(t,e,r){r._d=new Date(1e3*parseFloat(t,10))}),V("x",function(t,e,r){r._d=new Date(v(t))}),r.version="2.10.6",n(Bt),r.fn=Gn,r.min=Ot,r.max=It,r.utc=c,r.unix=Qe,r.months=hr,r.isDate=a,r.locale=E,r.invalid=f,r.duration=Jt,r.isMoment=y,r.weekdays=fr,r.parseZone=tr,r.localeData=D,r.isDuration=Mt,r.monthsShort=dr,r.weekdaysMin=gr,r.defineLocale=k,r.weekdaysShort=pr,r.normalizeUnits=F,r.relativeTimeThreshold=Lr;var mi=r;return mi})},{}],106:[function(t,e){e.exports={name:"mermaid",version:"0.5.8",description:"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams and gantt charts.",main:"src/mermaid.js",keywords:["diagram","markdown","flowchart","sequence diagram","gantt"],bin:{mermaid:"./bin/mermaid.js"},scripts:{live:"live-server ./test/examples",lint:"node node_modules/eslint/bin/eslint.js src",jison:"gulp jison_legacy",karma:"node node_modules/karma/bin/karma start karma.conf.js --single-run",watch:"source ./scripts/watch.sh",doc:"rm -r build;rm -r dist/www;gulp vartree;cp dist/www/all.html ../mermaid-pages/index.html;cp dist/mermaid.js ../mermaid-pages/javascripts/lib;cp dist/mermaid.forest.css ../mermaid-pages/stylesheets",tape:"node node_modules/tape/bin/tape test/cli_test-*.js",jasmine:"npm run jison &&node node_modules/jasmine-es6/bin/jasmine.js",pretest:"npm run jison",test:"npm run dist && npm run karma && npm run tape","dist-slim-mermaid":"node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.slim.js -x d3 && cat dist/mermaid.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.slim.min.js","dist-slim-mermaidAPI":"node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.slim.js -x d3 && cat dist/mermaidAPI.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.slim.min.js","dist-mermaid":"node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.js && cat dist/mermaid.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.min.js","dist-mermaidAPI":"node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.js && cat dist/mermaidAPI.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.min.js",dist:"npm run dist-slim-mermaid && npm run dist-slim-mermaidAPI && npm run dist-mermaid && npm run dist-mermaidAPI"},repository:{type:"git",url:"https://github.com/knsv/mermaid"},author:"Knut Sveidqvist",license:"MIT",dependencies:{chalk:"^0.5.1",d3:"3.5.6",dagre:"^0.7.4","dagre-d3":"0.4.10",he:"^0.5.0",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.9.0",semver:"^4.1.1",which:"^1.0.8"},devDependencies:{async:"^0.9.0","babel-eslint":"^4.1.3",babelify:"^6.4.0",browserify:"~6.2.0",clone:"^0.2.0","codeclimate-test-reporter":"0.0.4",dateformat:"^1.0.11",dox:"^0.8.0",eslint:"^1.6.0","eslint-watch":"^2.1.2","event-stream":"^3.2.0",foundation:"^4.2.1-1","front-matter":"^0.2.0",gulp:"~3.9.0","gulp-bower":"0.0.10","gulp-browserify":"^0.5.0","gulp-bump":"^0.1.11","gulp-concat":"~2.4.1","gulp-data":"^1.1.1","gulp-dox":"^0.1.6","gulp-ext-replace":"^0.2.0","gulp-filelog":"^0.4.1","gulp-front-matter":"^1.2.3","gulp-hogan":"^1.1.0","gulp-if":"^1.2.5","gulp-insert":"^0.4.0","gulp-istanbul":"^0.4.0","gulp-jasmine":"~2.1.0","gulp-jasmine-browser":"^0.2.3","gulp-jison":"~1.2.0","gulp-jshint":"^1.9.0","gulp-less":"^3.0.1","gulp-livereload":"^3.8.0","gulp-marked":"^1.0.0","gulp-mdvars":"^2.0.0","gulp-qunit":"~1.2.1","gulp-rename":"~1.2.0","gulp-shell":"^0.2.10","gulp-tag-version":"^1.2.1","gulp-uglify":"~1.0.1","gulp-util":"^3.0.7","gulp-vartree":"^2.0.1","hogan.js":"^3.0.2",jasmine:"2.3.2","jasmine-es6":"0.0.18",jison:"zaach/jison",jsdom:"^7.0.2","jshint-stylish":"^2.0.1",karma:"^0.13.15","karma-babel-preprocessor":"^6.0.1","karma-browserify":"^4.4.0","karma-jasmine":"^0.3.6","karma-phantomjs-launcher":"^0.2.1","live-server":"^0.9.0","map-stream":"0.0.6",marked:"^0.3.2","mock-browser":"^0.91.34",path:"^0.4.9",phantomjs:"^1.9.18",proxyquire:"^1.7.3","proxyquire-universal":"^1.0.8",proxyquireify:"^3.0.0","require-dir":"^0.3.0",rewire:"^2.1.3",rimraf:"^2.2.8",tape:"^3.0.3",testdom:"^2.0.0",uglifyjs:"^2.4.10","vinyl-source-stream":"^1.1.0",watchify:"^3.6.1"}}},{}],107:[function(t,e){"use strict";var r;if(t)try{r=t("d3")}catch(n){}r||(r=window.d3),e.exports=r,function(){var t=!1;if(t="tspans",r.selection.prototype.textwrap)return!1;if("undefined"==typeof t)var t=!1;r.selection.prototype.textwrap=r.selection.enter.prototype.textwrap=function(e,n){var i,n=parseInt(n)||0,a=this,s=function(t){var e=t[0][0],n=e.tagName.toString();if("rect"!==n)return!1;var i={};return i.x=r.select(e).attr("x")||0,i.y=r.select(e).attr("y")||0,i.width=r.select(e).attr("width")||0,i.height=r.select(e).attr("height")||0,i.attr=t.attr,i},o=function(t){if(t.attr||(t.attr=function(t){return this[t]?this[t]:void 0}),"object"==typeof t&&"undefined"!=typeof t.x&&"undefined"!=typeof t.y&&"undefined"!=typeof t.width&&"undefined"!=typeof t.height)return t;if("function"==typeof Array.isArray&&Array.isArray(t)||"[object Array]"===Object.prototype.toString.call(t)){var e=s(t);return e}return!1},u=function(t,e){var r=t;return 0!==e&&(r.x=parseInt(r.x)+e,r.y=parseInt(r.y)+e,r.width-=2*e,r.height-=2*e),r},c=o(e);if(n&&(c=u(c,n)),0!=a.length&&r&&e&&c){e=c;var l,h=function(t){var n=r.select(t[0].parentNode),a=n.select("text"),s=a.style("line-height"),o=a.text();a.remove();var u=n.append("foreignObject");u.attr("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility").attr("x",e.x).attr("y",e.y).attr("width",e.width).attr("height",e.height);var c=u.append("xhtml:div").attr("class","wrapped");c.style("height",e.height).style("width",e.width).html(o),s&&c.style("line-height",s),i=n.select("foreignObject")},d=function(t){var a,s=t[0],o=s.parentNode,u=r.select(s),c=s.getBBox().height,l=s.getBBox().width,h=c,d=u.style("line-height");if(a=d&&parseInt(d)?parseInt(d.replace("px","")):h,l>e.width){var f=u.text();if(u.text(""),f){var p,g;if(-1!==f.indexOf(" ")){var p=" ";g=f.split(" ")}else{p="";var y=f.length,m=Math.ceil(l/e.width),v=Math.floor(y/m);v*m>=y||m++;for(var b,_,g=[],A=0;m>A;A++)_=A*v,b=f.substr(_,v),g.push(b)}for(var w=[],x=0,E={},A=0;Ae.width&&C&&""!==C&&(x+=F,E={string:C,width:F,offset:x},w.push(E),u.text(""),u.text(D),A==g.length-1&&(k=D,u.text(k),T=s.getComputedTextLength())),A==g.length-1){u.text("");var S=k;S&&""!==S&&(T-x>0&&(T-=x),E={string:S,width:T,offset:x},w.push(E))}}var B;u.text("");for(var A=0;A0){w[A-1]}A*a0?a:void 0}),B.attr("x",function(){var t=e.x;return n&&(t+=n),t}))}}}u.attr("y",function(){var t=e.y;return a&&(t+=a),n&&(t+=n),t}),u.attr("x",function(){var t=e.x;return n&&(t+=n),t}),i=r.select(o).selectAll("text")};t&&("foreignobjects"==t?l=h:"tspans"==t&&(l=d)),t||(l="undefined"!=typeof SVGForeignObjectElement?h:d);for(var f=0;f "+t.w+": "+JSON.stringify(s.edge(t))),p(i,s.edge(t),s.edge(t).relation)}),i.attr("height","100%"),i.attr("width","100%")}},{"../../d3":107,"../../logger":126,"./classDb":108,"./parser/classDiagram":110,dagre:53}],110:[function(t,e,r){(function(n){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r},r=[1,11],n=[1,12],i=[1,13],a=[1,15],s=[1,16],o=[1,17],u=[6,8],c=[1,26],l=[1,27],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[6,8,13,17,23,26,27,28,29,30,31],y=[6,8,13,17,23,26,27,28,29,30,31,45,46,47],m=[23,45,46,47],v=[23,30,31,45,46,47],b=[23,26,27,28,29,45,46,47],_=[6,8,13],A=[1,46],w={trace:function(){},yy:{},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},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"},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]],performAction:function(t,e,r,n,i,a){var s=a.length-1;switch(i){case 5:this.$=a[s-1]+a[s];break;case 6:this.$=a[s];break;case 7:n.addRelation(a[s]);break;case 8:a[s-1].title=n.cleanupLabel(a[s]),n.addRelation(a[s-1]);break;case 12:n.addMembers(a[s-3],a[s-1]);break;case 13:this.$=[a[s]];break;case 14:a[s].push(a[s-1]),this.$=a[s];break;case 15:break;case 16:n.addMembers(a[s-1],n.cleanupLabel(a[s]));break;case 17:console.warn("Member",a[s]);break;case 18:break;case 19:this.$={id1:a[s-2],id2:a[s],relation:a[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 20:this.$={id1:a[s-3],id2:a[s],relation:a[s-1],relationTitle1:a[s-2],relationTitle2:"none"};break;case 21:this.$={id1:a[s-3],id2:a[s],relation:a[s-2],relationTitle1:"none",relationTitle2:a[s-1]};break;case 22:this.$={id1:a[s-4],id2:a[s],relation:a[s-2],relationTitle1:a[s-3],relationTitle2:a[s-1]};break;case 23:this.$={type1:a[s-2],type2:a[s],lineType:a[s-1]};break;case 24:this.$={type1:"none",type2:a[s],lineType:a[s-1]};break;case 25:this.$={type1:a[s-1],type2:"none",lineType:a[s]};break;case 26:this.$={type1:"none",type2:"none",lineType:a[s]};break;case 27:this.$=n.relationType.AGGREGATION;break;case 28:this.$=n.relationType.EXTENSION;break;case 29:this.$=n.relationType.COMPOSITION;break;case 30:this.$=n.relationType.DEPENDENCY;break;case 31:this.$=n.lineType.LINE;break;case 32:this.$=n.lineType.DOTTED_LINE}},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:r,20:n,21:i,45:a,46:s,47:o},{8:[1,18]},{6:[1,19],8:[2,3]},e(u,[2,7],{13:[1,20]}),e(u,[2,9]),e(u,[2,10]),e(u,[2,15],{22:21,24:24,25:25,13:[1,23],23:[1,22],26:c,27:l,28:h,29:d,30:f,31:p}),{10:32,11:14,45:a,46:s,47:o},e(u,[2,17]),e(u,[2,18]),e(g,[2,6],{11:14,10:33,45:a,46:s,47:o}),e(y,[2,46]),e(y,[2,47]),e(y,[2,48]),{1:[2,2]},{7:34,9:6,10:10,11:14,12:7,14:8,15:9,16:r,20:n,21:i,45:a,46:s,47:o},e(u,[2,8]),{10:35,11:14,23:[1,36],45:a,46:s,47:o},{22:37,24:24,25:25,26:c,27:l,28:h,29:d,30:f,31:p},e(u,[2,16]),{25:38,30:f,31:p},e(m,[2,26],{24:39,26:c,27:l,28:h,29:d}),e(v,[2,27]),e(v,[2,28]),e(v,[2,29]),e(v,[2,30]),e(b,[2,31]),e(b,[2,32]),e(u,[2,11],{17:[1,40]}),e(g,[2,5]),{8:[2,4]},e(_,[2,19]),{10:41, -11:14,45:a,46:s,47:o},{10:42,11:14,23:[1,43],45:a,46:s,47:o},e(m,[2,25],{24:44,26:c,27:l,28:h,29:d}),e(m,[2,24]),{18:45,20:A},e(_,[2,21]),e(_,[2,20]),{10:47,11:14,45:a,46:s,47:o},e(m,[2,23]),{19:[1,48]},{18:49,19:[2,13],20:A},e(_,[2,22]),e(u,[2,12]),{19:[2,14]}],defaultActions:{2:[2,1],18:[2,2],34:[2,4],49:[2,14]},parseError:function(t,e){if(!e.recoverable){var r=function(t,e){this.message=t,this.hash=e};throw r.prototype=new Error,new r(t,e)}this.trace(t)},parse:function(t){var e=this,r=[0],n=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,A,w,x,E,k,D,C=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},F={};;){if(_=r[r.length-1],this.defaultActions[_]?A=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),A=a[_]&&a[_][v]),"undefined"==typeof A||!A.length||!A[0]){var T="";D=[];for(x in a[_])this.terminals_[x]&&x>l&&D.push("'"+this.terminals_[x]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(A[0]){case 1:r.push(v),n.push(f.yytext),i.push(f.yylloc),r.push(A[1]),v=null,b?(v=b,b=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[A[1]][1],F.$=n[n.length-E],F._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(F,[s,u,o,p.yy,A[1],n,i].concat(d)),"undefined"!=typeof w)return w;E&&(r=r.slice(0,-1*E*2),n=n.slice(0,-1*E),i=i.slice(0,-1*E)),r.push(this.productions_[A[1]][0]),n.push(F.$),i.push(F._$),k=a[r[r.length-2]][r[r.length-1]],r.push(k);break;case 3:return!0}}return!0}},x=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),n=t[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(t=this.test_match(r,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[n]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,r,n){switch(r){case 0:break;case 1:return 6;case 2:break;case 3:return 5;case 4:return this.begin("struct"),17;case 5:return this.popState(),19;case 6:break;case 7:return"MEMBER";case 8:return 16;case 9:this.begin("string");break;case 10:this.popState();break;case 11:return"STR";case 12:return 27;case 13:return 27;case 14:return 29;case 15:return 29;case 16:return 28;case 17:return 26;case 18:return 30;case 19:return 31;case 20:return 13;case 21:return 43;case 22:return"DOT";case 23:return"PLUS";case 24:return 40;case 25:return"EQUALS";case 26:return"EQUALS";case 27:return 47;case 28:return"PUNCTUATION";case 29:return 46;case 30:return 45;case 31:return 42;case 32:return 8}},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)/,/^(?:$)/],conditions:{string:{rules:[10,11],inclusive:!1},struct:{rules:[5,6,7],inclusive:!1},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:!0}}};return t}();return w.lexer=x,t.prototype=w,w.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),n.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&r.main(n.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],111:[function(t,e,r){(function(e){"use strict";var n=t("../../logger"),i=new n.Log,a="",s=!1;r.setMessage=function(t){i.debug("Setting message to: "+t),a=t},r.getMessage=function(){return a},r.setInfo=function(t){s=t},r.getInfo=function(){return s},r.parseError=function(t,r){e.mermaidAPI.parseError(t,r)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../logger":126}],112:[function(t,e,r){"use strict";var n=t("./exampleDb"),i=t("./parser/example.js"),a=t("../../d3"),s=t("../../logger"),o=new s.Log;r.draw=function(t,e,r){var s;s=i.parser,s.yy=n,o.debug("Renering example diagram"),s.parse(t);var u=a.select("#"+e),c=u.append("g");c.append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("mermaid "+r),u.attr("height",100),u.attr("width",400)}},{"../../d3":107,"../../logger":126,"./exampleDb":111,"./parser/example.js":113}],113:[function(t,e,r){(function(n){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r},r=[6,9,10,12],n={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,message:11,say:12,TXT:13,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo",12:"say",13:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1],[8,1],[11,2]],performAction:function(t,e,r,n,i,a){var s=a.length-1;switch(i){case 1:return n;case 4:break;case 6:n.setInfo(!0);break;case 7:n.setMessage(a[s]);break;case 8:this.$=a[s-1].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},e(r,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8],11:9,12:[1,10]},{1:[2,1]},e(r,[2,3]),e(r,[2,4]),e(r,[2,5]),e(r,[2,6]),e(r,[2,7]),{13:[1,11]},e(r,[2,8])],defaultActions:{4:[2,1]},parseError:function(t,e){if(!e.recoverable){var r=function(t,e){this.message=t,this.hash=e};throw r.prototype=new Error,new r(t,e)}this.trace(t)},parse:function(t){var e=this,r=[0],n=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,A,w,x,E,k,D,C=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},F={};;){if(_=r[r.length-1],this.defaultActions[_]?A=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),A=a[_]&&a[_][v]),"undefined"==typeof A||!A.length||!A[0]){var T="";D=[];for(x in a[_])this.terminals_[x]&&x>l&&D.push("'"+this.terminals_[x]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(A[0]){case 1:r.push(v),n.push(f.yytext),i.push(f.yylloc),r.push(A[1]),v=null,b?(v=b,b=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[A[1]][1],F.$=n[n.length-E],F._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(F,[s,u,o,p.yy,A[1],n,i].concat(d)),"undefined"!=typeof w)return w;E&&(r=r.slice(0,-1*E*2),n=n.slice(0,-1*E),i=i.slice(0,-1*E)),r.push(this.productions_[A[1]][0]),n.push(F.$),i.push(F._$),k=a[r[r.length-2]][r[r.length-1]],r.push(k);break;case 3:return!0}}return!0}},i=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),n=t[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(t=this.test_match(r,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[n]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,r,n){switch(r){case 0:return 9;case 1:return 10;case 2:return 4;case 3:return 12;case 4:return 13;case 5:return 6;case 6:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:showInfo\b)/i,/^(?:info\b)/i,/^(?:say\b)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return t}();return n.lexer=i,t.prototype=n,n.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),n.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&r.main(n.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],114:[function(t,e){"use strict";var r,n=t("../../logger"),i=new n.Log;if(t)try{r=t("dagre-d3")}catch(a){i.debug("Could not load dagre-d3")}r||(r=window.dagreD3),e.exports=r},{"../../logger":126,"dagre-d3":4}],115:[function(t,e,r){"use strict";var n=t("./graphDb"),i=t("./parser/flow"),a=t("./parser/dot"),s=t("../../d3"),o=t("./dagre-d3"),u=t("../../logger"),c=new u.Log,l={};e.exports.setConf=function(t){var e,r=Object.keys(t);for(e=0;e0&&(s=a.classes.join(" "));var o="";o=n(o,a.styles),i="undefined"==typeof a.text?a.id:a.text;var u="";if(l.htmlLabels)u="html",i=i.replace(/fa:fa[\w\-]+/g,function(t){return''});else{var c=document.createElementNS("http://www.w3.org/2000/svg","text"),h=i.split(/
/),d=0;for(d=0;d/g,"\n");"undefined"==typeof t.style?l.htmlLabels?e.setEdge(t.start,t.end,{labelType:"html",style:a,labelpos:"c",label:''+t.text+"",arrowheadStyle:"fill: #333",arrowhead:r},i):e.setEdge(t.start,t.end,{labelType:"text",style:"stroke: #333; stroke-width: 1.5px;fill:none",labelpos:"c",label:s,arrowheadStyle:"fill: #333",arrowhead:r},i):e.setEdge(t.start,t.end,{labelType:"text",style:a,arrowheadStyle:"fill: #333",label:s,arrowhead:r},i)}})},r.getClasses=function(t,e){var r;n.clear(),r=e?a.parser:i.parser,r.yy=n,r.parse(t);var s=n.getClasses();return"undefined"==typeof s["default"]&&(s["default"]={id:"default"},s["default"].styles=[],s["default"].clusterStyles=["rx:4px","fill: rgb(255, 255, 222)","rx: 4px","stroke: rgb(170, 170, 51)","stroke-width: 1px"],s["default"].nodeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"],s["default"].edgeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"]),s},r.draw=function(t,e,u){c.debug("Drawing flowchart");var h;n.clear(),h=u?a.parser:i.parser,h.yy=n;try{h.parse(t)}catch(d){c.debug("Parsing failed")}var f;f=n.getDirection(),"undefined"==typeof f&&(f="TD");var p,g=new o.graphlib.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:f,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),y=n.getSubGraphs(),m=0;for(m=y.length-1;m>=0;m--)p=y[m],n.addVertex(p.id,p.title,"group",void 0);var v=n.getVertices(),b=n.getEdges();m=0;var _;for(m=y.length-1;m>=0;m--)for(p=y[m],s.selectAll("cluster").append("text"),_=0;_0?t.split(",").forEach(function(t){"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)}):"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)};var setTooltip=function(t,e){ -"undefined"!=typeof e&&(tooltips[t]=e)},setClickFun=function setClickFun(id,functionName){"undefined"!=typeof functionName&&"undefined"!=typeof vertices[id]&&funs.push(function(element){var elem=d3.select(element).select("#"+id);null!==elem&&elem.on("click",function(){eval(functionName+"('"+id+"')")})})},setLink=function(t,e){"undefined"!=typeof e&&"undefined"!=typeof vertices[t]&&funs.push(function(r){var n=d3.select(r).select("#"+t);null!==n&&n.on("click",function(){window.open(e,"newTab")})})};exports.getTooltip=function(t){return tooltips[t]},exports.setClickEvent=function(t,e,r,n){t.indexOf(",")>0?t.split(",").forEach(function(t){setTooltip(t,n),setClickFun(t,e),setLink(t,r)}):(setTooltip(t,n),setClickFun(t,e),setLink(t,r))},exports.bindFunctions=function(t){funs.forEach(function(e){e(t)})},exports.getDirection=function(){return direction},exports.getVertices=function(){return vertices},exports.getEdges=function(){return edges},exports.getClasses=function(){return classes};var setupToolTips=function(t){var e=d3.select(".mermaidTooltip");null===e[0][0]&&(e=d3.select("body").append("div").attr("class","mermaidTooltip").style("opacity",0));var r=d3.select(t).select("svg"),n=r.selectAll("g.node");n.on("mouseover",function(){var t=d3.select(this),r=t.attr("title");if(null!==r){var n=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.html(t.attr("title")).style("left",n.left+(n.right-n.left)/2+"px").style("top",n.top-14+document.body.scrollTop+"px"),t.classed("hover",!0)}}).on("mouseout",function(){e.transition().duration(500).style("opacity",0);var t=d3.select(this);t.classed("hover",!1)})};funs.push(setupToolTips),exports.clear=function(){vertices={},classes={},edges=[],funs=[],funs.push(setupToolTips),subGraphs=[],subCount=0,tooltips=[]},exports.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},exports.addSubGraph=function(t,e){function r(t){var e={"boolean":{},number:{},string:{}},r=[];return t.filter(function(t){var n=typeof t;return" "===t?!1:n in e?e[n].hasOwnProperty(t)?!1:e[n][t]=!0:r.indexOf(t)>=0?!1:r.push(t)})}var n=[];n=r(n.concat.apply(n,t));var i={id:"subGraph"+subCount,nodes:n,title:e};return subGraphs.push(i),subCount+=1,i.id};var getPosForId=function(t){var e;for(e=0;e2e3)){if(posCrossRef[secCount]=r,subGraphs[r].id===e)return{result:!0,count:0};for(var i=0,a=1;i=0){var o=t(e,s);if(o.result)return{result:!0,count:a+o.count};a+=o.count}i+=1}return{result:!1,count:a}}};exports.getDepthFirstPos=function(t){return posCrossRef[t]},exports.indexNodes=function(){secCount=-1,subGraphs.length>0&&indexNodes("none",subGraphs.length-1,0)},exports.getSubGraphs=function(){return subGraphs},exports.parseError=function(t,e){global.mermaidAPI.parseError(t,e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../d3":107,"../../logger":126}],117:[function(t,e,r){(function(n){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r},r=[1,5],n=[1,6],i=[1,12],a=[1,13],s=[1,14],o=[1,15],u=[1,16],c=[1,17],l=[1,18],h=[1,19],d=[1,20],f=[1,21],p=[1,22],g=[8,16,17,18,19,20,21,22,23,24,25,26],y=[1,37],m=[1,33],v=[1,34],b=[1,35],_=[1,36],A=[8,10,16,17,18,19,20,21,22,23,24,25,26,28,32,37,39,40,45,57,58],w=[10,28],x=[10,28,37,57,58],E=[2,49],k=[1,45],D=[1,48],C=[1,49],F=[1,52],T=[2,65],S=[1,65],B=[1,66],L=[1,67],O=[1,68],I=[1,69],N=[1,70],M=[1,71],P=[1,72],R=[1,73],q=[8,16,17,18,19,20,21,22,23,24,25,26,47],j=[10,28,37],U={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graph:4,EOF:5,graphStatement:6,idStatement:7,"{":8,stmt_list:9,"}":10,strict:11,GRAPH:12,DIGRAPH:13,textNoTags:14,textNoTagsToken:15,ALPHA:16,NUM:17,COLON:18,PLUS:19,EQUALS:20,MULT:21,DOT:22,BRKT:23,SPACE:24,MINUS:25,keywords:26,stmt:27,";":28,node_stmt:29,edge_stmt:30,attr_stmt:31,"=":32,subgraph:33,attr_list:34,NODE:35,EDGE:36,"[":37,a_list:38,"]":39,",":40,edgeRHS:41,node_id:42,edgeop:43,port:44,":":45,compass_pt:46,SUBGRAPH:47,n:48,ne:49,e:50,se:51,s:52,sw:53,w:54,nw:55,c:56,ARROW_POINT:57,ARROW_OPEN:58,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"{",10:"}",11:"strict",12:"GRAPH",13:"DIGRAPH",16:"ALPHA",17:"NUM",18:"COLON",19:"PLUS",20:"EQUALS",21:"MULT",22:"DOT",23:"BRKT",24:"SPACE",25:"MINUS",26:"keywords",28:";",32:"=",35:"NODE",36:"EDGE",37:"[",39:"]",40:",",45:":",47:"SUBGRAPH",48:"n",49:"ne",50:"e",51:"se",52:"s",53:"sw",54:"w",55:"nw",56:"c",57:"ARROW_POINT",58:"ARROW_OPEN"},productions_:[0,[3,2],[4,5],[4,6],[4,4],[6,1],[6,1],[7,1],[14,1],[14,2],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[9,1],[9,3],[27,1],[27,1],[27,1],[27,3],[27,1],[31,2],[31,2],[31,2],[34,4],[34,3],[34,3],[34,2],[38,5],[38,5],[38,3],[30,3],[30,3],[30,2],[30,2],[41,3],[41,3],[41,2],[41,2],[29,2],[29,1],[42,2],[42,1],[44,4],[44,2],[44,2],[33,5],[33,4],[33,3],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,0],[43,1],[43,1]],performAction:function(t,e,r,n,i,a){var s=a.length-1;switch(i){case 1:this.$=a[s-1];break;case 2:this.$=a[s-4];break;case 3:this.$=a[s-5];break;case 4:this.$=a[s-3];break;case 8:case 10:case 11:this.$=a[s];break;case 9:this.$=a[s-1]+""+a[s];break;case 12:case 13:case 14:case 15:case 16:case 18:case 19:case 20:this.$=a[s];break;case 17:this.$="
";break;case 39:this.$="oy";break;case 40:n.addLink(a[s-1],a[s].id,a[s].op),this.$="oy";break;case 42:n.addLink(a[s-1],a[s].id,a[s].op),this.$={op:a[s-2],id:a[s-1]};break;case 44:this.$={op:a[s-1],id:a[s]};break;case 48:n.addVertex(a[s-1]),this.$=a[s-1];break;case 49:n.addVertex(a[s]),this.$=a[s];break;case 66:this.$="arrow";break;case 67:this.$="arrow_open"}},table:[{3:1,4:2,6:3,11:[1,4],12:r,13:n},{1:[3]},{5:[1,7]},{7:8,8:[1,9],14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},{6:23,12:r,13:n},e(g,[2,5]),e(g,[2,6]),{1:[2,1]},{8:[1,24]},{7:30,8:y,9:25,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},e([8,10,28,32,37,39,40,45,57,58],[2,7],{15:38,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p}),e(A,[2,8]),e(A,[2,10]),e(A,[2,11]),e(A,[2,12]),e(A,[2,13]),e(A,[2,14]),e(A,[2,15]),e(A,[2,16]),e(A,[2,17]),e(A,[2,18]),e(A,[2,19]),e(A,[2,20]),{7:39,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},{7:30,8:y,9:40,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{10:[1,41]},{10:[2,21],28:[1,42]},e(w,[2,23]),e(w,[2,24]),e(w,[2,25]),e(x,E,{44:44,32:[1,43],45:k}),e(w,[2,27],{41:46,43:47,57:D,58:C}),e(w,[2,47],{43:47,34:50,41:51,37:F,57:D,58:C}),{34:53,37:F},{34:54,37:F},{34:55,37:F},{7:56,8:[1,57],14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},{7:30,8:y,9:58,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},e(A,[2,9]),{8:[1,59]},{10:[1,60]},{5:[2,4]},{7:30,8:y,9:61,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{7:62,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},e(x,[2,48]),e(x,T,{14:10,15:11,7:63,46:64,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,48:S,49:B,50:L,51:O,52:I,53:N,54:M,55:P,56:R}),e(w,[2,41],{34:74,37:F}),{7:77,8:y,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,33:76,42:75,47:_},e(q,[2,66]),e(q,[2,67]),e(w,[2,46]),e(w,[2,40],{34:78,37:F}),{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,38:79,39:[1,80]},e(w,[2,28]),e(w,[2,29]),e(w,[2,30]),{8:[1,82]},{7:30,8:y,9:83,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{10:[1,84]},{7:30,8:y,9:85,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{5:[2,2]},{10:[2,22]},e(w,[2,26]),e(x,[2,51],{45:[1,86]}),e(x,[2,52]),e(x,[2,56]),e(x,[2,57]),e(x,[2,58]),e(x,[2,59]),e(x,[2,60]),e(x,[2,61]),e(x,[2,62]),e(x,[2,63]),e(x,[2,64]),e(w,[2,38]),e(j,[2,44],{43:47,41:87,57:D,58:C}),e(j,[2,45],{43:47,41:88,57:D,58:C}),e(x,E,{44:44,45:k}),e(w,[2,39]),{39:[1,89]},e(w,[2,34],{34:90,37:F}),{32:[1,91]},{7:30,8:y,9:92,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{10:[1,93]},e(x,[2,55]),{10:[1,94]},e(x,T,{46:95,48:S,49:B,50:L,51:O,52:I,53:N,54:M,55:P,56:R}),e(j,[2,42]),e(j,[2,43]),e(w,[2,33],{34:96,37:F}),e(w,[2,32]),{7:97,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},{10:[1,98]},e(x,[2,54]),{5:[2,3]},e(x,[2,50]),e(w,[2,31]),{28:[1,99],39:[2,37],40:[1,100]},e(x,[2,53]),{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,38:101},{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,38:102},{39:[2,35]},{39:[2,36]}],defaultActions:{7:[2,1],41:[2,4],60:[2,2],61:[2,22],94:[2,3],101:[2,35],102:[2,36]},parseError:function(t,e){if(!e.recoverable){var r=function(t,e){this.message=t,this.hash=e};throw r.prototype=new Error,new r(t,e)}this.trace(t)},parse:function(t){var e=this,r=[0],n=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,A,w,x,E,k,D,C=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},F={};;){if(_=r[r.length-1],this.defaultActions[_]?A=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),A=a[_]&&a[_][v]),"undefined"==typeof A||!A.length||!A[0]){var T="";D=[];for(x in a[_])this.terminals_[x]&&x>l&&D.push("'"+this.terminals_[x]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(A[0]){case 1:r.push(v),n.push(f.yytext),i.push(f.yylloc),r.push(A[1]),v=null,b?(v=b,b=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[A[1]][1],F.$=n[n.length-E],F._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(F,[s,u,o,p.yy,A[1],n,i].concat(d)),"undefined"!=typeof w)return w;E&&(r=r.slice(0,-1*E*2),n=n.slice(0,-1*E),i=i.slice(0,-1*E)),r.push(this.productions_[A[1]][0]),n.push(F.$),i.push(F._$),k=a[r[r.length-2]][r[r.length-1]],r.push(k);break;case 3:return!0}}return!0}},Y=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),n=t[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(t=this.test_match(r,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[n]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,r,n){switch(r){case 0:return"STYLE";case 1:return"LINKSTYLE";case 2:return"CLASSDEF";case 3:return"CLASS";case 4:return"CLICK";case 5:return 12;case 6:return 13;case 7:return 47;case 8:return 35;case 9:return 36;case 10:return"DIR";case 11:return"DIR";case 12:return"DIR";case 13:return"DIR";case 14:return"DIR";case 15:return"DIR";case 16:return 17;case 17:return 23;case 18:return 18;case 19:return 28;case 20:return 40;case 21:return 32;case 22:return 21;case 23:return 22;case 24:return"ARROW_CROSS";case 25:return 57;case 26:return"ARROW_CIRCLE";case 27:return 58;case 28:return 25;case 29:return 19;case 30:return 20;case 31:return 16;case 32:return"PIPE";case 33:return"PS";case 34:return"PE";case 35:return 37;case 36:return 39;case 37:return 8;case 38:return 10;case 39:return"QUOTE";case 40:return 24;case 41:return"NEWLINE";case 42:return 5}},rules:[/^(?:style\b)/,/^(?:linkStyle\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:digraph\b)/,/^(?:subgraph\b)/,/^(?:node\b)/,/^(?:edge\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:--[x])/,/^(?:->)/,/^(?:--[o])/,/^(?:--)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u0061-\u007A\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)/,/^(?:\n)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],inclusive:!0}}};return t}();return U.lexer=Y,t.prototype=U,U.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),n.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&r.main(n.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],118:[function(t,e,r){(function(n){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r},r=[1,4],n=[1,3],i=[1,5],a=[1,8,9,10,11,13,18,30,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],s=[2,2],o=[1,12],u=[1,13],c=[1,14],l=[1,15],h=[1,31],d=[1,33],f=[1,22],p=[1,34],g=[1,24],y=[1,25],m=[1,26],v=[1,27],b=[1,28],_=[1,38],A=[1,40],w=[1,35],x=[1,39],E=[1,45],k=[1,44],D=[1,36],C=[1,37],F=[1,41],T=[1,42],S=[1,43],B=[1,8,9,10,11,13,18,30,32,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],L=[1,53],O=[1,52],I=[1,54],N=[1,72],M=[1,80],P=[1,81],R=[1,66],q=[1,65],j=[1,85],U=[1,84],Y=[1,82],G=[1,83],V=[1,73],$=[1,68],H=[1,67],W=[1,63],z=[1,75],Z=[1,76],X=[1,77],K=[1,78],J=[1,79],Q=[1,70],tt=[1,69],et=[8,9,11],rt=[8,9,11,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64],nt=[1,115],it=[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,85,87,88,90,91,93,94,95,96,97],at=[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,83,85,87,88,90,91,93,94,95,96,97],st=[1,117],ot=[1,118],ut=[8,9,10,11,13,18,30,32,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],ct=[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,83,85,87,88,90,91,93,94,95,96,97],lt=[13,18,46,81,85,87,88,90,91,93,94,95,96,97],ht=[13,18,46,49,65,81,85,87,88,90,91,93,94,95,96,97],dt=[1,191],ft=[1,188],pt=[1,195],gt=[1,192],yt=[1,189],mt=[1,196],vt=[1,186],bt=[1,187],_t=[1,190],At=[1,193],wt=[1,194],xt=[1,211],Et=[8,9,11,85],kt=[8,9,10,11,46,71,80,81,83,85,87,88,89,90,91],Dt={trace:function(){},yy:{},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,commentStatement:82,PCT:83,style:84,COMMA:85,styleComponent:86,ALPHA:87,COLON:88,UNIT:89,BRKT:90,DOT:91,graphCodeTokens:92,PUNCTUATION:93,UNICODE_TEXT:94,PLUS:95,EQUALS:96,MULT:97,TAG_START:98,TAG_END:99,QUOTE:100,$accept:0,$end:1},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",83:"PCT",85:"COMMA",87:"ALPHA",88:"COLON",89:"UNIT",90:"BRKT",91:"DOT",93:"PUNCTUATION",94:"UNICODE_TEXT",95:"PLUS",96:"EQUALS",97:"MULT",98:"TAG_START",99:"TAG_END",100:"QUOTE"},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],[82,3],[79,1],[79,3],[84,1],[84,2],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,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],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1]],performAction:function(t,e,r,n,i,a){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:a[s]!==[]&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 57:case 59:case 60:case 92:case 94:case 95:case 108:this.$=a[s];break;case 11:n.setDirection(a[s-1]),this.$=a[s-1];break;case 12:n.setDirection("LR"),this.$=a[s-1];break;case 13:n.setDirection("RL"),this.$=a[s-1];break;case 14:n.setDirection("BT"),this.$=a[s-1];break;case 15:n.setDirection("TB"),this.$=a[s-1];break;case 30:this.$=a[s-1];break;case 31:case 32:case 33:case 34:case 35:this.$=[];break;case 36:this.$=n.addSubGraph(a[s-1],a[s-3]);break;case 37:this.$=n.addSubGraph(a[s-1],void 0);break;case 41:n.addLink(a[s-2],a[s],a[s-1]),this.$=[a[s-2],a[s]];break;case 42:this.$=[a[s]];break;case 43:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"square");break;case 44:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"square");break;case 45:this.$=a[s-5],n.addVertex(a[s-5],a[s-2],"circle");break;case 46:this.$=a[s-6],n.addVertex(a[s-6],a[s-3],"circle");break;case 47:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"ellipse");break;case 48:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"ellipse");break;case 49:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"round");break;case 50:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"round");break;case 51:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"diamond");break;case 52:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"diamond");break;case 53:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"odd");break;case 54:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"odd");break;case 55:this.$=a[s],n.addVertex(a[s]);break;case 56:this.$=a[s-1],n.addVertex(a[s-1]);break;case 58:case 93:case 96:case 109:this.$=a[s-1]+""+a[s];break;case 61:this.$="v";break;case 62:this.$="-";break;case 63:a[s-1].text=a[s],this.$=a[s-1];break;case 64:case 65:a[s-2].text=a[s-1],this.$=a[s-2];break;case 66:this.$=a[s];break;case 67:this.$={type:"arrow",stroke:"normal",text:a[s-1]};break;case 68:this.$={type:"arrow_circle",stroke:"normal",text:a[s-1]};break;case 69:this.$={type:"arrow_cross",stroke:"normal",text:a[s-1]};break;case 70:this.$={type:"arrow_open",stroke:"normal",text:a[s-1]};break;case 71:this.$={type:"arrow",stroke:"dotted",text:a[s-1]};break;case 72:this.$={type:"arrow_circle",stroke:"dotted",text:a[s-1]};break;case 73:this.$={type:"arrow_cross",stroke:"dotted",text:a[s-1]};break;case 74:this.$={type:"arrow_open",stroke:"dotted",text:a[s-1]};break;case 75:this.$={type:"arrow",stroke:"thick",text:a[s-1]};break;case 76:this.$={type:"arrow_circle",stroke:"thick",text:a[s-1]};break;case 77:this.$={type:"arrow_cross",stroke:"thick",text:a[s-1]};break;case 78:this.$={type:"arrow_open",stroke:"thick",text:a[s-1]};break;case 79:this.$={type:"arrow",stroke:"normal"};break;case 80:this.$={type:"arrow_circle",stroke:"normal"};break;case 81:this.$={type:"arrow_cross",stroke:"normal"};break;case 82:this.$={type:"arrow_open",stroke:"normal"};break;case 83:this.$={type:"arrow",stroke:"dotted"};break;case 84:this.$={type:"arrow_circle",stroke:"dotted"};break;case 85:this.$={type:"arrow_cross",stroke:"dotted"};break;case 86:this.$={type:"arrow_open",stroke:"dotted"};break;case 87:this.$={type:"arrow",stroke:"thick"};break;case 88:this.$={type:"arrow_circle",stroke:"thick"};break;case 89:this.$={type:"arrow_cross",stroke:"thick"};break;case 90:this.$={type:"arrow_open",stroke:"thick"};break;case 91:this.$=a[s-1];break;case 110:case 111:this.$=a[s-4],n.addClass(a[s-2],a[s]);break;case 112:this.$=a[s-4],n.setClass(a[s-2],a[s]);break;case 113:this.$=a[s-4],n.setClickEvent(a[s-2],a[s],void 0,void 0);break;case 114:this.$=a[s-6],n.setClickEvent(a[s-4],a[s-2],void 0,a[s]);break;case 115:this.$=a[s-4],n.setClickEvent(a[s-2],void 0,a[s],void 0);break;case 116:this.$=a[s-6],n.setClickEvent(a[s-4],void 0,a[s-2],a[s]);break;case 117:this.$=a[s-4],n.addVertex(a[s-2],void 0,void 0,a[s]);break;case 118:case 119:case 120:this.$=a[s-4],n.updateLink(a[s-2],a[s]);break;case 122:this.$=[a[s]];break;case 123:a[s-2].push(a[s]),this.$=a[s-2];break;case 125:this.$=a[s-1]+a[s]}},table:[{3:1,4:2,9:r,10:n,12:i},{1:[3]},e(a,s,{5:6}),{4:7,9:r,10:n,12:i},{4:8,9:r, -10:n,12:i},{10:[1,9]},{1:[2,1],6:10,7:11,8:o,9:u,10:c,11:l,13:h,18:d,23:16,25:17,26:18,27:19,28:20,29:21,30:f,33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:b,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(a,[2,9]),e(a,[2,10]),{13:[1,46],15:[1,47],16:[1,48],17:[1,49],18:[1,50]},e(B,[2,3]),e(B,[2,4]),e(B,[2,5]),e(B,[2,6]),e(B,[2,7]),e(B,[2,8]),{8:L,9:O,11:I,24:51},{8:L,9:O,11:I,24:55},{8:L,9:O,11:I,24:56},{8:L,9:O,11:I,24:57},{8:L,9:O,11:I,24:58},{8:L,9:O,11:I,24:59},{8:L,9:O,10:N,11:I,12:M,13:P,15:R,16:q,17:j,18:U,24:61,30:Y,31:60,32:G,45:71,46:V,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(et,[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]},e(rt,[2,55],{45:32,21:113,44:114,10:nt,13:h,15:[1,112],18:d,36:[1,108],38:[1,109],40:[1,110],42:[1,111],46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S}),e(it,[2,57]),e(it,[2,59]),e(it,[2,60]),e(it,[2,61]),e(it,[2,62]),e(at,[2,150]),e(at,[2,151]),e(at,[2,152]),e(at,[2,153]),e(at,[2,154]),e(at,[2,155]),e(at,[2,156]),e(at,[2,157]),e(at,[2,158]),e(at,[2,159]),e(at,[2,160]),{8:st,9:ot,10:nt,14:116,21:119},{8:st,9:ot,10:nt,14:120,21:119},{8:st,9:ot,10:nt,14:121,21:119},{8:st,9:ot,10:nt,14:122,21:119},{8:st,9:ot,10:nt,14:123,21:119},e(B,[2,30]),e(B,[2,38]),e(B,[2,39]),e(B,[2,40]),e(B,[2,31]),e(B,[2,32]),e(B,[2,33]),e(B,[2,34]),e(B,[2,35]),{8:L,9:O,10:N,11:I,12:M,13:P,15:R,16:q,17:j,18:U,24:124,30:Y,32:G,45:71,46:V,50:$,60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(ut,s,{5:126}),e(ct,[2,92]),e(ct,[2,94]),e(ct,[2,139]),e(ct,[2,140]),e(ct,[2,141]),e(ct,[2,142]),e(ct,[2,143]),e(ct,[2,144]),e(ct,[2,145]),e(ct,[2,146]),e(ct,[2,147]),e(ct,[2,148]),e(ct,[2,149]),e(ct,[2,97]),e(ct,[2,98]),e(ct,[2,99]),e(ct,[2,100]),e(ct,[2,101]),e(ct,[2,102]),e(ct,[2,103]),e(ct,[2,104]),e(ct,[2,105]),e(ct,[2,106]),e(ct,[2,107]),{13:h,18:d,33:127,35:29,44:30,45:32,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(lt,[2,66],{48:128,49:[1,129],65:[1,130]}),{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,31:131,32:G,45:71,46:V,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,31:132,32:G,45:71,46:V,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,31:133,32:G,45:71,46:V,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(ht,[2,79]),e(ht,[2,80]),e(ht,[2,81]),e(ht,[2,82]),e(ht,[2,83]),e(ht,[2,84]),e(ht,[2,85]),e(ht,[2,86]),e(ht,[2,87]),e(ht,[2,88]),e(ht,[2,89]),e(ht,[2,90]),{13:h,18:d,35:134,44:30,45:32,46:p,80:[1,135],81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{78:[1,136],81:[1,137]},{13:h,18:d,35:139,44:30,45:32,46:p,78:[1,138],81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{13:h,18:d,35:140,44:30,45:32,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{13:h,18:d,35:141,44:30,45:32,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,31:142,32:G,45:71,46:V,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,31:144,32:G,38:[1,143],45:71,46:V,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,31:145,32:G,45:71,46:V,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,31:146,32:G,45:71,46:V,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,31:147,32:G,45:71,46:V,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(rt,[2,56]),e(it,[2,58]),e(rt,[2,29],{21:148,10:nt}),e(a,[2,11]),e(a,[2,21]),e(a,[2,22]),{9:[1,149]},e(a,[2,12]),e(a,[2,13]),e(a,[2,14]),e(a,[2,15]),e(ut,s,{5:150}),e(ct,[2,93]),{6:10,7:11,8:o,9:u,10:c,11:l,13:h,18:d,23:16,25:17,26:18,27:19,28:20,29:21,30:f,32:[1,151],33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:b,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(et,[2,41]),e(lt,[2,63],{10:[1,152]}),{10:[1,153]},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,31:154,32:G,45:71,46:V,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,32:G,45:71,46:V,50:$,51:[1,155],52:[1,156],53:[1,157],54:[1,158],60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,32:G,45:71,46:V,50:$,56:[1,159],57:[1,160],58:[1,161],59:[1,162],60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,32:G,45:71,46:V,50:$,60:H,61:[1,163],62:[1,164],63:[1,165],64:[1,166],66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:[1,167],13:h,18:d,44:114,45:32,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:[1,168]},{10:[1,169]},{10:[1,170]},{10:[1,171]},{10:[1,172],13:h,18:d,44:114,45:32,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:[1,173],13:h,18:d,44:114,45:32,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:[1,174],13:h,18:d,44:114,45:32,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,32:G,37:[1,175],45:71,46:V,50:$,60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,31:176,32:G,45:71,46:V,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,32:G,39:[1,177],45:71,46:V,50:$,60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,32:G,41:[1,178],45:71,46:V,50:$,60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,32:G,43:[1,179],45:71,46:V,50:$,60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,32:G,37:[1,180],45:71,46:V,50:$,60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(rt,[2,28]),e(a,[2,23]),{6:10,7:11,8:o,9:u,10:c,11:l,13:h,18:d,23:16,25:17,26:18,27:19,28:20,29:21,30:f,32:[1,181],33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:b,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(B,[2,37]),e(lt,[2,65]),e(lt,[2,64]),{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,32:G,45:71,46:V,50:$,60:H,65:[1,182],66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(lt,[2,67]),e(lt,[2,68]),e(lt,[2,69]),e(lt,[2,70]),e(lt,[2,71]),e(lt,[2,72]),e(lt,[2,73]),e(lt,[2,74]),e(lt,[2,75]),e(lt,[2,76]),e(lt,[2,77]),e(lt,[2,78]),{10:dt,46:ft,71:pt,79:183,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:bt,89:_t,90:At,91:wt},{10:dt,46:ft,71:pt,79:197,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:bt,89:_t,90:At,91:wt},{10:dt,46:ft,71:pt,79:198,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:bt,89:_t,90:At,91:wt},{10:dt,46:ft,71:pt,79:199,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:bt,89:_t,90:At,91:wt},{10:dt,46:ft,71:pt,79:200,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:bt,89:_t,90:At,91:wt},{10:dt,46:ft,71:pt,79:201,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:bt,89:_t,90:At,91:wt},{13:h,18:d,35:202,44:30,45:32,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{13:h,18:d,35:203,44:30,45:32,46:p,67:[1,204],81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(rt,[2,43],{21:205,10:nt}),{10:N,12:M,13:P,15:R,16:q,17:j,18:U,30:Y,32:G,39:[1,206],45:71,46:V,50:$,60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(rt,[2,49],{21:207,10:nt}),e(rt,[2,47],{21:208,10:nt}),e(rt,[2,51],{21:209,10:nt}),e(rt,[2,53],{21:210,10:nt}),e(B,[2,36]),e([10,13,18,46,81,85,87,88,90,91,93,94,95,96,97],[2,91]),e(et,[2,117],{85:xt}),e(Et,[2,122],{86:212,10:dt,46:ft,71:pt,80:gt,81:yt,83:mt,87:vt,88:bt,89:_t,90:At,91:wt}),e(kt,[2,124]),e(kt,[2,126]),e(kt,[2,127]),e(kt,[2,128]),e(kt,[2,129]),e(kt,[2,130]),e(kt,[2,131]),e(kt,[2,132]),e(kt,[2,133]),e(kt,[2,134]),e(kt,[2,135]),e(kt,[2,136]),e(et,[2,118],{85:xt}),e(et,[2,119],{85:xt}),e(et,[2,120],{85:xt}),e(et,[2,110],{85:xt}),e(et,[2,111],{85:xt}),e(et,[2,112],{45:32,44:114,13:h,18:d,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S}),e(et,[2,113],{45:32,44:114,10:[1,213],13:h,18:d,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S}),e(et,[2,115],{10:[1,214]}),e(rt,[2,44]),{39:[1,215]},e(rt,[2,50]),e(rt,[2,48]),e(rt,[2,52]),e(rt,[2,54]),{10:dt,46:ft,71:pt,80:gt,81:yt,83:mt,84:216,86:185,87:vt,88:bt,89:_t,90:At,91:wt},e(kt,[2,125]),{67:[1,217]},{67:[1,218]},e(rt,[2,45],{21:219,10:nt}),e(Et,[2,123],{86:212,10:dt,46:ft,71:pt,80:gt,81:yt,83:mt,87:vt,88:bt,89:_t,90:At,91:wt}),e(et,[2,114]),e(et,[2,116]),e(rt,[2,46])],defaultActions:{},parseError:function(t,e){if(!e.recoverable){var r=function(t,e){this.message=t,this.hash=e};throw r.prototype=new Error,new r(t,e)}this.trace(t)},parse:function(t){var e=this,r=[0],n=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,A,w,x,E,k,D,C=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},F={};;){if(_=r[r.length-1],this.defaultActions[_]?A=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),A=a[_]&&a[_][v]),"undefined"==typeof A||!A.length||!A[0]){var T="";D=[];for(x in a[_])this.terminals_[x]&&x>l&&D.push("'"+this.terminals_[x]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(A[0]){case 1:r.push(v),n.push(f.yytext),i.push(f.yylloc),r.push(A[1]),v=null,b?(v=b,b=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[A[1]][1],F.$=n[n.length-E],F._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(F,[s,u,o,p.yy,A[1],n,i].concat(d)),"undefined"!=typeof w)return w;E&&(r=r.slice(0,-1*E*2),n=n.slice(0,-1*E),i=i.slice(0,-1*E)),r.push(this.productions_[A[1]][0]),n.push(F.$),i.push(F._$),k=a[r[r.length-2]][r[r.length-1]],r.push(k);break;case 3:return!0}}return!0}},Ct=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),n=t[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(t=this.test_match(r,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[n]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,r,n){switch(r){case 0:break;case 1:this.begin("string");break;case 2:this.popState();break;case 3:return"STR";case 4:return 71;case 5:return 78;case 6:return 72;case 7:return 73;case 8:return 74;case 9:return 75;case 10:return 12;case 11:return 30;case 12:return 32;case 13:return 13;case 14:return 13;case 15:return 13;case 16:return 13;case 17:return 13;case 18:return 13;case 19:return 81;case 20:return 90;case 21:return 88;case 22:return 8;case 23:return 85;case 24:return 97;case 25:return 16;case 26:return 15;case 27:return 17;case 28:return 18;case 29:return 53;case 30:return 51;case 31:return 52;case 32:return 54;case 33:return 58;case 34:return 56;case 35:return 57;case 36:return 59;case 37:return 58;case 38:return 56;case 39:return 57;case 40:return 59;case 41:return 63;case 42:return 61;case 43:return 62;case 44:return 64;case 45:return 50;case 46:return 55;case 47:return 60;case 48:return 40;case 49:return 41;case 50:return 46;case 51:return 91;case 52:return 95;case 53:return 83;case 54:return 96;case 55:return 96;case 56:return 87;case 57:return 93;case 58:return 94;case 59:return 65;case 60:return 38;case 61:return 39;case 62:return 36;case 63:return 37;case 64:return 42;case 65:return 43;case 66:return 100;case 67:return 9;case 68:return 10;case 69:return 11}},rules:[/^(?:%%[^\n]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\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)/,/^(?:$)/],conditions:{string:{rules:[2,3],inclusive:!1},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],inclusive:!0}}};return t}();return Dt.lexer=Ct,t.prototype=Dt,Dt.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),n.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&r.main(n.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],119:[function(t,e,r){(function(e){"use strict";var n=t("moment"),i=t("../../logger"),a=new i.Log,s="",o="",u=[],c=[],l="";r.clear=function(){u=[],c=[],l="",o="",g=0,h=void 0,d=void 0,b=[]},r.setDateFormat=function(t){s=t},r.getDateFormat=function(){return s},r.setTitle=function(t){o=t},r.getTitle=function(){return o},r.addSection=function(t){l=t,u.push(t)},r.getTasks=function(){for(var t=A(),e=10,r=0;!t&&e>r;)t=A(),r++;return c=b};var h,d,f=function(t,e,i){i=i.trim();var s=/^after\s+([\d\w\-]+)/,o=s.exec(i.trim());if(null!==o){var u=r.findTaskById(o[1]);if("undefined"==typeof u){var c=new Date;return c.setHours(0,0,0,0),c}return u.endTime}return n(i,e.trim(),!0).isValid()?n(i,e.trim(),!0).toDate():(a.debug("Invalid date:"+i),a.debug("With date format:"+e.trim()),new Date)},p=function(t,e,r){if(r=r.trim(),n(r,e.trim(),!0).isValid())return n(r,e.trim()).toDate();var i=n(t),a=/^([\d]+)([wdhms])/,s=a.exec(r.trim());if(null!==s){switch(s[2]){case"s":i.add(s[1],"seconds");break;case"m":i.add(s[1],"minutes");break;case"h":i.add(s[1],"hours");break;case"d":i.add(s[1],"days");break;case"w":i.add(s[1],"weeks")}return i.toDate()}return i.toDate()},g=0,y=function(t){return"undefined"==typeof t?(g+=1,"task"+g):t},m=function(t,e){var n;n=":"===e.substr(0,1)?e.substr(1,e.length):e;for(var i=n.split(","),a={},s=r.getDateFormat(),o=!0;o;)o=!1,i[0].match(/^\s*active\s*$/)&&(a.active=!0,i.shift(1),o=!0),i[0].match(/^\s*done\s*$/)&&(a.done=!0,i.shift(1),o=!0),i[0].match(/^\s*crit\s*$/)&&(a.crit=!0,i.shift(1),o=!0);var u;for(u=0;ur-e?r+i+1.5*s.sidePadding>o?e+n-5:r+n+5:(r-e)/2+e+n}).attr("y",function(t,n){return n*e+s.barHeight/2+(s.fontSize/2-2)+r}).attr("text-height",i).attr("class",function(t){for(var e=w(t.startTime),r=w(t.endTime),n=this.getBBox().width,i=0,a=0;ar-e?r+n+1.5*s.sidePadding>o?"taskTextOutsideLeft taskTextOutside"+i+" "+u:"taskTextOutsideRight taskTextOutside"+i+" "+u:"taskText taskText"+i+" "+u})}function l(t,e,r,a){var o,u=[[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["h1 %I:%M",function(t){return t.getMinutes()}]],c=[["%Y",function(){return!0}]],l=[["%I:%M",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}]];"undefined"!=typeof s.axisFormatter&&(l=[],s.axisFormatter.forEach(function(t){var e=[];e[0]=t[0],e[1]=t[1],l.push(e)})),o=u.concat(l).concat(c);var h=i.svg.axis().scale(w).orient("bottom").tickSize(-a+e+s.gridLineStartPadding,0,0).tickFormat(i.time.format.multi(o));n>7&&230>n&&(h=h.ticks(i.time.monday.range)),b.append("g").attr("class","grid").attr("transform","translate("+t+", "+(a-50)+")").call(h).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em")}function h(t,e){for(var r=[],n=0,i=0;i0))return i[1]*t/2+e;for(var s=0;a>s;s++)return n+=r[a-1][1],i[1]*t/2+n*t+e}).attr("class",function(t){for(var e=0;en;++n)e.hasOwnProperty(t[n])||(e[t[n]]=!0, -r.push(t[n]));return r}function p(t){for(var e=t.length,r={};e;)r[t[--e]]=(r[t[e]]||0)+1;return r}function g(t,e){return p(e)[t]||0}r.yy.clear(),r.parse(t);var y=document.getElementById(e);o=y.parentElement.offsetWidth,"undefined"==typeof o&&(o=1200),"undefined"!=typeof s.useWidth&&(o=s.useWidth);var m=r.yy.getTasks(),v=m.length*(s.barHeight+s.barGap)+2*s.topPadding;y.setAttribute("height","100%"),y.setAttribute("viewBox","0 0 "+o+" "+v);var b=i.select("#"+e),_=i.min(m,function(t){return t.startTime}),A=i.max(m,function(t){return t.endTime}),w=i.time.scale().domain([i.min(m,function(t){return t.startTime}),i.max(m,function(t){return t.endTime})]).rangeRound([0,o-150]),x=[];n=a.duration(A-_).asDays();for(var E=0;El&&D.push("'"+this.terminals_[x]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(A[0]){case 1:r.push(v),n.push(f.yytext),i.push(f.yylloc),r.push(A[1]),v=null,b?(v=b,b=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[A[1]][1],F.$=n[n.length-E],F._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(F,[s,u,o,p.yy,A[1],n,i].concat(d)),"undefined"!=typeof w)return w;E&&(r=r.slice(0,-1*E*2),n=n.slice(0,-1*E),i=i.slice(0,-1*E)),r.push(this.productions_[A[1]][0]),n.push(F.$),i.push(F._$),k=a[r[r.length-2]][r[r.length-1]],r.push(k);break;case 3:return!0}}return!0}},u=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),n=t[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(t=this.test_match(r,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[n]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,r,n){switch(r){case 0:return 10;case 1:break;case 2:break;case 3:break;case 4:return 4;case 5:return 11;case 6:return"date";case 7:return 12;case 8:return 13;case 9:return 14;case 10:return 15;case 11:return":";case 12:return 6;case 13:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\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],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return t}();return o.lexer=u,t.prototype=o,o.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),n.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&r.main(n.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],122:[function(t,e,r){(function(n){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r},r=[2,2],n=[1,5],i=[1,7],a=[1,8],s=[1,11],o=[1,12],u=[1,13],c=[1,14],l=[1,16],h=[1,17],d=[1,7,9,10,16,18,19,20,21,22,23,33],f=[7,9,10,16,18,19,20,21,23,33],p=[1,53],g={trace:function(){},yy:{},symbols_:{error:2,start:3,SD:4,document:5,line:6,SPACE:7,statement:8,NL:9,participant:10,actor:11,AS:12,restOfLine:13,signal:14,note_statement:15,title:16,text:17,loop:18,end:19,opt:20,alt:21,"else":22,note:23,placement:24,text2:25,over:26,actor_pair:27,spaceList:28,",":29,left_of:30,right_of:31,signaltype:32,ACTOR:33,SOLID_OPEN_ARROW:34,DOTTED_OPEN_ARROW:35,SOLID_ARROW:36,DOTTED_ARROW:37,SOLID_CROSS:38,DOTTED_CROSS:39,TXT:40,$accept:0,$end:1},terminals_:{2:"error",4:"SD",7:"SPACE",9:"NL",10:"participant",12:"AS",13:"restOfLine",16:"title",17:"text",18:"loop",19:"end",20:"opt",21:"alt",22:"else",23:"note",26:"over",29:",",30:"left_of",31:"right_of",33:"ACTOR",34:"SOLID_OPEN_ARROW",35:"DOTTED_OPEN_ARROW",36:"SOLID_ARROW",37:"DOTTED_ARROW",38:"SOLID_CROSS",39:"DOTTED_CROSS",40:"TXT"},productions_:[0,[3,2],[5,0],[5,2],[6,2],[6,1],[6,1],[8,5],[8,3],[8,2],[8,2],[8,4],[8,4],[8,4],[8,7],[15,4],[15,4],[28,2],[28,1],[27,3],[27,1],[24,1],[24,1],[14,4],[11,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[25,1]],performAction:function(t,e,r,n,i,a){var s=a.length-1;switch(i){case 1:return n.apply(a[s]),a[s];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:this.$=[];break;case 7:a[s-3].description=a[s-1],this.$=a[s-3];break;case 8:this.$=a[s-1];break;case 12:a[s-1].unshift({type:"loopStart",loopText:a[s-2],signalType:n.LINETYPE.LOOP_START}),a[s-1].push({type:"loopEnd",loopText:a[s-2],signalType:n.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 13:a[s-1].unshift({type:"optStart",optText:a[s-2],signalType:n.LINETYPE.OPT_START}),a[s-1].push({type:"optEnd",optText:a[s-2],signalType:n.LINETYPE.OPT_END}),this.$=a[s-1];break;case 14:a[s-4].unshift({type:"altStart",altText:a[s-5],signalType:n.LINETYPE.ALT_START}),a[s-4].push({type:"else",altText:a[s-2],signalType:n.LINETYPE.ALT_ELSE}),a[s-4]=a[s-4].concat(a[s-1]),a[s-4].push({type:"altEnd",signalType:n.LINETYPE.ALT_END}),this.$=a[s-4];break;case 15:this.$=[a[s-1],{type:"addNote",placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 16:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:"addNote",placement:n.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 19:this.$=[a[s-2],a[s]];break;case 20:this.$=a[s];break;case 21:this.$=n.PLACEMENT.LEFTOF;break;case 22:this.$=n.PLACEMENT.RIGHTOF;break;case 23:this.$=[a[s-3],a[s-1],{type:"addMessage",from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 24:this.$={type:"addActor",actor:a[s]};break;case 25:this.$=n.LINETYPE.SOLID_OPEN;break;case 26:this.$=n.LINETYPE.DOTTED_OPEN;break;case 27:this.$=n.LINETYPE.SOLID;break;case 28:this.$=n.LINETYPE.DOTTED;break;case 29:this.$=n.LINETYPE.SOLID_CROSS;break;case 30:this.$=n.LINETYPE.DOTTED_CROSS;break;case 31:this.$=a[s].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},e([1,7,9,10,16,18,20,21,23,33],r,{5:3}),{1:[2,1],6:4,7:n,8:6,9:i,10:a,11:15,14:9,15:10,16:s,18:o,20:u,21:c,23:l,33:h},e(d,[2,3]),{8:18,10:a,11:15,14:9,15:10,16:s,18:o,20:u,21:c,23:l,33:h},e(d,[2,5]),e(d,[2,6]),{11:19,33:h},{9:[1,20]},{9:[1,21]},{7:[1,22]},{13:[1,23]},{13:[1,24]},{13:[1,25]},{32:26,34:[1,27],35:[1,28],36:[1,29],37:[1,30],38:[1,31],39:[1,32]},{24:33,26:[1,34],30:[1,35],31:[1,36]},e([9,12,29,34,35,36,37,38,39,40],[2,24]),e(d,[2,4]),{9:[1,38],12:[1,37]},e(d,[2,9]),e(d,[2,10]),{17:[1,39]},e(f,r,{5:40}),e(f,r,{5:41}),e([7,9,10,16,18,20,21,22,23,33],r,{5:42}),{11:43,33:h},{33:[2,25]},{33:[2,26]},{33:[2,27]},{33:[2,28]},{33:[2,29]},{33:[2,30]},{11:44,33:h},{11:46,27:45,33:h},{33:[2,21]},{33:[2,22]},{13:[1,47]},e(d,[2,8]),{9:[1,48]},{6:4,7:n,8:6,9:i,10:a,11:15,14:9,15:10,16:s,18:o,19:[1,49],20:u,21:c,23:l,33:h},{6:4,7:n,8:6,9:i,10:a,11:15,14:9,15:10,16:s,18:o,19:[1,50],20:u,21:c,23:l,33:h},{6:4,7:n,8:6,9:i,10:a,11:15,14:9,15:10,16:s,18:o,20:u,21:c,22:[1,51],23:l,33:h},{25:52,40:p},{25:54,40:p},{25:55,40:p},{29:[1,56],40:[2,20]},{9:[1,57]},e(d,[2,11]),e(d,[2,12]),e(d,[2,13]),{13:[1,58]},{9:[2,23]},{9:[2,31]},{9:[2,15]},{9:[2,16]},{11:59,33:h},e(d,[2,7]),e(f,r,{5:60}),{40:[2,19]},{6:4,7:n,8:6,9:i,10:a,11:15,14:9,15:10,16:s,18:o,19:[1,61],20:u,21:c,23:l,33:h},e(d,[2,14])],defaultActions:{27:[2,25],28:[2,26],29:[2,27],30:[2,28],31:[2,29],32:[2,30],35:[2,21],36:[2,22],52:[2,23],53:[2,31],54:[2,15],55:[2,16],59:[2,19]},parseError:function(t,e){if(!e.recoverable){var r=function(t,e){this.message=t,this.hash=e};throw r.prototype=new Error,new r(t,e)}this.trace(t)},parse:function(t){var e=this,r=[0],n=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,A,w,x,E,k,D,C=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},F={};;){if(_=r[r.length-1],this.defaultActions[_]?A=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),A=a[_]&&a[_][v]),"undefined"==typeof A||!A.length||!A[0]){var T="";D=[];for(x in a[_])this.terminals_[x]&&x>l&&D.push("'"+this.terminals_[x]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(A[0]){case 1:r.push(v),n.push(f.yytext),i.push(f.yylloc),r.push(A[1]),v=null,b?(v=b,b=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[A[1]][1],F.$=n[n.length-E],F._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(F,[s,u,o,p.yy,A[1],n,i].concat(d)),"undefined"!=typeof w)return w;E&&(r=r.slice(0,-1*E*2),n=n.slice(0,-1*E),i=i.slice(0,-1*E)),r.push(this.productions_[A[1]][0]),n.push(F.$),i.push(F._$),k=a[r[r.length-2]][r[r.length-1]],r.push(k);break;case 3:return!0}}return!0}},y=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),n=t[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(t=this.test_match(r,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[n]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,r,n){switch(r){case 0:return 9;case 1:break;case 2:break;case 3:break;case 4:break;case 5:return this.begin("ID"),10;case 6:return this.begin("ALIAS"),33;case 7:return this.popState(),this.popState(),this.begin("LINE"),12;case 8:return this.popState(),this.popState(),9;case 9:return this.begin("LINE"),18;case 10:return this.begin("LINE"),20;case 11:return this.begin("LINE"),21;case 12:return this.begin("LINE"),22;case 13:return this.popState(),13;case 14:return 19;case 15:return 30;case 16:return 31;case 17:return 26;case 18:return 23;case 19:return 16;case 20:return 4;case 21:return 29;case 22:return 9;case 23:return 33;case 24:return 36;case 25:return 37;case 26:return 34;case 27:return 35;case 28:return 38;case 29:return 39;case 30:return 40;case 31:return 9;case 32:return"INVALID"}},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,/^(?:[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\->:\n,;]+)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[2,3,13],inclusive:!1},ALIAS:{rules:[2,3,7,8],inclusive:!1},ID:{rules:[2,3,6],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],inclusive:!0}}};return t}();return g.lexer=y,t.prototype=g,g.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),n.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&r.main(n.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],123:[function(t,e,r){(function(e){"use strict";var n={},i=[],a=[],s=t("../../logger"),o=new s.Log;r.addActor=function(t,e,r){var i=n[t];i&&e===i.name&&null==r||(null==r&&(r=e),n[t]={name:e,description:r})},r.addMessage=function(t,e,r,n){i.push({from:t,to:e,message:r,answer:n})},r.addSignal=function(t,e,r,n){o.debug("Adding message from="+t+" to="+e+" message="+r+" type="+n),i.push({from:t,to:e,message:r,type:n})},r.getMessages=function(){return i},r.getActors=function(){return n},r.getActor=function(t){return n[t]},r.getActorKeys=function(){return Object.keys(n)},r.clear=function(){n={},i=[]},r.LINETYPE={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16},r.ARROWTYPE={FILLED:0,OPEN:1},r.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2},r.addNote=function(t,e,n){var s={actor:t,placement:e,message:n},o=[].concat(t,t);a.push(s),i.push({from:o[0],to:o[1],message:n,type:r.LINETYPE.NOTE,placement:e})},r.parseError=function(t,r){e.mermaidAPI.parseError(t,r)},r.apply=function(t){if(t instanceof Array)t.forEach(function(t){r.apply(t)});else switch(t.type){case"addActor":r.addActor(t.actor,t.actor,t.description);break;case"addNote":r.addNote(t.actor,t.placement,t.text);break;case"addMessage":r.addSignal(t.from,t.to,t.msg,t.signalType);break;case"loopStart":r.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":r.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":r.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":r.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":r.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":r.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":r.addSignal(void 0,void 0,void 0,t.signalType)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../logger":126}],124:[function(t,e,r){"use strict";var n=t("./parser/sequenceDiagram").parser;n.yy=t("./sequenceDb");var i=t("./svgDraw"),a=t("../../d3"),s=t("../../logger"),o=new s.Log,u={diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!1,bottomMarginAdj:1};r.bounds={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,list:[],init:function(){this.list=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,r,n){t[e]="undefined"==typeof t[e]?r:n(r,t[e])},updateLoops:function(t,e,n,i){var a=this,s=0;this.list.forEach(function(o){s++;var c=a.list.length-s+1;a.updateVal(o,"startx",t-c*u.boxMargin,Math.min),a.updateVal(o,"starty",e-c*u.boxMargin,Math.min),a.updateVal(o,"stopx",n+c*u.boxMargin,Math.max),a.updateVal(o,"stopy",i+c*u.boxMargin,Math.max),a.updateVal(r.bounds.data,"startx",t-c*u.boxMargin,Math.min),a.updateVal(r.bounds.data,"starty",e-c*u.boxMargin,Math.min),a.updateVal(r.bounds.data,"stopx",n+c*u.boxMargin,Math.max),a.updateVal(r.bounds.data,"stopy",i+c*u.boxMargin,Math.max)})},insert:function(t,e,n,i){var a,s,o,u;a=Math.min(t,n),o=Math.max(t,n),s=Math.min(e,i),u=Math.max(e,i),this.updateVal(r.bounds.data,"startx",a,Math.min),this.updateVal(r.bounds.data,"starty",s,Math.min),this.updateVal(r.bounds.data,"stopx",o,Math.max),this.updateVal(r.bounds.data,"stopy",u,Math.max),this.updateLoops(a,s,o,u)},newLoop:function(t){this.list.push({startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t})},endLoop:function(){var t=this.list.pop();return t},addElseToLoop:function(t){var e=this.list.pop();e.elsey=r.bounds.getVerticalPos(),e.elseText=t,this.list.push(e)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}};var c=function(t,e,n,a,s){var o=i.getNoteRect();o.x=e,o.y=n,o.width=s||u.width,o["class"]="note";var c=t.append("g"),l=i.drawRect(c,o),h=i.getTextObj();h.x=e-4,h.y=n-13,h.textMargin=u.noteMargin,h.dy="1em",h.text=a.message,h["class"]="noteText";var d=i.drawText(c,h,o.width-u.noteMargin),f=d[0][0].getBBox().height;!s&&f>u.width?(d.remove(),c=t.append("g"),d=i.drawText(c,h,2*o.width-u.noteMargin),f=d[0][0].getBBox().height,l.attr("width",2*o.width),r.bounds.insert(e,n,e+2*o.width,n+2*u.noteMargin+f)):r.bounds.insert(e,n,e+o.width,n+2*u.noteMargin+f),l.attr("height",f+2*u.noteMargin),r.bounds.bumpVerticalPos(f+2*u.noteMargin)},l=function(t,e,i,a,s){var o,c=t.append("g"),l=e+(i-e)/2,h=c.append("text").attr("x",l).attr("y",a-7).style("text-anchor","middle").attr("class","messageText").text(s.message);o="undefined"!=typeof h[0][0].getBBox?h[0][0].getBBox().width:h[0][0].getBoundingClientRect();var d;if(e===i){d=c.append("path").attr("d","M "+e+","+a+" C "+(e+60)+","+(a-10)+" "+(e+60)+","+(a+30)+" "+e+","+(a+20)),r.bounds.bumpVerticalPos(30);var f=Math.max(o/2,100);r.bounds.insert(e-f,r.bounds.getVerticalPos()-10,i+f,r.bounds.getVerticalPos())}else d=c.append("line"),d.attr("x1",e),d.attr("y1",a),d.attr("x2",i),d.attr("y2",a),r.bounds.insert(e,r.bounds.getVerticalPos()-10,i,r.bounds.getVerticalPos());s.type===n.yy.LINETYPE.DOTTED||s.type===n.yy.LINETYPE.DOTTED_CROSS||s.type===n.yy.LINETYPE.DOTTED_OPEN?(d.style("stroke-dasharray","3, 3"),d.attr("class","messageLine1")):d.attr("class","messageLine0");var p="";u.arrowMarkerAbsolute&&(p=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,p=p.replace(/\(/g,"\\("),p=p.replace(/\)/g,"\\)")),d.attr("stroke-width",2),d.attr("stroke","black"),d.style("fill","none"),(s.type===n.yy.LINETYPE.SOLID||s.type===n.yy.LINETYPE.DOTTED)&&d.attr("marker-end","url("+p+"#arrowhead)"),(s.type===n.yy.LINETYPE.SOLID_CROSS||s.type===n.yy.LINETYPE.DOTTED_CROSS)&&d.attr("marker-end","url("+p+"#crosshead)")};e.exports.drawActors=function(t,e,n,a){var s;for(s=0;s/gi," "),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.attr("fill",e.fill),"undefined"!=typeof e["class"]&&i.attr("class",e["class"]);var a=i.append("tspan");return a.attr("x",e.x+2*e.textMargin),a.text(n),"undefined"!=typeof i.textwrap&&i.textwrap({x:e.x,y:e.y,width:r,height:1800},e.textMargin),i},r.drawLabel=function(t,e){var n=r.getNoteRect();n.x=e.x,n.y=e.y,n.width=50,n.height=20,n.fill="#526e52",n.stroke="none",n["class"]="labelBox",r.drawRect(t,n),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,e.fill="white",r.drawText(t,e)};var n=-1;r.drawActor=function(t,e,i,a,s){var o=e+s.width/2,u=t.append("g");0===i&&(n++,u.append("line").attr("id","actor"+n).attr("x1",o).attr("y1",5).attr("x2",o).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"));var c=r.getNoteRect();c.x=e,c.y=i,c.fill="#eaeaea",c.width=s.width,c.height=s.height,c["class"]="actor",c.rx=3,c.ry=3,r.drawRect(u,c),u.append("text").attr("x",o).attr("y",i+s.height/2+5).attr("class","actor").style("text-anchor","middle").text(a)},r.drawLoop=function(t,e,n,i){var a=t.append("g"),s=function(t,e,r,n){a.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",n).attr("stroke-width",2).attr("stroke","#526e52").attr("class","loopLine")};s(e.startx,e.starty,e.stopx,e.starty),s(e.stopx,e.starty,e.stopx,e.stopy),s(e.startx,e.stopy,e.stopx,e.stopy),s(e.startx,e.starty,e.startx,e.stopy),"undefined"!=typeof e.elsey&&s(e.startx,e.elsey,e.stopx,e.elsey);var o=r.getTextObj();o.text=n,o.x=e.startx,o.y=e.starty,o.labelMargin=15,o["class"]="labelText",o.fill="white",r.drawLabel(a,o),o=r.getTextObj(),o.text="[ "+e.title+" ]",o.x=e.startx+(e.stopx-e.startx)/2,o.y=e.starty+1.5*i.boxMargin,o.anchor="middle",o["class"]="loopText",r.drawText(a,o),"undefined"!=typeof e.elseText&&(o.text="[ "+e.elseText+" ]",o.y=e.elsey+1.5*i.boxMargin,r.drawText(a,o))},r.insertArrowHead=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},r.insertArrowCrossHead=function(t){var e=t.append("defs"),r=e.append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);r.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"),r.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")},r.getTextObj=function(){var t={x:0,y:0,fill:"black","text-anchor":"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0};return t},r.getNoteRect=function(){var t={x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0};return t}},{}],126:[function(t,e,r){"use strict";function n(t){var e=t.getUTCHours(),r=t.getUTCMinutes(),n=t.getSeconds(),i=t.getMilliseconds();10>e&&(e="0"+e),10>r&&(r="0"+r),10>n&&(n="0"+n),100>i&&(i="0"+i),10>i&&(i="00"+i);var a=e+":"+r+":"+n+" ("+i+")";return a}function i(t){this.level=t,this.log=function(t,e){var r=this.level;return"undefined"==typeof r&&(r=s),e>=r&&"undefined"!=typeof console&&"undefined"!=typeof console.log?console.log("["+n(new Date)+"] "+t):void 0},this.trace=function(t){this.log(t,a.trace)},this.debug=function(t){this.log(t,a.debug)},this.info=function(t){this.log(t,a.info)},this.warn=function(t){this.log(t,a.warn)},this.error=function(t){this.log(t,a.error)}}var a={debug:1,info:2,warn:3,error:4,fatal:5,"default":5},s=a.error;r.setLogLevel=function(t){s=t},r.Log=i},{}],127:[function(t,e,r){(function(n){"use strict";var i=t("./logger"),a=new i.Log,s=t("./mermaidAPI"),o=0,u=t("he");e.exports.mermaidAPI=s;var c=function(){var t=s.getConfig();a.debug("Starting rendering diagrams");var e;arguments.length>=2?("undefined"!=typeof arguments[0]&&(n.mermaid.sequenceConfig=arguments[0]),e=arguments[1]):e=arguments[0];var r;"function"==typeof arguments[arguments.length-1]?(r=arguments[arguments.length-1],a.debug("Callback function found")):"undefined"!=typeof t.mermaid&&("function"==typeof t.mermaid.callback?(r=t.mermaid.callback,a.debug("Callback function found")):a.debug("No Callback function found")),e=void 0===e?document.querySelectorAll(".mermaid"):"string"==typeof e?document.querySelectorAll(e):e instanceof Node?[e]:e;var i;"undefined"!=typeof mermaid_config&&s.initialize(n.mermaid_config),a.debug("Start On Load before: "+n.mermaid.startOnLoad),"undefined"!=typeof n.mermaid.startOnLoad&&(a.debug("Start On Load inner: "+n.mermaid.startOnLoad),s.initialize({startOnLoad:n.mermaid.startOnLoad})),"undefined"!=typeof n.mermaid.ganttConfig&&s.initialize({gantt:n.mermaid.ganttConfig});var c,l=function(t,e){h.innerHTML=t,"undefined"!=typeof r&&r(d),e(h)};for(i=0;i0&&(n+=r.selectorText+" { "+r.style.cssText+"}\n")}}catch(l){"undefined"!=typeof r&&i.warn('Invalid CSS selector "'+r.selectorText+'"',l)}var h="",d="";for(var f in e)e.hasOwnProperty(f)&&"undefined"!=typeof f&&("default"===f?(e["default"].styles instanceof Array&&(h+="#"+t.id.trim()+" .node>rect { "+e[f].styles.join("; ")+"; }\n"),e["default"].nodeLabelStyles instanceof Array&&(h+="#"+t.id.trim()+" .node text { "+e[f].nodeLabelStyles.join("; ")+"; }\n"),e["default"].edgeLabelStyles instanceof Array&&(h+="#"+t.id.trim()+" .edgeLabel text { "+e[f].edgeLabelStyles.join("; ")+"; }\n"),e["default"].clusterStyles instanceof Array&&(h+="#"+t.id.trim()+" .cluster rect { "+e[f].clusterStyles.join("; ")+"; }\n")):e[f].styles instanceof Array&&(d+="#"+t.id.trim()+" ."+f+">rect, ."+f+">polygon, ."+f+">ellipse { "+e[f].styles.join("; ")+"; }\n"));if(""!==n||""!==h||""!==d){var p=document.createElement("style");p.setAttribute("type","text/css"),p.setAttribute("title","mermaid-svg-internal-css"),p.innerHTML="/* */\n",t.insertBefore(p,t.firstChild)}};r.cloneCssStyles=s},{"./logger":126}]},{},[127])(127)}); \ No newline at end of file +s.each(i.vs,function(e,r){t.node(e).order=r}),h(t,r,i.vs)})}function a(t,e){s.each(e,function(e){s.each(e,function(e,r){t.node(e).order=r})})}var s=t("../lodash"),o=t("./init-order"),u=t("./cross-count"),c=t("./sort-subgraph"),l=t("./build-layer-graph"),h=t("./add-subgraph-constraints"),d=t("../graphlib").Graph,f=t("../util");e.exports=r},{"../graphlib":36,"../lodash":39,"../util":58,"./add-subgraph-constraints":42,"./build-layer-graph":44,"./cross-count":45,"./init-order":47,"./sort-subgraph":49}],47:[function(t,e){"use strict";function r(t){function e(i){if(!n.has(r,i)){r[i]=!0;var a=t.node(i);s[a.rank].push(i),n.each(t.successors(i),e)}}var r={},i=n.filter(t.nodes(),function(e){return!t.children(e).length}),a=n.max(n.map(i,function(e){return t.node(e).rank})),s=n.map(n.range(a+1),function(){return[]}),o=n.sortBy(i,function(e){return t.node(e).rank});return n.each(o,e),s}var n=t("../lodash");e.exports=r},{"../lodash":39}],48:[function(t,e){"use strict";function r(t,e){var r={};a.each(t,function(t,e){var n=r[t.v]={indegree:0,"in":[],out:[],vs:[t.v],i:e};a.isUndefined(t.barycenter)||(n.barycenter=t.barycenter,n.weight=t.weight)}),a.each(e.edges(),function(t){var e=r[t.v],n=r[t.w];a.isUndefined(e)||a.isUndefined(n)||(n.indegree++,e.out.push(r[t.w]))});var i=a.filter(r,function(t){return!t.indegree});return n(i)}function n(t){function e(t){return function(e){e.merged||(a.isUndefined(e.barycenter)||a.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&i(t,e)}}function r(e){return function(r){r["in"].push(e),0===--r.indegree&&t.push(r)}}for(var n=[];t.length;){var s=t.pop();n.push(s),a.each(s["in"].reverse(),e(s)),a.each(s.out,r(s))}return a.chain(n).filter(function(t){return!t.merged}).map(function(t){return a.pick(t,["vs","i","barycenter","weight"])}).value()}function i(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}var a=t("../lodash");e.exports=r},{"../lodash":39}],49:[function(t,e){function r(t,e,c,l){var h=t.children(e),d=t.node(e),f=d?d.borderLeft:void 0,p=d?d.borderRight:void 0,g={};f&&(h=a.filter(h,function(t){return t!==f&&t!==p}));var y=s(t,h);a.each(y,function(e){if(t.children(e.v).length){var n=r(t,e.v,c,l);g[e.v]=n,a.has(n,"barycenter")&&i(e,n)}});var m=o(y,c);n(m,g);var v=u(m,l);if(f&&(v.vs=a.flatten([f,v.vs,p],!0),t.predecessors(f).length)){var b=t.node(t.predecessors(f)[0]),_=t.node(t.predecessors(p)[0]);a.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+b.order+_.order)/(v.weight+2),v.weight+=2}return v}function n(t,e){a.each(t,function(t){t.vs=a.flatten(t.vs.map(function(t){return e[t]?e[t].vs:t}),!0)})}function i(t,e){a.isUndefined(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}var a=t("../lodash"),s=t("./barycenter"),o=t("./resolve-conflicts"),u=t("./sort");e.exports=r},{"../lodash":39,"./barycenter":43,"./resolve-conflicts":48,"./sort":50}],50:[function(t,e){function r(t,e){var r=s.partition(t,function(t){return a.has(t,"barycenter")}),o=r.lhs,u=a.sortBy(r.rhs,function(t){return-t.i}),c=[],l=0,h=0,d=0;o.sort(i(!!e)),d=n(c,u,d),a.each(o,function(t){d+=t.vs.length,c.push(t.vs),l+=t.barycenter*t.weight,h+=t.weight,d=n(c,u,d)});var f={vs:a.flatten(c,!0)};return h&&(f.barycenter=l/h,f.weight=h),f}function n(t,e,r){for(var n;e.length&&(n=a.last(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function i(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}var a=t("../lodash"),s=t("../util");e.exports=r},{"../lodash":39,"../util":58}],51:[function(t,e){function r(t){var e=i(t);a.each(t.graph().dummyChains,function(r){for(var i=t.node(r),a=i.edgeObj,s=n(t,e,a.v,a.w),o=s.path,u=s.lca,c=0,l=o[c],h=!0;r!==a.w;){if(i=t.node(r),h){for(;(l=o[c])!==u&&t.node(l).maxRanku||c>e[i].lim));for(a=i,i=n;(i=t.parent(i))!==a;)o.push(i);return{path:s.concat(o.reverse()),lca:a}}function i(t){function e(i){var s=n;a.each(t.children(i),e),r[i]={low:s,lim:n++}}var r={},n=0;return a.each(t.children(),e),r}var a=t("./lodash");e.exports=r},{"./lodash":39}],52:[function(t,e){"use strict";function r(t,e){function r(e,r){var s=0,o=0,u=e.length,c=y.last(r);return y.each(r,function(e,l){var h=i(t,e),d=h?t.node(h).order:u;(h||e===c)&&(y.each(r.slice(o,l+1),function(e){y.each(t.predecessors(e),function(r){var i=t.node(r),o=i.order;!(s>o||o>d)||i.dummy&&t.node(e).dummy||a(n,r,e)})}),o=l+1,s=d)}),r}var n={};return y.reduce(e,r),n}function n(t,e){function r(e,r,n,s,o){var u;y.each(y.range(r,n),function(r){u=e[r],t.node(u).dummy&&y.each(t.predecessors(u),function(e){var r=t.node(e);r.dummy&&(r.ordero)&&a(i,e,u)})})}function n(e,n){var i,a=-1,s=0;return y.each(n,function(o,u){if("border"===t.node(o).dummy){var c=t.predecessors(o);c.length&&(i=t.node(c[0]).order,r(n,s,u,a,i),s=u,a=i)}r(n,s,n.length,i,e.length)}),n}var i={};return y.reduce(e,n),i}function i(t,e){return t.node(e).dummy?y.find(t.predecessors(e),function(e){return t.node(e).dummy}):void 0}function a(t,e,r){if(e>r){var n=e;e=r,r=n}var i=t[e];i||(t[e]=i={}),i[r]=!0}function s(t,e,r){if(e>r){var n=e;e=r,r=n}return y.has(t[e],r)}function o(t,e,r,n){var i={},a={},o={};return y.each(e,function(t){y.each(t,function(t,e){i[t]=t,a[t]=t,o[t]=e})}),y.each(e,function(t){var e=-1;y.each(t,function(t){var u=n(t);if(u.length){u=y.sortBy(u,function(t){return o[t]});for(var c=(u.length-1)/2,l=Math.floor(c),h=Math.ceil(c);h>=l;++l){var d=u[l];a[t]===t&&es.lim&&(o=s,u=!0);var c=p.filter(e.edges(),function(e){return u===f(t,t.node(e.v),o)&&u!==f(t,t.node(e.w),o)});return p.min(c,function(t){return y(e,t)})}function l(t,e,r,i){var a=r.v,o=r.w;t.removeEdge(a,o),t.setEdge(i.v,i.w,{}),s(t),n(t,e),h(t,e)}function h(t,e){var r=p.find(t.nodes(),function(t){return!e.node(t).parent}),n=v(t,r);n=n.slice(1),p.each(n,function(r){var n=t.node(r).parent,i=e.edge(r,n),a=!1;i||(i=e.edge(n,r),a=!0),e.node(r).rank=e.node(n).rank+(a?i.minlen:-i.minlen)})}function d(t,e,r){return t.hasEdge(e,r)}function f(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}var p=t("../lodash"),g=t("./feasible-tree"),y=t("./util").slack,m=t("./util").longestPath,v=t("../graphlib").alg.preorder,b=t("../graphlib").alg.postorder,_=t("../util").simplify;e.exports=r,r.initLowLimValues=s,r.initCutValues=n,r.calcCutValue=a,r.leaveEdge=u,r.enterEdge=c,r.exchangeEdges=l},{"../graphlib":36,"../lodash":39,"../util":58,"./feasible-tree":54,"./util":57}],57:[function(t,e){"use strict";function r(t){function e(n){var a=t.node(n);if(i.has(r,n))return a.rank;r[n]=!0;var s=i.min(i.map(t.outEdges(n),function(r){return e(r.w)-t.edge(r).minlen}));return s===Number.POSITIVE_INFINITY&&(s=0),a.rank=s}var r={};i.each(t.sources(),e)}function n(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var i=t("../lodash");e.exports={longestPath:r,slack:n}},{"../lodash":39}],58:[function(t,e){"use strict";function r(t,e,r,n){var i;do i=y.uniqueId(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function n(t){var e=(new m).setGraph(t.graph());return y.each(t.nodes(),function(r){e.setNode(r,t.node(r))}),y.each(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function i(t){var e=new m({multigraph:t.isMultigraph()}).setGraph(t.graph());return y.each(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),y.each(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function a(t){var e=y.map(t.nodes(),function(e){var r={};return y.each(t.outEdges(e),function(e){r[e.w]=(r[e.w]||0)+t.edge(e).weight}),r});return y.zipObject(t.nodes(),e)}function s(t){var e=y.map(t.nodes(),function(e){var r={};return y.each(t.inEdges(e),function(e){r[e.v]=(r[e.v]||0)+t.edge(e).weight}),r});return y.zipObject(t.nodes(),e)}function o(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var u,c;return Math.abs(a)*s>Math.abs(i)*o?(0>a&&(o=-o),u=o*i/a,c=o):(0>i&&(s=-s),u=s,c=s*a/i),{x:r+u,y:n+c}}function u(t){var e=y.map(y.range(d(t)+1),function(){return[]});return y.each(t.nodes(),function(r){var n=t.node(r),i=n.rank;y.isUndefined(i)||(e[i][n.order]=r)}),e}function c(t){var e=y.min(y.map(t.nodes(),function(e){return t.node(e).rank}));y.each(t.nodes(),function(r){var n=t.node(r);y.has(n,"rank")&&(n.rank-=e)})}function l(t){var e=y.min(y.map(t.nodes(),function(e){return t.node(e).rank})),r=[];y.each(t.nodes(),function(n){var i=t.node(n).rank-e;r[i]||(r[i]=[]),r[i].push(n)});var n=0,i=t.graph().nodeRankFactor;y.each(r,function(e,r){y.isUndefined(e)&&r%i!==0?--n:n&&y.each(e,function(e){t.node(e).rank+=n})})}function h(t,e,n,i){var a={width:0,height:0};return arguments.length>=4&&(a.rank=n,a.order=i),r(t,"border",a,e)}function d(t){return y.max(y.map(t.nodes(),function(e){var r=t.node(e).rank;return y.isUndefined(r)?void 0:r}))}function f(t,e){var r={lhs:[],rhs:[]};return y.each(t,function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r}function p(t,e){var r=y.now();try{return e()}finally{console.log(t+" time: "+(y.now()-r)+"ms")}}function g(t,e){return e()}var y=t("./lodash"),m=t("./graphlib").Graph;e.exports={addDummyNode:r,simplify:n,asNonCompoundGraph:i,successorWeights:a,predecessorWeights:s,intersectRect:o,buildLayerMatrix:u,normalizeRanks:c,removeEmptyRanks:l,addBorderNode:h,maxRank:d,partition:f,time:p,notime:g}},{"./graphlib":36,"./lodash":39}],59:[function(t,e){e.exports="0.7.4"},{}],60:[function(t,e){var r=t("./lib");e.exports={Graph:r.Graph,json:t("./lib/json"),alg:t("./lib/alg"),version:r.version}},{"./lib":76,"./lib/alg":67,"./lib/json":77}],61:[function(t,e){function r(t){function e(a){n.has(i,a)||(i[a]=!0,r.push(a),n.each(t.successors(a),e),n.each(t.predecessors(a),e))}var r,i={},a=[];return n.each(t.nodes(),function(t){r=[],e(t),r.length&&a.push(r)}),a}var n=t("../lodash");e.exports=r},{"../lodash":78}],62:[function(t,e){function r(t,e,r){i.isArray(e)||(e=[e]);var a=[],s={};return i.each(e,function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);n(t,e,"post"===r,s,a)}),a}function n(t,e,r,a,s){i.has(a,e)||(a[e]=!0,r||s.push(e),i.each(t.neighbors(e),function(e){n(t,e,r,a,s)}),r&&s.push(e))}var i=t("../lodash");e.exports=r},{"../lodash":78}],63:[function(t,e){function r(t,e,r){return i.transform(t.nodes(),function(i,a){i[a]=n(t,a,e,r)},{})}var n=t("./dijkstra"),i=t("../lodash");e.exports=r},{"../lodash":78,"./dijkstra":64}],64:[function(t,e){function r(t,e,r,i){return n(t,String(e),r||s,i||function(e){return t.outEdges(e)})}function n(t,e,r,n){var i,s,o={},u=new a,c=function(t){var e=t.v!==i?t.v:t.w,n=o[e],a=r(t),c=s.distance+a;if(0>a)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+a);c0&&(i=u.removeMin(),s=o[i],s.distance!==Number.POSITIVE_INFINITY);)n(i).forEach(c);return o}var i=t("../lodash"),a=t("../data/priority-queue");e.exports=r;var s=i.constant(1)},{"../data/priority-queue":74,"../lodash":78}],65:[function(t,e){function r(t){return n.filter(i(t),function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})}var n=t("../lodash"),i=t("./tarjan");e.exports=r},{"../lodash":78,"./tarjan":72}],66:[function(t,e){function r(t,e,r){return n(t,e||a,r||function(e){return t.outEdges(e)})}function n(t,e,r){var n={},i=t.nodes();return i.forEach(function(t){n[t]={},n[t][t]={distance:0},i.forEach(function(e){t!==e&&(n[t][e]={distance:Number.POSITIVE_INFINITY})}),r(t).forEach(function(r){var i=r.v===t?r.w:r.v,a=e(r);n[t][i]={distance:a,predecessor:t}})}),i.forEach(function(t){var e=n[t];i.forEach(function(r){var a=n[r];i.forEach(function(r){var n=a[t],i=e[r],s=a[r],o=n.distance+i.distance;oi&&(u[r]=s,c.decrease(r,i))}}var s,o=new i,u={},c=new a;if(0===t.nodeCount())return o;n.each(t.nodes(),function(t){c.add(t,Number.POSITIVE_INFINITY),o.setNode(t)}),c.decrease(t.nodes()[0],0);for(var l=!1;c.size()>0;){if(s=c.removeMin(),n.has(u,s))o.setEdge(s,u[s]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(s).forEach(r)}return o}var n=t("../lodash"),i=t("../graph"),a=t("../data/priority-queue");e.exports=r},{"../data/priority-queue":74,"../graph":75,"../lodash":78}],72:[function(t,e){function r(t){function e(o){var u=a[o]={onStack:!0,lowlink:r,index:r++};if(i.push(o),t.successors(o).forEach(function(t){n.has(a,t)?a[t].onStack&&(u.lowlink=Math.min(u.lowlink,a[t].index)):(e(t),u.lowlink=Math.min(u.lowlink,a[t].lowlink))}),u.lowlink===u.index){var c,l=[];do c=i.pop(),a[c].onStack=!1,l.push(c);while(o!==c);s.push(l)}}var r=0,i=[],a={},s=[];return t.nodes().forEach(function(t){n.has(a,t)||e(t)}),s}var n=t("../lodash");e.exports=r},{"../lodash":78}],73:[function(t,e){function r(t){function e(o){if(i.has(a,o))throw new n;i.has(r,o)||(a[o]=!0,r[o]=!0,i.each(t.predecessors(o),e),delete a[o],s.push(o))}var r={},a={},s=[];if(i.each(t.sinks(),e),i.size(r)!==t.nodeCount())throw new n;return s}function n(){}var i=t("../lodash");e.exports=r,r.CycleException=n},{"../lodash":78}],74:[function(t,e){function r(){this._arr=[],this._keyIndices={}}var n=t("../lodash");e.exports=r,r.prototype.size=function(){return this._arr.length},r.prototype.keys=function(){return this._arr.map(function(t){return t.key})},r.prototype.has=function(t){return n.has(this._keyIndices,t)},r.prototype.priority=function(t){var e=this._keyIndices[t];return void 0!==e?this._arr[e].priority:void 0},r.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},r.prototype.add=function(t,e){var r=this._keyIndices;if(t=String(t),!n.has(r,t)){var i=this._arr,a=i.length;return r[t]=a,i.push({key:t,priority:e}),this._decrease(a),!0}return!1},r.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},r.prototype.decrease=function(t,e){var r=this._keyIndices[t];if(e>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[r].priority+" New: "+e);this._arr[r].priority=e,this._decrease(r)},r.prototype._heapify=function(t){var e=this._arr,r=2*t,n=r+1,i=t;r>1,!(r[e].prioritya){var s=i;i=a,a=s}return i+h+a+h+(u.isUndefined(n)?c:n)}function s(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function o(t,e){return a(t,e.v,e.w,e.name)}var u=t("./lodash");e.exports=r;var c="\x00",l="\x00",h="";r.prototype._nodeCount=0,r.prototype._edgeCount=0,r.prototype.isDirected=function(){return this._isDirected},r.prototype.isMultigraph=function(){return this._isMultigraph},r.prototype.isCompound=function(){return this._isCompound},r.prototype.setGraph=function(t){return this._label=t,this},r.prototype.graph=function(){return this._label},r.prototype.setDefaultNodeLabel=function(t){return u.isFunction(t)||(t=u.constant(t)),this._defaultNodeLabelFn=t,this},r.prototype.nodeCount=function(){return this._nodeCount},r.prototype.nodes=function(){return u.keys(this._nodes)},r.prototype.sources=function(){return u.filter(this.nodes(),function(t){return u.isEmpty(this._in[t])},this)},r.prototype.sinks=function(){return u.filter(this.nodes(),function(t){return u.isEmpty(this._out[t])},this)},r.prototype.setNodes=function(t,e){var r=arguments;return u.each(t,function(t){r.length>1?this.setNode(t,e):this.setNode(t)},this),this},r.prototype.setNode=function(t,e){return u.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=l,this._children[t]={},this._children[l][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},r.prototype.node=function(t){return this._nodes[t]},r.prototype.hasNode=function(t){return u.has(this._nodes,t)},r.prototype.removeNode=function(t){var e=this;if(u.has(this._nodes,t)){var r=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],u.each(this.children(t),function(t){this.setParent(t)},this),delete this._children[t]),u.each(u.keys(this._in[t]),r),delete this._in[t],delete this._preds[t],u.each(u.keys(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},r.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(u.isUndefined(e))e=l;else{e+="";for(var r=e;!u.isUndefined(r);r=this.parent(r))if(r===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},r.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},r.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==l)return e}},r.prototype.children=function(t){if(u.isUndefined(t)&&(t=l),this._isCompound){var e=this._children[t];if(e)return u.keys(e)}else{if(t===l)return this.nodes();if(this.hasNode(t))return[]}},r.prototype.predecessors=function(t){var e=this._preds[t];return e?u.keys(e):void 0},r.prototype.successors=function(t){var e=this._sucs[t];return e?u.keys(e):void 0},r.prototype.neighbors=function(t){var e=this.predecessors(t);return e?u.union(e,this.successors(t)):void 0},r.prototype.filterNodes=function(t){function e(t){var a=n.parent(t);return void 0===a||r.hasNode(a)?(i[t]=a,a):a in i?i[a]:e(a)}var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph()),u.each(this._nodes,function(e,n){t(n)&&r.setNode(n,e)},this),u.each(this._edgeObjs,function(t){r.hasNode(t.v)&&r.hasNode(t.w)&&r.setEdge(t,this.edge(t))},this);var n=this,i={};return this._isCompound&&u.each(r.nodes(),function(t){r.setParent(t,e(t))}),r},r.prototype.setDefaultEdgeLabel=function(t){return u.isFunction(t)||(t=u.constant(t)),this._defaultEdgeLabelFn=t,this},r.prototype.edgeCount=function(){return this._edgeCount},r.prototype.edges=function(){return u.values(this._edgeObjs)},r.prototype.setPath=function(t,e){var r=this,n=arguments;return u.reduce(t,function(t,i){return n.length>1?r.setEdge(t,i,e):r.setEdge(t,i),i}),this},r.prototype.setEdge=function(){var t,e,r,i,o=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(t=c.v,e=c.w,r=c.name,2===arguments.length&&(i=arguments[1],o=!0)):(t=c,e=arguments[1],r=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,e=""+e,u.isUndefined(r)||(r=""+r);var l=a(this._isDirected,t,e,r);if(u.has(this._edgeLabels,l))return o&&(this._edgeLabels[l]=i),this;if(!u.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=o?i:this._defaultEdgeLabelFn(t,e,r);var h=s(this._isDirected,t,e,r);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[l]=h,n(this._preds[e],t),n(this._sucs[t],e),this._in[e][l]=h,this._out[t][l]=h,this._edgeCount++,this},r.prototype.edge=function(t,e,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,r);return this._edgeLabels[n]},r.prototype.hasEdge=function(t,e,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,r);return u.has(this._edgeLabels,n)},r.prototype.removeEdge=function(t,e,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,r),s=this._edgeObjs[n];return s&&(t=s.v,e=s.w,delete this._edgeLabels[n],delete this._edgeObjs[n],i(this._preds[e],t),i(this._sucs[t],e),delete this._in[e][n],delete this._out[t][n],this._edgeCount--),this},r.prototype.inEdges=function(t,e){var r=this._in[t];if(r){var n=u.values(r);return e?u.filter(n,function(t){return t.v===e}):n}},r.prototype.outEdges=function(t,e){var r=this._out[t];if(r){var n=u.values(r);return e?u.filter(n,function(t){return t.w===e}):n}},r.prototype.nodeEdges=function(t,e){var r=this.inEdges(t,e);return r?r.concat(this.outEdges(t,e)):void 0}},{"./lodash":78}],76:[function(t,e){e.exports={Graph:t("./graph"),version:t("./version")}},{"./graph":75,"./version":79}],77:[function(t,e){function r(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:n(t),edges:i(t)};return s.isUndefined(t.graph())||(e.value=s.clone(t.graph())),e}function n(t){return s.map(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return s.isUndefined(r)||(i.value=r),s.isUndefined(n)||(i.parent=n),i})}function i(t){return s.map(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return s.isUndefined(e.name)||(n.name=e.name),s.isUndefined(r)||(n.value=r),n})}function a(t){var e=new o(t.options).setGraph(t.value);return s.each(t.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),s.each(t.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}var s=t("./lodash"),o=t("./graph");e.exports={write:r,read:a}},{"./graph":75,"./lodash":78}],78:[function(t,e){e.exports=t(39)},{"/Users/knut/source/mermaid/node_modules/dagre/lib/lodash.js":39,lodash:81}],79:[function(t,e){e.exports="1.0.7"},{}],80:[function(t,e,r){(function(t){!function(n){var i="object"==typeof r&&r,a="object"==typeof e&&e&&e.exports==i&&e,s="object"==typeof t&&t;(s.global===s||s.window===s)&&(n=s);var o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=/[\x01-\x7F]/g,c=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,l=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,h={ +"Á":"Aacute","á":"aacute","Ă":"Abreve","ă":"abreve","∾":"ac","∿":"acd","∾̳":"acE","Â":"Acirc","â":"acirc","´":"acute","А":"Acy","а":"acy","Æ":"AElig","æ":"aelig","⁡":"af","𝔄":"Afr","𝔞":"afr","À":"Agrave","à":"agrave","ℵ":"aleph","Α":"Alpha","α":"alpha","Ā":"Amacr","ā":"amacr","⨿":"amalg","&":"amp","⩕":"andand","⩓":"And","∧":"and","⩜":"andd","⩘":"andslope","⩚":"andv","∠":"ang","⦤":"ange","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","∡":"angmsd","∟":"angrt","⊾":"angrtvb","⦝":"angrtvbd","∢":"angsph","Å":"angst","⍼":"angzarr","Ą":"Aogon","ą":"aogon","𝔸":"Aopf","𝕒":"aopf","⩯":"apacir","≈":"ap","⩰":"apE","≊":"ape","≋":"apid","'":"apos","å":"aring","𝒜":"Ascr","𝒶":"ascr","≔":"colone","*":"ast","≍":"CupCap","Ã":"Atilde","ã":"atilde","Ä":"Auml","ä":"auml","∳":"awconint","⨑":"awint","≌":"bcong","϶":"bepsi","‵":"bprime","∽":"bsim","⋍":"bsime","∖":"setmn","⫧":"Barv","⊽":"barvee","⌅":"barwed","⌆":"Barwed","⎵":"bbrk","⎶":"bbrktbrk","Б":"Bcy","б":"bcy","„":"bdquo","∵":"becaus","⦰":"bemptyv","ℬ":"Bscr","Β":"Beta","β":"beta","ℶ":"beth","≬":"twixt","𝔅":"Bfr","𝔟":"bfr","⋂":"xcap","◯":"xcirc","⋃":"xcup","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨆":"xsqcup","★":"starf","▽":"xdtri","△":"xutri","⨄":"xuplus","⋁":"Vee","⋀":"Wedge","⤍":"rbarr","⧫":"lozf","▪":"squf","▴":"utrif","▾":"dtrif","◂":"ltrif","▸":"rtrif","␣":"blank","▒":"blk12","░":"blk14","▓":"blk34","█":"block","=⃥":"bne","≡⃥":"bnequiv","⫭":"bNot","⌐":"bnot","𝔹":"Bopf","𝕓":"bopf","⊥":"bot","⋈":"bowtie","⧉":"boxbox","┐":"boxdl","╕":"boxdL","╖":"boxDl","╗":"boxDL","┌":"boxdr","╒":"boxdR","╓":"boxDr","╔":"boxDR","─":"boxh","═":"boxH","┬":"boxhd","╤":"boxHd","╥":"boxhD","╦":"boxHD","┴":"boxhu","╧":"boxHu","╨":"boxhU","╩":"boxHU","⊟":"minusb","⊞":"plusb","⊠":"timesb","┘":"boxul","╛":"boxuL","╜":"boxUl","╝":"boxUL","└":"boxur","╘":"boxuR","╙":"boxUr","╚":"boxUR","│":"boxv","║":"boxV","┼":"boxvh","╪":"boxvH","╫":"boxVh","╬":"boxVH","┤":"boxvl","╡":"boxvL","╢":"boxVl","╣":"boxVL","├":"boxvr","╞":"boxvR","╟":"boxVr","╠":"boxVR","˘":"breve","¦":"brvbar","𝒷":"bscr","⁏":"bsemi","⧅":"bsolb","\\":"bsol","⟈":"bsolhsub","•":"bull","≎":"bump","⪮":"bumpE","≏":"bumpe","Ć":"Cacute","ć":"cacute","⩄":"capand","⩉":"capbrcup","⩋":"capcap","∩":"cap","⋒":"Cap","⩇":"capcup","⩀":"capdot","ⅅ":"DD","∩︀":"caps","⁁":"caret","ˇ":"caron","ℭ":"Cfr","⩍":"ccaps","Č":"Ccaron","č":"ccaron","Ç":"Ccedil","ç":"ccedil","Ĉ":"Ccirc","ĉ":"ccirc","∰":"Cconint","⩌":"ccups","⩐":"ccupssm","Ċ":"Cdot","ċ":"cdot","¸":"cedil","⦲":"cemptyv","¢":"cent","·":"middot","𝔠":"cfr","Ч":"CHcy","ч":"chcy","✓":"check","Χ":"Chi","χ":"chi","ˆ":"circ","≗":"cire","↺":"olarr","↻":"orarr","⊛":"oast","⊚":"ocir","⊝":"odash","⊙":"odot","®":"reg","Ⓢ":"oS","⊖":"ominus","⊕":"oplus","⊗":"otimes","○":"cir","⧃":"cirE","⨐":"cirfnint","⫯":"cirmid","⧂":"cirscir","∲":"cwconint","”":"rdquo","’":"rsquo","♣":"clubs",":":"colon","∷":"Colon","⩴":"Colone",",":"comma","@":"commat","∁":"comp","∘":"compfn","ℂ":"Copf","≅":"cong","⩭":"congdot","≡":"equiv","∮":"oint","∯":"Conint","𝕔":"copf","∐":"coprod","©":"copy","℗":"copysr","↵":"crarr","✗":"cross","⨯":"Cross","𝒞":"Cscr","𝒸":"cscr","⫏":"csub","⫑":"csube","⫐":"csup","⫒":"csupe","⋯":"ctdot","⤸":"cudarrl","⤵":"cudarrr","⋞":"cuepr","⋟":"cuesc","↶":"cularr","⤽":"cularrp","⩈":"cupbrcap","⩆":"cupcap","∪":"cup","⋓":"Cup","⩊":"cupcup","⊍":"cupdot","⩅":"cupor","∪︀":"cups","↷":"curarr","⤼":"curarrm","⋎":"cuvee","⋏":"cuwed","¤":"curren","∱":"cwint","⌭":"cylcty","†":"dagger","‡":"Dagger","ℸ":"daleth","↓":"darr","↡":"Darr","⇓":"dArr","‐":"dash","⫤":"Dashv","⊣":"dashv","⤏":"rBarr","˝":"dblac","Ď":"Dcaron","ď":"dcaron","Д":"Dcy","д":"dcy","⇊":"ddarr","ⅆ":"dd","⤑":"DDotrahd","⩷":"eDDot","°":"deg","∇":"Del","Δ":"Delta","δ":"delta","⦱":"demptyv","⥿":"dfisht","𝔇":"Dfr","𝔡":"dfr","⥥":"dHar","⇃":"dharl","⇂":"dharr","˙":"dot","`":"grave","˜":"tilde","⋄":"diam","♦":"diams","¨":"die","ϝ":"gammad","⋲":"disin","÷":"div","⋇":"divonx","Ђ":"DJcy","ђ":"djcy","⌞":"dlcorn","⌍":"dlcrop",$:"dollar","𝔻":"Dopf","𝕕":"dopf","⃜":"DotDot","≐":"doteq","≑":"eDot","∸":"minusd","∔":"plusdo","⊡":"sdotb","⇐":"lArr","⇔":"iff","⟸":"xlArr","⟺":"xhArr","⟹":"xrArr","⇒":"rArr","⊨":"vDash","⇑":"uArr","⇕":"vArr","∥":"par","⤓":"DownArrowBar","⇵":"duarr","̑":"DownBreve","⥐":"DownLeftRightVector","⥞":"DownLeftTeeVector","⥖":"DownLeftVectorBar","↽":"lhard","⥟":"DownRightTeeVector","⥗":"DownRightVectorBar","⇁":"rhard","↧":"mapstodown","⊤":"top","⤐":"RBarr","⌟":"drcorn","⌌":"drcrop","𝒟":"Dscr","𝒹":"dscr","Ѕ":"DScy","ѕ":"dscy","⧶":"dsol","Đ":"Dstrok","đ":"dstrok","⋱":"dtdot","▿":"dtri","⥯":"duhar","⦦":"dwangle","Џ":"DZcy","џ":"dzcy","⟿":"dzigrarr","É":"Eacute","é":"eacute","⩮":"easter","Ě":"Ecaron","ě":"ecaron","Ê":"Ecirc","ê":"ecirc","≖":"ecir","≕":"ecolon","Э":"Ecy","э":"ecy","Ė":"Edot","ė":"edot","ⅇ":"ee","≒":"efDot","𝔈":"Efr","𝔢":"efr","⪚":"eg","È":"Egrave","è":"egrave","⪖":"egs","⪘":"egsdot","⪙":"el","∈":"in","⏧":"elinters","ℓ":"ell","⪕":"els","⪗":"elsdot","Ē":"Emacr","ē":"emacr","∅":"empty","◻":"EmptySmallSquare","▫":"EmptyVerySmallSquare"," ":"emsp13"," ":"emsp14"," ":"emsp","Ŋ":"ENG","ŋ":"eng"," ":"ensp","Ę":"Eogon","ę":"eogon","𝔼":"Eopf","𝕖":"eopf","⋕":"epar","⧣":"eparsl","⩱":"eplus","ε":"epsi","Ε":"Epsilon","ϵ":"epsiv","≂":"esim","⩵":"Equal","=":"equals","≟":"equest","⇌":"rlhar","⩸":"equivDD","⧥":"eqvparsl","⥱":"erarr","≓":"erDot","ℯ":"escr","ℰ":"Escr","⩳":"Esim","Η":"Eta","η":"eta","Ð":"ETH","ð":"eth","Ë":"Euml","ë":"euml","€":"euro","!":"excl","∃":"exist","Ф":"Fcy","ф":"fcy","♀":"female","ffi":"ffilig","ff":"fflig","ffl":"ffllig","𝔉":"Ffr","𝔣":"ffr","fi":"filig","◼":"FilledSmallSquare",fj:"fjlig","♭":"flat","fl":"fllig","▱":"fltns","ƒ":"fnof","𝔽":"Fopf","𝕗":"fopf","∀":"forall","⋔":"fork","⫙":"forkv","ℱ":"Fscr","⨍":"fpartint","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","⅔":"frac23","⅖":"frac25","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","⁄":"frasl","⌢":"frown","𝒻":"fscr","ǵ":"gacute","Γ":"Gamma","γ":"gamma","Ϝ":"Gammad","⪆":"gap","Ğ":"Gbreve","ğ":"gbreve","Ģ":"Gcedil","Ĝ":"Gcirc","ĝ":"gcirc","Г":"Gcy","г":"gcy","Ġ":"Gdot","ġ":"gdot","≥":"ge","≧":"gE","⪌":"gEl","⋛":"gel","⩾":"ges","⪩":"gescc","⪀":"gesdot","⪂":"gesdoto","⪄":"gesdotol","⋛︀":"gesl","⪔":"gesles","𝔊":"Gfr","𝔤":"gfr","≫":"gg","⋙":"Gg","ℷ":"gimel","Ѓ":"GJcy","ѓ":"gjcy","⪥":"gla","≷":"gl","⪒":"glE","⪤":"glj","⪊":"gnap","⪈":"gne","≩":"gnE","⋧":"gnsim","𝔾":"Gopf","𝕘":"gopf","⪢":"GreaterGreater","≳":"gsim","𝒢":"Gscr","ℊ":"gscr","⪎":"gsime","⪐":"gsiml","⪧":"gtcc","⩺":"gtcir",">":"gt","⋗":"gtdot","⦕":"gtlPar","⩼":"gtquest","⥸":"gtrarr","≩︀":"gvnE"," ":"hairsp","ℋ":"Hscr","Ъ":"HARDcy","ъ":"hardcy","⥈":"harrcir","↔":"harr","↭":"harrw","^":"Hat","ℏ":"hbar","Ĥ":"Hcirc","ĥ":"hcirc","♥":"hearts","…":"mldr","⊹":"hercon","𝔥":"hfr","ℌ":"Hfr","⤥":"searhk","⤦":"swarhk","⇿":"hoarr","∻":"homtht","↩":"larrhk","↪":"rarrhk","𝕙":"hopf","ℍ":"Hopf","―":"horbar","𝒽":"hscr","Ħ":"Hstrok","ħ":"hstrok","⁃":"hybull","Í":"Iacute","í":"iacute","⁣":"ic","Î":"Icirc","î":"icirc","И":"Icy","и":"icy","İ":"Idot","Е":"IEcy","е":"iecy","¡":"iexcl","𝔦":"ifr","ℑ":"Im","Ì":"Igrave","ì":"igrave","ⅈ":"ii","⨌":"qint","∭":"tint","⧜":"iinfin","℩":"iiota","IJ":"IJlig","ij":"ijlig","Ī":"Imacr","ī":"imacr","ℐ":"Iscr","ı":"imath","⊷":"imof","Ƶ":"imped","℅":"incare","∞":"infin","⧝":"infintie","⊺":"intcal","∫":"int","∬":"Int","ℤ":"Zopf","⨗":"intlarhk","⨼":"iprod","⁢":"it","Ё":"IOcy","ё":"iocy","Į":"Iogon","į":"iogon","𝕀":"Iopf","𝕚":"iopf","Ι":"Iota","ι":"iota","¿":"iquest","𝒾":"iscr","⋵":"isindot","⋹":"isinE","⋴":"isins","⋳":"isinsv","Ĩ":"Itilde","ĩ":"itilde","І":"Iukcy","і":"iukcy","Ï":"Iuml","ï":"iuml","Ĵ":"Jcirc","ĵ":"jcirc","Й":"Jcy","й":"jcy","𝔍":"Jfr","𝔧":"jfr","ȷ":"jmath","𝕁":"Jopf","𝕛":"jopf","𝒥":"Jscr","𝒿":"jscr","Ј":"Jsercy","ј":"jsercy","Є":"Jukcy","є":"jukcy","Κ":"Kappa","κ":"kappa","ϰ":"kappav","Ķ":"Kcedil","ķ":"kcedil","К":"Kcy","к":"kcy","𝔎":"Kfr","𝔨":"kfr","ĸ":"kgreen","Х":"KHcy","х":"khcy","Ќ":"KJcy","ќ":"kjcy","𝕂":"Kopf","𝕜":"kopf","𝒦":"Kscr","𝓀":"kscr","⇚":"lAarr","Ĺ":"Lacute","ĺ":"lacute","⦴":"laemptyv","ℒ":"Lscr","Λ":"Lambda","λ":"lambda","⟨":"lang","⟪":"Lang","⦑":"langd","⪅":"lap","«":"laquo","⇤":"larrb","⤟":"larrbfs","←":"larr","↞":"Larr","⤝":"larrfs","↫":"larrlp","⤹":"larrpl","⥳":"larrsim","↢":"larrtl","⤙":"latail","⤛":"lAtail","⪫":"lat","⪭":"late","⪭︀":"lates","⤌":"lbarr","⤎":"lBarr","❲":"lbbrk","{":"lcub","[":"lsqb","⦋":"lbrke","⦏":"lbrksld","⦍":"lbrkslu","Ľ":"Lcaron","ľ":"lcaron","Ļ":"Lcedil","ļ":"lcedil","⌈":"lceil","Л":"Lcy","л":"lcy","⤶":"ldca","“":"ldquo","⥧":"ldrdhar","⥋":"ldrushar","↲":"ldsh","≤":"le","≦":"lE","⇆":"lrarr","⟦":"lobrk","⥡":"LeftDownTeeVector","⥙":"LeftDownVectorBar","⌊":"lfloor","↼":"lharu","⇇":"llarr","⇋":"lrhar","⥎":"LeftRightVector","↤":"mapstoleft","⥚":"LeftTeeVector","⋋":"lthree","⧏":"LeftTriangleBar","⊲":"vltri","⊴":"ltrie","⥑":"LeftUpDownVector","⥠":"LeftUpTeeVector","⥘":"LeftUpVectorBar","↿":"uharl","⥒":"LeftVectorBar","⪋":"lEg","⋚":"leg","⩽":"les","⪨":"lescc","⩿":"lesdot","⪁":"lesdoto","⪃":"lesdotor","⋚︀":"lesg","⪓":"lesges","⋖":"ltdot","≶":"lg","⪡":"LessLess","≲":"lsim","⥼":"lfisht","𝔏":"Lfr","𝔩":"lfr","⪑":"lgE","⥢":"lHar","⥪":"lharul","▄":"lhblk","Љ":"LJcy","љ":"ljcy","≪":"ll","⋘":"Ll","⥫":"llhard","◺":"lltri","Ŀ":"Lmidot","ŀ":"lmidot","⎰":"lmoust","⪉":"lnap","⪇":"lne","≨":"lnE","⋦":"lnsim","⟬":"loang","⇽":"loarr","⟵":"xlarr","⟷":"xharr","⟼":"xmap","⟶":"xrarr","↬":"rarrlp","⦅":"lopar","𝕃":"Lopf","𝕝":"lopf","⨭":"loplus","⨴":"lotimes","∗":"lowast",_:"lowbar","↙":"swarr","↘":"searr","◊":"loz","(":"lpar","⦓":"lparlt","⥭":"lrhard","‎":"lrm","⊿":"lrtri","‹":"lsaquo","𝓁":"lscr","↰":"lsh","⪍":"lsime","⪏":"lsimg","‘":"lsquo","‚":"sbquo","Ł":"Lstrok","ł":"lstrok","⪦":"ltcc","⩹":"ltcir","<":"lt","⋉":"ltimes","⥶":"ltlarr","⩻":"ltquest","◃":"ltri","⦖":"ltrPar","⥊":"lurdshar","⥦":"luruhar","≨︀":"lvnE","¯":"macr","♂":"male","✠":"malt","⤅":"Map","↦":"map","↥":"mapstoup","▮":"marker","⨩":"mcomma","М":"Mcy","м":"mcy","—":"mdash","∺":"mDDot"," ":"MediumSpace","ℳ":"Mscr","𝔐":"Mfr","𝔪":"mfr","℧":"mho","µ":"micro","⫰":"midcir","∣":"mid","−":"minus","⨪":"minusdu","∓":"mp","⫛":"mlcp","⊧":"models","𝕄":"Mopf","𝕞":"mopf","𝓂":"mscr","Μ":"Mu","μ":"mu","⊸":"mumap","Ń":"Nacute","ń":"nacute","∠⃒":"nang","≉":"nap","⩰̸":"napE","≋̸":"napid","ʼn":"napos","♮":"natur","ℕ":"Nopf"," ":"nbsp","≎̸":"nbump","≏̸":"nbumpe","⩃":"ncap","Ň":"Ncaron","ň":"ncaron","Ņ":"Ncedil","ņ":"ncedil","≇":"ncong","⩭̸":"ncongdot","⩂":"ncup","Н":"Ncy","н":"ncy","–":"ndash","⤤":"nearhk","↗":"nearr","⇗":"neArr","≠":"ne","≐̸":"nedot","​":"ZeroWidthSpace","≢":"nequiv","⤨":"toea","≂̸":"nesim","\n":"NewLine","∄":"nexist","𝔑":"Nfr","𝔫":"nfr","≧̸":"ngE","≱":"nge","⩾̸":"nges","⋙̸":"nGg","≵":"ngsim","≫⃒":"nGt","≯":"ngt","≫̸":"nGtv","↮":"nharr","⇎":"nhArr","⫲":"nhpar","∋":"ni","⋼":"nis","⋺":"nisd","Њ":"NJcy","њ":"njcy","↚":"nlarr","⇍":"nlArr","‥":"nldr","≦̸":"nlE","≰":"nle","⩽̸":"nles","≮":"nlt","⋘̸":"nLl","≴":"nlsim","≪⃒":"nLt","⋪":"nltri","⋬":"nltrie","≪̸":"nLtv","∤":"nmid","⁠":"NoBreak","𝕟":"nopf","⫬":"Not","¬":"not","≭":"NotCupCap","∦":"npar","∉":"notin","≹":"ntgl","⋵̸":"notindot","⋹̸":"notinE","⋷":"notinvb","⋶":"notinvc","⧏̸":"NotLeftTriangleBar","≸":"ntlg","⪢̸":"NotNestedGreaterGreater","⪡̸":"NotNestedLessLess","∌":"notni","⋾":"notnivb","⋽":"notnivc","⊀":"npr","⪯̸":"npre","⋠":"nprcue","⧐̸":"NotRightTriangleBar","⋫":"nrtri","⋭":"nrtrie","⊏̸":"NotSquareSubset","⋢":"nsqsube","⊐̸":"NotSquareSuperset","⋣":"nsqsupe","⊂⃒":"vnsub","⊈":"nsube","⊁":"nsc","⪰̸":"nsce","⋡":"nsccue","≿̸":"NotSucceedsTilde","⊃⃒":"vnsup","⊉":"nsupe","≁":"nsim","≄":"nsime","⫽⃥":"nparsl","∂̸":"npart","⨔":"npolint","⤳̸":"nrarrc","↛":"nrarr","⇏":"nrArr","↝̸":"nrarrw","𝒩":"Nscr","𝓃":"nscr","⊄":"nsub","⫅̸":"nsubE","⊅":"nsup","⫆̸":"nsupE","Ñ":"Ntilde","ñ":"ntilde","Ν":"Nu","ν":"nu","#":"num","№":"numero"," ":"numsp","≍⃒":"nvap","⊬":"nvdash","⊭":"nvDash","⊮":"nVdash","⊯":"nVDash","≥⃒":"nvge",">⃒":"nvgt","⤄":"nvHarr","⧞":"nvinfin","⤂":"nvlArr","≤⃒":"nvle","<⃒":"nvlt","⊴⃒":"nvltrie","⤃":"nvrArr","⊵⃒":"nvrtrie","∼⃒":"nvsim","⤣":"nwarhk","↖":"nwarr","⇖":"nwArr","⤧":"nwnear","Ó":"Oacute","ó":"oacute","Ô":"Ocirc","ô":"ocirc","О":"Ocy","о":"ocy","Ő":"Odblac","ő":"odblac","⨸":"odiv","⦼":"odsold","Œ":"OElig","œ":"oelig","⦿":"ofcir","𝔒":"Ofr","𝔬":"ofr","˛":"ogon","Ò":"Ograve","ò":"ograve","⧁":"ogt","⦵":"ohbar","Ω":"ohm","⦾":"olcir","⦻":"olcross","‾":"oline","⧀":"olt","Ō":"Omacr","ō":"omacr","ω":"omega","Ο":"Omicron","ο":"omicron","⦶":"omid","𝕆":"Oopf","𝕠":"oopf","⦷":"opar","⦹":"operp","⩔":"Or","∨":"or","⩝":"ord","ℴ":"oscr","ª":"ordf","º":"ordm","⊶":"origof","⩖":"oror","⩗":"orslope","⩛":"orv","𝒪":"Oscr","Ø":"Oslash","ø":"oslash","⊘":"osol","Õ":"Otilde","õ":"otilde","⨶":"otimesas","⨷":"Otimes","Ö":"Ouml","ö":"ouml","⌽":"ovbar","⏞":"OverBrace","⎴":"tbrk","⏜":"OverParenthesis","¶":"para","⫳":"parsim","⫽":"parsl","∂":"part","П":"Pcy","п":"pcy","%":"percnt",".":"period","‰":"permil","‱":"pertenk","𝔓":"Pfr","𝔭":"pfr","Φ":"Phi","φ":"phi","ϕ":"phiv","☎":"phone","Π":"Pi","π":"pi","ϖ":"piv","ℎ":"planckh","⨣":"plusacir","⨢":"pluscir","+":"plus","⨥":"plusdu","⩲":"pluse","±":"pm","⨦":"plussim","⨧":"plustwo","⨕":"pointint","𝕡":"popf","ℙ":"Popf","£":"pound","⪷":"prap","⪻":"Pr","≺":"pr","≼":"prcue","⪯":"pre","≾":"prsim","⪹":"prnap","⪵":"prnE","⋨":"prnsim","⪳":"prE","′":"prime","″":"Prime","∏":"prod","⌮":"profalar","⌒":"profline","⌓":"profsurf","∝":"prop","⊰":"prurel","𝒫":"Pscr","𝓅":"pscr","Ψ":"Psi","ψ":"psi"," ":"puncsp","𝔔":"Qfr","𝔮":"qfr","𝕢":"qopf","ℚ":"Qopf","⁗":"qprime","𝒬":"Qscr","𝓆":"qscr","⨖":"quatint","?":"quest",'"':"quot","⇛":"rAarr","∽̱":"race","Ŕ":"Racute","ŕ":"racute","√":"Sqrt","⦳":"raemptyv","⟩":"rang","⟫":"Rang","⦒":"rangd","⦥":"range","»":"raquo","⥵":"rarrap","⇥":"rarrb","⤠":"rarrbfs","⤳":"rarrc","→":"rarr","↠":"Rarr","⤞":"rarrfs","⥅":"rarrpl","⥴":"rarrsim","⤖":"Rarrtl","↣":"rarrtl","↝":"rarrw","⤚":"ratail","⤜":"rAtail","∶":"ratio","❳":"rbbrk","}":"rcub","]":"rsqb","⦌":"rbrke","⦎":"rbrksld","⦐":"rbrkslu","Ř":"Rcaron","ř":"rcaron","Ŗ":"Rcedil","ŗ":"rcedil","⌉":"rceil","Р":"Rcy","р":"rcy","⤷":"rdca","⥩":"rdldhar","↳":"rdsh","ℜ":"Re","ℛ":"Rscr","ℝ":"Ropf","▭":"rect","⥽":"rfisht","⌋":"rfloor","𝔯":"rfr","⥤":"rHar","⇀":"rharu","⥬":"rharul","Ρ":"Rho","ρ":"rho","ϱ":"rhov","⇄":"rlarr","⟧":"robrk","⥝":"RightDownTeeVector","⥕":"RightDownVectorBar","⇉":"rrarr","⊢":"vdash","⥛":"RightTeeVector","⋌":"rthree","⧐":"RightTriangleBar","⊳":"vrtri","⊵":"rtrie","⥏":"RightUpDownVector","⥜":"RightUpTeeVector","⥔":"RightUpVectorBar","↾":"uharr","⥓":"RightVectorBar","˚":"ring","‏":"rlm","⎱":"rmoust","⫮":"rnmid","⟭":"roang","⇾":"roarr","⦆":"ropar","𝕣":"ropf","⨮":"roplus","⨵":"rotimes","⥰":"RoundImplies",")":"rpar","⦔":"rpargt","⨒":"rppolint","›":"rsaquo","𝓇":"rscr","↱":"rsh","⋊":"rtimes","▹":"rtri","⧎":"rtriltri","⧴":"RuleDelayed","⥨":"ruluhar","℞":"rx","Ś":"Sacute","ś":"sacute","⪸":"scap","Š":"Scaron","š":"scaron","⪼":"Sc","≻":"sc","≽":"sccue","⪰":"sce","⪴":"scE","Ş":"Scedil","ş":"scedil","Ŝ":"Scirc","ŝ":"scirc","⪺":"scnap","⪶":"scnE","⋩":"scnsim","⨓":"scpolint","≿":"scsim","С":"Scy","с":"scy","⋅":"sdot","⩦":"sdote","⇘":"seArr","§":"sect",";":"semi","⤩":"tosa","✶":"sext","𝔖":"Sfr","𝔰":"sfr","♯":"sharp","Щ":"SHCHcy","щ":"shchcy","Ш":"SHcy","ш":"shcy","↑":"uarr","­":"shy","Σ":"Sigma","σ":"sigma","ς":"sigmaf","∼":"sim","⩪":"simdot","≃":"sime","⪞":"simg","⪠":"simgE","⪝":"siml","⪟":"simlE","≆":"simne","⨤":"simplus","⥲":"simrarr","⨳":"smashp","⧤":"smeparsl","⌣":"smile","⪪":"smt","⪬":"smte","⪬︀":"smtes","Ь":"SOFTcy","ь":"softcy","⌿":"solbar","⧄":"solb","/":"sol","𝕊":"Sopf","𝕤":"sopf","♠":"spades","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊏":"sqsub","⊑":"sqsube","⊐":"sqsup","⊒":"sqsupe","□":"squ","𝒮":"Sscr","𝓈":"sscr","⋆":"Star","☆":"star","⊂":"sub","⋐":"Sub","⪽":"subdot","⫅":"subE","⊆":"sube","⫃":"subedot","⫁":"submult","⫋":"subnE","⊊":"subne","⪿":"subplus","⥹":"subrarr","⫇":"subsim","⫕":"subsub","⫓":"subsup","∑":"sum","♪":"sung","¹":"sup1","²":"sup2","³":"sup3","⊃":"sup","⋑":"Sup","⪾":"supdot","⫘":"supdsub","⫆":"supE","⊇":"supe","⫄":"supedot","⟉":"suphsol","⫗":"suphsub","⥻":"suplarr","⫂":"supmult","⫌":"supnE","⊋":"supne","⫀":"supplus","⫈":"supsim","⫔":"supsub","⫖":"supsup","⇙":"swArr","⤪":"swnwar","ß":"szlig"," ":"Tab","⌖":"target","Τ":"Tau","τ":"tau","Ť":"Tcaron","ť":"tcaron","Ţ":"Tcedil","ţ":"tcedil","Т":"Tcy","т":"tcy","⃛":"tdot","⌕":"telrec","𝔗":"Tfr","𝔱":"tfr","∴":"there4","Θ":"Theta","θ":"theta","ϑ":"thetav","  ":"ThickSpace"," ":"thinsp","Þ":"THORN","þ":"thorn","⨱":"timesbar","×":"times","⨰":"timesd","⌶":"topbot","⫱":"topcir","𝕋":"Topf","𝕥":"topf","⫚":"topfork","‴":"tprime","™":"trade","▵":"utri","≜":"trie","◬":"tridot","⨺":"triminus","⨹":"triplus","⧍":"trisb","⨻":"tritime","⏢":"trpezium","𝒯":"Tscr","𝓉":"tscr","Ц":"TScy","ц":"tscy","Ћ":"TSHcy","ћ":"tshcy","Ŧ":"Tstrok","ŧ":"tstrok","Ú":"Uacute","ú":"uacute","↟":"Uarr","⥉":"Uarrocir","Ў":"Ubrcy","ў":"ubrcy","Ŭ":"Ubreve","ŭ":"ubreve","Û":"Ucirc","û":"ucirc","У":"Ucy","у":"ucy","⇅":"udarr","Ű":"Udblac","ű":"udblac","⥮":"udhar","⥾":"ufisht","𝔘":"Ufr","𝔲":"ufr","Ù":"Ugrave","ù":"ugrave","⥣":"uHar","▀":"uhblk","⌜":"ulcorn","⌏":"ulcrop","◸":"ultri","Ū":"Umacr","ū":"umacr","⏟":"UnderBrace","⏝":"UnderParenthesis","⊎":"uplus","Ų":"Uogon","ų":"uogon","𝕌":"Uopf","𝕦":"uopf","⤒":"UpArrowBar","↕":"varr","υ":"upsi","ϒ":"Upsi","Υ":"Upsilon","⇈":"uuarr","⌝":"urcorn","⌎":"urcrop","Ů":"Uring","ů":"uring","◹":"urtri","𝒰":"Uscr","𝓊":"uscr","⋰":"utdot","Ũ":"Utilde","ũ":"utilde","Ü":"Uuml","ü":"uuml","⦧":"uwangle","⦜":"vangrt","⊊︀":"vsubne","⫋︀":"vsubnE","⊋︀":"vsupne","⫌︀":"vsupnE","⫨":"vBar","⫫":"Vbar","⫩":"vBarv","В":"Vcy","в":"vcy","⊩":"Vdash","⊫":"VDash","⫦":"Vdashl","⊻":"veebar","≚":"veeeq","⋮":"vellip","|":"vert","‖":"Vert","❘":"VerticalSeparator","≀":"wr","𝔙":"Vfr","𝔳":"vfr","𝕍":"Vopf","𝕧":"vopf","𝒱":"Vscr","𝓋":"vscr","⊪":"Vvdash","⦚":"vzigzag","Ŵ":"Wcirc","ŵ":"wcirc","⩟":"wedbar","≙":"wedgeq","℘":"wp","𝔚":"Wfr","𝔴":"wfr","𝕎":"Wopf","𝕨":"wopf","𝒲":"Wscr","𝓌":"wscr","𝔛":"Xfr","𝔵":"xfr","Ξ":"Xi","ξ":"xi","⋻":"xnis","𝕏":"Xopf","𝕩":"xopf","𝒳":"Xscr","𝓍":"xscr","Ý":"Yacute","ý":"yacute","Я":"YAcy","я":"yacy","Ŷ":"Ycirc","ŷ":"ycirc","Ы":"Ycy","ы":"ycy","¥":"yen","𝔜":"Yfr","𝔶":"yfr","Ї":"YIcy","ї":"yicy","𝕐":"Yopf","𝕪":"yopf","𝒴":"Yscr","𝓎":"yscr","Ю":"YUcy","ю":"yucy","ÿ":"yuml","Ÿ":"Yuml","Ź":"Zacute","ź":"zacute","Ž":"Zcaron","ž":"zcaron","З":"Zcy","з":"zcy","Ż":"Zdot","ż":"zdot","ℨ":"Zfr","Ζ":"Zeta","ζ":"zeta","𝔷":"zfr","Ж":"ZHcy","ж":"zhcy","⇝":"zigrarr","𝕫":"zopf","𝒵":"Zscr","𝓏":"zscr","‍":"zwj","‌":"zwnj"},d=/["&'<>`]/g,f={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},p=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,g=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|iacute|Uacute|plusmn|otilde|Otilde|Agrave|agrave|yacute|Yacute|oslash|Oslash|Atilde|atilde|brvbar|Ccedil|ccedil|ograve|curren|divide|Eacute|eacute|Ograve|oacute|Egrave|egrave|ugrave|frac12|frac14|frac34|Ugrave|Oacute|Iacute|ntilde|Ntilde|uacute|middot|Igrave|igrave|iquest|aacute|laquo|THORN|micro|iexcl|icirc|Icirc|Acirc|ucirc|ecirc|Ocirc|ocirc|Ecirc|Ucirc|aring|Aring|aelig|AElig|acute|pound|raquo|acirc|times|thorn|szlig|cedil|COPY|Auml|ordf|ordm|uuml|macr|Uuml|auml|Ouml|ouml|para|nbsp|Euml|quot|QUOT|euml|yuml|cent|sect|copy|sup1|sup2|sup3|Iuml|iuml|shy|eth|reg|not|yen|amp|AMP|REG|uml|ETH|deg|gt|GT|LT|lt)([=a-zA-Z0-9])?/g,m={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅","in":"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺","int":"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉", +napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"},v={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"},b={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},_=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],A=String.fromCharCode,w={},x=w.hasOwnProperty,E=function(t,e){return x.call(t,e)},k=function(t,e){for(var r=-1,n=t.length;++r=55296&&57343>=t||t>1114111?(e&&T("character reference outside the permissible Unicode range"),"�"):E(b,t)?(e&&T("disallowed character reference"),b[t]):(e&&k(_,t)&&T("disallowed character reference"),t>65535&&(t-=65536,r+=A(t>>>10&1023|55296),t=56320|1023&t),r+=A(t))},F=function(t){return"&#x"+t.charCodeAt(0).toString(16).toUpperCase()+";"},T=function(t){throw Error("Parse error: "+t)},S=function(t,e){e=D(e,S.options);var r=e.strict;r&&g.test(t)&&T("forbidden code point");var n=e.encodeEverything,i=e.useNamedReferences,a=e.allowUnsafeSymbols;return n?(t=t.replace(u,function(t){return i&&E(h,t)?"&"+h[t]+";":F(t)}),i&&(t=t.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),i&&(t=t.replace(l,function(t){return"&"+h[t]+";"}))):i?(a||(t=t.replace(d,function(t){return"&"+h[t]+";"})),t=t.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒"),t=t.replace(l,function(t){return"&"+h[t]+";"})):a||(t=t.replace(d,F)),t.replace(o,function(t){var e=t.charCodeAt(0),r=t.charCodeAt(1),n=1024*(e-55296)+r-56320+65536;return"&#x"+n.toString(16).toUpperCase()+";"}).replace(c,F)};S.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1};var B=function(t,e){e=D(e,B.options);var r=e.strict;return r&&p.test(t)&&T("malformed character reference"),t.replace(y,function(t,n,i,a,s,o,u,c){var l,h,d,f,p;return n?(l=n,h=i,r&&!h&&T("character reference was not terminated by a semicolon"),C(l,r)):a?(d=a,h=s,r&&!h&&T("character reference was not terminated by a semicolon"),l=parseInt(d,16),C(l,r)):o?(f=o,E(m,f)?m[f]:(r&&T("named character reference was not terminated by a semicolon"),t)):(f=u,p=c,p&&e.isAttributeValue?(r&&"="==p&&T("`&` did not start a character reference"),t):(r&&T("named character reference was not terminated by a semicolon"),v[f]+(p||"")))})};B.options={isAttributeValue:!1,strict:!1};var L=function(t){return t.replace(d,function(t){return f[t]})},I={version:"0.5.0",encode:S,decode:B,escape:L,unescape:B};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return I});else if(i&&!i.nodeType)if(a)a.exports=I;else for(var O in I)E(I,O)&&(i[O]=I[O]);else n.he=I}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],81:[function(t,e,r){(function(t){(function(){function n(t,e){if(t!==e){var r=null===t,n=t===k,i=t===t,a=null===e,s=e===k,o=e===e;if(t>e&&!a||!i||r&&!s&&o||n&&o)return 1;if(e>t&&!r||!o||a&&!n&&i||s&&i)return-1}return 0}function i(t,e,r){for(var n=t.length,i=r?n:-1;r?i--:++i-1;);return r}function c(t,e){for(var r=t.length;r--&&e.indexOf(t.charAt(r))>-1;);return r}function l(t,e){return n(t.criteria,e.criteria)||t.index-e.index}function h(t,e,r){for(var i=-1,a=t.criteria,s=e.criteria,o=a.length,u=r.length;++i=u)return c;var l=r[i];return c*("asc"===l||l===!0?1:-1)}}return t.index-e.index}function d(t){return Gt[t]}function f(t){return $t[t]}function p(t,e,r){return e?t=zt[t]:r&&(t=Zt[t]),"\\"+t}function g(t){return"\\"+Zt[t]}function y(t,e,r){for(var n=t.length,i=e+(r?0:-1);r?i--:++i=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function b(t,e){for(var r=-1,n=t.length,i=-1,a=[];++re,i=r?t.length:0,a=$r(0,i,this.__views__),s=a.start,o=a.end,u=o-s,c=n?o:s-1,l=this.__iteratees__,h=l.length,d=0,f=ws(u,this.__takeCount__);if(!r||j>i||i==u&&f==u)return rr(n&&r?t.reverse():t,this.__actions__);var p=[];t:for(;u--&&f>d;){c+=e;for(var g=-1,y=t[c];++g=j?pr(e):null,c=e.length;u&&(s=Kt,o=!1,e=u);t:for(;++ir&&(r=-r>i?0:i+r),n=n===k||n>i?i:+n||0,0>n&&(n+=i),i=r>n?0:n>>>0,r>>>=0;i>r;)t[r++]=e;return t}function Ce(t,e){var r=[];return Ns(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r}function Fe(t,e,r,n){var i;return r(t,function(t,r,a){return e(t,r,a)?(i=n?r:t,!1):void 0}),i}function Te(t,e,r,n){n||(n=[]);for(var i=-1,a=t.length;++in;)t=t[e[n++]];return n&&n==i?t:k}}function Ne(t,e,r,n,i,a){return t===e?!0:null==t||null==e||!Oi(t)&&!m(e)?t!==t&&e!==e:Me(t,e,Ne,r,n,i,a)}function Me(t,e,r,n,i,a,s){var o=To(t),u=To(e),c=H,l=H;o||(c=rs.call(t),c==$?c=Q:c!=Q&&(o=Vi(t))),u||(l=rs.call(e),l==$?l=Q:l!=Q&&(u=Vi(e)));var h=c==Q,d=l==Q,f=c==l;if(f&&!o&&!h)return Pr(t,e,c);if(!i){var p=h&&ts.call(t,"__wrapped__"),g=d&&ts.call(e,"__wrapped__");if(p||g)return r(p?t.value():t,g?e.value():e,n,i,a,s)}if(!f)return!1;a||(a=[]),s||(s=[]);for(var y=a.length;y--;)if(a[y]==t)return s[y]==e;a.push(t),s.push(e);var m=(o?Rr:qr)(t,e,r,n,i,a,s);return a.pop(),s.pop(),m}function Re(t,e,r){var n=e.length,i=n,a=!r;if(null==t)return!i;for(t=hn(t);n--;){var s=e[n];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++ne&&(e=-e>i?0:i+e),r=r===k||r>i?i:+r||0,0>r&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=ja(i);++n=j,u=o?pr():null,c=[];u?(n=Kt,s=!1):(o=!1,u=e?[]:c);t:for(;++r=i){for(;i>n;){var a=n+i>>>1,s=t[a];(r?e>=s:e>s)&&null!==s?n=a+1:i=a}return i}return ir(t,e,Ca,r)}function ir(t,e,r,n){e=r(e);for(var i=0,a=t?t.length:0,s=e!==e,o=null===e,u=e===k;a>i;){var c=ms((i+a)/2),l=r(t[c]),h=l!==k,d=l===l;if(s)var f=d||n;else f=o?d&&h&&(n||null!=l):u?d&&(n||h):null==l?!1:n?e>=l:e>l;f?i=c+1:a=c}return ws(a,Ts)}function ar(t,e,r){if("function"!=typeof t)return Ca;if(e===k)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 3:return function(r,n,i){return t.call(e,r,n,i)};case 4:return function(r,n,i,a){return t.call(e,r,n,i,a)};case 5:return function(r,n,i,a,s){return t.call(e,r,n,i,a,s)}}return function(){return t.apply(e,arguments)}}function sr(t){var e=new as(t.byteLength),r=new fs(e);return r.set(new fs(t)),e}function or(t,e,r){for(var n=r.length,i=-1,a=As(t.length-n,0),s=-1,o=e.length,u=ja(o+a);++s2?r[i-2]:k,s=i>2?r[2]:k,o=i>1?r[i-1]:k;for("function"==typeof a?(a=ar(a,o,5),i-=2):(a="function"==typeof o?o:k,i-=a?1:0),s&&Jr(r[0],r[1],s)&&(a=3>i?k:a,i=1);++n-1?r[s]:k}return Fe(r,n,t)}}function Ar(t){return function(e,r,n){return e&&e.length?(r=jr(r,n,3),i(e,r,t)):-1}}function wr(t){return function(e,r,n){return r=jr(r,n,3),Fe(e,r,t,!0)}}function xr(t){return function(){for(var e,r=arguments.length,n=t?r:-1,i=0,a=ja(r);t?n--:++n=j)return e.plant(n).value();for(var i=0,s=r?a[i].apply(this,t):n;++iv){var E=o?te(o):k,D=As(c-v,0),T=p?x:k,S=p?k:x,B=p?A:k,O=p?k:A;e|=p?L:I,e&=~(p?I:L),g||(e&=~(C|F));var N=[t,e,r,B,T,O,S,E,u,D],M=Br.apply(k,N);return tn(t)&&Ys(M,N),M.placeholder=w,M}}var R=d?r:this,P=f?R[t]:t;return o&&(A=un(A,o)),h&&u=e||!bs(e))return"";var i=e-n;return r=null==r?" ":r+"",ya(r,gs(i/r.length)).slice(0,i)}function Ir(t,e,r,n){function i(){for(var e=-1,o=arguments.length,u=-1,c=n.length,l=ja(c+o);++uu))return!1;for(;++o-1&&t%1==0&&e>t}function Jr(t,e,r){if(!Oi(r))return!1;var n=typeof e;if("number"==n?Xr(r)&&Kr(e,r.length):"string"==n&&e in r){var i=r[e];return t===t?t===i:i!==i}return!1}function Qr(t,e){var r=typeof t;if("string"==r&&kt.test(t)||"number"==r)return!0;if(To(t))return!1;var n=!Et.test(t);return n||null!=e&&t in hn(e)}function tn(t){var r=Ur(t);if(!(r in K.prototype))return!1;var n=e[r];if(t===n)return!0;var i=js(n);return!!i&&t===i[0]}function en(t){return"number"==typeof t&&t>-1&&t%1==0&&Bs>=t}function rn(t){return t===t&&!Oi(t)}function nn(t,e){var r=t[1],n=e[1],i=r|n,a=O>i,s=n==O&&r==S||n==O&&r==N&&t[7].length<=e[8]||n==(O|N)&&r==S;if(!a&&!s)return t;n&C&&(t[2]=e[2],i|=r&C?0:T);var o=e[3];if(o){var u=t[3];t[3]=u?or(u,o,e[4]):te(o),t[4]=u?b(t[3],G):te(e[4])}return o=e[5],o&&(u=t[5],t[5]=u?ur(u,o,e[6]):te(o),t[6]=u?b(t[5],G):te(e[6])),o=e[7],o&&(t[7]=te(o)),n&O&&(t[8]=null==t[8]?e[8]:ws(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}function an(t,e){return t===k?e:So(t,e,an)}function sn(t,e){t=hn(t);for(var r=-1,n=e.length,i={};++rn;)s[++a]=ze(t,n,n+=e);return s}function gn(t){for(var e=-1,r=t?t.length:0,n=-1,i=[];++ee?0:e)):[]}function mn(t,e,r){var n=t?t.length:0;return n?((r?Jr(t,e,r):null==e)&&(e=1),e=n-(+e||0),ze(t,0,0>e?0:e)):[]}function vn(t,e,r){return t&&t.length?er(t,jr(e,r,3),!0,!0):[]}function bn(t,e,r){return t&&t.length?er(t,jr(e,r,3),!0):[]}function _n(t,e,r,n){var i=t?t.length:0;return i?(r&&"number"!=typeof r&&Jr(t,e,r)&&(r=0,n=i),De(t,e,r,n)):[]}function An(t){return t?t[0]:k}function wn(t,e,r){var n=t?t.length:0;return r&&Jr(t,e,r)&&(e=!1),n?Te(t,e):[]}function xn(t){var e=t?t.length:0;return e?Te(t,!0):[]}function En(t,e,r){var n=t?t.length:0;if(!n)return-1;if("number"==typeof r)r=0>r?As(n+r,0):r;else if(r){var i=nr(t,e);return n>i&&(e===e?e===t[i]:t[i]!==t[i])?i:-1}return a(t,e,r||0)}function kn(t){return mn(t,1)}function Dn(t){var e=t?t.length:0;return e?t[e-1]:k}function Cn(t,e,r){var n=t?t.length:0;if(!n)return-1;var i=n;if("number"==typeof r)i=(0>r?As(n+r,0):ws(r||0,n-1))+1;else if(r){i=nr(t,e,!0)-1;var a=t[i];return(e===e?e===a:a!==a)?i:-1}if(e!==e)return y(t,i,!0);for(;i--;)if(t[i]===e)return i;return-1}function Fn(){var t=arguments,e=t[0];if(!e||!e.length)return e;for(var r=0,n=Yr(),i=t.length;++r-1;)ds.call(e,a,1);return e}function Tn(t,e,r){var n=[];if(!t||!t.length)return n;var i=-1,a=[],s=t.length;for(e=jr(e,r,3);++ie?0:e)):[]}function In(t,e,r){var n=t?t.length:0;return n?((r?Jr(t,e,r):null==e)&&(e=1),e=n-(+e||0),ze(t,0>e?0:e)):[]}function On(t,e,r){return t&&t.length?er(t,jr(e,r,3),!1,!0):[]}function Nn(t,e,r){return t&&t.length?er(t,jr(e,r,3)):[]}function Mn(t,e,r,n){var i=t?t.length:0;if(!i)return[];null!=e&&"boolean"!=typeof e&&(n=r,r=Jr(t,e,n)?k:e,e=!1);var s=jr();return(null!=r||s!==_e)&&(r=s(r,n,3)),e&&Yr()==a?_(t,r):Qe(t,r)}function Rn(t){if(!t||!t.length)return[];var e=-1,r=0;t=oe(t,function(t){return Xr(t)?(r=As(t.length,r),!0):void 0});for(var n=ja(r);++er?As(i+r,0):r||0,"string"==typeof t||!To(t)&&Yi(t)?i>=r&&t.indexOf(e,r)>-1:!!i&&Yr(t,e,r)>-1}function ti(t,e,r){var n=To(t)?ue:Pe;return e=jr(e,r,3),n(t,e)}function ei(t,e){return ti(t,Ia(e))}function ri(t,e,r){var n=To(t)?oe:Ce;return e=jr(e,r,3),n(t,function(t,r,n){return!e(t,r,n)})}function ni(t,e,r){if(r?Jr(t,e,r):null==e){t=ln(t);var n=t.length;return n>0?t[He(0,n-1)]:k}var i=-1,a=Wi(t),n=a.length,s=n-1;for(e=ws(0>e?0:+e||0,n);++i0&&(r=e.apply(this,arguments)),1>=t&&(e=k),r}}function fi(t,e,r){function n(){f&&ss(f),c&&ss(c),g=0,c=f=p=k}function i(e,r){r&&ss(r),c=f=p=k,e&&(g=go(),l=t.apply(d,u),f||c||(u=d=k))}function a(){var t=e-(go()-h);0>=t||t>e?i(p,c):f=hs(a,t)}function s(){i(m,f)}function o(){if(u=arguments,h=go(),d=this,p=m&&(f||!v),y===!1)var r=v&&!f;else{c||v||(g=h);var n=y-(h-g),i=0>=n||n>y;i?(c&&(c=ss(c)),g=h,l=t.apply(d,u)):c||(c=hs(s,n))}return i&&f?f=ss(f):f||e===y||(f=hs(a,e)),r&&(i=!0,l=t.apply(d,u)),!i||f||c||(u=d=k),l}var u,c,l,h,d,f,p,g=0,y=!1,m=!0;if("function"!=typeof t)throw new Za(V);if(e=0>e?0:+e||0,r===!0){var v=!0;m=!1}else Oi(r)&&(v=!!r.leading,y="maxWait"in r&&As(+r.maxWait||0,e),m="trailing"in r?!!r.trailing:m);return o.cancel=n,o}function pi(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new Za(V);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s),s};return r.cache=new pi.Cache,r}function gi(t){if("function"!=typeof t)throw new Za(V);return function(){return!t.apply(this,arguments)}}function yi(t){return di(2,t)}function mi(t,e){if("function"!=typeof t)throw new Za(V);return e=As(e===k?t.length-1:+e||0,0),function(){for(var r=arguments,n=-1,i=As(r.length-e,0),a=ja(i);++ne}function Ei(t,e){return t>=e}function ki(t){return m(t)&&Xr(t)&&ts.call(t,"callee")&&!cs.call(t,"callee")}function Di(t){return t===!0||t===!1||m(t)&&rs.call(t)==W}function Ci(t){return m(t)&&rs.call(t)==z}function Fi(t){return!!t&&1===t.nodeType&&m(t)&&!ji(t)}function Ti(t){return null==t?!0:Xr(t)&&(To(t)||Yi(t)||ki(t)||m(t)&&Ii(t.splice))?!t.length:!jo(t).length}function Si(t,e,r,n){r="function"==typeof r?ar(r,n,3):k;var i=r?r(t,e):k;return i===k?Ne(t,e,r):!!i}function Bi(t){return m(t)&&"string"==typeof t.message&&rs.call(t)==Z}function Li(t){return"number"==typeof t&&bs(t)}function Ii(t){return Oi(t)&&rs.call(t)==X}function Oi(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Ni(t,e,r,n){return r="function"==typeof r?ar(r,n,3):k,Re(t,Vr(e),r)}function Mi(t){return qi(t)&&t!=+t}function Ri(t){return null==t?!1:Ii(t)?is.test(Qa.call(t)):m(t)&&Ot.test(t)}function Pi(t){return null===t}function qi(t){return"number"==typeof t||m(t)&&rs.call(t)==J}function ji(t){var e;if(!m(t)||rs.call(t)!=Q||ki(t)||!ts.call(t,"constructor")&&(e=t.constructor,"function"==typeof e&&!(e instanceof e)))return!1;var r;return Se(t,function(t,e){r=e}),r===k||ts.call(t,r)}function Ui(t){return Oi(t)&&rs.call(t)==tt}function Yi(t){return"string"==typeof t||m(t)&&rs.call(t)==rt}function Vi(t){return m(t)&&en(t.length)&&!!Yt[rs.call(t)]}function Gi(t){return t===k}function $i(t,e){return e>t}function Hi(t,e){return e>=t}function Wi(t){var e=t?Us(t):0;return en(e)?e?te(t):[]:aa(t)}function zi(t){return be(t,ta(t))}function Zi(t,e,r){var n=Os(t);return r&&Jr(t,e,r)&&(e=k),e?me(n,e):n}function Xi(t){return Ie(t,ta(t))}function Ki(t,e,r){var n=null==t?k:Oe(t,dn(e),e+"");return n===k?r:n}function Ji(t,e){if(null==t)return!1;var r=ts.call(t,e);if(!r&&!Qr(e)){if(e=dn(e),t=1==e.length?t:Oe(t,ze(e,0,-1)),null==t)return!1;e=Dn(e),r=ts.call(t,e)}return r||en(t.length)&&Kr(e,t.length)&&(To(t)||ki(t))}function Qi(t,e,r){r&&Jr(t,e,r)&&(e=k);for(var n=-1,i=jo(t),a=i.length,s={};++n0;++n=ws(e,r)&&tr?0:+r||0,n),r-=e.length,r>=0&&t.indexOf(e,r)==r}function da(t){return t=o(t),t&&_t.test(t)?t.replace(vt,f):t}function fa(t){return t=o(t),t&&Ft.test(t)?t.replace(Ct,p):t||"(?:)"}function pa(t,e,r){t=o(t),e=+e;var n=t.length;if(n>=e||!bs(e))return t;var i=(e-n)/2,a=ms(i),s=gs(i);return r=Lr("",s,r),r.slice(0,a)+t+r}function ga(t,e,r){return(r?Jr(t,e,r):null==e)?e=0:e&&(e=+e),t=ba(t),Es(t,e||(It.test(t)?16:10))}function ya(t,e){var r="";if(t=o(t),e=+e,1>e||!t||!bs(e))return r;do e%2&&(r+=t),e=ms(e/2),t+=t;while(e);return r}function ma(t,e,r){return t=o(t),r=null==r?0:ws(0>r?0:+r||0,t.length),t.lastIndexOf(e,r)==r}function va(t,r,n){var i=e.templateSettings;n&&Jr(t,r,n)&&(r=n=k),t=o(t),r=ye(me({},n||r),i,ge);var a,s,u=ye(me({},r.imports),i.imports,ge),c=jo(u),l=tr(u,c),h=0,d=r.interpolate||Rt,f="__p += '",p=Wa((r.escape||Rt).source+"|"+d.source+"|"+(d===xt?Bt:Rt).source+"|"+(r.evaluate||Rt).source+"|$","g"),y="//# sourceURL="+("sourceURL"in r?r.sourceURL:"lodash.templateSources["+ ++Ut+"]")+"\n";t.replace(p,function(e,r,n,i,o,u){return n||(n=i),f+=t.slice(h,u).replace(Pt,g),r&&(a=!0,f+="' +\n__e("+r+") +\n'"),o&&(s=!0,f+="';\n"+o+";\n__p += '"),n&&(f+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),h=u+e.length,e}),f+="';\n";var m=r.variable;m||(f="with (obj) {\n"+f+"\n}\n"),f=(s?f.replace(pt,""):f).replace(gt,"$1").replace(yt,"$1;"),f="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var v=Ko(function(){return Va(c,y+"return "+f).apply(k,l)});if(v.source=f,Bi(v))throw v;return v}function ba(t,e,r){var n=t;return(t=o(t))?(r?Jr(n,e,r):null==e)?t.slice(A(t),w(t)+1):(e+="",t.slice(u(t,e),c(t,e)+1)):t}function _a(t,e,r){var n=t;return t=o(t),t?t.slice((r?Jr(n,e,r):null==e)?A(t):u(t,e+"")):t}function Aa(t,e,r){var n=t;return t=o(t),t?(r?Jr(n,e,r):null==e)?t.slice(0,w(t)+1):t.slice(0,c(t,e+"")+1):t}function wa(t,e,r){r&&Jr(t,e,r)&&(e=k);var n=M,i=R;if(null!=e)if(Oi(e)){var a="separator"in e?e.separator:a;n="length"in e?+e.length||0:n,i="omission"in e?o(e.omission):i}else n=+e||0;if(t=o(t),n>=t.length)return t;var s=n-i.length;if(1>s)return i;var u=t.slice(0,s);if(null==a)return u+i;if(Ui(a)){if(t.slice(s).search(a)){var c,l,h=t.slice(0,s);for(a.global||(a=Wa(a.source,(Lt.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(h);)l=c.index;u=u.slice(0,null==l?s:l)}}else if(t.indexOf(a,s)!=s){var d=u.lastIndexOf(a);d>-1&&(u=u.slice(0,d))}return u+i}function xa(t){return t=o(t),t&&bt.test(t)?t.replace(mt,x):t}function Ea(t,e,r){return r&&Jr(t,e,r)&&(e=k),t=o(t),t.match(e||qt)||[]}function ka(t,e,r){return r&&Jr(t,e,r)&&(e=k),m(t)?Fa(t):_e(t,e)}function Da(t){return function(){return t}}function Ca(t){return t}function Fa(t){return qe(Ae(t,!0))}function Ta(t,e){return je(t,Ae(e,!0))}function Sa(t,e,r){if(null==r){var n=Oi(e),i=n?jo(e):k,a=i&&i.length?Ie(e,i):k;(a?a.length:n)||(a=!1,r=e,e=t,t=this)}a||(a=Ie(e,jo(e)));var s=!0,o=-1,u=Ii(t),c=a.length;r===!1?s=!1:Oi(r)&&"chain"in r&&(s=r.chain);for(;++ot||!bs(t))return[];var n=-1,i=ja(ws(t,Fs));for(e=ar(e,r,1);++nn?i[n]=e(n):e(n);return i}function Ra(t){var e=++es;return o(t)+e}function Pa(t,e){return(+t||0)+(+e||0)}function qa(t,e,r){return r&&Jr(t,e,r)&&(e=k),e=jr(e,r,3),1==e.length?fe(To(t)?t:ln(t),e):Je(t,e)}t=t?ne.defaults(re.Object(),t,ne.pick(re,jt)):re;{var ja=t.Array,Ua=t.Date,Ya=t.Error,Va=t.Function,Ga=t.Math,$a=t.Number,Ha=t.Object,Wa=t.RegExp,za=t.String,Za=t.TypeError,Xa=ja.prototype,Ka=Ha.prototype,Ja=za.prototype,Qa=Va.prototype.toString,ts=Ka.hasOwnProperty,es=0,rs=Ka.toString,ns=re._,is=Wa("^"+Qa.call(ts).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),as=t.ArrayBuffer,ss=t.clearTimeout,os=t.parseFloat,us=Ga.pow,cs=Ka.propertyIsEnumerable,ls=Gr(t,"Set"),hs=t.setTimeout,ds=Xa.splice,fs=t.Uint8Array,ps=Gr(t,"WeakMap"),gs=Ga.ceil,ys=Gr(Ha,"create"),ms=Ga.floor,vs=Gr(ja,"isArray"),bs=t.isFinite,_s=Gr(Ha,"keys"),As=Ga.max,ws=Ga.min,xs=Gr(Ua,"now"),Es=t.parseInt,ks=Ga.random,Ds=$a.NEGATIVE_INFINITY,Cs=$a.POSITIVE_INFINITY,Fs=4294967295,Ts=Fs-1,Ss=Fs>>>1,Bs=9007199254740991,Ls=ps&&new ps,Is={};e.support={}}e.templateSettings={escape:At,evaluate:wt,interpolate:xt,variable:"",imports:{_:e}};var Os=function(){function t(){}return function(e){if(Oi(e)){t.prototype=e;var r=new t;t.prototype=k}return r||{}}}(),Ns=hr(Be),Ms=hr(Le,!0),Rs=dr(),Ps=dr(!0),qs=Ls?function(t,e){return Ls.set(t,e),t}:Ca,js=Ls?function(t){return Ls.get(t)}:La,Us=Ve("length"),Ys=function(){var t=0,e=0;return function(r,n){var i=go(),a=q-(i-e);if(e=i,a>0){if(++t>=P)return r}else t=0;return qs(r,n)}}(),Vs=mi(function(t,e){return m(t)&&Xr(t)?xe(t,Te(e,!1,!0)):[]}),Gs=Ar(),$s=Ar(!0),Hs=mi(function(t){for(var e=t.length,r=e,n=ja(h),i=Yr(),s=i==a,o=[];r--;){var u=t[r]=Xr(u=t[r])?u:[];n[r]=s&&u.length>=120?pr(r&&u):null}var c=t[0],l=-1,h=c?c.length:0,d=n[0];t:for(;++l2?t[e-2]:k,n=e>1?t[e-1]:k;return e>2&&"function"==typeof r?e-=2:(r=e>1&&"function"==typeof n?(--e,n):k,n=k),t.length=e,Pn(t,r,n)}),to=mi(function(t){return t=Te(t),this.thru(function(e){return Qt(To(e)?e:[hn(e)],t)})}),eo=mi(function(t,e){return ve(t,Te(e))}),ro=cr(function(t,e,r){ts.call(t,r)?++t[r]:t[r]=1}),no=_r(Ns),io=_r(Ms,!0),ao=Er(ee,Ns),so=Er(ie,Ms),oo=cr(function(t,e,r){ts.call(t,r)?t[r].push(e):t[r]=[e]}),uo=cr(function(t,e,r){t[r]=e}),co=mi(function(t,e,r){var n=-1,i="function"==typeof e,a=Qr(e),s=Xr(t)?ja(t.length):[];return Ns(t,function(t){var o=i?e:a&&null!=t?t[e]:k;s[++n]=o?o.apply(t,r):Zr(t,e,r)}),s}),lo=cr(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]}),ho=Sr(le,Ns),fo=Sr(he,Ms),po=mi(function(t,e){if(null==t)return[];var r=e[2];return r&&Jr(e[0],e[1],r)&&(e.length=1),Ke(t,Te(e),[])}),go=xs||function(){return(new Ua).getTime()},yo=mi(function(t,e,r){var n=C;if(r.length){var i=b(r,yo.placeholder);n|=L}return Mr(t,n,e,r,i)}),mo=mi(function(t,e){e=e.length?Te(e):Xi(t);for(var r=-1,n=e.length;++r0||0>e)?new K(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==k&&(e=+e||0,r=0>e?r.dropRight(-e):r.take(e-t)),r)},K.prototype.takeRightWhile=function(t,e){return this.reverse().takeWhile(t,e).reverse()},K.prototype.toArray=function(){return this.take(Cs)},Be(K.prototype,function(t,r){var n=/^(?:filter|map|reject)|While$/.test(r),i=/^(?:first|last)$/.test(r),a=e[i?"take"+("last"==r?"Right":""):r];a&&(e.prototype[r]=function(){var e=i?[1]:arguments,r=this.__chain__,s=this.__wrapped__,o=!!this.__actions__.length,u=s instanceof K,c=e[0],l=u||To(s);l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=function(t){return i&&r?a(t,1)[0]:a.apply(k,ce([t],e))},d={func:Vn,args:[h],thisArg:k},f=u&&!o;if(i&&!r)return f?(s=s.clone(),s.__actions__.push(d),t.call(s)):a.call(k,this.value())[0];if(!i&&l){s=f?s:new K(this);var p=t.apply(s,e);return p.__actions__.push(d),new v(p,r)}return this.thru(h)})}),ee(["join","pop","push","replace","shift","sort","splice","split","unshift"],function(t){var r=(/^(?:replace|split)$/.test(t)?Ja:Xa)[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:join|pop|replace|shift)$/.test(t);e.prototype[t]=function(){var t=arguments;return i&&!this.__chain__?r.apply(this.value(),t):this[n](function(e){return r.apply(e,t)})}}),Be(K.prototype,function(t,r){var n=e[r];if(n){var i=n.name,a=Is[i]||(Is[i]=[]);a.push({name:r,func:n})}}),Is[Br(k,F).name]=[{name:"wrapper",func:k}],K.prototype.clone=et,K.prototype.reverse=nt,K.prototype.value=Gt,e.prototype.chain=Gn,e.prototype.commit=$n,e.prototype.concat=to, +e.prototype.plant=Hn,e.prototype.reverse=Wn,e.prototype.toString=zn,e.prototype.run=e.prototype.toJSON=e.prototype.valueOf=e.prototype.value=Zn,e.prototype.collect=e.prototype.map,e.prototype.head=e.prototype.first,e.prototype.select=e.prototype.filter,e.prototype.tail=e.prototype.rest,e}var k,D="3.10.1",C=1,F=2,T=4,S=8,B=16,L=32,I=64,O=128,N=256,M=30,R="...",P=150,q=16,j=200,U=1,Y=2,V="Expected a function",G="__lodash_placeholder__",$="[object Arguments]",H="[object Array]",W="[object Boolean]",z="[object Date]",Z="[object Error]",X="[object Function]",K="[object Map]",J="[object Number]",Q="[object Object]",tt="[object RegExp]",et="[object Set]",rt="[object String]",nt="[object WeakMap]",it="[object ArrayBuffer]",at="[object Float32Array]",st="[object Float64Array]",ot="[object Int8Array]",ut="[object Int16Array]",ct="[object Int32Array]",lt="[object Uint8Array]",ht="[object Uint8ClampedArray]",dt="[object Uint16Array]",ft="[object Uint32Array]",pt=/\b__p \+= '';/g,gt=/\b(__p \+=) '' \+/g,yt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mt=/&(?:amp|lt|gt|quot|#39|#96);/g,vt=/[&<>"'`]/g,bt=RegExp(mt.source),_t=RegExp(vt.source),At=/<%-([\s\S]+?)%>/g,wt=/<%([\s\S]+?)%>/g,xt=/<%=([\s\S]+?)%>/g,Et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,kt=/^\w*$/,Dt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,Ct=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,Ft=RegExp(Ct.source),Tt=/[\u0300-\u036f\ufe20-\ufe23]/g,St=/\\(\\)?/g,Bt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Lt=/\w*$/,It=/^0[xX]/,Ot=/^\[object .+?Constructor\]$/,Nt=/^\d+$/,Mt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Rt=/($^)/,Pt=/['\n\r\u2028\u2029\\]/g,qt=function(){var t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",e="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(t+"+(?="+t+e+")|"+t+"?"+e+"|"+t+"+|[0-9]+","g")}(),jt=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Ut=-1,Yt={};Yt[at]=Yt[st]=Yt[ot]=Yt[ut]=Yt[ct]=Yt[lt]=Yt[ht]=Yt[dt]=Yt[ft]=!0,Yt[$]=Yt[H]=Yt[it]=Yt[W]=Yt[z]=Yt[Z]=Yt[X]=Yt[K]=Yt[J]=Yt[Q]=Yt[tt]=Yt[et]=Yt[rt]=Yt[nt]=!1;var Vt={};Vt[$]=Vt[H]=Vt[it]=Vt[W]=Vt[z]=Vt[at]=Vt[st]=Vt[ot]=Vt[ut]=Vt[ct]=Vt[J]=Vt[Q]=Vt[tt]=Vt[rt]=Vt[lt]=Vt[ht]=Vt[dt]=Vt[ft]=!0,Vt[Z]=Vt[X]=Vt[K]=Vt[et]=Vt[nt]=!1;var Gt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},$t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ht={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Wt={"function":!0,object:!0},zt={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Zt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Xt=Wt[typeof r]&&r&&!r.nodeType&&r,Kt=Wt[typeof e]&&e&&!e.nodeType&&e,Jt=Xt&&Kt&&"object"==typeof t&&t&&t.Object&&t,Qt=Wt[typeof self]&&self&&self.Object&&self,te=Wt[typeof window]&&window&&window.Object&&window,ee=Kt&&Kt.exports===Xt&&Xt,re=Jt||te!==(this&&this.window)&&te||Qt||this,ne=E();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(re._=ne,define(function(){return ne})):Xt&&Kt?ee?(Kt.exports=ne)._=ne:Xt._=ne:re._=ne}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],82:[function(t,e,r){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?e.exports=n():"function"==typeof define&&define.amd?define(n):t.moment=n()}(this,function(){"use strict";function r(){return Qr.apply(null,arguments)}function n(t){Qr=t}function i(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function a(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function s(t,e){var r,n=[];for(r=0;r0)for(r in tn)n=tn[r],i=e[n],p(i)||(t[n]=i);return t}function y(t){g(this,t),this._d=new Date(null!=t._d?t._d.getTime():0/0),en===!1&&(en=!0,r.updateOffset(this),en=!1)}function m(t){return t instanceof y||null!=t&&null!=t._isAMomentObject}function v(t){return 0>t?Math.ceil(t):Math.floor(t)}function b(t){var e=+t,r=0;return 0!==e&&isFinite(e)&&(r=v(e)),r}function _(t,e,r){var n,i=Math.min(t.length,e.length),a=Math.abs(t.length-e.length),s=0;for(n=0;i>n;n++)(r&&t[n]!==e[n]||!r&&b(t[n])!==b(e[n]))&&s++;return s+a}function A(t){r.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function w(t,e){var r=!0;return u(function(){return r&&(A(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),r=!1),e.apply(this,arguments)},e)}function x(t,e){rn[t]||(A(e),rn[t]=!0)}function E(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function k(t){return"[object Object]"===Object.prototype.toString.call(t)}function D(t){var e,r;for(r in t)e=t[r],E(e)?this[r]=e:this["_"+r]=e;this._config=t,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function C(t,e){var r,n=u({},t);for(r in e)o(e,r)&&(k(t[r])&&k(e[r])?(n[r]={},u(n[r],t[r]),u(n[r],e[r])):null!=e[r]?n[r]=e[r]:delete n[r]);return n}function F(t){null!=t&&this.set(t)}function T(t){return t?t.toLowerCase().replace("_","-"):t}function S(t){for(var e,r,n,i,a=0;a0;){if(n=B(i.slice(0,e).join("-")))return n;if(r&&r.length>=e&&_(i,r,!0)>=e-1)break;e--}a++}return null}function B(r){var n=null;if(!an[r]&&"undefined"!=typeof e&&e&&e.exports)try{n=nn._abbr,t("./locale/"+r),L(n)}catch(i){}return an[r]}function L(t,e){var r;return t&&(r=p(e)?N(t):I(t,e),r&&(nn=r)),nn._abbr}function I(t,e){return null!==e?(e.abbr=t,null!=an[t]?(x("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),e=C(an[t]._config,e)):null!=e.parentLocale&&(null!=an[e.parentLocale]?e=C(an[e.parentLocale]._config,e):x("parentLocaleUndefined","specified parentLocale is not defined yet")),an[t]=new F(e),L(t),an[t]):(delete an[t],null)}function O(t,e){if(null!=e){var r;null!=an[t]&&(e=C(an[t]._config,e)),r=new F(e),r.parentLocale=an[t],an[t]=r,L(t)}else null!=an[t]&&(null!=an[t].parentLocale?an[t]=an[t].parentLocale:null!=an[t]&&delete an[t]);return an[t]}function N(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return nn;if(!i(t)){if(e=B(t))return e;t=[t]}return S(t)}function M(){return Object.keys(an)}function R(t,e){var r=t.toLowerCase();sn[r]=sn[r+"s"]=sn[e]=t}function P(t){return"string"==typeof t?sn[t]||sn[t.toLowerCase()]:void 0}function q(t){var e,r,n={};for(r in t)o(t,r)&&(e=P(r),e&&(n[e]=t[r]));return n}function j(t,e){return function(n){return null!=n?(Y(this,t,n),r.updateOffset(this,e),this):U(this,t)}}function U(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():0/0}function Y(t,e,r){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](r)}function V(t,e){var r;if("object"==typeof t)for(r in t)this.set(r,t[r]);else if(t=P(t),E(this[t]))return this[t](e);return this}function G(t,e,r){var n=""+Math.abs(t),i=e-n.length,a=t>=0;return(a?r?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}function $(t,e,r,n){var i=n;"string"==typeof n&&(i=function(){return this[n]()}),t&&(ln[t]=i),e&&(ln[e[0]]=function(){return G(i.apply(this,arguments),e[1],e[2])}),r&&(ln[r]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function H(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function W(t){var e,r,n=t.match(on);for(e=0,r=n.length;r>e;e++)n[e]=ln[n[e]]?ln[n[e]]:H(n[e]);return function(i){var a="";for(e=0;r>e;e++)a+=n[e]instanceof Function?n[e].call(i,t):n[e];return a}}function z(t,e){return t.isValid()?(e=Z(e,t.localeData()),cn[e]=cn[e]||W(e),cn[e](t)):t.localeData().invalidDate()}function Z(t,e){function r(t){return e.longDateFormat(t)||t}var n=5;for(un.lastIndex=0;n>=0&&un.test(t);)t=t.replace(un,r),un.lastIndex=0,n-=1;return t}function X(t,e,r){Fn[t]=E(e)?e:function(t){return t&&r?r:e}}function K(t,e){return o(Fn,t)?Fn[t](e._strict,e._locale):new RegExp(J(t))}function J(t){return Q(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,r,n,i){return e||r||n||i}))}function Q(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function tt(t,e){var r,n=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(n=function(t,r){r[e]=b(t)}),r=0;rn;n++){if(i=c([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),r||this._monthsParse[n]||(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(a.replace(".",""),"i")),r&&"MMMM"===e&&this._longMonthsParse[n].test(t))return n;if(r&&"MMM"===e&&this._shortMonthsParse[n].test(t))return n;if(!r&&this._monthsParse[n].test(t))return n}}function ot(t,e){var r;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=b(e);else if(e=t.localeData().monthsParse(e),"number"!=typeof e)return t;return r=Math.min(t.date(),nt(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,r),t}function ut(t){return null!=t?(ot(this,t),r.updateOffset(this,!0),this):U(this,"Month")}function ct(){return nt(this.year(),this.month())}function lt(t){return this._monthsParseExact?(o(this,"_monthsRegex")||dt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex}function ht(t){return this._monthsParseExact?(o(this,"_monthsRegex")||dt.call(this),t?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex}function dt(){function t(t,e){return e.length-t.length}var e,r,n=[],i=[],a=[];for(e=0;12>e;e++)r=c([2e3,e]),n.push(this.monthsShort(r,"")),i.push(this.months(r,"")),a.push(this.months(r,"")),a.push(this.monthsShort(r,""));for(n.sort(t),i.sort(t),a.sort(t),e=0;12>e;e++)n[e]=Q(n[e]),i[e]=Q(i[e]),a[e]=Q(a[e]);this._monthsRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")$","i")}function ft(t){var e,r=t._a;return r&&-2===h(t).overflow&&(e=r[Bn]<0||r[Bn]>11?Bn:r[Ln]<1||r[Ln]>nt(r[Sn],r[Bn])?Ln:r[In]<0||r[In]>24||24===r[In]&&(0!==r[On]||0!==r[Nn]||0!==r[Mn])?In:r[On]<0||r[On]>59?On:r[Nn]<0||r[Nn]>59?Nn:r[Mn]<0||r[Mn]>999?Mn:-1,h(t)._overflowDayOfYear&&(Sn>e||e>Ln)&&(e=Ln),h(t)._overflowWeeks&&-1===e&&(e=Rn),h(t)._overflowWeekday&&-1===e&&(e=Pn),h(t).overflow=e),t}function pt(t){var e,r,n,i,a,s,o=t._i,u=Gn.exec(o)||$n.exec(o);if(u){for(h(t).iso=!0,e=0,r=Wn.length;r>e;e++)if(Wn[e][1].exec(u[1])){i=Wn[e][0],n=Wn[e][2]!==!1;break}if(null==i)return void(t._isValid=!1);if(u[3]){for(e=0,r=zn.length;r>e;e++)if(zn[e][1].exec(u[3])){a=(u[2]||" ")+zn[e][0];break}if(null==a)return void(t._isValid=!1)}if(!n&&null!=a)return void(t._isValid=!1);if(u[4]){if(!Hn.exec(u[4]))return void(t._isValid=!1);s="Z"}t._f=i+(a||"")+(s||""),Tt(t)}else t._isValid=!1}function gt(t){var e=Zn.exec(t._i);return null!==e?void(t._d=new Date(+e[1])):(pt(t),void(t._isValid===!1&&(delete t._isValid,r.createFromInputFallback(t))))}function yt(t,e,r,n,i,a,s){var o=new Date(t,e,r,n,i,a,s);return 100>t&&t>=0&&isFinite(o.getFullYear())&&o.setFullYear(t),o}function mt(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function vt(t){return bt(t)?366:365}function bt(t){return t%4===0&&t%100!==0||t%400===0}function _t(){return bt(this.year())}function At(t,e,r){var n=7+e-r,i=(7+mt(t,0,n).getUTCDay()-e)%7;return-i+n-1}function wt(t,e,r,n,i){var a,s,o=(7+r-n)%7,u=At(t,n,i),c=1+7*(e-1)+o+u;return 0>=c?(a=t-1,s=vt(a)+c):c>vt(t)?(a=t+1,s=c-vt(t)):(a=t,s=c),{year:a,dayOfYear:s}}function xt(t,e,r){var n,i,a=At(t.year(),e,r),s=Math.floor((t.dayOfYear()-a-1)/7)+1;return 1>s?(i=t.year()-1,n=s+Et(i,e,r)):s>Et(t.year(),e,r)?(n=s-Et(t.year(),e,r),i=t.year()+1):(i=t.year(),n=s),{week:n,year:i}}function Et(t,e,r){var n=At(t,e,r),i=At(t+1,e,r);return(vt(t)-n+i)/7}function kt(t,e,r){return null!=t?t:null!=e?e:r}function Dt(t){var e=new Date(r.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Ct(t){var e,r,n,i,a=[];if(!t._d){for(n=Dt(t),t._w&&null==t._a[Ln]&&null==t._a[Bn]&&Ft(t),t._dayOfYear&&(i=kt(t._a[Sn],n[Sn]),t._dayOfYear>vt(i)&&(h(t)._overflowDayOfYear=!0),r=mt(i,0,t._dayOfYear),t._a[Bn]=r.getUTCMonth(),t._a[Ln]=r.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=a[e]=n[e];for(;7>e;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[In]&&0===t._a[On]&&0===t._a[Nn]&&0===t._a[Mn]&&(t._nextDay=!0,t._a[In]=0),t._d=(t._useUTC?mt:yt).apply(null,a),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[In]=24)}}function Ft(t){var e,r,n,i,a,s,o,u;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(a=1,s=4,r=kt(e.GG,t._a[Sn],xt(Rt(),1,4).year),n=kt(e.W,1),i=kt(e.E,1),(1>i||i>7)&&(u=!0)):(a=t._locale._week.dow,s=t._locale._week.doy,r=kt(e.gg,t._a[Sn],xt(Rt(),a,s).year),n=kt(e.w,1),null!=e.d?(i=e.d,(0>i||i>6)&&(u=!0)):null!=e.e?(i=e.e+a,(e.e<0||e.e>6)&&(u=!0)):i=a),1>n||n>Et(r,a,s)?h(t)._overflowWeeks=!0:null!=u?h(t)._overflowWeekday=!0:(o=wt(r,n,i,a,s),t._a[Sn]=o.year,t._dayOfYear=o.dayOfYear)}function Tt(t){if(t._f===r.ISO_8601)return void pt(t);t._a=[],h(t).empty=!0;var e,n,i,a,s,o=""+t._i,u=o.length,c=0;for(i=Z(t._f,t._locale).match(on)||[],e=0;e0&&h(t).unusedInput.push(s),o=o.slice(o.indexOf(n)+n.length),c+=n.length),ln[a]?(n?h(t).empty=!1:h(t).unusedTokens.push(a),rt(a,n,t)):t._strict&&!n&&h(t).unusedTokens.push(a);h(t).charsLeftOver=u-c,o.length>0&&h(t).unusedInput.push(o),h(t).bigHour===!0&&t._a[In]<=12&&t._a[In]>0&&(h(t).bigHour=void 0),t._a[In]=St(t._locale,t._a[In],t._meridiem),Ct(t),ft(t)}function St(t,e,r){var n;return null==r?e:null!=t.meridiemHour?t.meridiemHour(e,r):null!=t.isPM?(n=t.isPM(r),n&&12>e&&(e+=12),n||12!==e||(e=0),e):e}function Bt(t){var e,r,n,i,a;if(0===t._f.length)return h(t).invalidFormat=!0,void(t._d=new Date(0/0));for(i=0;ia)&&(n=a,r=e));u(t,r||e)}function Lt(t){if(!t._d){var e=q(t._i);t._a=s([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),Ct(t)}}function It(t){var e=new y(ft(Ot(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Ot(t){var e=t._i,r=t._f;return t._locale=t._locale||N(t._l),null===e||void 0===r&&""===e?f({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),m(e)?new y(ft(e)):(i(r)?Bt(t):r?Tt(t):a(e)?t._d=e:Nt(t),d(t)||(t._d=null),t))}function Nt(t){var e=t._i;void 0===e?t._d=new Date(r.now()):a(e)?t._d=new Date(+e):"string"==typeof e?gt(t):i(e)?(t._a=s(e.slice(0),function(t){return parseInt(t,10)}),Ct(t)):"object"==typeof e?Lt(t):"number"==typeof e?t._d=new Date(e):r.createFromInputFallback(t)}function Mt(t,e,r,n,i){var a={};return"boolean"==typeof r&&(n=r,r=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=r,a._i=t,a._f=e,a._strict=n,It(a)}function Rt(t,e,r,n){return Mt(t,e,r,n,!1)}function Pt(t,e){var r,n;if(1===e.length&&i(e[0])&&(e=e[0]),!e.length)return Rt();for(r=e[0],n=1;nt&&(t=-t,r="-"),r+G(~~(t/60),2)+e+G(~~t%60,2)})}function Gt(t,e){var r=(e||"").match(t)||[],n=r[r.length-1]||[],i=(n+"").match(ti)||["-",0,0],a=+(60*i[1])+b(i[2]);return"+"===i[0]?a:-a}function $t(t,e){var n,i;return e._isUTC?(n=e.clone(),i=(m(t)||a(t)?+t:+Rt(t))-+n,n._d.setTime(+n._d+i),r.updateOffset(n,!1),n):Rt(t).local()}function Ht(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Wt(t,e){var n,i=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=Gt(kn,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&e&&(n=Ht(this)),this._offset=t,this._isUTC=!0,null!=n&&this.add(n,"m"),i!==t&&(!e||this._changeInProgress?le(this,ie(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:Ht(this):null!=t?this:0/0}function zt(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Zt(t){return this.utcOffset(0,t)}function Xt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ht(this),"m")),this}function Kt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Gt(En,this._i)),this}function Jt(t){return this.isValid()?(t=t?Rt(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function Qt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function te(){if(!p(this._isDSTShifted))return this._isDSTShifted;var t={};if(g(t,this),t=Ot(t),t._a){var e=t._isUTC?c(t._a):Rt(t._a);this._isDSTShifted=this.isValid()&&_(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function ee(){return this.isValid()?!this._isUTC:!1}function re(){return this.isValid()?this._isUTC:!1}function ne(){return this.isValid()?this._isUTC&&0===this._offset:!1}function ie(t,e){var r,n,i,a=t,s=null;return Yt(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(a={},e?a[e]=t:a.milliseconds=t):(s=ei.exec(t))?(r="-"===s[1]?-1:1,a={y:0,d:b(s[Ln])*r,h:b(s[In])*r,m:b(s[On])*r,s:b(s[Nn])*r,ms:b(s[Mn])*r}):(s=ri.exec(t))?(r="-"===s[1]?-1:1,a={y:ae(s[2],r),M:ae(s[3],r),w:ae(s[4],r),d:ae(s[5],r),h:ae(s[6],r),m:ae(s[7],r),s:ae(s[8],r)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(i=oe(Rt(a.from),Rt(a.to)),a={},a.ms=i.milliseconds,a.M=i.months),n=new Ut(a),Yt(t)&&o(t,"_locale")&&(n._locale=t._locale),n}function ae(t,e){var r=t&&parseFloat(t.replace(",","."));return(isNaN(r)?0:r)*e}function se(t,e){var r={milliseconds:0,months:0};return r.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(r.months,"M").isAfter(e)&&--r.months,r.milliseconds=+e-+t.clone().add(r.months,"M"),r}function oe(t,e){var r;return t.isValid()&&e.isValid()?(e=$t(e,t),t.isBefore(e)?r=se(t,e):(r=se(e,t),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function ue(t){return 0>t?-1*Math.round(-1*t):Math.round(t)}function ce(t,e){return function(r,n){var i,a;return null===n||isNaN(+n)||(x(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),a=r,r=n,n=a),r="string"==typeof r?+r:r,i=ie(r,n),le(this,i,t),this}}function le(t,e,n,i){var a=e._milliseconds,s=ue(e._days),o=ue(e._months);t.isValid()&&(i=null==i?!0:i,a&&t._d.setTime(+t._d+a*n),s&&Y(t,"Date",U(t,"Date")+s*n),o&&ot(t,U(t,"Month")+o*n),i&&r.updateOffset(t,s||o))}function he(t,e){var r=t||Rt(),n=$t(r,this).startOf("day"),i=this.diff(n,"days",!0),a=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse",s=e&&(E(e[a])?e[a]():e[a]);return this.format(s||this.localeData().calendar(a,this,Rt(r)))}function de(){return new y(this)}function fe(t,e){var r=m(t)?t:Rt(t);return this.isValid()&&r.isValid()?(e=P(p(e)?"millisecond":e),"millisecond"===e?+this>+r:+r<+this.clone().startOf(e)):!1}function pe(t,e){var r=m(t)?t:Rt(t);return this.isValid()&&r.isValid()?(e=P(p(e)?"millisecond":e),"millisecond"===e?+r>+this:+this.clone().endOf(e)<+r):!1}function ge(t,e,r){return this.isAfter(t,r)&&this.isBefore(e,r)}function ye(t,e){var r,n=m(t)?t:Rt(t);return this.isValid()&&n.isValid()?(e=P(e||"millisecond"),"millisecond"===e?+this===+n:(r=+n,+this.clone().startOf(e)<=r&&r<=+this.clone().endOf(e))):!1}function me(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function ve(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function be(t,e,r){var n,i,a,s;return this.isValid()?(n=$t(t,this),n.isValid()?(i=6e4*(n.utcOffset()-this.utcOffset()),e=P(e),"year"===e||"month"===e||"quarter"===e?(s=_e(this,n),"quarter"===e?s/=3:"year"===e&&(s/=12)):(a=this-n,s="second"===e?a/1e3:"minute"===e?a/6e4:"hour"===e?a/36e5:"day"===e?(a-i)/864e5:"week"===e?(a-i)/6048e5:a),r?s:v(s)):0/0):0/0}function _e(t,e){var r,n,i=12*(e.year()-t.year())+(e.month()-t.month()),a=t.clone().add(i,"months");return 0>e-a?(r=t.clone().add(i-1,"months"),n=(e-a)/(a-r)):(r=t.clone().add(i+1,"months"),n=(e-a)/(r-a)),-(i+n)}function Ae(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function we(){var t=this.clone().utc();return 0a&&(e=a),ze.call(this,t,e,r,n,i))}function ze(t,e,r,n,i){var a=wt(t,e,r,n,i),s=mt(a.year,0,a.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}function Ze(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Xe(t){return xt(t,this._week.dow,this._week.doy).week}function Ke(){return this._week.dow}function Je(){return this._week.doy}function Qe(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function tr(t){var e=xt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function er(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function rr(t,e){return i(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]}function nr(t){return this._weekdaysShort[t.day()]}function ir(t){return this._weekdaysMin[t.day()]}function ar(t,e,r){var n,i,a;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;7>n;n++){if(i=Rt([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[n]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(a.replace(".",""),"i")),r&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(r&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(r&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!r&&this._weekdaysParse[n].test(t))return n}}function sr(t){if(!this.isValid())return null!=t?this:0/0;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=er(t,this.localeData()),this.add(t-e,"d")):e}function or(t){if(!this.isValid())return null!=t?this:0/0;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function ur(t){return this.isValid()?null==t?this.day()||7:this.day(this.day()%7?t:t-7):null!=t?this:0/0}function cr(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function lr(){return this.hours()%12||12}function hr(t,e){$(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function dr(t,e){return e._meridiemParse}function fr(t){return"p"===(t+"").toLowerCase().charAt(0)}function pr(t,e,r){return t>11?r?"pm":"PM":r?"am":"AM"}function gr(t,e){e[Mn]=b(1e3*("0."+t))}function yr(){return this._isUTC?"UTC":""}function mr(){return this._isUTC?"Coordinated Universal Time":""}function vr(t){return Rt(1e3*t)}function br(){return Rt.apply(null,arguments).parseZone()}function _r(t,e,r){var n=this._calendar[t];return E(n)?n.call(e,r):n}function Ar(t){var e=this._longDateFormat[t],r=this._longDateFormat[t.toUpperCase()];return e||!r?e:(this._longDateFormat[t]=r.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function wr(){return this._invalidDate}function xr(t){return this._ordinal.replace("%d",t)}function Er(t){return t}function kr(t,e,r,n){var i=this._relativeTime[r];return E(i)?i(t,e,r,n):i.replace(/%d/i,t)}function Dr(t,e){var r=this._relativeTime[t>0?"future":"past"];return E(r)?r(e):r.replace(/%s/i,e)}function Cr(t,e,r,n){var i=N(),a=c().set(n,e);return i[r](a,t)}function Fr(t,e,r,n,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return Cr(t,e,r,i);var a,s=[];for(a=0;n>a;a++)s[a]=Cr(t,a,r,i);return s}function Tr(t,e){return Fr(t,e,"months",12,"month")}function Sr(t,e){return Fr(t,e,"monthsShort",12,"month")}function Br(t,e){return Fr(t,e,"weekdays",7,"day")}function Lr(t,e){return Fr(t,e,"weekdaysShort",7,"day")}function Ir(t,e){return Fr(t,e,"weekdaysMin",7,"day")}function Or(){var t=this._data;return this._milliseconds=Di(this._milliseconds),this._days=Di(this._days),this._months=Di(this._months),t.milliseconds=Di(t.milliseconds),t.seconds=Di(t.seconds),t.minutes=Di(t.minutes),t.hours=Di(t.hours),t.months=Di(t.months),t.years=Di(t.years),this}function Nr(t,e,r,n){var i=ie(e,r);return t._milliseconds+=n*i._milliseconds,t._days+=n*i._days,t._months+=n*i._months,t._bubble()}function Mr(t,e){return Nr(this,t,e,1)}function Rr(t,e){return Nr(this,t,e,-1)}function Pr(t){return 0>t?Math.floor(t):Math.ceil(t)}function qr(){var t,e,r,n,i,a=this._milliseconds,s=this._days,o=this._months,u=this._data;return a>=0&&s>=0&&o>=0||0>=a&&0>=s&&0>=o||(a+=864e5*Pr(Ur(o)+s),s=0,o=0),u.milliseconds=a%1e3,t=v(a/1e3),u.seconds=t%60,e=v(t/60),u.minutes=e%60,r=v(e/60),u.hours=r%24,s+=v(r/24),i=v(jr(s)),o+=i,s-=Pr(Ur(i)),n=v(o/12),o%=12,u.days=s,u.months=o,u.years=n,this}function jr(t){return 4800*t/146097}function Ur(t){return 146097*t/4800}function Yr(t){var e,r,n=this._milliseconds;if(t=P(t),"month"===t||"year"===t)return e=this._days+n/864e5,r=this._months+jr(e),"month"===t?r:r/12;switch(e=this._days+Math.round(Ur(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}}function Vr(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*b(this._months/12)}function Gr(t){return function(){return this.as(t)}}function $r(t){return t=P(t),this[t+"s"]()}function Hr(t){ +return function(){return this._data[t]}}function Wr(){return v(this.days()/7)}function zr(t,e,r,n,i){return i.relativeTime(e||1,!!r,t,n)}function Zr(t,e,r){var n=ie(t).abs(),i=Yi(n.as("s")),a=Yi(n.as("m")),s=Yi(n.as("h")),o=Yi(n.as("d")),u=Yi(n.as("M")),c=Yi(n.as("y")),l=i=a&&["m"]||a=s&&["h"]||s=o&&["d"]||o=u&&["M"]||u=c&&["y"]||["yy",c];return l[2]=e,l[3]=+t>0,l[4]=r,zr.apply(null,l)}function Xr(t,e){return void 0===Vi[t]?!1:void 0===e?Vi[t]:(Vi[t]=e,!0)}function Kr(t){var e=this.localeData(),r=Zr(this,!t,e);return t&&(r=e.pastFuture(+this,r)),e.postformat(r)}function Jr(){var t,e,r,n=Gi(this._milliseconds)/1e3,i=Gi(this._days),a=Gi(this._months);t=v(n/60),e=v(t/60),n%=60,t%=60,r=v(a/12),a%=12;var s=r,o=a,u=i,c=e,l=t,h=n,d=this.asSeconds();return d?(0>d?"-":"")+"P"+(s?s+"Y":"")+(o?o+"M":"")+(u?u+"D":"")+(c||l||h?"T":"")+(c?c+"H":"")+(l?l+"M":"")+(h?h+"S":""):"P0D"}var Qr,tn=r.momentProperties=[],en=!1,rn={};r.suppressDeprecationWarnings=!1;var nn,an={},sn={},on=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,un=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,cn={},ln={},hn=/\d/,dn=/\d\d/,fn=/\d{3}/,pn=/\d{4}/,gn=/[+-]?\d{6}/,yn=/\d\d?/,mn=/\d\d\d\d?/,vn=/\d\d\d\d\d\d?/,bn=/\d{1,3}/,_n=/\d{1,4}/,An=/[+-]?\d{1,6}/,wn=/\d+/,xn=/[+-]?\d+/,En=/Z|[+-]\d\d:?\d\d/gi,kn=/Z|[+-]\d\d(?::?\d\d)?/gi,Dn=/[+-]?\d+(\.\d{1,3})?/,Cn=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Fn={},Tn={},Sn=0,Bn=1,Ln=2,In=3,On=4,Nn=5,Mn=6,Rn=7,Pn=8;$("M",["MM",2],"Mo",function(){return this.month()+1}),$("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),$("MMMM",0,0,function(t){return this.localeData().months(this,t)}),R("month","M"),X("M",yn),X("MM",yn,dn),X("MMM",function(t,e){return e.monthsShortRegex(t)}),X("MMMM",function(t,e){return e.monthsRegex(t)}),tt(["M","MM"],function(t,e){e[Bn]=b(t)-1}),tt(["MMM","MMMM"],function(t,e,r,n){var i=r._locale.monthsParse(t,n,r._strict);null!=i?e[Bn]=i:h(r).invalidMonth=t});var qn=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,jn="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Un="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Yn=Cn,Vn=Cn,Gn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,$n=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Hn=/Z|[+-]\d\d(?::?\d\d)?/,Wn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],zn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Zn=/^\/?Date\((\-?\d+)/i;r.createFromInputFallback=w("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),$("Y",0,0,function(){var t=this.year();return 9999>=t?""+t:"+"+t}),$(0,["YY",2],0,function(){return this.year()%100}),$(0,["YYYY",4],0,"year"),$(0,["YYYYY",5],0,"year"),$(0,["YYYYYY",6,!0],0,"year"),R("year","y"),X("Y",xn),X("YY",yn,dn),X("YYYY",_n,pn),X("YYYYY",An,gn),X("YYYYYY",An,gn),tt(["YYYYY","YYYYYY"],Sn),tt("YYYY",function(t,e){e[Sn]=2===t.length?r.parseTwoDigitYear(t):b(t)}),tt("YY",function(t,e){e[Sn]=r.parseTwoDigitYear(t)}),tt("Y",function(t,e){e[Sn]=parseInt(t,10)}),r.parseTwoDigitYear=function(t){return b(t)+(b(t)>68?1900:2e3)};var Xn=j("FullYear",!1);r.ISO_8601=function(){};var Kn=w("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Rt.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:f()}),Jn=w("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Rt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:f()}),Qn=function(){return Date.now?Date.now():+new Date};Vt("Z",":"),Vt("ZZ",""),X("Z",kn),X("ZZ",kn),tt(["Z","ZZ"],function(t,e,r){r._useUTC=!0,r._tzm=Gt(kn,t)});var ti=/([\+\-]|\d\d)/gi;r.updateOffset=function(){};var ei=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,ri=/^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/;ie.fn=Ut.prototype;var ni=ce(1,"add"),ii=ce(-1,"subtract");r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var ai=w("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});$(0,["gg",2],0,function(){return this.weekYear()%100}),$(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ye("gggg","weekYear"),Ye("ggggg","weekYear"),Ye("GGGG","isoWeekYear"),Ye("GGGGG","isoWeekYear"),R("weekYear","gg"),R("isoWeekYear","GG"),X("G",xn),X("g",xn),X("GG",yn,dn),X("gg",yn,dn),X("GGGG",_n,pn),X("gggg",_n,pn),X("GGGGG",An,gn),X("ggggg",An,gn),et(["gggg","ggggg","GGGG","GGGGG"],function(t,e,r,n){e[n.substr(0,2)]=b(t)}),et(["gg","GG"],function(t,e,n,i){e[i]=r.parseTwoDigitYear(t)}),$("Q",0,"Qo","quarter"),R("quarter","Q"),X("Q",hn),tt("Q",function(t,e){e[Bn]=3*(b(t)-1)}),$("w",["ww",2],"wo","week"),$("W",["WW",2],"Wo","isoWeek"),R("week","w"),R("isoWeek","W"),X("w",yn),X("ww",yn,dn),X("W",yn),X("WW",yn,dn),et(["w","ww","W","WW"],function(t,e,r,n){e[n.substr(0,1)]=b(t)});var si={dow:0,doy:6};$("D",["DD",2],"Do","date"),R("date","D"),X("D",yn),X("DD",yn,dn),X("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),tt(["D","DD"],Ln),tt("Do",function(t,e){e[Ln]=b(t.match(yn)[0],10)});var oi=j("Date",!0);$("d",0,"do","day"),$("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),$("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),$("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),$("e",0,0,"weekday"),$("E",0,0,"isoWeekday"),R("day","d"),R("weekday","e"),R("isoWeekday","E"),X("d",yn),X("e",yn),X("E",yn),X("dd",Cn),X("ddd",Cn),X("dddd",Cn),et(["dd","ddd","dddd"],function(t,e,r,n){var i=r._locale.weekdaysParse(t,n,r._strict);null!=i?e.d=i:h(r).invalidWeekday=t}),et(["d","e","E"],function(t,e,r,n){e[n]=b(t)});var ui="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ci="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),li="Su_Mo_Tu_We_Th_Fr_Sa".split("_");$("DDD",["DDDD",3],"DDDo","dayOfYear"),R("dayOfYear","DDD"),X("DDD",bn),X("DDDD",fn),tt(["DDD","DDDD"],function(t,e,r){r._dayOfYear=b(t)}),$("H",["HH",2],0,"hour"),$("h",["hh",2],0,lr),$("hmm",0,0,function(){return""+lr.apply(this)+G(this.minutes(),2)}),$("hmmss",0,0,function(){return""+lr.apply(this)+G(this.minutes(),2)+G(this.seconds(),2)}),$("Hmm",0,0,function(){return""+this.hours()+G(this.minutes(),2)}),$("Hmmss",0,0,function(){return""+this.hours()+G(this.minutes(),2)+G(this.seconds(),2)}),hr("a",!0),hr("A",!1),R("hour","h"),X("a",dr),X("A",dr),X("H",yn),X("h",yn),X("HH",yn,dn),X("hh",yn,dn),X("hmm",mn),X("hmmss",vn),X("Hmm",mn),X("Hmmss",vn),tt(["H","HH"],In),tt(["a","A"],function(t,e,r){r._isPm=r._locale.isPM(t),r._meridiem=t}),tt(["h","hh"],function(t,e,r){e[In]=b(t),h(r).bigHour=!0}),tt("hmm",function(t,e,r){var n=t.length-2;e[In]=b(t.substr(0,n)),e[On]=b(t.substr(n)),h(r).bigHour=!0}),tt("hmmss",function(t,e,r){var n=t.length-4,i=t.length-2;e[In]=b(t.substr(0,n)),e[On]=b(t.substr(n,2)),e[Nn]=b(t.substr(i)),h(r).bigHour=!0}),tt("Hmm",function(t,e){var r=t.length-2;e[In]=b(t.substr(0,r)),e[On]=b(t.substr(r))}),tt("Hmmss",function(t,e){var r=t.length-4,n=t.length-2;e[In]=b(t.substr(0,r)),e[On]=b(t.substr(r,2)),e[Nn]=b(t.substr(n))});var hi=/[ap]\.?m?\.?/i,di=j("Hours",!0);$("m",["mm",2],0,"minute"),R("minute","m"),X("m",yn),X("mm",yn,dn),tt(["m","mm"],On);var fi=j("Minutes",!1);$("s",["ss",2],0,"second"),R("second","s"),X("s",yn),X("ss",yn,dn),tt(["s","ss"],Nn);var pi=j("Seconds",!1);$("S",0,0,function(){return~~(this.millisecond()/100)}),$(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),$(0,["SSS",3],0,"millisecond"),$(0,["SSSS",4],0,function(){return 10*this.millisecond()}),$(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),$(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),$(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),$(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),$(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),R("millisecond","ms"),X("S",bn,hn),X("SS",bn,dn),X("SSS",bn,fn);var gi;for(gi="SSSS";gi.length<=9;gi+="S")X(gi,wn);for(gi="S";gi.length<=9;gi+="S")tt(gi,gr);var yi=j("Milliseconds",!1);$("z",0,0,"zoneAbbr"),$("zz",0,0,"zoneName");var mi=y.prototype;mi.add=ni,mi.calendar=he,mi.clone=de,mi.diff=be,mi.endOf=Be,mi.format=xe,mi.from=Ee,mi.fromNow=ke,mi.to=De,mi.toNow=Ce,mi.get=V,mi.invalidAt=je,mi.isAfter=fe,mi.isBefore=pe,mi.isBetween=ge,mi.isSame=ye,mi.isSameOrAfter=me,mi.isSameOrBefore=ve,mi.isValid=Pe,mi.lang=ai,mi.locale=Fe,mi.localeData=Te,mi.max=Jn,mi.min=Kn,mi.parsingFlags=qe,mi.set=V,mi.startOf=Se,mi.subtract=ii,mi.toArray=Ne,mi.toObject=Me,mi.toDate=Oe,mi.toISOString=we,mi.toJSON=Re,mi.toString=Ae,mi.unix=Ie,mi.valueOf=Le,mi.creationData=Ue,mi.year=Xn,mi.isLeapYear=_t,mi.weekYear=Ve,mi.isoWeekYear=Ge,mi.quarter=mi.quarters=Ze,mi.month=ut,mi.daysInMonth=ct,mi.week=mi.weeks=Qe,mi.isoWeek=mi.isoWeeks=tr,mi.weeksInYear=He,mi.isoWeeksInYear=$e,mi.date=oi,mi.day=mi.days=sr,mi.weekday=or,mi.isoWeekday=ur,mi.dayOfYear=cr,mi.hour=mi.hours=di,mi.minute=mi.minutes=fi,mi.second=mi.seconds=pi,mi.millisecond=mi.milliseconds=yi,mi.utcOffset=Wt,mi.utc=Zt,mi.local=Xt,mi.parseZone=Kt,mi.hasAlignedHourOffset=Jt,mi.isDST=Qt,mi.isDSTShifted=te,mi.isLocal=ee,mi.isUtcOffset=re,mi.isUtc=ne,mi.isUTC=ne,mi.zoneAbbr=yr,mi.zoneName=mr,mi.dates=w("dates accessor is deprecated. Use date instead.",oi),mi.months=w("months accessor is deprecated. Use month instead",ut),mi.years=w("years accessor is deprecated. Use year instead",Xn),mi.zone=w("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",zt);var vi=mi,bi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},_i={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Ai="Invalid date",wi="%d",xi=/\d{1,2}/,Ei={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ki=F.prototype;ki._calendar=bi,ki.calendar=_r,ki._longDateFormat=_i,ki.longDateFormat=Ar,ki._invalidDate=Ai,ki.invalidDate=wr,ki._ordinal=wi,ki.ordinal=xr,ki._ordinalParse=xi,ki.preparse=Er,ki.postformat=Er,ki._relativeTime=Ei,ki.relativeTime=kr,ki.pastFuture=Dr,ki.set=D,ki.months=it,ki._months=jn,ki.monthsShort=at,ki._monthsShort=Un,ki.monthsParse=st,ki._monthsRegex=Vn,ki.monthsRegex=ht,ki._monthsShortRegex=Yn,ki.monthsShortRegex=lt,ki.week=Xe,ki._week=si,ki.firstDayOfYear=Je,ki.firstDayOfWeek=Ke,ki.weekdays=rr,ki._weekdays=ui,ki.weekdaysMin=ir,ki._weekdaysMin=li,ki.weekdaysShort=nr,ki._weekdaysShort=ci,ki.weekdaysParse=ar,ki.isPM=fr,ki._meridiemParse=hi,ki.meridiem=pr,L("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,r=1===b(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+r}}),r.lang=w("moment.lang is deprecated. Use moment.locale instead.",L),r.langData=w("moment.langData is deprecated. Use moment.localeData instead.",N);var Di=Math.abs,Ci=Gr("ms"),Fi=Gr("s"),Ti=Gr("m"),Si=Gr("h"),Bi=Gr("d"),Li=Gr("w"),Ii=Gr("M"),Oi=Gr("y"),Ni=Hr("milliseconds"),Mi=Hr("seconds"),Ri=Hr("minutes"),Pi=Hr("hours"),qi=Hr("days"),ji=Hr("months"),Ui=Hr("years"),Yi=Math.round,Vi={s:45,m:45,h:22,d:26,M:11},Gi=Math.abs,$i=Ut.prototype;$i.abs=Or,$i.add=Mr,$i.subtract=Rr,$i.as=Yr,$i.asMilliseconds=Ci,$i.asSeconds=Fi,$i.asMinutes=Ti,$i.asHours=Si,$i.asDays=Bi,$i.asWeeks=Li,$i.asMonths=Ii,$i.asYears=Oi,$i.valueOf=Vr,$i._bubble=qr,$i.get=$r,$i.milliseconds=Ni,$i.seconds=Mi,$i.minutes=Ri,$i.hours=Pi,$i.days=qi,$i.weeks=Wr,$i.months=ji,$i.years=Ui,$i.humanize=Kr,$i.toISOString=Jr,$i.toString=Jr,$i.toJSON=Jr,$i.locale=Fe,$i.localeData=Te,$i.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Jr),$i.lang=ai,$("X",0,0,"unix"),$("x",0,0,"valueOf"),X("x",xn),X("X",Dn),tt("X",function(t,e,r){r._d=new Date(1e3*parseFloat(t,10))}),tt("x",function(t,e,r){r._d=new Date(b(t))}),r.version="2.12.0",n(Rt),r.fn=vi,r.min=qt,r.max=jt,r.now=Qn,r.utc=c,r.unix=vr,r.months=Tr,r.isDate=a,r.locale=L,r.invalid=f,r.duration=ie,r.isMoment=m,r.weekdays=Br,r.parseZone=br,r.localeData=N,r.isDuration=Yt,r.monthsShort=Sr,r.weekdaysMin=Ir,r.defineLocale=I,r.updateLocale=O,r.locales=M,r.weekdaysShort=Lr,r.normalizeUnits=P,r.relativeTimeThreshold=Xr,r.prototype=vi;var Hi=r;return Hi})},{}],83:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;a--){var s=a>=0?arguments[a]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,i="/"===s.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),a="/"===s(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),a=n(e.split("/")),s=Math.min(i.length,a.length),o=s,u=0;s>u;u++)if(i[u]!==a[u]){o=u;break}for(var c=[],u=o;ue&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:84}],84:[function(t,e){function r(){}var n=e.exports={};n.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.MutationObserver,r="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};var n=[];if(e){var i=document.createElement("div"),a=new MutationObserver(function(){var t=n.slice();n.length=0,t.forEach(function(t){t()})});return a.observe(i,{attributes:!0}),function(t){n.length||i.setAttribute("yes","no"),n.push(t)}}return r?(window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.on=r,n.addListener=r,n.once=r,n.off=r,n.removeListener=r,n.removeAllListeners=r,n.emit=r,n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},{}],85:[function(t,e){e.exports={name:"mermaid",version:"0.5.8",description:"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams and gantt charts.",main:"src/mermaid.js",keywords:["diagram","markdown","flowchart","sequence diagram","gantt"],bin:{mermaid:"./bin/mermaid.js"},scripts:{live:"live-server ./test/examples",lint:"node node_modules/eslint/bin/eslint.js src",jison:"gulp jison_legacy",karma:"node node_modules/karma/bin/karma start karma.conf.js --single-run",watch:"source ./scripts/watch.sh",doc:"rm -r build;rm -r dist/www;gulp vartree;cp dist/www/all.html ../mermaid-pages/index.html;cp dist/mermaid.js ../mermaid-pages/javascripts/lib;cp dist/mermaid.forest.css ../mermaid-pages/stylesheets",tape:"node node_modules/tape/bin/tape test/cli_test-*.js",jasmine:"npm run jison &&node node_modules/jasmine-es6/bin/jasmine.js",pretest:"npm run jison",test:"npm run dist && npm run karma && npm run tape","dist-slim-mermaid":"node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.slim.js -x d3 && cat dist/mermaid.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.slim.min.js","dist-slim-mermaidAPI":"node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.slim.js -x d3 && cat dist/mermaidAPI.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.slim.min.js","dist-mermaid":"node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.js && cat dist/mermaid.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.min.js","dist-mermaidAPI":"node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.js && cat dist/mermaidAPI.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.min.js",dist:"npm run dist-slim-mermaid && npm run dist-slim-mermaidAPI && npm run dist-mermaid && npm run dist-mermaidAPI"},repository:{type:"git",url:"https://github.com/knsv/mermaid"},author:"Knut Sveidqvist",license:"MIT",dependencies:{chalk:"^0.5.1",d3:"3.5.6",dagre:"^0.7.4","dagre-d3":"0.4.10",he:"^0.5.0",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.9.0",semver:"^4.1.1",which:"^1.0.8"},devDependencies:{async:"^0.9.0","babel-eslint":"^4.1.3",babelify:"^6.4.0",browserify:"~6.2.0",clone:"^0.2.0","codeclimate-test-reporter":"0.0.4",dateformat:"^1.0.11",dox:"^0.8.0",eslint:"^1.6.0","eslint-watch":"^2.1.2","event-stream":"^3.2.0",foundation:"^4.2.1-1","front-matter":"^0.2.0",gulp:"~3.9.0","gulp-bower":"0.0.10","gulp-browserify":"^0.5.0","gulp-bump":"^0.1.11","gulp-concat":"~2.4.1","gulp-data":"^1.1.1","gulp-dox":"^0.1.6","gulp-ext-replace":"^0.2.0","gulp-filelog":"^0.4.1","gulp-front-matter":"^1.2.3","gulp-hogan":"^1.1.0","gulp-if":"^1.2.5","gulp-insert":"^0.4.0","gulp-istanbul":"^0.4.0","gulp-jasmine":"~2.1.0","gulp-jasmine-browser":"^0.2.3","gulp-jison":"~1.2.0","gulp-jshint":"^1.9.0","gulp-less":"^3.0.1","gulp-livereload":"^3.8.0","gulp-marked":"^1.0.0","gulp-mdvars":"^2.0.0","gulp-qunit":"~1.2.1","gulp-rename":"~1.2.0","gulp-shell":"^0.2.10","gulp-tag-version":"^1.2.1","gulp-uglify":"~1.0.1","gulp-util":"^3.0.7","gulp-vartree":"^2.0.1","hogan.js":"^3.0.2",jasmine:"2.3.2","jasmine-es6":"0.0.18",jison:"zaach/jison",jsdom:"^7.0.2","jshint-stylish":"^2.0.1",karma:"^0.13.15","karma-babel-preprocessor":"^6.0.1","karma-browserify":"^4.4.0","karma-jasmine":"^0.3.6","karma-phantomjs-launcher":"^0.2.1","live-server":"^0.9.0","map-stream":"0.0.6",marked:"^0.3.2","mock-browser":"^0.91.34",path:"^0.4.9",phantomjs:"^2.1.3",proxyquire:"^1.7.3","proxyquire-universal":"^1.0.8",proxyquireify:"^3.0.0","require-dir":"^0.3.0",rewire:"^2.1.3",rimraf:"^2.2.8",tape:"^3.0.3",testdom:"^2.0.0",uglifyjs:"^2.4.10","vinyl-source-stream":"^1.1.0",watchify:"^3.6.1"}}},{}],86:[function(t,e){"use strict";var r;if(t)try{r=t("d3")}catch(n){}r||(r=window.d3),e.exports=r,function(){var t=!1;if(t="tspans",r.selection.prototype.textwrap)return!1;if("undefined"==typeof t)var t=!1;r.selection.prototype.textwrap=r.selection.enter.prototype.textwrap=function(e,n){var i,n=parseInt(n)||0,a=this,s=function(t){var e=t[0][0],n=e.tagName.toString();if("rect"!==n)return!1;var i={};return i.x=r.select(e).attr("x")||0,i.y=r.select(e).attr("y")||0,i.width=r.select(e).attr("width")||0,i.height=r.select(e).attr("height")||0,i.attr=t.attr,i},o=function(t){if(t.attr||(t.attr=function(t){return this[t]?this[t]:void 0}),"object"==typeof t&&"undefined"!=typeof t.x&&"undefined"!=typeof t.y&&"undefined"!=typeof t.width&&"undefined"!=typeof t.height)return t;if("function"==typeof Array.isArray&&Array.isArray(t)||"[object Array]"===Object.prototype.toString.call(t)){var e=s(t);return e}return!1},u=function(t,e){var r=t;return 0!==e&&(r.x=parseInt(r.x)+e,r.y=parseInt(r.y)+e,r.width-=2*e,r.height-=2*e),r},c=o(e);if(n&&(c=u(c,n)),0!=a.length&&r&&e&&c){e=c;var l,h=function(t){var n=r.select(t[0].parentNode),a=n.select("text"),s=a.style("line-height"),o=a.text();a.remove();var u=n.append("foreignObject");u.attr("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility").attr("x",e.x).attr("y",e.y).attr("width",e.width).attr("height",e.height);var c=u.append("xhtml:div").attr("class","wrapped");c.style("height",e.height).style("width",e.width).html(o),s&&c.style("line-height",s),i=n.select("foreignObject")},d=function(t){var a,s=t[0],o=s.parentNode,u=r.select(s),c=s.getBBox().height,l=s.getBBox().width,h=c,d=u.style("line-height");if(a=d&&parseInt(d)?parseInt(d.replace("px","")):h,l>e.width){var f=u.text();if(u.text(""),f){var p,g;if(-1!==f.indexOf(" ")){var p=" ";g=f.split(" ")}else{p="";var y=f.length,m=Math.ceil(l/e.width),v=Math.floor(y/m);v*m>=y||m++;for(var b,_,g=[],A=0;m>A;A++)_=A*v,b=f.substr(_,v),g.push(b)}for(var w=[],x=0,E={},A=0;Ae.width&&C&&""!==C&&(x+=F,E={string:C,width:F,offset:x},w.push(E),u.text(""),u.text(D),A==g.length-1&&(k=D,u.text(k),T=s.getComputedTextLength())),A==g.length-1){u.text("");var S=k;S&&""!==S&&(T-x>0&&(T-=x),E={string:S,width:T,offset:x},w.push(E))}}var B;u.text("");for(var A=0;A0){w[A-1]}A*a0?a:void 0}),B.attr("x",function(){var t=e.x;return n&&(t+=n),t}))}}}u.attr("y",function(){var t=e.y;return a&&(t+=a),n&&(t+=n),t}),u.attr("x",function(){var t=e.x;return n&&(t+=n),t}),i=r.select(o).selectAll("text")};t&&("foreignobjects"==t?l=h:"tspans"==t&&(l=d)),t||(l="undefined"!=typeof SVGForeignObjectElement?h:d);for(var f=0;f "+t.w+": "+JSON.stringify(s.edge(t))),p(i,s.edge(t),s.edge(t).relation)}),i.attr("height","100%"),i.attr("width","100%")}},{"../../d3":86,"../../logger":105,"./classDb":87,"./parser/classDiagram":89,dagre:30}],89:[function(t,e,r){(function(n){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r},r=[1,11],n=[1,12],i=[1,13],a=[1,15],s=[1,16],o=[1,17],u=[6,8],c=[1,26],l=[1,27],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[6,8,13,17,23,26,27,28,29,30,31],y=[6,8,13,17,23,26,27,28,29,30,31,45,46,47],m=[23,45,46,47],v=[23,30,31,45,46,47],b=[23,26,27,28,29,45,46,47],_=[6,8,13],A=[1,46],w={trace:function(){},yy:{},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},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"},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]], +performAction:function(t,e,r,n,i,a){var s=a.length-1;switch(i){case 5:this.$=a[s-1]+a[s];break;case 6:this.$=a[s];break;case 7:n.addRelation(a[s]);break;case 8:a[s-1].title=n.cleanupLabel(a[s]),n.addRelation(a[s-1]);break;case 12:n.addMembers(a[s-3],a[s-1]);break;case 13:this.$=[a[s]];break;case 14:a[s].push(a[s-1]),this.$=a[s];break;case 15:break;case 16:n.addMembers(a[s-1],n.cleanupLabel(a[s]));break;case 17:console.warn("Member",a[s]);break;case 18:break;case 19:this.$={id1:a[s-2],id2:a[s],relation:a[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 20:this.$={id1:a[s-3],id2:a[s],relation:a[s-1],relationTitle1:a[s-2],relationTitle2:"none"};break;case 21:this.$={id1:a[s-3],id2:a[s],relation:a[s-2],relationTitle1:"none",relationTitle2:a[s-1]};break;case 22:this.$={id1:a[s-4],id2:a[s],relation:a[s-2],relationTitle1:a[s-3],relationTitle2:a[s-1]};break;case 23:this.$={type1:a[s-2],type2:a[s],lineType:a[s-1]};break;case 24:this.$={type1:"none",type2:a[s],lineType:a[s-1]};break;case 25:this.$={type1:a[s-1],type2:"none",lineType:a[s]};break;case 26:this.$={type1:"none",type2:"none",lineType:a[s]};break;case 27:this.$=n.relationType.AGGREGATION;break;case 28:this.$=n.relationType.EXTENSION;break;case 29:this.$=n.relationType.COMPOSITION;break;case 30:this.$=n.relationType.DEPENDENCY;break;case 31:this.$=n.lineType.LINE;break;case 32:this.$=n.lineType.DOTTED_LINE}},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:r,20:n,21:i,45:a,46:s,47:o},{8:[1,18]},{6:[1,19],8:[2,3]},e(u,[2,7],{13:[1,20]}),e(u,[2,9]),e(u,[2,10]),e(u,[2,15],{22:21,24:24,25:25,13:[1,23],23:[1,22],26:c,27:l,28:h,29:d,30:f,31:p}),{10:32,11:14,45:a,46:s,47:o},e(u,[2,17]),e(u,[2,18]),e(g,[2,6],{11:14,10:33,45:a,46:s,47:o}),e(y,[2,46]),e(y,[2,47]),e(y,[2,48]),{1:[2,2]},{7:34,9:6,10:10,11:14,12:7,14:8,15:9,16:r,20:n,21:i,45:a,46:s,47:o},e(u,[2,8]),{10:35,11:14,23:[1,36],45:a,46:s,47:o},{22:37,24:24,25:25,26:c,27:l,28:h,29:d,30:f,31:p},e(u,[2,16]),{25:38,30:f,31:p},e(m,[2,26],{24:39,26:c,27:l,28:h,29:d}),e(v,[2,27]),e(v,[2,28]),e(v,[2,29]),e(v,[2,30]),e(b,[2,31]),e(b,[2,32]),e(u,[2,11],{17:[1,40]}),e(g,[2,5]),{8:[2,4]},e(_,[2,19]),{10:41,11:14,45:a,46:s,47:o},{10:42,11:14,23:[1,43],45:a,46:s,47:o},e(m,[2,25],{24:44,26:c,27:l,28:h,29:d}),e(m,[2,24]),{18:45,20:A},e(_,[2,21]),e(_,[2,20]),{10:47,11:14,45:a,46:s,47:o},e(m,[2,23]),{19:[1,48]},{18:49,19:[2,13],20:A},e(_,[2,22]),e(u,[2,12]),{19:[2,14]}],defaultActions:{2:[2,1],18:[2,2],34:[2,4],49:[2,14]},parseError:function(t,e){if(!e.recoverable){var r=function(t,e){this.message=t,this.hash=e};throw r.prototype=new Error,new r(t,e)}this.trace(t)},parse:function(t){var e=this,r=[0],n=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,A,w,x,E,k,D,C=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},F={};;){if(_=r[r.length-1],this.defaultActions[_]?A=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),A=a[_]&&a[_][v]),"undefined"==typeof A||!A.length||!A[0]){var T="";D=[];for(x in a[_])this.terminals_[x]&&x>l&&D.push("'"+this.terminals_[x]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(A[0]){case 1:r.push(v),n.push(f.yytext),i.push(f.yylloc),r.push(A[1]),v=null,b?(v=b,b=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[A[1]][1],F.$=n[n.length-E],F._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(F,[s,u,o,p.yy,A[1],n,i].concat(d)),"undefined"!=typeof w)return w;E&&(r=r.slice(0,-1*E*2),n=n.slice(0,-1*E),i=i.slice(0,-1*E)),r.push(this.productions_[A[1]][0]),n.push(F.$),i.push(F._$),k=a[r[r.length-2]][r[r.length-1]],r.push(k);break;case 3:return!0}}return!0}},x=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),n=t[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(t=this.test_match(r,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[n]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,r,n){switch(r){case 0:break;case 1:return 6;case 2:break;case 3:return 5;case 4:return this.begin("struct"),17;case 5:return this.popState(),19;case 6:break;case 7:return"MEMBER";case 8:return 16;case 9:this.begin("string");break;case 10:this.popState();break;case 11:return"STR";case 12:return 27;case 13:return 27;case 14:return 29;case 15:return 29;case 16:return 28;case 17:return 26;case 18:return 30;case 19:return 31;case 20:return 13;case 21:return 43;case 22:return"DOT";case 23:return"PLUS";case 24:return 40;case 25:return"EQUALS";case 26:return"EQUALS";case 27:return 47;case 28:return"PUNCTUATION";case 29:return 46;case 30:return 45;case 31:return 42;case 32:return 8}},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)/,/^(?:$)/],conditions:{string:{rules:[10,11],inclusive:!1},struct:{rules:[5,6,7],inclusive:!1},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:!0}}};return t}();return w.lexer=x,t.prototype=w,w.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),n.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&r.main(n.argv.slice(1)))}).call(this,t("_process"))},{_process:84,fs:1,path:83}],90:[function(t,e,r){(function(e){"use strict";var n=t("../../logger"),i=new n.Log,a="",s=!1;r.setMessage=function(t){i.debug("Setting message to: "+t),a=t},r.getMessage=function(){return a},r.setInfo=function(t){s=t},r.getInfo=function(){return s},r.parseError=function(t,r){e.mermaidAPI.parseError(t,r)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../logger":105}],91:[function(t,e,r){"use strict";var n=t("./exampleDb"),i=t("./parser/example.js"),a=t("../../d3"),s=t("../../logger"),o=new s.Log;r.draw=function(t,e,r){var s;s=i.parser,s.yy=n,o.debug("Renering example diagram"),s.parse(t);var u=a.select("#"+e),c=u.append("g");c.append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("mermaid "+r),u.attr("height",100),u.attr("width",400)}},{"../../d3":86,"../../logger":105,"./exampleDb":90,"./parser/example.js":92}],92:[function(t,e,r){(function(n){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r},r=[6,9,10,12],n={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,message:11,say:12,TXT:13,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo",12:"say",13:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1],[8,1],[11,2]],performAction:function(t,e,r,n,i,a){var s=a.length-1;switch(i){case 1:return n;case 4:break;case 6:n.setInfo(!0);break;case 7:n.setMessage(a[s]);break;case 8:this.$=a[s-1].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},e(r,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8],11:9,12:[1,10]},{1:[2,1]},e(r,[2,3]),e(r,[2,4]),e(r,[2,5]),e(r,[2,6]),e(r,[2,7]),{13:[1,11]},e(r,[2,8])],defaultActions:{4:[2,1]},parseError:function(t,e){if(!e.recoverable){var r=function(t,e){this.message=t,this.hash=e};throw r.prototype=new Error,new r(t,e)}this.trace(t)},parse:function(t){var e=this,r=[0],n=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,A,w,x,E,k,D,C=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},F={};;){if(_=r[r.length-1],this.defaultActions[_]?A=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),A=a[_]&&a[_][v]),"undefined"==typeof A||!A.length||!A[0]){var T="";D=[];for(x in a[_])this.terminals_[x]&&x>l&&D.push("'"+this.terminals_[x]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(A[0]){case 1:r.push(v),n.push(f.yytext),i.push(f.yylloc),r.push(A[1]),v=null,b?(v=b,b=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[A[1]][1],F.$=n[n.length-E],F._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(F,[s,u,o,p.yy,A[1],n,i].concat(d)),"undefined"!=typeof w)return w;E&&(r=r.slice(0,-1*E*2),n=n.slice(0,-1*E),i=i.slice(0,-1*E)),r.push(this.productions_[A[1]][0]),n.push(F.$),i.push(F._$),k=a[r[r.length-2]][r[r.length-1]],r.push(k);break;case 3:return!0}}return!0}},i=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),n=t[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(t=this.test_match(r,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[n]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,r,n){switch(r){case 0:return 9;case 1:return 10;case 2:return 4;case 3:return 12;case 4:return 13;case 5:return 6;case 6:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:showInfo\b)/i,/^(?:info\b)/i,/^(?:say\b)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return t}();return n.lexer=i,t.prototype=n,n.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),n.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&r.main(n.argv.slice(1)))}).call(this,t("_process"))},{_process:84,fs:1,path:83}],93:[function(t,e){"use strict";var r,n=t("../../logger"),i=new n.Log;if(t)try{r=t("dagre-d3")}catch(a){i.debug("Could not load dagre-d3")}r||(r=window.dagreD3),e.exports=r},{"../../logger":105,"dagre-d3":2}],94:[function(t,e,r){"use strict";var n=t("./graphDb"),i=t("./parser/flow"),a=t("./parser/dot"),s=t("../../d3"),o=t("./dagre-d3"),u=t("../../logger"),c=new u.Log,l={};e.exports.setConf=function(t){var e,r=Object.keys(t);for(e=0;e0&&(s=a.classes.join(" "));var o="";o=n(o,a.styles),i="undefined"==typeof a.text?a.id:a.text;var u="";if(l.htmlLabels)u="html",i=i.replace(/fa:fa[\w\-]+/g,function(t){return''});else{var c=document.createElementNS("http://www.w3.org/2000/svg","text"),h=i.split(/
/),d=0;for(d=0;d/g,"\n");"undefined"==typeof t.style?l.htmlLabels?e.setEdge(t.start,t.end,{labelType:"html",style:a,labelpos:"c",label:''+t.text+"",arrowheadStyle:"fill: #333",arrowhead:r},i):e.setEdge(t.start,t.end,{labelType:"text",style:"stroke: #333; stroke-width: 1.5px;fill:none",labelpos:"c",label:s,arrowheadStyle:"fill: #333",arrowhead:r},i):e.setEdge(t.start,t.end,{labelType:"text",style:a,arrowheadStyle:"fill: #333",label:s,arrowhead:r},i)}})},r.getClasses=function(t,e){var r;n.clear(),r=e?a.parser:i.parser,r.yy=n,r.parse(t);var s=n.getClasses();return"undefined"==typeof s["default"]&&(s["default"]={id:"default"},s["default"].styles=[],s["default"].clusterStyles=["rx:4px","fill: rgb(255, 255, 222)","rx: 4px","stroke: rgb(170, 170, 51)","stroke-width: 1px"],s["default"].nodeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"],s["default"].edgeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"]),s},r.draw=function(t,e,u){c.debug("Drawing flowchart");var h;n.clear(),h=u?a.parser:i.parser,h.yy=n;try{h.parse(t)}catch(d){c.debug("Parsing failed")}var f;f=n.getDirection(),"undefined"==typeof f&&(f="TD");var p,g=new o.graphlib.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:f,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),y=n.getSubGraphs(),m=0;for(m=y.length-1;m>=0;m--)p=y[m],n.addVertex(p.id,p.title,"group",void 0);var v=n.getVertices(),b=n.getEdges();m=0;var _;for(m=y.length-1;m>=0;m--)for(p=y[m],s.selectAll("cluster").append("text"),_=0;_0?t.split(",").forEach(function(t){"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)}):"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)};var setTooltip=function(t,e){"undefined"!=typeof e&&(tooltips[t]=e)},setClickFun=function setClickFun(id,functionName){"undefined"!=typeof functionName&&"undefined"!=typeof vertices[id]&&funs.push(function(element){var elem=d3.select(element).select("#"+id);null!==elem&&elem.on("click",function(){eval(functionName+"('"+id+"')")})})},setLink=function(t,e){"undefined"!=typeof e&&"undefined"!=typeof vertices[t]&&funs.push(function(r){var n=d3.select(r).select("#"+t);null!==n&&n.on("click",function(){window.open(e,"newTab")})})};exports.getTooltip=function(t){return tooltips[t]},exports.setClickEvent=function(t,e,r,n){t.indexOf(",")>0?t.split(",").forEach(function(t){setTooltip(t,n),setClickFun(t,e),setLink(t,r)}):(setTooltip(t,n),setClickFun(t,e),setLink(t,r))},exports.bindFunctions=function(t){funs.forEach(function(e){e(t)})},exports.getDirection=function(){return direction},exports.getVertices=function(){return vertices},exports.getEdges=function(){return edges},exports.getClasses=function(){return classes};var setupToolTips=function(t){var e=d3.select(".mermaidTooltip");null===e[0][0]&&(e=d3.select("body").append("div").attr("class","mermaidTooltip").style("opacity",0));var r=d3.select(t).select("svg"),n=r.selectAll("g.node");n.on("mouseover",function(){var t=d3.select(this),r=t.attr("title");if(null!==r){var n=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.html(t.attr("title")).style("left",n.left+(n.right-n.left)/2+"px").style("top",n.top-14+document.body.scrollTop+"px"),t.classed("hover",!0)}}).on("mouseout",function(){e.transition().duration(500).style("opacity",0);var t=d3.select(this);t.classed("hover",!1)})};funs.push(setupToolTips),exports.clear=function(){vertices={},classes={},edges=[],funs=[],funs.push(setupToolTips),subGraphs=[],subCount=0,tooltips=[]},exports.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},exports.addSubGraph=function(t,e){function r(t){var e={"boolean":{},number:{},string:{}},r=[];return t.filter(function(t){var n=typeof t;return" "===t?!1:n in e?e[n].hasOwnProperty(t)?!1:e[n][t]=!0:r.indexOf(t)>=0?!1:r.push(t)})}var n=[];n=r(n.concat.apply(n,t));var i={id:"subGraph"+subCount,nodes:n,title:e};return subGraphs.push(i),subCount+=1,i.id};var getPosForId=function(t){var e;for(e=0;e2e3)){if(posCrossRef[secCount]=r,subGraphs[r].id===e)return{result:!0,count:0};for(var i=0,a=1;i=0){var o=t(e,s);if(o.result)return{result:!0,count:a+o.count};a+=o.count}i+=1}return{result:!1,count:a}}};exports.getDepthFirstPos=function(t){return posCrossRef[t]},exports.indexNodes=function(){secCount=-1,subGraphs.length>0&&indexNodes("none",subGraphs.length-1,0)},exports.getSubGraphs=function(){return subGraphs},exports.parseError=function(t,e){global.mermaidAPI.parseError(t,e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../d3":86,"../../logger":105}],96:[function(t,e,r){(function(n){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r},r=[1,5],n=[1,6],i=[1,12],a=[1,13],s=[1,14],o=[1,15],u=[1,16],c=[1,17],l=[1,18],h=[1,19],d=[1,20],f=[1,21],p=[1,22],g=[8,16,17,18,19,20,21,22,23,24,25,26],y=[1,37],m=[1,33],v=[1,34],b=[1,35],_=[1,36],A=[8,10,16,17,18,19,20,21,22,23,24,25,26,28,32,37,39,40,45,57,58],w=[10,28],x=[10,28,37,57,58],E=[2,49],k=[1,45],D=[1,48],C=[1,49],F=[1,52],T=[2,65],S=[1,65],B=[1,66],L=[1,67],I=[1,68],O=[1,69],N=[1,70],M=[1,71],R=[1,72],P=[1,73],q=[8,16,17,18,19,20,21,22,23,24,25,26,47],j=[10,28,37],U={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graph:4,EOF:5,graphStatement:6,idStatement:7,"{":8,stmt_list:9,"}":10,strict:11,GRAPH:12,DIGRAPH:13,textNoTags:14,textNoTagsToken:15,ALPHA:16,NUM:17,COLON:18,PLUS:19,EQUALS:20,MULT:21,DOT:22,BRKT:23,SPACE:24,MINUS:25,keywords:26,stmt:27,";":28,node_stmt:29,edge_stmt:30,attr_stmt:31,"=":32,subgraph:33,attr_list:34,NODE:35,EDGE:36,"[":37,a_list:38,"]":39,",":40,edgeRHS:41,node_id:42,edgeop:43,port:44,":":45,compass_pt:46,SUBGRAPH:47,n:48,ne:49,e:50,se:51,s:52,sw:53,w:54,nw:55,c:56,ARROW_POINT:57,ARROW_OPEN:58,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"{",10:"}",11:"strict",12:"GRAPH",13:"DIGRAPH",16:"ALPHA",17:"NUM",18:"COLON",19:"PLUS",20:"EQUALS",21:"MULT",22:"DOT",23:"BRKT",24:"SPACE",25:"MINUS",26:"keywords",28:";",32:"=",35:"NODE",36:"EDGE",37:"[",39:"]",40:",",45:":",47:"SUBGRAPH",48:"n",49:"ne",50:"e",51:"se",52:"s",53:"sw",54:"w",55:"nw",56:"c",57:"ARROW_POINT",58:"ARROW_OPEN"},productions_:[0,[3,2],[4,5],[4,6],[4,4],[6,1],[6,1],[7,1],[14,1],[14,2],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[9,1],[9,3],[27,1],[27,1],[27,1],[27,3],[27,1],[31,2],[31,2],[31,2],[34,4],[34,3],[34,3],[34,2],[38,5],[38,5],[38,3],[30,3],[30,3],[30,2],[30,2],[41,3],[41,3],[41,2],[41,2],[29,2],[29,1],[42,2],[42,1],[44,4],[44,2],[44,2],[33,5],[33,4],[33,3],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,0],[43,1],[43,1]],performAction:function(t,e,r,n,i,a){var s=a.length-1;switch(i){case 1:this.$=a[s-1];break;case 2:this.$=a[s-4];break;case 3:this.$=a[s-5];break;case 4:this.$=a[s-3];break;case 8:case 10:case 11:this.$=a[s];break;case 9:this.$=a[s-1]+""+a[s];break;case 12:case 13:case 14:case 15:case 16:case 18:case 19:case 20:this.$=a[s];break;case 17:this.$="
";break;case 39:this.$="oy";break;case 40:n.addLink(a[s-1],a[s].id,a[s].op),this.$="oy";break;case 42:n.addLink(a[s-1],a[s].id,a[s].op),this.$={op:a[s-2],id:a[s-1]};break;case 44:this.$={op:a[s-1],id:a[s]};break;case 48:n.addVertex(a[s-1]),this.$=a[s-1];break;case 49:n.addVertex(a[s]),this.$=a[s];break;case 66:this.$="arrow";break;case 67:this.$="arrow_open"}},table:[{3:1,4:2,6:3,11:[1,4],12:r,13:n},{1:[3]},{5:[1,7]},{7:8,8:[1,9],14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},{6:23,12:r,13:n},e(g,[2,5]),e(g,[2,6]),{1:[2,1]},{8:[1,24]},{7:30,8:y,9:25,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},e([8,10,28,32,37,39,40,45,57,58],[2,7],{15:38,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p}),e(A,[2,8]),e(A,[2,10]),e(A,[2,11]),e(A,[2,12]),e(A,[2,13]),e(A,[2,14]),e(A,[2,15]),e(A,[2,16]),e(A,[2,17]),e(A,[2,18]),e(A,[2,19]),e(A,[2,20]),{7:39,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},{7:30,8:y,9:40,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{10:[1,41]},{10:[2,21],28:[1,42]},e(w,[2,23]),e(w,[2,24]),e(w,[2,25]),e(x,E,{44:44,32:[1,43],45:k}),e(w,[2,27],{41:46,43:47,57:D,58:C}),e(w,[2,47],{43:47,34:50,41:51,37:F,57:D,58:C}),{34:53,37:F},{34:54,37:F},{34:55,37:F},{7:56,8:[1,57],14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},{7:30,8:y,9:58,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},e(A,[2,9]),{8:[1,59]},{10:[1,60]},{5:[2,4]},{7:30,8:y,9:61,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{7:62,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},e(x,[2,48]),e(x,T,{14:10,15:11,7:63,46:64,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,48:S,49:B,50:L,51:I,52:O,53:N,54:M,55:R,56:P}),e(w,[2,41],{34:74,37:F}),{7:77,8:y,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,33:76,42:75,47:_},e(q,[2,66]),e(q,[2,67]),e(w,[2,46]),e(w,[2,40],{34:78,37:F}),{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,38:79,39:[1,80]},e(w,[2,28]),e(w,[2,29]),e(w,[2,30]),{8:[1,82]},{7:30,8:y,9:83,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{10:[1,84]},{7:30,8:y,9:85,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{5:[2,2]},{10:[2,22]},e(w,[2,26]),e(x,[2,51],{45:[1,86]}),e(x,[2,52]),e(x,[2,56]),e(x,[2,57]),e(x,[2,58]),e(x,[2,59]),e(x,[2,60]),e(x,[2,61]),e(x,[2,62]),e(x,[2,63]),e(x,[2,64]),e(w,[2,38]),e(j,[2,44],{43:47,41:87,57:D,58:C}),e(j,[2,45],{43:47,41:88,57:D,58:C}),e(x,E,{44:44,45:k}),e(w,[2,39]),{39:[1,89]},e(w,[2,34],{34:90,37:F}),{32:[1,91]},{7:30,8:y,9:92,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:_},{10:[1,93]},e(x,[2,55]),{10:[1,94]},e(x,T,{46:95,48:S,49:B,50:L,51:I,52:O,53:N,54:M,55:R,56:P}),e(j,[2,42]),e(j,[2,43]),e(w,[2,33],{34:96,37:F}),e(w,[2,32]),{7:97,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},{10:[1,98]},e(x,[2,54]),{5:[2,3]},e(x,[2,50]),e(w,[2,31]),{28:[1,99],39:[2,37],40:[1,100]},e(x,[2,53]),{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,38:101},{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,38:102},{39:[2,35]},{39:[2,36]}],defaultActions:{7:[2,1],41:[2,4],60:[2,2],61:[2,22],94:[2,3],101:[2,35],102:[2,36]},parseError:function(t,e){if(!e.recoverable){var r=function(t,e){this.message=t,this.hash=e};throw r.prototype=new Error,new r(t,e)}this.trace(t)},parse:function(t){var e=this,r=[0],n=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,A,w,x,E,k,D,C=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},F={};;){if(_=r[r.length-1],this.defaultActions[_]?A=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),A=a[_]&&a[_][v]),"undefined"==typeof A||!A.length||!A[0]){var T="";D=[];for(x in a[_])this.terminals_[x]&&x>l&&D.push("'"+this.terminals_[x]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(A[0]){case 1:r.push(v),n.push(f.yytext),i.push(f.yylloc),r.push(A[1]),v=null,b?(v=b,b=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[A[1]][1],F.$=n[n.length-E],F._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(F,[s,u,o,p.yy,A[1],n,i].concat(d)),"undefined"!=typeof w)return w;E&&(r=r.slice(0,-1*E*2),n=n.slice(0,-1*E),i=i.slice(0,-1*E)),r.push(this.productions_[A[1]][0]),n.push(F.$),i.push(F._$),k=a[r[r.length-2]][r[r.length-1]],r.push(k);break;case 3:return!0}}return!0}},Y=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),n=t[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(t=this.test_match(r,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[n]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,r,n){switch(r){case 0:return"STYLE";case 1:return"LINKSTYLE";case 2:return"CLASSDEF";case 3:return"CLASS";case 4:return"CLICK";case 5:return 12;case 6:return 13;case 7:return 47;case 8:return 35;case 9:return 36;case 10:return"DIR";case 11:return"DIR";case 12:return"DIR";case 13:return"DIR";case 14:return"DIR";case 15:return"DIR";case 16:return 17;case 17:return 23;case 18:return 18;case 19:return 28;case 20:return 40;case 21:return 32;case 22:return 21;case 23:return 22;case 24:return"ARROW_CROSS";case 25:return 57;case 26:return"ARROW_CIRCLE";case 27:return 58;case 28:return 25;case 29:return 19;case 30:return 20;case 31:return 16;case 32:return"PIPE";case 33:return"PS";case 34:return"PE";case 35:return 37;case 36:return 39;case 37:return 8;case 38:return 10;case 39:return"QUOTE";case 40:return 24;case 41:return"NEWLINE";case 42:return 5}},rules:[/^(?:style\b)/,/^(?:linkStyle\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:digraph\b)/,/^(?:subgraph\b)/,/^(?:node\b)/,/^(?:edge\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:--[x])/,/^(?:->)/,/^(?:--[o])/,/^(?:--)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u0061-\u007A\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)/,/^(?:\n)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],inclusive:!0}}};return t}();return U.lexer=Y,t.prototype=U,U.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),n.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&r.main(n.argv.slice(1)))}).call(this,t("_process"))},{_process:84,fs:1,path:83}],97:[function(t,e,r){(function(n){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r},r=[1,4],n=[1,3],i=[1,5],a=[1,8,9,10,11,13,18,30,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],s=[2,2],o=[1,12],u=[1,13],c=[1,14],l=[1,15],h=[1,31],d=[1,33],f=[1,22],p=[1,34],g=[1,24],y=[1,25],m=[1,26],v=[1,27],b=[1,28],_=[1,38],A=[1,40],w=[1,35],x=[1,39],E=[1,45],k=[1,44],D=[1,36],C=[1,37],F=[1,41],T=[1,42],S=[1,43],B=[1,8,9,10,11,13,18,30,32,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],L=[1,53],I=[1,52],O=[1,54],N=[1,72],M=[1,80],R=[1,81],P=[1,66],q=[1,65],j=[1,85],U=[1,84],Y=[1,82],V=[1,83],G=[1,73],$=[1,68],H=[1,67],W=[1,63],z=[1,75],Z=[1,76],X=[1,77],K=[1,78],J=[1,79],Q=[1,70],tt=[1,69],et=[8,9,11],rt=[8,9,11,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64],nt=[1,115],it=[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,85,87,88,90,91,93,94,95,96,97],at=[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,83,85,87,88,90,91,93,94,95,96,97],st=[1,117],ot=[1,118],ut=[8,9,10,11,13,18,30,32,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],ct=[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,83,85,87,88,90,91,93,94,95,96,97],lt=[13,18,46,81,85,87,88,90,91,93,94,95,96,97],ht=[13,18,46,49,65,81,85,87,88,90,91,93,94,95,96,97],dt=[1,191],ft=[1,188],pt=[1,195],gt=[1,192],yt=[1,189],mt=[1,196],vt=[1,186],bt=[1,187],_t=[1,190],At=[1,193],wt=[1,194],xt=[1,211],Et=[8,9,11,85],kt=[8,9,10,11,46,71,80,81,83,85,87,88,89,90,91],Dt={trace:function(){},yy:{},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,commentStatement:82,PCT:83,style:84,COMMA:85,styleComponent:86,ALPHA:87,COLON:88,UNIT:89,BRKT:90,DOT:91,graphCodeTokens:92,PUNCTUATION:93,UNICODE_TEXT:94,PLUS:95,EQUALS:96,MULT:97,TAG_START:98,TAG_END:99,QUOTE:100,$accept:0,$end:1},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",83:"PCT",85:"COMMA",87:"ALPHA",88:"COLON",89:"UNIT",90:"BRKT",91:"DOT",93:"PUNCTUATION",94:"UNICODE_TEXT",95:"PLUS",96:"EQUALS",97:"MULT",98:"TAG_START",99:"TAG_END",100:"QUOTE"},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],[82,3],[79,1],[79,3],[84,1],[84,2],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,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],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1]],performAction:function(t,e,r,n,i,a){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:a[s]!==[]&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 57:case 59:case 60:case 92:case 94:case 95:case 108:this.$=a[s];break;case 11:n.setDirection(a[s-1]),this.$=a[s-1];break;case 12:n.setDirection("LR"),this.$=a[s-1];break;case 13:n.setDirection("RL"),this.$=a[s-1];break;case 14:n.setDirection("BT"),this.$=a[s-1];break;case 15:n.setDirection("TB"),this.$=a[s-1];break;case 30:this.$=a[s-1];break;case 31:case 32:case 33:case 34:case 35:this.$=[];break;case 36:this.$=n.addSubGraph(a[s-1],a[s-3]);break;case 37:this.$=n.addSubGraph(a[s-1],void 0);break;case 41:n.addLink(a[s-2],a[s],a[s-1]),this.$=[a[s-2],a[s]];break;case 42:this.$=[a[s]];break;case 43:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"square");break;case 44:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"square");break;case 45:this.$=a[s-5],n.addVertex(a[s-5],a[s-2],"circle");break;case 46:this.$=a[s-6],n.addVertex(a[s-6],a[s-3],"circle");break;case 47:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"ellipse");break;case 48:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"ellipse");break;case 49:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"round");break;case 50:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"round");break;case 51:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"diamond");break;case 52:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"diamond");break;case 53:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"odd");break;case 54:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"odd");break;case 55:this.$=a[s],n.addVertex(a[s]);break;case 56:this.$=a[s-1],n.addVertex(a[s-1]);break;case 58:case 93:case 96:case 109:this.$=a[s-1]+""+a[s];break;case 61:this.$="v";break;case 62:this.$="-";break;case 63:a[s-1].text=a[s],this.$=a[s-1];break;case 64:case 65:a[s-2].text=a[s-1],this.$=a[s-2];break;case 66:this.$=a[s];break;case 67:this.$={type:"arrow",stroke:"normal",text:a[s-1]};break;case 68:this.$={type:"arrow_circle", +stroke:"normal",text:a[s-1]};break;case 69:this.$={type:"arrow_cross",stroke:"normal",text:a[s-1]};break;case 70:this.$={type:"arrow_open",stroke:"normal",text:a[s-1]};break;case 71:this.$={type:"arrow",stroke:"dotted",text:a[s-1]};break;case 72:this.$={type:"arrow_circle",stroke:"dotted",text:a[s-1]};break;case 73:this.$={type:"arrow_cross",stroke:"dotted",text:a[s-1]};break;case 74:this.$={type:"arrow_open",stroke:"dotted",text:a[s-1]};break;case 75:this.$={type:"arrow",stroke:"thick",text:a[s-1]};break;case 76:this.$={type:"arrow_circle",stroke:"thick",text:a[s-1]};break;case 77:this.$={type:"arrow_cross",stroke:"thick",text:a[s-1]};break;case 78:this.$={type:"arrow_open",stroke:"thick",text:a[s-1]};break;case 79:this.$={type:"arrow",stroke:"normal"};break;case 80:this.$={type:"arrow_circle",stroke:"normal"};break;case 81:this.$={type:"arrow_cross",stroke:"normal"};break;case 82:this.$={type:"arrow_open",stroke:"normal"};break;case 83:this.$={type:"arrow",stroke:"dotted"};break;case 84:this.$={type:"arrow_circle",stroke:"dotted"};break;case 85:this.$={type:"arrow_cross",stroke:"dotted"};break;case 86:this.$={type:"arrow_open",stroke:"dotted"};break;case 87:this.$={type:"arrow",stroke:"thick"};break;case 88:this.$={type:"arrow_circle",stroke:"thick"};break;case 89:this.$={type:"arrow_cross",stroke:"thick"};break;case 90:this.$={type:"arrow_open",stroke:"thick"};break;case 91:this.$=a[s-1];break;case 110:case 111:this.$=a[s-4],n.addClass(a[s-2],a[s]);break;case 112:this.$=a[s-4],n.setClass(a[s-2],a[s]);break;case 113:this.$=a[s-4],n.setClickEvent(a[s-2],a[s],void 0,void 0);break;case 114:this.$=a[s-6],n.setClickEvent(a[s-4],a[s-2],void 0,a[s]);break;case 115:this.$=a[s-4],n.setClickEvent(a[s-2],void 0,a[s],void 0);break;case 116:this.$=a[s-6],n.setClickEvent(a[s-4],void 0,a[s-2],a[s]);break;case 117:this.$=a[s-4],n.addVertex(a[s-2],void 0,void 0,a[s]);break;case 118:case 119:case 120:this.$=a[s-4],n.updateLink(a[s-2],a[s]);break;case 122:this.$=[a[s]];break;case 123:a[s-2].push(a[s]),this.$=a[s-2];break;case 125:this.$=a[s-1]+a[s]}},table:[{3:1,4:2,9:r,10:n,12:i},{1:[3]},e(a,s,{5:6}),{4:7,9:r,10:n,12:i},{4:8,9:r,10:n,12:i},{10:[1,9]},{1:[2,1],6:10,7:11,8:o,9:u,10:c,11:l,13:h,18:d,23:16,25:17,26:18,27:19,28:20,29:21,30:f,33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:b,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(a,[2,9]),e(a,[2,10]),{13:[1,46],15:[1,47],16:[1,48],17:[1,49],18:[1,50]},e(B,[2,3]),e(B,[2,4]),e(B,[2,5]),e(B,[2,6]),e(B,[2,7]),e(B,[2,8]),{8:L,9:I,11:O,24:51},{8:L,9:I,11:O,24:55},{8:L,9:I,11:O,24:56},{8:L,9:I,11:O,24:57},{8:L,9:I,11:O,24:58},{8:L,9:I,11:O,24:59},{8:L,9:I,10:N,11:O,12:M,13:R,15:P,16:q,17:j,18:U,24:61,30:Y,31:60,32:V,45:71,46:G,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(et,[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]},e(rt,[2,55],{45:32,21:113,44:114,10:nt,13:h,15:[1,112],18:d,36:[1,108],38:[1,109],40:[1,110],42:[1,111],46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S}),e(it,[2,57]),e(it,[2,59]),e(it,[2,60]),e(it,[2,61]),e(it,[2,62]),e(at,[2,150]),e(at,[2,151]),e(at,[2,152]),e(at,[2,153]),e(at,[2,154]),e(at,[2,155]),e(at,[2,156]),e(at,[2,157]),e(at,[2,158]),e(at,[2,159]),e(at,[2,160]),{8:st,9:ot,10:nt,14:116,21:119},{8:st,9:ot,10:nt,14:120,21:119},{8:st,9:ot,10:nt,14:121,21:119},{8:st,9:ot,10:nt,14:122,21:119},{8:st,9:ot,10:nt,14:123,21:119},e(B,[2,30]),e(B,[2,38]),e(B,[2,39]),e(B,[2,40]),e(B,[2,31]),e(B,[2,32]),e(B,[2,33]),e(B,[2,34]),e(B,[2,35]),{8:L,9:I,10:N,11:O,12:M,13:R,15:P,16:q,17:j,18:U,24:124,30:Y,32:V,45:71,46:G,50:$,60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(ut,s,{5:126}),e(ct,[2,92]),e(ct,[2,94]),e(ct,[2,139]),e(ct,[2,140]),e(ct,[2,141]),e(ct,[2,142]),e(ct,[2,143]),e(ct,[2,144]),e(ct,[2,145]),e(ct,[2,146]),e(ct,[2,147]),e(ct,[2,148]),e(ct,[2,149]),e(ct,[2,97]),e(ct,[2,98]),e(ct,[2,99]),e(ct,[2,100]),e(ct,[2,101]),e(ct,[2,102]),e(ct,[2,103]),e(ct,[2,104]),e(ct,[2,105]),e(ct,[2,106]),e(ct,[2,107]),{13:h,18:d,33:127,35:29,44:30,45:32,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(lt,[2,66],{48:128,49:[1,129],65:[1,130]}),{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,31:131,32:V,45:71,46:G,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,31:132,32:V,45:71,46:G,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,31:133,32:V,45:71,46:G,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(ht,[2,79]),e(ht,[2,80]),e(ht,[2,81]),e(ht,[2,82]),e(ht,[2,83]),e(ht,[2,84]),e(ht,[2,85]),e(ht,[2,86]),e(ht,[2,87]),e(ht,[2,88]),e(ht,[2,89]),e(ht,[2,90]),{13:h,18:d,35:134,44:30,45:32,46:p,80:[1,135],81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{78:[1,136],81:[1,137]},{13:h,18:d,35:139,44:30,45:32,46:p,78:[1,138],81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{13:h,18:d,35:140,44:30,45:32,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{13:h,18:d,35:141,44:30,45:32,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,31:142,32:V,45:71,46:G,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,31:144,32:V,38:[1,143],45:71,46:G,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,31:145,32:V,45:71,46:G,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,31:146,32:V,45:71,46:G,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,31:147,32:V,45:71,46:G,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(rt,[2,56]),e(it,[2,58]),e(rt,[2,29],{21:148,10:nt}),e(a,[2,11]),e(a,[2,21]),e(a,[2,22]),{9:[1,149]},e(a,[2,12]),e(a,[2,13]),e(a,[2,14]),e(a,[2,15]),e(ut,s,{5:150}),e(ct,[2,93]),{6:10,7:11,8:o,9:u,10:c,11:l,13:h,18:d,23:16,25:17,26:18,27:19,28:20,29:21,30:f,32:[1,151],33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:b,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(et,[2,41]),e(lt,[2,63],{10:[1,152]}),{10:[1,153]},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,31:154,32:V,45:71,46:G,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,45:71,46:G,50:$,51:[1,155],52:[1,156],53:[1,157],54:[1,158],60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,45:71,46:G,50:$,56:[1,159],57:[1,160],58:[1,161],59:[1,162],60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,45:71,46:G,50:$,60:H,61:[1,163],62:[1,164],63:[1,165],64:[1,166],66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:[1,167],13:h,18:d,44:114,45:32,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:[1,168]},{10:[1,169]},{10:[1,170]},{10:[1,171]},{10:[1,172],13:h,18:d,44:114,45:32,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:[1,173],13:h,18:d,44:114,45:32,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:[1,174],13:h,18:d,44:114,45:32,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,37:[1,175],45:71,46:G,50:$,60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,31:176,32:V,45:71,46:G,50:$,60:H,66:62,67:W,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,39:[1,177],45:71,46:G,50:$,60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,41:[1,178],45:71,46:G,50:$,60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,43:[1,179],45:71,46:G,50:$,60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,37:[1,180],45:71,46:G,50:$,60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(rt,[2,28]),e(a,[2,23]),{6:10,7:11,8:o,9:u,10:c,11:l,13:h,18:d,23:16,25:17,26:18,27:19,28:20,29:21,30:f,32:[1,181],33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:b,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(B,[2,37]),e(lt,[2,65]),e(lt,[2,64]),{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,45:71,46:G,50:$,60:H,65:[1,182],66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(lt,[2,67]),e(lt,[2,68]),e(lt,[2,69]),e(lt,[2,70]),e(lt,[2,71]),e(lt,[2,72]),e(lt,[2,73]),e(lt,[2,74]),e(lt,[2,75]),e(lt,[2,76]),e(lt,[2,77]),e(lt,[2,78]),{10:dt,46:ft,71:pt,79:183,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:bt,89:_t,90:At,91:wt},{10:dt,46:ft,71:pt,79:197,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:bt,89:_t,90:At,91:wt},{10:dt,46:ft,71:pt,79:198,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:bt,89:_t,90:At,91:wt},{10:dt,46:ft,71:pt,79:199,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:bt,89:_t,90:At,91:wt},{10:dt,46:ft,71:pt,79:200,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:bt,89:_t,90:At,91:wt},{10:dt,46:ft,71:pt,79:201,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:bt,89:_t,90:At,91:wt},{13:h,18:d,35:202,44:30,45:32,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},{13:h,18:d,35:203,44:30,45:32,46:p,67:[1,204],81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(rt,[2,43],{21:205,10:nt}),{10:N,12:M,13:R,15:P,16:q,17:j,18:U,30:Y,32:V,39:[1,206],45:71,46:G,50:$,60:H,66:125,70:74,71:z,72:Z,73:X,74:K,75:J,77:64,78:Q,81:_,83:tt,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S},e(rt,[2,49],{21:207,10:nt}),e(rt,[2,47],{21:208,10:nt}),e(rt,[2,51],{21:209,10:nt}),e(rt,[2,53],{21:210,10:nt}),e(B,[2,36]),e([10,13,18,46,81,85,87,88,90,91,93,94,95,96,97],[2,91]),e(et,[2,117],{85:xt}),e(Et,[2,122],{86:212,10:dt,46:ft,71:pt,80:gt,81:yt,83:mt,87:vt,88:bt,89:_t,90:At,91:wt}),e(kt,[2,124]),e(kt,[2,126]),e(kt,[2,127]),e(kt,[2,128]),e(kt,[2,129]),e(kt,[2,130]),e(kt,[2,131]),e(kt,[2,132]),e(kt,[2,133]),e(kt,[2,134]),e(kt,[2,135]),e(kt,[2,136]),e(et,[2,118],{85:xt}),e(et,[2,119],{85:xt}),e(et,[2,120],{85:xt}),e(et,[2,110],{85:xt}),e(et,[2,111],{85:xt}),e(et,[2,112],{45:32,44:114,13:h,18:d,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S}),e(et,[2,113],{45:32,44:114,10:[1,213],13:h,18:d,46:p,81:_,85:A,87:w,88:x,90:E,91:k,93:D,94:C,95:F,96:T,97:S}),e(et,[2,115],{10:[1,214]}),e(rt,[2,44]),{39:[1,215]},e(rt,[2,50]),e(rt,[2,48]),e(rt,[2,52]),e(rt,[2,54]),{10:dt,46:ft,71:pt,80:gt,81:yt,83:mt,84:216,86:185,87:vt,88:bt,89:_t,90:At,91:wt},e(kt,[2,125]),{67:[1,217]},{67:[1,218]},e(rt,[2,45],{21:219,10:nt}),e(Et,[2,123],{86:212,10:dt,46:ft,71:pt,80:gt,81:yt,83:mt,87:vt,88:bt,89:_t,90:At,91:wt}),e(et,[2,114]),e(et,[2,116]),e(rt,[2,46])],defaultActions:{},parseError:function(t,e){if(!e.recoverable){var r=function(t,e){this.message=t,this.hash=e};throw r.prototype=new Error,new r(t,e)}this.trace(t)},parse:function(t){var e=this,r=[0],n=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,A,w,x,E,k,D,C=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},F={};;){if(_=r[r.length-1],this.defaultActions[_]?A=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),A=a[_]&&a[_][v]),"undefined"==typeof A||!A.length||!A[0]){var T="";D=[];for(x in a[_])this.terminals_[x]&&x>l&&D.push("'"+this.terminals_[x]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(A[0]){case 1:r.push(v),n.push(f.yytext),i.push(f.yylloc),r.push(A[1]),v=null,b?(v=b,b=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[A[1]][1],F.$=n[n.length-E],F._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(F,[s,u,o,p.yy,A[1],n,i].concat(d)),"undefined"!=typeof w)return w;E&&(r=r.slice(0,-1*E*2),n=n.slice(0,-1*E),i=i.slice(0,-1*E)),r.push(this.productions_[A[1]][0]),n.push(F.$),i.push(F._$),k=a[r[r.length-2]][r[r.length-1]],r.push(k);break;case 3:return!0}}return!0}},Ct=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),n=t[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(t=this.test_match(r,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[n]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,r,n){switch(r){case 0:break;case 1:this.begin("string");break;case 2:this.popState();break;case 3:return"STR";case 4:return 71;case 5:return 78;case 6:return 72;case 7:return 73;case 8:return 74;case 9:return 75;case 10:return 12;case 11:return 30;case 12:return 32;case 13:return 13;case 14:return 13;case 15:return 13;case 16:return 13;case 17:return 13;case 18:return 13;case 19:return 81;case 20:return 90;case 21:return 88;case 22:return 8;case 23:return 85;case 24:return 97;case 25:return 16;case 26:return 15;case 27:return 17;case 28:return 18;case 29:return 53;case 30:return 51;case 31:return 52;case 32:return 54;case 33:return 58;case 34:return 56;case 35:return 57;case 36:return 59;case 37:return 58;case 38:return 56;case 39:return 57;case 40:return 59;case 41:return 63;case 42:return 61;case 43:return 62;case 44:return 64;case 45:return 50;case 46:return 55;case 47:return 60;case 48:return 40;case 49:return 41;case 50:return 46;case 51:return 91;case 52:return 95;case 53:return 83;case 54:return 96;case 55:return 96;case 56:return 87;case 57:return 93;case 58:return 94;case 59:return 65;case 60:return 38;case 61:return 39;case 62:return 36;case 63:return 37;case 64:return 42;case 65:return 43;case 66:return 100;case 67:return 9;case 68:return 10;case 69:return 11}},rules:[/^(?:%%[^\n]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\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)/,/^(?:$)/],conditions:{string:{rules:[2,3],inclusive:!1},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],inclusive:!0}}};return t}();return Dt.lexer=Ct,t.prototype=Dt,Dt.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),n.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&r.main(n.argv.slice(1)))}).call(this,t("_process"))},{_process:84,fs:1,path:83}],98:[function(t,e,r){(function(e){"use strict";var n=t("moment"),i=t("../../logger"),a=new i.Log,s="",o="",u=[],c=[],l="";r.clear=function(){u=[],c=[],l="",o="",g=0,h=void 0,d=void 0,b=[]},r.setDateFormat=function(t){s=t},r.getDateFormat=function(){return s},r.setTitle=function(t){o=t},r.getTitle=function(){return o},r.addSection=function(t){l=t,u.push(t)},r.getTasks=function(){for(var t=A(),e=10,r=0;!t&&e>r;)t=A(),r++;return c=b};var h,d,f=function(t,e,i){i=i.trim();var s=/^after\s+([\d\w\-]+)/,o=s.exec(i.trim());if(null!==o){var u=r.findTaskById(o[1]);if("undefined"==typeof u){var c=new Date;return c.setHours(0,0,0,0),c}return u.endTime}return n(i,e.trim(),!0).isValid()?n(i,e.trim(),!0).toDate():(a.debug("Invalid date:"+i),a.debug("With date format:"+e.trim()),new Date)},p=function(t,e,r){if(r=r.trim(),n(r,e.trim(),!0).isValid())return n(r,e.trim()).toDate();var i=n(t),a=/^([\d]+)([wdhms])/,s=a.exec(r.trim());if(null!==s){switch(s[2]){case"s":i.add(s[1],"seconds");break;case"m":i.add(s[1],"minutes");break;case"h":i.add(s[1],"hours");break;case"d":i.add(s[1],"days");break;case"w":i.add(s[1],"weeks")}return i.toDate()}return i.toDate()},g=0,y=function(t){return"undefined"==typeof t?(g+=1,"task"+g):t},m=function(t,e){var n;n=":"===e.substr(0,1)?e.substr(1,e.length):e;for(var i=n.split(","),a={},s=r.getDateFormat(),o=!0;o;)o=!1,i[0].match(/^\s*active\s*$/)&&(a.active=!0,i.shift(1),o=!0),i[0].match(/^\s*done\s*$/)&&(a.done=!0,i.shift(1),o=!0),i[0].match(/^\s*crit\s*$/)&&(a.crit=!0,i.shift(1),o=!0);var u;for(u=0;ur-e?r+i+1.5*s.sidePadding>o?e+n-5:r+n+5:(r-e)/2+e+n}).attr("y",function(t,n){return n*e+s.barHeight/2+(s.fontSize/2-2)+r; + +}).attr("text-height",i).attr("class",function(t){for(var e=w(t.startTime),r=w(t.endTime),n=this.getBBox().width,i=0,a=0;ar-e?r+n+1.5*s.sidePadding>o?"taskTextOutsideLeft taskTextOutside"+i+" "+u:"taskTextOutsideRight taskTextOutside"+i+" "+u:"taskText taskText"+i+" "+u})}function l(t,e,r,a){var o,u=[[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["h1 %I:%M",function(t){return t.getMinutes()}]],c=[["%Y",function(){return!0}]],l=[["%I:%M",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}]];"undefined"!=typeof s.axisFormatter&&(l=[],s.axisFormatter.forEach(function(t){var e=[];e[0]=t[0],e[1]=t[1],l.push(e)})),o=u.concat(l).concat(c);var h=i.svg.axis().scale(w).orient("bottom").tickSize(-a+e+s.gridLineStartPadding,0,0).tickFormat(i.time.format.multi(o));n>7&&230>n&&(h=h.ticks(i.time.monday.range)),b.append("g").attr("class","grid").attr("transform","translate("+t+", "+(a-50)+")").call(h).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em")}function h(t,e){for(var r=[],n=0,i=0;i0))return i[1]*t/2+e;for(var s=0;a>s;s++)return n+=r[a-1][1],i[1]*t/2+n*t+e}).attr("class",function(t){for(var e=0;en;++n)e.hasOwnProperty(t[n])||(e[t[n]]=!0,r.push(t[n]));return r}function p(t){for(var e=t.length,r={};e;)r[t[--e]]=(r[t[e]]||0)+1;return r}function g(t,e){return p(e)[t]||0}r.yy.clear(),r.parse(t);var y=document.getElementById(e);o=y.parentElement.offsetWidth,"undefined"==typeof o&&(o=1200),"undefined"!=typeof s.useWidth&&(o=s.useWidth);var m=r.yy.getTasks(),v=m.length*(s.barHeight+s.barGap)+2*s.topPadding;y.setAttribute("height","100%"),y.setAttribute("viewBox","0 0 "+o+" "+v);var b=i.select("#"+e),_=i.min(m,function(t){return t.startTime}),A=i.max(m,function(t){return t.endTime}),w=i.time.scale().domain([i.min(m,function(t){return t.startTime}),i.max(m,function(t){return t.endTime})]).rangeRound([0,o-150]),x=[];n=a.duration(A-_).asDays();for(var E=0;El&&D.push("'"+this.terminals_[x]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(A[0]){case 1:r.push(v),n.push(f.yytext),i.push(f.yylloc),r.push(A[1]),v=null,b?(v=b,b=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[A[1]][1],F.$=n[n.length-E],F._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(F,[s,u,o,p.yy,A[1],n,i].concat(d)),"undefined"!=typeof w)return w;E&&(r=r.slice(0,-1*E*2),n=n.slice(0,-1*E),i=i.slice(0,-1*E)),r.push(this.productions_[A[1]][0]),n.push(F.$),i.push(F._$),k=a[r[r.length-2]][r[r.length-1]],r.push(k);break;case 3:return!0}}return!0}},u=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),n=t[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(t=this.test_match(r,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[n]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,r,n){switch(r){case 0:return 10;case 1:break;case 2:break;case 3:break;case 4:return 4;case 5:return 11;case 6:return"date";case 7:return 12;case 8:return 13;case 9:return 14;case 10:return 15;case 11:return":";case 12:return 6;case 13:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\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],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return t}();return o.lexer=u,t.prototype=o,o.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),n.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&r.main(n.argv.slice(1)))}).call(this,t("_process"))},{_process:84,fs:1,path:83}],101:[function(t,e,r){(function(n){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r},r=[1,2],n=[1,3],i=[1,4],a=[2,4],s=[1,9],o=[1,11],u=[1,12],c=[1,14],l=[1,15],h=[1,17],d=[1,18],f=[1,19],p=[1,20],g=[1,22],y=[1,23],m=[1,4,5,10,15,16,18,20,21,22,23,24,25,37],v=[4,5,10,15,16,18,20,21,22,23,25,37],b=[35,36,37],_=[1,67],A={trace:function(){},yy:{},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,text:19,loop:20,end:21,opt:22,alt:23,"else":24,note:25,placement:26,text2:27,over:28,actor_pair:29,spaceList:30,",":31,left_of:32,right_of:33,signaltype:34,"+":35,"-":36,ACTOR:37,SOLID_OPEN_ARROW:38,DOTTED_OPEN_ARROW:39,SOLID_ARROW:40,DOTTED_ARROW:41,SOLID_CROSS:42,DOTTED_CROSS:43,TXT:44,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",10:"participant",12:"AS",13:"restOfLine",15:"activate",16:"deactivate",18:"title",19:"text",20:"loop",21:"end",22:"opt",23:"alt",24:"else",25:"note",28:"over",31:",",32:"left_of",33:"right_of",35:"+",36:"-",37:"ACTOR",38:"SOLID_OPEN_ARROW",39:"DOTTED_OPEN_ARROW",40:"SOLID_ARROW",41:"DOTTED_ARROW",42:"SOLID_CROSS",43:"DOTTED_CROSS",44:"TXT"},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,4],[9,4],[9,4],[9,7],[17,4],[17,4],[30,2],[30,1],[29,3],[29,1],[26,1],[26,1],[14,5],[14,5],[14,4],[11,1],[34,1],[34,1],[34,1],[34,1],[34,1],[34,1],[27,1]],performAction:function(t,e,r,n,i,a){var s=a.length-1;switch(i){case 3:return n.apply(a[s]),a[s];case 4:this.$=[];break;case 5:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:this.$=a[s];break;case 8:this.$=[];break;case 9:a[s-3].description=a[s-1],this.$=a[s-3];break;case 10:this.$=a[s-1];break;case 12:this.$={type:"activeStart",signalType:n.LINETYPE.ACTIVE_START,actor:a[s-1]};break;case 13:this.$={type:"activeEnd",signalType:n.LINETYPE.ACTIVE_END,actor:a[s-1]};break;case 16:a[s-1].unshift({type:"loopStart",loopText:a[s-2],signalType:n.LINETYPE.LOOP_START}),a[s-1].push({type:"loopEnd",loopText:a[s-2],signalType:n.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 17:a[s-1].unshift({type:"optStart",optText:a[s-2],signalType:n.LINETYPE.OPT_START}),a[s-1].push({type:"optEnd",optText:a[s-2],signalType:n.LINETYPE.OPT_END}),this.$=a[s-1];break;case 18:a[s-4].unshift({type:"altStart",altText:a[s-5],signalType:n.LINETYPE.ALT_START}),a[s-4].push({type:"else",altText:a[s-2],signalType:n.LINETYPE.ALT_ELSE}),a[s-4]=a[s-4].concat(a[s-1]),a[s-4].push({type:"altEnd",signalType:n.LINETYPE.ALT_END}),this.$=a[s-4];break;case 19:this.$=[a[s-1],{type:"addNote",placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 20:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:"addNote",placement:n.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 23:this.$=[a[s-2],a[s]];break;case 24:this.$=a[s];break;case 25:this.$=n.PLACEMENT.LEFTOF;break;case 26:this.$=n.PLACEMENT.RIGHTOF;break;case 27:this.$=[a[s-4],a[s-1],{type:"addMessage",from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:"activeStart",signalType:n.LINETYPE.ACTIVE_START,actor:a[s-1]}];break;case 28:this.$=[a[s-4],a[s-1],{type:"addMessage",from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:"activeEnd",signalType:n.LINETYPE.ACTIVE_END,actor:a[s-4]}];break;case 29:this.$=[a[s-3],a[s-1],{type:"addMessage",from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 30:this.$={type:"addActor",actor:a[s]};break;case 31:this.$=n.LINETYPE.SOLID_OPEN;break;case 32:this.$=n.LINETYPE.DOTTED_OPEN;break;case 33:this.$=n.LINETYPE.SOLID;break;case 34:this.$=n.LINETYPE.DOTTED;break;case 35:this.$=n.LINETYPE.SOLID_CROSS;break;case 36:this.$=n.LINETYPE.DOTTED_CROSS;break;case 37:this.$=a[s].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:r,5:n,6:i},{1:[3]},{3:5,4:r,5:n,6:i},{3:6,4:r,5:n,6:i},e([1,4,5,10,15,16,18,20,22,23,25,37],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:s,5:o,8:8,9:10,10:u,11:21,14:13,15:c,16:l,17:16,18:h,20:d,22:f,23:p,25:g,37:y},e(m,[2,5]),{9:24,10:u,11:21,14:13,15:c,16:l,17:16,18:h,20:d,22:f,23:p,25:g,37:y},e(m,[2,7]),e(m,[2,8]),{11:25,37:y},{5:[1,26]},{11:27,37:y},{11:28,37:y},{5:[1,29]},{4:[1,30]},{13:[1,31]},{13:[1,32]},{13:[1,33]},{34:34,38:[1,35],39:[1,36],40:[1,37],41:[1,38],42:[1,39],43:[1,40]},{26:41,28:[1,42],32:[1,43],33:[1,44]},e([5,12,31,38,39,40,41,42,43,44],[2,30]),e(m,[2,6]),{5:[1,46],12:[1,45]},e(m,[2,11]),{5:[1,47]},{5:[1,48]},e(m,[2,14]),{19:[1,49]},e(v,a,{7:50}),e(v,a,{7:51}),e([4,5,10,15,16,18,20,22,23,24,25,37],a,{7:52}),{11:55,35:[1,53],36:[1,54],37:y},e(b,[2,31]),e(b,[2,32]),e(b,[2,33]),e(b,[2,34]),e(b,[2,35]),e(b,[2,36]),{11:56,37:y},{11:58,29:57,37:y},{37:[2,25]},{37:[2,26]},{13:[1,59]},e(m,[2,10]),e(m,[2,12]),e(m,[2,13]),{5:[1,60]},{4:s,5:o,8:8,9:10,10:u,11:21,14:13,15:c,16:l,17:16,18:h,20:d,21:[1,61],22:f,23:p,25:g,37:y},{4:s,5:o,8:8,9:10,10:u,11:21,14:13,15:c,16:l,17:16,18:h,20:d,21:[1,62],22:f,23:p,25:g,37:y},{4:s,5:o,8:8,9:10,10:u,11:21,14:13,15:c,16:l,17:16,18:h,20:d,22:f,23:p,24:[1,63],25:g,37:y},{11:64,37:y},{11:65,37:y},{27:66,44:_},{27:68,44:_},{27:69,44:_},{31:[1,70],44:[2,24]},{5:[1,71]},e(m,[2,15]),e(m,[2,16]),e(m,[2,17]),{13:[1,72]},{27:73,44:_},{27:74,44:_},{5:[2,29]},{5:[2,37]},{5:[2,19]},{5:[2,20]},{11:75,37:y},e(m,[2,9]),e(v,a,{7:76}),{5:[2,27]},{5:[2,28]},{44:[2,23]},{4:s,5:o,8:8,9:10,10:u,11:21,14:13,15:c,16:l,17:16,18:h,20:d,21:[1,77],22:f,23:p,25:g,37:y},e(m,[2,18])],defaultActions:{5:[2,1],6:[2,2],43:[2,25],44:[2,26],66:[2,29],67:[2,37],68:[2,19],69:[2,20],73:[2,27],74:[2,28],75:[2,23]},parseError:function(t,e){if(!e.recoverable){var r=function(t,e){this.message=t,this.hash=e};throw r.prototype=Error,new r(t,e)}this.trace(t)},parse:function(t){var e=this,r=[0],n=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,_,A,w,x,E,k,D,C=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},F={};;){if(_=r[r.length-1],this.defaultActions[_]?A=this.defaultActions[_]:((null===v||"undefined"==typeof v)&&(v=C()),A=a[_]&&a[_][v]),"undefined"==typeof A||!A.length||!A[0]){var T="";D=[];for(x in a[_])this.terminals_[x]&&x>l&&D.push("'"+this.terminals_[x]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(A[0]){case 1:r.push(v),n.push(f.yytext),i.push(f.yylloc),r.push(A[1]),v=null,b?(v=b,b=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(E=this.productions_[A[1]][1],F.$=n[n.length-E],F._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(F,[s,u,o,p.yy,A[1],n,i].concat(d)),"undefined"!=typeof w)return w;E&&(r=r.slice(0,-1*E*2),n=n.slice(0,-1*E),i=i.slice(0,-1*E)),r.push(this.productions_[A[1]][0]),n.push(F.$),i.push(F._$),k=a[r[r.length-2]][r[r.length-1]],r.push(k);break;case 3:return!0}}return!0}},w=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),n=t[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(t=this.test_match(r,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[n]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,r,n){switch(r){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:return this.begin("ID"),10;case 6:return this.begin("ALIAS"),37;case 7:return this.popState(),this.popState(),this.begin("LINE"),12;case 8:return this.popState(),this.popState(),5;case 9:return this.begin("LINE"),20;case 10:return this.begin("LINE"),22;case 11:return this.begin("LINE"),23;case 12:return this.begin("LINE"),24;case 13:return this.popState(),13;case 14:return 21;case 15:return 32;case 16:return 33;case 17:return 28;case 18:return 25;case 19:return this.begin("ID"),15;case 20:return this.begin("ID"),16;case 21:return 18;case 22:return 6;case 23:return 31;case 24:return 5;case 25:return e.yytext=e.yytext.trim(),37;case 26:return 40;case 27:return 41;case 28:return 38;case 29:return 39;case 30:return 42;case 31:return 43;case 32:return 44;case 33:return 35;case 34:return 36;case 35:return 5;case 36:return"INVALID"}},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,/^(?:[^#\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],conditions:{LINE:{rules:[2,3,13],inclusive:!1},ALIAS:{rules:[2,3,7,8],inclusive:!1},ID:{rules:[2,3,6],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],inclusive:!0}}};return t}();return A.lexer=w,t.prototype=A,A.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),n.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&r.main(n.argv.slice(1)))}).call(this,t("_process"))},{_process:84,fs:1,path:83}],102:[function(t,e,r){(function(e){"use strict";var n={},i=[],a=[],s=t("../../logger"),o=new s.Log;r.addActor=function(t,e,r){var i=n[t];i&&e===i.name&&null==r||(null==r&&(r=e),n[t]={name:e,description:r})},r.addMessage=function(t,e,r,n){i.push({from:t,to:e,message:r,answer:n})},r.addSignal=function(t,e,r,n){o.debug("Adding message from="+t+" to="+e+" message="+r+" type="+n),i.push({from:t,to:e,message:r,type:n})},r.getMessages=function(){return i},r.getActors=function(){return n},r.getActor=function(t){return n[t]},r.getActorKeys=function(){return Object.keys(n)},r.clear=function(){n={},i=[]},r.LINETYPE={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18},r.ARROWTYPE={FILLED:0,OPEN:1},r.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2},r.addNote=function(t,e,n){var s={actor:t,placement:e,message:n},o=[].concat(t,t);a.push(s),i.push({from:o[0],to:o[1],message:n,type:r.LINETYPE.NOTE,placement:e})},r.parseError=function(t,r){e.mermaidAPI.parseError(t,r)},r.apply=function(t){if(t instanceof Array)t.forEach(function(t){r.apply(t)});else switch(t.type){case"addActor":r.addActor(t.actor,t.actor,t.description);break;case"activeStart":r.addSignal(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":r.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":r.addNote(t.actor,t.placement,t.text);break;case"addMessage":r.addSignal(t.from,t.to,t.msg,t.signalType);break;case"loopStart":r.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":r.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":r.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":r.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":r.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":r.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":r.addSignal(void 0,void 0,void 0,t.signalType)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../logger":105}],103:[function(t,e,r){"use strict";var n=t("./parser/sequenceDiagram").parser;n.yy=t("./sequenceDb");var i=t("./svgDraw"),a=t("../../d3"),s=t("../../logger"),o=new s.Log,u={diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!1,bottomMarginAdj:1,activationWidth:10};r.bounds={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],init:function(){this.sequenceItems=[],this.activations=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,r,n){t[e]="undefined"==typeof t[e]?r:n(r,t[e])},updateBounds:function(t,e,n,i){function a(a){return function(c){o++;var l=s.sequenceItems.length-o+1;s.updateVal(c,"starty",e-l*u.boxMargin,Math.min),s.updateVal(c,"stopy",i+l*u.boxMargin,Math.max),s.updateVal(r.bounds.data,"startx",t-l*u.boxMargin,Math.min),s.updateVal(r.bounds.data,"stopx",n+l*u.boxMargin,Math.max),"activation"!=a&&(s.updateVal(c,"startx",t-l*u.boxMargin,Math.min),s.updateVal(c,"stopx",n+l*u.boxMargin,Math.max),s.updateVal(r.bounds.data,"starty",e-l*u.boxMargin,Math.min),s.updateVal(r.bounds.data,"stopy",i+l*u.boxMargin,Math.max))}}var s=this,o=0;this.sequenceItems.forEach(a()),this.activations.forEach(a("activation"))},insert:function(t,e,n,i){var a,s,o,u;a=Math.min(t,n),o=Math.max(t,n),s=Math.min(e,i),u=Math.max(e,i),this.updateVal(r.bounds.data,"startx",a,Math.min),this.updateVal(r.bounds.data,"starty",s,Math.min),this.updateVal(r.bounds.data,"stopx",o,Math.max),this.updateVal(r.bounds.data,"stopy",u,Math.max),this.updateBounds(a,s,o,u)},newActivation:function(t,e){var r=n.yy.getActors()[t.from.actor],a=h(t.from.actor).length,s=r.x+u.width/2+(a-1)*u.activationWidth/2;this.activations.push({startx:s,starty:this.verticalPos+2,stopx:s+u.activationWidth,stopy:void 0,actor:t.from.actor,anchored:i.anchorElement(e)})},endActivation:function(t){var e=this.activations.map(function(t){ +return t.actor}).lastIndexOf(t.from.actor),r=this.activations.splice(e,1)[0];return r},newLoop:function(t){this.sequenceItems.push({startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t})},endLoop:function(){var t=this.sequenceItems.pop();return t},addElseToLoop:function(t){var e=this.sequenceItems.pop();e.elsey=r.bounds.getVerticalPos(),e.elseText=t,this.sequenceItems.push(e)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}};var c=function(t,e,n,a,s){var o=i.getNoteRect();o.x=e,o.y=n,o.width=s||u.width,o["class"]="note";var c=t.append("g"),l=i.drawRect(c,o),h=i.getTextObj();h.x=e-4,h.y=n-13,h.textMargin=u.noteMargin,h.dy="1em",h.text=a.message,h["class"]="noteText";var d=i.drawText(c,h,o.width-u.noteMargin),f=d[0][0].getBBox().height;!s&&f>u.width?(d.remove(),c=t.append("g"),d=i.drawText(c,h,2*o.width-u.noteMargin),f=d[0][0].getBBox().height,l.attr("width",2*o.width),r.bounds.insert(e,n,e+2*o.width,n+2*u.noteMargin+f)):r.bounds.insert(e,n,e+o.width,n+2*u.noteMargin+f),l.attr("height",f+2*u.noteMargin),r.bounds.bumpVerticalPos(f+2*u.noteMargin)},l=function(t,e,i,a,s){var o,c=t.append("g"),l=e+(i-e)/2,h=c.append("text").attr("x",l).attr("y",a-7).style("text-anchor","middle").attr("class","messageText").text(s.message);o="undefined"!=typeof h[0][0].getBBox?h[0][0].getBBox().width:h[0][0].getBoundingClientRect();var d;if(e===i){d=c.append("path").attr("d","M "+e+","+a+" C "+(e+60)+","+(a-10)+" "+(e+60)+","+(a+30)+" "+e+","+(a+20)),r.bounds.bumpVerticalPos(30);var f=Math.max(o/2,100);r.bounds.insert(e-f,r.bounds.getVerticalPos()-10,i+f,r.bounds.getVerticalPos())}else d=c.append("line"),d.attr("x1",e),d.attr("y1",a),d.attr("x2",i),d.attr("y2",a),r.bounds.insert(e,r.bounds.getVerticalPos()-10,i,r.bounds.getVerticalPos());s.type===n.yy.LINETYPE.DOTTED||s.type===n.yy.LINETYPE.DOTTED_CROSS||s.type===n.yy.LINETYPE.DOTTED_OPEN?(d.style("stroke-dasharray","3, 3"),d.attr("class","messageLine1")):d.attr("class","messageLine0");var p="";u.arrowMarkerAbsolute&&(p=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,p=p.replace(/\(/g,"\\("),p=p.replace(/\)/g,"\\)")),d.attr("stroke-width",2),d.attr("stroke","black"),d.style("fill","none"),(s.type===n.yy.LINETYPE.SOLID||s.type===n.yy.LINETYPE.DOTTED)&&d.attr("marker-end","url("+p+"#arrowhead)"),(s.type===n.yy.LINETYPE.SOLID_CROSS||s.type===n.yy.LINETYPE.DOTTED_CROSS)&&d.attr("marker-end","url("+p+"#crosshead)")};e.exports.drawActors=function(t,e,n,a){var s;for(s=0;se&&(n.starty=e-6,e+=12),i.drawActivation(y,n,e,u),r.bounds.insert(n.startx,e-10,n.stopx,e)}n.yy.clear(),n.parse(t+"\n"),r.bounds.init();var f,p,g,y=a.select("#"+s),m=n.yy.getActors(),v=n.yy.getActorKeys(),b=n.yy.getMessages();e.exports.drawActors(y,m,v,0),i.insertArrowHead(y),i.insertArrowCrossHead(y);var _;b.forEach(function(t){var e;switch(t.type){case n.yy.LINETYPE.NOTE:r.bounds.bumpVerticalPos(u.boxMargin),f=m[t.from].x,p=m[t.to].x,t.placement===n.yy.PLACEMENT.RIGHTOF?c(y,f+(u.width+u.actorMargin)/2,r.bounds.getVerticalPos(),t):t.placement===n.yy.PLACEMENT.LEFTOF?c(y,f-(u.width+u.actorMargin)/2,r.bounds.getVerticalPos(),t):t.to===t.from?c(y,f,r.bounds.getVerticalPos(),t):(g=Math.abs(f-p)+u.actorMargin,c(y,(f+p+u.width-g)/2,r.bounds.getVerticalPos(),t,g));break;case n.yy.LINETYPE.ACTIVE_START:r.bounds.newActivation(t,y);break;case n.yy.LINETYPE.ACTIVE_END:h(t,r.bounds.getVerticalPos());break;case n.yy.LINETYPE.LOOP_START:r.bounds.bumpVerticalPos(u.boxMargin),r.bounds.newLoop(t.message),r.bounds.bumpVerticalPos(u.boxMargin+u.boxTextMargin);break;case n.yy.LINETYPE.LOOP_END:e=r.bounds.endLoop(),i.drawLoop(y,e,"loop",u),r.bounds.bumpVerticalPos(u.boxMargin);break;case n.yy.LINETYPE.OPT_START:r.bounds.bumpVerticalPos(u.boxMargin),r.bounds.newLoop(t.message),r.bounds.bumpVerticalPos(u.boxMargin+u.boxTextMargin);break;case n.yy.LINETYPE.OPT_END:e=r.bounds.endLoop(),i.drawLoop(y,e,"opt",u),r.bounds.bumpVerticalPos(u.boxMargin);break;case n.yy.LINETYPE.ALT_START:r.bounds.bumpVerticalPos(u.boxMargin),r.bounds.newLoop(t.message),r.bounds.bumpVerticalPos(u.boxMargin+u.boxTextMargin);break;case n.yy.LINETYPE.ALT_ELSE:r.bounds.bumpVerticalPos(u.boxMargin),e=r.bounds.addElseToLoop(t.message),r.bounds.bumpVerticalPos(u.boxMargin);break;case n.yy.LINETYPE.ALT_END:e=r.bounds.endLoop(),i.drawLoop(y,e,"alt",u),r.bounds.bumpVerticalPos(u.boxMargin);break;default:try{_=t,r.bounds.bumpVerticalPos(u.messageMargin);var a=d(t.from),s=d(t.to),o=a[0]<=s[0]?1:0,v=a[0]/gi," "),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.attr("fill",e.fill),"undefined"!=typeof e["class"]&&i.attr("class",e["class"]);var a=i.append("tspan");return a.attr("x",e.x+2*e.textMargin),a.text(n),"undefined"!=typeof i.textwrap&&i.textwrap({x:e.x,y:e.y,width:r,height:1800},e.textMargin),i},r.drawLabel=function(t,e){var n=r.getNoteRect();n.x=e.x,n.y=e.y,n.width=50,n.height=20,n.fill="#526e52",n.stroke="none",n["class"]="labelBox",r.drawRect(t,n),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,e.fill="white",r.drawText(t,e)};var n=-1;r.drawActor=function(t,e,i,a,s){var o=e+s.width/2,u=t.append("g");0===i&&(n++,u.append("line").attr("id","actor"+n).attr("x1",o).attr("y1",5).attr("x2",o).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"));var c=r.getNoteRect();c.x=e,c.y=i,c.fill="#eaeaea",c.width=s.width,c.height=s.height,c["class"]="actor",c.rx=3,c.ry=3,r.drawRect(u,c),u.append("text").attr("x",o).attr("y",i+s.height/2+5).attr("class","actor").style("text-anchor","middle").text(a)},r.anchorElement=function(t){return t.append("g")},r.drawActivation=function(t,e,n){var i=r.getNoteRect(),a=e.anchored;i.x=e.startx,i.y=e.starty,i.fill="#f4f4f4",i.width=e.stopx-e.startx,i.height=n-e.starty,r.drawRect(a,i)},r.drawLoop=function(t,e,n,i){var a=t.append("g"),s=function(t,e,r,n){a.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",n).attr("stroke-width",2).attr("stroke","#526e52").attr("class","loopLine")};s(e.startx,e.starty,e.stopx,e.starty),s(e.stopx,e.starty,e.stopx,e.stopy),s(e.startx,e.stopy,e.stopx,e.stopy),s(e.startx,e.starty,e.startx,e.stopy),"undefined"!=typeof e.elsey&&s(e.startx,e.elsey,e.stopx,e.elsey);var o=r.getTextObj();o.text=n,o.x=e.startx,o.y=e.starty,o.labelMargin=15,o["class"]="labelText",o.fill="white",r.drawLabel(a,o),o=r.getTextObj(),o.text="[ "+e.title+" ]",o.x=e.startx+(e.stopx-e.startx)/2,o.y=e.starty+1.5*i.boxMargin,o.anchor="middle",o["class"]="loopText",r.drawText(a,o),"undefined"!=typeof e.elseText&&(o.text="[ "+e.elseText+" ]",o.y=e.elsey+1.5*i.boxMargin,r.drawText(a,o))},r.insertArrowHead=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},r.insertArrowCrossHead=function(t){var e=t.append("defs"),r=e.append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);r.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"),r.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")},r.getTextObj=function(){var t={x:0,y:0,fill:"black","text-anchor":"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0};return t},r.getNoteRect=function(){var t={x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0};return t}},{}],105:[function(t,e,r){"use strict";function n(t){var e=t.getUTCHours(),r=t.getUTCMinutes(),n=t.getSeconds(),i=t.getMilliseconds();10>e&&(e="0"+e),10>r&&(r="0"+r),10>n&&(n="0"+n),100>i&&(i="0"+i),10>i&&(i="00"+i);var a=e+":"+r+":"+n+" ("+i+")";return a}function i(t){this.level=t,this.log=function(t,e){var r=this.level;return"undefined"==typeof r&&(r=s),e>=r&&"undefined"!=typeof console&&"undefined"!=typeof console.log?console.log("["+n(new Date)+"] "+t):void 0},this.trace=function(t){this.log(t,a.trace)},this.debug=function(t){this.log(t,a.debug)},this.info=function(t){this.log(t,a.info)},this.warn=function(t){this.log(t,a.warn)},this.error=function(t){this.log(t,a.error)}}var a={debug:1,info:2,warn:3,error:4,fatal:5,"default":5},s=a.error;r.setLogLevel=function(t){s=t},r.Log=i},{}],106:[function(t,e,r){(function(n){"use strict";var i=t("./logger"),a=new i.Log,s=t("./mermaidAPI"),o=0,u=t("he");e.exports.mermaidAPI=s;var c=function(){var t=s.getConfig();a.debug("Starting rendering diagrams");var e;arguments.length>=2?("undefined"!=typeof arguments[0]&&(n.mermaid.sequenceConfig=arguments[0]),e=arguments[1]):e=arguments[0];var r;"function"==typeof arguments[arguments.length-1]?(r=arguments[arguments.length-1],a.debug("Callback function found")):"undefined"!=typeof t.mermaid&&("function"==typeof t.mermaid.callback?(r=t.mermaid.callback,a.debug("Callback function found")):a.debug("No Callback function found")),e=void 0===e?document.querySelectorAll(".mermaid"):"string"==typeof e?document.querySelectorAll(e):e instanceof Node?[e]:e;var i;"undefined"!=typeof mermaid_config&&s.initialize(n.mermaid_config),a.debug("Start On Load before: "+n.mermaid.startOnLoad),"undefined"!=typeof n.mermaid.startOnLoad&&(a.debug("Start On Load inner: "+n.mermaid.startOnLoad),s.initialize({startOnLoad:n.mermaid.startOnLoad})),"undefined"!=typeof n.mermaid.ganttConfig&&s.initialize({gantt:n.mermaid.ganttConfig});var c,l=function(t,e){h.innerHTML=t,"undefined"!=typeof r&&r(d),e(h)};for(i=0;i0&&(n+=r.selectorText+" { "+r.style.cssText+"}\n")}}catch(l){"undefined"!=typeof r&&i.warn('Invalid CSS selector "'+r.selectorText+'"',l)}var h="",d="";for(var f in e)e.hasOwnProperty(f)&&"undefined"!=typeof f&&("default"===f?(e["default"].styles instanceof Array&&(h+="#"+t.id.trim()+" .node>rect { "+e[f].styles.join("; ")+"; }\n"),e["default"].nodeLabelStyles instanceof Array&&(h+="#"+t.id.trim()+" .node text { "+e[f].nodeLabelStyles.join("; ")+"; }\n"),e["default"].edgeLabelStyles instanceof Array&&(h+="#"+t.id.trim()+" .edgeLabel text { "+e[f].edgeLabelStyles.join("; ")+"; }\n"),e["default"].clusterStyles instanceof Array&&(h+="#"+t.id.trim()+" .cluster rect { "+e[f].clusterStyles.join("; ")+"; }\n")):e[f].styles instanceof Array&&(d+="#"+t.id.trim()+" ."+f+">rect, ."+f+">polygon, ."+f+">ellipse { "+e[f].styles.join("; ")+"; }\n"));if(""!==n||""!==h||""!==d){var p=document.createElement("style");p.setAttribute("type","text/css"),p.setAttribute("title","mermaid-svg-internal-css"),p.innerHTML="/* */\n",t.insertBefore(p,t.firstChild)}};r.cloneCssStyles=s},{"./logger":105}]},{},[106])(106)}); \ No newline at end of file diff --git a/dist/mermaidAPI.js b/dist/mermaidAPI.js index 9397d28e1..42397d0f9 100644 --- a/dist/mermaidAPI.js +++ b/dist/mermaidAPI.js @@ -1,322 +1,6 @@ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.mermaidAPI=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0 - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift('..'); - } - } - - return parts; -} - -// Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; -var splitPath = function(filename) { - return splitPathRe.exec(filename).slice(1); -}; - -// path.resolve([from ...], to) -// posix version -exports.resolve = function() { - var resolvedPath = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) ? arguments[i] : process.cwd(); - - // Skip empty and invalid entries - if (typeof path !== 'string') { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - continue; - } - - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; - } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path - resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { - return !!p; - }), !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; -}; - -// path.normalize(path) -// posix version -exports.normalize = function(path) { - var isAbsolute = exports.isAbsolute(path), - trailingSlash = substr(path, -1) === '/'; - - // Normalize the path - path = normalizeArray(filter(path.split('/'), function(p) { - return !!p; - }), !isAbsolute).join('/'); - - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - - return (isAbsolute ? '/' : '') + path; -}; - -// posix version -exports.isAbsolute = function(path) { - return path.charAt(0) === '/'; -}; - -// posix version -exports.join = function() { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(filter(paths, function(p, index) { - if (typeof p !== 'string') { - throw new TypeError('Arguments to path.join must be strings'); - } - return p; - }).join('/')); -}; - - -// path.relative(from, to) -// posix version -exports.relative = function(from, to) { - from = exports.resolve(from).substr(1); - to = exports.resolve(to).substr(1); - - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') break; - } - - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') break; - } - - if (start > end) return []; - return arr.slice(start, end - start + 1); - } - - var fromParts = trim(from.split('/')); - var toParts = trim(to.split('/')); - - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('/'); -}; - -exports.sep = '/'; -exports.delimiter = ':'; - -exports.dirname = function(path) { - var result = splitPath(path), - root = result[0], - dir = result[1]; - - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } - - return root + dir; -}; - - -exports.basename = function(path, ext) { - var f = splitPath(path)[2]; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -exports.extname = function(path) { - return splitPath(path)[3]; -}; - -function filter (xs, f) { - if (xs.filter) return xs.filter(f); - var res = []; - for (var i = 0; i < xs.length; i++) { - if (f(xs[i], i, xs)) res.push(xs[i]); - } - return res; -} - -// String.prototype.substr - negative index don't work in IE8 -var substr = 'ab'.substr(-1) === 'b' - ? function (str, start, len) { return str.substr(start, len) } - : function (str, start, len) { - if (start < 0) start = str.length + start; - return str.substr(start, len); - } -; - -}).call(this,require('_process')) -},{"_process":3}],3:[function(require,module,exports){ -// shim for using process in browser - -var process = module.exports = {}; - -process.nextTick = (function () { - var canSetImmediate = typeof window !== 'undefined' - && window.setImmediate; - var canMutationObserver = typeof window !== 'undefined' - && window.MutationObserver; - var canPost = typeof window !== 'undefined' - && window.postMessage && window.addEventListener - ; - - if (canSetImmediate) { - return function (f) { return window.setImmediate(f) }; - } - - var queue = []; - - if (canMutationObserver) { - var hiddenDiv = document.createElement("div"); - var observer = new MutationObserver(function () { - var queueList = queue.slice(); - queue.length = 0; - queueList.forEach(function (fn) { - fn(); - }); - }); - - observer.observe(hiddenDiv, { attributes: true }); - - return function nextTick(fn) { - if (!queue.length) { - hiddenDiv.setAttribute('yes', 'no'); - } - queue.push(fn); - }; - } - - if (canPost) { - window.addEventListener('message', function (ev) { - var source = ev.source; - if ((source === window || source === null) && ev.data === 'process-tick') { - ev.stopPropagation(); - if (queue.length > 0) { - var fn = queue.shift(); - fn(); - } - } - }, true); - - return function nextTick(fn) { - queue.push(fn); - window.postMessage('process-tick', '*'); - }; - } - - return function nextTick(fn) { - setTimeout(fn, 0); - }; -})(); - -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -// TODO(shtylman) -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; - -},{}],4:[function(require,module,exports){ !function() { var d3 = { version: "3.5.6" @@ -9821,7 +9505,7 @@ process.chdir = function (dir) { if (typeof define === "function" && define.amd) define(d3); else if (typeof module === "object" && module.exports) module.exports = d3; this.d3 = d3; }(); -},{}],5:[function(require,module,exports){ +},{}],3:[function(require,module,exports){ /** * @license * Copyright (c) 2012-2013 Chris Pettitt @@ -9853,7 +9537,7 @@ module.exports = { version: require("./lib/version") }; -},{"./lib/dagre":12,"./lib/graphlib":13,"./lib/intersect":14,"./lib/render":29,"./lib/util":31,"./lib/version":32}],6:[function(require,module,exports){ +},{"./lib/dagre":10,"./lib/graphlib":11,"./lib/intersect":12,"./lib/render":27,"./lib/util":29,"./lib/version":30}],4:[function(require,module,exports){ var util = require("./util"); module.exports = { @@ -9917,7 +9601,7 @@ function undirected(parent, id, edge, type) { util.applyStyle(path, edge[type + "Style"]); } -},{"./util":31}],7:[function(require,module,exports){ +},{"./util":29}],5:[function(require,module,exports){ var util = require("./util"), addLabel = require("./label/add-label"); @@ -9962,7 +9646,7 @@ function createClusters(selection, g) { return svgClusters; } -},{"./label/add-label":22,"./util":31}],8:[function(require,module,exports){ +},{"./label/add-label":20,"./util":29}],6:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -9999,7 +9683,7 @@ function createEdgeLabels(selection, g) { return svgEdgeLabels; } -},{"./d3":11,"./label/add-label":22,"./lodash":25,"./util":31}],9:[function(require,module,exports){ +},{"./d3":9,"./label/add-label":20,"./lodash":23,"./util":29}],7:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -10131,7 +9815,7 @@ function exit(svgPaths, g) { }); } -},{"./d3":11,"./intersect/intersect-node":18,"./lodash":25,"./util":31}],10:[function(require,module,exports){ +},{"./d3":9,"./intersect/intersect-node":16,"./lodash":23,"./util":29}],8:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -10191,11 +9875,11 @@ function createNodes(selection, g, shapes) { return svgNodes; } -},{"./d3":11,"./label/add-label":22,"./lodash":25,"./util":31}],11:[function(require,module,exports){ +},{"./d3":9,"./label/add-label":20,"./lodash":23,"./util":29}],9:[function(require,module,exports){ // Stub to get D3 either via NPM or from the global object module.exports = window.d3; -},{}],12:[function(require,module,exports){ +},{}],10:[function(require,module,exports){ /* global window */ var dagre; @@ -10212,7 +9896,7 @@ if (!dagre) { module.exports = dagre; -},{"dagre":54}],13:[function(require,module,exports){ +},{"dagre":31}],11:[function(require,module,exports){ /* global window */ var graphlib; @@ -10229,7 +9913,7 @@ if (!graphlib) { module.exports = graphlib; -},{"graphlib":33}],14:[function(require,module,exports){ +},{"graphlib":61}],12:[function(require,module,exports){ module.exports = { node: require("./intersect-node"), circle: require("./intersect-circle"), @@ -10238,7 +9922,7 @@ module.exports = { rect: require("./intersect-rect") }; -},{"./intersect-circle":15,"./intersect-ellipse":16,"./intersect-node":18,"./intersect-polygon":19,"./intersect-rect":20}],15:[function(require,module,exports){ +},{"./intersect-circle":13,"./intersect-ellipse":14,"./intersect-node":16,"./intersect-polygon":17,"./intersect-rect":18}],13:[function(require,module,exports){ var intersectEllipse = require("./intersect-ellipse"); module.exports = intersectCircle; @@ -10247,7 +9931,7 @@ function intersectCircle(node, rx, point) { return intersectEllipse(node, rx, rx, point); } -},{"./intersect-ellipse":16}],16:[function(require,module,exports){ +},{"./intersect-ellipse":14}],14:[function(require,module,exports){ module.exports = intersectEllipse; function intersectEllipse(node, rx, ry, point) { @@ -10274,7 +9958,7 @@ function intersectEllipse(node, rx, ry, point) { } -},{}],17:[function(require,module,exports){ +},{}],15:[function(require,module,exports){ module.exports = intersectLine; /* @@ -10346,14 +10030,14 @@ function sameSign(r1, r2) { return r1 * r2 > 0; } -},{}],18:[function(require,module,exports){ +},{}],16:[function(require,module,exports){ module.exports = intersectNode; function intersectNode(node, point) { return node.intersect(point); } -},{}],19:[function(require,module,exports){ +},{}],17:[function(require,module,exports){ var intersectLine = require("./intersect-line"); module.exports = intersectPolygon; @@ -10410,7 +10094,7 @@ function intersectPolygon(node, polyPoints, point) { return intersections[0]; } -},{"./intersect-line":17}],20:[function(require,module,exports){ +},{"./intersect-line":15}],18:[function(require,module,exports){ module.exports = intersectRect; function intersectRect(node, point) { @@ -10444,7 +10128,7 @@ function intersectRect(node, point) { return {x: x + sx, y: y + sy}; } -},{}],21:[function(require,module,exports){ +},{}],19:[function(require,module,exports){ var util = require("../util"); module.exports = addHtmlLabel; @@ -10489,7 +10173,7 @@ function addHtmlLabel(root, node) { return fo; } -},{"../util":31}],22:[function(require,module,exports){ +},{"../util":29}],20:[function(require,module,exports){ var addTextLabel = require("./add-text-label"), addHtmlLabel = require("./add-html-label"), addSVGLabel = require("./add-svg-label"); @@ -10528,7 +10212,7 @@ function addLabel(root, node, location) { return labelSvg; } -},{"./add-html-label":21,"./add-svg-label":23,"./add-text-label":24}],23:[function(require,module,exports){ +},{"./add-html-label":19,"./add-svg-label":21,"./add-text-label":22}],21:[function(require,module,exports){ var util = require("../util"); module.exports = addSVGLabel; @@ -10543,7 +10227,7 @@ function addSVGLabel(root, node) { return domNode; } -},{"../util":31}],24:[function(require,module,exports){ +},{"../util":29}],22:[function(require,module,exports){ var util = require("../util"); module.exports = addTextLabel; @@ -10590,7 +10274,7 @@ function processEscapeSequences(text) { return newText; } -},{"../util":31}],25:[function(require,module,exports){ +},{"../util":29}],23:[function(require,module,exports){ /* global window */ var lodash; @@ -10607,7 +10291,7 @@ if (!lodash) { module.exports = lodash; -},{"lodash":53}],26:[function(require,module,exports){ +},{"lodash":81}],24:[function(require,module,exports){ "use strict"; var util = require("./util"), @@ -10643,7 +10327,7 @@ function positionClusters(selection, g) { } -},{"./d3":11,"./util":31}],27:[function(require,module,exports){ +},{"./d3":9,"./util":29}],25:[function(require,module,exports){ "use strict"; var util = require("./util"), @@ -10667,7 +10351,7 @@ function positionEdgeLabels(selection, g) { .attr("transform", translate); } -},{"./d3":11,"./lodash":25,"./util":31}],28:[function(require,module,exports){ +},{"./d3":9,"./lodash":23,"./util":29}],26:[function(require,module,exports){ "use strict"; var util = require("./util"), @@ -10690,7 +10374,7 @@ function positionNodes(selection, g) { .attr("transform", translate); } -},{"./d3":11,"./util":31}],29:[function(require,module,exports){ +},{"./d3":9,"./util":29}],27:[function(require,module,exports){ var _ = require("./lodash"), layout = require("./dagre").layout; @@ -10859,7 +10543,7 @@ function createOrSelectGroup(root, name) { return selection; } -},{"./arrows":6,"./create-clusters":7,"./create-edge-labels":8,"./create-edge-paths":9,"./create-nodes":10,"./dagre":12,"./lodash":25,"./position-clusters":26,"./position-edge-labels":27,"./position-nodes":28,"./shapes":30}],30:[function(require,module,exports){ +},{"./arrows":4,"./create-clusters":5,"./create-edge-labels":6,"./create-edge-paths":7,"./create-nodes":8,"./dagre":10,"./lodash":23,"./position-clusters":24,"./position-edge-labels":25,"./position-nodes":26,"./shapes":28}],28:[function(require,module,exports){ "use strict"; var intersectRect = require("./intersect/intersect-rect"), @@ -10942,7 +10626,7 @@ function diamond(parent, bbox, node) { return shapeSvg; } -},{"./intersect/intersect-circle":15,"./intersect/intersect-ellipse":16,"./intersect/intersect-polygon":19,"./intersect/intersect-rect":20}],31:[function(require,module,exports){ +},{"./intersect/intersect-circle":13,"./intersect/intersect-ellipse":14,"./intersect/intersect-polygon":17,"./intersect/intersect-rect":18}],29:[function(require,module,exports){ var _ = require("./lodash"); // Public utility functions @@ -10998,10 +10682,2912 @@ function applyTransition(selection, g) { return selection; } -},{"./lodash":25}],32:[function(require,module,exports){ +},{"./lodash":23}],30:[function(require,module,exports){ module.exports = "0.4.10"; -},{}],33:[function(require,module,exports){ +},{}],31:[function(require,module,exports){ +/* +Copyright (c) 2012-2014 Chris Pettitt + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +module.exports = { + graphlib: require("./lib/graphlib"), + + layout: require("./lib/layout"), + debug: require("./lib/debug"), + util: { + time: require("./lib/util").time, + notime: require("./lib/util").notime + }, + version: require("./lib/version") +}; + +},{"./lib/debug":36,"./lib/graphlib":37,"./lib/layout":39,"./lib/util":59,"./lib/version":60}],32:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"), + greedyFAS = require("./greedy-fas"); + +module.exports = { + run: run, + undo: undo +}; + +function run(g) { + var fas = (g.graph().acyclicer === "greedy" + ? greedyFAS(g, weightFn(g)) + : dfsFAS(g)); + _.each(fas, function(e) { + var label = g.edge(e); + g.removeEdge(e); + label.forwardName = e.name; + label.reversed = true; + g.setEdge(e.w, e.v, label, _.uniqueId("rev")); + }); + + function weightFn(g) { + return function(e) { + return g.edge(e).weight; + }; + } +} + +function dfsFAS(g) { + var fas = [], + stack = {}, + visited = {}; + + function dfs(v) { + if (_.has(visited, v)) { + return; + } + visited[v] = true; + stack[v] = true; + _.each(g.outEdges(v), function(e) { + if (_.has(stack, e.w)) { + fas.push(e); + } else { + dfs(e.w); + } + }); + delete stack[v]; + } + + _.each(g.nodes(), dfs); + return fas; +} + +function undo(g) { + _.each(g.edges(), function(e) { + var label = g.edge(e); + if (label.reversed) { + g.removeEdge(e); + + var forwardName = label.forwardName; + delete label.reversed; + delete label.forwardName; + g.setEdge(e.w, e.v, label, forwardName); + } + }); +} + +},{"./greedy-fas":38,"./lodash":40}],33:[function(require,module,exports){ +var _ = require("./lodash"), + util = require("./util"); + +module.exports = addBorderSegments; + +function addBorderSegments(g) { + function dfs(v) { + var children = g.children(v), + node = g.node(v); + if (children.length) { + _.each(children, dfs); + } + + if (_.has(node, "minRank")) { + node.borderLeft = []; + node.borderRight = []; + for (var rank = node.minRank, maxRank = node.maxRank + 1; + rank < maxRank; + ++rank) { + addBorderNode(g, "borderLeft", "_bl", v, node, rank); + addBorderNode(g, "borderRight", "_br", v, node, rank); + } + } + } + + _.each(g.children(), dfs); +} + +function addBorderNode(g, prop, prefix, sg, sgNode, rank) { + var label = { width: 0, height: 0, rank: rank, borderType: prop }, + prev = sgNode[prop][rank - 1], + curr = util.addDummyNode(g, "border", label, prefix); + sgNode[prop][rank] = curr; + g.setParent(curr, sg); + if (prev) { + g.setEdge(prev, curr, { weight: 1 }); + } +} + +},{"./lodash":40,"./util":59}],34:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"); + +module.exports = { + adjust: adjust, + undo: undo +}; + +function adjust(g) { + var rankDir = g.graph().rankdir.toLowerCase(); + if (rankDir === "lr" || rankDir === "rl") { + swapWidthHeight(g); + } +} + +function undo(g) { + var rankDir = g.graph().rankdir.toLowerCase(); + if (rankDir === "bt" || rankDir === "rl") { + reverseY(g); + } + + if (rankDir === "lr" || rankDir === "rl") { + swapXY(g); + swapWidthHeight(g); + } +} + +function swapWidthHeight(g) { + _.each(g.nodes(), function(v) { swapWidthHeightOne(g.node(v)); }); + _.each(g.edges(), function(e) { swapWidthHeightOne(g.edge(e)); }); +} + +function swapWidthHeightOne(attrs) { + var w = attrs.width; + attrs.width = attrs.height; + attrs.height = w; +} + +function reverseY(g) { + _.each(g.nodes(), function(v) { reverseYOne(g.node(v)); }); + + _.each(g.edges(), function(e) { + var edge = g.edge(e); + _.each(edge.points, reverseYOne); + if (_.has(edge, "y")) { + reverseYOne(edge); + } + }); +} + +function reverseYOne(attrs) { + attrs.y = -attrs.y; +} + +function swapXY(g) { + _.each(g.nodes(), function(v) { swapXYOne(g.node(v)); }); + + _.each(g.edges(), function(e) { + var edge = g.edge(e); + _.each(edge.points, swapXYOne); + if (_.has(edge, "x")) { + swapXYOne(edge); + } + }); +} + +function swapXYOne(attrs) { + var x = attrs.x; + attrs.x = attrs.y; + attrs.y = x; +} + +},{"./lodash":40}],35:[function(require,module,exports){ +/* + * Simple doubly linked list implementation derived from Cormen, et al., + * "Introduction to Algorithms". + */ + +module.exports = List; + +function List() { + var sentinel = {}; + sentinel._next = sentinel._prev = sentinel; + this._sentinel = sentinel; +} + +List.prototype.dequeue = function() { + var sentinel = this._sentinel, + entry = sentinel._prev; + if (entry !== sentinel) { + unlink(entry); + return entry; + } +}; + +List.prototype.enqueue = function(entry) { + var sentinel = this._sentinel; + if (entry._prev && entry._next) { + unlink(entry); + } + entry._next = sentinel._next; + sentinel._next._prev = entry; + sentinel._next = entry; + entry._prev = sentinel; +}; + +List.prototype.toString = function() { + var strs = [], + sentinel = this._sentinel, + curr = sentinel._prev; + while (curr !== sentinel) { + strs.push(JSON.stringify(curr, filterOutLinks)); + curr = curr._prev; + } + return "[" + strs.join(", ") + "]"; +}; + +function unlink(entry) { + entry._prev._next = entry._next; + entry._next._prev = entry._prev; + delete entry._next; + delete entry._prev; +} + +function filterOutLinks(k, v) { + if (k !== "_next" && k !== "_prev") { + return v; + } +} + +},{}],36:[function(require,module,exports){ +var _ = require("./lodash"), + util = require("./util"), + Graph = require("./graphlib").Graph; + +module.exports = { + debugOrdering: debugOrdering +}; + +/* istanbul ignore next */ +function debugOrdering(g) { + var layerMatrix = util.buildLayerMatrix(g); + + var h = new Graph({ compound: true, multigraph: true }).setGraph({}); + + _.each(g.nodes(), function(v) { + h.setNode(v, { label: v }); + h.setParent(v, "layer" + g.node(v).rank); + }); + + _.each(g.edges(), function(e) { + h.setEdge(e.v, e.w, {}, e.name); + }); + + _.each(layerMatrix, function(layer, i) { + var layerV = "layer" + i; + h.setNode(layerV, { rank: "same" }); + _.reduce(layer, function(u, v) { + h.setEdge(u, v, { style: "invis" }); + return v; + }); + }); + + return h; +} + +},{"./graphlib":37,"./lodash":40,"./util":59}],37:[function(require,module,exports){ +/* global window */ + +var graphlib; + +if (typeof require === "function") { + try { + graphlib = require("graphlib"); + } catch (e) {} +} + +if (!graphlib) { + graphlib = window.graphlib; +} + +module.exports = graphlib; + +},{"graphlib":61}],38:[function(require,module,exports){ +var _ = require("./lodash"), + Graph = require("./graphlib").Graph, + List = require("./data/list"); + +/* + * A greedy heuristic for finding a feedback arc set for a graph. A feedback + * arc set is a set of edges that can be removed to make a graph acyclic. + * The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, "A fast and + * effective heuristic for the feedback arc set problem." This implementation + * adjusts that from the paper to allow for weighted edges. + */ +module.exports = greedyFAS; + +var DEFAULT_WEIGHT_FN = _.constant(1); + +function greedyFAS(g, weightFn) { + if (g.nodeCount() <= 1) { + return []; + } + var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN); + var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx); + + // Expand multi-edges + return _.flatten(_.map(results, function(e) { + return g.outEdges(e.v, e.w); + }), true); +} + +function doGreedyFAS(g, buckets, zeroIdx) { + var results = [], + sources = buckets[buckets.length - 1], + sinks = buckets[0]; + + var entry; + while (g.nodeCount()) { + while ((entry = sinks.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } + while ((entry = sources.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } + if (g.nodeCount()) { + for (var i = buckets.length - 2; i > 0; --i) { + entry = buckets[i].dequeue(); + if (entry) { + results = results.concat(removeNode(g, buckets, zeroIdx, entry, true)); + break; + } + } + } + } + + return results; +} + +function removeNode(g, buckets, zeroIdx, entry, collectPredecessors) { + var results = collectPredecessors ? [] : undefined; + + _.each(g.inEdges(entry.v), function(edge) { + var weight = g.edge(edge), + uEntry = g.node(edge.v); + + if (collectPredecessors) { + results.push({ v: edge.v, w: edge.w }); + } + + uEntry.out -= weight; + assignBucket(buckets, zeroIdx, uEntry); + }); + + _.each(g.outEdges(entry.v), function(edge) { + var weight = g.edge(edge), + w = edge.w, + wEntry = g.node(w); + wEntry["in"] -= weight; + assignBucket(buckets, zeroIdx, wEntry); + }); + + g.removeNode(entry.v); + + return results; +} + +function buildState(g, weightFn) { + var fasGraph = new Graph(), + maxIn = 0, + maxOut = 0; + + _.each(g.nodes(), function(v) { + fasGraph.setNode(v, { v: v, "in": 0, out: 0 }); + }); + + // Aggregate weights on nodes, but also sum the weights across multi-edges + // into a single edge for the fasGraph. + _.each(g.edges(), function(e) { + var prevWeight = fasGraph.edge(e.v, e.w) || 0, + weight = weightFn(e), + edgeWeight = prevWeight + weight; + fasGraph.setEdge(e.v, e.w, edgeWeight); + maxOut = Math.max(maxOut, fasGraph.node(e.v).out += weight); + maxIn = Math.max(maxIn, fasGraph.node(e.w)["in"] += weight); + }); + + var buckets = _.range(maxOut + maxIn + 3).map(function() { return new List(); }); + var zeroIdx = maxIn + 1; + + _.each(fasGraph.nodes(), function(v) { + assignBucket(buckets, zeroIdx, fasGraph.node(v)); + }); + + return { graph: fasGraph, buckets: buckets, zeroIdx: zeroIdx }; +} + +function assignBucket(buckets, zeroIdx, entry) { + if (!entry.out) { + buckets[0].enqueue(entry); + } else if (!entry["in"]) { + buckets[buckets.length - 1].enqueue(entry); + } else { + buckets[entry.out - entry["in"] + zeroIdx].enqueue(entry); + } +} + +},{"./data/list":35,"./graphlib":37,"./lodash":40}],39:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"), + acyclic = require("./acyclic"), + normalize = require("./normalize"), + rank = require("./rank"), + normalizeRanks = require("./util").normalizeRanks, + parentDummyChains = require("./parent-dummy-chains"), + removeEmptyRanks = require("./util").removeEmptyRanks, + nestingGraph = require("./nesting-graph"), + addBorderSegments = require("./add-border-segments"), + coordinateSystem = require("./coordinate-system"), + order = require("./order"), + position = require("./position"), + util = require("./util"), + Graph = require("./graphlib").Graph; + +module.exports = layout; + +function layout(g, opts) { + var time = opts && opts.debugTiming ? util.time : util.notime; + time("layout", function() { + var layoutGraph = time(" buildLayoutGraph", + function() { return buildLayoutGraph(g); }); + time(" runLayout", function() { runLayout(layoutGraph, time); }); + time(" updateInputGraph", function() { updateInputGraph(g, layoutGraph); }); + }); +} + +function runLayout(g, time) { + time(" makeSpaceForEdgeLabels", function() { makeSpaceForEdgeLabels(g); }); + time(" removeSelfEdges", function() { removeSelfEdges(g); }); + time(" acyclic", function() { acyclic.run(g); }); + time(" nestingGraph.run", function() { nestingGraph.run(g); }); + time(" rank", function() { rank(util.asNonCompoundGraph(g)); }); + time(" injectEdgeLabelProxies", function() { injectEdgeLabelProxies(g); }); + time(" removeEmptyRanks", function() { removeEmptyRanks(g); }); + time(" nestingGraph.cleanup", function() { nestingGraph.cleanup(g); }); + time(" normalizeRanks", function() { normalizeRanks(g); }); + time(" assignRankMinMax", function() { assignRankMinMax(g); }); + time(" removeEdgeLabelProxies", function() { removeEdgeLabelProxies(g); }); + time(" normalize.run", function() { normalize.run(g); }); + time(" parentDummyChains", function() { parentDummyChains(g); }); + time(" addBorderSegments", function() { addBorderSegments(g); }); + time(" order", function() { order(g); }); + time(" insertSelfEdges", function() { insertSelfEdges(g); }); + time(" adjustCoordinateSystem", function() { coordinateSystem.adjust(g); }); + time(" position", function() { position(g); }); + time(" positionSelfEdges", function() { positionSelfEdges(g); }); + time(" removeBorderNodes", function() { removeBorderNodes(g); }); + time(" normalize.undo", function() { normalize.undo(g); }); + time(" fixupEdgeLabelCoords", function() { fixupEdgeLabelCoords(g); }); + time(" undoCoordinateSystem", function() { coordinateSystem.undo(g); }); + time(" translateGraph", function() { translateGraph(g); }); + time(" assignNodeIntersects", function() { assignNodeIntersects(g); }); + time(" reversePoints", function() { reversePointsForReversedEdges(g); }); + time(" acyclic.undo", function() { acyclic.undo(g); }); +} + +/* + * Copies final layout information from the layout graph back to the input + * graph. This process only copies whitelisted attributes from the layout graph + * to the input graph, so it serves as a good place to determine what + * attributes can influence layout. + */ +function updateInputGraph(inputGraph, layoutGraph) { + _.each(inputGraph.nodes(), function(v) { + var inputLabel = inputGraph.node(v), + layoutLabel = layoutGraph.node(v); + + if (inputLabel) { + inputLabel.x = layoutLabel.x; + inputLabel.y = layoutLabel.y; + + if (layoutGraph.children(v).length) { + inputLabel.width = layoutLabel.width; + inputLabel.height = layoutLabel.height; + } + } + }); + + _.each(inputGraph.edges(), function(e) { + var inputLabel = inputGraph.edge(e), + layoutLabel = layoutGraph.edge(e); + + inputLabel.points = layoutLabel.points; + if (_.has(layoutLabel, "x")) { + inputLabel.x = layoutLabel.x; + inputLabel.y = layoutLabel.y; + } + }); + + inputGraph.graph().width = layoutGraph.graph().width; + inputGraph.graph().height = layoutGraph.graph().height; +} + +var graphNumAttrs = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], + graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, + graphAttrs = ["acyclicer", "ranker", "rankdir", "align"], + nodeNumAttrs = ["width", "height"], + nodeDefaults = { width: 0, height: 0 }, + edgeNumAttrs = ["minlen", "weight", "width", "height", "labeloffset"], + edgeDefaults = { + minlen: 1, weight: 1, width: 0, height: 0, + labeloffset: 10, labelpos: "r" + }, + edgeAttrs = ["labelpos"]; + +/* + * Constructs a new graph from the input graph, which can be used for layout. + * This process copies only whitelisted attributes from the input graph to the + * layout graph. Thus this function serves as a good place to determine what + * attributes can influence layout. + */ +function buildLayoutGraph(inputGraph) { + var g = new Graph({ multigraph: true, compound: true }), + graph = canonicalize(inputGraph.graph()); + + g.setGraph(_.merge({}, + graphDefaults, + selectNumberAttrs(graph, graphNumAttrs), + _.pick(graph, graphAttrs))); + + _.each(inputGraph.nodes(), function(v) { + var node = canonicalize(inputGraph.node(v)); + g.setNode(v, _.defaults(selectNumberAttrs(node, nodeNumAttrs), nodeDefaults)); + g.setParent(v, inputGraph.parent(v)); + }); + + _.each(inputGraph.edges(), function(e) { + var edge = canonicalize(inputGraph.edge(e)); + g.setEdge(e, _.merge({}, + edgeDefaults, + selectNumberAttrs(edge, edgeNumAttrs), + _.pick(edge, edgeAttrs))); + }); + + return g; +} + +/* + * This idea comes from the Gansner paper: to account for edge labels in our + * layout we split each rank in half by doubling minlen and halving ranksep. + * Then we can place labels at these mid-points between nodes. + * + * We also add some minimal padding to the width to push the label for the edge + * away from the edge itself a bit. + */ +function makeSpaceForEdgeLabels(g) { + var graph = g.graph(); + graph.ranksep /= 2; + _.each(g.edges(), function(e) { + var edge = g.edge(e); + edge.minlen *= 2; + if (edge.labelpos.toLowerCase() !== "c") { + if (graph.rankdir === "TB" || graph.rankdir === "BT") { + edge.width += edge.labeloffset; + } else { + edge.height += edge.labeloffset; + } + } + }); +} + +/* + * Creates temporary dummy nodes that capture the rank in which each edge's + * label is going to, if it has one of non-zero width and height. We do this + * so that we can safely remove empty ranks while preserving balance for the + * label's position. + */ +function injectEdgeLabelProxies(g) { + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (edge.width && edge.height) { + var v = g.node(e.v), + w = g.node(e.w), + label = { rank: (w.rank - v.rank) / 2 + v.rank, e: e }; + util.addDummyNode(g, "edge-proxy", label, "_ep"); + } + }); +} + +function assignRankMinMax(g) { + var maxRank = 0; + _.each(g.nodes(), function(v) { + var node = g.node(v); + if (node.borderTop) { + node.minRank = g.node(node.borderTop).rank; + node.maxRank = g.node(node.borderBottom).rank; + maxRank = _.max(maxRank, node.maxRank); + } + }); + g.graph().maxRank = maxRank; +} + +function removeEdgeLabelProxies(g) { + _.each(g.nodes(), function(v) { + var node = g.node(v); + if (node.dummy === "edge-proxy") { + g.edge(node.e).labelRank = node.rank; + g.removeNode(v); + } + }); +} + +function translateGraph(g) { + var minX = Number.POSITIVE_INFINITY, + maxX = 0, + minY = Number.POSITIVE_INFINITY, + maxY = 0, + graphLabel = g.graph(), + marginX = graphLabel.marginx || 0, + marginY = graphLabel.marginy || 0; + + function getExtremes(attrs) { + var x = attrs.x, + y = attrs.y, + w = attrs.width, + h = attrs.height; + minX = Math.min(minX, x - w / 2); + maxX = Math.max(maxX, x + w / 2); + minY = Math.min(minY, y - h / 2); + maxY = Math.max(maxY, y + h / 2); + } + + _.each(g.nodes(), function(v) { getExtremes(g.node(v)); }); + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (_.has(edge, "x")) { + getExtremes(edge); + } + }); + + minX -= marginX; + minY -= marginY; + + _.each(g.nodes(), function(v) { + var node = g.node(v); + node.x -= minX; + node.y -= minY; + }); + + _.each(g.edges(), function(e) { + var edge = g.edge(e); + _.each(edge.points, function(p) { + p.x -= minX; + p.y -= minY; + }); + if (_.has(edge, "x")) { edge.x -= minX; } + if (_.has(edge, "y")) { edge.y -= minY; } + }); + + graphLabel.width = maxX - minX + marginX; + graphLabel.height = maxY - minY + marginY; +} + +function assignNodeIntersects(g) { + _.each(g.edges(), function(e) { + var edge = g.edge(e), + nodeV = g.node(e.v), + nodeW = g.node(e.w), + p1, p2; + if (!edge.points) { + edge.points = []; + p1 = nodeW; + p2 = nodeV; + } else { + p1 = edge.points[0]; + p2 = edge.points[edge.points.length - 1]; + } + edge.points.unshift(util.intersectRect(nodeV, p1)); + edge.points.push(util.intersectRect(nodeW, p2)); + }); +} + +function fixupEdgeLabelCoords(g) { + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (_.has(edge, "x")) { + if (edge.labelpos === "l" || edge.labelpos === "r") { + edge.width -= edge.labeloffset; + } + switch (edge.labelpos) { + case "l": edge.x -= edge.width / 2 + edge.labeloffset; break; + case "r": edge.x += edge.width / 2 + edge.labeloffset; break; + } + } + }); +} + +function reversePointsForReversedEdges(g) { + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (edge.reversed) { + edge.points.reverse(); + } + }); +} + +function removeBorderNodes(g) { + _.each(g.nodes(), function(v) { + if (g.children(v).length) { + var node = g.node(v), + t = g.node(node.borderTop), + b = g.node(node.borderBottom), + l = g.node(_.last(node.borderLeft)), + r = g.node(_.last(node.borderRight)); + + node.width = Math.abs(r.x - l.x); + node.height = Math.abs(b.y - t.y); + node.x = l.x + node.width / 2; + node.y = t.y + node.height / 2; + } + }); + + _.each(g.nodes(), function(v) { + if (g.node(v).dummy === "border") { + g.removeNode(v); + } + }); +} + +function removeSelfEdges(g) { + _.each(g.edges(), function(e) { + if (e.v === e.w) { + var node = g.node(e.v); + if (!node.selfEdges) { + node.selfEdges = []; + } + node.selfEdges.push({ e: e, label: g.edge(e) }); + g.removeEdge(e); + } + }); +} + +function insertSelfEdges(g) { + var layers = util.buildLayerMatrix(g); + _.each(layers, function(layer) { + var orderShift = 0; + _.each(layer, function(v, i) { + var node = g.node(v); + node.order = i + orderShift; + _.each(node.selfEdges, function(selfEdge) { + util.addDummyNode(g, "selfedge", { + width: selfEdge.label.width, + height: selfEdge.label.height, + rank: node.rank, + order: i + (++orderShift), + e: selfEdge.e, + label: selfEdge.label + }, "_se"); + }); + delete node.selfEdges; + }); + }); +} + +function positionSelfEdges(g) { + _.each(g.nodes(), function(v) { + var node = g.node(v); + if (node.dummy === "selfedge") { + var selfNode = g.node(node.e.v), + x = selfNode.x + selfNode.width / 2, + y = selfNode.y, + dx = node.x - x, + dy = selfNode.height / 2; + g.setEdge(node.e, node.label); + g.removeNode(v); + node.label.points = [ + { x: x + 2 * dx / 3, y: y - dy }, + { x: x + 5 * dx / 6, y: y - dy }, + { x: x + dx , y: y }, + { x: x + 5 * dx / 6, y: y + dy }, + { x: x + 2 * dx / 3, y: y + dy }, + ]; + node.label.x = node.x; + node.label.y = node.y; + } + }); +} + +function selectNumberAttrs(obj, attrs) { + return _.mapValues(_.pick(obj, attrs), Number); +} + +function canonicalize(attrs) { + var newAttrs = {}; + _.each(attrs, function(v, k) { + newAttrs[k.toLowerCase()] = v; + }); + return newAttrs; +} + +},{"./acyclic":32,"./add-border-segments":33,"./coordinate-system":34,"./graphlib":37,"./lodash":40,"./nesting-graph":41,"./normalize":42,"./order":47,"./parent-dummy-chains":52,"./position":54,"./rank":56,"./util":59}],40:[function(require,module,exports){ +/* global window */ + +var lodash; + +if (typeof require === "function") { + try { + lodash = require("lodash"); + } catch (e) {} +} + +if (!lodash) { + lodash = window._; +} + +module.exports = lodash; + +},{"lodash":81}],41:[function(require,module,exports){ +var _ = require("./lodash"), + util = require("./util"); + +module.exports = { + run: run, + cleanup: cleanup +}; + +/* + * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs, + * adds appropriate edges to ensure that all cluster nodes are placed between + * these boundries, and ensures that the graph is connected. + * + * In addition we ensure, through the use of the minlen property, that nodes + * and subgraph border nodes to not end up on the same rank. + * + * Preconditions: + * + * 1. Input graph is a DAG + * 2. Nodes in the input graph has a minlen attribute + * + * Postconditions: + * + * 1. Input graph is connected. + * 2. Dummy nodes are added for the tops and bottoms of subgraphs. + * 3. The minlen attribute for nodes is adjusted to ensure nodes do not + * get placed on the same rank as subgraph border nodes. + * + * The nesting graph idea comes from Sander, "Layout of Compound Directed + * Graphs." + */ +function run(g) { + var root = util.addDummyNode(g, "root", {}, "_root"), + depths = treeDepths(g), + height = _.max(depths) - 1, + nodeSep = 2 * height + 1; + + g.graph().nestingRoot = root; + + // Multiply minlen by nodeSep to align nodes on non-border ranks. + _.each(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; }); + + // Calculate a weight that is sufficient to keep subgraphs vertically compact + var weight = sumWeights(g) + 1; + + // Create border nodes and link them up + _.each(g.children(), function(child) { + dfs(g, root, nodeSep, weight, height, depths, child); + }); + + // Save the multiplier for node layers for later removal of empty border + // layers. + g.graph().nodeRankFactor = nodeSep; +} + +function dfs(g, root, nodeSep, weight, height, depths, v) { + var children = g.children(v); + if (!children.length) { + if (v !== root) { + g.setEdge(root, v, { weight: 0, minlen: nodeSep }); + } + return; + } + + var top = util.addBorderNode(g, "_bt"), + bottom = util.addBorderNode(g, "_bb"), + label = g.node(v); + + g.setParent(top, v); + label.borderTop = top; + g.setParent(bottom, v); + label.borderBottom = bottom; + + _.each(children, function(child) { + dfs(g, root, nodeSep, weight, height, depths, child); + + var childNode = g.node(child), + childTop = childNode.borderTop ? childNode.borderTop : child, + childBottom = childNode.borderBottom ? childNode.borderBottom : child, + thisWeight = childNode.borderTop ? weight : 2 * weight, + minlen = childTop !== childBottom ? 1 : height - depths[v] + 1; + + g.setEdge(top, childTop, { + weight: thisWeight, + minlen: minlen, + nestingEdge: true + }); + + g.setEdge(childBottom, bottom, { + weight: thisWeight, + minlen: minlen, + nestingEdge: true + }); + }); + + if (!g.parent(v)) { + g.setEdge(root, top, { weight: 0, minlen: height + depths[v] }); + } +} + +function treeDepths(g) { + var depths = {}; + function dfs(v, depth) { + var children = g.children(v); + if (children && children.length) { + _.each(children, function(child) { + dfs(child, depth + 1); + }); + } + depths[v] = depth; + } + _.each(g.children(), function(v) { dfs(v, 1); }); + return depths; +} + +function sumWeights(g) { + return _.reduce(g.edges(), function(acc, e) { + return acc + g.edge(e).weight; + }, 0); +} + +function cleanup(g) { + var graphLabel = g.graph(); + g.removeNode(graphLabel.nestingRoot); + delete graphLabel.nestingRoot; + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (edge.nestingEdge) { + g.removeEdge(e); + } + }); +} + +},{"./lodash":40,"./util":59}],42:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"), + util = require("./util"); + +module.exports = { + run: run, + undo: undo +}; + +/* + * Breaks any long edges in the graph into short segments that span 1 layer + * each. This operation is undoable with the denormalize function. + * + * Pre-conditions: + * + * 1. The input graph is a DAG. + * 2. Each node in the graph has a "rank" property. + * + * Post-condition: + * + * 1. All edges in the graph have a length of 1. + * 2. Dummy nodes are added where edges have been split into segments. + * 3. The graph is augmented with a "dummyChains" attribute which contains + * the first dummy in each chain of dummy nodes produced. + */ +function run(g) { + g.graph().dummyChains = []; + _.each(g.edges(), function(edge) { normalizeEdge(g, edge); }); +} + +function normalizeEdge(g, e) { + var v = e.v, + vRank = g.node(v).rank, + w = e.w, + wRank = g.node(w).rank, + name = e.name, + edgeLabel = g.edge(e), + labelRank = edgeLabel.labelRank; + + if (wRank === vRank + 1) return; + + g.removeEdge(e); + + var dummy, attrs, i; + for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) { + edgeLabel.points = []; + attrs = { + width: 0, height: 0, + edgeLabel: edgeLabel, edgeObj: e, + rank: vRank + }; + dummy = util.addDummyNode(g, "edge", attrs, "_d"); + if (vRank === labelRank) { + attrs.width = edgeLabel.width; + attrs.height = edgeLabel.height; + attrs.dummy = "edge-label"; + attrs.labelpos = edgeLabel.labelpos; + } + g.setEdge(v, dummy, { weight: edgeLabel.weight }, name); + if (i === 0) { + g.graph().dummyChains.push(dummy); + } + v = dummy; + } + + g.setEdge(v, w, { weight: edgeLabel.weight }, name); +} + +function undo(g) { + _.each(g.graph().dummyChains, function(v) { + var node = g.node(v), + origLabel = node.edgeLabel, + w; + g.setEdge(node.edgeObj, origLabel); + while (node.dummy) { + w = g.successors(v)[0]; + g.removeNode(v); + origLabel.points.push({ x: node.x, y: node.y }); + if (node.dummy === "edge-label") { + origLabel.x = node.x; + origLabel.y = node.y; + origLabel.width = node.width; + origLabel.height = node.height; + } + v = w; + node = g.node(v); + } + }); +} + +},{"./lodash":40,"./util":59}],43:[function(require,module,exports){ +var _ = require("../lodash"); + +module.exports = addSubgraphConstraints; + +function addSubgraphConstraints(g, cg, vs) { + var prev = {}, + rootPrev; + + _.each(vs, function(v) { + var child = g.parent(v), + parent, + prevChild; + while (child) { + parent = g.parent(child); + if (parent) { + prevChild = prev[parent]; + prev[parent] = child; + } else { + prevChild = rootPrev; + rootPrev = child; + } + if (prevChild && prevChild !== child) { + cg.setEdge(prevChild, child); + return; + } + child = parent; + } + }); + + /* + function dfs(v) { + var children = v ? g.children(v) : g.children(); + if (children.length) { + var min = Number.POSITIVE_INFINITY, + subgraphs = []; + _.each(children, function(child) { + var childMin = dfs(child); + if (g.children(child).length) { + subgraphs.push({ v: child, order: childMin }); + } + min = Math.min(min, childMin); + }); + _.reduce(_.sortBy(subgraphs, "order"), function(prev, curr) { + cg.setEdge(prev.v, curr.v); + return curr; + }); + return min; + } + return g.node(v).order; + } + dfs(undefined); + */ +} + +},{"../lodash":40}],44:[function(require,module,exports){ +var _ = require("../lodash"); + +module.exports = barycenter; + +function barycenter(g, movable) { + return _.map(movable, function(v) { + var inV = g.inEdges(v); + if (!inV.length) { + return { v: v }; + } else { + var result = _.reduce(inV, function(acc, e) { + var edge = g.edge(e), + nodeU = g.node(e.v); + return { + sum: acc.sum + (edge.weight * nodeU.order), + weight: acc.weight + edge.weight + }; + }, { sum: 0, weight: 0 }); + + return { + v: v, + barycenter: result.sum / result.weight, + weight: result.weight + }; + } + }); +} + + +},{"../lodash":40}],45:[function(require,module,exports){ +var _ = require("../lodash"), + Graph = require("../graphlib").Graph; + +module.exports = buildLayerGraph; + +/* + * Constructs a graph that can be used to sort a layer of nodes. The graph will + * contain all base and subgraph nodes from the request layer in their original + * hierarchy and any edges that are incident on these nodes and are of the type + * requested by the "relationship" parameter. + * + * Nodes from the requested rank that do not have parents are assigned a root + * node in the output graph, which is set in the root graph attribute. This + * makes it easy to walk the hierarchy of movable nodes during ordering. + * + * Pre-conditions: + * + * 1. Input graph is a DAG + * 2. Base nodes in the input graph have a rank attribute + * 3. Subgraph nodes in the input graph has minRank and maxRank attributes + * 4. Edges have an assigned weight + * + * Post-conditions: + * + * 1. Output graph has all nodes in the movable rank with preserved + * hierarchy. + * 2. Root nodes in the movable layer are made children of the node + * indicated by the root attribute of the graph. + * 3. Non-movable nodes incident on movable nodes, selected by the + * relationship parameter, are included in the graph (without hierarchy). + * 4. Edges incident on movable nodes, selected by the relationship + * parameter, are added to the output graph. + * 5. The weights for copied edges are aggregated as need, since the output + * graph is not a multi-graph. + */ +function buildLayerGraph(g, rank, relationship) { + var root = createRootNode(g), + result = new Graph({ compound: true }).setGraph({ root: root }) + .setDefaultNodeLabel(function(v) { return g.node(v); }); + + _.each(g.nodes(), function(v) { + var node = g.node(v), + parent = g.parent(v); + + if (node.rank === rank || node.minRank <= rank && rank <= node.maxRank) { + result.setNode(v); + result.setParent(v, parent || root); + + // This assumes we have only short edges! + _.each(g[relationship](v), function(e) { + var u = e.v === v ? e.w : e.v, + edge = result.edge(u, v), + weight = !_.isUndefined(edge) ? edge.weight : 0; + result.setEdge(u, v, { weight: g.edge(e).weight + weight }); + }); + + if (_.has(node, "minRank")) { + result.setNode(v, { + borderLeft: node.borderLeft[rank], + borderRight: node.borderRight[rank] + }); + } + } + }); + + return result; +} + +function createRootNode(g) { + var v; + while (g.hasNode((v = _.uniqueId("_root")))); + return v; +} + +},{"../graphlib":37,"../lodash":40}],46:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"); + +module.exports = crossCount; + +/* + * A function that takes a layering (an array of layers, each with an array of + * ordererd nodes) and a graph and returns a weighted crossing count. + * + * Pre-conditions: + * + * 1. Input graph must be simple (not a multigraph), directed, and include + * only simple edges. + * 2. Edges in the input graph must have assigned weights. + * + * Post-conditions: + * + * 1. The graph and layering matrix are left unchanged. + * + * This algorithm is derived from Barth, et al., "Bilayer Cross Counting." + */ +function crossCount(g, layering) { + var cc = 0; + for (var i = 1; i < layering.length; ++i) { + cc += twoLayerCrossCount(g, layering[i-1], layering[i]); + } + return cc; +} + +function twoLayerCrossCount(g, northLayer, southLayer) { + // Sort all of the edges between the north and south layers by their position + // in the north layer and then the south. Map these edges to the position of + // their head in the south layer. + var southPos = _.zipObject(southLayer, + _.map(southLayer, function (v, i) { return i; })); + var southEntries = _.flatten(_.map(northLayer, function(v) { + return _.chain(g.outEdges(v)) + .map(function(e) { + return { pos: southPos[e.w], weight: g.edge(e).weight }; + }) + .sortBy("pos") + .value(); + }), true); + + // Build the accumulator tree + var firstIndex = 1; + while (firstIndex < southLayer.length) firstIndex <<= 1; + var treeSize = 2 * firstIndex - 1; + firstIndex -= 1; + var tree = _.map(new Array(treeSize), function() { return 0; }); + + // Calculate the weighted crossings + var cc = 0; + _.each(southEntries.forEach(function(entry) { + var index = entry.pos + firstIndex; + tree[index] += entry.weight; + var weightSum = 0; + while (index > 0) { + if (index % 2) { + weightSum += tree[index + 1]; + } + index = (index - 1) >> 1; + tree[index] += entry.weight; + } + cc += entry.weight * weightSum; + })); + + return cc; +} + +},{"../lodash":40}],47:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + initOrder = require("./init-order"), + crossCount = require("./cross-count"), + sortSubgraph = require("./sort-subgraph"), + buildLayerGraph = require("./build-layer-graph"), + addSubgraphConstraints = require("./add-subgraph-constraints"), + Graph = require("../graphlib").Graph, + util = require("../util"); + +module.exports = order; + +/* + * Applies heuristics to minimize edge crossings in the graph and sets the best + * order solution as an order attribute on each node. + * + * Pre-conditions: + * + * 1. Graph must be DAG + * 2. Graph nodes must be objects with a "rank" attribute + * 3. Graph edges must have the "weight" attribute + * + * Post-conditions: + * + * 1. Graph nodes will have an "order" attribute based on the results of the + * algorithm. + */ +function order(g) { + var maxRank = util.maxRank(g), + downLayerGraphs = buildLayerGraphs(g, _.range(1, maxRank + 1), "inEdges"), + upLayerGraphs = buildLayerGraphs(g, _.range(maxRank - 1, -1, -1), "outEdges"); + + var layering = initOrder(g); + assignOrder(g, layering); + + var bestCC = Number.POSITIVE_INFINITY, + best; + + for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) { + sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2); + + layering = util.buildLayerMatrix(g); + var cc = crossCount(g, layering); + if (cc < bestCC) { + lastBest = 0; + best = _.cloneDeep(layering); + bestCC = cc; + } + } + + assignOrder(g, best); +} + +function buildLayerGraphs(g, ranks, relationship) { + return _.map(ranks, function(rank) { + return buildLayerGraph(g, rank, relationship); + }); +} + +function sweepLayerGraphs(layerGraphs, biasRight) { + var cg = new Graph(); + _.each(layerGraphs, function(lg) { + var root = lg.graph().root; + var sorted = sortSubgraph(lg, root, cg, biasRight); + _.each(sorted.vs, function(v, i) { + lg.node(v).order = i; + }); + addSubgraphConstraints(lg, cg, sorted.vs); + }); +} + +function assignOrder(g, layering) { + _.each(layering, function(layer) { + _.each(layer, function(v, i) { + g.node(v).order = i; + }); + }); +} + +},{"../graphlib":37,"../lodash":40,"../util":59,"./add-subgraph-constraints":43,"./build-layer-graph":45,"./cross-count":46,"./init-order":48,"./sort-subgraph":50}],48:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"); + +module.exports = initOrder; + +/* + * Assigns an initial order value for each node by performing a DFS search + * starting from nodes in the first rank. Nodes are assigned an order in their + * rank as they are first visited. + * + * This approach comes from Gansner, et al., "A Technique for Drawing Directed + * Graphs." + * + * Returns a layering matrix with an array per layer and each layer sorted by + * the order of its nodes. + */ +function initOrder(g) { + var visited = {}, + simpleNodes = _.filter(g.nodes(), function(v) { + return !g.children(v).length; + }), + maxRank = _.max(_.map(simpleNodes, function(v) { return g.node(v).rank; })), + layers = _.map(_.range(maxRank + 1), function() { return []; }); + + function dfs(v) { + if (_.has(visited, v)) return; + visited[v] = true; + var node = g.node(v); + layers[node.rank].push(v); + _.each(g.successors(v), dfs); + } + + var orderedVs = _.sortBy(simpleNodes, function(v) { return g.node(v).rank; }); + _.each(orderedVs, dfs); + + return layers; +} + +},{"../lodash":40}],49:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"); + +module.exports = resolveConflicts; + +/* + * Given a list of entries of the form {v, barycenter, weight} and a + * constraint graph this function will resolve any conflicts between the + * constraint graph and the barycenters for the entries. If the barycenters for + * an entry would violate a constraint in the constraint graph then we coalesce + * the nodes in the conflict into a new node that respects the contraint and + * aggregates barycenter and weight information. + * + * This implementation is based on the description in Forster, "A Fast and + * Simple Hueristic for Constrained Two-Level Crossing Reduction," thought it + * differs in some specific details. + * + * Pre-conditions: + * + * 1. Each entry has the form {v, barycenter, weight}, or if the node has + * no barycenter, then {v}. + * + * Returns: + * + * A new list of entries of the form {vs, i, barycenter, weight}. The list + * `vs` may either be a singleton or it may be an aggregation of nodes + * ordered such that they do not violate constraints from the constraint + * graph. The property `i` is the lowest original index of any of the + * elements in `vs`. + */ +function resolveConflicts(entries, cg) { + var mappedEntries = {}; + _.each(entries, function(entry, i) { + var tmp = mappedEntries[entry.v] = { + indegree: 0, + "in": [], + out: [], + vs: [entry.v], + i: i + }; + if (!_.isUndefined(entry.barycenter)) { + tmp.barycenter = entry.barycenter; + tmp.weight = entry.weight; + } + }); + + _.each(cg.edges(), function(e) { + var entryV = mappedEntries[e.v], + entryW = mappedEntries[e.w]; + if (!_.isUndefined(entryV) && !_.isUndefined(entryW)) { + entryW.indegree++; + entryV.out.push(mappedEntries[e.w]); + } + }); + + var sourceSet = _.filter(mappedEntries, function(entry) { + return !entry.indegree; + }); + + return doResolveConflicts(sourceSet); +} + +function doResolveConflicts(sourceSet) { + var entries = []; + + function handleIn(vEntry) { + return function(uEntry) { + if (uEntry.merged) { + return; + } + if (_.isUndefined(uEntry.barycenter) || + _.isUndefined(vEntry.barycenter) || + uEntry.barycenter >= vEntry.barycenter) { + mergeEntries(vEntry, uEntry); + } + }; + } + + function handleOut(vEntry) { + return function(wEntry) { + wEntry["in"].push(vEntry); + if (--wEntry.indegree === 0) { + sourceSet.push(wEntry); + } + }; + } + + while (sourceSet.length) { + var entry = sourceSet.pop(); + entries.push(entry); + _.each(entry["in"].reverse(), handleIn(entry)); + _.each(entry.out, handleOut(entry)); + } + + return _.chain(entries) + .filter(function(entry) { return !entry.merged; }) + .map(function(entry) { + return _.pick(entry, ["vs", "i", "barycenter", "weight"]); + }) + .value(); +} + +function mergeEntries(target, source) { + var sum = 0, + weight = 0; + + if (target.weight) { + sum += target.barycenter * target.weight; + weight += target.weight; + } + + if (source.weight) { + sum += source.barycenter * source.weight; + weight += source.weight; + } + + target.vs = source.vs.concat(target.vs); + target.barycenter = sum / weight; + target.weight = weight; + target.i = Math.min(source.i, target.i); + source.merged = true; +} + +},{"../lodash":40}],50:[function(require,module,exports){ +var _ = require("../lodash"), + barycenter = require("./barycenter"), + resolveConflicts = require("./resolve-conflicts"), + sort = require("./sort"); + +module.exports = sortSubgraph; + +function sortSubgraph(g, v, cg, biasRight) { + var movable = g.children(v), + node = g.node(v), + bl = node ? node.borderLeft : undefined, + br = node ? node.borderRight: undefined, + subgraphs = {}; + + if (bl) { + movable = _.filter(movable, function(w) { + return w !== bl && w !== br; + }); + } + + var barycenters = barycenter(g, movable); + _.each(barycenters, function(entry) { + if (g.children(entry.v).length) { + var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight); + subgraphs[entry.v] = subgraphResult; + if (_.has(subgraphResult, "barycenter")) { + mergeBarycenters(entry, subgraphResult); + } + } + }); + + var entries = resolveConflicts(barycenters, cg); + expandSubgraphs(entries, subgraphs); + + var result = sort(entries, biasRight); + + if (bl) { + result.vs = _.flatten([bl, result.vs, br], true); + if (g.predecessors(bl).length) { + var blPred = g.node(g.predecessors(bl)[0]), + brPred = g.node(g.predecessors(br)[0]); + if (!_.has(result, "barycenter")) { + result.barycenter = 0; + result.weight = 0; + } + result.barycenter = (result.barycenter * result.weight + + blPred.order + brPred.order) / (result.weight + 2); + result.weight += 2; + } + } + + return result; +} + +function expandSubgraphs(entries, subgraphs) { + _.each(entries, function(entry) { + entry.vs = _.flatten(entry.vs.map(function(v) { + if (subgraphs[v]) { + return subgraphs[v].vs; + } + return v; + }), true); + }); +} + +function mergeBarycenters(target, other) { + if (!_.isUndefined(target.barycenter)) { + target.barycenter = (target.barycenter * target.weight + + other.barycenter * other.weight) / + (target.weight + other.weight); + target.weight += other.weight; + } else { + target.barycenter = other.barycenter; + target.weight = other.weight; + } +} + +},{"../lodash":40,"./barycenter":44,"./resolve-conflicts":49,"./sort":51}],51:[function(require,module,exports){ +var _ = require("../lodash"), + util = require("../util"); + +module.exports = sort; + +function sort(entries, biasRight) { + var parts = util.partition(entries, function(entry) { + return _.has(entry, "barycenter"); + }); + var sortable = parts.lhs, + unsortable = _.sortBy(parts.rhs, function(entry) { return -entry.i; }), + vs = [], + sum = 0, + weight = 0, + vsIndex = 0; + + sortable.sort(compareWithBias(!!biasRight)); + + vsIndex = consumeUnsortable(vs, unsortable, vsIndex); + + _.each(sortable, function (entry) { + vsIndex += entry.vs.length; + vs.push(entry.vs); + sum += entry.barycenter * entry.weight; + weight += entry.weight; + vsIndex = consumeUnsortable(vs, unsortable, vsIndex); + }); + + var result = { vs: _.flatten(vs, true) }; + if (weight) { + result.barycenter = sum / weight; + result.weight = weight; + } + return result; +} + +function consumeUnsortable(vs, unsortable, index) { + var last; + while (unsortable.length && (last = _.last(unsortable)).i <= index) { + unsortable.pop(); + vs.push(last.vs); + index++; + } + return index; +} + +function compareWithBias(bias) { + return function(entryV, entryW) { + if (entryV.barycenter < entryW.barycenter) { + return -1; + } else if (entryV.barycenter > entryW.barycenter) { + return 1; + } + + return !bias ? entryV.i - entryW.i : entryW.i - entryV.i; + }; +} + +},{"../lodash":40,"../util":59}],52:[function(require,module,exports){ +var _ = require("./lodash"); + +module.exports = parentDummyChains; + +function parentDummyChains(g) { + var postorderNums = postorder(g); + + _.each(g.graph().dummyChains, function(v) { + var node = g.node(v), + edgeObj = node.edgeObj, + pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w), + path = pathData.path, + lca = pathData.lca, + pathIdx = 0, + pathV = path[pathIdx], + ascending = true; + + while (v !== edgeObj.w) { + node = g.node(v); + + if (ascending) { + while ((pathV = path[pathIdx]) !== lca && + g.node(pathV).maxRank < node.rank) { + pathIdx++; + } + + if (pathV === lca) { + ascending = false; + } + } + + if (!ascending) { + while (pathIdx < path.length - 1 && + g.node(pathV = path[pathIdx + 1]).minRank <= node.rank) { + pathIdx++; + } + pathV = path[pathIdx]; + } + + g.setParent(v, pathV); + v = g.successors(v)[0]; + } + }); +} + +// Find a path from v to w through the lowest common ancestor (LCA). Return the +// full path and the LCA. +function findPath(g, postorderNums, v, w) { + var vPath = [], + wPath = [], + low = Math.min(postorderNums[v].low, postorderNums[w].low), + lim = Math.max(postorderNums[v].lim, postorderNums[w].lim), + parent, + lca; + + // Traverse up from v to find the LCA + parent = v; + do { + parent = g.parent(parent); + vPath.push(parent); + } while (parent && + (postorderNums[parent].low > low || lim > postorderNums[parent].lim)); + lca = parent; + + // Traverse from w to LCA + parent = w; + while ((parent = g.parent(parent)) !== lca) { + wPath.push(parent); + } + + return { path: vPath.concat(wPath.reverse()), lca: lca }; +} + +function postorder(g) { + var result = {}, + lim = 0; + + function dfs(v) { + var low = lim; + _.each(g.children(v), dfs); + result[v] = { low: low, lim: lim++ }; + } + _.each(g.children(), dfs); + + return result; +} + +},{"./lodash":40}],53:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + Graph = require("../graphlib").Graph, + util = require("../util"); + +/* + * This module provides coordinate assignment based on Brandes and Köpf, "Fast + * and Simple Horizontal Coordinate Assignment." + */ + +module.exports = { + positionX: positionX, + findType1Conflicts: findType1Conflicts, + findType2Conflicts: findType2Conflicts, + addConflict: addConflict, + hasConflict: hasConflict, + verticalAlignment: verticalAlignment, + horizontalCompaction: horizontalCompaction, + alignCoordinates: alignCoordinates, + findSmallestWidthAlignment: findSmallestWidthAlignment, + balance: balance +}; + +/* + * Marks all edges in the graph with a type-1 conflict with the "type1Conflict" + * property. A type-1 conflict is one where a non-inner segment crosses an + * inner segment. An inner segment is an edge with both incident nodes marked + * with the "dummy" property. + * + * This algorithm scans layer by layer, starting with the second, for type-1 + * conflicts between the current layer and the previous layer. For each layer + * it scans the nodes from left to right until it reaches one that is incident + * on an inner segment. It then scans predecessors to determine if they have + * edges that cross that inner segment. At the end a final scan is done for all + * nodes on the current rank to see if they cross the last visited inner + * segment. + * + * This algorithm (safely) assumes that a dummy node will only be incident on a + * single node in the layers being scanned. + */ +function findType1Conflicts(g, layering) { + var conflicts = {}; + + function visitLayer(prevLayer, layer) { + var + // last visited node in the previous layer that is incident on an inner + // segment. + k0 = 0, + // Tracks the last node in this layer scanned for crossings with a type-1 + // segment. + scanPos = 0, + prevLayerLength = prevLayer.length, + lastNode = _.last(layer); + + _.each(layer, function(v, i) { + var w = findOtherInnerSegmentNode(g, v), + k1 = w ? g.node(w).order : prevLayerLength; + + if (w || v === lastNode) { + _.each(layer.slice(scanPos, i +1), function(scanNode) { + _.each(g.predecessors(scanNode), function(u) { + var uLabel = g.node(u), + uPos = uLabel.order; + if ((uPos < k0 || k1 < uPos) && + !(uLabel.dummy && g.node(scanNode).dummy)) { + addConflict(conflicts, u, scanNode); + } + }); + }); + scanPos = i + 1; + k0 = k1; + } + }); + + return layer; + } + + _.reduce(layering, visitLayer); + return conflicts; +} + +function findType2Conflicts(g, layering) { + var conflicts = {}; + + function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) { + var v; + _.each(_.range(southPos, southEnd), function(i) { + v = south[i]; + if (g.node(v).dummy) { + _.each(g.predecessors(v), function(u) { + var uNode = g.node(u); + if (uNode.dummy && + (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) { + addConflict(conflicts, u, v); + } + }); + } + }); + } + + + function visitLayer(north, south) { + var prevNorthPos = -1, + nextNorthPos, + southPos = 0; + + _.each(south, function(v, southLookahead) { + if (g.node(v).dummy === "border") { + var predecessors = g.predecessors(v); + if (predecessors.length) { + nextNorthPos = g.node(predecessors[0]).order; + scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos); + southPos = southLookahead; + prevNorthPos = nextNorthPos; + } + } + scan(south, southPos, south.length, nextNorthPos, north.length); + }); + + return south; + } + + _.reduce(layering, visitLayer); + return conflicts; +} + +function findOtherInnerSegmentNode(g, v) { + if (g.node(v).dummy) { + return _.find(g.predecessors(v), function(u) { + return g.node(u).dummy; + }); + } +} + +function addConflict(conflicts, v, w) { + if (v > w) { + var tmp = v; + v = w; + w = tmp; + } + + var conflictsV = conflicts[v]; + if (!conflictsV) { + conflicts[v] = conflictsV = {}; + } + conflictsV[w] = true; +} + +function hasConflict(conflicts, v, w) { + if (v > w) { + var tmp = v; + v = w; + w = tmp; + } + return _.has(conflicts[v], w); +} + +/* + * Try to align nodes into vertical "blocks" where possible. This algorithm + * attempts to align a node with one of its median neighbors. If the edge + * connecting a neighbor is a type-1 conflict then we ignore that possibility. + * If a previous node has already formed a block with a node after the node + * we're trying to form a block with, we also ignore that possibility - our + * blocks would be split in that scenario. + */ +function verticalAlignment(g, layering, conflicts, neighborFn) { + var root = {}, + align = {}, + pos = {}; + + // We cache the position here based on the layering because the graph and + // layering may be out of sync. The layering matrix is manipulated to + // generate different extreme alignments. + _.each(layering, function(layer) { + _.each(layer, function(v, order) { + root[v] = v; + align[v] = v; + pos[v] = order; + }); + }); + + _.each(layering, function(layer) { + var prevIdx = -1; + _.each(layer, function(v) { + var ws = neighborFn(v); + if (ws.length) { + ws = _.sortBy(ws, function(w) { return pos[w]; }); + var mp = (ws.length - 1) / 2; + for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) { + var w = ws[i]; + if (align[v] === v && + prevIdx < pos[w] && + !hasConflict(conflicts, v, w)) { + align[w] = v; + align[v] = root[v] = root[w]; + prevIdx = pos[w]; + } + } + } + }); + }); + + return { root: root, align: align }; +} + +function horizontalCompaction(g, layering, root, align, reverseSep) { + // This portion of the algorithm differs from BK due to a number of problems. + // Instead of their algorithm we construct a new block graph and do two + // sweeps. The first sweep places blocks with the smallest possible + // coordinates. The second sweep removes unused space by moving blocks to the + // greatest coordinates without violating separation. + var xs = {}, + blockG = buildBlockGraph(g, layering, root, reverseSep); + + // First pass, assign smallest coordinates via DFS + var visited = {}; + function pass1(v) { + if (!_.has(visited, v)) { + visited[v] = true; + xs[v] = _.reduce(blockG.inEdges(v), function(max, e) { + pass1(e.v); + return Math.max(max, xs[e.v] + blockG.edge(e)); + }, 0); + } + } + _.each(blockG.nodes(), pass1); + + var borderType = reverseSep ? "borderLeft" : "borderRight"; + function pass2(v) { + if (visited[v] !== 2) { + visited[v]++; + var node = g.node(v); + var min = _.reduce(blockG.outEdges(v), function(min, e) { + pass2(e.w); + return Math.min(min, xs[e.w] - blockG.edge(e)); + }, Number.POSITIVE_INFINITY); + if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) { + xs[v] = Math.max(xs[v], min); + } + } + } + _.each(blockG.nodes(), pass2); + + // Assign x coordinates to all nodes + _.each(align, function(v) { + xs[v] = xs[root[v]]; + }); + + return xs; +} + + +function buildBlockGraph(g, layering, root, reverseSep) { + var blockGraph = new Graph(), + graphLabel = g.graph(), + sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep); + + _.each(layering, function(layer) { + var u; + _.each(layer, function(v) { + var vRoot = root[v]; + blockGraph.setNode(vRoot); + if (u) { + var uRoot = root[u], + prevMax = blockGraph.edge(uRoot, vRoot); + blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0)); + } + u = v; + }); + }); + + return blockGraph; +} + +/* + * Returns the alignment that has the smallest width of the given alignments. + */ +function findSmallestWidthAlignment(g, xss) { + return _.min(xss, function(xs) { + var min = _.min(xs, function(x, v) { return x - width(g, v) / 2; }), + max = _.max(xs, function(x, v) { return x + width(g, v) / 2; }); + return max - min; + }); +} + +/* + * Align the coordinates of each of the layout alignments such that + * left-biased alignments have their minimum coordinate at the same point as + * the minimum coordinate of the smallest width alignment and right-biased + * alignments have their maximum coordinate at the same point as the maximum + * coordinate of the smallest width alignment. + */ +function alignCoordinates(xss, alignTo) { + var alignToMin = _.min(alignTo), + alignToMax = _.max(alignTo); + + _.each(["u", "d"], function(vert) { + _.each(["l", "r"], function(horiz) { + var alignment = vert + horiz, + xs = xss[alignment], + delta; + if (xs === alignTo) return; + + delta = horiz === "l" ? alignToMin - _.min(xs) : alignToMax - _.max(xs); + + if (delta) { + xss[alignment] = _.mapValues(xs, function(x) { return x + delta; }); + } + }); + }); +} + +function balance(xss, align) { + return _.mapValues(xss.ul, function(ignore, v) { + if (align) { + return xss[align.toLowerCase()][v]; + } else { + var xs = _.sortBy(_.pluck(xss, v)); + return (xs[1] + xs[2]) / 2; + } + }); +} + +function positionX(g) { + var layering = util.buildLayerMatrix(g), + conflicts = _.merge(findType1Conflicts(g, layering), + findType2Conflicts(g, layering)); + + var xss = {}, + adjustedLayering; + _.each(["u", "d"], function(vert) { + adjustedLayering = vert === "u" ? layering : _.values(layering).reverse(); + _.each(["l", "r"], function(horiz) { + if (horiz === "r") { + adjustedLayering = _.map(adjustedLayering, function(inner) { + return _.values(inner).reverse(); + }); + } + + var neighborFn = _.bind(vert === "u" ? g.predecessors : g.successors, g); + var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn); + var xs = horizontalCompaction(g, adjustedLayering, + align.root, align.align, + horiz === "r"); + if (horiz === "r") { + xs = _.mapValues(xs, function(x) { return -x; }); + } + xss[vert + horiz] = xs; + }); + }); + + var smallestWidth = findSmallestWidthAlignment(g, xss); + alignCoordinates(xss, smallestWidth); + return balance(xss, g.graph().align); +} + +function sep(nodeSep, edgeSep, reverseSep) { + return function(g, v, w) { + var vLabel = g.node(v), + wLabel = g.node(w), + sum = 0, + delta; + + sum += vLabel.width / 2; + if (_.has(vLabel, "labelpos")) { + switch (vLabel.labelpos.toLowerCase()) { + case "l": delta = -vLabel.width / 2; break; + case "r": delta = vLabel.width / 2; break; + } + } + if (delta) { + sum += reverseSep ? delta : -delta; + } + delta = 0; + + sum += (vLabel.dummy ? edgeSep : nodeSep) / 2; + sum += (wLabel.dummy ? edgeSep : nodeSep) / 2; + + sum += wLabel.width / 2; + if (_.has(wLabel, "labelpos")) { + switch (wLabel.labelpos.toLowerCase()) { + case "l": delta = wLabel.width / 2; break; + case "r": delta = -wLabel.width / 2; break; + } + } + if (delta) { + sum += reverseSep ? delta : -delta; + } + delta = 0; + + return sum; + }; +} + +function width(g, v) { + return g.node(v).width; +} + +},{"../graphlib":37,"../lodash":40,"../util":59}],54:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + util = require("../util"), + positionX = require("./bk").positionX; + +module.exports = position; + +function position(g) { + g = util.asNonCompoundGraph(g); + + positionY(g); + _.each(positionX(g), function(x, v) { + g.node(v).x = x; + }); +} + +function positionY(g) { + var layering = util.buildLayerMatrix(g), + rankSep = g.graph().ranksep, + prevY = 0; + _.each(layering, function(layer) { + var maxHeight = _.max(_.map(layer, function(v) { return g.node(v).height; })); + _.each(layer, function(v) { + g.node(v).y = prevY + maxHeight / 2; + }); + prevY += maxHeight + rankSep; + }); +} + + +},{"../lodash":40,"../util":59,"./bk":53}],55:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + Graph = require("../graphlib").Graph, + slack = require("./util").slack; + +module.exports = feasibleTree; + +/* + * Constructs a spanning tree with tight edges and adjusted the input node's + * ranks to achieve this. A tight edge is one that is has a length that matches + * its "minlen" attribute. + * + * The basic structure for this function is derived from Gansner, et al., "A + * Technique for Drawing Directed Graphs." + * + * Pre-conditions: + * + * 1. Graph must be a DAG. + * 2. Graph must be connected. + * 3. Graph must have at least one node. + * 5. Graph nodes must have been previously assigned a "rank" property that + * respects the "minlen" property of incident edges. + * 6. Graph edges must have a "minlen" property. + * + * Post-conditions: + * + * - Graph nodes will have their rank adjusted to ensure that all edges are + * tight. + * + * Returns a tree (undirected graph) that is constructed using only "tight" + * edges. + */ +function feasibleTree(g) { + var t = new Graph({ directed: false }); + + // Choose arbitrary node from which to start our tree + var start = g.nodes()[0], + size = g.nodeCount(); + t.setNode(start, {}); + + var edge, delta; + while (tightTree(t, g) < size) { + edge = findMinSlackEdge(t, g); + delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge); + shiftRanks(t, g, delta); + } + + return t; +} + +/* + * Finds a maximal tree of tight edges and returns the number of nodes in the + * tree. + */ +function tightTree(t, g) { + function dfs(v) { + _.each(g.nodeEdges(v), function(e) { + var edgeV = e.v, + w = (v === edgeV) ? e.w : edgeV; + if (!t.hasNode(w) && !slack(g, e)) { + t.setNode(w, {}); + t.setEdge(v, w, {}); + dfs(w); + } + }); + } + + _.each(t.nodes(), dfs); + return t.nodeCount(); +} + +/* + * Finds the edge with the smallest slack that is incident on tree and returns + * it. + */ +function findMinSlackEdge(t, g) { + return _.min(g.edges(), function(e) { + if (t.hasNode(e.v) !== t.hasNode(e.w)) { + return slack(g, e); + } + }); +} + +function shiftRanks(t, g, delta) { + _.each(t.nodes(), function(v) { + g.node(v).rank += delta; + }); +} + +},{"../graphlib":37,"../lodash":40,"./util":58}],56:[function(require,module,exports){ +"use strict"; + +var rankUtil = require("./util"), + longestPath = rankUtil.longestPath, + feasibleTree = require("./feasible-tree"), + networkSimplex = require("./network-simplex"); + +module.exports = rank; + +/* + * Assigns a rank to each node in the input graph that respects the "minlen" + * constraint specified on edges between nodes. + * + * This basic structure is derived from Gansner, et al., "A Technique for + * Drawing Directed Graphs." + * + * Pre-conditions: + * + * 1. Graph must be a connected DAG + * 2. Graph nodes must be objects + * 3. Graph edges must have "weight" and "minlen" attributes + * + * Post-conditions: + * + * 1. Graph nodes will have a "rank" attribute based on the results of the + * algorithm. Ranks can start at any index (including negative), we'll + * fix them up later. + */ +function rank(g) { + switch(g.graph().ranker) { + case "network-simplex": networkSimplexRanker(g); break; + case "tight-tree": tightTreeRanker(g); break; + case "longest-path": longestPathRanker(g); break; + default: networkSimplexRanker(g); + } +} + +// A fast and simple ranker, but results are far from optimal. +var longestPathRanker = longestPath; + +function tightTreeRanker(g) { + longestPath(g); + feasibleTree(g); +} + +function networkSimplexRanker(g) { + networkSimplex(g); +} + +},{"./feasible-tree":55,"./network-simplex":57,"./util":58}],57:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + feasibleTree = require("./feasible-tree"), + slack = require("./util").slack, + initRank = require("./util").longestPath, + preorder = require("../graphlib").alg.preorder, + postorder = require("../graphlib").alg.postorder, + simplify = require("../util").simplify; + +module.exports = networkSimplex; + +// Expose some internals for testing purposes +networkSimplex.initLowLimValues = initLowLimValues; +networkSimplex.initCutValues = initCutValues; +networkSimplex.calcCutValue = calcCutValue; +networkSimplex.leaveEdge = leaveEdge; +networkSimplex.enterEdge = enterEdge; +networkSimplex.exchangeEdges = exchangeEdges; + +/* + * The network simplex algorithm assigns ranks to each node in the input graph + * and iteratively improves the ranking to reduce the length of edges. + * + * Preconditions: + * + * 1. The input graph must be a DAG. + * 2. All nodes in the graph must have an object value. + * 3. All edges in the graph must have "minlen" and "weight" attributes. + * + * Postconditions: + * + * 1. All nodes in the graph will have an assigned "rank" attribute that has + * been optimized by the network simplex algorithm. Ranks start at 0. + * + * + * A rough sketch of the algorithm is as follows: + * + * 1. Assign initial ranks to each node. We use the longest path algorithm, + * which assigns ranks to the lowest position possible. In general this + * leads to very wide bottom ranks and unnecessarily long edges. + * 2. Construct a feasible tight tree. A tight tree is one such that all + * edges in the tree have no slack (difference between length of edge + * and minlen for the edge). This by itself greatly improves the assigned + * rankings by shorting edges. + * 3. Iteratively find edges that have negative cut values. Generally a + * negative cut value indicates that the edge could be removed and a new + * tree edge could be added to produce a more compact graph. + * + * Much of the algorithms here are derived from Gansner, et al., "A Technique + * for Drawing Directed Graphs." The structure of the file roughly follows the + * structure of the overall algorithm. + */ +function networkSimplex(g) { + g = simplify(g); + initRank(g); + var t = feasibleTree(g); + initLowLimValues(t); + initCutValues(t, g); + + var e, f; + while ((e = leaveEdge(t))) { + f = enterEdge(t, g, e); + exchangeEdges(t, g, e, f); + } +} + +/* + * Initializes cut values for all edges in the tree. + */ +function initCutValues(t, g) { + var vs = postorder(t, t.nodes()); + vs = vs.slice(0, vs.length - 1); + _.each(vs, function(v) { + assignCutValue(t, g, v); + }); +} + +function assignCutValue(t, g, child) { + var childLab = t.node(child), + parent = childLab.parent; + t.edge(child, parent).cutvalue = calcCutValue(t, g, child); +} + +/* + * Given the tight tree, its graph, and a child in the graph calculate and + * return the cut value for the edge between the child and its parent. + */ +function calcCutValue(t, g, child) { + var childLab = t.node(child), + parent = childLab.parent, + // True if the child is on the tail end of the edge in the directed graph + childIsTail = true, + // The graph's view of the tree edge we're inspecting + graphEdge = g.edge(child, parent), + // The accumulated cut value for the edge between this node and its parent + cutValue = 0; + + if (!graphEdge) { + childIsTail = false; + graphEdge = g.edge(parent, child); + } + + cutValue = graphEdge.weight; + + _.each(g.nodeEdges(child), function(e) { + var isOutEdge = e.v === child, + other = isOutEdge ? e.w : e.v; + + if (other !== parent) { + var pointsToHead = isOutEdge === childIsTail, + otherWeight = g.edge(e).weight; + + cutValue += pointsToHead ? otherWeight : -otherWeight; + if (isTreeEdge(t, child, other)) { + var otherCutValue = t.edge(child, other).cutvalue; + cutValue += pointsToHead ? -otherCutValue : otherCutValue; + } + } + }); + + return cutValue; +} + +function initLowLimValues(tree, root) { + if (arguments.length < 2) { + root = tree.nodes()[0]; + } + dfsAssignLowLim(tree, {}, 1, root); +} + +function dfsAssignLowLim(tree, visited, nextLim, v, parent) { + var low = nextLim, + label = tree.node(v); + + visited[v] = true; + _.each(tree.neighbors(v), function(w) { + if (!_.has(visited, w)) { + nextLim = dfsAssignLowLim(tree, visited, nextLim, w, v); + } + }); + + label.low = low; + label.lim = nextLim++; + if (parent) { + label.parent = parent; + } else { + // TODO should be able to remove this when we incrementally update low lim + delete label.parent; + } + + return nextLim; +} + +function leaveEdge(tree) { + return _.find(tree.edges(), function(e) { + return tree.edge(e).cutvalue < 0; + }); +} + +function enterEdge(t, g, edge) { + var v = edge.v, + w = edge.w; + + // For the rest of this function we assume that v is the tail and w is the + // head, so if we don't have this edge in the graph we should flip it to + // match the correct orientation. + if (!g.hasEdge(v, w)) { + v = edge.w; + w = edge.v; + } + + var vLabel = t.node(v), + wLabel = t.node(w), + tailLabel = vLabel, + flip = false; + + // If the root is in the tail of the edge then we need to flip the logic that + // checks for the head and tail nodes in the candidates function below. + if (vLabel.lim > wLabel.lim) { + tailLabel = wLabel; + flip = true; + } + + var candidates = _.filter(g.edges(), function(edge) { + return flip === isDescendant(t, t.node(edge.v), tailLabel) && + flip !== isDescendant(t, t.node(edge.w), tailLabel); + }); + + return _.min(candidates, function(edge) { return slack(g, edge); }); +} + +function exchangeEdges(t, g, e, f) { + var v = e.v, + w = e.w; + t.removeEdge(v, w); + t.setEdge(f.v, f.w, {}); + initLowLimValues(t); + initCutValues(t, g); + updateRanks(t, g); +} + +function updateRanks(t, g) { + var root = _.find(t.nodes(), function(v) { return !g.node(v).parent; }), + vs = preorder(t, root); + vs = vs.slice(1); + _.each(vs, function(v) { + var parent = t.node(v).parent, + edge = g.edge(v, parent), + flipped = false; + + if (!edge) { + edge = g.edge(parent, v); + flipped = true; + } + + g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen); + }); +} + +/* + * Returns true if the edge is in the tree. + */ +function isTreeEdge(tree, u, v) { + return tree.hasEdge(u, v); +} + +/* + * Returns true if the specified node is descendant of the root node per the + * assigned low and lim attributes in the tree. + */ +function isDescendant(tree, vLabel, rootLabel) { + return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim; +} + +},{"../graphlib":37,"../lodash":40,"../util":59,"./feasible-tree":55,"./util":58}],58:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"); + +module.exports = { + longestPath: longestPath, + slack: slack +}; + +/* + * Initializes ranks for the input graph using the longest path algorithm. This + * algorithm scales well and is fast in practice, it yields rather poor + * solutions. Nodes are pushed to the lowest layer possible, leaving the bottom + * ranks wide and leaving edges longer than necessary. However, due to its + * speed, this algorithm is good for getting an initial ranking that can be fed + * into other algorithms. + * + * This algorithm does not normalize layers because it will be used by other + * algorithms in most cases. If using this algorithm directly, be sure to + * run normalize at the end. + * + * Pre-conditions: + * + * 1. Input graph is a DAG. + * 2. Input graph node labels can be assigned properties. + * + * Post-conditions: + * + * 1. Each node will be assign an (unnormalized) "rank" property. + */ +function longestPath(g) { + var visited = {}; + + function dfs(v) { + var label = g.node(v); + if (_.has(visited, v)) { + return label.rank; + } + visited[v] = true; + + var rank = _.min(_.map(g.outEdges(v), function(e) { + return dfs(e.w) - g.edge(e).minlen; + })); + + if (rank === Number.POSITIVE_INFINITY) { + rank = 0; + } + + return (label.rank = rank); + } + + _.each(g.sources(), dfs); +} + +/* + * Returns the amount of slack for the given edge. The slack is defined as the + * difference between the length of the edge and its minimum length. + */ +function slack(g, e) { + return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen; +} + +},{"../lodash":40}],59:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"), + Graph = require("./graphlib").Graph; + +module.exports = { + addDummyNode: addDummyNode, + simplify: simplify, + asNonCompoundGraph: asNonCompoundGraph, + successorWeights: successorWeights, + predecessorWeights: predecessorWeights, + intersectRect: intersectRect, + buildLayerMatrix: buildLayerMatrix, + normalizeRanks: normalizeRanks, + removeEmptyRanks: removeEmptyRanks, + addBorderNode: addBorderNode, + maxRank: maxRank, + partition: partition, + time: time, + notime: notime +}; + +/* + * Adds a dummy node to the graph and return v. + */ +function addDummyNode(g, type, attrs, name) { + var v; + do { + v = _.uniqueId(name); + } while (g.hasNode(v)); + + attrs.dummy = type; + g.setNode(v, attrs); + return v; +} + +/* + * Returns a new graph with only simple edges. Handles aggregation of data + * associated with multi-edges. + */ +function simplify(g) { + var simplified = new Graph().setGraph(g.graph()); + _.each(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); }); + _.each(g.edges(), function(e) { + var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 }, + label = g.edge(e); + simplified.setEdge(e.v, e.w, { + weight: simpleLabel.weight + label.weight, + minlen: Math.max(simpleLabel.minlen, label.minlen) + }); + }); + return simplified; +} + +function asNonCompoundGraph(g) { + var simplified = new Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph()); + _.each(g.nodes(), function(v) { + if (!g.children(v).length) { + simplified.setNode(v, g.node(v)); + } + }); + _.each(g.edges(), function(e) { + simplified.setEdge(e, g.edge(e)); + }); + return simplified; +} + +function successorWeights(g) { + var weightMap = _.map(g.nodes(), function(v) { + var sucs = {}; + _.each(g.outEdges(v), function(e) { + sucs[e.w] = (sucs[e.w] || 0) + g.edge(e).weight; + }); + return sucs; + }); + return _.zipObject(g.nodes(), weightMap); +} + +function predecessorWeights(g) { + var weightMap = _.map(g.nodes(), function(v) { + var preds = {}; + _.each(g.inEdges(v), function(e) { + preds[e.v] = (preds[e.v] || 0) + g.edge(e).weight; + }); + return preds; + }); + return _.zipObject(g.nodes(), weightMap); +} + +/* + * Finds where a line starting at point ({x, y}) would intersect a rectangle + * ({x, y, width, height}) if it were pointing at the rectangle's center. + */ +function intersectRect(rect, point) { + var x = rect.x; + var y = rect.y; + + // Rectangle intersection algorithm from: + // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes + var dx = point.x - x; + var dy = point.y - y; + var w = rect.width / 2; + var h = rect.height / 2; + + if (!dx && !dy) { + throw new Error("Not possible to find intersection inside of the rectangle"); + } + + var sx, sy; + if (Math.abs(dy) * w > Math.abs(dx) * h) { + // Intersection is top or bottom of rect. + if (dy < 0) { + h = -h; + } + sx = h * dx / dy; + sy = h; + } else { + // Intersection is left or right of rect. + if (dx < 0) { + w = -w; + } + sx = w; + sy = w * dy / dx; + } + + return { x: x + sx, y: y + sy }; +} + +/* + * Given a DAG with each node assigned "rank" and "order" properties, this + * function will produce a matrix with the ids of each node. + */ +function buildLayerMatrix(g) { + var layering = _.map(_.range(maxRank(g) + 1), function() { return []; }); + _.each(g.nodes(), function(v) { + var node = g.node(v), + rank = node.rank; + if (!_.isUndefined(rank)) { + layering[rank][node.order] = v; + } + }); + return layering; +} + +/* + * Adjusts the ranks for all nodes in the graph such that all nodes v have + * rank(v) >= 0 and at least one node w has rank(w) = 0. + */ +function normalizeRanks(g) { + var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); + _.each(g.nodes(), function(v) { + var node = g.node(v); + if (_.has(node, "rank")) { + node.rank -= min; + } + }); +} + +function removeEmptyRanks(g) { + // Ranks may not start at 0, so we need to offset them + var offset = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); + + var layers = []; + _.each(g.nodes(), function(v) { + var rank = g.node(v).rank - offset; + if (!layers[rank]) { + layers[rank] = []; + } + layers[rank].push(v); + }); + + var delta = 0, + nodeRankFactor = g.graph().nodeRankFactor; + _.each(layers, function(vs, i) { + if (_.isUndefined(vs) && i % nodeRankFactor !== 0) { + --delta; + } else if (delta) { + _.each(vs, function(v) { g.node(v).rank += delta; }); + } + }); +} + +function addBorderNode(g, prefix, rank, order) { + var node = { + width: 0, + height: 0 + }; + if (arguments.length >= 4) { + node.rank = rank; + node.order = order; + } + return addDummyNode(g, "border", node, prefix); +} + +function maxRank(g) { + return _.max(_.map(g.nodes(), function(v) { + var rank = g.node(v).rank; + if (!_.isUndefined(rank)) { + return rank; + } + })); +} + +/* + * Partition a collection into two groups: `lhs` and `rhs`. If the supplied + * function returns true for an entry it goes into `lhs`. Otherwise it goes + * into `rhs. + */ +function partition(collection, fn) { + var result = { lhs: [], rhs: [] }; + _.each(collection, function(value) { + if (fn(value)) { + result.lhs.push(value); + } else { + result.rhs.push(value); + } + }); + return result; +} + +/* + * Returns a new function that wraps `fn` with a timer. The wrapper logs the + * time it takes to execute the function. + */ +function time(name, fn) { + var start = _.now(); + try { + return fn(); + } finally { + console.log(name + " time: " + (_.now() - start) + "ms"); + } +} + +function notime(name, fn) { + return fn(); +} + +},{"./graphlib":37,"./lodash":40}],60:[function(require,module,exports){ +module.exports = "0.7.4"; + +},{}],61:[function(require,module,exports){ /** * Copyright (c) 2014, Chris Pettitt * All rights reserved. @@ -11041,7 +13627,7 @@ module.exports = { version: lib.version }; -},{"./lib":49,"./lib/alg":40,"./lib/json":50}],34:[function(require,module,exports){ +},{"./lib":77,"./lib/alg":68,"./lib/json":78}],62:[function(require,module,exports){ var _ = require("../lodash"); module.exports = components; @@ -11070,7 +13656,7 @@ function components(g) { return cmpts; } -},{"../lodash":51}],35:[function(require,module,exports){ +},{"../lodash":79}],63:[function(require,module,exports){ var _ = require("../lodash"); module.exports = dfs; @@ -11111,7 +13697,7 @@ function doDfs(g, v, postorder, visited, acc) { } } -},{"../lodash":51}],36:[function(require,module,exports){ +},{"../lodash":79}],64:[function(require,module,exports){ var dijkstra = require("./dijkstra"), _ = require("../lodash"); @@ -11123,7 +13709,7 @@ function dijkstraAll(g, weightFunc, edgeFunc) { }, {}); } -},{"../lodash":51,"./dijkstra":37}],37:[function(require,module,exports){ +},{"../lodash":79,"./dijkstra":65}],65:[function(require,module,exports){ var _ = require("../lodash"), PriorityQueue = require("../data/priority-queue"); @@ -11179,7 +13765,7 @@ function runDijkstra(g, source, weightFn, edgeFn) { return results; } -},{"../data/priority-queue":47,"../lodash":51}],38:[function(require,module,exports){ +},{"../data/priority-queue":75,"../lodash":79}],66:[function(require,module,exports){ var _ = require("../lodash"), tarjan = require("./tarjan"); @@ -11191,7 +13777,7 @@ function findCycles(g) { }); } -},{"../lodash":51,"./tarjan":45}],39:[function(require,module,exports){ +},{"../lodash":79,"./tarjan":73}],67:[function(require,module,exports){ var _ = require("../lodash"); module.exports = floydWarshall; @@ -11243,7 +13829,7 @@ function runFloydWarshall(g, weightFn, edgeFn) { return results; } -},{"../lodash":51}],40:[function(require,module,exports){ +},{"../lodash":79}],68:[function(require,module,exports){ module.exports = { components: require("./components"), dijkstra: require("./dijkstra"), @@ -11258,7 +13844,7 @@ module.exports = { topsort: require("./topsort") }; -},{"./components":34,"./dijkstra":37,"./dijkstra-all":36,"./find-cycles":38,"./floyd-warshall":39,"./is-acyclic":41,"./postorder":42,"./preorder":43,"./prim":44,"./tarjan":45,"./topsort":46}],41:[function(require,module,exports){ +},{"./components":62,"./dijkstra":65,"./dijkstra-all":64,"./find-cycles":66,"./floyd-warshall":67,"./is-acyclic":69,"./postorder":70,"./preorder":71,"./prim":72,"./tarjan":73,"./topsort":74}],69:[function(require,module,exports){ var topsort = require("./topsort"); module.exports = isAcyclic; @@ -11275,7 +13861,7 @@ function isAcyclic(g) { return true; } -},{"./topsort":46}],42:[function(require,module,exports){ +},{"./topsort":74}],70:[function(require,module,exports){ var dfs = require("./dfs"); module.exports = postorder; @@ -11284,7 +13870,7 @@ function postorder(g, vs) { return dfs(g, vs, "post"); } -},{"./dfs":35}],43:[function(require,module,exports){ +},{"./dfs":63}],71:[function(require,module,exports){ var dfs = require("./dfs"); module.exports = preorder; @@ -11293,7 +13879,7 @@ function preorder(g, vs) { return dfs(g, vs, "pre"); } -},{"./dfs":35}],44:[function(require,module,exports){ +},{"./dfs":63}],72:[function(require,module,exports){ var _ = require("../lodash"), Graph = require("../graph"), PriorityQueue = require("../data/priority-queue"); @@ -11347,7 +13933,7 @@ function prim(g, weightFunc) { return result; } -},{"../data/priority-queue":47,"../graph":48,"../lodash":51}],45:[function(require,module,exports){ +},{"../data/priority-queue":75,"../graph":76,"../lodash":79}],73:[function(require,module,exports){ var _ = require("../lodash"); module.exports = tarjan; @@ -11396,7 +13982,7 @@ function tarjan(g) { return results; } -},{"../lodash":51}],46:[function(require,module,exports){ +},{"../lodash":79}],74:[function(require,module,exports){ var _ = require("../lodash"); module.exports = topsort; @@ -11432,7 +14018,7 @@ function topsort(g) { function CycleException() {} -},{"../lodash":51}],47:[function(require,module,exports){ +},{"../lodash":79}],75:[function(require,module,exports){ var _ = require("../lodash"); module.exports = PriorityQueue; @@ -11586,7 +14172,7 @@ PriorityQueue.prototype._swap = function(i, j) { keyIndices[origArrI.key] = j; }; -},{"../lodash":51}],48:[function(require,module,exports){ +},{"../lodash":79}],76:[function(require,module,exports){ "use strict"; var _ = require("./lodash"); @@ -12107,14 +14693,14 @@ function edgeObjToId(isDirected, edgeObj) { return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name); } -},{"./lodash":51}],49:[function(require,module,exports){ +},{"./lodash":79}],77:[function(require,module,exports){ // Includes only the "core" of graphlib module.exports = { Graph: require("./graph"), version: require("./version") }; -},{"./graph":48,"./version":52}],50:[function(require,module,exports){ +},{"./graph":76,"./version":80}],78:[function(require,module,exports){ var _ = require("./lodash"), Graph = require("./graph"); @@ -12182,27 +14768,12 @@ function read(json) { return g; } -},{"./graph":48,"./lodash":51}],51:[function(require,module,exports){ -/* global window */ - -var lodash; - -if (typeof require === "function") { - try { - lodash = require("lodash"); - } catch (e) {} -} - -if (!lodash) { - lodash = window._; -} - -module.exports = lodash; - -},{"lodash":53}],52:[function(require,module,exports){ +},{"./graph":76,"./lodash":79}],79:[function(require,module,exports){ +module.exports=require(40) +},{"/Users/knut/source/mermaid/node_modules/dagre/lib/lodash.js":40,"lodash":81}],80:[function(require,module,exports){ module.exports = '1.0.7'; -},{}],53:[function(require,module,exports){ +},{}],81:[function(require,module,exports){ (function (global){ /** * @license @@ -24557,2943 +27128,14 @@ module.exports = '1.0.7'; }.call(this)); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],54:[function(require,module,exports){ -/* -Copyright (c) 2012-2014 Chris Pettitt - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -module.exports = { - graphlib: require("./lib/graphlib"), - - layout: require("./lib/layout"), - debug: require("./lib/debug"), - util: { - time: require("./lib/util").time, - notime: require("./lib/util").notime - }, - version: require("./lib/version") -}; - -},{"./lib/debug":59,"./lib/graphlib":60,"./lib/layout":62,"./lib/util":82,"./lib/version":83}],55:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"), - greedyFAS = require("./greedy-fas"); - -module.exports = { - run: run, - undo: undo -}; - -function run(g) { - var fas = (g.graph().acyclicer === "greedy" - ? greedyFAS(g, weightFn(g)) - : dfsFAS(g)); - _.each(fas, function(e) { - var label = g.edge(e); - g.removeEdge(e); - label.forwardName = e.name; - label.reversed = true; - g.setEdge(e.w, e.v, label, _.uniqueId("rev")); - }); - - function weightFn(g) { - return function(e) { - return g.edge(e).weight; - }; - } -} - -function dfsFAS(g) { - var fas = [], - stack = {}, - visited = {}; - - function dfs(v) { - if (_.has(visited, v)) { - return; - } - visited[v] = true; - stack[v] = true; - _.each(g.outEdges(v), function(e) { - if (_.has(stack, e.w)) { - fas.push(e); - } else { - dfs(e.w); - } - }); - delete stack[v]; - } - - _.each(g.nodes(), dfs); - return fas; -} - -function undo(g) { - _.each(g.edges(), function(e) { - var label = g.edge(e); - if (label.reversed) { - g.removeEdge(e); - - var forwardName = label.forwardName; - delete label.reversed; - delete label.forwardName; - g.setEdge(e.w, e.v, label, forwardName); - } - }); -} - -},{"./greedy-fas":61,"./lodash":63}],56:[function(require,module,exports){ -var _ = require("./lodash"), - util = require("./util"); - -module.exports = addBorderSegments; - -function addBorderSegments(g) { - function dfs(v) { - var children = g.children(v), - node = g.node(v); - if (children.length) { - _.each(children, dfs); - } - - if (_.has(node, "minRank")) { - node.borderLeft = []; - node.borderRight = []; - for (var rank = node.minRank, maxRank = node.maxRank + 1; - rank < maxRank; - ++rank) { - addBorderNode(g, "borderLeft", "_bl", v, node, rank); - addBorderNode(g, "borderRight", "_br", v, node, rank); - } - } - } - - _.each(g.children(), dfs); -} - -function addBorderNode(g, prop, prefix, sg, sgNode, rank) { - var label = { width: 0, height: 0, rank: rank, borderType: prop }, - prev = sgNode[prop][rank - 1], - curr = util.addDummyNode(g, "border", label, prefix); - sgNode[prop][rank] = curr; - g.setParent(curr, sg); - if (prev) { - g.setEdge(prev, curr, { weight: 1 }); - } -} - -},{"./lodash":63,"./util":82}],57:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"); - -module.exports = { - adjust: adjust, - undo: undo -}; - -function adjust(g) { - var rankDir = g.graph().rankdir.toLowerCase(); - if (rankDir === "lr" || rankDir === "rl") { - swapWidthHeight(g); - } -} - -function undo(g) { - var rankDir = g.graph().rankdir.toLowerCase(); - if (rankDir === "bt" || rankDir === "rl") { - reverseY(g); - } - - if (rankDir === "lr" || rankDir === "rl") { - swapXY(g); - swapWidthHeight(g); - } -} - -function swapWidthHeight(g) { - _.each(g.nodes(), function(v) { swapWidthHeightOne(g.node(v)); }); - _.each(g.edges(), function(e) { swapWidthHeightOne(g.edge(e)); }); -} - -function swapWidthHeightOne(attrs) { - var w = attrs.width; - attrs.width = attrs.height; - attrs.height = w; -} - -function reverseY(g) { - _.each(g.nodes(), function(v) { reverseYOne(g.node(v)); }); - - _.each(g.edges(), function(e) { - var edge = g.edge(e); - _.each(edge.points, reverseYOne); - if (_.has(edge, "y")) { - reverseYOne(edge); - } - }); -} - -function reverseYOne(attrs) { - attrs.y = -attrs.y; -} - -function swapXY(g) { - _.each(g.nodes(), function(v) { swapXYOne(g.node(v)); }); - - _.each(g.edges(), function(e) { - var edge = g.edge(e); - _.each(edge.points, swapXYOne); - if (_.has(edge, "x")) { - swapXYOne(edge); - } - }); -} - -function swapXYOne(attrs) { - var x = attrs.x; - attrs.x = attrs.y; - attrs.y = x; -} - -},{"./lodash":63}],58:[function(require,module,exports){ -/* - * Simple doubly linked list implementation derived from Cormen, et al., - * "Introduction to Algorithms". - */ - -module.exports = List; - -function List() { - var sentinel = {}; - sentinel._next = sentinel._prev = sentinel; - this._sentinel = sentinel; -} - -List.prototype.dequeue = function() { - var sentinel = this._sentinel, - entry = sentinel._prev; - if (entry !== sentinel) { - unlink(entry); - return entry; - } -}; - -List.prototype.enqueue = function(entry) { - var sentinel = this._sentinel; - if (entry._prev && entry._next) { - unlink(entry); - } - entry._next = sentinel._next; - sentinel._next._prev = entry; - sentinel._next = entry; - entry._prev = sentinel; -}; - -List.prototype.toString = function() { - var strs = [], - sentinel = this._sentinel, - curr = sentinel._prev; - while (curr !== sentinel) { - strs.push(JSON.stringify(curr, filterOutLinks)); - curr = curr._prev; - } - return "[" + strs.join(", ") + "]"; -}; - -function unlink(entry) { - entry._prev._next = entry._next; - entry._next._prev = entry._prev; - delete entry._next; - delete entry._prev; -} - -function filterOutLinks(k, v) { - if (k !== "_next" && k !== "_prev") { - return v; - } -} - -},{}],59:[function(require,module,exports){ -var _ = require("./lodash"), - util = require("./util"), - Graph = require("./graphlib").Graph; - -module.exports = { - debugOrdering: debugOrdering -}; - -/* istanbul ignore next */ -function debugOrdering(g) { - var layerMatrix = util.buildLayerMatrix(g); - - var h = new Graph({ compound: true, multigraph: true }).setGraph({}); - - _.each(g.nodes(), function(v) { - h.setNode(v, { label: v }); - h.setParent(v, "layer" + g.node(v).rank); - }); - - _.each(g.edges(), function(e) { - h.setEdge(e.v, e.w, {}, e.name); - }); - - _.each(layerMatrix, function(layer, i) { - var layerV = "layer" + i; - h.setNode(layerV, { rank: "same" }); - _.reduce(layer, function(u, v) { - h.setEdge(u, v, { style: "invis" }); - return v; - }); - }); - - return h; -} - -},{"./graphlib":60,"./lodash":63,"./util":82}],60:[function(require,module,exports){ -/* global window */ - -var graphlib; - -if (typeof require === "function") { - try { - graphlib = require("graphlib"); - } catch (e) {} -} - -if (!graphlib) { - graphlib = window.graphlib; -} - -module.exports = graphlib; - -},{"graphlib":84}],61:[function(require,module,exports){ -var _ = require("./lodash"), - Graph = require("./graphlib").Graph, - List = require("./data/list"); - -/* - * A greedy heuristic for finding a feedback arc set for a graph. A feedback - * arc set is a set of edges that can be removed to make a graph acyclic. - * The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, "A fast and - * effective heuristic for the feedback arc set problem." This implementation - * adjusts that from the paper to allow for weighted edges. - */ -module.exports = greedyFAS; - -var DEFAULT_WEIGHT_FN = _.constant(1); - -function greedyFAS(g, weightFn) { - if (g.nodeCount() <= 1) { - return []; - } - var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN); - var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx); - - // Expand multi-edges - return _.flatten(_.map(results, function(e) { - return g.outEdges(e.v, e.w); - }), true); -} - -function doGreedyFAS(g, buckets, zeroIdx) { - var results = [], - sources = buckets[buckets.length - 1], - sinks = buckets[0]; - - var entry; - while (g.nodeCount()) { - while ((entry = sinks.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } - while ((entry = sources.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } - if (g.nodeCount()) { - for (var i = buckets.length - 2; i > 0; --i) { - entry = buckets[i].dequeue(); - if (entry) { - results = results.concat(removeNode(g, buckets, zeroIdx, entry, true)); - break; - } - } - } - } - - return results; -} - -function removeNode(g, buckets, zeroIdx, entry, collectPredecessors) { - var results = collectPredecessors ? [] : undefined; - - _.each(g.inEdges(entry.v), function(edge) { - var weight = g.edge(edge), - uEntry = g.node(edge.v); - - if (collectPredecessors) { - results.push({ v: edge.v, w: edge.w }); - } - - uEntry.out -= weight; - assignBucket(buckets, zeroIdx, uEntry); - }); - - _.each(g.outEdges(entry.v), function(edge) { - var weight = g.edge(edge), - w = edge.w, - wEntry = g.node(w); - wEntry["in"] -= weight; - assignBucket(buckets, zeroIdx, wEntry); - }); - - g.removeNode(entry.v); - - return results; -} - -function buildState(g, weightFn) { - var fasGraph = new Graph(), - maxIn = 0, - maxOut = 0; - - _.each(g.nodes(), function(v) { - fasGraph.setNode(v, { v: v, "in": 0, out: 0 }); - }); - - // Aggregate weights on nodes, but also sum the weights across multi-edges - // into a single edge for the fasGraph. - _.each(g.edges(), function(e) { - var prevWeight = fasGraph.edge(e.v, e.w) || 0, - weight = weightFn(e), - edgeWeight = prevWeight + weight; - fasGraph.setEdge(e.v, e.w, edgeWeight); - maxOut = Math.max(maxOut, fasGraph.node(e.v).out += weight); - maxIn = Math.max(maxIn, fasGraph.node(e.w)["in"] += weight); - }); - - var buckets = _.range(maxOut + maxIn + 3).map(function() { return new List(); }); - var zeroIdx = maxIn + 1; - - _.each(fasGraph.nodes(), function(v) { - assignBucket(buckets, zeroIdx, fasGraph.node(v)); - }); - - return { graph: fasGraph, buckets: buckets, zeroIdx: zeroIdx }; -} - -function assignBucket(buckets, zeroIdx, entry) { - if (!entry.out) { - buckets[0].enqueue(entry); - } else if (!entry["in"]) { - buckets[buckets.length - 1].enqueue(entry); - } else { - buckets[entry.out - entry["in"] + zeroIdx].enqueue(entry); - } -} - -},{"./data/list":58,"./graphlib":60,"./lodash":63}],62:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"), - acyclic = require("./acyclic"), - normalize = require("./normalize"), - rank = require("./rank"), - normalizeRanks = require("./util").normalizeRanks, - parentDummyChains = require("./parent-dummy-chains"), - removeEmptyRanks = require("./util").removeEmptyRanks, - nestingGraph = require("./nesting-graph"), - addBorderSegments = require("./add-border-segments"), - coordinateSystem = require("./coordinate-system"), - order = require("./order"), - position = require("./position"), - util = require("./util"), - Graph = require("./graphlib").Graph; - -module.exports = layout; - -function layout(g, opts) { - var time = opts && opts.debugTiming ? util.time : util.notime; - time("layout", function() { - var layoutGraph = time(" buildLayoutGraph", - function() { return buildLayoutGraph(g); }); - time(" runLayout", function() { runLayout(layoutGraph, time); }); - time(" updateInputGraph", function() { updateInputGraph(g, layoutGraph); }); - }); -} - -function runLayout(g, time) { - time(" makeSpaceForEdgeLabels", function() { makeSpaceForEdgeLabels(g); }); - time(" removeSelfEdges", function() { removeSelfEdges(g); }); - time(" acyclic", function() { acyclic.run(g); }); - time(" nestingGraph.run", function() { nestingGraph.run(g); }); - time(" rank", function() { rank(util.asNonCompoundGraph(g)); }); - time(" injectEdgeLabelProxies", function() { injectEdgeLabelProxies(g); }); - time(" removeEmptyRanks", function() { removeEmptyRanks(g); }); - time(" nestingGraph.cleanup", function() { nestingGraph.cleanup(g); }); - time(" normalizeRanks", function() { normalizeRanks(g); }); - time(" assignRankMinMax", function() { assignRankMinMax(g); }); - time(" removeEdgeLabelProxies", function() { removeEdgeLabelProxies(g); }); - time(" normalize.run", function() { normalize.run(g); }); - time(" parentDummyChains", function() { parentDummyChains(g); }); - time(" addBorderSegments", function() { addBorderSegments(g); }); - time(" order", function() { order(g); }); - time(" insertSelfEdges", function() { insertSelfEdges(g); }); - time(" adjustCoordinateSystem", function() { coordinateSystem.adjust(g); }); - time(" position", function() { position(g); }); - time(" positionSelfEdges", function() { positionSelfEdges(g); }); - time(" removeBorderNodes", function() { removeBorderNodes(g); }); - time(" normalize.undo", function() { normalize.undo(g); }); - time(" fixupEdgeLabelCoords", function() { fixupEdgeLabelCoords(g); }); - time(" undoCoordinateSystem", function() { coordinateSystem.undo(g); }); - time(" translateGraph", function() { translateGraph(g); }); - time(" assignNodeIntersects", function() { assignNodeIntersects(g); }); - time(" reversePoints", function() { reversePointsForReversedEdges(g); }); - time(" acyclic.undo", function() { acyclic.undo(g); }); -} - -/* - * Copies final layout information from the layout graph back to the input - * graph. This process only copies whitelisted attributes from the layout graph - * to the input graph, so it serves as a good place to determine what - * attributes can influence layout. - */ -function updateInputGraph(inputGraph, layoutGraph) { - _.each(inputGraph.nodes(), function(v) { - var inputLabel = inputGraph.node(v), - layoutLabel = layoutGraph.node(v); - - if (inputLabel) { - inputLabel.x = layoutLabel.x; - inputLabel.y = layoutLabel.y; - - if (layoutGraph.children(v).length) { - inputLabel.width = layoutLabel.width; - inputLabel.height = layoutLabel.height; - } - } - }); - - _.each(inputGraph.edges(), function(e) { - var inputLabel = inputGraph.edge(e), - layoutLabel = layoutGraph.edge(e); - - inputLabel.points = layoutLabel.points; - if (_.has(layoutLabel, "x")) { - inputLabel.x = layoutLabel.x; - inputLabel.y = layoutLabel.y; - } - }); - - inputGraph.graph().width = layoutGraph.graph().width; - inputGraph.graph().height = layoutGraph.graph().height; -} - -var graphNumAttrs = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], - graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, - graphAttrs = ["acyclicer", "ranker", "rankdir", "align"], - nodeNumAttrs = ["width", "height"], - nodeDefaults = { width: 0, height: 0 }, - edgeNumAttrs = ["minlen", "weight", "width", "height", "labeloffset"], - edgeDefaults = { - minlen: 1, weight: 1, width: 0, height: 0, - labeloffset: 10, labelpos: "r" - }, - edgeAttrs = ["labelpos"]; - -/* - * Constructs a new graph from the input graph, which can be used for layout. - * This process copies only whitelisted attributes from the input graph to the - * layout graph. Thus this function serves as a good place to determine what - * attributes can influence layout. - */ -function buildLayoutGraph(inputGraph) { - var g = new Graph({ multigraph: true, compound: true }), - graph = canonicalize(inputGraph.graph()); - - g.setGraph(_.merge({}, - graphDefaults, - selectNumberAttrs(graph, graphNumAttrs), - _.pick(graph, graphAttrs))); - - _.each(inputGraph.nodes(), function(v) { - var node = canonicalize(inputGraph.node(v)); - g.setNode(v, _.defaults(selectNumberAttrs(node, nodeNumAttrs), nodeDefaults)); - g.setParent(v, inputGraph.parent(v)); - }); - - _.each(inputGraph.edges(), function(e) { - var edge = canonicalize(inputGraph.edge(e)); - g.setEdge(e, _.merge({}, - edgeDefaults, - selectNumberAttrs(edge, edgeNumAttrs), - _.pick(edge, edgeAttrs))); - }); - - return g; -} - -/* - * This idea comes from the Gansner paper: to account for edge labels in our - * layout we split each rank in half by doubling minlen and halving ranksep. - * Then we can place labels at these mid-points between nodes. - * - * We also add some minimal padding to the width to push the label for the edge - * away from the edge itself a bit. - */ -function makeSpaceForEdgeLabels(g) { - var graph = g.graph(); - graph.ranksep /= 2; - _.each(g.edges(), function(e) { - var edge = g.edge(e); - edge.minlen *= 2; - if (edge.labelpos.toLowerCase() !== "c") { - if (graph.rankdir === "TB" || graph.rankdir === "BT") { - edge.width += edge.labeloffset; - } else { - edge.height += edge.labeloffset; - } - } - }); -} - -/* - * Creates temporary dummy nodes that capture the rank in which each edge's - * label is going to, if it has one of non-zero width and height. We do this - * so that we can safely remove empty ranks while preserving balance for the - * label's position. - */ -function injectEdgeLabelProxies(g) { - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (edge.width && edge.height) { - var v = g.node(e.v), - w = g.node(e.w), - label = { rank: (w.rank - v.rank) / 2 + v.rank, e: e }; - util.addDummyNode(g, "edge-proxy", label, "_ep"); - } - }); -} - -function assignRankMinMax(g) { - var maxRank = 0; - _.each(g.nodes(), function(v) { - var node = g.node(v); - if (node.borderTop) { - node.minRank = g.node(node.borderTop).rank; - node.maxRank = g.node(node.borderBottom).rank; - maxRank = _.max(maxRank, node.maxRank); - } - }); - g.graph().maxRank = maxRank; -} - -function removeEdgeLabelProxies(g) { - _.each(g.nodes(), function(v) { - var node = g.node(v); - if (node.dummy === "edge-proxy") { - g.edge(node.e).labelRank = node.rank; - g.removeNode(v); - } - }); -} - -function translateGraph(g) { - var minX = Number.POSITIVE_INFINITY, - maxX = 0, - minY = Number.POSITIVE_INFINITY, - maxY = 0, - graphLabel = g.graph(), - marginX = graphLabel.marginx || 0, - marginY = graphLabel.marginy || 0; - - function getExtremes(attrs) { - var x = attrs.x, - y = attrs.y, - w = attrs.width, - h = attrs.height; - minX = Math.min(minX, x - w / 2); - maxX = Math.max(maxX, x + w / 2); - minY = Math.min(minY, y - h / 2); - maxY = Math.max(maxY, y + h / 2); - } - - _.each(g.nodes(), function(v) { getExtremes(g.node(v)); }); - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (_.has(edge, "x")) { - getExtremes(edge); - } - }); - - minX -= marginX; - minY -= marginY; - - _.each(g.nodes(), function(v) { - var node = g.node(v); - node.x -= minX; - node.y -= minY; - }); - - _.each(g.edges(), function(e) { - var edge = g.edge(e); - _.each(edge.points, function(p) { - p.x -= minX; - p.y -= minY; - }); - if (_.has(edge, "x")) { edge.x -= minX; } - if (_.has(edge, "y")) { edge.y -= minY; } - }); - - graphLabel.width = maxX - minX + marginX; - graphLabel.height = maxY - minY + marginY; -} - -function assignNodeIntersects(g) { - _.each(g.edges(), function(e) { - var edge = g.edge(e), - nodeV = g.node(e.v), - nodeW = g.node(e.w), - p1, p2; - if (!edge.points) { - edge.points = []; - p1 = nodeW; - p2 = nodeV; - } else { - p1 = edge.points[0]; - p2 = edge.points[edge.points.length - 1]; - } - edge.points.unshift(util.intersectRect(nodeV, p1)); - edge.points.push(util.intersectRect(nodeW, p2)); - }); -} - -function fixupEdgeLabelCoords(g) { - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (_.has(edge, "x")) { - if (edge.labelpos === "l" || edge.labelpos === "r") { - edge.width -= edge.labeloffset; - } - switch (edge.labelpos) { - case "l": edge.x -= edge.width / 2 + edge.labeloffset; break; - case "r": edge.x += edge.width / 2 + edge.labeloffset; break; - } - } - }); -} - -function reversePointsForReversedEdges(g) { - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (edge.reversed) { - edge.points.reverse(); - } - }); -} - -function removeBorderNodes(g) { - _.each(g.nodes(), function(v) { - if (g.children(v).length) { - var node = g.node(v), - t = g.node(node.borderTop), - b = g.node(node.borderBottom), - l = g.node(_.last(node.borderLeft)), - r = g.node(_.last(node.borderRight)); - - node.width = Math.abs(r.x - l.x); - node.height = Math.abs(b.y - t.y); - node.x = l.x + node.width / 2; - node.y = t.y + node.height / 2; - } - }); - - _.each(g.nodes(), function(v) { - if (g.node(v).dummy === "border") { - g.removeNode(v); - } - }); -} - -function removeSelfEdges(g) { - _.each(g.edges(), function(e) { - if (e.v === e.w) { - var node = g.node(e.v); - if (!node.selfEdges) { - node.selfEdges = []; - } - node.selfEdges.push({ e: e, label: g.edge(e) }); - g.removeEdge(e); - } - }); -} - -function insertSelfEdges(g) { - var layers = util.buildLayerMatrix(g); - _.each(layers, function(layer) { - var orderShift = 0; - _.each(layer, function(v, i) { - var node = g.node(v); - node.order = i + orderShift; - _.each(node.selfEdges, function(selfEdge) { - util.addDummyNode(g, "selfedge", { - width: selfEdge.label.width, - height: selfEdge.label.height, - rank: node.rank, - order: i + (++orderShift), - e: selfEdge.e, - label: selfEdge.label - }, "_se"); - }); - delete node.selfEdges; - }); - }); -} - -function positionSelfEdges(g) { - _.each(g.nodes(), function(v) { - var node = g.node(v); - if (node.dummy === "selfedge") { - var selfNode = g.node(node.e.v), - x = selfNode.x + selfNode.width / 2, - y = selfNode.y, - dx = node.x - x, - dy = selfNode.height / 2; - g.setEdge(node.e, node.label); - g.removeNode(v); - node.label.points = [ - { x: x + 2 * dx / 3, y: y - dy }, - { x: x + 5 * dx / 6, y: y - dy }, - { x: x + dx , y: y }, - { x: x + 5 * dx / 6, y: y + dy }, - { x: x + 2 * dx / 3, y: y + dy }, - ]; - node.label.x = node.x; - node.label.y = node.y; - } - }); -} - -function selectNumberAttrs(obj, attrs) { - return _.mapValues(_.pick(obj, attrs), Number); -} - -function canonicalize(attrs) { - var newAttrs = {}; - _.each(attrs, function(v, k) { - newAttrs[k.toLowerCase()] = v; - }); - return newAttrs; -} - -},{"./acyclic":55,"./add-border-segments":56,"./coordinate-system":57,"./graphlib":60,"./lodash":63,"./nesting-graph":64,"./normalize":65,"./order":70,"./parent-dummy-chains":75,"./position":77,"./rank":79,"./util":82}],63:[function(require,module,exports){ -module.exports=require(51) -},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\lodash.js":51,"lodash":104}],64:[function(require,module,exports){ -var _ = require("./lodash"), - util = require("./util"); - -module.exports = { - run: run, - cleanup: cleanup -}; - -/* - * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs, - * adds appropriate edges to ensure that all cluster nodes are placed between - * these boundries, and ensures that the graph is connected. - * - * In addition we ensure, through the use of the minlen property, that nodes - * and subgraph border nodes to not end up on the same rank. - * - * Preconditions: - * - * 1. Input graph is a DAG - * 2. Nodes in the input graph has a minlen attribute - * - * Postconditions: - * - * 1. Input graph is connected. - * 2. Dummy nodes are added for the tops and bottoms of subgraphs. - * 3. The minlen attribute for nodes is adjusted to ensure nodes do not - * get placed on the same rank as subgraph border nodes. - * - * The nesting graph idea comes from Sander, "Layout of Compound Directed - * Graphs." - */ -function run(g) { - var root = util.addDummyNode(g, "root", {}, "_root"), - depths = treeDepths(g), - height = _.max(depths) - 1, - nodeSep = 2 * height + 1; - - g.graph().nestingRoot = root; - - // Multiply minlen by nodeSep to align nodes on non-border ranks. - _.each(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; }); - - // Calculate a weight that is sufficient to keep subgraphs vertically compact - var weight = sumWeights(g) + 1; - - // Create border nodes and link them up - _.each(g.children(), function(child) { - dfs(g, root, nodeSep, weight, height, depths, child); - }); - - // Save the multiplier for node layers for later removal of empty border - // layers. - g.graph().nodeRankFactor = nodeSep; -} - -function dfs(g, root, nodeSep, weight, height, depths, v) { - var children = g.children(v); - if (!children.length) { - if (v !== root) { - g.setEdge(root, v, { weight: 0, minlen: nodeSep }); - } - return; - } - - var top = util.addBorderNode(g, "_bt"), - bottom = util.addBorderNode(g, "_bb"), - label = g.node(v); - - g.setParent(top, v); - label.borderTop = top; - g.setParent(bottom, v); - label.borderBottom = bottom; - - _.each(children, function(child) { - dfs(g, root, nodeSep, weight, height, depths, child); - - var childNode = g.node(child), - childTop = childNode.borderTop ? childNode.borderTop : child, - childBottom = childNode.borderBottom ? childNode.borderBottom : child, - thisWeight = childNode.borderTop ? weight : 2 * weight, - minlen = childTop !== childBottom ? 1 : height - depths[v] + 1; - - g.setEdge(top, childTop, { - weight: thisWeight, - minlen: minlen, - nestingEdge: true - }); - - g.setEdge(childBottom, bottom, { - weight: thisWeight, - minlen: minlen, - nestingEdge: true - }); - }); - - if (!g.parent(v)) { - g.setEdge(root, top, { weight: 0, minlen: height + depths[v] }); - } -} - -function treeDepths(g) { - var depths = {}; - function dfs(v, depth) { - var children = g.children(v); - if (children && children.length) { - _.each(children, function(child) { - dfs(child, depth + 1); - }); - } - depths[v] = depth; - } - _.each(g.children(), function(v) { dfs(v, 1); }); - return depths; -} - -function sumWeights(g) { - return _.reduce(g.edges(), function(acc, e) { - return acc + g.edge(e).weight; - }, 0); -} - -function cleanup(g) { - var graphLabel = g.graph(); - g.removeNode(graphLabel.nestingRoot); - delete graphLabel.nestingRoot; - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (edge.nestingEdge) { - g.removeEdge(e); - } - }); -} - -},{"./lodash":63,"./util":82}],65:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"), - util = require("./util"); - -module.exports = { - run: run, - undo: undo -}; - -/* - * Breaks any long edges in the graph into short segments that span 1 layer - * each. This operation is undoable with the denormalize function. - * - * Pre-conditions: - * - * 1. The input graph is a DAG. - * 2. Each node in the graph has a "rank" property. - * - * Post-condition: - * - * 1. All edges in the graph have a length of 1. - * 2. Dummy nodes are added where edges have been split into segments. - * 3. The graph is augmented with a "dummyChains" attribute which contains - * the first dummy in each chain of dummy nodes produced. - */ -function run(g) { - g.graph().dummyChains = []; - _.each(g.edges(), function(edge) { normalizeEdge(g, edge); }); -} - -function normalizeEdge(g, e) { - var v = e.v, - vRank = g.node(v).rank, - w = e.w, - wRank = g.node(w).rank, - name = e.name, - edgeLabel = g.edge(e), - labelRank = edgeLabel.labelRank; - - if (wRank === vRank + 1) return; - - g.removeEdge(e); - - var dummy, attrs, i; - for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) { - edgeLabel.points = []; - attrs = { - width: 0, height: 0, - edgeLabel: edgeLabel, edgeObj: e, - rank: vRank - }; - dummy = util.addDummyNode(g, "edge", attrs, "_d"); - if (vRank === labelRank) { - attrs.width = edgeLabel.width; - attrs.height = edgeLabel.height; - attrs.dummy = "edge-label"; - attrs.labelpos = edgeLabel.labelpos; - } - g.setEdge(v, dummy, { weight: edgeLabel.weight }, name); - if (i === 0) { - g.graph().dummyChains.push(dummy); - } - v = dummy; - } - - g.setEdge(v, w, { weight: edgeLabel.weight }, name); -} - -function undo(g) { - _.each(g.graph().dummyChains, function(v) { - var node = g.node(v), - origLabel = node.edgeLabel, - w; - g.setEdge(node.edgeObj, origLabel); - while (node.dummy) { - w = g.successors(v)[0]; - g.removeNode(v); - origLabel.points.push({ x: node.x, y: node.y }); - if (node.dummy === "edge-label") { - origLabel.x = node.x; - origLabel.y = node.y; - origLabel.width = node.width; - origLabel.height = node.height; - } - v = w; - node = g.node(v); - } - }); -} - -},{"./lodash":63,"./util":82}],66:[function(require,module,exports){ -var _ = require("../lodash"); - -module.exports = addSubgraphConstraints; - -function addSubgraphConstraints(g, cg, vs) { - var prev = {}, - rootPrev; - - _.each(vs, function(v) { - var child = g.parent(v), - parent, - prevChild; - while (child) { - parent = g.parent(child); - if (parent) { - prevChild = prev[parent]; - prev[parent] = child; - } else { - prevChild = rootPrev; - rootPrev = child; - } - if (prevChild && prevChild !== child) { - cg.setEdge(prevChild, child); - return; - } - child = parent; - } - }); - - /* - function dfs(v) { - var children = v ? g.children(v) : g.children(); - if (children.length) { - var min = Number.POSITIVE_INFINITY, - subgraphs = []; - _.each(children, function(child) { - var childMin = dfs(child); - if (g.children(child).length) { - subgraphs.push({ v: child, order: childMin }); - } - min = Math.min(min, childMin); - }); - _.reduce(_.sortBy(subgraphs, "order"), function(prev, curr) { - cg.setEdge(prev.v, curr.v); - return curr; - }); - return min; - } - return g.node(v).order; - } - dfs(undefined); - */ -} - -},{"../lodash":63}],67:[function(require,module,exports){ -var _ = require("../lodash"); - -module.exports = barycenter; - -function barycenter(g, movable) { - return _.map(movable, function(v) { - var inV = g.inEdges(v); - if (!inV.length) { - return { v: v }; - } else { - var result = _.reduce(inV, function(acc, e) { - var edge = g.edge(e), - nodeU = g.node(e.v); - return { - sum: acc.sum + (edge.weight * nodeU.order), - weight: acc.weight + edge.weight - }; - }, { sum: 0, weight: 0 }); - - return { - v: v, - barycenter: result.sum / result.weight, - weight: result.weight - }; - } - }); -} - - -},{"../lodash":63}],68:[function(require,module,exports){ -var _ = require("../lodash"), - Graph = require("../graphlib").Graph; - -module.exports = buildLayerGraph; - -/* - * Constructs a graph that can be used to sort a layer of nodes. The graph will - * contain all base and subgraph nodes from the request layer in their original - * hierarchy and any edges that are incident on these nodes and are of the type - * requested by the "relationship" parameter. - * - * Nodes from the requested rank that do not have parents are assigned a root - * node in the output graph, which is set in the root graph attribute. This - * makes it easy to walk the hierarchy of movable nodes during ordering. - * - * Pre-conditions: - * - * 1. Input graph is a DAG - * 2. Base nodes in the input graph have a rank attribute - * 3. Subgraph nodes in the input graph has minRank and maxRank attributes - * 4. Edges have an assigned weight - * - * Post-conditions: - * - * 1. Output graph has all nodes in the movable rank with preserved - * hierarchy. - * 2. Root nodes in the movable layer are made children of the node - * indicated by the root attribute of the graph. - * 3. Non-movable nodes incident on movable nodes, selected by the - * relationship parameter, are included in the graph (without hierarchy). - * 4. Edges incident on movable nodes, selected by the relationship - * parameter, are added to the output graph. - * 5. The weights for copied edges are aggregated as need, since the output - * graph is not a multi-graph. - */ -function buildLayerGraph(g, rank, relationship) { - var root = createRootNode(g), - result = new Graph({ compound: true }).setGraph({ root: root }) - .setDefaultNodeLabel(function(v) { return g.node(v); }); - - _.each(g.nodes(), function(v) { - var node = g.node(v), - parent = g.parent(v); - - if (node.rank === rank || node.minRank <= rank && rank <= node.maxRank) { - result.setNode(v); - result.setParent(v, parent || root); - - // This assumes we have only short edges! - _.each(g[relationship](v), function(e) { - var u = e.v === v ? e.w : e.v, - edge = result.edge(u, v), - weight = !_.isUndefined(edge) ? edge.weight : 0; - result.setEdge(u, v, { weight: g.edge(e).weight + weight }); - }); - - if (_.has(node, "minRank")) { - result.setNode(v, { - borderLeft: node.borderLeft[rank], - borderRight: node.borderRight[rank] - }); - } - } - }); - - return result; -} - -function createRootNode(g) { - var v; - while (g.hasNode((v = _.uniqueId("_root")))); - return v; -} - -},{"../graphlib":60,"../lodash":63}],69:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"); - -module.exports = crossCount; - -/* - * A function that takes a layering (an array of layers, each with an array of - * ordererd nodes) and a graph and returns a weighted crossing count. - * - * Pre-conditions: - * - * 1. Input graph must be simple (not a multigraph), directed, and include - * only simple edges. - * 2. Edges in the input graph must have assigned weights. - * - * Post-conditions: - * - * 1. The graph and layering matrix are left unchanged. - * - * This algorithm is derived from Barth, et al., "Bilayer Cross Counting." - */ -function crossCount(g, layering) { - var cc = 0; - for (var i = 1; i < layering.length; ++i) { - cc += twoLayerCrossCount(g, layering[i-1], layering[i]); - } - return cc; -} - -function twoLayerCrossCount(g, northLayer, southLayer) { - // Sort all of the edges between the north and south layers by their position - // in the north layer and then the south. Map these edges to the position of - // their head in the south layer. - var southPos = _.zipObject(southLayer, - _.map(southLayer, function (v, i) { return i; })); - var southEntries = _.flatten(_.map(northLayer, function(v) { - return _.chain(g.outEdges(v)) - .map(function(e) { - return { pos: southPos[e.w], weight: g.edge(e).weight }; - }) - .sortBy("pos") - .value(); - }), true); - - // Build the accumulator tree - var firstIndex = 1; - while (firstIndex < southLayer.length) firstIndex <<= 1; - var treeSize = 2 * firstIndex - 1; - firstIndex -= 1; - var tree = _.map(new Array(treeSize), function() { return 0; }); - - // Calculate the weighted crossings - var cc = 0; - _.each(southEntries.forEach(function(entry) { - var index = entry.pos + firstIndex; - tree[index] += entry.weight; - var weightSum = 0; - while (index > 0) { - if (index % 2) { - weightSum += tree[index + 1]; - } - index = (index - 1) >> 1; - tree[index] += entry.weight; - } - cc += entry.weight * weightSum; - })); - - return cc; -} - -},{"../lodash":63}],70:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - initOrder = require("./init-order"), - crossCount = require("./cross-count"), - sortSubgraph = require("./sort-subgraph"), - buildLayerGraph = require("./build-layer-graph"), - addSubgraphConstraints = require("./add-subgraph-constraints"), - Graph = require("../graphlib").Graph, - util = require("../util"); - -module.exports = order; - -/* - * Applies heuristics to minimize edge crossings in the graph and sets the best - * order solution as an order attribute on each node. - * - * Pre-conditions: - * - * 1. Graph must be DAG - * 2. Graph nodes must be objects with a "rank" attribute - * 3. Graph edges must have the "weight" attribute - * - * Post-conditions: - * - * 1. Graph nodes will have an "order" attribute based on the results of the - * algorithm. - */ -function order(g) { - var maxRank = util.maxRank(g), - downLayerGraphs = buildLayerGraphs(g, _.range(1, maxRank + 1), "inEdges"), - upLayerGraphs = buildLayerGraphs(g, _.range(maxRank - 1, -1, -1), "outEdges"); - - var layering = initOrder(g); - assignOrder(g, layering); - - var bestCC = Number.POSITIVE_INFINITY, - best; - - for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) { - sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2); - - layering = util.buildLayerMatrix(g); - var cc = crossCount(g, layering); - if (cc < bestCC) { - lastBest = 0; - best = _.cloneDeep(layering); - bestCC = cc; - } - } - - assignOrder(g, best); -} - -function buildLayerGraphs(g, ranks, relationship) { - return _.map(ranks, function(rank) { - return buildLayerGraph(g, rank, relationship); - }); -} - -function sweepLayerGraphs(layerGraphs, biasRight) { - var cg = new Graph(); - _.each(layerGraphs, function(lg) { - var root = lg.graph().root; - var sorted = sortSubgraph(lg, root, cg, biasRight); - _.each(sorted.vs, function(v, i) { - lg.node(v).order = i; - }); - addSubgraphConstraints(lg, cg, sorted.vs); - }); -} - -function assignOrder(g, layering) { - _.each(layering, function(layer) { - _.each(layer, function(v, i) { - g.node(v).order = i; - }); - }); -} - -},{"../graphlib":60,"../lodash":63,"../util":82,"./add-subgraph-constraints":66,"./build-layer-graph":68,"./cross-count":69,"./init-order":71,"./sort-subgraph":73}],71:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"); - -module.exports = initOrder; - -/* - * Assigns an initial order value for each node by performing a DFS search - * starting from nodes in the first rank. Nodes are assigned an order in their - * rank as they are first visited. - * - * This approach comes from Gansner, et al., "A Technique for Drawing Directed - * Graphs." - * - * Returns a layering matrix with an array per layer and each layer sorted by - * the order of its nodes. - */ -function initOrder(g) { - var visited = {}, - simpleNodes = _.filter(g.nodes(), function(v) { - return !g.children(v).length; - }), - maxRank = _.max(_.map(simpleNodes, function(v) { return g.node(v).rank; })), - layers = _.map(_.range(maxRank + 1), function() { return []; }); - - function dfs(v) { - if (_.has(visited, v)) return; - visited[v] = true; - var node = g.node(v); - layers[node.rank].push(v); - _.each(g.successors(v), dfs); - } - - var orderedVs = _.sortBy(simpleNodes, function(v) { return g.node(v).rank; }); - _.each(orderedVs, dfs); - - return layers; -} - -},{"../lodash":63}],72:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"); - -module.exports = resolveConflicts; - -/* - * Given a list of entries of the form {v, barycenter, weight} and a - * constraint graph this function will resolve any conflicts between the - * constraint graph and the barycenters for the entries. If the barycenters for - * an entry would violate a constraint in the constraint graph then we coalesce - * the nodes in the conflict into a new node that respects the contraint and - * aggregates barycenter and weight information. - * - * This implementation is based on the description in Forster, "A Fast and - * Simple Hueristic for Constrained Two-Level Crossing Reduction," thought it - * differs in some specific details. - * - * Pre-conditions: - * - * 1. Each entry has the form {v, barycenter, weight}, or if the node has - * no barycenter, then {v}. - * - * Returns: - * - * A new list of entries of the form {vs, i, barycenter, weight}. The list - * `vs` may either be a singleton or it may be an aggregation of nodes - * ordered such that they do not violate constraints from the constraint - * graph. The property `i` is the lowest original index of any of the - * elements in `vs`. - */ -function resolveConflicts(entries, cg) { - var mappedEntries = {}; - _.each(entries, function(entry, i) { - var tmp = mappedEntries[entry.v] = { - indegree: 0, - "in": [], - out: [], - vs: [entry.v], - i: i - }; - if (!_.isUndefined(entry.barycenter)) { - tmp.barycenter = entry.barycenter; - tmp.weight = entry.weight; - } - }); - - _.each(cg.edges(), function(e) { - var entryV = mappedEntries[e.v], - entryW = mappedEntries[e.w]; - if (!_.isUndefined(entryV) && !_.isUndefined(entryW)) { - entryW.indegree++; - entryV.out.push(mappedEntries[e.w]); - } - }); - - var sourceSet = _.filter(mappedEntries, function(entry) { - return !entry.indegree; - }); - - return doResolveConflicts(sourceSet); -} - -function doResolveConflicts(sourceSet) { - var entries = []; - - function handleIn(vEntry) { - return function(uEntry) { - if (uEntry.merged) { - return; - } - if (_.isUndefined(uEntry.barycenter) || - _.isUndefined(vEntry.barycenter) || - uEntry.barycenter >= vEntry.barycenter) { - mergeEntries(vEntry, uEntry); - } - }; - } - - function handleOut(vEntry) { - return function(wEntry) { - wEntry["in"].push(vEntry); - if (--wEntry.indegree === 0) { - sourceSet.push(wEntry); - } - }; - } - - while (sourceSet.length) { - var entry = sourceSet.pop(); - entries.push(entry); - _.each(entry["in"].reverse(), handleIn(entry)); - _.each(entry.out, handleOut(entry)); - } - - return _.chain(entries) - .filter(function(entry) { return !entry.merged; }) - .map(function(entry) { - return _.pick(entry, ["vs", "i", "barycenter", "weight"]); - }) - .value(); -} - -function mergeEntries(target, source) { - var sum = 0, - weight = 0; - - if (target.weight) { - sum += target.barycenter * target.weight; - weight += target.weight; - } - - if (source.weight) { - sum += source.barycenter * source.weight; - weight += source.weight; - } - - target.vs = source.vs.concat(target.vs); - target.barycenter = sum / weight; - target.weight = weight; - target.i = Math.min(source.i, target.i); - source.merged = true; -} - -},{"../lodash":63}],73:[function(require,module,exports){ -var _ = require("../lodash"), - barycenter = require("./barycenter"), - resolveConflicts = require("./resolve-conflicts"), - sort = require("./sort"); - -module.exports = sortSubgraph; - -function sortSubgraph(g, v, cg, biasRight) { - var movable = g.children(v), - node = g.node(v), - bl = node ? node.borderLeft : undefined, - br = node ? node.borderRight: undefined, - subgraphs = {}; - - if (bl) { - movable = _.filter(movable, function(w) { - return w !== bl && w !== br; - }); - } - - var barycenters = barycenter(g, movable); - _.each(barycenters, function(entry) { - if (g.children(entry.v).length) { - var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight); - subgraphs[entry.v] = subgraphResult; - if (_.has(subgraphResult, "barycenter")) { - mergeBarycenters(entry, subgraphResult); - } - } - }); - - var entries = resolveConflicts(barycenters, cg); - expandSubgraphs(entries, subgraphs); - - var result = sort(entries, biasRight); - - if (bl) { - result.vs = _.flatten([bl, result.vs, br], true); - if (g.predecessors(bl).length) { - var blPred = g.node(g.predecessors(bl)[0]), - brPred = g.node(g.predecessors(br)[0]); - if (!_.has(result, "barycenter")) { - result.barycenter = 0; - result.weight = 0; - } - result.barycenter = (result.barycenter * result.weight + - blPred.order + brPred.order) / (result.weight + 2); - result.weight += 2; - } - } - - return result; -} - -function expandSubgraphs(entries, subgraphs) { - _.each(entries, function(entry) { - entry.vs = _.flatten(entry.vs.map(function(v) { - if (subgraphs[v]) { - return subgraphs[v].vs; - } - return v; - }), true); - }); -} - -function mergeBarycenters(target, other) { - if (!_.isUndefined(target.barycenter)) { - target.barycenter = (target.barycenter * target.weight + - other.barycenter * other.weight) / - (target.weight + other.weight); - target.weight += other.weight; - } else { - target.barycenter = other.barycenter; - target.weight = other.weight; - } -} - -},{"../lodash":63,"./barycenter":67,"./resolve-conflicts":72,"./sort":74}],74:[function(require,module,exports){ -var _ = require("../lodash"), - util = require("../util"); - -module.exports = sort; - -function sort(entries, biasRight) { - var parts = util.partition(entries, function(entry) { - return _.has(entry, "barycenter"); - }); - var sortable = parts.lhs, - unsortable = _.sortBy(parts.rhs, function(entry) { return -entry.i; }), - vs = [], - sum = 0, - weight = 0, - vsIndex = 0; - - sortable.sort(compareWithBias(!!biasRight)); - - vsIndex = consumeUnsortable(vs, unsortable, vsIndex); - - _.each(sortable, function (entry) { - vsIndex += entry.vs.length; - vs.push(entry.vs); - sum += entry.barycenter * entry.weight; - weight += entry.weight; - vsIndex = consumeUnsortable(vs, unsortable, vsIndex); - }); - - var result = { vs: _.flatten(vs, true) }; - if (weight) { - result.barycenter = sum / weight; - result.weight = weight; - } - return result; -} - -function consumeUnsortable(vs, unsortable, index) { - var last; - while (unsortable.length && (last = _.last(unsortable)).i <= index) { - unsortable.pop(); - vs.push(last.vs); - index++; - } - return index; -} - -function compareWithBias(bias) { - return function(entryV, entryW) { - if (entryV.barycenter < entryW.barycenter) { - return -1; - } else if (entryV.barycenter > entryW.barycenter) { - return 1; - } - - return !bias ? entryV.i - entryW.i : entryW.i - entryV.i; - }; -} - -},{"../lodash":63,"../util":82}],75:[function(require,module,exports){ -var _ = require("./lodash"); - -module.exports = parentDummyChains; - -function parentDummyChains(g) { - var postorderNums = postorder(g); - - _.each(g.graph().dummyChains, function(v) { - var node = g.node(v), - edgeObj = node.edgeObj, - pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w), - path = pathData.path, - lca = pathData.lca, - pathIdx = 0, - pathV = path[pathIdx], - ascending = true; - - while (v !== edgeObj.w) { - node = g.node(v); - - if (ascending) { - while ((pathV = path[pathIdx]) !== lca && - g.node(pathV).maxRank < node.rank) { - pathIdx++; - } - - if (pathV === lca) { - ascending = false; - } - } - - if (!ascending) { - while (pathIdx < path.length - 1 && - g.node(pathV = path[pathIdx + 1]).minRank <= node.rank) { - pathIdx++; - } - pathV = path[pathIdx]; - } - - g.setParent(v, pathV); - v = g.successors(v)[0]; - } - }); -} - -// Find a path from v to w through the lowest common ancestor (LCA). Return the -// full path and the LCA. -function findPath(g, postorderNums, v, w) { - var vPath = [], - wPath = [], - low = Math.min(postorderNums[v].low, postorderNums[w].low), - lim = Math.max(postorderNums[v].lim, postorderNums[w].lim), - parent, - lca; - - // Traverse up from v to find the LCA - parent = v; - do { - parent = g.parent(parent); - vPath.push(parent); - } while (parent && - (postorderNums[parent].low > low || lim > postorderNums[parent].lim)); - lca = parent; - - // Traverse from w to LCA - parent = w; - while ((parent = g.parent(parent)) !== lca) { - wPath.push(parent); - } - - return { path: vPath.concat(wPath.reverse()), lca: lca }; -} - -function postorder(g) { - var result = {}, - lim = 0; - - function dfs(v) { - var low = lim; - _.each(g.children(v), dfs); - result[v] = { low: low, lim: lim++ }; - } - _.each(g.children(), dfs); - - return result; -} - -},{"./lodash":63}],76:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - Graph = require("../graphlib").Graph, - util = require("../util"); - -/* - * This module provides coordinate assignment based on Brandes and Köpf, "Fast - * and Simple Horizontal Coordinate Assignment." - */ - -module.exports = { - positionX: positionX, - findType1Conflicts: findType1Conflicts, - findType2Conflicts: findType2Conflicts, - addConflict: addConflict, - hasConflict: hasConflict, - verticalAlignment: verticalAlignment, - horizontalCompaction: horizontalCompaction, - alignCoordinates: alignCoordinates, - findSmallestWidthAlignment: findSmallestWidthAlignment, - balance: balance -}; - -/* - * Marks all edges in the graph with a type-1 conflict with the "type1Conflict" - * property. A type-1 conflict is one where a non-inner segment crosses an - * inner segment. An inner segment is an edge with both incident nodes marked - * with the "dummy" property. - * - * This algorithm scans layer by layer, starting with the second, for type-1 - * conflicts between the current layer and the previous layer. For each layer - * it scans the nodes from left to right until it reaches one that is incident - * on an inner segment. It then scans predecessors to determine if they have - * edges that cross that inner segment. At the end a final scan is done for all - * nodes on the current rank to see if they cross the last visited inner - * segment. - * - * This algorithm (safely) assumes that a dummy node will only be incident on a - * single node in the layers being scanned. - */ -function findType1Conflicts(g, layering) { - var conflicts = {}; - - function visitLayer(prevLayer, layer) { - var - // last visited node in the previous layer that is incident on an inner - // segment. - k0 = 0, - // Tracks the last node in this layer scanned for crossings with a type-1 - // segment. - scanPos = 0, - prevLayerLength = prevLayer.length, - lastNode = _.last(layer); - - _.each(layer, function(v, i) { - var w = findOtherInnerSegmentNode(g, v), - k1 = w ? g.node(w).order : prevLayerLength; - - if (w || v === lastNode) { - _.each(layer.slice(scanPos, i +1), function(scanNode) { - _.each(g.predecessors(scanNode), function(u) { - var uLabel = g.node(u), - uPos = uLabel.order; - if ((uPos < k0 || k1 < uPos) && - !(uLabel.dummy && g.node(scanNode).dummy)) { - addConflict(conflicts, u, scanNode); - } - }); - }); - scanPos = i + 1; - k0 = k1; - } - }); - - return layer; - } - - _.reduce(layering, visitLayer); - return conflicts; -} - -function findType2Conflicts(g, layering) { - var conflicts = {}; - - function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) { - var v; - _.each(_.range(southPos, southEnd), function(i) { - v = south[i]; - if (g.node(v).dummy) { - _.each(g.predecessors(v), function(u) { - var uNode = g.node(u); - if (uNode.dummy && - (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) { - addConflict(conflicts, u, v); - } - }); - } - }); - } - - - function visitLayer(north, south) { - var prevNorthPos = -1, - nextNorthPos, - southPos = 0; - - _.each(south, function(v, southLookahead) { - if (g.node(v).dummy === "border") { - var predecessors = g.predecessors(v); - if (predecessors.length) { - nextNorthPos = g.node(predecessors[0]).order; - scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos); - southPos = southLookahead; - prevNorthPos = nextNorthPos; - } - } - scan(south, southPos, south.length, nextNorthPos, north.length); - }); - - return south; - } - - _.reduce(layering, visitLayer); - return conflicts; -} - -function findOtherInnerSegmentNode(g, v) { - if (g.node(v).dummy) { - return _.find(g.predecessors(v), function(u) { - return g.node(u).dummy; - }); - } -} - -function addConflict(conflicts, v, w) { - if (v > w) { - var tmp = v; - v = w; - w = tmp; - } - - var conflictsV = conflicts[v]; - if (!conflictsV) { - conflicts[v] = conflictsV = {}; - } - conflictsV[w] = true; -} - -function hasConflict(conflicts, v, w) { - if (v > w) { - var tmp = v; - v = w; - w = tmp; - } - return _.has(conflicts[v], w); -} - -/* - * Try to align nodes into vertical "blocks" where possible. This algorithm - * attempts to align a node with one of its median neighbors. If the edge - * connecting a neighbor is a type-1 conflict then we ignore that possibility. - * If a previous node has already formed a block with a node after the node - * we're trying to form a block with, we also ignore that possibility - our - * blocks would be split in that scenario. - */ -function verticalAlignment(g, layering, conflicts, neighborFn) { - var root = {}, - align = {}, - pos = {}; - - // We cache the position here based on the layering because the graph and - // layering may be out of sync. The layering matrix is manipulated to - // generate different extreme alignments. - _.each(layering, function(layer) { - _.each(layer, function(v, order) { - root[v] = v; - align[v] = v; - pos[v] = order; - }); - }); - - _.each(layering, function(layer) { - var prevIdx = -1; - _.each(layer, function(v) { - var ws = neighborFn(v); - if (ws.length) { - ws = _.sortBy(ws, function(w) { return pos[w]; }); - var mp = (ws.length - 1) / 2; - for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) { - var w = ws[i]; - if (align[v] === v && - prevIdx < pos[w] && - !hasConflict(conflicts, v, w)) { - align[w] = v; - align[v] = root[v] = root[w]; - prevIdx = pos[w]; - } - } - } - }); - }); - - return { root: root, align: align }; -} - -function horizontalCompaction(g, layering, root, align, reverseSep) { - // This portion of the algorithm differs from BK due to a number of problems. - // Instead of their algorithm we construct a new block graph and do two - // sweeps. The first sweep places blocks with the smallest possible - // coordinates. The second sweep removes unused space by moving blocks to the - // greatest coordinates without violating separation. - var xs = {}, - blockG = buildBlockGraph(g, layering, root, reverseSep); - - // First pass, assign smallest coordinates via DFS - var visited = {}; - function pass1(v) { - if (!_.has(visited, v)) { - visited[v] = true; - xs[v] = _.reduce(blockG.inEdges(v), function(max, e) { - pass1(e.v); - return Math.max(max, xs[e.v] + blockG.edge(e)); - }, 0); - } - } - _.each(blockG.nodes(), pass1); - - var borderType = reverseSep ? "borderLeft" : "borderRight"; - function pass2(v) { - if (visited[v] !== 2) { - visited[v]++; - var node = g.node(v); - var min = _.reduce(blockG.outEdges(v), function(min, e) { - pass2(e.w); - return Math.min(min, xs[e.w] - blockG.edge(e)); - }, Number.POSITIVE_INFINITY); - if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) { - xs[v] = Math.max(xs[v], min); - } - } - } - _.each(blockG.nodes(), pass2); - - // Assign x coordinates to all nodes - _.each(align, function(v) { - xs[v] = xs[root[v]]; - }); - - return xs; -} - - -function buildBlockGraph(g, layering, root, reverseSep) { - var blockGraph = new Graph(), - graphLabel = g.graph(), - sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep); - - _.each(layering, function(layer) { - var u; - _.each(layer, function(v) { - var vRoot = root[v]; - blockGraph.setNode(vRoot); - if (u) { - var uRoot = root[u], - prevMax = blockGraph.edge(uRoot, vRoot); - blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0)); - } - u = v; - }); - }); - - return blockGraph; -} - -/* - * Returns the alignment that has the smallest width of the given alignments. - */ -function findSmallestWidthAlignment(g, xss) { - return _.min(xss, function(xs) { - var min = _.min(xs, function(x, v) { return x - width(g, v) / 2; }), - max = _.max(xs, function(x, v) { return x + width(g, v) / 2; }); - return max - min; - }); -} - -/* - * Align the coordinates of each of the layout alignments such that - * left-biased alignments have their minimum coordinate at the same point as - * the minimum coordinate of the smallest width alignment and right-biased - * alignments have their maximum coordinate at the same point as the maximum - * coordinate of the smallest width alignment. - */ -function alignCoordinates(xss, alignTo) { - var alignToMin = _.min(alignTo), - alignToMax = _.max(alignTo); - - _.each(["u", "d"], function(vert) { - _.each(["l", "r"], function(horiz) { - var alignment = vert + horiz, - xs = xss[alignment], - delta; - if (xs === alignTo) return; - - delta = horiz === "l" ? alignToMin - _.min(xs) : alignToMax - _.max(xs); - - if (delta) { - xss[alignment] = _.mapValues(xs, function(x) { return x + delta; }); - } - }); - }); -} - -function balance(xss, align) { - return _.mapValues(xss.ul, function(ignore, v) { - if (align) { - return xss[align.toLowerCase()][v]; - } else { - var xs = _.sortBy(_.pluck(xss, v)); - return (xs[1] + xs[2]) / 2; - } - }); -} - -function positionX(g) { - var layering = util.buildLayerMatrix(g), - conflicts = _.merge(findType1Conflicts(g, layering), - findType2Conflicts(g, layering)); - - var xss = {}, - adjustedLayering; - _.each(["u", "d"], function(vert) { - adjustedLayering = vert === "u" ? layering : _.values(layering).reverse(); - _.each(["l", "r"], function(horiz) { - if (horiz === "r") { - adjustedLayering = _.map(adjustedLayering, function(inner) { - return _.values(inner).reverse(); - }); - } - - var neighborFn = _.bind(vert === "u" ? g.predecessors : g.successors, g); - var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn); - var xs = horizontalCompaction(g, adjustedLayering, - align.root, align.align, - horiz === "r"); - if (horiz === "r") { - xs = _.mapValues(xs, function(x) { return -x; }); - } - xss[vert + horiz] = xs; - }); - }); - - var smallestWidth = findSmallestWidthAlignment(g, xss); - alignCoordinates(xss, smallestWidth); - return balance(xss, g.graph().align); -} - -function sep(nodeSep, edgeSep, reverseSep) { - return function(g, v, w) { - var vLabel = g.node(v), - wLabel = g.node(w), - sum = 0, - delta; - - sum += vLabel.width / 2; - if (_.has(vLabel, "labelpos")) { - switch (vLabel.labelpos.toLowerCase()) { - case "l": delta = -vLabel.width / 2; break; - case "r": delta = vLabel.width / 2; break; - } - } - if (delta) { - sum += reverseSep ? delta : -delta; - } - delta = 0; - - sum += (vLabel.dummy ? edgeSep : nodeSep) / 2; - sum += (wLabel.dummy ? edgeSep : nodeSep) / 2; - - sum += wLabel.width / 2; - if (_.has(wLabel, "labelpos")) { - switch (wLabel.labelpos.toLowerCase()) { - case "l": delta = wLabel.width / 2; break; - case "r": delta = -wLabel.width / 2; break; - } - } - if (delta) { - sum += reverseSep ? delta : -delta; - } - delta = 0; - - return sum; - }; -} - -function width(g, v) { - return g.node(v).width; -} - -},{"../graphlib":60,"../lodash":63,"../util":82}],77:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - util = require("../util"), - positionX = require("./bk").positionX; - -module.exports = position; - -function position(g) { - g = util.asNonCompoundGraph(g); - - positionY(g); - _.each(positionX(g), function(x, v) { - g.node(v).x = x; - }); -} - -function positionY(g) { - var layering = util.buildLayerMatrix(g), - rankSep = g.graph().ranksep, - prevY = 0; - _.each(layering, function(layer) { - var maxHeight = _.max(_.map(layer, function(v) { return g.node(v).height; })); - _.each(layer, function(v) { - g.node(v).y = prevY + maxHeight / 2; - }); - prevY += maxHeight + rankSep; - }); -} - - -},{"../lodash":63,"../util":82,"./bk":76}],78:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - Graph = require("../graphlib").Graph, - slack = require("./util").slack; - -module.exports = feasibleTree; - -/* - * Constructs a spanning tree with tight edges and adjusted the input node's - * ranks to achieve this. A tight edge is one that is has a length that matches - * its "minlen" attribute. - * - * The basic structure for this function is derived from Gansner, et al., "A - * Technique for Drawing Directed Graphs." - * - * Pre-conditions: - * - * 1. Graph must be a DAG. - * 2. Graph must be connected. - * 3. Graph must have at least one node. - * 5. Graph nodes must have been previously assigned a "rank" property that - * respects the "minlen" property of incident edges. - * 6. Graph edges must have a "minlen" property. - * - * Post-conditions: - * - * - Graph nodes will have their rank adjusted to ensure that all edges are - * tight. - * - * Returns a tree (undirected graph) that is constructed using only "tight" - * edges. - */ -function feasibleTree(g) { - var t = new Graph({ directed: false }); - - // Choose arbitrary node from which to start our tree - var start = g.nodes()[0], - size = g.nodeCount(); - t.setNode(start, {}); - - var edge, delta; - while (tightTree(t, g) < size) { - edge = findMinSlackEdge(t, g); - delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge); - shiftRanks(t, g, delta); - } - - return t; -} - -/* - * Finds a maximal tree of tight edges and returns the number of nodes in the - * tree. - */ -function tightTree(t, g) { - function dfs(v) { - _.each(g.nodeEdges(v), function(e) { - var edgeV = e.v, - w = (v === edgeV) ? e.w : edgeV; - if (!t.hasNode(w) && !slack(g, e)) { - t.setNode(w, {}); - t.setEdge(v, w, {}); - dfs(w); - } - }); - } - - _.each(t.nodes(), dfs); - return t.nodeCount(); -} - -/* - * Finds the edge with the smallest slack that is incident on tree and returns - * it. - */ -function findMinSlackEdge(t, g) { - return _.min(g.edges(), function(e) { - if (t.hasNode(e.v) !== t.hasNode(e.w)) { - return slack(g, e); - } - }); -} - -function shiftRanks(t, g, delta) { - _.each(t.nodes(), function(v) { - g.node(v).rank += delta; - }); -} - -},{"../graphlib":60,"../lodash":63,"./util":81}],79:[function(require,module,exports){ -"use strict"; - -var rankUtil = require("./util"), - longestPath = rankUtil.longestPath, - feasibleTree = require("./feasible-tree"), - networkSimplex = require("./network-simplex"); - -module.exports = rank; - -/* - * Assigns a rank to each node in the input graph that respects the "minlen" - * constraint specified on edges between nodes. - * - * This basic structure is derived from Gansner, et al., "A Technique for - * Drawing Directed Graphs." - * - * Pre-conditions: - * - * 1. Graph must be a connected DAG - * 2. Graph nodes must be objects - * 3. Graph edges must have "weight" and "minlen" attributes - * - * Post-conditions: - * - * 1. Graph nodes will have a "rank" attribute based on the results of the - * algorithm. Ranks can start at any index (including negative), we'll - * fix them up later. - */ -function rank(g) { - switch(g.graph().ranker) { - case "network-simplex": networkSimplexRanker(g); break; - case "tight-tree": tightTreeRanker(g); break; - case "longest-path": longestPathRanker(g); break; - default: networkSimplexRanker(g); - } -} - -// A fast and simple ranker, but results are far from optimal. -var longestPathRanker = longestPath; - -function tightTreeRanker(g) { - longestPath(g); - feasibleTree(g); -} - -function networkSimplexRanker(g) { - networkSimplex(g); -} - -},{"./feasible-tree":78,"./network-simplex":80,"./util":81}],80:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - feasibleTree = require("./feasible-tree"), - slack = require("./util").slack, - initRank = require("./util").longestPath, - preorder = require("../graphlib").alg.preorder, - postorder = require("../graphlib").alg.postorder, - simplify = require("../util").simplify; - -module.exports = networkSimplex; - -// Expose some internals for testing purposes -networkSimplex.initLowLimValues = initLowLimValues; -networkSimplex.initCutValues = initCutValues; -networkSimplex.calcCutValue = calcCutValue; -networkSimplex.leaveEdge = leaveEdge; -networkSimplex.enterEdge = enterEdge; -networkSimplex.exchangeEdges = exchangeEdges; - -/* - * The network simplex algorithm assigns ranks to each node in the input graph - * and iteratively improves the ranking to reduce the length of edges. - * - * Preconditions: - * - * 1. The input graph must be a DAG. - * 2. All nodes in the graph must have an object value. - * 3. All edges in the graph must have "minlen" and "weight" attributes. - * - * Postconditions: - * - * 1. All nodes in the graph will have an assigned "rank" attribute that has - * been optimized by the network simplex algorithm. Ranks start at 0. - * - * - * A rough sketch of the algorithm is as follows: - * - * 1. Assign initial ranks to each node. We use the longest path algorithm, - * which assigns ranks to the lowest position possible. In general this - * leads to very wide bottom ranks and unnecessarily long edges. - * 2. Construct a feasible tight tree. A tight tree is one such that all - * edges in the tree have no slack (difference between length of edge - * and minlen for the edge). This by itself greatly improves the assigned - * rankings by shorting edges. - * 3. Iteratively find edges that have negative cut values. Generally a - * negative cut value indicates that the edge could be removed and a new - * tree edge could be added to produce a more compact graph. - * - * Much of the algorithms here are derived from Gansner, et al., "A Technique - * for Drawing Directed Graphs." The structure of the file roughly follows the - * structure of the overall algorithm. - */ -function networkSimplex(g) { - g = simplify(g); - initRank(g); - var t = feasibleTree(g); - initLowLimValues(t); - initCutValues(t, g); - - var e, f; - while ((e = leaveEdge(t))) { - f = enterEdge(t, g, e); - exchangeEdges(t, g, e, f); - } -} - -/* - * Initializes cut values for all edges in the tree. - */ -function initCutValues(t, g) { - var vs = postorder(t, t.nodes()); - vs = vs.slice(0, vs.length - 1); - _.each(vs, function(v) { - assignCutValue(t, g, v); - }); -} - -function assignCutValue(t, g, child) { - var childLab = t.node(child), - parent = childLab.parent; - t.edge(child, parent).cutvalue = calcCutValue(t, g, child); -} - -/* - * Given the tight tree, its graph, and a child in the graph calculate and - * return the cut value for the edge between the child and its parent. - */ -function calcCutValue(t, g, child) { - var childLab = t.node(child), - parent = childLab.parent, - // True if the child is on the tail end of the edge in the directed graph - childIsTail = true, - // The graph's view of the tree edge we're inspecting - graphEdge = g.edge(child, parent), - // The accumulated cut value for the edge between this node and its parent - cutValue = 0; - - if (!graphEdge) { - childIsTail = false; - graphEdge = g.edge(parent, child); - } - - cutValue = graphEdge.weight; - - _.each(g.nodeEdges(child), function(e) { - var isOutEdge = e.v === child, - other = isOutEdge ? e.w : e.v; - - if (other !== parent) { - var pointsToHead = isOutEdge === childIsTail, - otherWeight = g.edge(e).weight; - - cutValue += pointsToHead ? otherWeight : -otherWeight; - if (isTreeEdge(t, child, other)) { - var otherCutValue = t.edge(child, other).cutvalue; - cutValue += pointsToHead ? -otherCutValue : otherCutValue; - } - } - }); - - return cutValue; -} - -function initLowLimValues(tree, root) { - if (arguments.length < 2) { - root = tree.nodes()[0]; - } - dfsAssignLowLim(tree, {}, 1, root); -} - -function dfsAssignLowLim(tree, visited, nextLim, v, parent) { - var low = nextLim, - label = tree.node(v); - - visited[v] = true; - _.each(tree.neighbors(v), function(w) { - if (!_.has(visited, w)) { - nextLim = dfsAssignLowLim(tree, visited, nextLim, w, v); - } - }); - - label.low = low; - label.lim = nextLim++; - if (parent) { - label.parent = parent; - } else { - // TODO should be able to remove this when we incrementally update low lim - delete label.parent; - } - - return nextLim; -} - -function leaveEdge(tree) { - return _.find(tree.edges(), function(e) { - return tree.edge(e).cutvalue < 0; - }); -} - -function enterEdge(t, g, edge) { - var v = edge.v, - w = edge.w; - - // For the rest of this function we assume that v is the tail and w is the - // head, so if we don't have this edge in the graph we should flip it to - // match the correct orientation. - if (!g.hasEdge(v, w)) { - v = edge.w; - w = edge.v; - } - - var vLabel = t.node(v), - wLabel = t.node(w), - tailLabel = vLabel, - flip = false; - - // If the root is in the tail of the edge then we need to flip the logic that - // checks for the head and tail nodes in the candidates function below. - if (vLabel.lim > wLabel.lim) { - tailLabel = wLabel; - flip = true; - } - - var candidates = _.filter(g.edges(), function(edge) { - return flip === isDescendant(t, t.node(edge.v), tailLabel) && - flip !== isDescendant(t, t.node(edge.w), tailLabel); - }); - - return _.min(candidates, function(edge) { return slack(g, edge); }); -} - -function exchangeEdges(t, g, e, f) { - var v = e.v, - w = e.w; - t.removeEdge(v, w); - t.setEdge(f.v, f.w, {}); - initLowLimValues(t); - initCutValues(t, g); - updateRanks(t, g); -} - -function updateRanks(t, g) { - var root = _.find(t.nodes(), function(v) { return !g.node(v).parent; }), - vs = preorder(t, root); - vs = vs.slice(1); - _.each(vs, function(v) { - var parent = t.node(v).parent, - edge = g.edge(v, parent), - flipped = false; - - if (!edge) { - edge = g.edge(parent, v); - flipped = true; - } - - g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen); - }); -} - -/* - * Returns true if the edge is in the tree. - */ -function isTreeEdge(tree, u, v) { - return tree.hasEdge(u, v); -} - -/* - * Returns true if the specified node is descendant of the root node per the - * assigned low and lim attributes in the tree. - */ -function isDescendant(tree, vLabel, rootLabel) { - return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim; -} - -},{"../graphlib":60,"../lodash":63,"../util":82,"./feasible-tree":78,"./util":81}],81:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"); - -module.exports = { - longestPath: longestPath, - slack: slack -}; - -/* - * Initializes ranks for the input graph using the longest path algorithm. This - * algorithm scales well and is fast in practice, it yields rather poor - * solutions. Nodes are pushed to the lowest layer possible, leaving the bottom - * ranks wide and leaving edges longer than necessary. However, due to its - * speed, this algorithm is good for getting an initial ranking that can be fed - * into other algorithms. - * - * This algorithm does not normalize layers because it will be used by other - * algorithms in most cases. If using this algorithm directly, be sure to - * run normalize at the end. - * - * Pre-conditions: - * - * 1. Input graph is a DAG. - * 2. Input graph node labels can be assigned properties. - * - * Post-conditions: - * - * 1. Each node will be assign an (unnormalized) "rank" property. - */ -function longestPath(g) { - var visited = {}; - - function dfs(v) { - var label = g.node(v); - if (_.has(visited, v)) { - return label.rank; - } - visited[v] = true; - - var rank = _.min(_.map(g.outEdges(v), function(e) { - return dfs(e.w) - g.edge(e).minlen; - })); - - if (rank === Number.POSITIVE_INFINITY) { - rank = 0; - } - - return (label.rank = rank); - } - - _.each(g.sources(), dfs); -} - -/* - * Returns the amount of slack for the given edge. The slack is defined as the - * difference between the length of the edge and its minimum length. - */ -function slack(g, e) { - return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen; -} - -},{"../lodash":63}],82:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"), - Graph = require("./graphlib").Graph; - -module.exports = { - addDummyNode: addDummyNode, - simplify: simplify, - asNonCompoundGraph: asNonCompoundGraph, - successorWeights: successorWeights, - predecessorWeights: predecessorWeights, - intersectRect: intersectRect, - buildLayerMatrix: buildLayerMatrix, - normalizeRanks: normalizeRanks, - removeEmptyRanks: removeEmptyRanks, - addBorderNode: addBorderNode, - maxRank: maxRank, - partition: partition, - time: time, - notime: notime -}; - -/* - * Adds a dummy node to the graph and return v. - */ -function addDummyNode(g, type, attrs, name) { - var v; - do { - v = _.uniqueId(name); - } while (g.hasNode(v)); - - attrs.dummy = type; - g.setNode(v, attrs); - return v; -} - -/* - * Returns a new graph with only simple edges. Handles aggregation of data - * associated with multi-edges. - */ -function simplify(g) { - var simplified = new Graph().setGraph(g.graph()); - _.each(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); }); - _.each(g.edges(), function(e) { - var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 }, - label = g.edge(e); - simplified.setEdge(e.v, e.w, { - weight: simpleLabel.weight + label.weight, - minlen: Math.max(simpleLabel.minlen, label.minlen) - }); - }); - return simplified; -} - -function asNonCompoundGraph(g) { - var simplified = new Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph()); - _.each(g.nodes(), function(v) { - if (!g.children(v).length) { - simplified.setNode(v, g.node(v)); - } - }); - _.each(g.edges(), function(e) { - simplified.setEdge(e, g.edge(e)); - }); - return simplified; -} - -function successorWeights(g) { - var weightMap = _.map(g.nodes(), function(v) { - var sucs = {}; - _.each(g.outEdges(v), function(e) { - sucs[e.w] = (sucs[e.w] || 0) + g.edge(e).weight; - }); - return sucs; - }); - return _.zipObject(g.nodes(), weightMap); -} - -function predecessorWeights(g) { - var weightMap = _.map(g.nodes(), function(v) { - var preds = {}; - _.each(g.inEdges(v), function(e) { - preds[e.v] = (preds[e.v] || 0) + g.edge(e).weight; - }); - return preds; - }); - return _.zipObject(g.nodes(), weightMap); -} - -/* - * Finds where a line starting at point ({x, y}) would intersect a rectangle - * ({x, y, width, height}) if it were pointing at the rectangle's center. - */ -function intersectRect(rect, point) { - var x = rect.x; - var y = rect.y; - - // Rectangle intersection algorithm from: - // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes - var dx = point.x - x; - var dy = point.y - y; - var w = rect.width / 2; - var h = rect.height / 2; - - if (!dx && !dy) { - throw new Error("Not possible to find intersection inside of the rectangle"); - } - - var sx, sy; - if (Math.abs(dy) * w > Math.abs(dx) * h) { - // Intersection is top or bottom of rect. - if (dy < 0) { - h = -h; - } - sx = h * dx / dy; - sy = h; - } else { - // Intersection is left or right of rect. - if (dx < 0) { - w = -w; - } - sx = w; - sy = w * dy / dx; - } - - return { x: x + sx, y: y + sy }; -} - -/* - * Given a DAG with each node assigned "rank" and "order" properties, this - * function will produce a matrix with the ids of each node. - */ -function buildLayerMatrix(g) { - var layering = _.map(_.range(maxRank(g) + 1), function() { return []; }); - _.each(g.nodes(), function(v) { - var node = g.node(v), - rank = node.rank; - if (!_.isUndefined(rank)) { - layering[rank][node.order] = v; - } - }); - return layering; -} - -/* - * Adjusts the ranks for all nodes in the graph such that all nodes v have - * rank(v) >= 0 and at least one node w has rank(w) = 0. - */ -function normalizeRanks(g) { - var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); - _.each(g.nodes(), function(v) { - var node = g.node(v); - if (_.has(node, "rank")) { - node.rank -= min; - } - }); -} - -function removeEmptyRanks(g) { - // Ranks may not start at 0, so we need to offset them - var offset = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); - - var layers = []; - _.each(g.nodes(), function(v) { - var rank = g.node(v).rank - offset; - if (!layers[rank]) { - layers[rank] = []; - } - layers[rank].push(v); - }); - - var delta = 0, - nodeRankFactor = g.graph().nodeRankFactor; - _.each(layers, function(vs, i) { - if (_.isUndefined(vs) && i % nodeRankFactor !== 0) { - --delta; - } else if (delta) { - _.each(vs, function(v) { g.node(v).rank += delta; }); - } - }); -} - -function addBorderNode(g, prefix, rank, order) { - var node = { - width: 0, - height: 0 - }; - if (arguments.length >= 4) { - node.rank = rank; - node.order = order; - } - return addDummyNode(g, "border", node, prefix); -} - -function maxRank(g) { - return _.max(_.map(g.nodes(), function(v) { - var rank = g.node(v).rank; - if (!_.isUndefined(rank)) { - return rank; - } - })); -} - -/* - * Partition a collection into two groups: `lhs` and `rhs`. If the supplied - * function returns true for an entry it goes into `lhs`. Otherwise it goes - * into `rhs. - */ -function partition(collection, fn) { - var result = { lhs: [], rhs: [] }; - _.each(collection, function(value) { - if (fn(value)) { - result.lhs.push(value); - } else { - result.rhs.push(value); - } - }); - return result; -} - -/* - * Returns a new function that wraps `fn` with a timer. The wrapper logs the - * time it takes to execute the function. - */ -function time(name, fn) { - var start = _.now(); - try { - return fn(); - } finally { - console.log(name + " time: " + (_.now() - start) + "ms"); - } -} - -function notime(name, fn) { - return fn(); -} - -},{"./graphlib":60,"./lodash":63}],83:[function(require,module,exports){ -module.exports = "0.7.4"; - -},{}],84:[function(require,module,exports){ -module.exports=require(33) -},{"./lib":100,"./lib/alg":91,"./lib/json":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\index.js":33}],85:[function(require,module,exports){ -module.exports=require(34) -},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\components.js":34}],86:[function(require,module,exports){ -module.exports=require(35) -},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dfs.js":35}],87:[function(require,module,exports){ -module.exports=require(36) -},{"../lodash":102,"./dijkstra":88,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dijkstra-all.js":36}],88:[function(require,module,exports){ -module.exports=require(37) -},{"../data/priority-queue":98,"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dijkstra.js":37}],89:[function(require,module,exports){ -module.exports=require(38) -},{"../lodash":102,"./tarjan":96,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\find-cycles.js":38}],90:[function(require,module,exports){ -module.exports=require(39) -},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\floyd-warshall.js":39}],91:[function(require,module,exports){ -module.exports=require(40) -},{"./components":85,"./dijkstra":88,"./dijkstra-all":87,"./find-cycles":89,"./floyd-warshall":90,"./is-acyclic":92,"./postorder":93,"./preorder":94,"./prim":95,"./tarjan":96,"./topsort":97,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\index.js":40}],92:[function(require,module,exports){ -module.exports=require(41) -},{"./topsort":97,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\is-acyclic.js":41}],93:[function(require,module,exports){ -module.exports=require(42) -},{"./dfs":86,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\postorder.js":42}],94:[function(require,module,exports){ -module.exports=require(43) -},{"./dfs":86,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\preorder.js":43}],95:[function(require,module,exports){ -module.exports=require(44) -},{"../data/priority-queue":98,"../graph":99,"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\prim.js":44}],96:[function(require,module,exports){ -module.exports=require(45) -},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\tarjan.js":45}],97:[function(require,module,exports){ -module.exports=require(46) -},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\topsort.js":46}],98:[function(require,module,exports){ -module.exports=require(47) -},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\data\\priority-queue.js":47}],99:[function(require,module,exports){ -module.exports=require(48) -},{"./lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\graph.js":48}],100:[function(require,module,exports){ -module.exports=require(49) -},{"./graph":99,"./version":103,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\index.js":49}],101:[function(require,module,exports){ -module.exports=require(50) -},{"./graph":99,"./lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\json.js":50}],102:[function(require,module,exports){ -module.exports=require(51) -},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\lodash.js":51,"lodash":104}],103:[function(require,module,exports){ -module.exports=require(52) -},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\version.js":52}],104:[function(require,module,exports){ -module.exports=require(53) -},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\lodash\\index.js":53}],105:[function(require,module,exports){ +},{}],82:[function(require,module,exports){ //! moment.js -//! version : 2.10.6 +//! version : 2.12.0 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com -(function (global, factory) { +;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory() @@ -27512,7 +27154,7 @@ module.exports=require(53) } function isArray(input) { - return Object.prototype.toString.call(input) === '[object Array]'; + return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; } function isDate(input) { @@ -27610,39 +27252,45 @@ module.exports=require(53) return m; } + function isUndefined(input) { + return input === void 0; + } + + // Plugins that add properties should also add the key here (null value), + // so we can properly clone ourselves. var momentProperties = utils_hooks__hooks.momentProperties = []; function copyConfig(to, from) { var i, prop, val; - if (typeof from._isAMomentObject !== 'undefined') { + if (!isUndefined(from._isAMomentObject)) { to._isAMomentObject = from._isAMomentObject; } - if (typeof from._i !== 'undefined') { + if (!isUndefined(from._i)) { to._i = from._i; } - if (typeof from._f !== 'undefined') { + if (!isUndefined(from._f)) { to._f = from._f; } - if (typeof from._l !== 'undefined') { + if (!isUndefined(from._l)) { to._l = from._l; } - if (typeof from._strict !== 'undefined') { + if (!isUndefined(from._strict)) { to._strict = from._strict; } - if (typeof from._tzm !== 'undefined') { + if (!isUndefined(from._tzm)) { to._tzm = from._tzm; } - if (typeof from._isUTC !== 'undefined') { + if (!isUndefined(from._isUTC)) { to._isUTC = from._isUTC; } - if (typeof from._offset !== 'undefined') { + if (!isUndefined(from._offset)) { to._offset = from._offset; } - if (typeof from._pf !== 'undefined') { + if (!isUndefined(from._pf)) { to._pf = getParsingFlags(from); } - if (typeof from._locale !== 'undefined') { + if (!isUndefined(from._locale)) { to._locale = from._locale; } @@ -27650,7 +27298,7 @@ module.exports=require(53) for (i in momentProperties) { prop = momentProperties[i]; val = from[prop]; - if (typeof val !== 'undefined') { + if (!isUndefined(val)) { to[prop] = val; } } @@ -27697,6 +27345,7 @@ module.exports=require(53) return value; } + // compare two arrays, return the number of differences function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), @@ -27711,9 +27360,85 @@ module.exports=require(53) return diffs + lengthDiff; } - function Locale() { + function warn(msg) { + if (utils_hooks__hooks.suppressDeprecationWarnings === false && + (typeof console !== 'undefined') && console.warn) { + console.warn('Deprecation warning: ' + msg); + } } + function deprecate(msg, fn) { + var firstTime = true; + + return extend(function () { + if (firstTime) { + warn(msg + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\n' + (new Error()).stack); + firstTime = false; + } + return fn.apply(this, arguments); + }, fn); + } + + var deprecations = {}; + + function deprecateSimple(name, msg) { + if (!deprecations[name]) { + warn(msg); + deprecations[name] = true; + } + } + + utils_hooks__hooks.suppressDeprecationWarnings = false; + + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + + function isObject(input) { + return Object.prototype.toString.call(input) === '[object Object]'; + } + + function locale_set__set (config) { + var prop, i; + for (i in config) { + prop = config[i]; + if (isFunction(prop)) { + this[i] = prop; + } else { + this['_' + i] = prop; + } + } + this._config = config; + // Lenient ordinal parsing accepts just a number in addition to + // number + (possibly) stuff coming from _ordinalParseLenient. + this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source); + } + + function mergeConfigs(parentConfig, childConfig) { + var res = extend({}, parentConfig), prop; + for (prop in childConfig) { + if (hasOwnProp(childConfig, prop)) { + if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { + res[prop] = {}; + extend(res[prop], parentConfig[prop]); + extend(res[prop], childConfig[prop]); + } else if (childConfig[prop] != null) { + res[prop] = childConfig[prop]; + } else { + delete res[prop]; + } + } + } + return res; + } + + function Locale(config) { + if (config != null) { + this.set(config); + } + } + + // internal storage for locale config files var locales = {}; var globalLocale; @@ -27751,7 +27476,7 @@ module.exports=require(53) function loadLocale(name) { var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node - if (!locales[name] && typeof module !== 'undefined' && + if (!locales[name] && (typeof module !== 'undefined') && module && module.exports) { try { oldLocale = globalLocale._abbr; @@ -27770,7 +27495,7 @@ module.exports=require(53) function locale_locales__getSetGlobalLocale (key, values) { var data; if (key) { - if (typeof values === 'undefined') { + if (isUndefined(values)) { data = locale_locales__getLocale(key); } else { @@ -27786,11 +27511,25 @@ module.exports=require(53) return globalLocale._abbr; } - function defineLocale (name, values) { - if (values !== null) { - values.abbr = name; - locales[name] = locales[name] || new Locale(); - locales[name].set(values); + function defineLocale (name, config) { + if (config !== null) { + config.abbr = name; + if (locales[name] != null) { + deprecateSimple('defineLocaleOverride', + 'use moment.updateLocale(localeName, config) to change ' + + 'an existing locale. moment.defineLocale(localeName, ' + + 'config) should only be used for creating a new locale'); + config = mergeConfigs(locales[name]._config, config); + } else if (config.parentLocale != null) { + if (locales[config.parentLocale] != null) { + config = mergeConfigs(locales[config.parentLocale]._config, config); + } else { + // treat as if there is no base config + deprecateSimple('parentLocaleUndefined', + 'specified parentLocale is not defined yet'); + } + } + locales[name] = new Locale(config); // backwards compat for now: also set the locale locale_locales__getSetGlobalLocale(name); @@ -27803,6 +27542,31 @@ module.exports=require(53) } } + function updateLocale(name, config) { + if (config != null) { + var locale; + if (locales[name] != null) { + config = mergeConfigs(locales[name]._config, config); + } + locale = new Locale(config); + locale.parentLocale = locales[name]; + locales[name] = locale; + + // backwards compat for now: also set the locale + locale_locales__getSetGlobalLocale(name); + } else { + // pass null for config to unupdate, useful for tests + if (locales[name] != null) { + if (locales[name].parentLocale != null) { + locales[name] = locales[name].parentLocale; + } else if (locales[name] != null) { + delete locales[name]; + } + } + } + return locales[name]; + } + // returns locale data function locale_locales__getLocale (key) { var locale; @@ -27827,6 +27591,10 @@ module.exports=require(53) return chooseLocale(key); } + function locale_locales__listLocales() { + return Object.keys(locales); + } + var aliases = {}; function addUnitAlias (unit, shorthand) { @@ -27868,11 +27636,14 @@ module.exports=require(53) } function get_set__get (mom, unit) { - return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit](); + return mom.isValid() ? + mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; } function get_set__set (mom, unit, value) { - return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + if (mom.isValid()) { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + } } // MOMENTS @@ -27885,7 +27656,7 @@ module.exports=require(53) } } else { units = normalizeUnits(units); - if (typeof this[units] === 'function') { + if (isFunction(this[units])) { return this[units](value); } } @@ -27900,7 +27671,7 @@ module.exports=require(53) Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; } - var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; + var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; @@ -27996,6 +27767,8 @@ module.exports=require(53) var match4 = /\d{4}/; // 0000 - 9999 var match6 = /[+-]?\d{6}/; // -999999 - 999999 var match1to2 = /\d\d?/; // 0 - 99 + var match3to4 = /\d\d\d\d?/; // 999 - 9999 + var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 var match1to3 = /\d{1,3}/; // 0 - 999 var match1to4 = /\d{1,4}/; // 0 - 9999 var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 @@ -28004,23 +27777,19 @@ module.exports=require(53) var matchSigned = /[+-]?\d+/; // -inf - inf var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z + var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. + // includes scottish gaelic two word and hyphenated months var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; + var regexes = {}; - function isFunction (sth) { - // https://github.com/moment/moment/issues/2325 - return typeof sth === 'function' && - Object.prototype.toString.call(sth) === '[object Function]'; - } - - function addRegexToken (token, regex, strictRegex) { - regexes[token] = isFunction(regex) ? regex : function (isStrict) { + regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { return (isStrict && strictRegex) ? strictRegex : regex; }; } @@ -28035,9 +27804,13 @@ module.exports=require(53) // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function unescapeFormat(s) { - return s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { + return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; - }).replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + })); + } + + function regexEscape(s) { + return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } var tokens = {}; @@ -28077,6 +27850,8 @@ module.exports=require(53) var MINUTE = 4; var SECOND = 5; var MILLISECOND = 6; + var WEEK = 7; + var WEEKDAY = 8; function daysInMonth(year, month) { return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); @@ -28104,8 +27879,12 @@ module.exports=require(53) addRegexToken('M', match1to2); addRegexToken('MM', match1to2, match2); - addRegexToken('MMM', matchWord); - addRegexToken('MMMM', matchWord); + addRegexToken('MMM', function (isStrict, locale) { + return locale.monthsShortRegex(isStrict); + }); + addRegexToken('MMMM', function (isStrict, locale) { + return locale.monthsRegex(isStrict); + }); addParseToken(['M', 'MM'], function (input, array) { array[MONTH] = toInt(input) - 1; @@ -28123,14 +27902,17 @@ module.exports=require(53) // LOCALES + var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/; var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); - function localeMonths (m) { - return this._months[m.month()]; + function localeMonths (m, format) { + return isArray(this._months) ? this._months[m.month()] : + this._months[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); - function localeMonthsShort (m) { - return this._monthsShort[m.month()]; + function localeMonthsShort (m, format) { + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : + this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } function localeMonthsParse (monthName, format, strict) { @@ -28169,12 +27951,20 @@ module.exports=require(53) function setMonth (mom, value) { var dayOfMonth; - // TODO: Move this out of here! + if (!mom.isValid()) { + // No op + return mom; + } + if (typeof value === 'string') { - value = mom.localeData().monthsParse(value); - // TODO: Another silent failure? - if (typeof value !== 'number') { - return mom; + if (/^\d+$/.test(value)) { + value = toInt(value); + } else { + value = mom.localeData().monthsParse(value); + // TODO: Another silent failure? + if (typeof value !== 'number') { + return mom; + } } } @@ -28197,6 +27987,72 @@ module.exports=require(53) return daysInMonth(this.year(), this.month()); } + var defaultMonthsShortRegex = matchWord; + function monthsShortRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsShortStrictRegex; + } else { + return this._monthsShortRegex; + } + } else { + return this._monthsShortStrictRegex && isStrict ? + this._monthsShortStrictRegex : this._monthsShortRegex; + } + } + + var defaultMonthsRegex = matchWord; + function monthsRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsStrictRegex; + } else { + return this._monthsRegex; + } + } else { + return this._monthsStrictRegex && isStrict ? + this._monthsStrictRegex : this._monthsRegex; + } + } + + function computeMonthsParse () { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var shortPieces = [], longPieces = [], mixedPieces = [], + i, mom; + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + mom = create_utc__createUTC([2000, i]); + shortPieces.push(this.monthsShort(mom, '')); + longPieces.push(this.months(mom, '')); + mixedPieces.push(this.months(mom, '')); + mixedPieces.push(this.monthsShort(mom, '')); + } + // Sorting makes sure if one month (or abbr) is a prefix of another it + // will match the longer piece. + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + for (i = 0; i < 12; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + + this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._monthsShortRegex = this._monthsRegex; + this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')$', 'i'); + this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')$', 'i'); + } + function checkOverflow (m) { var overflow; var a = m._a; @@ -28214,6 +28070,12 @@ module.exports=require(53) if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { overflow = DATE; } + if (getParsingFlags(m)._overflowWeeks && overflow === -1) { + overflow = WEEK; + } + if (getParsingFlags(m)._overflowWeekday && overflow === -1) { + overflow = WEEKDAY; + } getParsingFlags(m).overflow = overflow; } @@ -28221,51 +28083,39 @@ module.exports=require(53) return m; } - function warn(msg) { - if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { - console.warn('Deprecation warning: ' + msg); - } - } + // iso 8601 regex + // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) + var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; + var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; - function deprecate(msg, fn) { - var firstTime = true; - - return extend(function () { - if (firstTime) { - warn(msg + '\n' + (new Error()).stack); - firstTime = false; - } - return fn.apply(this, arguments); - }, fn); - } - - var deprecations = {}; - - function deprecateSimple(name, msg) { - if (!deprecations[name]) { - warn(msg); - deprecations[name] = true; - } - } - - utils_hooks__hooks.suppressDeprecationWarnings = false; - - var from_string__isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; + var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; var isoDates = [ - ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], - ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], - ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], - ['GGGG-[W]WW', /\d{4}-W\d{2}/], - ['YYYY-DDD', /\d{4}-\d{3}/] + ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], + ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], + ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], + ['GGGG-[W]WW', /\d{4}-W\d\d/, false], + ['YYYY-DDD', /\d{4}-\d{3}/], + ['YYYY-MM', /\d{4}-\d\d/, false], + ['YYYYYYMMDD', /[+-]\d{10}/], + ['YYYYMMDD', /\d{8}/], + // YYYYMM is NOT allowed by the standard + ['GGGG[W]WWE', /\d{4}W\d{3}/], + ['GGGG[W]WW', /\d{4}W\d{2}/, false], + ['YYYYDDD', /\d{7}/] ]; // iso time formats and regexes var isoTimes = [ - ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], - ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], - ['HH:mm', /(T| )\d\d:\d\d/], - ['HH', /(T| )\d\d/] + ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], + ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], + ['HH:mm:ss', /\d\d:\d\d:\d\d/], + ['HH:mm', /\d\d:\d\d/], + ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], + ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], + ['HHmmss', /\d\d\d\d\d\d/], + ['HHmm', /\d\d\d\d/], + ['HH', /\d\d/] ]; var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; @@ -28274,26 +28124,49 @@ module.exports=require(53) function configFromISO(config) { var i, l, string = config._i, - match = from_string__isoRegex.exec(string); + match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), + allowTime, dateFormat, timeFormat, tzFormat; if (match) { getParsingFlags(config).iso = true; + for (i = 0, l = isoDates.length; i < l; i++) { - if (isoDates[i][1].exec(string)) { - config._f = isoDates[i][0]; + if (isoDates[i][1].exec(match[1])) { + dateFormat = isoDates[i][0]; + allowTime = isoDates[i][2] !== false; break; } } - for (i = 0, l = isoTimes.length; i < l; i++) { - if (isoTimes[i][1].exec(string)) { - // match[6] should be 'T' or space - config._f += (match[6] || ' ') + isoTimes[i][0]; - break; + if (dateFormat == null) { + config._isValid = false; + return; + } + if (match[3]) { + for (i = 0, l = isoTimes.length; i < l; i++) { + if (isoTimes[i][1].exec(match[3])) { + // match[2] should be 'T' or space + timeFormat = (match[2] || ' ') + isoTimes[i][0]; + break; + } + } + if (timeFormat == null) { + config._isValid = false; + return; } } - if (string.match(matchOffset)) { - config._f += 'Z'; + if (!allowTime && timeFormat != null) { + config._isValid = false; + return; } + if (match[4]) { + if (tzRegex.exec(match[4])) { + tzFormat = 'Z'; + } else { + config._isValid = false; + return; + } + } + config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; @@ -28331,8 +28204,8 @@ module.exports=require(53) //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply var date = new Date(y, m, d, h, M, s, ms); - //the date constructor doesn't accept years < 1970 - if (y < 1970) { + //the date constructor remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { date.setFullYear(y); } return date; @@ -28340,12 +28213,21 @@ module.exports=require(53) function createUTCDate (y) { var date = new Date(Date.UTC.apply(null, arguments)); - if (y < 1970) { + + //the Date.UTC function remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } return date; } + // FORMATTING + + addFormatToken('Y', 0, 0, function () { + var y = this.year(); + return y <= 9999 ? '' + y : '+' + y; + }); + addFormatToken(0, ['YY', 2], 0, function () { return this.year() % 100; }); @@ -28373,6 +28255,9 @@ module.exports=require(53) addParseToken('YY', function (input, array) { array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input); }); + addParseToken('Y', function (input, array) { + array[YEAR] = parseInt(input, 10); + }); // HELPERS @@ -28398,124 +28283,66 @@ module.exports=require(53) return isLeapYear(this.year()); } - addFormatToken('w', ['ww', 2], 'wo', 'week'); - addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + // start-of-first-week - start-of-year + function firstWeekOffset(year, dow, doy) { + var // first-week day -- which january is always in the first week (4 for iso, 1 for other) + fwd = 7 + dow - doy, + // first-week day local weekday -- which local weekday is fwd + fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; - // ALIASES - - addUnitAlias('week', 'w'); - addUnitAlias('isoWeek', 'W'); - - // PARSING - - addRegexToken('w', match1to2); - addRegexToken('ww', match1to2, match2); - addRegexToken('W', match1to2); - addRegexToken('WW', match1to2, match2); - - addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { - week[token.substr(0, 1)] = toInt(input); - }); - - // HELPERS - - // firstDayOfWeek 0 = sun, 6 = sat - // the day of the week that starts the week - // (usually sunday or monday) - // firstDayOfWeekOfYear 0 = sun, 6 = sat - // the first week is the week that contains the first - // of this day of the week - // (eg. ISO weeks use thursday (4)) - function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { - var end = firstDayOfWeekOfYear - firstDayOfWeek, - daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), - adjustedMoment; - - - if (daysToDayOfWeek > end) { - daysToDayOfWeek -= 7; - } - - if (daysToDayOfWeek < end - 7) { - daysToDayOfWeek += 7; - } - - adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd'); - return { - week: Math.ceil(adjustedMoment.dayOfYear() / 7), - year: adjustedMoment.year() - }; + return -fwdlw + fwd - 1; } - // LOCALES - - function localeWeek (mom) { - return weekOfYear(mom, this._week.dow, this._week.doy).week; - } - - var defaultLocaleWeek = { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - }; - - function localeFirstDayOfWeek () { - return this._week.dow; - } - - function localeFirstDayOfYear () { - return this._week.doy; - } - - // MOMENTS - - function getSetWeek (input) { - var week = this.localeData().week(this); - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - function getSetISOWeek (input) { - var week = weekOfYear(this, 1, 4).week; - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); - - // ALIASES - - addUnitAlias('dayOfYear', 'DDD'); - - // PARSING - - addRegexToken('DDD', match1to3); - addRegexToken('DDDD', match3); - addParseToken(['DDD', 'DDDD'], function (input, array, config) { - config._dayOfYear = toInt(input); - }); - - // HELPERS - //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { - var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear; - if (d < firstDayOfWeek) { - d += 7; + function dayOfYearFromWeeks(year, week, weekday, dow, doy) { + var localWeekday = (7 + weekday - dow) % 7, + weekOffset = firstWeekOffset(year, dow, doy), + dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, + resYear, resDayOfYear; + + if (dayOfYear <= 0) { + resYear = year - 1; + resDayOfYear = daysInYear(resYear) + dayOfYear; + } else if (dayOfYear > daysInYear(year)) { + resYear = year + 1; + resDayOfYear = dayOfYear - daysInYear(year); + } else { + resYear = year; + resDayOfYear = dayOfYear; } - weekday = weekday != null ? 1 * weekday : firstDayOfWeek; - - dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday; - return { - year: dayOfYear > 0 ? year : year - 1, - dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear + year: resYear, + dayOfYear: resDayOfYear }; } - // MOMENTS + function weekOfYear(mom, dow, doy) { + var weekOffset = firstWeekOffset(mom.year(), dow, doy), + week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, + resWeek, resYear; - function getSetDayOfYear (input) { - var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; - return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + if (week < 1) { + resYear = mom.year() - 1; + resWeek = week + weeksInYear(resYear, dow, doy); + } else if (week > weeksInYear(mom.year(), dow, doy)) { + resWeek = week - weeksInYear(mom.year(), dow, doy); + resYear = mom.year() + 1; + } else { + resYear = mom.year(); + resWeek = week; + } + + return { + week: resWeek, + year: resYear + }; + } + + function weeksInYear(year, dow, doy) { + var weekOffset = firstWeekOffset(year, dow, doy), + weekOffsetNext = firstWeekOffset(year + 1, dow, doy); + return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; } // Pick the first defined of two or three arguments. @@ -28530,11 +28357,12 @@ module.exports=require(53) } function currentDateArray(config) { - var now = new Date(); + // hooks is actually the exported moment object + var nowValue = new Date(utils_hooks__hooks.now()); if (config._useUTC) { - return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()]; + return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; } - return [now.getFullYear(), now.getMonth(), now.getDate()]; + return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; } // convert an array to a date. @@ -28604,7 +28432,7 @@ module.exports=require(53) } function dayOfYearFromWeekInfo(config) { - var w, weekYear, week, weekday, dow, doy, temp; + var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; w = config._w; if (w.GG != null || w.W != null || w.E != null) { @@ -28618,6 +28446,9 @@ module.exports=require(53) weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year); week = defaults(w.W, 1); weekday = defaults(w.E, 1); + if (weekday < 1 || weekday > 7) { + weekdayOverflow = true; + } } else { dow = config._locale._week.dow; doy = config._locale._week.doy; @@ -28628,23 +28459,32 @@ module.exports=require(53) if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; - if (weekday < dow) { - ++week; + if (weekday < 0 || weekday > 6) { + weekdayOverflow = true; } } else if (w.e != null) { // local weekday -- counting starts from begining of week weekday = w.e + dow; + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; + } } else { // default to begining of week weekday = dow; } } - temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow); - - config._a[YEAR] = temp.year; - config._dayOfYear = temp.dayOfYear; + if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { + getParsingFlags(config)._overflowWeeks = true; + } else if (weekdayOverflow != null) { + getParsingFlags(config)._overflowWeekday = true; + } else { + temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); + config._a[YEAR] = temp.year; + config._dayOfYear = temp.dayOfYear; + } } + // constant that refers to the ISO standard utils_hooks__hooks.ISO_8601 = function () {}; // date from string and format string @@ -28669,6 +28509,8 @@ module.exports=require(53) for (i = 0; i < tokens.length; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; + // console.log('token', token, 'parsedInput', parsedInput, + // 'regex', getParseRegexForToken(token, config)); if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { @@ -28737,6 +28579,7 @@ module.exports=require(53) } } + // date from string and array of format strings function configFromStringAndArray(config) { var tempConfig, bestMoment, @@ -28787,7 +28630,9 @@ module.exports=require(53) } var i = normalizeObjectUnits(config._i); - config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond]; + config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { + return obj && parseInt(obj, 10); + }); configFromArray(config); } @@ -28829,13 +28674,17 @@ module.exports=require(53) configFromInput(config); } + if (!valid__isValid(config)) { + config._d = null; + } + return config; } function configFromInput(config) { var input = config._i; if (input === undefined) { - config._d = new Date(); + config._d = new Date(utils_hooks__hooks.now()); } else if (isDate(input)) { config._d = new Date(+input); } else if (typeof input === 'string') { @@ -28879,18 +28728,26 @@ module.exports=require(53) } var prototypeMin = deprecate( - 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', + 'moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); - return other < this ? this : other; + if (this.isValid() && other.isValid()) { + return other < this ? this : other; + } else { + return valid__createInvalid(); + } } ); var prototypeMax = deprecate( - 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', + 'moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); - return other > this ? this : other; + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return valid__createInvalid(); + } } ); @@ -28929,6 +28786,10 @@ module.exports=require(53) return pickBy('isAfter', args); } + var now = function () { + return Date.now ? Date.now() : +(new Date()); + }; + function Duration (duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, @@ -28968,6 +28829,8 @@ module.exports=require(53) return obj instanceof Duration; } + // FORMATTING + function offset (token, separator) { addFormatToken(token, 0, 0, function () { var offset = this.utcOffset(); @@ -28985,11 +28848,11 @@ module.exports=require(53) // PARSING - addRegexToken('Z', matchOffset); - addRegexToken('ZZ', matchOffset); + addRegexToken('Z', matchShortOffset); + addRegexToken('ZZ', matchShortOffset); addParseToken(['Z', 'ZZ'], function (input, array, config) { config._useUTC = true; - config._tzm = offsetFromString(input); + config._tzm = offsetFromString(matchShortOffset, input); }); // HELPERS @@ -28999,8 +28862,8 @@ module.exports=require(53) // '-1530' > ['-15', '30'] var chunkOffset = /([\+\-]|\d\d)/gi; - function offsetFromString(string) { - var matches = ((string || '').match(matchOffset) || []); + function offsetFromString(matcher, string) { + var matches = ((string || '').match(matcher) || []); var chunk = matches[matches.length - 1] || []; var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; var minutes = +(parts[1] * 60) + toInt(parts[2]); @@ -29050,11 +28913,13 @@ module.exports=require(53) function getSetOffset (input, keepLocalTime) { var offset = this._offset || 0, localAdjust; + if (!this.isValid()) { + return input != null ? this : NaN; + } if (input != null) { if (typeof input === 'string') { - input = offsetFromString(input); - } - if (Math.abs(input) < 16) { + input = offsetFromString(matchShortOffset, input); + } else if (Math.abs(input) < 16) { input = input * 60; } if (!this._isUTC && keepLocalTime) { @@ -29114,12 +28979,15 @@ module.exports=require(53) if (this._tzm) { this.utcOffset(this._tzm); } else if (typeof this._i === 'string') { - this.utcOffset(offsetFromString(this._i)); + this.utcOffset(offsetFromString(matchOffset, this._i)); } return this; } function hasAlignedHourOffset (input) { + if (!this.isValid()) { + return false; + } input = input ? local__createLocal(input).utcOffset() : 0; return (this.utcOffset() - input) % 60 === 0; @@ -29133,7 +29001,7 @@ module.exports=require(53) } function isDaylightSavingTimeShifted () { - if (typeof this._isDSTShifted !== 'undefined') { + if (!isUndefined(this._isDSTShifted)) { return this._isDSTShifted; } @@ -29154,22 +29022,24 @@ module.exports=require(53) } function isLocal () { - return !this._isUTC; + return this.isValid() ? !this._isUTC : false; } function isUtcOffset () { - return this._isUTC; + return this.isValid() ? this._isUTC : false; } function isUtc () { - return this._isUTC && this._offset === 0; + return this.isValid() ? this._isUTC && this._offset === 0 : false; } - var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; + // ASP.NET json date format regex + var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/; // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere - var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; + // and further modified to allow for strings containing both week and day + var isoRegex = /^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/; function create__createDuration (input, key) { var duration = input, @@ -29202,16 +29072,16 @@ module.exports=require(53) s : toInt(match[SECOND]) * sign, ms : toInt(match[MILLISECOND]) * sign }; - } else if (!!(match = create__isoRegex.exec(input))) { + } else if (!!(match = isoRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; duration = { y : parseIso(match[2], sign), M : parseIso(match[3], sign), - d : parseIso(match[4], sign), - h : parseIso(match[5], sign), - m : parseIso(match[6], sign), - s : parseIso(match[7], sign), - w : parseIso(match[8], sign) + w : parseIso(match[4], sign), + d : parseIso(match[5], sign), + h : parseIso(match[6], sign), + m : parseIso(match[7], sign), + s : parseIso(match[8], sign) }; } else if (duration == null) {// checks for null or undefined duration = {}; @@ -29259,6 +29129,10 @@ module.exports=require(53) function momentsDifference(base, other) { var res; + if (!(base.isValid() && other.isValid())) { + return {milliseconds: 0, months: 0}; + } + other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); @@ -29271,6 +29145,15 @@ module.exports=require(53) return res; } + function absRound (number) { + if (number < 0) { + return Math.round(-1 * number) * -1; + } else { + return Math.round(number); + } + } + + // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { var dur, tmp; @@ -29289,8 +29172,14 @@ module.exports=require(53) function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, - days = duration._days, - months = duration._months; + days = absRound(duration._days), + months = absRound(duration._months); + + if (!mom.isValid()) { + // No op + return; + } + updateOffset = updateOffset == null ? true : updateOffset; if (milliseconds) { @@ -29322,7 +29211,10 @@ module.exports=require(53) diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; - return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now))); + + var output = formats && (isFunction(formats[format]) ? formats[format]() : formats[format]); + + return this.format(output || this.localeData().calendar(format, this, local__createLocal(now))); } function clone () { @@ -29330,26 +29222,28 @@ module.exports=require(53) } function isAfter (input, units) { - var inputMs; - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this > +input; + return +this > +localInput; } else { - inputMs = isMoment(input) ? +input : +local__createLocal(input); - return inputMs < +this.clone().startOf(units); + return +localInput < +this.clone().startOf(units); } } function isBefore (input, units) { - var inputMs; - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this < +input; + return +this < +localInput; } else { - inputMs = isMoment(input) ? +input : +local__createLocal(input); - return +this.clone().endOf(units) < inputMs; + return +this.clone().endOf(units) < +localInput; } } @@ -29358,22 +29252,45 @@ module.exports=require(53) } function isSame (input, units) { - var inputMs; + var localInput = isMoment(input) ? input : local__createLocal(input), + inputMs; + if (!(this.isValid() && localInput.isValid())) { + return false; + } units = normalizeUnits(units || 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this === +input; + return +this === +localInput; } else { - inputMs = +local__createLocal(input); + inputMs = +localInput; return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units)); } } + function isSameOrAfter (input, units) { + return this.isSame(input, units) || this.isAfter(input,units); + } + + function isSameOrBefore (input, units) { + return this.isSame(input, units) || this.isBefore(input,units); + } + function diff (input, units, asFloat) { - var that = cloneWithOffset(input, this), - zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4, + var that, + zoneDelta, delta, output; + if (!this.isValid()) { + return NaN; + } + + that = cloneWithOffset(input, this); + + if (!that.isValid()) { + return NaN; + } + + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + units = normalizeUnits(units); if (units === 'year' || units === 'month' || units === 'quarter') { @@ -29424,7 +29341,7 @@ module.exports=require(53) function moment_format__toISOString () { var m = this.clone().utc(); if (0 < m.year() && m.year() <= 9999) { - if ('function' === typeof Date.prototype.toISOString) { + if (isFunction(Date.prototype.toISOString)) { // native implementation is ~50x faster, use it when we can return this.toDate().toISOString(); } else { @@ -29441,10 +29358,13 @@ module.exports=require(53) } function from (time, withoutSuffix) { - if (!this.isValid()) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { return this.localeData().invalidDate(); } - return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); } function fromNow (withoutSuffix) { @@ -29452,16 +29372,22 @@ module.exports=require(53) } function to (time, withoutSuffix) { - if (!this.isValid()) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { return this.localeData().invalidDate(); } - return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); } function toNow (withoutSuffix) { return this.to(local__createLocal(), withoutSuffix); } + // If passed a locale key, it will set the locale for this + // instance. Otherwise, it will return the locale configuration + // variables for this instance. function locale (key) { var newLocaleData; @@ -29572,6 +29498,11 @@ module.exports=require(53) }; } + function toJSON () { + // new Date(NaN).toJSON() === null + return this.isValid() ? this.toISOString() : null; + } + function moment_valid__isValid () { return valid__isValid(this); } @@ -29584,6 +29515,18 @@ module.exports=require(53) return getParsingFlags(this).overflow; } + function creationData() { + return { + input: this._i, + format: this._f, + locale: this._locale, + isUTC: this._isUTC, + strict: this._strict + }; + } + + // FORMATTING + addFormatToken(0, ['gg', 2], 0, function () { return this.weekYear() % 100; }); @@ -29625,22 +29568,20 @@ module.exports=require(53) week[token] = utils_hooks__hooks.parseTwoDigitYear(input); }); - // HELPERS - - function weeksInYear(year, dow, doy) { - return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week; - } - // MOMENTS function getSetWeekYear (input) { - var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; - return input == null ? year : this.add((input - year), 'y'); + return getSetWeekYearHelper.call(this, + input, + this.week(), + this.weekday(), + this.localeData()._week.dow, + this.localeData()._week.doy); } function getSetISOWeekYear (input) { - var year = weekOfYear(this, 1, 4).year; - return input == null ? year : this.add((input - year), 'y'); + return getSetWeekYearHelper.call(this, + input, this.isoWeek(), this.isoWeekday(), 1, 4); } function getISOWeeksInYear () { @@ -29652,7 +29593,32 @@ module.exports=require(53) return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } - addFormatToken('Q', 0, 0, 'quarter'); + function getSetWeekYearHelper(input, week, weekday, dow, doy) { + var weeksTarget; + if (input == null) { + return weekOfYear(this, dow, doy).year; + } else { + weeksTarget = weeksInYear(input, dow, doy); + if (week > weeksTarget) { + week = weeksTarget; + } + return setWeekAll.call(this, input, week, weekday, dow, doy); + } + } + + function setWeekAll(weekYear, week, weekday, dow, doy) { + var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), + date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); + + this.year(date.getUTCFullYear()); + this.month(date.getUTCMonth()); + this.date(date.getUTCDate()); + return this; + } + + // FORMATTING + + addFormatToken('Q', 0, 'Qo', 'quarter'); // ALIASES @@ -29671,6 +29637,62 @@ module.exports=require(53) return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); } + // FORMATTING + + addFormatToken('w', ['ww', 2], 'wo', 'week'); + addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + + // ALIASES + + addUnitAlias('week', 'w'); + addUnitAlias('isoWeek', 'W'); + + // PARSING + + addRegexToken('w', match1to2); + addRegexToken('ww', match1to2, match2); + addRegexToken('W', match1to2); + addRegexToken('WW', match1to2, match2); + + addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { + week[token.substr(0, 1)] = toInt(input); + }); + + // HELPERS + + // LOCALES + + function localeWeek (mom) { + return weekOfYear(mom, this._week.dow, this._week.doy).week; + } + + var defaultLocaleWeek = { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. + }; + + function localeFirstDayOfWeek () { + return this._week.dow; + } + + function localeFirstDayOfYear () { + return this._week.doy; + } + + // MOMENTS + + function getSetWeek (input) { + var week = this.localeData().week(this); + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + function getSetISOWeek (input) { + var week = weekOfYear(this, 1, 4).week; + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + // FORMATTING + addFormatToken('D', ['DD', 2], 'Do', 'date'); // ALIASES @@ -29694,6 +29716,8 @@ module.exports=require(53) var getSetDayOfMonth = makeGetSet('Date', true); + // FORMATTING + addFormatToken('d', 0, 'do', 'day'); addFormatToken('dd', 0, 0, function (format) { @@ -29726,8 +29750,8 @@ module.exports=require(53) addRegexToken('ddd', matchWord); addRegexToken('dddd', matchWord); - addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) { - var weekday = config._locale.weekdaysParse(input); + addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { + var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid if (weekday != null) { week.d = weekday; @@ -29762,8 +29786,9 @@ module.exports=require(53) // LOCALES var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); - function localeWeekdays (m) { - return this._weekdays[m.day()]; + function localeWeekdays (m, format) { + return isArray(this._weekdays) ? this._weekdays[m.day()] : + this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()]; } var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); @@ -29776,20 +29801,37 @@ module.exports=require(53) return this._weekdaysMin[m.day()]; } - function localeWeekdaysParse (weekdayName) { + function localeWeekdaysParse (weekdayName, format, strict) { var i, mom, regex; - this._weekdaysParse = this._weekdaysParse || []; + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._minWeekdaysParse = []; + this._shortWeekdaysParse = []; + this._fullWeekdaysParse = []; + } for (i = 0; i < 7; i++) { // make the regex if we don't have it already + + mom = local__createLocal([2000, 1]).day(i); + if (strict && !this._fullWeekdaysParse[i]) { + this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); + this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); + this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i'); + } if (!this._weekdaysParse[i]) { - mom = local__createLocal([2000, 1]).day(i); regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex - if (this._weekdaysParse[i].test(weekdayName)) { + if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { return i; } } @@ -29798,6 +29840,9 @@ module.exports=require(53) // MOMENTS function getSetDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); if (input != null) { input = parseWeekday(input, this.localeData()); @@ -29808,20 +29853,73 @@ module.exports=require(53) } function getSetLocaleDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); } function getSetISODayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); } - addFormatToken('H', ['HH', 2], 0, 'hour'); - addFormatToken('h', ['hh', 2], 0, function () { + // FORMATTING + + addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); + + // ALIASES + + addUnitAlias('dayOfYear', 'DDD'); + + // PARSING + + addRegexToken('DDD', match1to3); + addRegexToken('DDDD', match3); + addParseToken(['DDD', 'DDDD'], function (input, array, config) { + config._dayOfYear = toInt(input); + }); + + // HELPERS + + // MOMENTS + + function getSetDayOfYear (input) { + var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; + return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + } + + // FORMATTING + + function hFormat() { return this.hours() % 12 || 12; + } + + addFormatToken('H', ['HH', 2], 0, 'hour'); + addFormatToken('h', ['hh', 2], 0, hFormat); + + addFormatToken('hmm', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); + }); + + addFormatToken('hmmss', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); + }); + + addFormatToken('Hmm', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2); + }); + + addFormatToken('Hmmss', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); }); function meridiem (token, lowercase) { @@ -29850,6 +29948,11 @@ module.exports=require(53) addRegexToken('HH', match1to2, match2); addRegexToken('hh', match1to2, match2); + addRegexToken('hmm', match3to4); + addRegexToken('hmmss', match5to6); + addRegexToken('Hmm', match3to4); + addRegexToken('Hmmss', match5to6); + addParseToken(['H', 'HH'], HOUR); addParseToken(['a', 'A'], function (input, array, config) { config._isPm = config._locale.isPM(input); @@ -29859,6 +29962,32 @@ module.exports=require(53) array[HOUR] = toInt(input); getParsingFlags(config).bigHour = true; }); + addParseToken('hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('Hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + }); + addParseToken('Hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + }); // LOCALES @@ -29886,6 +30015,8 @@ module.exports=require(53) // this rule. var getSetHour = makeGetSet('Hours', true); + // FORMATTING + addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES @@ -29902,6 +30033,8 @@ module.exports=require(53) var getSetMinute = makeGetSet('Minutes', false); + // FORMATTING + addFormatToken('s', ['ss', 2], 0, 'second'); // ALIASES @@ -29918,6 +30051,8 @@ module.exports=require(53) var getSetSecond = makeGetSet('Seconds', false); + // FORMATTING + addFormatToken('S', 0, 0, function () { return ~~(this.millisecond() / 100); }); @@ -29973,6 +30108,8 @@ module.exports=require(53) var getSetMillisecond = makeGetSet('Milliseconds', false); + // FORMATTING + addFormatToken('z', 0, 0, 'zoneAbbr'); addFormatToken('zz', 0, 0, 'zoneName'); @@ -29988,40 +30125,43 @@ module.exports=require(53) var momentPrototype__proto = Moment.prototype; - momentPrototype__proto.add = add_subtract__add; - momentPrototype__proto.calendar = moment_calendar__calendar; - momentPrototype__proto.clone = clone; - momentPrototype__proto.diff = diff; - momentPrototype__proto.endOf = endOf; - momentPrototype__proto.format = format; - momentPrototype__proto.from = from; - momentPrototype__proto.fromNow = fromNow; - momentPrototype__proto.to = to; - momentPrototype__proto.toNow = toNow; - momentPrototype__proto.get = getSet; - momentPrototype__proto.invalidAt = invalidAt; - momentPrototype__proto.isAfter = isAfter; - momentPrototype__proto.isBefore = isBefore; - momentPrototype__proto.isBetween = isBetween; - momentPrototype__proto.isSame = isSame; - momentPrototype__proto.isValid = moment_valid__isValid; - momentPrototype__proto.lang = lang; - momentPrototype__proto.locale = locale; - momentPrototype__proto.localeData = localeData; - momentPrototype__proto.max = prototypeMax; - momentPrototype__proto.min = prototypeMin; - momentPrototype__proto.parsingFlags = parsingFlags; - momentPrototype__proto.set = getSet; - momentPrototype__proto.startOf = startOf; - momentPrototype__proto.subtract = add_subtract__subtract; - momentPrototype__proto.toArray = toArray; - momentPrototype__proto.toObject = toObject; - momentPrototype__proto.toDate = toDate; - momentPrototype__proto.toISOString = moment_format__toISOString; - momentPrototype__proto.toJSON = moment_format__toISOString; - momentPrototype__proto.toString = toString; - momentPrototype__proto.unix = unix; - momentPrototype__proto.valueOf = to_type__valueOf; + momentPrototype__proto.add = add_subtract__add; + momentPrototype__proto.calendar = moment_calendar__calendar; + momentPrototype__proto.clone = clone; + momentPrototype__proto.diff = diff; + momentPrototype__proto.endOf = endOf; + momentPrototype__proto.format = format; + momentPrototype__proto.from = from; + momentPrototype__proto.fromNow = fromNow; + momentPrototype__proto.to = to; + momentPrototype__proto.toNow = toNow; + momentPrototype__proto.get = getSet; + momentPrototype__proto.invalidAt = invalidAt; + momentPrototype__proto.isAfter = isAfter; + momentPrototype__proto.isBefore = isBefore; + momentPrototype__proto.isBetween = isBetween; + momentPrototype__proto.isSame = isSame; + momentPrototype__proto.isSameOrAfter = isSameOrAfter; + momentPrototype__proto.isSameOrBefore = isSameOrBefore; + momentPrototype__proto.isValid = moment_valid__isValid; + momentPrototype__proto.lang = lang; + momentPrototype__proto.locale = locale; + momentPrototype__proto.localeData = localeData; + momentPrototype__proto.max = prototypeMax; + momentPrototype__proto.min = prototypeMin; + momentPrototype__proto.parsingFlags = parsingFlags; + momentPrototype__proto.set = getSet; + momentPrototype__proto.startOf = startOf; + momentPrototype__proto.subtract = add_subtract__subtract; + momentPrototype__proto.toArray = toArray; + momentPrototype__proto.toObject = toObject; + momentPrototype__proto.toDate = toDate; + momentPrototype__proto.toISOString = moment_format__toISOString; + momentPrototype__proto.toJSON = toJSON; + momentPrototype__proto.toString = toString; + momentPrototype__proto.unix = unix; + momentPrototype__proto.valueOf = to_type__valueOf; + momentPrototype__proto.creationData = creationData; // Year momentPrototype__proto.year = getSetYear; @@ -30107,7 +30247,7 @@ module.exports=require(53) function locale_calendar__calendar (key, mom, now) { var output = this._calendar[key]; - return typeof output === 'function' ? output.call(mom, now) : output; + return isFunction(output) ? output.call(mom, now) : output; } var defaultLongDateFormat = { @@ -30169,29 +30309,14 @@ module.exports=require(53) function relative__relativeTime (number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; - return (typeof output === 'function') ? + return (isFunction(output)) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } function pastFuture (diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); - } - - function locale_set__set (config) { - var prop, i; - for (i in config) { - prop = config[i]; - if (typeof prop === 'function') { - this[i] = prop; - } else { - this['_' + i] = prop; - } - } - // Lenient ordinal parsing accepts just a number in addition to - // number + (possibly) stuff coming from _ordinalParseLenient. - this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source); + return isFunction(format) ? format(output) : format.replace(/%s/i, output); } var prototype__proto = Locale.prototype; @@ -30213,11 +30338,15 @@ module.exports=require(53) prototype__proto.set = locale_set__set; // Month - prototype__proto.months = localeMonths; - prototype__proto._months = defaultLocaleMonths; - prototype__proto.monthsShort = localeMonthsShort; - prototype__proto._monthsShort = defaultLocaleMonthsShort; - prototype__proto.monthsParse = localeMonthsParse; + prototype__proto.months = localeMonths; + prototype__proto._months = defaultLocaleMonths; + prototype__proto.monthsShort = localeMonthsShort; + prototype__proto._monthsShort = defaultLocaleMonthsShort; + prototype__proto.monthsParse = localeMonthsParse; + prototype__proto._monthsRegex = defaultMonthsRegex; + prototype__proto.monthsRegex = monthsRegex; + prototype__proto._monthsShortRegex = defaultMonthsShortRegex; + prototype__proto.monthsShortRegex = monthsShortRegex; // Week prototype__proto.week = localeWeek; @@ -30505,15 +30634,15 @@ module.exports=require(53) var years = round(duration.as('y')); var a = seconds < thresholds.s && ['s', seconds] || - minutes === 1 && ['m'] || + minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || - hours === 1 && ['h'] || + hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || - days === 1 && ['d'] || + days <= 1 && ['d'] || days < thresholds.d && ['dd', days] || - months === 1 && ['M'] || + months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || - years === 1 && ['y'] || ['yy', years]; + years <= 1 && ['y'] || ['yy', years]; a[2] = withoutSuffix; a[3] = +posNegDuration > 0; @@ -30634,6 +30763,8 @@ module.exports=require(53) // Side effect imports + // FORMATTING + addFormatToken('X', 0, 0, 'unix'); addFormatToken('x', 0, 0, 'valueOf'); @@ -30651,13 +30782,14 @@ module.exports=require(53) // Side effect imports - utils_hooks__hooks.version = '2.10.6'; + utils_hooks__hooks.version = '2.12.0'; setHookCallback(local__createLocal); utils_hooks__hooks.fn = momentPrototype; utils_hooks__hooks.min = min; utils_hooks__hooks.max = max; + utils_hooks__hooks.now = now; utils_hooks__hooks.utc = create_utc__createUTC; utils_hooks__hooks.unix = moment__createUnix; utils_hooks__hooks.months = lists__listMonths; @@ -30673,16 +30805,335 @@ module.exports=require(53) utils_hooks__hooks.monthsShort = lists__listMonthsShort; utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin; utils_hooks__hooks.defineLocale = defineLocale; + utils_hooks__hooks.updateLocale = updateLocale; + utils_hooks__hooks.locales = locale_locales__listLocales; utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort; utils_hooks__hooks.normalizeUnits = normalizeUnits; utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold; + utils_hooks__hooks.prototype = momentPrototype; var _moment = utils_hooks__hooks; return _moment; })); -},{}],106:[function(require,module,exports){ +},{}],83:[function(require,module,exports){ +(function (process){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// resolves . and .. elements in a path array with directory names there +// must be no slashes, empty elements, or device names (c:\) in the array +// (so also no leading and trailing slashes - it does not distinguish +// relative and absolute paths) +function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + + return parts; +} + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var splitPath = function(filename) { + return splitPathRe.exec(filename).slice(1); +}; + +// path.resolve([from ...], to) +// posix version +exports.resolve = function() { + var resolvedPath = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) ? arguments[i] : process.cwd(); + + // Skip empty and invalid entries + if (typeof path !== 'string') { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { + return !!p; + }), !resolvedAbsolute).join('/'); + + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; +}; + +// path.normalize(path) +// posix version +exports.normalize = function(path) { + var isAbsolute = exports.isAbsolute(path), + trailingSlash = substr(path, -1) === '/'; + + // Normalize the path + path = normalizeArray(filter(path.split('/'), function(p) { + return !!p; + }), !isAbsolute).join('/'); + + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + + return (isAbsolute ? '/' : '') + path; +}; + +// posix version +exports.isAbsolute = function(path) { + return path.charAt(0) === '/'; +}; + +// posix version +exports.join = function() { + var paths = Array.prototype.slice.call(arguments, 0); + return exports.normalize(filter(paths, function(p, index) { + if (typeof p !== 'string') { + throw new TypeError('Arguments to path.join must be strings'); + } + return p; + }).join('/')); +}; + + +// path.relative(from, to) +// posix version +exports.relative = function(from, to) { + from = exports.resolve(from).substr(1); + to = exports.resolve(to).substr(1); + + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('/'); +}; + +exports.sep = '/'; +exports.delimiter = ':'; + +exports.dirname = function(path) { + var result = splitPath(path), + root = result[0], + dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; +}; + + +exports.basename = function(path, ext) { + var f = splitPath(path)[2]; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +}; + + +exports.extname = function(path) { + return splitPath(path)[3]; +}; + +function filter (xs, f) { + if (xs.filter) return xs.filter(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + if (f(xs[i], i, xs)) res.push(xs[i]); + } + return res; +} + +// String.prototype.substr - negative index don't work in IE8 +var substr = 'ab'.substr(-1) === 'b' + ? function (str, start, len) { return str.substr(start, len) } + : function (str, start, len) { + if (start < 0) start = str.length + start; + return str.substr(start, len); + } +; + +}).call(this,require('_process')) +},{"_process":84}],84:[function(require,module,exports){ +// shim for using process in browser + +var process = module.exports = {}; + +process.nextTick = (function () { + var canSetImmediate = typeof window !== 'undefined' + && window.setImmediate; + var canMutationObserver = typeof window !== 'undefined' + && window.MutationObserver; + var canPost = typeof window !== 'undefined' + && window.postMessage && window.addEventListener + ; + + if (canSetImmediate) { + return function (f) { return window.setImmediate(f) }; + } + + var queue = []; + + if (canMutationObserver) { + var hiddenDiv = document.createElement("div"); + var observer = new MutationObserver(function () { + var queueList = queue.slice(); + queue.length = 0; + queueList.forEach(function (fn) { + fn(); + }); + }); + + observer.observe(hiddenDiv, { attributes: true }); + + return function nextTick(fn) { + if (!queue.length) { + hiddenDiv.setAttribute('yes', 'no'); + } + queue.push(fn); + }; + } + + if (canPost) { + window.addEventListener('message', function (ev) { + var source = ev.source; + if ((source === window || source === null) && ev.data === 'process-tick') { + ev.stopPropagation(); + if (queue.length > 0) { + var fn = queue.shift(); + fn(); + } + } + }, true); + + return function nextTick(fn) { + queue.push(fn); + window.postMessage('process-tick', '*'); + }; + } + + return function nextTick(fn) { + setTimeout(fn, 0); + }; +})(); + +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +// TODO(shtylman) +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; + +},{}],85:[function(require,module,exports){ module.exports={ "name": "mermaid", "version": "0.5.8", @@ -30792,7 +31243,7 @@ module.exports={ "marked": "^0.3.2", "mock-browser": "^0.91.34", "path": "^0.4.9", - "phantomjs": "^1.9.18", + "phantomjs": "^2.1.3", "proxyquire": "^1.7.3", "proxyquire-universal": "^1.0.8", "proxyquireify": "^3.0.0", @@ -30807,7 +31258,7 @@ module.exports={ } } -},{}],107:[function(require,module,exports){ +},{}],86:[function(require,module,exports){ /* global window */ //log.debug('Setting up d3'); 'use strict'; @@ -31278,7 +31729,7 @@ module.exports = d3; })(); /* jshint ignore:end */ -},{"d3":4}],108:[function(require,module,exports){ +},{"d3":2}],87:[function(require,module,exports){ 'use strict'; var Logger = require('../../logger'); @@ -31365,7 +31816,7 @@ exports.relationType = { DEPENDENCY: 3 }; -},{"../../logger":126}],109:[function(require,module,exports){ +},{"../../logger":105}],88:[function(require,module,exports){ /** * Created by knut on 14-11-23. */ @@ -31674,7 +32125,7 @@ module.exports.draw = function (text, id) { //diagram.attr('viewBox', (box.startx-conf.diagramMarginX) + ' -' +conf.diagramMarginY + ' ' + width + ' ' + height); }; -},{"../../d3":107,"../../logger":126,"./classDb":108,"./parser/classDiagram":110,"dagre":54}],110:[function(require,module,exports){ +},{"../../d3":86,"../../logger":105,"./classDb":87,"./parser/classDiagram":89,"dagre":31}],89:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -32476,7 +32927,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],111:[function(require,module,exports){ +},{"_process":84,"fs":1,"path":83}],90:[function(require,module,exports){ (function (global){ /** * Created by knut on 15-01-14. @@ -32511,7 +32962,7 @@ exports.parseError = function (err, hash) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../logger":126}],112:[function(require,module,exports){ +},{"../../logger":105}],91:[function(require,module,exports){ /** * Created by knut on 14-12-11. */ @@ -32546,7 +32997,7 @@ exports.draw = function (txt, id, ver) { /* var box = exports.bounds.getBounds(); - var height = box.stopy-box.starty+2*conf.diagramMarginY; + var height = box.stopy-box.starty+2*conf.diagramMarginY; var width = box.stopx-box.startx+2*conf.diagramMarginX;*/ svg.attr('height', 100); @@ -32554,7 +33005,7 @@ exports.draw = function (txt, id, ver) { //svg.attr('viewBox', '0 0 300 150'); }; -},{"../../d3":107,"../../logger":126,"./exampleDb":111,"./parser/example.js":113}],113:[function(require,module,exports){ +},{"../../d3":86,"../../logger":105,"./exampleDb":90,"./parser/example.js":92}],92:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -33200,7 +33651,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],114:[function(require,module,exports){ +},{"_process":84,"fs":1,"path":83}],93:[function(require,module,exports){ /* global window */ 'use strict'; @@ -33224,7 +33675,7 @@ if (!dagreD3) { module.exports = dagreD3; -},{"../../logger":126,"dagre-d3":5}],115:[function(require,module,exports){ +},{"../../logger":105,"dagre-d3":3}],94:[function(require,module,exports){ /** * Created by knut on 14-12-11. */ @@ -33697,7 +34148,7 @@ exports.draw = function (text, id, isDot) { } }; -},{"../../d3":107,"../../logger":126,"./dagre-d3":114,"./graphDb":116,"./parser/dot":117,"./parser/flow":118}],116:[function(require,module,exports){ +},{"../../d3":86,"../../logger":105,"./dagre-d3":93,"./graphDb":95,"./parser/dot":96,"./parser/flow":97}],95:[function(require,module,exports){ (function (global){ /** * Created by knut on 14-11-03. @@ -34086,7 +34537,7 @@ exports.parseError = function (err, hash) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../d3":107,"../../logger":126}],117:[function(require,module,exports){ +},{"../../d3":86,"../../logger":105}],96:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -34917,7 +35368,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],118:[function(require,module,exports){ +},{"_process":84,"fs":1,"path":83}],97:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -36027,7 +36478,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],119:[function(require,module,exports){ +},{"_process":84,"fs":1,"path":83}],98:[function(require,module,exports){ (function (global){ /** * Created by knut on 15-01-14. @@ -36414,7 +36865,7 @@ exports.parseError = function (err, hash) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../logger":126,"moment":105}],120:[function(require,module,exports){ +},{"../../logger":105,"moment":82}],99:[function(require,module,exports){ 'use strict'; var gantt = require('./parser/gantt').parser; @@ -36768,7 +37219,7 @@ module.exports.draw = function (text, id) { } }; -},{"../../d3":107,"./ganttDb":119,"./parser/gantt":121,"moment":105}],121:[function(require,module,exports){ +},{"../../d3":86,"./ganttDb":98,"./parser/gantt":100,"moment":82}],100:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -37451,9 +37902,9 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],122:[function(require,module,exports){ +},{"_process":84,"fs":1,"path":83}],101:[function(require,module,exports){ (function (process){ -/* parser generated by jison 0.4.15 */ +/* parser generated by jison 0.4.17 */ /* Returns a Parser object of the following structure: @@ -37532,63 +37983,75 @@ var sequenceDiagram = (function () { var o = function o(k, v, _o, l) { for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v);return _o; }, - $V0 = [2, 2], - $V1 = [1, 5], - $V2 = [1, 7], - $V3 = [1, 8], - $V4 = [1, 11], - $V5 = [1, 12], - $V6 = [1, 13], + $V0 = [1, 2], + $V1 = [1, 3], + $V2 = [1, 4], + $V3 = [2, 4], + $V4 = [1, 9], + $V5 = [1, 11], + $V6 = [1, 12], $V7 = [1, 14], - $V8 = [1, 16], + $V8 = [1, 15], $V9 = [1, 17], - $Va = [1, 7, 9, 10, 16, 18, 19, 20, 21, 22, 23, 33], - $Vb = [7, 9, 10, 16, 18, 19, 20, 21, 23, 33], - $Vc = [1, 53]; + $Va = [1, 18], + $Vb = [1, 19], + $Vc = [1, 20], + $Vd = [1, 22], + $Ve = [1, 23], + $Vf = [1, 4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 24, 25, 37], + $Vg = [4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 25, 37], + $Vh = [35, 36, 37], + $Vi = [1, 67]; var parser = { trace: function trace() {}, yy: {}, - symbols_: { "error": 2, "start": 3, "SD": 4, "document": 5, "line": 6, "SPACE": 7, "statement": 8, "NL": 9, "participant": 10, "actor": 11, "AS": 12, "restOfLine": 13, "signal": 14, "note_statement": 15, "title": 16, "text": 17, "loop": 18, "end": 19, "opt": 20, "alt": 21, "else": 22, "note": 23, "placement": 24, "text2": 25, "over": 26, "actor_pair": 27, "spaceList": 28, ",": 29, "left_of": 30, "right_of": 31, "signaltype": 32, "ACTOR": 33, "SOLID_OPEN_ARROW": 34, "DOTTED_OPEN_ARROW": 35, "SOLID_ARROW": 36, "DOTTED_ARROW": 37, "SOLID_CROSS": 38, "DOTTED_CROSS": 39, "TXT": 40, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "SD", 7: "SPACE", 9: "NL", 10: "participant", 12: "AS", 13: "restOfLine", 16: "title", 17: "text", 18: "loop", 19: "end", 20: "opt", 21: "alt", 22: "else", 23: "note", 26: "over", 29: ",", 30: "left_of", 31: "right_of", 33: "ACTOR", 34: "SOLID_OPEN_ARROW", 35: "DOTTED_OPEN_ARROW", 36: "SOLID_ARROW", 37: "DOTTED_ARROW", 38: "SOLID_CROSS", 39: "DOTTED_CROSS", 40: "TXT" }, - productions_: [0, [3, 2], [5, 0], [5, 2], [6, 2], [6, 1], [6, 1], [8, 5], [8, 3], [8, 2], [8, 2], [8, 4], [8, 4], [8, 4], [8, 7], [15, 4], [15, 4], [28, 2], [28, 1], [27, 3], [27, 1], [24, 1], [24, 1], [14, 4], [11, 1], [32, 1], [32, 1], [32, 1], [32, 1], [32, 1], [32, 1], [25, 1]], + 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, "text": 19, "loop": 20, "end": 21, "opt": 22, "alt": 23, "else": 24, "note": 25, "placement": 26, "text2": 27, "over": 28, "actor_pair": 29, "spaceList": 30, ",": 31, "left_of": 32, "right_of": 33, "signaltype": 34, "+": 35, "-": 36, "ACTOR": 37, "SOLID_OPEN_ARROW": 38, "DOTTED_OPEN_ARROW": 39, "SOLID_ARROW": 40, "DOTTED_ARROW": 41, "SOLID_CROSS": 42, "DOTTED_CROSS": 43, "TXT": 44, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 4: "SPACE", 5: "NL", 6: "SD", 10: "participant", 12: "AS", 13: "restOfLine", 15: "activate", 16: "deactivate", 18: "title", 19: "text", 20: "loop", 21: "end", 22: "opt", 23: "alt", 24: "else", 25: "note", 28: "over", 31: ",", 32: "left_of", 33: "right_of", 35: "+", 36: "-", 37: "ACTOR", 38: "SOLID_OPEN_ARROW", 39: "DOTTED_OPEN_ARROW", 40: "SOLID_ARROW", 41: "DOTTED_ARROW", 42: "SOLID_CROSS", 43: "DOTTED_CROSS", 44: "TXT" }, + 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, 4], [9, 4], [9, 4], [9, 7], [17, 4], [17, 4], [30, 2], [30, 1], [29, 3], [29, 1], [26, 1], [26, 1], [14, 5], [14, 5], [14, 4], [11, 1], [34, 1], [34, 1], [34, 1], [34, 1], [34, 1], [34, 1], [27, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, /* action[1] */$$, /* vstack */_$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { - case 1: + case 3: yy.apply($$[$0]);return $$[$0]; break; - case 2: + case 4: this.$ = []; break; - case 3: + case 5: $$[$0 - 1].push($$[$0]);this.$ = $$[$0 - 1]; break; - case 4:case 5: + case 6:case 7: this.$ = $$[$0]; break; - case 6: + case 8: this.$ = []; break; - case 7: + case 9: $$[$0 - 3].description = $$[$0 - 1];this.$ = $$[$0 - 3]; break; - case 8: + case 10: this.$ = $$[$0 - 1]; break; case 12: + this.$ = { type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] }; + break; + case 13: + this.$ = { type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 1] }; + break; + case 16: $$[$0 - 1].unshift({ type: 'loopStart', loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_START }); $$[$0 - 1].push({ type: 'loopEnd', loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_END }); this.$ = $$[$0 - 1]; break; - case 13: + case 17: $$[$0 - 1].unshift({ type: 'optStart', optText: $$[$0 - 2], signalType: yy.LINETYPE.OPT_START }); $$[$0 - 1].push({ type: 'optEnd', optText: $$[$0 - 2], signalType: yy.LINETYPE.OPT_END }); this.$ = $$[$0 - 1]; break; - case 14: + case 18: // Alt start $$[$0 - 4].unshift({ type: 'altStart', altText: $$[$0 - 5], signalType: yy.LINETYPE.ALT_START }); @@ -37602,11 +38065,11 @@ var sequenceDiagram = (function () { this.$ = $$[$0 - 4]; break; - case 15: + case 19: this.$ = [$$[$0 - 1], { type: 'addNote', placement: $$[$0 - 2], actor: $$[$0 - 1].actor, text: $$[$0] }]; break; - case 16: + case 20: // Coerce actor_pair into a [to, from, ...] array $$[$0 - 2] = [].concat($$[$0 - 1], $$[$0 - 1]).slice(0, 2); @@ -37614,49 +38077,55 @@ var sequenceDiagram = (function () { $$[$0 - 2][1] = $$[$0 - 2][1].actor; this.$ = [$$[$0 - 1], { type: 'addNote', placement: yy.PLACEMENT.OVER, actor: $$[$0 - 2].slice(0, 2), text: $$[$0] }]; break; - case 19: + case 23: this.$ = [$$[$0 - 2], $$[$0]]; break; - case 20: + case 24: this.$ = $$[$0]; break; - case 21: + case 25: this.$ = yy.PLACEMENT.LEFTOF; break; - case 22: + case 26: this.$ = yy.PLACEMENT.RIGHTOF; break; - case 23: - this.$ = [$$[$0 - 3], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }]; - break; - case 24: - this.$ = { type: 'addActor', actor: $$[$0] }; - break; - case 25: - this.$ = yy.LINETYPE.SOLID_OPEN; - break; - case 26: - this.$ = yy.LINETYPE.DOTTED_OPEN; - break; case 27: - this.$ = yy.LINETYPE.SOLID; + this.$ = [$$[$0 - 4], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, { type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] }]; break; case 28: - this.$ = yy.LINETYPE.DOTTED; + this.$ = [$$[$0 - 4], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, { type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 4] }]; break; case 29: - this.$ = yy.LINETYPE.SOLID_CROSS; + this.$ = [$$[$0 - 3], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }]; break; case 30: - this.$ = yy.LINETYPE.DOTTED_CROSS; + this.$ = { type: 'addActor', actor: $$[$0] }; break; case 31: + this.$ = yy.LINETYPE.SOLID_OPEN; + break; + case 32: + this.$ = yy.LINETYPE.DOTTED_OPEN; + break; + case 33: + this.$ = yy.LINETYPE.SOLID; + break; + case 34: + this.$ = yy.LINETYPE.DOTTED; + break; + case 35: + this.$ = yy.LINETYPE.SOLID_CROSS; + break; + case 36: + this.$ = yy.LINETYPE.DOTTED_CROSS; + break; + case 37: this.$ = $$[$0].substring(1).trim().replace(/\\n/gm, "\n"); break; } }, - table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o([1, 7, 9, 10, 16, 18, 20, 21, 23, 33], $V0, { 5: 3 }), { 1: [2, 1], 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, o($Va, [2, 3]), { 8: 18, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, o($Va, [2, 5]), o($Va, [2, 6]), { 11: 19, 33: $V9 }, { 9: [1, 20] }, { 9: [1, 21] }, { 7: [1, 22] }, { 13: [1, 23] }, { 13: [1, 24] }, { 13: [1, 25] }, { 32: 26, 34: [1, 27], 35: [1, 28], 36: [1, 29], 37: [1, 30], 38: [1, 31], 39: [1, 32] }, { 24: 33, 26: [1, 34], 30: [1, 35], 31: [1, 36] }, o([9, 12, 29, 34, 35, 36, 37, 38, 39, 40], [2, 24]), o($Va, [2, 4]), { 9: [1, 38], 12: [1, 37] }, o($Va, [2, 9]), o($Va, [2, 10]), { 17: [1, 39] }, o($Vb, $V0, { 5: 40 }), o($Vb, $V0, { 5: 41 }), o([7, 9, 10, 16, 18, 20, 21, 22, 23, 33], $V0, { 5: 42 }), { 11: 43, 33: $V9 }, { 33: [2, 25] }, { 33: [2, 26] }, { 33: [2, 27] }, { 33: [2, 28] }, { 33: [2, 29] }, { 33: [2, 30] }, { 11: 44, 33: $V9 }, { 11: 46, 27: 45, 33: $V9 }, { 33: [2, 21] }, { 33: [2, 22] }, { 13: [1, 47] }, o($Va, [2, 8]), { 9: [1, 48] }, { 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 19: [1, 49], 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, { 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 19: [1, 50], 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, { 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 20: $V6, 21: $V7, 22: [1, 51], 23: $V8, 33: $V9 }, { 25: 52, 40: $Vc }, { 25: 54, 40: $Vc }, { 25: 55, 40: $Vc }, { 29: [1, 56], 40: [2, 20] }, { 9: [1, 57] }, o($Va, [2, 11]), o($Va, [2, 12]), o($Va, [2, 13]), { 13: [1, 58] }, { 9: [2, 23] }, { 9: [2, 31] }, { 9: [2, 15] }, { 9: [2, 16] }, { 11: 59, 33: $V9 }, o($Va, [2, 7]), o($Vb, $V0, { 5: 60 }), { 40: [2, 19] }, { 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 19: [1, 61], 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, o($Va, [2, 14])], - defaultActions: { 27: [2, 25], 28: [2, 26], 29: [2, 27], 30: [2, 28], 31: [2, 29], 32: [2, 30], 35: [2, 21], 36: [2, 22], 52: [2, 23], 53: [2, 31], 54: [2, 15], 55: [2, 16], 59: [2, 19] }, + 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, 37], $V3, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, o($Vf, [2, 5]), { 9: 24, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, o($Vf, [2, 7]), o($Vf, [2, 8]), { 11: 25, 37: $Ve }, { 5: [1, 26] }, { 11: 27, 37: $Ve }, { 11: 28, 37: $Ve }, { 5: [1, 29] }, { 4: [1, 30] }, { 13: [1, 31] }, { 13: [1, 32] }, { 13: [1, 33] }, { 34: 34, 38: [1, 35], 39: [1, 36], 40: [1, 37], 41: [1, 38], 42: [1, 39], 43: [1, 40] }, { 26: 41, 28: [1, 42], 32: [1, 43], 33: [1, 44] }, o([5, 12, 31, 38, 39, 40, 41, 42, 43, 44], [2, 30]), o($Vf, [2, 6]), { 5: [1, 46], 12: [1, 45] }, o($Vf, [2, 11]), { 5: [1, 47] }, { 5: [1, 48] }, o($Vf, [2, 14]), { 19: [1, 49] }, o($Vg, $V3, { 7: 50 }), o($Vg, $V3, { 7: 51 }), o([4, 5, 10, 15, 16, 18, 20, 22, 23, 24, 25, 37], $V3, { 7: 52 }), { 11: 55, 35: [1, 53], 36: [1, 54], 37: $Ve }, o($Vh, [2, 31]), o($Vh, [2, 32]), o($Vh, [2, 33]), o($Vh, [2, 34]), o($Vh, [2, 35]), o($Vh, [2, 36]), { 11: 56, 37: $Ve }, { 11: 58, 29: 57, 37: $Ve }, { 37: [2, 25] }, { 37: [2, 26] }, { 13: [1, 59] }, o($Vf, [2, 10]), o($Vf, [2, 12]), o($Vf, [2, 13]), { 5: [1, 60] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 61], 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 62], 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 24: [1, 63], 25: $Vd, 37: $Ve }, { 11: 64, 37: $Ve }, { 11: 65, 37: $Ve }, { 27: 66, 44: $Vi }, { 27: 68, 44: $Vi }, { 27: 69, 44: $Vi }, { 31: [1, 70], 44: [2, 24] }, { 5: [1, 71] }, o($Vf, [2, 15]), o($Vf, [2, 16]), o($Vf, [2, 17]), { 13: [1, 72] }, { 27: 73, 44: $Vi }, { 27: 74, 44: $Vi }, { 5: [2, 29] }, { 5: [2, 37] }, { 5: [2, 19] }, { 5: [2, 20] }, { 11: 75, 37: $Ve }, o($Vf, [2, 9]), o($Vg, $V3, { 7: 76 }), { 5: [2, 27] }, { 5: [2, 28] }, { 44: [2, 23] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 77], 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, o($Vf, [2, 18])], + defaultActions: { 5: [2, 1], 6: [2, 2], 43: [2, 25], 44: [2, 26], 66: [2, 29], 67: [2, 37], 68: [2, 19], 69: [2, 20], 73: [2, 27], 74: [2, 28], 75: [2, 23] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); @@ -37666,7 +38135,7 @@ var sequenceDiagram = (function () { this.hash = hash; }; - _parseError.prototype = new Error(); + _parseError.prototype = Error; throw new _parseError(str, hash); } @@ -38136,7 +38605,7 @@ var sequenceDiagram = (function () { var YYSTATE = YY_START; switch ($avoiding_name_collisions) { case 0: - return 9; + return 5; break; case 1: /* skip all whitespace */ @@ -38154,70 +38623,70 @@ var sequenceDiagram = (function () { this.begin('ID');return 10; break; case 6: - this.begin('ALIAS');return 33; + this.begin('ALIAS');return 37; break; case 7: this.popState();this.popState();this.begin('LINE');return 12; break; case 8: - this.popState();this.popState();return 9; + this.popState();this.popState();return 5; break; case 9: - this.begin('LINE');return 18; - break; - case 10: this.begin('LINE');return 20; break; + case 10: + this.begin('LINE');return 22; + break; case 11: - this.begin('LINE');return 21; + this.begin('LINE');return 23; break; case 12: - this.begin('LINE');return 22; + this.begin('LINE');return 24; break; case 13: this.popState();return 13; break; case 14: - return 19; + return 21; break; case 15: - return 30; + return 32; break; case 16: - return 31; - break; - case 17: - return 26; - break; - case 18: - return 23; - break; - case 19: - return 16; - break; - case 20: - return 4; - break; - case 21: - return 29; - break; - case 22: - return 9; - break; - case 23: return 33; break; + case 17: + return 28; + break; + case 18: + return 25; + break; + case 19: + this.begin('ID');return 15; + break; + case 20: + this.begin('ID');return 16; + break; + case 21: + return 18; + break; + case 22: + return 6; + break; + case 23: + return 31; + break; case 24: - return 36; + return 5; break; case 25: - return 37; + yy_.yytext = yy_.yytext.trim();return 37; break; case 26: - return 34; + return 40; break; case 27: - return 35; + return 41; break; case 28: return 38; @@ -38226,18 +38695,30 @@ var sequenceDiagram = (function () { return 39; break; case 30: - return 40; + return 42; break; case 31: - return 9; + return 43; break; case 32: + return 44; + break; + case 33: + return 35; + break; + case 34: + return 36; + break; + case 35: + return 5; + break; + case 36: return 'INVALID'; break; } }, - 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, /^(?:[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:title\b)/i, /^(?:sequenceDiagram\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\->:\n,;]+)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?::[^#\n;]+)/i, /^(?:$)/i, /^(?:.)/i], - conditions: { "LINE": { "rules": [2, 3, 13], "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, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], "inclusive": true } } + 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, /^(?:[^#\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], + conditions: { "LINE": { "rules": [2, 3, 13], "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, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36], "inclusive": true } } }; return lexer; })(); @@ -38269,7 +38750,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],123:[function(require,module,exports){ +},{"_process":84,"fs":1,"path":83}],102:[function(require,module,exports){ (function (global){ /** * Created by knut on 14-11-19. @@ -38338,7 +38819,9 @@ exports.LINETYPE = { ALT_ELSE: 13, ALT_END: 14, OPT_START: 15, - OPT_END: 16 + OPT_END: 16, + ACTIVE_START: 17, + ACTIVE_END: 18 }; exports.ARROWTYPE = { @@ -38372,11 +38855,17 @@ exports.apply = function (param) { exports.apply(item); }); } else { - // log.debug(param); + // console.info(param); switch (param.type) { case 'addActor': exports.addActor(param.actor, param.actor, param.description); break; + case 'activeStart': + exports.addSignal(param.actor, undefined, undefined, param.signalType); + break; + case 'activeEnd': + exports.addSignal(param.actor, undefined, undefined, param.signalType); + break; case 'addNote': exports.addNote(param.actor, param.placement, param.text); break; @@ -38415,7 +38904,7 @@ exports.apply = function (param) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../logger":126}],124:[function(require,module,exports){ +},{"../../logger":105}],103:[function(require,module,exports){ /** * Created by knut on 14-11-23. */ @@ -38435,7 +38924,7 @@ var conf = { diagramMarginY: 10, // Margin between actors actorMargin: 50, - // Width of actor moxes + // Width of actor boxes width: 150, // Height of actor boxes height: 65, @@ -38449,7 +38938,10 @@ var conf = { mirrorActors: false, // Depending on css styling this might need adjustment // Prolongs the edge of the diagram downwards - bottomMarginAdj: 1 + bottomMarginAdj: 1, + + // width of activation box + activationWidth: 10 }; //var bb = getBBox('path'); @@ -38462,9 +38954,11 @@ exports.bounds = { }, verticalPos: 0, - list: [], + sequenceItems: [], + activations: [], init: function init() { - this.list = []; + this.sequenceItems = []; + this.activations = []; this.data = { startx: undefined, stopx: undefined, @@ -38480,24 +38974,33 @@ exports.bounds = { obj[key] = fun(val, obj[key]); } }, - updateLoops: function updateLoops(startx, starty, stopx, stopy) { + updateBounds: function updateBounds(startx, starty, stopx, stopy) { var _self = this; var cnt = 0; - this.list.forEach(function (loop) { - cnt++; - // The loop list is a stack so the biggest margins in the beginning of the list - var n = _self.list.length - cnt + 1; + function updateFn(type) { + return function updateItemBounds(item) { + cnt++; + // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems + var n = _self.sequenceItems.length - cnt + 1; - _self.updateVal(loop, 'startx', startx - n * conf.boxMargin, Math.min); - _self.updateVal(loop, 'starty', starty - n * conf.boxMargin, Math.min); - _self.updateVal(loop, 'stopx', stopx + n * conf.boxMargin, Math.max); - _self.updateVal(loop, 'stopy', stopy + n * conf.boxMargin, Math.max); + _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min); + _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max); - _self.updateVal(exports.bounds.data, 'startx', startx - n * conf.boxMargin, Math.min); - _self.updateVal(exports.bounds.data, 'starty', starty - n * conf.boxMargin, Math.min); - _self.updateVal(exports.bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max); - _self.updateVal(exports.bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max); - }); + _self.updateVal(exports.bounds.data, 'startx', startx - n * conf.boxMargin, Math.min); + _self.updateVal(exports.bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max); + + if (!(type == 'activation')) { + _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min); + _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max); + + _self.updateVal(exports.bounds.data, 'starty', starty - n * conf.boxMargin, Math.min); + _self.updateVal(exports.bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max); + } + }; + } + + this.sequenceItems.forEach(updateFn()); + this.activations.forEach(updateFn('activation')); }, insert: function insert(startx, starty, stopx, stopy) { @@ -38513,21 +39016,37 @@ exports.bounds = { this.updateVal(exports.bounds.data, 'stopx', _stopx, Math.max); this.updateVal(exports.bounds.data, 'stopy', _stopy, Math.max); - this.updateLoops(_startx, _starty, _stopx, _stopy); + this.updateBounds(_startx, _starty, _stopx, _stopy); + }, + newActivation: function newActivation(message, diagram) { + var actorRect = sq.yy.getActors()[message.from.actor]; + var stackedSize = actorActivations(message.from.actor).length; + var x = actorRect.x + conf.width / 2 + (stackedSize - 1) * conf.activationWidth / 2; + this.activations.push({ startx: x, starty: this.verticalPos + 2, stopx: x + conf.activationWidth, stopy: undefined, + actor: message.from.actor, + anchored: svgDraw.anchorElement(diagram) + }); + }, + endActivation: function endActivation(message) { + // find most recent activation for given actor + var lastActorActivationIdx = this.activations.map(function (activation) { + return activation.actor; + }).lastIndexOf(message.from.actor); + var activation = this.activations.splice(lastActorActivationIdx, 1)[0]; + return activation; }, newLoop: function newLoop(title) { - this.list.push({ startx: undefined, starty: this.verticalPos, stopx: undefined, stopy: undefined, title: title }); + this.sequenceItems.push({ startx: undefined, starty: this.verticalPos, stopx: undefined, stopy: undefined, title: title }); }, endLoop: function endLoop() { - var loop = this.list.pop(); - //loop.stopy = exports.bounds.getVerticalPos(); + var loop = this.sequenceItems.pop(); return loop; }, addElseToLoop: function addElseToLoop(message) { - var loop = this.list.pop(); + var loop = this.sequenceItems.pop(); loop.elsey = exports.bounds.getVerticalPos(); loop.elseText = message; - this.list.push(loop); + this.sequenceItems.push(loop); }, bumpVerticalPos: function bumpVerticalPos(bump) { this.verticalPos = this.verticalPos + bump; @@ -38663,7 +39182,7 @@ module.exports.drawActors = function (diagram, actors, actorKeys, verticalPos) { // Add some rendering data to the object actors[key].x = i * conf.actorMargin + i * conf.width; actors[key].y = verticalPos; - actors[key].width = conf.diagramMarginY; + actors[key].width = conf.diagramMarginX; actors[key].height = conf.diagramMarginY; // Draw the box with the attached line @@ -38683,6 +39202,27 @@ module.exports.setConf = function (cnf) { conf[key] = cnf[key]; }); }; + +var actorActivations = function actorActivations(actor) { + return module.exports.bounds.activations.filter(function (activation) { + return activation.actor == actor; + }); +}; + +var actorFlowVerticaBounds = function actorFlowVerticaBounds(actor) { + // handle multiple stacked activations for same actor + var actors = sq.yy.getActors(); + var activations = actorActivations(actor); + + var left = activations.reduce(function (acc, activation) { + return Math.min(acc, activation.startx); + }, actors[actor].x + conf.width / 2); + var right = activations.reduce(function (acc, activation) { + return Math.max(acc, activation.stopx); + }, actors[actor].x + conf.width / 2); + return [left, right]; +}; + /** * Draws a flowchart in the tag with id: id based on the graph definition in text. * @param text @@ -38709,6 +39249,19 @@ module.exports.draw = function (text, id) { svgDraw.insertArrowHead(diagram); svgDraw.insertArrowCrossHead(diagram); + function activeEnd(msg, verticalPos) { + var activationData = exports.bounds.endActivation(msg); + if (activationData.starty + 18 > verticalPos) { + activationData.starty = verticalPos - 6; + verticalPos += 12; + } + svgDraw.drawActivation(diagram, activationData, verticalPos, conf); + + exports.bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos); + } + + var lastMsg; + // Draw the messages/signals messages.forEach(function (msg) { var loopData; @@ -38733,6 +39286,12 @@ module.exports.draw = function (text, id) { drawNote(diagram, (startx + stopx + conf.width - forceWidth) / 2, exports.bounds.getVerticalPos(), msg, forceWidth); } break; + case sq.yy.LINETYPE.ACTIVE_START: + exports.bounds.newActivation(msg, diagram); + break; + case sq.yy.LINETYPE.ACTIVE_END: + activeEnd(msg, exports.bounds.getVerticalPos()); + break; case sq.yy.LINETYPE.LOOP_START: exports.bounds.bumpVerticalPos(conf.boxMargin); exports.bounds.newLoop(msg.message); @@ -38774,12 +39333,23 @@ module.exports.draw = function (text, id) { exports.bounds.bumpVerticalPos(conf.boxMargin); break; default: - exports.bounds.bumpVerticalPos(conf.messageMargin); - startx = actors[msg.from].x + conf.width / 2; - stopx = actors[msg.to].x + conf.width / 2; - - drawMessage(diagram, startx, stopx, exports.bounds.getVerticalPos(), msg); + try { + lastMsg = msg; + exports.bounds.bumpVerticalPos(conf.messageMargin); + var fromBounds = actorFlowVerticaBounds(msg.from); + var toBounds = actorFlowVerticaBounds(msg.to); + var fromIdx = fromBounds[0] <= toBounds[0] ? 1 : 0; + var toIdx = fromBounds[0] < toBounds[0] ? 0 : 1; + startx = fromBounds[fromIdx]; + stopx = toBounds[toIdx]; + var verticalPos = exports.bounds.getVerticalPos(); + drawMessage(diagram, startx, stopx, verticalPos, msg); + var allBounds = fromBounds.concat(toBounds); + exports.bounds.insert(Math.min.apply(null, allBounds), verticalPos, Math.max.apply(null, allBounds), verticalPos); + } catch (e) { + console.error('error while drawing message', e); + } } }); @@ -38814,7 +39384,7 @@ module.exports.draw = function (text, id) { diagram.attr('viewBox', box.startx - conf.diagramMarginX + ' -' + conf.diagramMarginY + ' ' + width + ' ' + height); }; -},{"../../d3":107,"../../logger":126,"./parser/sequenceDiagram":122,"./sequenceDb":123,"./svgDraw":125}],125:[function(require,module,exports){ +},{"../../d3":86,"../../logger":105,"./parser/sequenceDiagram":101,"./sequenceDb":102,"./svgDraw":104}],104:[function(require,module,exports){ /** * Created by knut on 14-12-20. */ @@ -38926,6 +39496,26 @@ exports.drawActor = function (elem, left, verticalPos, description, conf) { .attr('x', center).attr('y', verticalPos + conf.height / 2 + 5).attr('class', 'actor').style('text-anchor', 'middle').text(description); }; +exports.anchorElement = function (elem) { + return elem.append('g'); +}; +/** + * Draws an actor in the diagram with the attaced line + * @param elem - element to append activation rect + * @param bounds - activation box bounds + * @param verticalPos - precise y cooridnate of bottom activation box edge + */ +exports.drawActivation = function (elem, bounds, verticalPos) { + var rect = exports.getNoteRect(); + var g = bounds.anchored; + rect.x = bounds.startx; + rect.y = bounds.starty; + rect.fill = '#f4f4f4'; + rect.width = bounds.stopx - bounds.startx; + rect.height = verticalPos - bounds.starty; + exports.drawRect(g, rect); +}; + /** * Draws an actor in the diagram with the attaced line * @param center - The center of the the actor @@ -39022,7 +39612,7 @@ exports.getNoteRect = function () { return rect; }; -},{}],126:[function(require,module,exports){ +},{}],105:[function(require,module,exports){ /** * #logger * logger = require('logger').create() @@ -39122,7 +39712,7 @@ function Log(level) { exports.Log = Log; -},{}],127:[function(require,module,exports){ +},{}],106:[function(require,module,exports){ (function (global){ /** * --- @@ -39659,7 +40249,7 @@ global.mermaidAPI = { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../package.json":106,"./d3":107,"./diagrams/classDiagram/classDb":108,"./diagrams/classDiagram/classRenderer":109,"./diagrams/classDiagram/parser/classDiagram":110,"./diagrams/example/exampleDb":111,"./diagrams/example/exampleRenderer":112,"./diagrams/example/parser/example":113,"./diagrams/flowchart/flowRenderer":115,"./diagrams/flowchart/graphDb":116,"./diagrams/flowchart/parser/dot":117,"./diagrams/flowchart/parser/flow":118,"./diagrams/gantt/ganttDb":119,"./diagrams/gantt/ganttRenderer":120,"./diagrams/gantt/parser/gantt":121,"./diagrams/sequenceDiagram/parser/sequenceDiagram":122,"./diagrams/sequenceDiagram/sequenceDb":123,"./diagrams/sequenceDiagram/sequenceRenderer":124,"./logger":126,"./utils":128}],128:[function(require,module,exports){ +},{"../package.json":85,"./d3":86,"./diagrams/classDiagram/classDb":87,"./diagrams/classDiagram/classRenderer":88,"./diagrams/classDiagram/parser/classDiagram":89,"./diagrams/example/exampleDb":90,"./diagrams/example/exampleRenderer":91,"./diagrams/example/parser/example":92,"./diagrams/flowchart/flowRenderer":94,"./diagrams/flowchart/graphDb":95,"./diagrams/flowchart/parser/dot":96,"./diagrams/flowchart/parser/flow":97,"./diagrams/gantt/ganttDb":98,"./diagrams/gantt/ganttRenderer":99,"./diagrams/gantt/parser/gantt":100,"./diagrams/sequenceDiagram/parser/sequenceDiagram":101,"./diagrams/sequenceDiagram/sequenceDb":102,"./diagrams/sequenceDiagram/sequenceRenderer":103,"./logger":105,"./utils":107}],107:[function(require,module,exports){ /** * Created by knut on 14-11-23. */ @@ -39799,5 +40389,5 @@ var cloneCssStyles = function cloneCssStyles(svg, classes) { exports.cloneCssStyles = cloneCssStyles; -},{"./logger":126}]},{},[127])(127) +},{"./logger":105}]},{},[106])(106) }); \ No newline at end of file diff --git a/dist/mermaidAPI.min.js b/dist/mermaidAPI.min.js index 731f41f60..94c636a71 100644 --- a/dist/mermaidAPI.min.js +++ b/dist/mermaidAPI.min.js @@ -1,21 +1,16 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.mermaidAPI=t()}}(function(){var define,module,exports;return function t(e,n,r){function i(u,o){if(!n[u]){if(!e[u]){var s="function"==typeof require&&require;if(!o&&s)return s(u,!0);if(a)return a(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[u]={exports:{}};e[u][0].call(l.exports,function(t){var n=e[u][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[u].exports}for(var a="function"==typeof require&&require,u=0;u=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!i;a--){var u=a>=0?arguments[a]:t.cwd();if("string"!=typeof u)throw new TypeError("Arguments to path.resolve must be strings");u&&(n=u+"/"+n,i="/"===u.charAt(0))}return n=e(r(n.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(t){var i=n.isAbsolute(t),a="/"===u(t,-1);return t=e(r(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(r(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function r(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),a=r(e.split("/")),u=Math.min(i.length,a.length),o=u,s=0;u>s;s++)if(i[s]!==a[s]){o=s;break}for(var c=[],s=o;se&&(e=t.length+e),t.substr(e,n)}}).call(this,t("_process"))},{_process:3}],3:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.MutationObserver,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};var r=[];if(e){var i=document.createElement("div"),a=new MutationObserver(function(){var t=r.slice();r.length=0,t.forEach(function(t){t()})});return a.observe(i,{attributes:!0}),function(t){r.length||i.setAttribute("yes","no"),r.push(t)}}return n?(window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),r.length>0)){var n=r.shift();n()}},!0),function(t){r.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],4:[function(t,e){!function(){function t(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function r(t,e){return e>t?-1:t>e?1:t>=e?0:0/0}function i(t){return null===t?0/0:+t}function a(t){return!isNaN(t)}function u(t){return{left:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var a=r+i>>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var a=r+i>>>1;t(e[a],n)>0?i=a:r=a+1}return r}}}function o(t){return t.length}function s(t){for(var e=1;t*e%1;)e*=10;return e}function c(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function l(){this._=Object.create(null)}function h(t){return(t+="")===gu||t[0]===yu?yu+t:t}function f(t){return(t+="")[0]===yu?t.slice(1):t}function d(t){return h(t)in this._}function p(t){return(t=h(t))in this._&&delete this._[t]}function g(){var t=[];for(var e in this._)t.push(f(e));return t}function y(){var t=0;for(var e in this._)++t;return t}function m(){for(var t in this._)return!1;return!0}function v(){this._=Object.create(null)}function _(t){return t}function b(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function x(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=mu.length;r>n;++n){var i=mu[n]+e;if(i in t)return i}}function w(){}function A(){}function k(t){function e(){for(var e,r=n,i=-1,a=r.length;++in;n++)for(var i,a=t[n],u=0,o=a.length;o>u;u++)(i=a[u])&&e(i,u,n);return t}function G(t){return _u(t,Eu),t}function W(t){var e,n;return function(r,i,a){var u,o=t[a].update,s=o.length;for(a!=n&&(n=a,e=0),i>=e&&(e=i+1);!(u=o[e])&&++e0&&(t=t.slice(0,o));var c=Mu.get(t);return c&&(t=c,s=X),o?e?i:r:e?w:a}function V(t,e){return function(n){var r=nu.event;nu.event=n,e[0]=this.__data__;try{t.apply(this,e)}finally{nu.event=r}}}function X(t,e){var n=V(t,e);return function(t){var e=this,r=t.relatedTarget;r&&(r===e||8&r.compareDocumentPosition(e))||n.call(e,t)}}function Z(e){var r=".dragsuppress-"+ ++Cu,i="click"+r,a=nu.select(n(e)).on("touchmove"+r,E).on("dragstart"+r,E).on("selectstart"+r,E);if(null==Du&&(Du="onselectstart"in e?!1:x(e.style,"userSelect")),Du){var u=t(e).style,o=u[Du];u[Du]="none"}return function(t){if(a.on(r,null),Du&&(u[Du]=o),t){var e=function(){a.on(i,null)};a.on(i,function(){E(),e()},!0),setTimeout(e,0)}}}function K(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>Su){var a=n(t);if(a.scrollX||a.scrollY){r=nu.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=r[0][0].getScreenCTM();Su=!(u.f||u.e),r.remove()}}return Su?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}function Q(){return nu.event.changedTouches[0].identifier}function J(t){return t>0?1:0>t?-1:0}function tt(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function et(t){return t>1?0:-1>t?Bu:Math.acos(t)}function nt(t){return t>1?Nu:-1>t?-Nu:Math.asin(t)}function rt(t){return((t=Math.exp(t))-1/t)/2}function it(t){return((t=Math.exp(t))+1/t)/2}function at(t){return((t=Math.exp(2*t))-1)/(t+1)}function ut(t){return(t=Math.sin(t/2))*t}function ot(){}function st(t,e,n){return this instanceof st?(this.h=+t,this.s=+e,void(this.l=+n)):arguments.length<2?t instanceof st?new st(t.h,t.s,t.l):wt(""+t,At,st):new st(t,e,n)}function ct(t,e,n){function r(t){return t>360?t-=360:0>t&&(t+=360),60>t?a+(u-a)*t/60:180>t?u:240>t?a+(u-a)*(240-t)/60:a}function i(t){return Math.round(255*r(t))}var a,u;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:0>e?0:e>1?1:e,n=0>n?0:n>1?1:n,u=.5>=n?n*(1+e):n+e-n*e,a=2*n-u,new vt(i(t+120),i(t),i(t-120))}function lt(t,e,n){return this instanceof lt?(this.h=+t,this.c=+e,void(this.l=+n)):arguments.length<2?t instanceof lt?new lt(t.h,t.c,t.l):t instanceof ft?pt(t.l,t.a,t.b):pt((t=kt((t=nu.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new lt(t,e,n)}function ht(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ft(n,Math.cos(t*=Ou)*e,Math.sin(t)*e)}function ft(t,e,n){return this instanceof ft?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof ft?new ft(t.l,t.a,t.b):t instanceof lt?ht(t.h,t.c,t.l):kt((t=vt(t)).r,t.g,t.b):new ft(t,e,n)}function dt(t,e,n){var r=(t+16)/116,i=r+e/500,a=r-n/200;return i=gt(i)*Hu,r=gt(r)*Vu,a=gt(a)*Xu,new vt(mt(3.2404542*i-1.5371385*r-.4985314*a),mt(-.969266*i+1.8760108*r+.041556*a),mt(.0556434*i-.2040259*r+1.0572252*a))}function pt(t,e,n){return t>0?new lt(Math.atan2(n,e)*Pu,Math.sqrt(e*e+n*n),t):new lt(0/0,0/0,t)}function gt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function yt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function mt(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function vt(t,e,n){return this instanceof vt?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof vt?new vt(t.r,t.g,t.b):wt(""+t,vt,ct):new vt(t,e,n)}function _t(t){return new vt(t>>16,t>>8&255,255&t)}function bt(t){return _t(t)+""}function xt(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function wt(t,e,n){t=t.toLowerCase();var r,i,a,u=0,o=0,s=0;if(r=/([a-z]+)\((.*)\)/.exec(t))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(Mt(i[0]),Mt(i[1]),Mt(i[2]))}return(a=Qu.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(u=(3840&a)>>4,u=u>>4|u,o=240&a,o=o>>4|o,s=15&a,s=s<<4|s):7===t.length&&(u=(16711680&a)>>16,o=(65280&a)>>8,s=255&a)),e(u,o,s))}function At(t,e,n){var r,i,a=Math.min(t/=255,e/=255,n/=255),u=Math.max(t,e,n),o=u-a,s=(u+a)/2;return o?(i=.5>s?o/(u+a):o/(2-u-a),r=t==u?(e-n)/o+(n>e?6:0):e==u?(n-t)/o+2:(t-e)/o+4,r*=60):(r=0/0,i=s>0&&1>s?0:r),new st(r,i,s)}function kt(t,e,n){t=Et(t),e=Et(e),n=Et(n);var r=yt((.4124564*t+.3575761*e+.1804375*n)/Hu),i=yt((.2126729*t+.7151522*e+.072175*n)/Vu),a=yt((.0193339*t+.119192*e+.9503041*n)/Xu);return ft(116*i-16,500*(r-i),200*(i-a))}function Et(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Mt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Dt(t){return"function"==typeof t?t:function(){return t}}function Ct(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),St(e,n,t,r)}}function St(t,e,n,r){function i(){var t,e=s.status;if(!e&&Ft(s)||e>=200&&300>e||304===e){try{t=n.call(a,s)}catch(r){return void u.error.call(a,r)}u.load.call(a,t)}else u.error.call(a,s)}var a={},u=nu.dispatch("beforesend","progress","load","error"),o={},s=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(t)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=i:s.onreadystatechange=function(){s.readyState>3&&i()},s.onprogress=function(t){var e=nu.event;nu.event=t;try{u.progress.call(a,s)}finally{nu.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?o[t]:(null==e?delete o[t]:o[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(c=t,a):c},a.response=function(t){return n=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(iu(arguments)))}}),a.send=function(n,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),s.open(n,t,!0),null==e||"accept"in o||(o.accept=e+",*/*"),s.setRequestHeader)for(var l in o)s.setRequestHeader(l,o[l]);return null!=e&&s.overrideMimeType&&s.overrideMimeType(e),null!=c&&(s.responseType=c),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),u.beforesend.call(a,s),s.send(null==r?null:r),a},a.abort=function(){return s.abort(),a},nu.rebind(a,u,"on"),null==r?a:a.get(Tt(r))}function Tt(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Ft(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Bt(){var t=Lt(),e=It()-t;e>24?(isFinite(e)&&(clearTimeout(no),no=setTimeout(Bt,e)),eo=0):(eo=1,io(Bt))}function Lt(){var t=Date.now();for(ro=Ju;ro;)t>=ro.t&&(ro.f=ro.c(t-ro.t)),ro=ro.n;return t}function It(){for(var t,e=Ju,n=1/0;e;)e.f?e=t?t.n=e.n:Ju=e.n:(e.t8?function(t){return t/n}:function(t){return t*n},symbol:t}}function Pt(t){var e=t.decimal,n=t.thousands,r=t.grouping,i=t.currency,a=r&&n?function(t,e){for(var i=t.length,a=[],u=0,o=r[0],s=0;i>0&&o>0&&(s+o+1>e&&(o=Math.max(1,e-s)),a.push(t.substring(i-=o,i+o)),!((s+=o+1)>e));)o=r[u=(u+1)%r.length];return a.reverse().join(n)}:_;return function(t){var n=uo.exec(t),r=n[1]||" ",u=n[2]||">",o=n[3]||"-",s=n[4]||"",c=n[5],l=+n[6],h=n[7],f=n[8],d=n[9],p=1,g="",y="",m=!1,v=!0;switch(f&&(f=+f.substring(1)),(c||"0"===r&&"="===u)&&(c=r="0",u="="),d){case"n":h=!0,d="g";break;case"%":p=100,y="%",d="f";break;case"p":p=100,y="%",d="r";break;case"b":case"o":case"x":case"X":"#"===s&&(g="0"+d.toLowerCase());case"c":v=!1;case"d":m=!0,f=0;break;case"s":p=-1,d="r"}"$"===s&&(g=i[0],y=i[1]),"r"!=d||f||(d="g"),null!=f&&("g"==d?f=Math.max(1,Math.min(21,f)):("e"==d||"f"==d)&&(f=Math.max(0,Math.min(20,f)))),d=oo.get(d)||Rt;var _=c&&h;return function(t){var n=y;if(m&&t%1)return"";var i=0>t||0===t&&0>1/t?(t=-t,"-"):"-"===o?"":o;if(0>p){var s=nu.formatPrefix(t,f);t=s.scale(t),n=s.symbol+y}else t*=p;t=d(t,f);var b,x,w=t.lastIndexOf(".");if(0>w){var A=v?t.lastIndexOf("e"):-1;0>A?(b=t,x=""):(b=t.substring(0,A),x=t.substring(A))}else b=t.substring(0,w),x=e+t.substring(w+1);!c&&h&&(b=a(b,1/0));var k=g.length+b.length+x.length+(_?0:i.length),E=l>k?new Array(k=l-k+1).join(r):"";return _&&(b=a(E+b,E.length?l-x.length:1/0)),i+=g,t=b+x,("<"===u?i+t+E:">"===u?E+i+t:"^"===u?E.substring(0,k>>=1)+i+t+E.substring(k):i+(_?t:E+t))+n}}}function Rt(t){return t+""}function jt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Yt(t,e,n){function r(e){var n=t(e),r=a(n,1);return r-e>e-n?n:r}function i(n){return e(n=t(new co(n-1)),1),n}function a(t,n){return e(t=new co(+t),n),t}function u(t,r,a){var u=i(t),o=[];if(a>1)for(;r>u;)n(u)%a||o.push(new Date(+u)),e(u,1);else for(;r>u;)o.push(new Date(+u)),e(u,1);return o}function o(t,e,n){try{co=jt;var r=new jt;return r._=t,u(r,e,n)}finally{co=Date}}t.floor=t,t.round=r,t.ceil=i,t.offset=a,t.range=u;var s=t.utc=Ut(t);return s.floor=s,s.round=Ut(r),s.ceil=Ut(i),s.offset=Ut(a),s.range=o,t}function Ut(t){return function(e,n){try{co=jt;var r=new jt;return r._=e,t(r,n)._}finally{co=Date}}}function $t(t){function e(t){function e(e){for(var n,i,a,u=[],o=-1,s=0;++oo;){if(r>=c)return-1;if(i=e.charCodeAt(o++),37===i){if(u=e.charAt(o++),a=S[u in ho?e.charAt(o++):u],!a||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function r(t,e,n){w.lastIndex=0;var r=w.exec(e.slice(n));return r?(t.w=A.get(r[0].toLowerCase()),n+r[0].length):-1}function i(t,e,n){b.lastIndex=0;var r=b.exec(e.slice(n));return r?(t.w=x.get(r[0].toLowerCase()),n+r[0].length):-1}function a(t,e,n){M.lastIndex=0;var r=M.exec(e.slice(n));return r?(t.m=D.get(r[0].toLowerCase()),n+r[0].length):-1}function u(t,e,n){k.lastIndex=0;var r=k.exec(e.slice(n));return r?(t.m=E.get(r[0].toLowerCase()),n+r[0].length):-1}function o(t,e,r){return n(t,C.c.toString(),e,r)}function s(t,e,r){return n(t,C.x.toString(),e,r)}function c(t,e,r){return n(t,C.X.toString(),e,r)}function l(t,e,n){var r=_.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}var h=t.dateTime,f=t.date,d=t.time,p=t.periods,g=t.days,y=t.shortDays,m=t.months,v=t.shortMonths;e.utc=function(t){function n(t){try{co=jt;var e=new co;return e._=t,r(e)}finally{co=Date}}var r=e(t);return n.parse=function(t){try{co=jt;var e=r.parse(t);return e&&e._}finally{co=Date}},n.toString=r.toString,n},e.multi=e.utc.multi=se;var _=nu.map(),b=qt(g),x=Gt(g),w=qt(y),A=Gt(y),k=qt(m),E=Gt(m),M=qt(v),D=Gt(v);p.forEach(function(t,e){_.set(t.toLowerCase(),e)});var C={a:function(t){return y[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return v[t.getMonth()]},B:function(t){return m[t.getMonth()]},c:e(h),d:function(t,e){return zt(t.getDate(),e,2)},e:function(t,e){return zt(t.getDate(),e,2)},H:function(t,e){return zt(t.getHours(),e,2)},I:function(t,e){return zt(t.getHours()%12||12,e,2)},j:function(t,e){return zt(1+so.dayOfYear(t),e,3)},L:function(t,e){return zt(t.getMilliseconds(),e,3)},m:function(t,e){return zt(t.getMonth()+1,e,2)},M:function(t,e){return zt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return zt(t.getSeconds(),e,2)},U:function(t,e){return zt(so.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return zt(so.mondayOfYear(t),e,2)},x:e(f),X:e(d),y:function(t,e){return zt(t.getFullYear()%100,e,2)},Y:function(t,e){return zt(t.getFullYear()%1e4,e,4)},Z:ue,"%":function(){return"%"}},S={a:r,A:i,b:a,B:u,c:o,d:te,e:te,H:ne,I:ne,j:ee,L:ae,m:Jt,M:re,p:l,S:ie,U:Ht,w:Wt,W:Vt,x:s,X:c,y:Zt,Y:Xt,Z:Kt,"%":oe};return e}function zt(t,e,n){var r=0>t?"-":"",i=(r?-t:t)+"",a=i.length;return r+(n>a?new Array(n-a+1).join(e)+i:i)}function qt(t){return new RegExp("^(?:"+t.map(nu.requote).join("|")+")","i")}function Gt(t){for(var e=new l,n=-1,r=t.length;++n68?1900:2e3)}function Jt(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function te(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function ee(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function ne(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function re(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function ie(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function ae(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function ue(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=pu(e)/60|0,i=pu(e)%60;return n+zt(r,"0",2)+zt(i,"0",2)}function oe(t,e,n){po.lastIndex=0;var r=po.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function se(t){for(var e=t.length,n=-1;++n=0?1:-1,o=u*n,s=Math.cos(e),c=Math.sin(e),l=a*c,h=i*s+l*Math.cos(o),f=l*u*Math.sin(o);bo.add(Math.atan2(f,h)),r=t,i=s,a=c}var e,n,r,i,a;xo.point=function(u,o){xo.point=t,r=(e=u)*Ou,i=Math.cos(o=(n=o)*Ou/2+Bu/4),a=Math.sin(o)},xo.lineEnd=function(){t(e,n)}}function ge(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function ye(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function me(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ve(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function _e(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function be(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function xe(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function we(t,e){return pu(t[0]-e[0])o;++o)i.point((n=t[o])[0],n[1]);return void i.lineEnd()}var s=new Be(n,t,null,!0),c=new Be(n,null,s,!1);s.o=c,a.push(s),u.push(c),s=new Be(r,t,null,!1),c=new Be(r,null,s,!0),s.o=c,a.push(s),u.push(c)}}),u.sort(e),Fe(a),Fe(u),a.length){for(var o=0,s=n,c=u.length;c>o;++o)u[o].e=s=!s;for(var l,h,f=a[0];;){for(var d=f,p=!0;d.v;)if((d=d.n)===f)return;l=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(p)for(var o=0,c=l.length;c>o;++o)i.point((h=l[o])[0],h[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(p){l=d.p.z;for(var o=l.length-1;o>=0;--o)i.point((h=l[o])[0],h[1])}else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,l=d.z,p=!p}while(!d.v);i.lineEnd()}}}function Fe(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r0){for(x||(a.polygonStart(),x=!0),a.lineStart();++u1&&2&e&&n.push(n.pop().concat(n.shift())),d.push(n.filter(Ie))}var d,p,g,y=e(a),m=i.invert(r[0],r[1]),v={point:u,lineStart:s,lineEnd:c,polygonStart:function(){v.point=l,v.lineStart=h,v.lineEnd=f,d=[],p=[]},polygonEnd:function(){v.point=u,v.lineStart=s,v.lineEnd=c,d=nu.merge(d);var t=Ye(m,p);d.length?(x||(a.polygonStart(),x=!0),Te(d,Oe,t,n,a)):t&&(x||(a.polygonStart(),x=!0),a.lineStart(),n(null,null,1,a),a.lineEnd()),x&&(a.polygonEnd(),x=!1),d=p=null},sphere:function(){a.polygonStart(),a.lineStart(),n(null,null,1,a),a.lineEnd(),a.polygonEnd()}},_=Ne(),b=e(_),x=!1;return v}}function Ie(t){return t.length>1}function Ne(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:w,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Oe(t,e){return((t=t.x)[0]<0?t[1]-Nu-Tu:Nu-t[1])-((e=e.x)[0]<0?e[1]-Nu-Tu:Nu-e[1])}function Pe(t){var e,n=0/0,r=0/0,i=0/0;return{lineStart:function(){t.lineStart(),e=1},point:function(a,u){var o=a>0?Bu:-Bu,s=pu(a-n);pu(s-Bu)0?Nu:-Nu),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(o,r),t.point(a,r),e=0):i!==o&&s>=Bu&&(pu(n-i)Tu?Math.atan((Math.sin(e)*(a=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*a*u)):(e+r)/2}function je(t,e,n,r){var i;if(null==t)i=n*Nu,r.point(-Bu,i),r.point(0,i),r.point(Bu,i),r.point(Bu,0),r.point(Bu,-i),r.point(0,-i),r.point(-Bu,-i),r.point(-Bu,0),r.point(-Bu,i);else if(pu(t[0]-e[0])>Tu){var a=t[0]o;++o){var c=e[o],l=c.length;if(l)for(var h=c[0],f=h[0],d=h[1]/2+Bu/4,p=Math.sin(d),g=Math.cos(d),y=1;;){y===l&&(y=0),t=c[y];var m=t[0],v=t[1]/2+Bu/4,_=Math.sin(v),b=Math.cos(v),x=m-f,w=x>=0?1:-1,A=w*x,k=A>Bu,E=p*_;if(bo.add(Math.atan2(E*w*Math.sin(A),g*b+E*Math.cos(A))),a+=k?x+w*Lu:x,k^f>=n^m>=n){var M=me(ge(h),ge(t));be(M);var D=me(i,M);be(D);var C=(k^x>=0?-1:1)*nt(D[2]);(r>C||r===C&&(M[0]||M[1]))&&(u+=k^x>=0?1:-1)}if(!y++)break;f=m,p=_,g=b,h=t}}return(-Tu>a||Tu>a&&0>bo)^1&u}function Ue(t){function e(t,e){return Math.cos(t)*Math.cos(e)>a}function n(t){var n,a,s,c,l;return{lineStart:function(){c=s=!1,l=1},point:function(h,f){var d,p=[h,f],g=e(h,f),y=u?g?0:i(h,f):g?i(h+(0>h?Bu:-Bu),f):0;if(!n&&(c=s=g)&&t.lineStart(),g!==s&&(d=r(n,p),(we(n,d)||we(p,d))&&(p[0]+=Tu,p[1]+=Tu,g=e(p[0],p[1]))),g!==s)l=0,g?(t.lineStart(),d=r(p,n),t.point(d[0],d[1])):(d=r(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(o&&n&&u^g){var m;y&a||!(m=r(p,n,!0))||(l=0,u?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||n&&we(n,p)||t.point(p[0],p[1]),n=p,s=g,a=y},lineEnd:function(){s&&t.lineEnd(),n=null},clean:function(){return l|(c&&s)<<1}}}function r(t,e,n){var r=ge(t),i=ge(e),u=[1,0,0],o=me(r,i),s=ye(o,o),c=o[0],l=s-c*c;if(!l)return!n&&t;var h=a*s/l,f=-a*c/l,d=me(u,o),p=_e(u,h),g=_e(o,f);ve(p,g);var y=d,m=ye(p,y),v=ye(y,y),_=m*m-v*(ye(p,p)-1);if(!(0>_)){var b=Math.sqrt(_),x=_e(y,(-m-b)/v);if(ve(x,p),x=xe(x),!n)return x;var w,A=t[0],k=e[0],E=t[1],M=e[1];A>k&&(w=A,A=k,k=w);var D=k-A,C=pu(D-Bu)D;if(!C&&E>M&&(w=E,E=M,M=w),S?C?E+M>0^x[1]<(pu(x[0]-A)Bu^(A<=x[0]&&x[0]<=k)){var T=_e(y,(-m+b)/v);return ve(T,p),[x,xe(T)]}}}function i(e,n){var r=u?t:Bu-t,i=0;return-r>e?i|=1:e>r&&(i|=2),-r>n?i|=4:n>r&&(i|=8),i}var a=Math.cos(t),u=a>0,o=pu(a)>Tu,s=gn(t,6*Ou);return Le(e,n,s,u?[0,-t]:[-Bu,t-Bu])}function $e(t,e,n,r){return function(i){var a,u=i.a,o=i.b,s=u.x,c=u.y,l=o.x,h=o.y,f=0,d=1,p=l-s,g=h-c;if(a=t-s,p||!(a>0)){if(a/=p,0>p){if(f>a)return;d>a&&(d=a)}else if(p>0){if(a>d)return;a>f&&(f=a)}if(a=n-s,p||!(0>a)){if(a/=p,0>p){if(a>d)return;a>f&&(f=a)}else if(p>0){if(f>a)return;d>a&&(d=a)}if(a=e-c,g||!(a>0)){if(a/=g,0>g){if(f>a)return;d>a&&(d=a)}else if(g>0){if(a>d)return;a>f&&(f=a)}if(a=r-c,g||!(0>a)){if(a/=g,0>g){if(a>d)return;a>f&&(f=a)}else if(g>0){if(f>a)return;d>a&&(d=a)}return f>0&&(i.a={x:s+f*p,y:c+f*g}),1>d&&(i.b={x:s+d*p,y:c+d*g}),i}}}}}}function ze(t,e,n,r){function i(r,i){return pu(r[0]-t)0?0:3:pu(r[0]-n)0?2:1:pu(r[1]-e)0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=i(t,1),r=i(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]; +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.mermaidAPI=t()}}(function(){var define,module,exports;return function t(e,n,r){function i(u,o){if(!n[u]){if(!e[u]){var s="function"==typeof require&&require;if(!o&&s)return s(u,!0);if(a)return a(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[u]={exports:{}};e[u][0].call(l.exports,function(t){var n=e[u][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[u].exports}for(var a="function"==typeof require&&require,u=0;ut?-1:t>e?1:t>=e?0:0/0}function i(t){return null===t?0/0:+t}function a(t){return!isNaN(t)}function u(t){return{left:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var a=r+i>>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var a=r+i>>>1;t(e[a],n)>0?i=a:r=a+1}return r}}}function o(t){return t.length}function s(t){for(var e=1;t*e%1;)e*=10;return e}function c(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function l(){this._=Object.create(null)}function h(t){return(t+="")===gu||t[0]===yu?yu+t:t}function f(t){return(t+="")[0]===yu?t.slice(1):t}function d(t){return h(t)in this._}function p(t){return(t=h(t))in this._&&delete this._[t]}function g(){var t=[];for(var e in this._)t.push(f(e));return t}function y(){var t=0;for(var e in this._)++t;return t}function m(){for(var t in this._)return!1;return!0}function v(){this._=Object.create(null)}function _(t){return t}function b(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function x(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=mu.length;r>n;++n){var i=mu[n]+e;if(i in t)return i}}function w(){}function A(){}function k(t){function e(){for(var e,r=n,i=-1,a=r.length;++in;n++)for(var i,a=t[n],u=0,o=a.length;o>u;u++)(i=a[u])&&e(i,u,n);return t}function q(t){return _u(t,Eu),t}function V(t){var e,n;return function(r,i,a){var u,o=t[a].update,s=o.length;for(a!=n&&(n=a,e=0),i>=e&&(e=i+1);!(u=o[e])&&++e0&&(t=t.slice(0,o));var c=Mu.get(t);return c&&(t=c,s=X),o?e?i:r:e?w:a}function G(t,e){return function(n){var r=nu.event;nu.event=n,e[0]=this.__data__;try{t.apply(this,e)}finally{nu.event=r}}}function X(t,e){var n=G(t,e);return function(t){var e=this,r=t.relatedTarget;r&&(r===e||8&r.compareDocumentPosition(e))||n.call(e,t)}}function Z(e){var r=".dragsuppress-"+ ++Su,i="click"+r,a=nu.select(n(e)).on("touchmove"+r,E).on("dragstart"+r,E).on("selectstart"+r,E);if(null==Du&&(Du="onselectstart"in e?!1:x(e.style,"userSelect")),Du){var u=t(e).style,o=u[Du];u[Du]="none"}return function(t){if(a.on(r,null),Du&&(u[Du]=o),t){var e=function(){a.on(i,null)};a.on(i,function(){E(),e()},!0),setTimeout(e,0)}}}function K(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>Cu){var a=n(t);if(a.scrollX||a.scrollY){r=nu.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=r[0][0].getScreenCTM();Cu=!(u.f||u.e),r.remove()}}return Cu?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}function Q(){return nu.event.changedTouches[0].identifier}function J(t){return t>0?1:0>t?-1:0}function tt(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function et(t){return t>1?0:-1>t?Bu:Math.acos(t)}function nt(t){return t>1?Nu:-1>t?-Nu:Math.asin(t)}function rt(t){return((t=Math.exp(t))-1/t)/2}function it(t){return((t=Math.exp(t))+1/t)/2}function at(t){return((t=Math.exp(2*t))-1)/(t+1)}function ut(t){return(t=Math.sin(t/2))*t}function ot(){}function st(t,e,n){return this instanceof st?(this.h=+t,this.s=+e,void(this.l=+n)):arguments.length<2?t instanceof st?new st(t.h,t.s,t.l):wt(""+t,At,st):new st(t,e,n)}function ct(t,e,n){function r(t){return t>360?t-=360:0>t&&(t+=360),60>t?a+(u-a)*t/60:180>t?u:240>t?a+(u-a)*(240-t)/60:a}function i(t){return Math.round(255*r(t))}var a,u;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:0>e?0:e>1?1:e,n=0>n?0:n>1?1:n,u=.5>=n?n*(1+e):n+e-n*e,a=2*n-u,new vt(i(t+120),i(t),i(t-120))}function lt(t,e,n){return this instanceof lt?(this.h=+t,this.c=+e,void(this.l=+n)):arguments.length<2?t instanceof lt?new lt(t.h,t.c,t.l):t instanceof ft?pt(t.l,t.a,t.b):pt((t=kt((t=nu.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new lt(t,e,n)}function ht(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ft(n,Math.cos(t*=Ou)*e,Math.sin(t)*e)}function ft(t,e,n){return this instanceof ft?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof ft?new ft(t.l,t.a,t.b):t instanceof lt?ht(t.h,t.c,t.l):kt((t=vt(t)).r,t.g,t.b):new ft(t,e,n)}function dt(t,e,n){var r=(t+16)/116,i=r+e/500,a=r-n/200;return i=gt(i)*Hu,r=gt(r)*Gu,a=gt(a)*Xu,new vt(mt(3.2404542*i-1.5371385*r-.4985314*a),mt(-.969266*i+1.8760108*r+.041556*a),mt(.0556434*i-.2040259*r+1.0572252*a))}function pt(t,e,n){return t>0?new lt(Math.atan2(n,e)*Pu,Math.sqrt(e*e+n*n),t):new lt(0/0,0/0,t)}function gt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function yt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function mt(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function vt(t,e,n){return this instanceof vt?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof vt?new vt(t.r,t.g,t.b):wt(""+t,vt,ct):new vt(t,e,n)}function _t(t){return new vt(t>>16,t>>8&255,255&t)}function bt(t){return _t(t)+""}function xt(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function wt(t,e,n){t=t.toLowerCase();var r,i,a,u=0,o=0,s=0;if(r=/([a-z]+)\((.*)\)/.exec(t))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(Mt(i[0]),Mt(i[1]),Mt(i[2]))}return(a=Qu.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(u=(3840&a)>>4,u=u>>4|u,o=240&a,o=o>>4|o,s=15&a,s=s<<4|s):7===t.length&&(u=(16711680&a)>>16,o=(65280&a)>>8,s=255&a)),e(u,o,s))}function At(t,e,n){var r,i,a=Math.min(t/=255,e/=255,n/=255),u=Math.max(t,e,n),o=u-a,s=(u+a)/2;return o?(i=.5>s?o/(u+a):o/(2-u-a),r=t==u?(e-n)/o+(n>e?6:0):e==u?(n-t)/o+2:(t-e)/o+4,r*=60):(r=0/0,i=s>0&&1>s?0:r),new st(r,i,s)}function kt(t,e,n){t=Et(t),e=Et(e),n=Et(n);var r=yt((.4124564*t+.3575761*e+.1804375*n)/Hu),i=yt((.2126729*t+.7151522*e+.072175*n)/Gu),a=yt((.0193339*t+.119192*e+.9503041*n)/Xu);return ft(116*i-16,500*(r-i),200*(i-a))}function Et(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Mt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Dt(t){return"function"==typeof t?t:function(){return t}}function St(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),Ct(e,n,t,r)}}function Ct(t,e,n,r){function i(){var t,e=s.status;if(!e&&Ft(s)||e>=200&&300>e||304===e){try{t=n.call(a,s)}catch(r){return void u.error.call(a,r)}u.load.call(a,t)}else u.error.call(a,s)}var a={},u=nu.dispatch("beforesend","progress","load","error"),o={},s=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(t)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=i:s.onreadystatechange=function(){s.readyState>3&&i()},s.onprogress=function(t){var e=nu.event;nu.event=t;try{u.progress.call(a,s)}finally{nu.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?o[t]:(null==e?delete o[t]:o[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(c=t,a):c},a.response=function(t){return n=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(iu(arguments)))}}),a.send=function(n,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),s.open(n,t,!0),null==e||"accept"in o||(o.accept=e+",*/*"),s.setRequestHeader)for(var l in o)s.setRequestHeader(l,o[l]);return null!=e&&s.overrideMimeType&&s.overrideMimeType(e),null!=c&&(s.responseType=c),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),u.beforesend.call(a,s),s.send(null==r?null:r),a},a.abort=function(){return s.abort(),a},nu.rebind(a,u,"on"),null==r?a:a.get(Tt(r))}function Tt(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Ft(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Bt(){var t=Lt(),e=It()-t;e>24?(isFinite(e)&&(clearTimeout(no),no=setTimeout(Bt,e)),eo=0):(eo=1,io(Bt))}function Lt(){var t=Date.now();for(ro=Ju;ro;)t>=ro.t&&(ro.f=ro.c(t-ro.t)),ro=ro.n;return t}function It(){for(var t,e=Ju,n=1/0;e;)e.f?e=t?t.n=e.n:Ju=e.n:(e.t8?function(t){return t/n}:function(t){return t*n},symbol:t}}function Pt(t){var e=t.decimal,n=t.thousands,r=t.grouping,i=t.currency,a=r&&n?function(t,e){for(var i=t.length,a=[],u=0,o=r[0],s=0;i>0&&o>0&&(s+o+1>e&&(o=Math.max(1,e-s)),a.push(t.substring(i-=o,i+o)),!((s+=o+1)>e));)o=r[u=(u+1)%r.length];return a.reverse().join(n)}:_;return function(t){var n=uo.exec(t),r=n[1]||" ",u=n[2]||">",o=n[3]||"-",s=n[4]||"",c=n[5],l=+n[6],h=n[7],f=n[8],d=n[9],p=1,g="",y="",m=!1,v=!0;switch(f&&(f=+f.substring(1)),(c||"0"===r&&"="===u)&&(c=r="0",u="="),d){case"n":h=!0,d="g";break;case"%":p=100,y="%",d="f";break;case"p":p=100,y="%",d="r";break;case"b":case"o":case"x":case"X":"#"===s&&(g="0"+d.toLowerCase());case"c":v=!1;case"d":m=!0,f=0;break;case"s":p=-1,d="r"}"$"===s&&(g=i[0],y=i[1]),"r"!=d||f||(d="g"),null!=f&&("g"==d?f=Math.max(1,Math.min(21,f)):("e"==d||"f"==d)&&(f=Math.max(0,Math.min(20,f)))),d=oo.get(d)||Rt;var _=c&&h;return function(t){var n=y;if(m&&t%1)return"";var i=0>t||0===t&&0>1/t?(t=-t,"-"):"-"===o?"":o;if(0>p){var s=nu.formatPrefix(t,f);t=s.scale(t),n=s.symbol+y}else t*=p;t=d(t,f);var b,x,w=t.lastIndexOf(".");if(0>w){var A=v?t.lastIndexOf("e"):-1;0>A?(b=t,x=""):(b=t.substring(0,A),x=t.substring(A))}else b=t.substring(0,w),x=e+t.substring(w+1);!c&&h&&(b=a(b,1/0));var k=g.length+b.length+x.length+(_?0:i.length),E=l>k?new Array(k=l-k+1).join(r):"";return _&&(b=a(E+b,E.length?l-x.length:1/0)),i+=g,t=b+x,("<"===u?i+t+E:">"===u?E+i+t:"^"===u?E.substring(0,k>>=1)+i+t+E.substring(k):i+(_?t:E+t))+n}}}function Rt(t){return t+""}function jt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Yt(t,e,n){function r(e){var n=t(e),r=a(n,1);return r-e>e-n?n:r}function i(n){return e(n=t(new co(n-1)),1),n}function a(t,n){return e(t=new co(+t),n),t}function u(t,r,a){var u=i(t),o=[];if(a>1)for(;r>u;)n(u)%a||o.push(new Date(+u)),e(u,1);else for(;r>u;)o.push(new Date(+u)),e(u,1);return o}function o(t,e,n){try{co=jt;var r=new jt;return r._=t,u(r,e,n)}finally{co=Date}}t.floor=t,t.round=r,t.ceil=i,t.offset=a,t.range=u;var s=t.utc=Ut(t);return s.floor=s,s.round=Ut(r),s.ceil=Ut(i),s.offset=Ut(a),s.range=o,t}function Ut(t){return function(e,n){try{co=jt;var r=new jt;return r._=e,t(r,n)._}finally{co=Date}}}function $t(t){function e(t){function e(e){for(var n,i,a,u=[],o=-1,s=0;++oo;){if(r>=c)return-1;if(i=e.charCodeAt(o++),37===i){if(u=e.charAt(o++),a=C[u in ho?e.charAt(o++):u],!a||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function r(t,e,n){w.lastIndex=0;var r=w.exec(e.slice(n));return r?(t.w=A.get(r[0].toLowerCase()),n+r[0].length):-1}function i(t,e,n){b.lastIndex=0;var r=b.exec(e.slice(n));return r?(t.w=x.get(r[0].toLowerCase()),n+r[0].length):-1}function a(t,e,n){M.lastIndex=0;var r=M.exec(e.slice(n));return r?(t.m=D.get(r[0].toLowerCase()),n+r[0].length):-1}function u(t,e,n){k.lastIndex=0;var r=k.exec(e.slice(n));return r?(t.m=E.get(r[0].toLowerCase()),n+r[0].length):-1}function o(t,e,r){return n(t,S.c.toString(),e,r)}function s(t,e,r){return n(t,S.x.toString(),e,r)}function c(t,e,r){return n(t,S.X.toString(),e,r)}function l(t,e,n){var r=_.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}var h=t.dateTime,f=t.date,d=t.time,p=t.periods,g=t.days,y=t.shortDays,m=t.months,v=t.shortMonths;e.utc=function(t){function n(t){try{co=jt;var e=new co;return e._=t,r(e)}finally{co=Date}}var r=e(t);return n.parse=function(t){try{co=jt;var e=r.parse(t);return e&&e._}finally{co=Date}},n.toString=r.toString,n},e.multi=e.utc.multi=se;var _=nu.map(),b=Wt(g),x=qt(g),w=Wt(y),A=qt(y),k=Wt(m),E=qt(m),M=Wt(v),D=qt(v);p.forEach(function(t,e){_.set(t.toLowerCase(),e)});var S={a:function(t){return y[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return v[t.getMonth()]},B:function(t){return m[t.getMonth()]},c:e(h),d:function(t,e){return zt(t.getDate(),e,2)},e:function(t,e){return zt(t.getDate(),e,2)},H:function(t,e){return zt(t.getHours(),e,2)},I:function(t,e){return zt(t.getHours()%12||12,e,2)},j:function(t,e){return zt(1+so.dayOfYear(t),e,3)},L:function(t,e){return zt(t.getMilliseconds(),e,3)},m:function(t,e){return zt(t.getMonth()+1,e,2)},M:function(t,e){return zt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return zt(t.getSeconds(),e,2)},U:function(t,e){return zt(so.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return zt(so.mondayOfYear(t),e,2)},x:e(f),X:e(d),y:function(t,e){return zt(t.getFullYear()%100,e,2)},Y:function(t,e){return zt(t.getFullYear()%1e4,e,4)},Z:ue,"%":function(){return"%"}},C={a:r,A:i,b:a,B:u,c:o,d:te,e:te,H:ne,I:ne,j:ee,L:ae,m:Jt,M:re,p:l,S:ie,U:Ht,w:Vt,W:Gt,x:s,X:c,y:Zt,Y:Xt,Z:Kt,"%":oe};return e}function zt(t,e,n){var r=0>t?"-":"",i=(r?-t:t)+"",a=i.length;return r+(n>a?new Array(n-a+1).join(e)+i:i)}function Wt(t){return new RegExp("^(?:"+t.map(nu.requote).join("|")+")","i")}function qt(t){for(var e=new l,n=-1,r=t.length;++n68?1900:2e3)}function Jt(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function te(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function ee(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function ne(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function re(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function ie(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function ae(t,e,n){fo.lastIndex=0;var r=fo.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function ue(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=pu(e)/60|0,i=pu(e)%60;return n+zt(r,"0",2)+zt(i,"0",2)}function oe(t,e,n){po.lastIndex=0;var r=po.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function se(t){for(var e=t.length,n=-1;++n=0?1:-1,o=u*n,s=Math.cos(e),c=Math.sin(e),l=a*c,h=i*s+l*Math.cos(o),f=l*u*Math.sin(o);bo.add(Math.atan2(f,h)),r=t,i=s,a=c}var e,n,r,i,a;xo.point=function(u,o){xo.point=t,r=(e=u)*Ou,i=Math.cos(o=(n=o)*Ou/2+Bu/4),a=Math.sin(o)},xo.lineEnd=function(){t(e,n)}}function ge(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function ye(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function me(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ve(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function _e(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function be(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function xe(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function we(t,e){return pu(t[0]-e[0])o;++o)i.point((n=t[o])[0],n[1]);return void i.lineEnd()}var s=new Be(n,t,null,!0),c=new Be(n,null,s,!1);s.o=c,a.push(s),u.push(c),s=new Be(r,t,null,!1),c=new Be(r,null,s,!0),s.o=c,a.push(s),u.push(c)}}),u.sort(e),Fe(a),Fe(u),a.length){for(var o=0,s=n,c=u.length;c>o;++o)u[o].e=s=!s;for(var l,h,f=a[0];;){for(var d=f,p=!0;d.v;)if((d=d.n)===f)return;l=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(p)for(var o=0,c=l.length;c>o;++o)i.point((h=l[o])[0],h[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(p){l=d.p.z;for(var o=l.length-1;o>=0;--o)i.point((h=l[o])[0],h[1])}else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,l=d.z,p=!p}while(!d.v);i.lineEnd()}}}function Fe(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r0){for(x||(a.polygonStart(),x=!0),a.lineStart();++u1&&2&e&&n.push(n.pop().concat(n.shift())),d.push(n.filter(Ie))}var d,p,g,y=e(a),m=i.invert(r[0],r[1]),v={point:u,lineStart:s,lineEnd:c,polygonStart:function(){v.point=l,v.lineStart=h,v.lineEnd=f,d=[],p=[]},polygonEnd:function(){v.point=u,v.lineStart=s,v.lineEnd=c,d=nu.merge(d);var t=Ye(m,p);d.length?(x||(a.polygonStart(),x=!0),Te(d,Oe,t,n,a)):t&&(x||(a.polygonStart(),x=!0),a.lineStart(),n(null,null,1,a),a.lineEnd()),x&&(a.polygonEnd(),x=!1),d=p=null},sphere:function(){a.polygonStart(),a.lineStart(),n(null,null,1,a),a.lineEnd(),a.polygonEnd()}},_=Ne(),b=e(_),x=!1;return v}}function Ie(t){return t.length>1}function Ne(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:w,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Oe(t,e){return((t=t.x)[0]<0?t[1]-Nu-Tu:Nu-t[1])-((e=e.x)[0]<0?e[1]-Nu-Tu:Nu-e[1])}function Pe(t){var e,n=0/0,r=0/0,i=0/0;return{lineStart:function(){t.lineStart(),e=1},point:function(a,u){var o=a>0?Bu:-Bu,s=pu(a-n);pu(s-Bu)0?Nu:-Nu),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(o,r),t.point(a,r),e=0):i!==o&&s>=Bu&&(pu(n-i)Tu?Math.atan((Math.sin(e)*(a=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*a*u)):(e+r)/2}function je(t,e,n,r){var i;if(null==t)i=n*Nu,r.point(-Bu,i),r.point(0,i),r.point(Bu,i),r.point(Bu,0),r.point(Bu,-i),r.point(0,-i),r.point(-Bu,-i),r.point(-Bu,0),r.point(-Bu,i);else if(pu(t[0]-e[0])>Tu){var a=t[0]o;++o){var c=e[o],l=c.length;if(l)for(var h=c[0],f=h[0],d=h[1]/2+Bu/4,p=Math.sin(d),g=Math.cos(d),y=1;;){y===l&&(y=0),t=c[y];var m=t[0],v=t[1]/2+Bu/4,_=Math.sin(v),b=Math.cos(v),x=m-f,w=x>=0?1:-1,A=w*x,k=A>Bu,E=p*_;if(bo.add(Math.atan2(E*w*Math.sin(A),g*b+E*Math.cos(A))),a+=k?x+w*Lu:x,k^f>=n^m>=n){var M=me(ge(h),ge(t));be(M);var D=me(i,M);be(D);var S=(k^x>=0?-1:1)*nt(D[2]);(r>S||r===S&&(M[0]||M[1]))&&(u+=k^x>=0?1:-1)}if(!y++)break;f=m,p=_,g=b,h=t}}return(-Tu>a||Tu>a&&0>bo)^1&u}function Ue(t){function e(t,e){return Math.cos(t)*Math.cos(e)>a}function n(t){var n,a,s,c,l;return{lineStart:function(){c=s=!1,l=1},point:function(h,f){var d,p=[h,f],g=e(h,f),y=u?g?0:i(h,f):g?i(h+(0>h?Bu:-Bu),f):0;if(!n&&(c=s=g)&&t.lineStart(),g!==s&&(d=r(n,p),(we(n,d)||we(p,d))&&(p[0]+=Tu,p[1]+=Tu,g=e(p[0],p[1]))),g!==s)l=0,g?(t.lineStart(),d=r(p,n),t.point(d[0],d[1])):(d=r(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(o&&n&&u^g){var m;y&a||!(m=r(p,n,!0))||(l=0,u?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||n&&we(n,p)||t.point(p[0],p[1]),n=p,s=g,a=y},lineEnd:function(){s&&t.lineEnd(),n=null},clean:function(){return l|(c&&s)<<1}}}function r(t,e,n){var r=ge(t),i=ge(e),u=[1,0,0],o=me(r,i),s=ye(o,o),c=o[0],l=s-c*c;if(!l)return!n&&t;var h=a*s/l,f=-a*c/l,d=me(u,o),p=_e(u,h),g=_e(o,f);ve(p,g);var y=d,m=ye(p,y),v=ye(y,y),_=m*m-v*(ye(p,p)-1);if(!(0>_)){var b=Math.sqrt(_),x=_e(y,(-m-b)/v);if(ve(x,p),x=xe(x),!n)return x;var w,A=t[0],k=e[0],E=t[1],M=e[1];A>k&&(w=A,A=k,k=w);var D=k-A,S=pu(D-Bu)D;if(!S&&E>M&&(w=E,E=M,M=w),C?S?E+M>0^x[1]<(pu(x[0]-A)Bu^(A<=x[0]&&x[0]<=k)){var T=_e(y,(-m+b)/v);return ve(T,p),[x,xe(T)]}}}function i(e,n){var r=u?t:Bu-t,i=0;return-r>e?i|=1:e>r&&(i|=2),-r>n?i|=4:n>r&&(i|=8),i}var a=Math.cos(t),u=a>0,o=pu(a)>Tu,s=gn(t,6*Ou);return Le(e,n,s,u?[0,-t]:[-Bu,t-Bu])}function $e(t,e,n,r){return function(i){var a,u=i.a,o=i.b,s=u.x,c=u.y,l=o.x,h=o.y,f=0,d=1,p=l-s,g=h-c;if(a=t-s,p||!(a>0)){if(a/=p,0>p){if(f>a)return;d>a&&(d=a)}else if(p>0){if(a>d)return;a>f&&(f=a)}if(a=n-s,p||!(0>a)){if(a/=p,0>p){if(a>d)return;a>f&&(f=a)}else if(p>0){if(f>a)return;d>a&&(d=a)}if(a=e-c,g||!(a>0)){if(a/=g,0>g){if(f>a)return;d>a&&(d=a)}else if(g>0){if(a>d)return;a>f&&(f=a)}if(a=r-c,g||!(0>a)){if(a/=g,0>g){if(a>d)return;a>f&&(f=a)}else if(g>0){if(f>a)return;d>a&&(d=a)}return f>0&&(i.a={x:s+f*p,y:c+f*g}),1>d&&(i.b={x:s+d*p,y:c+d*g}),i}}}}}}function ze(t,e,n,r){function i(r,i){return pu(r[0]-t)0?0:3:pu(r[0]-n)0?2:1:pu(r[1]-e)0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=i(t,1),r=i(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){function s(t){for(var e=0,n=y.length,r=t[1],i=0;n>i;++i)for(var a,u=1,o=y[i],s=o.length,c=o[0];s>u;++u)a=o[u],c[1]<=r?a[1]>r&&tt(c,a,t)>0&&++e:a[1]<=r&&tt(c,a,t)<0&&--e,c=a;return 0!==e}function c(a,o,s,c){var l=0,h=0;if(null==a||(l=i(a,s))!==(h=i(o,s))||u(a,o)<0^s>0){do c.point(0===l||3===l?t:n,l>1?r:e);while((l=(l+s+4)%4)!==h)}else c.point(o[0],o[1])}function l(i,a){return i>=t&&n>=i&&a>=e&&r>=a}function h(t,e){l(t,e)&&o.point(t,e)}function f(){C.point=p,y&&y.push(m=[]),k=!0,A=!1,x=w=0/0}function d(){g&&(p(v,_),b&&A&&D.rejoin(),g.push(D.buffer())),C.point=h,A&&o.lineEnd()}function p(t,e){t=Math.max(-No,Math.min(No,t)),e=Math.max(-No,Math.min(No,e));var n=l(t,e);if(y&&m.push([t,e]),k)v=t,_=e,b=n,k=!1,n&&(o.lineStart(),o.point(t,e));else if(n&&A)o.point(t,e);else{var r={a:{x:x,y:w},b:{x:t,y:e}};S(r)?(A||(o.lineStart(),o.point(r.a.x,r.a.y)),o.point(r.b.x,r.b.y),n||o.lineEnd(),E=!1):n&&(o.lineStart(),o.point(t,e),E=!1)}x=t,w=e,A=n}var g,y,m,v,_,b,x,w,A,k,E,M=o,D=Ne(),S=$e(t,e,n,r),C={point:h,lineStart:f,lineEnd:d,polygonStart:function(){o=D,g=[],y=[],E=!0},polygonEnd:function(){o=M,g=nu.merge(g);var e=s([t,r]),n=E&&e,i=g.length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),c(null,null,1,o),o.lineEnd()),i&&Te(g,a,e,c,o),o.polygonEnd()),g=y=m=null}};return C}}function We(t){var e=0,n=Bu/3,r=on(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Bu/180,n=t[1]*Bu/180):[e/Bu*180,n/Bu*180]},i}function qe(t,e){function n(t,e){var n=Math.sqrt(a-2*i*Math.sin(e))/i;return[n*Math.sin(t*=i),u-n*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(e))/2,a=1+r*(2*i-r),u=Math.sqrt(a)/i;return n.invert=function(t,e){var n=u-e;return[Math.atan2(t,n)/i,nt((a-(t*t+n*n)*i*i)/(2*i))]},n}function Ve(){function t(t,e){Po+=i*t-r*e,r=t,i=e}var e,n,r,i;$o.point=function(a,u){$o.point=t,e=r=a,n=i=u},$o.lineEnd=function(){t(e,n)}}function He(t,e){Ro>t&&(Ro=t),t>Yo&&(Yo=t),jo>e&&(jo=e),e>Uo&&(Uo=e)}function Ge(){function t(t,e){u.push("M",t,",",e,a)}function e(t,e){u.push("M",t,",",e),o.point=n}function n(t,e){u.push("L",t,",",e)}function r(){o.point=t}function i(){u.push("Z")}var a=Xe(4.5),u=[],o={point:t,lineStart:function(){o.point=e},lineEnd:r,polygonStart:function(){o.lineEnd=i},polygonEnd:function(){o.lineEnd=r,o.point=t},pointRadius:function(t){return a=Xe(t),o},result:function(){if(u.length){var t=u.join("");return u=[],t}}};return o}function Xe(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ze(t,e){ko+=t,Eo+=e,++Mo}function Ke(){function t(t,r){var i=t-e,a=r-n,u=Math.sqrt(i*i+a*a);Do+=u*(e+t)/2,So+=u*(n+r)/2,Co+=u,Ze(e=t,n=r)}var e,n;Wo.point=function(r,i){Wo.point=t,Ze(e=r,n=i)}}function Qe(){Wo.point=Ze}function Je(){function t(t,e){var n=t-r,a=e-i,u=Math.sqrt(n*n+a*a);Do+=u*(r+t)/2,So+=u*(i+e)/2,Co+=u,u=i*t-r*e,To+=u*(r+t),Fo+=u*(i+e),Bo+=3*u,Ze(r=t,i=e)}var e,n,r,i;Wo.point=function(a,u){Wo.point=t,Ze(e=r=a,n=i=u)},Wo.lineEnd=function(){t(e,n)}}function tn(t){function e(e,n){t.moveTo(e+u,n),t.arc(e,n,u,0,Lu)}function n(e,n){t.moveTo(e,n),o.point=r}function r(e,n){t.lineTo(e,n)}function i(){o.point=e}function a(){ +t.closePath()}var u=4.5,o={point:e,lineStart:function(){o.point=n},lineEnd:i,polygonStart:function(){o.lineEnd=a},polygonEnd:function(){o.lineEnd=i,o.point=e},pointRadius:function(t){return u=t,o},result:w};return o}function en(t){function e(t){return(o?r:n)(t)}function n(e){return an(e,function(n,r){n=t(n,r),e.point(n[0],n[1])})}function r(e){function n(n,r){n=t(n,r),e.point(n[0],n[1])}function r(){_=0/0,k.point=a,e.lineStart()}function a(n,r){var a=ge([n,r]),u=t(n,r);i(_,b,v,x,w,A,_=u[0],b=u[1],v=n,x=a[0],w=a[1],A=a[2],o,e),e.point(_,b)}function u(){k.point=n,e.lineEnd()}function s(){r(),k.point=c,k.lineEnd=l}function c(t,e){a(h=t,f=e),d=_,p=b,g=x,y=w,m=A,k.point=a}function l(){i(_,b,v,x,w,A,d,p,h,g,y,m,o,e),k.lineEnd=u,u()}var h,f,d,p,g,y,m,v,_,b,x,w,A,k={point:n,lineStart:r,lineEnd:u,polygonStart:function(){e.polygonStart(),k.lineStart=s},polygonEnd:function(){e.polygonEnd(),k.lineStart=r}};return k}function i(e,n,r,o,s,c,l,h,f,d,p,g,y,m){var v=l-e,_=h-n,b=v*v+_*_;if(b>4*a&&y--){var x=o+d,w=s+p,A=c+g,k=Math.sqrt(x*x+w*w+A*A),E=Math.asin(A/=k),M=pu(pu(A)-1)a||pu((v*T+_*F)/b-.5)>.3||u>o*d+s*p+c*g)&&(i(e,n,r,o,s,c,S,C,M,x/=k,w/=k,A,y,m),m.point(S,C),i(S,C,M,x,w,A,l,h,f,d,p,g,y,m))}}var a=.5,u=Math.cos(30*Ou),o=16;return e.precision=function(t){return arguments.length?(o=(a=t*t)>0&&16,e):Math.sqrt(a)},e}function nn(t){var e=en(function(e,n){return t([e*Pu,n*Pu])});return function(t){return sn(e(t))}}function rn(t){this.stream=t}function an(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function un(t){return on(function(){return t})()}function on(t){function e(t){return t=o(t[0]*Ou,t[1]*Ou),[t[0]*f+s,c-t[1]*f]}function n(t){return t=o.invert((t[0]-s)/f,(c-t[1])/f),t&&[t[0]*Pu,t[1]*Pu]}function r(){o=Se(u=hn(m,v,b),a);var t=a(g,y);return s=d-t[0]*f,c=p+t[1]*f,i()}function i(){return l&&(l.valid=!1,l=null),e}var a,u,o,s,c,l,h=en(function(t,e){return t=a(t,e),[t[0]*f+s,c-t[1]*f]}),f=150,d=480,p=250,g=0,y=0,m=0,v=0,b=0,x=Io,w=_,A=null,k=null;return e.stream=function(t){return l&&(l.valid=!1),l=sn(x(u,h(w(t)))),l.valid=!0,l},e.clipAngle=function(t){return arguments.length?(x=null==t?(A=t,Io):Ue((A=+t)*Ou),i()):A},e.clipExtent=function(t){return arguments.length?(k=t,w=t?ze(t[0][0],t[0][1],t[1][0],t[1][1]):_,i()):k},e.scale=function(t){return arguments.length?(f=+t,r()):f},e.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],r()):[d,p]},e.center=function(t){return arguments.length?(g=t[0]%360*Ou,y=t[1]%360*Ou,r()):[g*Pu,y*Pu]},e.rotate=function(t){return arguments.length?(m=t[0]%360*Ou,v=t[1]%360*Ou,b=t.length>2?t[2]%360*Ou:0,r()):[m*Pu,v*Pu,b*Pu]},nu.rebind(e,h,"precision"),function(){return a=t.apply(this,arguments),e.invert=a.invert&&n,r()}}function sn(t){return an(t,function(e,n){t.point(e*Ou,n*Ou)})}function cn(t,e){return[t,e]}function ln(t,e){return[t>Bu?t-Lu:-Bu>t?t+Lu:t,e]}function hn(t,e,n){return t?e||n?Se(dn(t),pn(e,n)):dn(t):e||n?pn(e,n):ln}function fn(t){return function(e,n){return e+=t,[e>Bu?e-Lu:-Bu>e?e+Lu:e,n]}}function dn(t){var e=fn(t);return e.invert=fn(-t),e}function pn(t,e){function n(t,e){var n=Math.cos(e),o=Math.cos(t)*n,s=Math.sin(t)*n,c=Math.sin(e),l=c*r+o*i;return[Math.atan2(s*a-l*u,o*r-c*i),nt(l*a+s*u)]}var r=Math.cos(t),i=Math.sin(t),a=Math.cos(e),u=Math.sin(e);return n.invert=function(t,e){var n=Math.cos(e),o=Math.cos(t)*n,s=Math.sin(t)*n,c=Math.sin(e),l=c*a-s*u;return[Math.atan2(s*a+c*u,o*r+l*i),nt(l*r-o*i)]},n}function gn(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,a,u,o){var s=u*e;null!=i?(i=yn(n,i),a=yn(n,a),(u>0?a>i:i>a)&&(i+=u*Lu)):(i=t+u*Lu,a=t-.5*s);for(var c,l=i;u>0?l>a:a>l;l-=s)o.point((c=xe([n,-r*Math.cos(l),-r*Math.sin(l)]))[0],c[1])}}function yn(t,e){var n=ge(e);n[0]-=t,be(n);var r=et(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Tu)%(2*Math.PI)}function mn(t,e,n){var r=nu.range(t,e-Tu,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function vn(t,e,n){var r=nu.range(t,e-Tu,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function _n(t){return t.source}function bn(t){return t.target}function xn(t,e,n,r){var i=Math.cos(e),a=Math.sin(e),u=Math.cos(r),o=Math.sin(r),s=i*Math.cos(t),c=i*Math.sin(t),l=u*Math.cos(n),h=u*Math.sin(n),f=2*Math.asin(Math.sqrt(ut(r-e)+i*u*ut(n-t))),d=1/Math.sin(f),p=f?function(t){var e=Math.sin(t*=f)*d,n=Math.sin(f-t)*d,r=n*s+e*l,i=n*c+e*h,u=n*a+e*o;return[Math.atan2(i,r)*Pu,Math.atan2(u,Math.sqrt(r*r+i*i))*Pu]}:function(){return[t*Pu,e*Pu]};return p.distance=f,p}function wn(){function t(t,i){var a=Math.sin(i*=Ou),u=Math.cos(i),o=pu((t*=Ou)-e),s=Math.cos(o);qo+=Math.atan2(Math.sqrt((o=u*Math.sin(o))*o+(o=r*a-n*u*s)*o),n*a+r*u*s),e=t,n=a,r=u}var e,n,r;Vo.point=function(i,a){e=i*Ou,n=Math.sin(a*=Ou),r=Math.cos(a),Vo.point=t},Vo.lineEnd=function(){Vo.point=Vo.lineEnd=w}}function An(t,e){function n(e,n){var r=Math.cos(e),i=Math.cos(n),a=t(r*i);return[a*i*Math.sin(e),a*Math.sin(n)]}return n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),i=e(r),a=Math.sin(i),u=Math.cos(i);return[Math.atan2(t*a,r*u),Math.asin(r&&n*a/r)]},n}function kn(t,e){function n(t,e){u>0?-Nu+Tu>e&&(e=-Nu+Tu):e>Nu-Tu&&(e=Nu-Tu);var n=u/Math.pow(i(e),a);return[n*Math.sin(a*t),u-n*Math.cos(a*t)]}var r=Math.cos(t),i=function(t){return Math.tan(Bu/4+t/2)},a=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(i(e)/i(t)),u=r*Math.pow(i(t),a)/a;return a?(n.invert=function(t,e){var n=u-e,r=J(a)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/a,2*Math.atan(Math.pow(u/r,1/a))-Nu]},n):Mn}function En(t,e){function n(t,e){var n=a-e;return[n*Math.sin(i*t),a-n*Math.cos(i*t)]}var r=Math.cos(t),i=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),a=r/i+t;return pu(i)i;i++){for(;r>1&&tt(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function Bn(t,e){return t[0]-e[0]||t[1]-e[1]}function Ln(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function In(t,e,n,r){var i=t[0],a=n[0],u=e[0]-i,o=r[0]-a,s=t[1],c=n[1],l=e[1]-s,h=r[1]-c,f=(o*(s-c)-h*(i-a))/(h*u-o*l);return[i+f*u,s+f*l]}function Nn(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function On(){rr(this),this.edge=this.site=this.circle=null}function Pn(t){var e=is.pop()||new On;return e.site=t,e}function Rn(t){Gn(t),es.remove(t),is.push(t),rr(t)}function jn(t){var e=t.circle,n=e.x,r=e.cy,i={x:n,y:r},a=t.P,u=t.N,o=[t];Rn(t);for(var s=a;s.circle&&pu(n-s.circle.x)l;++l)c=o[l],s=o[l-1],tr(c.edge,s.site,c.site,i);s=o[0],c=o[h-1],c.edge=Qn(s.site,c.site,null,i),Hn(s),Hn(c)}function Yn(t){for(var e,n,r,i,a=t.x,u=t.y,o=es._;o;)if(r=Un(o,u)-a,r>Tu)o=o.L;else{if(i=a-$n(o,u),!(i>Tu)){r>-Tu?(e=o.P,n=o):i>-Tu?(e=o,n=o.N):e=n=o;break}if(!o.R){e=o;break}o=o.R}var s=Pn(t);if(es.insert(e,s),e||n){if(e===n)return Gn(e),n=Pn(e.site),es.insert(s,n),s.edge=n.edge=Qn(e.site,s.site),Hn(e),void Hn(n);if(!n)return void(s.edge=Qn(e.site,s.site));Gn(e),Gn(n);var c=e.site,l=c.x,h=c.y,f=t.x-l,d=t.y-h,p=n.site,g=p.x-l,y=p.y-h,m=2*(f*y-d*g),v=f*f+d*d,_=g*g+y*y,b={x:(y*v-d*_)/m+l,y:(f*_-g*v)/m+h};tr(n.edge,c,p,b),s.edge=Qn(c,t,null,b),n.edge=Qn(t,p,null,b),Hn(e),Hn(n)}}function Un(t,e){var n=t.site,r=n.x,i=n.y,a=i-e;if(!a)return r;var u=t.P;if(!u)return-(1/0);n=u.site;var o=n.x,s=n.y,c=s-e;if(!c)return o;var l=o-r,h=1/a-1/c,f=l/c;return h?(-f+Math.sqrt(f*f-2*h*(l*l/(-2*c)-s+c/2+i-a/2)))/h+r:(r+o)/2}function $n(t,e){var n=t.N;if(n)return Un(n,e);var r=t.site;return r.y===e?r.x:1/0}function zn(t){this.site=t,this.edges=[]}function Wn(t){for(var e,n,r,i,a,u,o,s,c,l,h=t[0][0],f=t[1][0],d=t[0][1],p=t[1][1],g=ts,y=g.length;y--;)if(a=g[y],a&&a.prepare())for(o=a.edges,s=o.length,u=0;s>u;)l=o[u].end(),r=l.x,i=l.y,c=o[++u%s].start(),e=c.x,n=c.y,(pu(r-e)>Tu||pu(i-n)>Tu)&&(o.splice(u,0,new er(Jn(a.site,l,pu(r-h)Tu?{x:h,y:pu(e-h)Tu?{x:pu(n-p)Tu?{x:f,y:pu(e-f)Tu?{x:pu(n-d)=-Fu)){var d=s*s+c*c,p=l*l+h*h,g=(h*d-c*p)/f,y=(s*p-l*d)/f,h=y+o,m=as.pop()||new Vn;m.arc=t,m.site=i,m.x=g+u,m.y=h+Math.sqrt(g*g+y*y),m.cy=h,t.circle=m;for(var v=null,_=rs._;_;)if(m.y<_.y||m.y===_.y&&m.x<=_.x){if(!_.L){v=_.P;break}_=_.L}else{if(!_.R){v=_;break}_=_.R}rs.insert(v,m),v||(ns=m)}}}}function Gn(t){var e=t.circle;e&&(e.P||(ns=e.N),rs.remove(e),as.push(e),rr(e),t.circle=null)}function Xn(t){for(var e,n=Jo,r=$e(t[0][0],t[0][1],t[1][0],t[1][1]),i=n.length;i--;)e=n[i],(!Zn(e,t)||!r(e)||pu(e.a.x-e.b.x)y||y>=o)return;if(f>p){if(a){if(a.y>=c)return}else a={x:y,y:s};n={x:y,y:c}}else{if(a){if(a.yr||r>1)if(f>p){if(a){if(a.y>=c)return}else a={x:(s-i)/r,y:s};n={x:(c-i)/r,y:c}}else{if(a){if(a.yd){if(a){if(a.x>=o)return}else a={x:u,y:r*u+i};n={x:o,y:r*o+i}}else{if(a){if(a.xa||h>u||r>f||i>d)){if(p=t.point){var p,g=e-t.x,y=n-t.y,m=g*g+y*y;if(s>m){var v=Math.sqrt(s=m);r=e-v,i=n-v,a=e+v,u=n+v,o=p}}for(var _=t.nodes,b=.5*(l+f),x=.5*(h+d),w=e>=b,A=n>=x,k=A<<1|w,E=k+4;E>k;++k)if(t=_[3&k])switch(3&k){case 0:c(t,l,h,b,x);break;case 1:c(t,b,h,f,x);break;case 2:c(t,l,x,b,d);break;case 3:c(t,b,x,f,d)}}}(t,r,i,a,u),o}function gr(t,e){t=nu.rgb(t),e=nu.rgb(e);var n=t.r,r=t.g,i=t.b,a=e.r-n,u=e.g-r,o=e.b-i;return function(t){return"#"+xt(Math.round(n+a*t))+xt(Math.round(r+u*t))+xt(Math.round(i+o*t))}}function yr(t,e){var n,r={},i={};for(n in t)n in e?r[n]=_r(t[n],e[n]):i[n]=t[n];for(n in e)n in t||(i[n]=e[n]);return function(t){for(n in r)i[n]=r[n](t);return i}}function mr(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function vr(t,e){var n,r,i,a=os.lastIndex=ss.lastIndex=0,u=-1,o=[],s=[];for(t+="",e+="";(n=os.exec(t))&&(r=ss.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),o[u]?o[u]+=i:o[++u]=i),(n=n[0])===(r=r[0])?o[u]?o[u]+=r:o[++u]=r:(o[++u]=null,s.push({i:u,x:mr(n,r)})),a=ss.lastIndex;return ar;++r)o[(n=s[r]).i]=n.x(t);return o.join("")})}function _r(t,e){for(var n,r=nu.interpolators.length;--r>=0&&!(n=nu.interpolators[r](t,e)););return n}function br(t,e){var n,r=[],i=[],a=t.length,u=e.length,o=Math.min(t.length,e.length);for(n=0;o>n;++n)r.push(_r(t[n],e[n]));for(;a>n;++n)i[n]=t[n];for(;u>n;++n)i[n]=e[n];return function(t){for(n=0;o>n;++n)i[n]=r[n](t);return i}}function xr(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function wr(t){return function(e){return 1-t(1-e)}}function Ar(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function kr(t){return t*t}function Er(t){return t*t*t}function Mr(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(.5>t?n:3*(t-e)+n-.75)}function Dr(t){return function(e){return Math.pow(e,t)}}function Sr(t){return 1-Math.cos(t*Nu)}function Cr(t){return Math.pow(2,10*(t-1))}function Tr(t){return 1-Math.sqrt(1-t*t)}function Fr(t,e){var n;return arguments.length<2&&(e=.45),arguments.length?n=e/Lu*Math.asin(1/t):(t=1,n=e/4),function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-n)*Lu/e)}}function Br(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function Lr(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Ir(t,e){t=nu.hcl(t),e=nu.hcl(e);var n=t.h,r=t.c,i=t.l,a=e.h-n,u=e.c-r,o=e.l-i;return isNaN(u)&&(u=0,r=isNaN(r)?e.c:r),isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:-180>a&&(a+=360),function(t){return ht(n+a*t,r+u*t,i+o*t)+""}}function Nr(t,e){t=nu.hsl(t),e=nu.hsl(e);var n=t.h,r=t.s,i=t.l,a=e.h-n,u=e.s-r,o=e.l-i;return isNaN(u)&&(u=0,r=isNaN(r)?e.s:r),isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:-180>a&&(a+=360),function(t){return ct(n+a*t,r+u*t,i+o*t)+""}}function Or(t,e){t=nu.lab(t),e=nu.lab(e);var n=t.l,r=t.a,i=t.b,a=e.l-n,u=e.a-r,o=e.b-i;return function(t){return dt(n+a*t,r+u*t,i+o*t)+""}}function Pr(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function Rr(t){var e=[t.a,t.b],n=[t.c,t.d],r=Yr(e),i=jr(e,n),a=Yr(Ur(n,e,-i))||0;e[0]*n[1]180?l+=360:l-c>180&&(c+=360),i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:mr(c,l)})):l&&r.push(r.pop()+"rotate("+l+")"),h!=f?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:mr(h,f)}):f&&r.push(r.pop()+"skewX("+f+")"),d[0]!=p[0]||d[1]!=p[1]?(n=r.push(r.pop()+"scale(",null,",",null,")"),i.push({i:n-4,x:mr(d[0],p[0])},{i:n-2,x:mr(d[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),n=i.length,function(t){for(var e,a=-1;++a=0;)n.push(i[r])}function ei(t,e){for(var n=[t],r=[];null!=(t=n.pop());)if(r.push(t),(a=t.children)&&(i=a.length))for(var i,a,u=-1;++un;++n)(e=t[n][1])>i&&(r=n,i=e);return r}function fi(t){return t.reduce(di,0)}function di(t,e){return t+e[1]}function pi(t,e){return gi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function gi(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,a=[];++n<=e;)a[n]=i*n+r;return a}function yi(t){return[nu.min(t),nu.max(t)]}function mi(t,e){return t.value-e.value}function vi(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function _i(t,e){t._pack_next=e,e._pack_prev=t}function bi(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return.999*i*i>n*n+r*r}function xi(t){function e(t){l=Math.min(t.x-t.r,l),h=Math.max(t.x+t.r,h),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}if((n=t.children)&&(c=n.length)){var n,r,i,a,u,o,s,c,l=1/0,h=-(1/0),f=1/0,d=-(1/0);if(n.forEach(wi),r=n[0],r.x=-r.r,r.y=0,e(r),c>1&&(i=n[1],i.x=i.r,i.y=0,e(i),c>2))for(a=n[2],Ei(r,i,a),e(a),vi(r,a),r._pack_prev=a,vi(a,i),i=r._pack_next,u=3;c>u;u++){Ei(r,i,a=n[u]);var p=0,g=1,y=1;for(o=i._pack_next;o!==i;o=o._pack_next,g++)if(bi(o,a)){p=1;break}if(1==p)for(s=r._pack_prev;s!==o._pack_prev&&!bi(s,a);s=s._pack_prev,y++);p?(y>g||g==y&&i.ru;u++)a=n[u],a.x-=m,a.y-=v,_=Math.max(_,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=_,n.forEach(Ai)}}function wi(t){t._pack_next=t._pack_prev=t}function Ai(t){delete t._pack_next,delete t._pack_prev}function ki(t,e,n,r){var i=t.children;if(t.x=e+=r*t.x,t.y=n+=r*t.y,t.r*=r,i)for(var a=-1,u=i.length;++a=0;)e=i[a],e.z+=n,e.m+=n,n+=e.s+(r+=e.c)}function Fi(t,e,n){return t.a.parent===e.parent?t.a:n}function Bi(t){return 1+nu.max(t,function(t){return t.y})}function Li(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ii(t){var e=t.children;return e&&e.length?Ii(e[0]):t}function Ni(t){var e,n=t.children;return n&&(e=n.length)?Ni(n[e-1]):t}function Oi(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Pi(t,e){var n=t.x+e[3],r=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return 0>i&&(n+=i/2,i=0),0>a&&(r+=a/2,a=0),{x:n,y:r,dx:i,dy:a}}function Ri(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function ji(t){return t.rangeExtent?t.rangeExtent():Ri(t.range())}function Yi(t,e,n,r){var i=n(t[0],t[1]),a=r(e[0],e[1]);return function(t){return a(i(t))}}function Ui(t,e){var n,r=0,i=t.length-1,a=t[r],u=t[i];return a>u&&(n=r,r=i,i=n,n=a,a=u,u=n),t[r]=e.floor(a),t[i]=e.ceil(u),t}function $i(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:_s}function zi(t,e,n,r){var i=[],a=[],u=0,o=Math.min(t.length,e.length)-1;for(t[o]2?zi:Yi,s=r?Wr:zr;return u=i(t,e,s,n),o=i(e,t,s,_r),a}function a(t){return u(t)}var u,o;return a.invert=function(t){return o(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Pr)},a.clamp=function(t){return arguments.length?(r=t,i()):r},a.interpolate=function(t){return arguments.length?(n=t,i()):n},a.ticks=function(e){return Gi(t,e)},a.tickFormat=function(e,n){return Xi(t,e,n)},a.nice=function(e){return Vi(t,e),i()},a.copy=function(){return Wi(t,e,n,r)},i()}function qi(t,e){return nu.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Vi(t,e){return Ui(t,$i(Hi(t,e)[2]))}function Hi(t,e){null==e&&(e=10);var n=Ri(t),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),a=e/r*i;return.15>=a?i*=10:.35>=a?i*=5:.75>=a&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function Gi(t,e){return nu.range.apply(nu,Hi(t,e))}function Xi(t,e,n){var r=Hi(t,e);if(n){var i=uo.exec(n);if(i.shift(),"s"===i[8]){var a=nu.formatPrefix(Math.max(pu(r[0]),pu(r[1])));return i[7]||(i[7]="."+Zi(a.scale(r[2]))),i[8]="f",n=nu.format(i.join("")),function(t){return n(a.scale(t))+a.symbol}}i[7]||(i[7]="."+Ki(i[8],r)),n=i.join("")}else n=",."+Zi(r[2])+"f";return nu.format(n)}function Zi(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function Ki(t,e){var n=Zi(e[2]);return t in bs?Math.abs(n-Zi(Math.max(pu(e[0]),pu(e[1]))))+ +("e"!==t):n-2*("%"===t)}function Qi(t,e,n,r){function i(t){return(n?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function u(e){return t(i(e))}return u.invert=function(e){return a(t.invert(e))},u.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((r=e.map(Number)).map(i)),u):r},u.base=function(n){return arguments.length?(e=+n,t.domain(r.map(i)),u):e},u.nice=function(){var e=Ui(r.map(i),n?Math:ws);return t.domain(e),r=e.map(a),u},u.ticks=function(){var t=Ri(r),u=[],o=t[0],s=t[1],c=Math.floor(i(o)),l=Math.ceil(i(s)),h=e%1?2:e;if(isFinite(l-c)){if(n){for(;l>c;c++)for(var f=1;h>f;f++)u.push(a(c)*f);u.push(a(c))}else for(u.push(a(c));c++0;f--)u.push(a(c)*f);for(c=0;u[c]s;l--);u=u.slice(c,l)}return u},u.tickFormat=function(t,e){if(!arguments.length)return xs;arguments.length<2?e=xs:"function"!=typeof e&&(e=nu.format(e));var r,o=Math.max(.1,t/u.ticks().length),s=n?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(t){return t/a(s(i(t)+r))<=o?e(t):""}},u.copy=function(){return Qi(t.copy(),e,n,r)},qi(u,t)}function Ji(t,e,n){function r(e){return t(i(e))}var i=ta(e),a=ta(1/e);return r.invert=function(e){return a(t.invert(e))},r.domain=function(e){return arguments.length?(t.domain((n=e.map(Number)).map(i)),r):n},r.ticks=function(t){return Gi(n,t)},r.tickFormat=function(t,e){return Xi(n,t,e)},r.nice=function(t){return r.domain(Vi(n,t))},r.exponent=function(u){return arguments.length?(i=ta(e=u),a=ta(1/e),t.domain(n.map(i)),r):e},r.copy=function(){return Ji(t.copy(),e,n)},qi(r,t)}function ta(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function ea(t,e){function n(n){return a[((i.get(n)||("range"===e.t?i.set(n,t.push(n)):0/0))-1)%a.length]}function r(e,n){return nu.range(t.length).map(function(t){return e+n*t})}var i,a,u;return n.domain=function(r){if(!arguments.length)return t;t=[],i=new l;for(var a,u=-1,o=r.length;++un?[0/0,0/0]:[n>0?o[n-1]:t[0],ne?0/0:e/a+t,[e,e+1/a]},r.copy=function(){return ra(t,e,n)},i()}function ia(t,e){function n(n){return n>=n?e[nu.bisect(t,n)]:void 0}return n.domain=function(e){return arguments.length?(t=e,n):t},n.range=function(t){return arguments.length?(e=t,n):e},n.invertExtent=function(n){return n=e.indexOf(n),[t[n-1],t[n]]},n.copy=function(){return ia(t,e)},n}function aa(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(n){return arguments.length?(t=n.map(e),e):t},e.ticks=function(e){return Gi(t,e)},e.tickFormat=function(e,n){return Xi(t,e,n)},e.copy=function(){return aa(t)},e}function ua(){return 0}function oa(t){return t.innerRadius}function sa(t){return t.outerRadius}function ca(t){return t.startAngle}function la(t){return t.endAngle}function ha(t){return t&&t.padAngle}function fa(t,e,n,r){return(t-n)*e-(e-r)*t>0?0:1}function da(t,e,n,r,i){var a=t[0]-e[0],u=t[1]-e[1],o=(i?r:-r)/Math.sqrt(a*a+u*u),s=o*u,c=-o*a,l=t[0]+s,h=t[1]+c,f=e[0]+s,d=e[1]+c,p=(l+f)/2,g=(h+d)/2,y=f-l,m=d-h,v=y*y+m*m,_=n-r,b=l*d-f*h,x=(0>m?-1:1)*Math.sqrt(_*_*v-b*b),w=(b*m-y*x)/v,A=(-b*y-m*x)/v,k=(b*m+y*x)/v,E=(-b*y+m*x)/v,M=w-p,D=A-g,S=k-p,C=E-g;return M*M+D*D>S*S+C*C&&(w=k,A=E),[[w-s,A-c],[w*n/_,A*n/_]]}function pa(t){function e(e){function u(){c.push("M",a(t(l),o))}for(var s,c=[],l=[],h=-1,f=e.length,d=Dt(n),p=Dt(r);++h1&&i.push("H",r[0]),i.join("")}function va(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e1){o=e[1],a=t[s],s++,r+="C"+(i[0]+u[0])+","+(i[1]+u[1])+","+(a[0]-o[0])+","+(a[1]-o[1])+","+a[0]+","+a[1];for(var c=2;c9&&(i=3*e/Math.sqrt(i),u[o]=i*n,u[o+1]=i*r));for(o=-1;++o<=s;)i=(t[Math.min(s,o+1)][0]-t[Math.max(0,o-1)][0])/(6*(1+u[o]*u[o])), +a.push([i||0,u[o]*i||0]);return a}function Ia(t){return t.length<3?ga(t):t[0]+Aa(t,La(t))}function Na(t){for(var e,n,r,i=-1,a=t.length;++ir)return l();var i=a[a.active];i&&(--a.count,delete a[a.active],i.event&&i.event.interrupt.call(t,t.__data__,i.index)),a.active=r,u.event&&u.event.start.call(t,t.__data__,e),u.tween.forEach(function(n,r){(r=r.call(t,t.__data__,e))&&g.push(r)}),f=u.ease,h=u.duration,nu.timer(function(){return p.c=c(n||1)?Ce:c,1},0,o)}function c(n){if(a.active!==r)return 1;for(var i=n/h,o=f(i),s=g.length;s>0;)g[--s].call(t,o);return i>=1?(u.event&&u.event.end.call(t,t.__data__,e),l()):void 0}function l(){return--a.count?delete a[r]:delete t[n],1}var h,f,d=u.delay,p=ro,g=[];return p.t=d+o,i>=d?s(i-d):void(p.c=s)},0,o)}}function Xa(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function Za(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}function Ka(t){return t.toISOString()}function Qa(t,e,n){function r(e){return t(e)}function i(t,n){var r=t[1]-t[0],i=r/n,a=nu.bisect(Hs,i);return a==Hs.length?[e.year,Hi(t.map(function(t){return t/31536e6}),n)[2]]:a?e[i/Hs[a-1]1?{floor:function(e){for(;n(e=t.floor(e));)e=Ja(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=Ja(+e+1);return e}}:t))},r.ticks=function(t,e){var n=Ri(r.domain()),a=null==t?i(n,10):"number"==typeof t?i(n,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(n[0],Ja(+n[1]+1),1>e?1:e)},r.tickFormat=function(){return n},r.copy=function(){return Qa(t.copy(),e,n)},qi(r,t)}function Ja(t){return new Date(t)}function tu(t){return JSON.parse(t.responseText)}function eu(t){var e=au.createRange();return e.selectNode(au.body),e.createContextualFragment(t.responseText)}var nu={version:"3.5.6"},ru=[].slice,iu=function(t){return ru.call(t)},au=this.document;if(au)try{iu(au.documentElement.childNodes)[0].nodeType}catch(uu){iu=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}if(Date.now||(Date.now=function(){return+new Date}),au)try{au.createElement("DIV").style.setProperty("opacity",0,"")}catch(ou){var su=this.Element.prototype,cu=su.setAttribute,lu=su.setAttributeNS,hu=this.CSSStyleDeclaration.prototype,fu=hu.setProperty;su.setAttribute=function(t,e){cu.call(this,t,e+"")},su.setAttributeNS=function(t,e,n){lu.call(this,t,e,n+"")},hu.setProperty=function(t,e,n){fu.call(this,t,e+"",n)}}nu.ascending=r,nu.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:0/0},nu.min=function(t,e){var n,r,i=-1,a=t.length;if(1===arguments.length){for(;++i=r){n=r;break}for(;++ir&&(n=r)}else{for(;++i=r){n=r;break}for(;++ir&&(n=r)}return n},nu.max=function(t,e){var n,r,i=-1,a=t.length;if(1===arguments.length){for(;++i=r){n=r;break}for(;++in&&(n=r)}else{for(;++i=r){n=r;break}for(;++in&&(n=r)}return n},nu.extent=function(t,e){var n,r,i,a=-1,u=t.length;if(1===arguments.length){for(;++a=r){n=i=r;break}for(;++ar&&(n=r),r>i&&(i=r))}else{for(;++a=r){n=i=r;break}for(;++ar&&(n=r),r>i&&(i=r))}return[n,i]},nu.sum=function(t,e){var n,r=0,i=t.length,u=-1;if(1===arguments.length)for(;++u1?s/(l-1):void 0},nu.deviation=function(){var t=nu.variance.apply(this,arguments);return t?Math.sqrt(t):t};var du=u(r);nu.bisectLeft=du.left,nu.bisect=nu.bisectRight=du.right,nu.bisector=function(t){return u(1===t.length?function(e,n){return r(t(e),n)}:t)},nu.shuffle=function(t,e,n){(a=arguments.length)<3&&(n=t.length,2>a&&(e=0));for(var r,i,a=n-e;a;)i=Math.random()*a--|0,r=t[a+e],t[a+e]=t[i+e],t[i+e]=r;return t},nu.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},nu.pairs=function(t){for(var e,n=0,r=t.length-1,i=t[0],a=new Array(0>r?0:r);r>n;)a[n]=[e=i,i=t[++n]];return a},nu.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,e=nu.min(arguments,o),n=new Array(e);++t=0;)for(r=t[i],e=r.length;--e>=0;)n[--u]=r[e];return n};var pu=Math.abs;nu.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n===1/0)throw new Error("infinite range");var r,i=[],a=s(pu(n)),u=-1;if(t*=a,e*=a,n*=a,0>n)for(;(r=t+n*++u)>e;)i.push(r/a);else for(;(r=t+n*++u)=a.length)return r?r.call(i,u):n?u.sort(n):u;for(var s,c,h,f,d=-1,p=u.length,g=a[o++],y=new l;++d=a.length)return t;var r=[],i=u[n++];return t.forEach(function(t,i){r.push({key:t,values:e(i,n)})}),i?r.sort(function(t,e){return i(t.key,e.key)}):r}var n,r,i={},a=[],u=[];return i.map=function(e,n){return t(n,e,0)},i.entries=function(n){return e(t(nu.map,n,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return u[a.length-1]=t,i},i.sortValues=function(t){return n=t,i},i.rollup=function(t){return r=t,i},i},nu.set=function(t){var e=new v;if(t)for(var n=0,r=t.length;r>n;++n)e.add(t[n]);return e},c(v,{has:d,add:function(t){return this._[h(t+="")]=!0,t},remove:p,values:g,size:y,empty:m,forEach:function(t){for(var e in this._)t.call(this,f(e))}}),nu.behavior={},nu.rebind=function(t,e){for(var n,r=1,i=arguments.length;++r=0&&(r=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},nu.event=null,nu.requote=function(t){return t.replace(vu,"\\$&")};var vu=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,_u={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},bu=function(t,e){return e.querySelector(t)},xu=function(t,e){return e.querySelectorAll(t)},wu=function(t,e){var n=t.matches||t[x(t,"matchesSelector")];return(wu=function(t,e){return n.call(t,e)})(t,e)};"function"==typeof Sizzle&&(bu=function(t,e){return Sizzle(t,e)[0]||null},xu=Sizzle,wu=Sizzle.matchesSelector),nu.selection=function(){return nu.select(au.documentElement)};var Au=nu.selection.prototype=[];Au.select=function(t){var e,n,r,i,a=[];t=C(t);for(var u=-1,o=this.length;++u=0&&(n=t.slice(0,e),t=t.slice(e+1)),ku.hasOwnProperty(n)?{space:ku[n],local:t}:t}},Au.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return t=nu.ns.qualify(t),t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(F(e,t[e]));return this}return this.each(F(t,e))},Au.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=I(t)).length,i=-1;if(e=n.classList){for(;++ii){if("string"!=typeof t){2>i&&(e="");for(r in t)this.each(P(r,t[r],e));return this}if(2>i){var a=this.node();return n(a).getComputedStyle(a,null).getPropertyValue(t)}r=""}return this.each(P(t,e,r))},Au.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(R(e,t[e]));return this}return this.each(R(t,e))},Au.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},Au.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},Au.append=function(t){return t=j(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Au.insert=function(t,e){return t=j(t),e=C(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},Au.remove=function(){return this.each(Y)},Au.data=function(t,e){function n(t,n){var r,i,a,u=t.length,h=n.length,f=Math.min(u,h),d=new Array(h),p=new Array(h),g=new Array(u);if(e){var y,m=new l,v=new Array(u);for(r=-1;++rr;++r)p[r]=U(n[r]);for(;u>r;++r)g[r]=t[r]}p.update=d,p.parentNode=d.parentNode=g.parentNode=t.parentNode,o.push(p),s.push(d),c.push(g)}var r,i,a=-1,u=this.length;if(!arguments.length){for(t=new Array(u=(r=this[0]).length);++aa;a++){i.push(e=[]),e.parentNode=(n=this[a]).parentNode;for(var o=0,s=n.length;s>o;o++)(r=n[o])&&t.call(r,r.__data__,o,a)&&e.push(r)}return S(i)},Au.order=function(){for(var t=-1,e=this.length;++t=0;)(n=r[i])&&(a&&a!==n.nextSibling&&a.parentNode.insertBefore(n,a),a=n);return this},Au.sort=function(t){t=z.apply(this,arguments);for(var e=-1,n=this.length;++et;t++)for(var n=this[t],r=0,i=n.length;i>r;r++){var a=n[r];if(a)return a}return null},Au.size=function(){var t=0;return W(this,function(){++t}),t};var Eu=[];nu.selection.enter=q,nu.selection.enter.prototype=Eu,Eu.append=Au.append,Eu.empty=Au.empty,Eu.node=Au.node,Eu.call=Au.call,Eu.size=Au.size,Eu.select=function(t){for(var e,n,r,i,a,u=[],o=-1,s=this.length;++or){if("string"!=typeof t){2>r&&(e=!1);for(n in t)this.each(H(n,t[n],e));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;n=!1}return this.each(H(t,e,n))};var Mu=nu.map({mouseenter:"mouseover",mouseleave:"mouseout"});au&&Mu.forEach(function(t){"on"+t in au&&Mu.remove(t)});var Du,Su=0;nu.mouse=function(t){return K(t,M())};var Cu=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;nu.touch=function(t,e,n){if(arguments.length<3&&(n=e,e=M().changedTouches),e)for(var r,i=0,a=e.length;a>i;++i)if((r=e[i]).identifier===n)return K(t,r)},nu.behavior.drag=function(){function t(){this.on("mousedown.drag",a).on("touchstart.drag",u)}function e(t,e,n,a,u){return function(){function o(){var t,n,r=e(f,g);r&&(t=r[0]-_[0],n=r[1]-_[1],p|=t|n,_=r,d({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:t,dy:n}))}function s(){e(f,g)&&(m.on(a+y,null).on(u+y,null),v(p&&nu.event.target===h),d({type:"dragend"}))}var c,l=this,h=nu.event.target,f=l.parentNode,d=r.of(l,arguments),p=0,g=t(),y=".drag"+(null==g?"":"-"+g),m=nu.select(n(h)).on(a+y,o).on(u+y,s),v=Z(h),_=e(f,g);i?(c=i.apply(l,arguments),c=[c.x-_[0],c.y-_[1]]):c=[0,0],d({type:"dragstart"})}}var r=D(t,"drag","dragstart","dragend"),i=null,a=e(w,nu.mouse,n,"mousemove","mouseup"),u=e(Q,nu.touch,_,"touchmove","touchend");return t.origin=function(e){return arguments.length?(i=e,t):i},nu.rebind(t,r,"on")},nu.touches=function(t,e){return arguments.length<2&&(e=M().touches),e?iu(e).map(function(e){var n=K(t,e);return n.identifier=e.identifier,n}):[]};var Tu=1e-6,Fu=Tu*Tu,Bu=Math.PI,Lu=2*Bu,Iu=Lu-Tu,Nu=Bu/2,Ou=Bu/180,Pu=180/Bu,Ru=Math.SQRT2,ju=2,Yu=4;nu.interpolateZoom=function(t,e){function n(t){var e=t*v;if(m){var n=it(g),u=a/(ju*f)*(n*at(Ru*e+g)-rt(g));return[r+u*c,i+u*l,a*n/it(Ru*e+g)]}return[r+t*c,i+t*l,a*Math.exp(Ru*e)]}var r=t[0],i=t[1],a=t[2],u=e[0],o=e[1],s=e[2],c=u-r,l=o-i,h=c*c+l*l,f=Math.sqrt(h),d=(s*s-a*a+Yu*h)/(2*a*ju*f),p=(s*s-a*a-Yu*h)/(2*s*ju*f),g=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(p*p+1)-p),m=y-g,v=(m||Math.log(s/a))/Ru;return n.duration=1e3*v,n},nu.behavior.zoom=function(){function t(t){t.on(F,h).on($u+".zoom",d).on("dblclick.zoom",p).on(I,f)}function e(t){return[(t[0]-k.x)/k.k,(t[1]-k.y)/k.k]}function r(t){return[t[0]*k.k+k.x,t[1]*k.k+k.y]}function i(t){k.k=Math.max(S[0],Math.min(S[1],t))}function a(t,e){e=r(e),k.x+=t[0]-e[0],k.y+=t[1]-e[1]}function u(e,n,r,u){e.__chart__={x:k.x,y:k.y,k:k.k},i(Math.pow(2,u)),a(y=n,r),e=nu.select(e),C>0&&(e=e.transition().duration(C)),e.call(t.event)}function o(){x&&x.domain(b.range().map(function(t){return(t-k.x)/k.k}).map(b.invert)),A&&A.domain(w.range().map(function(t){return(t-k.y)/k.k}).map(w.invert))}function s(t){T++||t({type:"zoomstart"})}function c(t){o(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function l(t){--T||(t({type:"zoomend"}),y=null)}function h(){function t(){h=1,a(nu.mouse(i),d),c(o)}function r(){f.on(B,null).on(L,null),p(h&&nu.event.target===u),l(o)}var i=this,u=nu.event.target,o=N.of(i,arguments),h=0,f=nu.select(n(i)).on(B,t).on(L,r),d=e(nu.mouse(i)),p=Z(i);Ps.call(i),s(o)}function f(){function t(){var t=nu.touches(p);return d=k.k,t.forEach(function(t){t.identifier in y&&(y[t.identifier]=e(t))}),t}function n(){var e=nu.event.target;nu.select(e).on(b,r).on(x,o),w.push(e);for(var n=nu.event.changedTouches,i=0,a=n.length;a>i;++i)y[n[i].identifier]=null;var s=t(),c=Date.now();if(1===s.length){if(500>c-_){var l=s[0];u(p,l,y[l.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),E()}_=c}else if(s.length>1){var l=s[0],h=s[1],f=l[0]-h[0],d=l[1]-h[1];m=f*f+d*d}}function r(){var t,e,n,r,u=nu.touches(p);Ps.call(p);for(var o=0,s=u.length;s>o;++o,r=null)if(n=u[o],r=y[n.identifier]){if(e)break;t=n,e=r}if(r){var l=(l=n[0]-t[0])*l+(l=n[1]-t[1])*l,h=m&&Math.sqrt(l/m);t=[(t[0]+n[0])/2,(t[1]+n[1])/2],e=[(e[0]+r[0])/2,(e[1]+r[1])/2],i(h*d)}_=null,a(t,e),c(g)}function o(){if(nu.event.touches.length){for(var e=nu.event.changedTouches,n=0,r=e.length;r>n;++n)delete y[e[n].identifier];for(var i in y)return void t()}nu.selectAll(w).on(v,null),A.on(F,h).on(I,f),M(),l(g)}var d,p=this,g=N.of(p,arguments),y={},m=0,v=".zoom-"+nu.event.changedTouches[0].identifier,b="touchmove"+v,x="touchend"+v,w=[],A=nu.select(p),M=Z(p);n(),s(g),A.on(F,null).on(I,n)}function d(){var t=N.of(this,arguments);v?clearTimeout(v):(Ps.call(this),g=e(y=m||nu.mouse(this)),s(t)),v=setTimeout(function(){v=null,l(t)},50),E(),i(Math.pow(2,.002*Uu())*k.k),a(y,g),c(t)}function p(){var t=nu.mouse(this),n=Math.log(k.k)/Math.LN2;u(this,t,e(t),nu.event.shiftKey?Math.ceil(n)-1:Math.floor(n)+1)}var g,y,m,v,_,b,x,w,A,k={x:0,y:0,k:1},M=[960,500],S=zu,C=250,T=0,F="mousedown.zoom",B="mousemove.zoom",L="mouseup.zoom",I="touchstart.zoom",N=D(t,"zoomstart","zoom","zoomend");return $u||($u="onwheel"in au?(Uu=function(){return-nu.event.deltaY*(nu.event.deltaMode?120:1)},"wheel"):"onmousewheel"in au?(Uu=function(){return nu.event.wheelDelta},"mousewheel"):(Uu=function(){return-nu.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=N.of(this,arguments),e=k;Ns?nu.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},s(t)}).tween("zoom:zoom",function(){var n=M[0],r=M[1],i=y?y[0]:n/2,a=y?y[1]:r/2,u=nu.interpolateZoom([(i-k.x)/k.k,(a-k.y)/k.k,n/k.k],[(i-e.x)/e.k,(a-e.y)/e.k,n/e.k]);return function(e){var r=u(e),o=n/r[2];this.__chart__=k={x:i-r[0]*o,y:a-r[1]*o,k:o},c(t)}}).each("interrupt.zoom",function(){l(t)}).each("end.zoom",function(){l(t)}):(this.__chart__=k,s(t),c(t),l(t))})},t.translate=function(e){return arguments.length?(k={x:+e[0],y:+e[1],k:k.k},o(),t):[k.x,k.y]},t.scale=function(e){return arguments.length?(k={x:k.x,y:k.y,k:+e},o(),t):k.k},t.scaleExtent=function(e){return arguments.length?(S=null==e?zu:[+e[0],+e[1]],t):S},t.center=function(e){return arguments.length?(m=e&&[+e[0],+e[1]],t):m},t.size=function(e){return arguments.length?(M=e&&[+e[0],+e[1]],t):M},t.duration=function(e){return arguments.length?(C=+e,t):C},t.x=function(e){return arguments.length?(x=e,b=e.copy(),k={x:0,y:0,k:1},t):x},t.y=function(e){return arguments.length?(A=e,w=e.copy(),k={x:0,y:0,k:1},t):A},nu.rebind(t,N,"on")};var Uu,$u,zu=[0,1/0];nu.color=ot,ot.prototype.toString=function(){return this.rgb()+""},nu.hsl=st;var Wu=st.prototype=new ot;Wu.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new st(this.h,this.s,this.l/t)},Wu.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new st(this.h,this.s,t*this.l)},Wu.rgb=function(){return ct(this.h,this.s,this.l)},nu.hcl=lt;var qu=lt.prototype=new ot;qu.brighter=function(t){return new lt(this.h,this.c,Math.min(100,this.l+Vu*(arguments.length?t:1)))},qu.darker=function(t){return new lt(this.h,this.c,Math.max(0,this.l-Vu*(arguments.length?t:1)))},qu.rgb=function(){return ht(this.h,this.c,this.l).rgb()},nu.lab=ft;var Vu=18,Hu=.95047,Gu=1,Xu=1.08883,Zu=ft.prototype=new ot;Zu.brighter=function(t){return new ft(Math.min(100,this.l+Vu*(arguments.length?t:1)),this.a,this.b)},Zu.darker=function(t){return new ft(Math.max(0,this.l-Vu*(arguments.length?t:1)),this.a,this.b)},Zu.rgb=function(){return dt(this.l,this.a,this.b)},nu.rgb=vt;var Ku=vt.prototype=new ot;Ku.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,i=30;return e||n||r?(e&&i>e&&(e=i),n&&i>n&&(n=i),r&&i>r&&(r=i),new vt(Math.min(255,e/t),Math.min(255,n/t),Math.min(255,r/t))):new vt(i,i,i)},Ku.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new vt(t*this.r,t*this.g,t*this.b)},Ku.hsl=function(){return At(this.r,this.g,this.b)},Ku.toString=function(){return"#"+xt(this.r)+xt(this.g)+xt(this.b)};var Qu=nu.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Qu.forEach(function(t,e){Qu.set(t,_t(e))}),nu.functor=Dt,nu.xhr=St(_),nu.dsv=function(t,e){function n(t,n,a){arguments.length<3&&(a=n,n=null);var u=Ct(t,e,null==n?r:i(n),a);return u.row=function(t){return arguments.length?u.response(null==(n=t)?r:i(t)):n},u}function r(t){return n.parse(t.responseText)}function i(t){return function(e){return n.parse(e.responseText,t)}}function a(e){return e.map(u).join(t)}function u(t){return o.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var o=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return n.parse=function(t,e){var r;return n.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,n){return e(i(t),n)}:i})},n.parseRows=function(t,e){function n(){if(l>=c)return u;if(i)return i=!1,a;var e=l;if(34===t.charCodeAt(e)){for(var n=e;n++l;){var r=t.charCodeAt(l++),o=1;if(10===r)i=!0;else if(13===r)i=!0,10===t.charCodeAt(l)&&(++l,++o);else if(r!==s)continue;return t.slice(e,l-o)}return t.slice(e)}for(var r,i,a={},u={},o=[],c=t.length,l=0,h=0;(r=n())!==u;){for(var f=[];r!==a&&r!==u;)f.push(r),r=n();e&&null==(f=e(f,h++))||o.push(f)}return o},n.format=function(e){if(Array.isArray(e[0]))return n.formatRows(e);var r=new v,i=[];return e.forEach(function(t){for(var e in t)r.has(e)||i.push(r.add(e))}),[i.map(u).join(t)].concat(e.map(function(e){return i.map(function(t){return u(e[t])}).join(t)})).join("\n")},n.formatRows=function(t){return t.map(a).join("\n")},n},nu.csv=nu.dsv(",","text/csv"),nu.tsv=nu.dsv(" ","text/tab-separated-values");var Ju,to,eo,no,ro,io=this[x(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};nu.timer=function(t,e,n){var r=arguments.length;2>r&&(e=0),3>r&&(n=Date.now());var i=n+e,a={c:t,t:i,f:!1,n:null};to?to.n=a:Ju=a,to=a,eo||(no=clearTimeout(no),eo=1,io(Bt))},nu.timer.flush=function(){Lt(),It()},nu.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var ao=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Ot);nu.formatPrefix=function(t,e){var n=0;return t&&(0>t&&(t*=-1),e&&(t=nu.round(t,Nt(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),ao[8+n/3]};var uo=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,oo=nu.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=nu.round(t,Nt(t,e))).toFixed(Math.max(0,Math.min(20,Nt(t*(1+1e-15),e))))}}),so=nu.time={},co=Date;jt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){lo.setUTCDate.apply(this._,arguments)},setDay:function(){lo.setUTCDay.apply(this._,arguments)},setFullYear:function(){lo.setUTCFullYear.apply(this._,arguments)},setHours:function(){lo.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){lo.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){lo.setUTCMinutes.apply(this._,arguments)},setMonth:function(){lo.setUTCMonth.apply(this._,arguments)},setSeconds:function(){lo.setUTCSeconds.apply(this._,arguments)},setTime:function(){lo.setTime.apply(this._,arguments)}};var lo=Date.prototype;so.year=Yt(function(t){return t=so.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),so.years=so.year.range,so.years.utc=so.year.utc.range,so.day=Yt(function(t){var e=new co(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),so.days=so.day.range,so.days.utc=so.day.utc.range,so.dayOfYear=function(t){var e=so.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=so[t]=Yt(function(t){return(t=so.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=so.year(t).getDay();return Math.floor((so.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});so[t+"s"]=n.range,so[t+"s"].utc=n.utc.range,so[t+"OfYear"]=function(t){var n=so.year(t).getDay();return Math.floor((so.dayOfYear(t)+(n+e)%7)/7); -}return function(o){function s(t){for(var e=0,n=y.length,r=t[1],i=0;n>i;++i)for(var a,u=1,o=y[i],s=o.length,c=o[0];s>u;++u)a=o[u],c[1]<=r?a[1]>r&&tt(c,a,t)>0&&++e:a[1]<=r&&tt(c,a,t)<0&&--e,c=a;return 0!==e}function c(a,o,s,c){var l=0,h=0;if(null==a||(l=i(a,s))!==(h=i(o,s))||u(a,o)<0^s>0){do c.point(0===l||3===l?t:n,l>1?r:e);while((l=(l+s+4)%4)!==h)}else c.point(o[0],o[1])}function l(i,a){return i>=t&&n>=i&&a>=e&&r>=a}function h(t,e){l(t,e)&&o.point(t,e)}function f(){S.point=p,y&&y.push(m=[]),k=!0,A=!1,x=w=0/0}function d(){g&&(p(v,_),b&&A&&D.rejoin(),g.push(D.buffer())),S.point=h,A&&o.lineEnd()}function p(t,e){t=Math.max(-No,Math.min(No,t)),e=Math.max(-No,Math.min(No,e));var n=l(t,e);if(y&&m.push([t,e]),k)v=t,_=e,b=n,k=!1,n&&(o.lineStart(),o.point(t,e));else if(n&&A)o.point(t,e);else{var r={a:{x:x,y:w},b:{x:t,y:e}};C(r)?(A||(o.lineStart(),o.point(r.a.x,r.a.y)),o.point(r.b.x,r.b.y),n||o.lineEnd(),E=!1):n&&(o.lineStart(),o.point(t,e),E=!1)}x=t,w=e,A=n}var g,y,m,v,_,b,x,w,A,k,E,M=o,D=Ne(),C=$e(t,e,n,r),S={point:h,lineStart:f,lineEnd:d,polygonStart:function(){o=D,g=[],y=[],E=!0},polygonEnd:function(){o=M,g=nu.merge(g);var e=s([t,r]),n=E&&e,i=g.length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),c(null,null,1,o),o.lineEnd()),i&&Te(g,a,e,c,o),o.polygonEnd()),g=y=m=null}};return S}}function qe(t){var e=0,n=Bu/3,r=on(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Bu/180,n=t[1]*Bu/180):[e/Bu*180,n/Bu*180]},i}function Ge(t,e){function n(t,e){var n=Math.sqrt(a-2*i*Math.sin(e))/i;return[n*Math.sin(t*=i),u-n*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(e))/2,a=1+r*(2*i-r),u=Math.sqrt(a)/i;return n.invert=function(t,e){var n=u-e;return[Math.atan2(t,n)/i,nt((a-(t*t+n*n)*i*i)/(2*i))]},n}function We(){function t(t,e){Po+=i*t-r*e,r=t,i=e}var e,n,r,i;$o.point=function(a,u){$o.point=t,e=r=a,n=i=u},$o.lineEnd=function(){t(e,n)}}function He(t,e){Ro>t&&(Ro=t),t>Yo&&(Yo=t),jo>e&&(jo=e),e>Uo&&(Uo=e)}function Ve(){function t(t,e){u.push("M",t,",",e,a)}function e(t,e){u.push("M",t,",",e),o.point=n}function n(t,e){u.push("L",t,",",e)}function r(){o.point=t}function i(){u.push("Z")}var a=Xe(4.5),u=[],o={point:t,lineStart:function(){o.point=e},lineEnd:r,polygonStart:function(){o.lineEnd=i},polygonEnd:function(){o.lineEnd=r,o.point=t},pointRadius:function(t){return a=Xe(t),o},result:function(){if(u.length){var t=u.join("");return u=[],t}}};return o}function Xe(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ze(t,e){ko+=t,Eo+=e,++Mo}function Ke(){function t(t,r){var i=t-e,a=r-n,u=Math.sqrt(i*i+a*a);Do+=u*(e+t)/2,Co+=u*(n+r)/2,So+=u,Ze(e=t,n=r)}var e,n;qo.point=function(r,i){qo.point=t,Ze(e=r,n=i)}}function Qe(){qo.point=Ze}function Je(){function t(t,e){var n=t-r,a=e-i,u=Math.sqrt(n*n+a*a);Do+=u*(r+t)/2,Co+=u*(i+e)/2,So+=u,u=i*t-r*e,To+=u*(r+t),Fo+=u*(i+e),Bo+=3*u,Ze(r=t,i=e)}var e,n,r,i;qo.point=function(a,u){qo.point=t,Ze(e=r=a,n=i=u)},qo.lineEnd=function(){t(e,n)}}function tn(t){function e(e,n){t.moveTo(e+u,n),t.arc(e,n,u,0,Lu)}function n(e,n){t.moveTo(e,n),o.point=r}function r(e,n){t.lineTo(e,n)}function i(){o.point=e}function a(){t.closePath()}var u=4.5,o={point:e,lineStart:function(){o.point=n},lineEnd:i,polygonStart:function(){o.lineEnd=a},polygonEnd:function(){o.lineEnd=i,o.point=e},pointRadius:function(t){return u=t,o},result:w};return o}function en(t){function e(t){return(o?r:n)(t)}function n(e){return an(e,function(n,r){n=t(n,r),e.point(n[0],n[1])})}function r(e){function n(n,r){n=t(n,r),e.point(n[0],n[1])}function r(){_=0/0,k.point=a,e.lineStart()}function a(n,r){var a=ge([n,r]),u=t(n,r);i(_,b,v,x,w,A,_=u[0],b=u[1],v=n,x=a[0],w=a[1],A=a[2],o,e),e.point(_,b)}function u(){k.point=n,e.lineEnd()}function s(){r(),k.point=c,k.lineEnd=l}function c(t,e){a(h=t,f=e),d=_,p=b,g=x,y=w,m=A,k.point=a}function l(){i(_,b,v,x,w,A,d,p,h,g,y,m,o,e),k.lineEnd=u,u()}var h,f,d,p,g,y,m,v,_,b,x,w,A,k={point:n,lineStart:r,lineEnd:u,polygonStart:function(){e.polygonStart(),k.lineStart=s},polygonEnd:function(){e.polygonEnd(),k.lineStart=r}};return k}function i(e,n,r,o,s,c,l,h,f,d,p,g,y,m){var v=l-e,_=h-n,b=v*v+_*_;if(b>4*a&&y--){var x=o+d,w=s+p,A=c+g,k=Math.sqrt(x*x+w*w+A*A),E=Math.asin(A/=k),M=pu(pu(A)-1)a||pu((v*T+_*F)/b-.5)>.3||u>o*d+s*p+c*g)&&(i(e,n,r,o,s,c,C,S,M,x/=k,w/=k,A,y,m),m.point(C,S),i(C,S,M,x,w,A,l,h,f,d,p,g,y,m))}}var a=.5,u=Math.cos(30*Ou),o=16;return e.precision=function(t){return arguments.length?(o=(a=t*t)>0&&16,e):Math.sqrt(a)},e}function nn(t){var e=en(function(e,n){return t([e*Pu,n*Pu])});return function(t){return sn(e(t))}}function rn(t){this.stream=t}function an(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function un(t){return on(function(){return t})()}function on(t){function e(t){return t=o(t[0]*Ou,t[1]*Ou),[t[0]*f+s,c-t[1]*f]}function n(t){return t=o.invert((t[0]-s)/f,(c-t[1])/f),t&&[t[0]*Pu,t[1]*Pu]}function r(){o=Ce(u=hn(m,v,b),a);var t=a(g,y);return s=d-t[0]*f,c=p+t[1]*f,i()}function i(){return l&&(l.valid=!1,l=null),e}var a,u,o,s,c,l,h=en(function(t,e){return t=a(t,e),[t[0]*f+s,c-t[1]*f]}),f=150,d=480,p=250,g=0,y=0,m=0,v=0,b=0,x=Io,w=_,A=null,k=null;return e.stream=function(t){return l&&(l.valid=!1),l=sn(x(u,h(w(t)))),l.valid=!0,l},e.clipAngle=function(t){return arguments.length?(x=null==t?(A=t,Io):Ue((A=+t)*Ou),i()):A},e.clipExtent=function(t){return arguments.length?(k=t,w=t?ze(t[0][0],t[0][1],t[1][0],t[1][1]):_,i()):k},e.scale=function(t){return arguments.length?(f=+t,r()):f},e.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],r()):[d,p]},e.center=function(t){return arguments.length?(g=t[0]%360*Ou,y=t[1]%360*Ou,r()):[g*Pu,y*Pu]},e.rotate=function(t){return arguments.length?(m=t[0]%360*Ou,v=t[1]%360*Ou,b=t.length>2?t[2]%360*Ou:0,r()):[m*Pu,v*Pu,b*Pu]},nu.rebind(e,h,"precision"),function(){return a=t.apply(this,arguments),e.invert=a.invert&&n,r()}}function sn(t){return an(t,function(e,n){t.point(e*Ou,n*Ou)})}function cn(t,e){return[t,e]}function ln(t,e){return[t>Bu?t-Lu:-Bu>t?t+Lu:t,e]}function hn(t,e,n){return t?e||n?Ce(dn(t),pn(e,n)):dn(t):e||n?pn(e,n):ln}function fn(t){return function(e,n){return e+=t,[e>Bu?e-Lu:-Bu>e?e+Lu:e,n]}}function dn(t){var e=fn(t);return e.invert=fn(-t),e}function pn(t,e){function n(t,e){var n=Math.cos(e),o=Math.cos(t)*n,s=Math.sin(t)*n,c=Math.sin(e),l=c*r+o*i;return[Math.atan2(s*a-l*u,o*r-c*i),nt(l*a+s*u)]}var r=Math.cos(t),i=Math.sin(t),a=Math.cos(e),u=Math.sin(e);return n.invert=function(t,e){var n=Math.cos(e),o=Math.cos(t)*n,s=Math.sin(t)*n,c=Math.sin(e),l=c*a-s*u;return[Math.atan2(s*a+c*u,o*r+l*i),nt(l*r-o*i)]},n}function gn(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,a,u,o){var s=u*e;null!=i?(i=yn(n,i),a=yn(n,a),(u>0?a>i:i>a)&&(i+=u*Lu)):(i=t+u*Lu,a=t-.5*s);for(var c,l=i;u>0?l>a:a>l;l-=s)o.point((c=xe([n,-r*Math.cos(l),-r*Math.sin(l)]))[0],c[1])}}function yn(t,e){var n=ge(e);n[0]-=t,be(n);var r=et(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Tu)%(2*Math.PI)}function mn(t,e,n){var r=nu.range(t,e-Tu,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function vn(t,e,n){var r=nu.range(t,e-Tu,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function _n(t){return t.source}function bn(t){return t.target}function xn(t,e,n,r){var i=Math.cos(e),a=Math.sin(e),u=Math.cos(r),o=Math.sin(r),s=i*Math.cos(t),c=i*Math.sin(t),l=u*Math.cos(n),h=u*Math.sin(n),f=2*Math.asin(Math.sqrt(ut(r-e)+i*u*ut(n-t))),d=1/Math.sin(f),p=f?function(t){var e=Math.sin(t*=f)*d,n=Math.sin(f-t)*d,r=n*s+e*l,i=n*c+e*h,u=n*a+e*o;return[Math.atan2(i,r)*Pu,Math.atan2(u,Math.sqrt(r*r+i*i))*Pu]}:function(){return[t*Pu,e*Pu]};return p.distance=f,p}function wn(){function t(t,i){var a=Math.sin(i*=Ou),u=Math.cos(i),o=pu((t*=Ou)-e),s=Math.cos(o);Go+=Math.atan2(Math.sqrt((o=u*Math.sin(o))*o+(o=r*a-n*u*s)*o),n*a+r*u*s),e=t,n=a,r=u}var e,n,r;Wo.point=function(i,a){e=i*Ou,n=Math.sin(a*=Ou),r=Math.cos(a),Wo.point=t},Wo.lineEnd=function(){Wo.point=Wo.lineEnd=w}}function An(t,e){function n(e,n){var r=Math.cos(e),i=Math.cos(n),a=t(r*i);return[a*i*Math.sin(e),a*Math.sin(n)]}return n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),i=e(r),a=Math.sin(i),u=Math.cos(i);return[Math.atan2(t*a,r*u),Math.asin(r&&n*a/r)]},n}function kn(t,e){function n(t,e){u>0?-Nu+Tu>e&&(e=-Nu+Tu):e>Nu-Tu&&(e=Nu-Tu);var n=u/Math.pow(i(e),a);return[n*Math.sin(a*t),u-n*Math.cos(a*t)]}var r=Math.cos(t),i=function(t){return Math.tan(Bu/4+t/2)},a=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(i(e)/i(t)),u=r*Math.pow(i(t),a)/a;return a?(n.invert=function(t,e){var n=u-e,r=J(a)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/a,2*Math.atan(Math.pow(u/r,1/a))-Nu]},n):Mn}function En(t,e){function n(t,e){var n=a-e;return[n*Math.sin(i*t),a-n*Math.cos(i*t)]}var r=Math.cos(t),i=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),a=r/i+t;return pu(i)i;i++){for(;r>1&&tt(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function Bn(t,e){return t[0]-e[0]||t[1]-e[1]}function Ln(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function In(t,e,n,r){var i=t[0],a=n[0],u=e[0]-i,o=r[0]-a,s=t[1],c=n[1],l=e[1]-s,h=r[1]-c,f=(o*(s-c)-h*(i-a))/(h*u-o*l);return[i+f*u,s+f*l]}function Nn(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function On(){rr(this),this.edge=this.site=this.circle=null}function Pn(t){var e=is.pop()||new On;return e.site=t,e}function Rn(t){Vn(t),es.remove(t),is.push(t),rr(t)}function jn(t){var e=t.circle,n=e.x,r=e.cy,i={x:n,y:r},a=t.P,u=t.N,o=[t];Rn(t);for(var s=a;s.circle&&pu(n-s.circle.x)l;++l)c=o[l],s=o[l-1],tr(c.edge,s.site,c.site,i);s=o[0],c=o[h-1],c.edge=Qn(s.site,c.site,null,i),Hn(s),Hn(c)}function Yn(t){for(var e,n,r,i,a=t.x,u=t.y,o=es._;o;)if(r=Un(o,u)-a,r>Tu)o=o.L;else{if(i=a-$n(o,u),!(i>Tu)){r>-Tu?(e=o.P,n=o):i>-Tu?(e=o,n=o.N):e=n=o;break}if(!o.R){e=o;break}o=o.R}var s=Pn(t);if(es.insert(e,s),e||n){if(e===n)return Vn(e),n=Pn(e.site),es.insert(s,n),s.edge=n.edge=Qn(e.site,s.site),Hn(e),void Hn(n);if(!n)return void(s.edge=Qn(e.site,s.site));Vn(e),Vn(n);var c=e.site,l=c.x,h=c.y,f=t.x-l,d=t.y-h,p=n.site,g=p.x-l,y=p.y-h,m=2*(f*y-d*g),v=f*f+d*d,_=g*g+y*y,b={x:(y*v-d*_)/m+l,y:(f*_-g*v)/m+h};tr(n.edge,c,p,b),s.edge=Qn(c,t,null,b),n.edge=Qn(t,p,null,b),Hn(e),Hn(n)}}function Un(t,e){var n=t.site,r=n.x,i=n.y,a=i-e;if(!a)return r;var u=t.P;if(!u)return-(1/0);n=u.site;var o=n.x,s=n.y,c=s-e;if(!c)return o;var l=o-r,h=1/a-1/c,f=l/c;return h?(-f+Math.sqrt(f*f-2*h*(l*l/(-2*c)-s+c/2+i-a/2)))/h+r:(r+o)/2}function $n(t,e){var n=t.N;if(n)return Un(n,e);var r=t.site;return r.y===e?r.x:1/0}function zn(t){this.site=t,this.edges=[]}function qn(t){for(var e,n,r,i,a,u,o,s,c,l,h=t[0][0],f=t[1][0],d=t[0][1],p=t[1][1],g=ts,y=g.length;y--;)if(a=g[y],a&&a.prepare())for(o=a.edges,s=o.length,u=0;s>u;)l=o[u].end(),r=l.x,i=l.y,c=o[++u%s].start(),e=c.x,n=c.y,(pu(r-e)>Tu||pu(i-n)>Tu)&&(o.splice(u,0,new er(Jn(a.site,l,pu(r-h)Tu?{x:h,y:pu(e-h)Tu?{x:pu(n-p)Tu?{x:f,y:pu(e-f)Tu?{x:pu(n-d)=-Fu)){var d=s*s+c*c,p=l*l+h*h,g=(h*d-c*p)/f,y=(s*p-l*d)/f,h=y+o,m=as.pop()||new Wn;m.arc=t,m.site=i,m.x=g+u,m.y=h+Math.sqrt(g*g+y*y),m.cy=h,t.circle=m;for(var v=null,_=rs._;_;)if(m.y<_.y||m.y===_.y&&m.x<=_.x){if(!_.L){v=_.P;break}_=_.L}else{if(!_.R){v=_;break}_=_.R}rs.insert(v,m),v||(ns=m)}}}}function Vn(t){var e=t.circle;e&&(e.P||(ns=e.N),rs.remove(e),as.push(e),rr(e),t.circle=null)}function Xn(t){for(var e,n=Jo,r=$e(t[0][0],t[0][1],t[1][0],t[1][1]),i=n.length;i--;)e=n[i],(!Zn(e,t)||!r(e)||pu(e.a.x-e.b.x)y||y>=o)return;if(f>p){if(a){if(a.y>=c)return}else a={x:y,y:s};n={x:y,y:c}}else{if(a){if(a.yr||r>1)if(f>p){if(a){if(a.y>=c)return}else a={x:(s-i)/r,y:s};n={x:(c-i)/r,y:c}}else{if(a){if(a.yd){if(a){if(a.x>=o)return}else a={x:u,y:r*u+i};n={x:o,y:r*o+i}}else{if(a){if(a.xa||h>u||r>f||i>d)){if(p=t.point){var p,g=e-t.x,y=n-t.y,m=g*g+y*y;if(s>m){var v=Math.sqrt(s=m);r=e-v,i=n-v,a=e+v,u=n+v,o=p}}for(var _=t.nodes,b=.5*(l+f),x=.5*(h+d),w=e>=b,A=n>=x,k=A<<1|w,E=k+4;E>k;++k)if(t=_[3&k])switch(3&k){case 0:c(t,l,h,b,x);break;case 1:c(t,b,h,f,x);break;case 2:c(t,l,x,b,d);break;case 3:c(t,b,x,f,d)}}}(t,r,i,a,u),o}function gr(t,e){t=nu.rgb(t),e=nu.rgb(e);var n=t.r,r=t.g,i=t.b,a=e.r-n,u=e.g-r,o=e.b-i;return function(t){return"#"+xt(Math.round(n+a*t))+xt(Math.round(r+u*t))+xt(Math.round(i+o*t))}}function yr(t,e){var n,r={},i={};for(n in t)n in e?r[n]=_r(t[n],e[n]):i[n]=t[n];for(n in e)n in t||(i[n]=e[n]);return function(t){for(n in r)i[n]=r[n](t);return i}}function mr(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function vr(t,e){var n,r,i,a=os.lastIndex=ss.lastIndex=0,u=-1,o=[],s=[];for(t+="",e+="";(n=os.exec(t))&&(r=ss.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),o[u]?o[u]+=i:o[++u]=i),(n=n[0])===(r=r[0])?o[u]?o[u]+=r:o[++u]=r:(o[++u]=null,s.push({i:u,x:mr(n,r)})),a=ss.lastIndex;return ar;++r)o[(n=s[r]).i]=n.x(t);return o.join("")})}function _r(t,e){for(var n,r=nu.interpolators.length;--r>=0&&!(n=nu.interpolators[r](t,e)););return n}function br(t,e){var n,r=[],i=[],a=t.length,u=e.length,o=Math.min(t.length,e.length);for(n=0;o>n;++n)r.push(_r(t[n],e[n]));for(;a>n;++n)i[n]=t[n];for(;u>n;++n)i[n]=e[n];return function(t){for(n=0;o>n;++n)i[n]=r[n](t);return i}}function xr(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function wr(t){return function(e){return 1-t(1-e)}}function Ar(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function kr(t){return t*t}function Er(t){return t*t*t}function Mr(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(.5>t?n:3*(t-e)+n-.75)}function Dr(t){return function(e){return Math.pow(e,t)}}function Cr(t){return 1-Math.cos(t*Nu)}function Sr(t){return Math.pow(2,10*(t-1))}function Tr(t){return 1-Math.sqrt(1-t*t)}function Fr(t,e){var n;return arguments.length<2&&(e=.45),arguments.length?n=e/Lu*Math.asin(1/t):(t=1,n=e/4),function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-n)*Lu/e)}}function Br(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function Lr(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Ir(t,e){t=nu.hcl(t),e=nu.hcl(e);var n=t.h,r=t.c,i=t.l,a=e.h-n,u=e.c-r,o=e.l-i;return isNaN(u)&&(u=0,r=isNaN(r)?e.c:r),isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:-180>a&&(a+=360),function(t){return ht(n+a*t,r+u*t,i+o*t)+""}}function Nr(t,e){t=nu.hsl(t),e=nu.hsl(e);var n=t.h,r=t.s,i=t.l,a=e.h-n,u=e.s-r,o=e.l-i;return isNaN(u)&&(u=0,r=isNaN(r)?e.s:r),isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:-180>a&&(a+=360),function(t){return ct(n+a*t,r+u*t,i+o*t)+""}}function Or(t,e){t=nu.lab(t),e=nu.lab(e);var n=t.l,r=t.a,i=t.b,a=e.l-n,u=e.a-r,o=e.b-i;return function(t){return dt(n+a*t,r+u*t,i+o*t)+""}}function Pr(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function Rr(t){var e=[t.a,t.b],n=[t.c,t.d],r=Yr(e),i=jr(e,n),a=Yr(Ur(n,e,-i))||0;e[0]*n[1]180?l+=360:l-c>180&&(c+=360),i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:mr(c,l)})):l&&r.push(r.pop()+"rotate("+l+")"),h!=f?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:mr(h,f)}):f&&r.push(r.pop()+"skewX("+f+")"),d[0]!=p[0]||d[1]!=p[1]?(n=r.push(r.pop()+"scale(",null,",",null,")"),i.push({i:n-4,x:mr(d[0],p[0])},{i:n-2,x:mr(d[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),n=i.length,function(t){for(var e,a=-1;++a=0;)n.push(i[r])}function ei(t,e){for(var n=[t],r=[];null!=(t=n.pop());)if(r.push(t),(a=t.children)&&(i=a.length))for(var i,a,u=-1;++un;++n)(e=t[n][1])>i&&(r=n,i=e);return r}function fi(t){return t.reduce(di,0)}function di(t,e){return t+e[1]}function pi(t,e){return gi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function gi(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,a=[];++n<=e;)a[n]=i*n+r;return a}function yi(t){return[nu.min(t),nu.max(t)]}function mi(t,e){return t.value-e.value}function vi(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function _i(t,e){t._pack_next=e,e._pack_prev=t}function bi(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return.999*i*i>n*n+r*r}function xi(t){function e(t){l=Math.min(t.x-t.r,l),h=Math.max(t.x+t.r,h),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}if((n=t.children)&&(c=n.length)){var n,r,i,a,u,o,s,c,l=1/0,h=-(1/0),f=1/0,d=-(1/0);if(n.forEach(wi),r=n[0],r.x=-r.r,r.y=0,e(r),c>1&&(i=n[1],i.x=i.r,i.y=0,e(i),c>2))for(a=n[2],Ei(r,i,a),e(a),vi(r,a),r._pack_prev=a,vi(a,i),i=r._pack_next,u=3;c>u;u++){Ei(r,i,a=n[u]);var p=0,g=1,y=1;for(o=i._pack_next;o!==i;o=o._pack_next,g++)if(bi(o,a)){p=1;break}if(1==p)for(s=r._pack_prev;s!==o._pack_prev&&!bi(s,a);s=s._pack_prev,y++);p?(y>g||g==y&&i.ru;u++)a=n[u],a.x-=m,a.y-=v,_=Math.max(_,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=_,n.forEach(Ai)}}function wi(t){t._pack_next=t._pack_prev=t}function Ai(t){delete t._pack_next,delete t._pack_prev}function ki(t,e,n,r){var i=t.children;if(t.x=e+=r*t.x,t.y=n+=r*t.y,t.r*=r,i)for(var a=-1,u=i.length;++a=0;)e=i[a],e.z+=n,e.m+=n,n+=e.s+(r+=e.c)}function Fi(t,e,n){return t.a.parent===e.parent?t.a:n}function Bi(t){return 1+nu.max(t,function(t){return t.y})}function Li(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ii(t){var e=t.children;return e&&e.length?Ii(e[0]):t}function Ni(t){var e,n=t.children;return n&&(e=n.length)?Ni(n[e-1]):t}function Oi(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Pi(t,e){var n=t.x+e[3],r=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return 0>i&&(n+=i/2,i=0),0>a&&(r+=a/2,a=0),{x:n,y:r,dx:i,dy:a}}function Ri(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function ji(t){return t.rangeExtent?t.rangeExtent():Ri(t.range())}function Yi(t,e,n,r){var i=n(t[0],t[1]),a=r(e[0],e[1]);return function(t){return a(i(t))}}function Ui(t,e){var n,r=0,i=t.length-1,a=t[r],u=t[i];return a>u&&(n=r,r=i,i=n,n=a,a=u,u=n),t[r]=e.floor(a),t[i]=e.ceil(u),t}function $i(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:_s}function zi(t,e,n,r){var i=[],a=[],u=0,o=Math.min(t.length,e.length)-1;for(t[o]2?zi:Yi,s=r?qr:zr;return u=i(t,e,s,n),o=i(e,t,s,_r),a}function a(t){return u(t)}var u,o;return a.invert=function(t){return o(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Pr)},a.clamp=function(t){return arguments.length?(r=t,i()):r},a.interpolate=function(t){return arguments.length?(n=t,i()):n},a.ticks=function(e){return Vi(t,e)},a.tickFormat=function(e,n){return Xi(t,e,n)},a.nice=function(e){return Wi(t,e),i()},a.copy=function(){return qi(t,e,n,r)},i()}function Gi(t,e){return nu.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Wi(t,e){return Ui(t,$i(Hi(t,e)[2]))}function Hi(t,e){null==e&&(e=10);var n=Ri(t),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),a=e/r*i;return.15>=a?i*=10:.35>=a?i*=5:.75>=a&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function Vi(t,e){return nu.range.apply(nu,Hi(t,e))}function Xi(t,e,n){var r=Hi(t,e);if(n){var i=uo.exec(n);if(i.shift(),"s"===i[8]){var a=nu.formatPrefix(Math.max(pu(r[0]),pu(r[1])));return i[7]||(i[7]="."+Zi(a.scale(r[2]))),i[8]="f",n=nu.format(i.join("")),function(t){return n(a.scale(t))+a.symbol}}i[7]||(i[7]="."+Ki(i[8],r)),n=i.join("")}else n=",."+Zi(r[2])+"f";return nu.format(n)}function Zi(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function Ki(t,e){var n=Zi(e[2]);return t in bs?Math.abs(n-Zi(Math.max(pu(e[0]),pu(e[1]))))+ +("e"!==t):n-2*("%"===t)}function Qi(t,e,n,r){function i(t){return(n?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function u(e){return t(i(e))}return u.invert=function(e){return a(t.invert(e))},u.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((r=e.map(Number)).map(i)),u):r},u.base=function(n){return arguments.length?(e=+n,t.domain(r.map(i)),u):e},u.nice=function(){var e=Ui(r.map(i),n?Math:ws);return t.domain(e),r=e.map(a),u},u.ticks=function(){var t=Ri(r),u=[],o=t[0],s=t[1],c=Math.floor(i(o)),l=Math.ceil(i(s)),h=e%1?2:e;if(isFinite(l-c)){if(n){for(;l>c;c++)for(var f=1;h>f;f++)u.push(a(c)*f);u.push(a(c))}else for(u.push(a(c));c++0;f--)u.push(a(c)*f);for(c=0;u[c]s;l--);u=u.slice(c,l)}return u},u.tickFormat=function(t,e){if(!arguments.length)return xs;arguments.length<2?e=xs:"function"!=typeof e&&(e=nu.format(e));var r,o=Math.max(.1,t/u.ticks().length),s=n?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(t){return t/a(s(i(t)+r))<=o?e(t):""}},u.copy=function(){return Qi(t.copy(),e,n,r)},Gi(u,t)}function Ji(t,e,n){function r(e){return t(i(e))}var i=ta(e),a=ta(1/e);return r.invert=function(e){return a(t.invert(e))},r.domain=function(e){return arguments.length?(t.domain((n=e.map(Number)).map(i)),r):n},r.ticks=function(t){return Vi(n,t)},r.tickFormat=function(t,e){return Xi(n,t,e)},r.nice=function(t){return r.domain(Wi(n,t))},r.exponent=function(u){return arguments.length?(i=ta(e=u),a=ta(1/e),t.domain(n.map(i)),r):e},r.copy=function(){return Ji(t.copy(),e,n)},Gi(r,t)}function ta(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function ea(t,e){function n(n){return a[((i.get(n)||("range"===e.t?i.set(n,t.push(n)):0/0))-1)%a.length]}function r(e,n){return nu.range(t.length).map(function(t){return e+n*t})}var i,a,u;return n.domain=function(r){if(!arguments.length)return t;t=[],i=new l;for(var a,u=-1,o=r.length;++un?[0/0,0/0]:[n>0?o[n-1]:t[0],ne?0/0:e/a+t,[e,e+1/a]},r.copy=function(){return ra(t,e,n)},i()}function ia(t,e){function n(n){return n>=n?e[nu.bisect(t,n)]:void 0}return n.domain=function(e){return arguments.length?(t=e,n):t},n.range=function(t){return arguments.length?(e=t,n):e},n.invertExtent=function(n){return n=e.indexOf(n),[t[n-1],t[n]]},n.copy=function(){return ia(t,e)},n}function aa(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(n){return arguments.length?(t=n.map(e),e):t},e.ticks=function(e){return Vi(t,e)},e.tickFormat=function(e,n){return Xi(t,e,n)},e.copy=function(){return aa(t)},e}function ua(){return 0}function oa(t){return t.innerRadius}function sa(t){return t.outerRadius}function ca(t){return t.startAngle}function la(t){return t.endAngle}function ha(t){return t&&t.padAngle}function fa(t,e,n,r){return(t-n)*e-(e-r)*t>0?0:1}function da(t,e,n,r,i){var a=t[0]-e[0],u=t[1]-e[1],o=(i?r:-r)/Math.sqrt(a*a+u*u),s=o*u,c=-o*a,l=t[0]+s,h=t[1]+c,f=e[0]+s,d=e[1]+c,p=(l+f)/2,g=(h+d)/2,y=f-l,m=d-h,v=y*y+m*m,_=n-r,b=l*d-f*h,x=(0>m?-1:1)*Math.sqrt(_*_*v-b*b),w=(b*m-y*x)/v,A=(-b*y-m*x)/v,k=(b*m+y*x)/v,E=(-b*y+m*x)/v,M=w-p,D=A-g,C=k-p,S=E-g;return M*M+D*D>C*C+S*S&&(w=k,A=E),[[w-s,A-c],[w*n/_,A*n/_]]}function pa(t){function e(e){function u(){c.push("M",a(t(l),o))}for(var s,c=[],l=[],h=-1,f=e.length,d=Dt(n),p=Dt(r);++h1&&i.push("H",r[0]),i.join("")}function va(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e1){o=e[1],a=t[s],s++,r+="C"+(i[0]+u[0])+","+(i[1]+u[1])+","+(a[0]-o[0])+","+(a[1]-o[1])+","+a[0]+","+a[1];for(var c=2;c9&&(i=3*e/Math.sqrt(i),u[o]=i*n,u[o+1]=i*r));for(o=-1;++o<=s;)i=(t[Math.min(s,o+1)][0]-t[Math.max(0,o-1)][0])/(6*(1+u[o]*u[o])),a.push([i||0,u[o]*i||0]);return a}function Ia(t){return t.length<3?ga(t):t[0]+Aa(t,La(t))}function Na(t){for(var e,n,r,i=-1,a=t.length;++ir)return l();var i=a[a.active];i&&(--a.count,delete a[a.active],i.event&&i.event.interrupt.call(t,t.__data__,i.index)),a.active=r,u.event&&u.event.start.call(t,t.__data__,e),u.tween.forEach(function(n,r){(r=r.call(t,t.__data__,e))&&g.push(r)}),f=u.ease,h=u.duration,nu.timer(function(){return p.c=c(n||1)?Se:c,1},0,o)}function c(n){if(a.active!==r)return 1;for(var i=n/h,o=f(i),s=g.length;s>0;)g[--s].call(t,o);return i>=1?(u.event&&u.event.end.call(t,t.__data__,e),l()):void 0}function l(){return--a.count?delete a[r]:delete t[n],1}var h,f,d=u.delay,p=ro,g=[];return p.t=d+o,i>=d?s(i-d):void(p.c=s)},0,o)}}function Xa(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function Za(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}function Ka(t){return t.toISOString()}function Qa(t,e,n){function r(e){return t(e)}function i(t,n){var r=t[1]-t[0],i=r/n,a=nu.bisect(Hs,i);return a==Hs.length?[e.year,Hi(t.map(function(t){return t/31536e6}),n)[2]]:a?e[i/Hs[a-1]1?{floor:function(e){for(;n(e=t.floor(e));)e=Ja(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=Ja(+e+1);return e}}:t))},r.ticks=function(t,e){var n=Ri(r.domain()),a=null==t?i(n,10):"number"==typeof t?i(n,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(n[0],Ja(+n[1]+1),1>e?1:e)},r.tickFormat=function(){return n},r.copy=function(){return Qa(t.copy(),e,n)},Gi(r,t)}function Ja(t){return new Date(t)}function tu(t){return JSON.parse(t.responseText)}function eu(t){var e=au.createRange();return e.selectNode(au.body),e.createContextualFragment(t.responseText)}var nu={version:"3.5.6"},ru=[].slice,iu=function(t){return ru.call(t)},au=this.document;if(au)try{iu(au.documentElement.childNodes)[0].nodeType}catch(uu){iu=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}if(Date.now||(Date.now=function(){return+new Date}),au)try{au.createElement("DIV").style.setProperty("opacity",0,"")}catch(ou){var su=this.Element.prototype,cu=su.setAttribute,lu=su.setAttributeNS,hu=this.CSSStyleDeclaration.prototype,fu=hu.setProperty;su.setAttribute=function(t,e){cu.call(this,t,e+"")},su.setAttributeNS=function(t,e,n){lu.call(this,t,e,n+"")},hu.setProperty=function(t,e,n){fu.call(this,t,e+"",n)}}nu.ascending=r,nu.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:0/0},nu.min=function(t,e){var n,r,i=-1,a=t.length;if(1===arguments.length){for(;++i=r){n=r;break}for(;++ir&&(n=r)}else{for(;++i=r){n=r;break}for(;++ir&&(n=r)}return n},nu.max=function(t,e){var n,r,i=-1,a=t.length;if(1===arguments.length){for(;++i=r){n=r;break}for(;++in&&(n=r)}else{for(;++i=r){n=r;break}for(;++in&&(n=r)}return n},nu.extent=function(t,e){var n,r,i,a=-1,u=t.length;if(1===arguments.length){for(;++a=r){n=i=r;break}for(;++ar&&(n=r),r>i&&(i=r))}else{for(;++a=r){n=i=r;break}for(;++ar&&(n=r),r>i&&(i=r))}return[n,i]},nu.sum=function(t,e){var n,r=0,i=t.length,u=-1;if(1===arguments.length)for(;++u1?s/(l-1):void 0},nu.deviation=function(){var t=nu.variance.apply(this,arguments);return t?Math.sqrt(t):t};var du=u(r);nu.bisectLeft=du.left,nu.bisect=nu.bisectRight=du.right,nu.bisector=function(t){return u(1===t.length?function(e,n){return r(t(e),n)}:t)},nu.shuffle=function(t,e,n){(a=arguments.length)<3&&(n=t.length,2>a&&(e=0));for(var r,i,a=n-e;a;)i=Math.random()*a--|0,r=t[a+e],t[a+e]=t[i+e],t[i+e]=r;return t},nu.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},nu.pairs=function(t){for(var e,n=0,r=t.length-1,i=t[0],a=new Array(0>r?0:r);r>n;)a[n]=[e=i,i=t[++n]];return a},nu.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,e=nu.min(arguments,o),n=new Array(e);++t=0;)for(r=t[i],e=r.length;--e>=0;)n[--u]=r[e];return n};var pu=Math.abs;nu.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n===1/0)throw new Error("infinite range");var r,i=[],a=s(pu(n)),u=-1;if(t*=a,e*=a,n*=a,0>n)for(;(r=t+n*++u)>e;)i.push(r/a);else for(;(r=t+n*++u)=a.length)return r?r.call(i,u):n?u.sort(n):u;for(var s,c,h,f,d=-1,p=u.length,g=a[o++],y=new l;++d=a.length)return t;var r=[],i=u[n++];return t.forEach(function(t,i){r.push({key:t,values:e(i,n)})}),i?r.sort(function(t,e){return i(t.key,e.key)}):r}var n,r,i={},a=[],u=[];return i.map=function(e,n){return t(n,e,0)},i.entries=function(n){return e(t(nu.map,n,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return u[a.length-1]=t,i},i.sortValues=function(t){return n=t,i},i.rollup=function(t){return r=t,i},i},nu.set=function(t){var e=new v;if(t)for(var n=0,r=t.length;r>n;++n)e.add(t[n]);return e},c(v,{has:d,add:function(t){return this._[h(t+="")]=!0,t},remove:p,values:g,size:y,empty:m,forEach:function(t){for(var e in this._)t.call(this,f(e))}}),nu.behavior={},nu.rebind=function(t,e){for(var n,r=1,i=arguments.length;++r=0&&(r=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},nu.event=null,nu.requote=function(t){return t.replace(vu,"\\$&")};var vu=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,_u={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},bu=function(t,e){return e.querySelector(t)},xu=function(t,e){return e.querySelectorAll(t)},wu=function(t,e){var n=t.matches||t[x(t,"matchesSelector")];return(wu=function(t,e){return n.call(t,e)})(t,e)};"function"==typeof Sizzle&&(bu=function(t,e){return Sizzle(t,e)[0]||null},xu=Sizzle,wu=Sizzle.matchesSelector),nu.selection=function(){return nu.select(au.documentElement)};var Au=nu.selection.prototype=[];Au.select=function(t){var e,n,r,i,a=[];t=S(t);for(var u=-1,o=this.length;++u=0&&(n=t.slice(0,e),t=t.slice(e+1)),ku.hasOwnProperty(n)?{space:ku[n],local:t}:t}},Au.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return t=nu.ns.qualify(t),t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(F(e,t[e]));return this}return this.each(F(t,e))},Au.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=I(t)).length,i=-1;if(e=n.classList){for(;++ii){if("string"!=typeof t){2>i&&(e="");for(r in t)this.each(P(r,t[r],e));return this}if(2>i){var a=this.node();return n(a).getComputedStyle(a,null).getPropertyValue(t)}r=""}return this.each(P(t,e,r))},Au.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(R(e,t[e]));return this}return this.each(R(t,e))},Au.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},Au.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},Au.append=function(t){return t=j(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Au.insert=function(t,e){return t=j(t),e=S(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},Au.remove=function(){return this.each(Y)},Au.data=function(t,e){function n(t,n){var r,i,a,u=t.length,h=n.length,f=Math.min(u,h),d=new Array(h),p=new Array(h),g=new Array(u);if(e){var y,m=new l,v=new Array(u);for(r=-1;++rr;++r)p[r]=U(n[r]);for(;u>r;++r)g[r]=t[r]}p.update=d,p.parentNode=d.parentNode=g.parentNode=t.parentNode,o.push(p),s.push(d),c.push(g)}var r,i,a=-1,u=this.length;if(!arguments.length){for(t=new Array(u=(r=this[0]).length);++aa;a++){i.push(e=[]),e.parentNode=(n=this[a]).parentNode;for(var o=0,s=n.length;s>o;o++)(r=n[o])&&t.call(r,r.__data__,o,a)&&e.push(r)}return C(i)},Au.order=function(){for(var t=-1,e=this.length;++t=0;)(n=r[i])&&(a&&a!==n.nextSibling&&a.parentNode.insertBefore(n,a),a=n);return this},Au.sort=function(t){t=z.apply(this,arguments);for(var e=-1,n=this.length;++et;t++)for(var n=this[t],r=0,i=n.length;i>r;r++){var a=n[r];if(a)return a}return null},Au.size=function(){var t=0;return q(this,function(){++t}),t};var Eu=[];nu.selection.enter=G,nu.selection.enter.prototype=Eu,Eu.append=Au.append,Eu.empty=Au.empty,Eu.node=Au.node,Eu.call=Au.call,Eu.size=Au.size,Eu.select=function(t){for(var e,n,r,i,a,u=[],o=-1,s=this.length;++or){if("string"!=typeof t){2>r&&(e=!1);for(n in t)this.each(H(n,t[n],e));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;n=!1}return this.each(H(t,e,n))};var Mu=nu.map({mouseenter:"mouseover",mouseleave:"mouseout"});au&&Mu.forEach(function(t){"on"+t in au&&Mu.remove(t)});var Du,Cu=0;nu.mouse=function(t){return K(t,M())};var Su=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;nu.touch=function(t,e,n){if(arguments.length<3&&(n=e,e=M().changedTouches),e)for(var r,i=0,a=e.length;a>i;++i)if((r=e[i]).identifier===n)return K(t,r)},nu.behavior.drag=function(){function t(){this.on("mousedown.drag",a).on("touchstart.drag",u)}function e(t,e,n,a,u){return function(){function o(){var t,n,r=e(f,g);r&&(t=r[0]-_[0],n=r[1]-_[1],p|=t|n,_=r,d({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:t,dy:n}))}function s(){e(f,g)&&(m.on(a+y,null).on(u+y,null),v(p&&nu.event.target===h),d({type:"dragend"}))}var c,l=this,h=nu.event.target,f=l.parentNode,d=r.of(l,arguments),p=0,g=t(),y=".drag"+(null==g?"":"-"+g),m=nu.select(n(h)).on(a+y,o).on(u+y,s),v=Z(h),_=e(f,g);i?(c=i.apply(l,arguments),c=[c.x-_[0],c.y-_[1]]):c=[0,0],d({type:"dragstart"})}}var r=D(t,"drag","dragstart","dragend"),i=null,a=e(w,nu.mouse,n,"mousemove","mouseup"),u=e(Q,nu.touch,_,"touchmove","touchend");return t.origin=function(e){return arguments.length?(i=e,t):i},nu.rebind(t,r,"on")},nu.touches=function(t,e){return arguments.length<2&&(e=M().touches),e?iu(e).map(function(e){var n=K(t,e);return n.identifier=e.identifier,n}):[]};var Tu=1e-6,Fu=Tu*Tu,Bu=Math.PI,Lu=2*Bu,Iu=Lu-Tu,Nu=Bu/2,Ou=Bu/180,Pu=180/Bu,Ru=Math.SQRT2,ju=2,Yu=4;nu.interpolateZoom=function(t,e){function n(t){var e=t*v;if(m){var n=it(g),u=a/(ju*f)*(n*at(Ru*e+g)-rt(g));return[r+u*c,i+u*l,a*n/it(Ru*e+g)]}return[r+t*c,i+t*l,a*Math.exp(Ru*e)]}var r=t[0],i=t[1],a=t[2],u=e[0],o=e[1],s=e[2],c=u-r,l=o-i,h=c*c+l*l,f=Math.sqrt(h),d=(s*s-a*a+Yu*h)/(2*a*ju*f),p=(s*s-a*a-Yu*h)/(2*s*ju*f),g=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(p*p+1)-p),m=y-g,v=(m||Math.log(s/a))/Ru;return n.duration=1e3*v,n},nu.behavior.zoom=function(){function t(t){t.on(F,h).on($u+".zoom",d).on("dblclick.zoom",p).on(I,f)}function e(t){return[(t[0]-k.x)/k.k,(t[1]-k.y)/k.k]}function r(t){return[t[0]*k.k+k.x,t[1]*k.k+k.y]}function i(t){k.k=Math.max(C[0],Math.min(C[1],t))}function a(t,e){e=r(e),k.x+=t[0]-e[0],k.y+=t[1]-e[1]}function u(e,n,r,u){e.__chart__={x:k.x,y:k.y,k:k.k},i(Math.pow(2,u)),a(y=n,r),e=nu.select(e),S>0&&(e=e.transition().duration(S)),e.call(t.event)}function o(){x&&x.domain(b.range().map(function(t){return(t-k.x)/k.k}).map(b.invert)),A&&A.domain(w.range().map(function(t){return(t-k.y)/k.k}).map(w.invert))}function s(t){T++||t({type:"zoomstart"})}function c(t){o(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function l(t){--T||(t({type:"zoomend"}),y=null)}function h(){function t(){h=1,a(nu.mouse(i),d),c(o)}function r(){f.on(B,null).on(L,null),p(h&&nu.event.target===u),l(o)}var i=this,u=nu.event.target,o=N.of(i,arguments),h=0,f=nu.select(n(i)).on(B,t).on(L,r),d=e(nu.mouse(i)),p=Z(i);Ps.call(i),s(o)}function f(){function t(){var t=nu.touches(p);return d=k.k,t.forEach(function(t){t.identifier in y&&(y[t.identifier]=e(t))}),t}function n(){var e=nu.event.target;nu.select(e).on(b,r).on(x,o),w.push(e);for(var n=nu.event.changedTouches,i=0,a=n.length;a>i;++i)y[n[i].identifier]=null;var s=t(),c=Date.now();if(1===s.length){if(500>c-_){var l=s[0];u(p,l,y[l.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),E()}_=c}else if(s.length>1){var l=s[0],h=s[1],f=l[0]-h[0],d=l[1]-h[1];m=f*f+d*d}}function r(){var t,e,n,r,u=nu.touches(p);Ps.call(p);for(var o=0,s=u.length;s>o;++o,r=null)if(n=u[o],r=y[n.identifier]){if(e)break;t=n,e=r}if(r){var l=(l=n[0]-t[0])*l+(l=n[1]-t[1])*l,h=m&&Math.sqrt(l/m);t=[(t[0]+n[0])/2,(t[1]+n[1])/2],e=[(e[0]+r[0])/2,(e[1]+r[1])/2],i(h*d)}_=null,a(t,e),c(g)}function o(){if(nu.event.touches.length){for(var e=nu.event.changedTouches,n=0,r=e.length;r>n;++n)delete y[e[n].identifier];for(var i in y)return void t()}nu.selectAll(w).on(v,null),A.on(F,h).on(I,f),M(),l(g)}var d,p=this,g=N.of(p,arguments),y={},m=0,v=".zoom-"+nu.event.changedTouches[0].identifier,b="touchmove"+v,x="touchend"+v,w=[],A=nu.select(p),M=Z(p);n(),s(g),A.on(F,null).on(I,n)}function d(){var t=N.of(this,arguments);v?clearTimeout(v):(Ps.call(this),g=e(y=m||nu.mouse(this)),s(t)),v=setTimeout(function(){v=null,l(t)},50),E(),i(Math.pow(2,.002*Uu())*k.k),a(y,g),c(t)}function p(){var t=nu.mouse(this),n=Math.log(k.k)/Math.LN2;u(this,t,e(t),nu.event.shiftKey?Math.ceil(n)-1:Math.floor(n)+1)}var g,y,m,v,_,b,x,w,A,k={x:0,y:0,k:1},M=[960,500],C=zu,S=250,T=0,F="mousedown.zoom",B="mousemove.zoom",L="mouseup.zoom",I="touchstart.zoom",N=D(t,"zoomstart","zoom","zoomend");return $u||($u="onwheel"in au?(Uu=function(){return-nu.event.deltaY*(nu.event.deltaMode?120:1)},"wheel"):"onmousewheel"in au?(Uu=function(){return nu.event.wheelDelta},"mousewheel"):(Uu=function(){return-nu.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=N.of(this,arguments),e=k;Ns?nu.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},s(t)}).tween("zoom:zoom",function(){var n=M[0],r=M[1],i=y?y[0]:n/2,a=y?y[1]:r/2,u=nu.interpolateZoom([(i-k.x)/k.k,(a-k.y)/k.k,n/k.k],[(i-e.x)/e.k,(a-e.y)/e.k,n/e.k]);return function(e){var r=u(e),o=n/r[2];this.__chart__=k={x:i-r[0]*o,y:a-r[1]*o,k:o},c(t)}}).each("interrupt.zoom",function(){l(t)}).each("end.zoom",function(){l(t)}):(this.__chart__=k,s(t),c(t),l(t))})},t.translate=function(e){return arguments.length?(k={x:+e[0],y:+e[1],k:k.k},o(),t):[k.x,k.y]},t.scale=function(e){return arguments.length?(k={x:k.x,y:k.y,k:+e},o(),t):k.k},t.scaleExtent=function(e){return arguments.length?(C=null==e?zu:[+e[0],+e[1]],t):C},t.center=function(e){return arguments.length?(m=e&&[+e[0],+e[1]],t):m},t.size=function(e){return arguments.length?(M=e&&[+e[0],+e[1]],t):M},t.duration=function(e){return arguments.length?(S=+e,t):S},t.x=function(e){return arguments.length?(x=e,b=e.copy(),k={x:0,y:0,k:1},t):x},t.y=function(e){return arguments.length?(A=e,w=e.copy(),k={x:0,y:0,k:1},t):A},nu.rebind(t,N,"on")};var Uu,$u,zu=[0,1/0];nu.color=ot,ot.prototype.toString=function(){return this.rgb()+""},nu.hsl=st;var qu=st.prototype=new ot;qu.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new st(this.h,this.s,this.l/t)},qu.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new st(this.h,this.s,t*this.l)},qu.rgb=function(){return ct(this.h,this.s,this.l)},nu.hcl=lt;var Gu=lt.prototype=new ot;Gu.brighter=function(t){return new lt(this.h,this.c,Math.min(100,this.l+Wu*(arguments.length?t:1)))},Gu.darker=function(t){return new lt(this.h,this.c,Math.max(0,this.l-Wu*(arguments.length?t:1)))},Gu.rgb=function(){return ht(this.h,this.c,this.l).rgb()},nu.lab=ft;var Wu=18,Hu=.95047,Vu=1,Xu=1.08883,Zu=ft.prototype=new ot;Zu.brighter=function(t){return new ft(Math.min(100,this.l+Wu*(arguments.length?t:1)),this.a,this.b)},Zu.darker=function(t){return new ft(Math.max(0,this.l-Wu*(arguments.length?t:1)),this.a,this.b)},Zu.rgb=function(){return dt(this.l,this.a,this.b)},nu.rgb=vt;var Ku=vt.prototype=new ot;Ku.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,i=30;return e||n||r?(e&&i>e&&(e=i),n&&i>n&&(n=i),r&&i>r&&(r=i),new vt(Math.min(255,e/t),Math.min(255,n/t),Math.min(255,r/t))):new vt(i,i,i)},Ku.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new vt(t*this.r,t*this.g,t*this.b)},Ku.hsl=function(){return At(this.r,this.g,this.b)},Ku.toString=function(){return"#"+xt(this.r)+xt(this.g)+xt(this.b)};var Qu=nu.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Qu.forEach(function(t,e){Qu.set(t,_t(e))}),nu.functor=Dt,nu.xhr=Ct(_),nu.dsv=function(t,e){function n(t,n,a){arguments.length<3&&(a=n,n=null);var u=St(t,e,null==n?r:i(n),a);return u.row=function(t){return arguments.length?u.response(null==(n=t)?r:i(t)):n},u}function r(t){return n.parse(t.responseText)}function i(t){return function(e){return n.parse(e.responseText,t)}}function a(e){return e.map(u).join(t)}function u(t){return o.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var o=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return n.parse=function(t,e){var r;return n.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,n){return e(i(t),n)}:i})},n.parseRows=function(t,e){function n(){if(l>=c)return u;if(i)return i=!1,a;var e=l;if(34===t.charCodeAt(e)){for(var n=e;n++l;){var r=t.charCodeAt(l++),o=1;if(10===r)i=!0;else if(13===r)i=!0,10===t.charCodeAt(l)&&(++l,++o);else if(r!==s)continue;return t.slice(e,l-o)}return t.slice(e)}for(var r,i,a={},u={},o=[],c=t.length,l=0,h=0;(r=n())!==u;){for(var f=[];r!==a&&r!==u;)f.push(r),r=n();e&&null==(f=e(f,h++))||o.push(f)}return o},n.format=function(e){if(Array.isArray(e[0]))return n.formatRows(e);var r=new v,i=[];return e.forEach(function(t){for(var e in t)r.has(e)||i.push(r.add(e))}),[i.map(u).join(t)].concat(e.map(function(e){return i.map(function(t){return u(e[t])}).join(t)})).join("\n")},n.formatRows=function(t){return t.map(a).join("\n")},n},nu.csv=nu.dsv(",","text/csv"),nu.tsv=nu.dsv(" ","text/tab-separated-values");var Ju,to,eo,no,ro,io=this[x(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};nu.timer=function(t,e,n){var r=arguments.length;2>r&&(e=0),3>r&&(n=Date.now());var i=n+e,a={c:t,t:i,f:!1,n:null};to?to.n=a:Ju=a, -to=a,eo||(no=clearTimeout(no),eo=1,io(Bt))},nu.timer.flush=function(){Lt(),It()},nu.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var ao=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Ot);nu.formatPrefix=function(t,e){var n=0;return t&&(0>t&&(t*=-1),e&&(t=nu.round(t,Nt(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),ao[8+n/3]};var uo=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,oo=nu.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=nu.round(t,Nt(t,e))).toFixed(Math.max(0,Math.min(20,Nt(t*(1+1e-15),e))))}}),so=nu.time={},co=Date;jt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){lo.setUTCDate.apply(this._,arguments)},setDay:function(){lo.setUTCDay.apply(this._,arguments)},setFullYear:function(){lo.setUTCFullYear.apply(this._,arguments)},setHours:function(){lo.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){lo.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){lo.setUTCMinutes.apply(this._,arguments)},setMonth:function(){lo.setUTCMonth.apply(this._,arguments)},setSeconds:function(){lo.setUTCSeconds.apply(this._,arguments)},setTime:function(){lo.setTime.apply(this._,arguments)}};var lo=Date.prototype;so.year=Yt(function(t){return t=so.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),so.years=so.year.range,so.years.utc=so.year.utc.range,so.day=Yt(function(t){var e=new co(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),so.days=so.day.range,so.days.utc=so.day.utc.range,so.dayOfYear=function(t){var e=so.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=so[t]=Yt(function(t){return(t=so.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=so.year(t).getDay();return Math.floor((so.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});so[t+"s"]=n.range,so[t+"s"].utc=n.utc.range,so[t+"OfYear"]=function(t){var n=so.year(t).getDay();return Math.floor((so.dayOfYear(t)+(n+e)%7)/7)}}),so.week=so.sunday,so.weeks=so.sunday.range,so.weeks.utc=so.sunday.utc.range,so.weekOfYear=so.sundayOfYear;var ho={"-":"",_:" ",0:"0"},fo=/^\s*\d+/,po=/^%/;nu.locale=function(t){return{numberFormat:Pt(t),timeFormat:$t(t)}};var go=nu.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});nu.format=go.numberFormat,nu.geo={},ce.prototype={s:0,t:0,add:function(t){le(t,this.t,yo),le(yo.s,this.s,this),this.s?this.t+=yo.t:this.s=yo.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var yo=new ce;nu.geo.stream=function(t,e){t&&mo.hasOwnProperty(t.type)?mo[t.type](t,e):he(t,e)};var mo={Feature:function(t,e){he(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++rt?4*Bu+t:t,xo.lineStart=xo.lineEnd=xo.point=w}};nu.geo.bounds=function(){function t(t,e){_.push(b=[l=t,f=t]),h>e&&(h=e),e>d&&(d=e)}function e(e,n){var r=ge([e*Ou,n*Ou]);if(m){var i=me(m,r),a=[i[1],-i[0],0],u=me(a,i);be(u),u=xe(u);var s=e-p,c=s>0?1:-1,g=u[0]*Pu*c,y=pu(s)>180;if(y^(g>c*p&&c*e>g)){var v=u[1]*Pu;v>d&&(d=v)}else if(g=(g+360)%360-180,y^(g>c*p&&c*e>g)){var v=-u[1]*Pu;h>v&&(h=v)}else h>n&&(h=n),n>d&&(d=n);y?p>e?o(l,e)>o(l,f)&&(f=e):o(e,f)>o(l,f)&&(l=e):f>=l?(l>e&&(l=e),e>f&&(f=e)):e>p?o(l,e)>o(l,f)&&(f=e):o(e,f)>o(l,f)&&(l=e)}else t(e,n);m=r,p=e}function n(){x.point=e}function r(){b[0]=l,b[1]=f,x.point=t,m=null}function i(t,n){if(m){var r=t-p;v+=pu(r)>180?r+(r>0?360:-360):r}else g=t,y=n;xo.point(t,n),e(t,n)}function a(){xo.lineStart()}function u(){i(g,y),xo.lineEnd(),pu(v)>Tu&&(l=-(f=180)),b[0]=l,b[1]=f,m=null}function o(t,e){return(e-=t)<0?e+360:e}function s(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tbo?(l=-(f=180),h=-(d=90)):v>Tu?d=90:-Tu>v&&(h=-90),b[0]=l,b[1]=f}};return function(t){d=f=-(l=h=1/0),_=[],nu.geo.stream(t,x);var e=_.length;if(e){_.sort(s);for(var n,r=1,i=_[0],a=[i];e>r;++r)n=_[r],c(n[0],i)||c(n[1],i)?(o(i[0],n[1])>o(i[0],i[1])&&(i[1]=n[1]),o(n[0],i[1])>o(i[0],i[1])&&(i[0]=n[0])):a.push(i=n);for(var u,n,p=-(1/0),e=a.length-1,r=0,i=a[e];e>=r;i=n,++r)n=a[r],(u=o(i[1],n[0]))>p&&(p=u,l=n[0],f=i[1])}return _=b=null,l===1/0||h===1/0?[[0/0,0/0],[0/0,0/0]]:[[l,h],[f,d]]}}(),nu.geo.centroid=function(t){wo=Ao=ko=Eo=Mo=Do=Co=So=To=Fo=Bo=0,nu.geo.stream(t,Lo);var e=To,n=Fo,r=Bo,i=e*e+n*n+r*r;return Fu>i&&(e=Do,n=Co,r=So,Tu>Ao&&(e=ko,n=Eo,r=Mo),i=e*e+n*n+r*r,Fu>i)?[0/0,0/0]:[Math.atan2(n,e)*Pu,nt(r/Math.sqrt(i))*Pu]};var wo,Ao,ko,Eo,Mo,Do,Co,So,To,Fo,Bo,Lo={sphere:w,point:Ae,lineStart:Ee,lineEnd:Me,polygonStart:function(){Lo.lineStart=De},polygonEnd:function(){Lo.lineStart=Ee}},Io=Le(Se,Pe,je,[-Bu,-Bu/2]),No=1e9;nu.geo.clipExtent=function(){var t,e,n,r,i,a,u={stream:function(t){return i&&(i.valid=!1),i=a(t),i.valid=!0,i},extent:function(o){return arguments.length?(a=ze(t=+o[0][0],e=+o[0][1],n=+o[1][0],r=+o[1][1]),i&&(i.valid=!1,i=null),u):[[t,e],[n,r]]}};return u.extent([[0,0],[960,500]])},(nu.geo.conicEqualArea=function(){return qe(Ge)}).raw=Ge,nu.geo.albers=function(){return nu.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},nu.geo.albersUsa=function(){function t(t){var a=t[0],u=t[1];return e=null,n(a,u),e||(r(a,u),e)||i(a,u),e}var e,n,r,i,a=nu.geo.albers(),u=nu.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o=nu.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,n){e=[t,n]}};return t.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?u:i>=.166&&.234>i&&r>=-.214&&-.115>r?o:a).invert(t)},t.stream=function(t){var e=a.stream(t),n=u.stream(t),r=o.stream(t);return{point:function(t,i){e.point(t,i),n.point(t,i),r.point(t,i)},sphere:function(){e.sphere(),n.sphere(),r.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),u.precision(e),o.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),u.scale(.35*e),o.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var c=a.scale(),l=+e[0],h=+e[1];return n=a.translate(e).clipExtent([[l-.455*c,h-.238*c],[l+.455*c,h+.238*c]]).stream(s).point,r=u.translate([l-.307*c,h+.201*c]).clipExtent([[l-.425*c+Tu,h+.12*c+Tu],[l-.214*c-Tu,h+.234*c-Tu]]).stream(s).point,i=o.translate([l-.205*c,h+.212*c]).clipExtent([[l-.214*c+Tu,h+.166*c+Tu],[l-.115*c-Tu,h+.234*c-Tu]]).stream(s).point,t},t.scale(1070)};var Oo,Po,Ro,jo,Yo,Uo,$o={point:w,lineStart:w,lineEnd:w,polygonStart:function(){Po=0,$o.lineStart=We},polygonEnd:function(){$o.lineStart=$o.lineEnd=$o.point=w,Oo+=pu(Po/2)}},zo={point:He,lineStart:w,lineEnd:w,polygonStart:w,polygonEnd:w},qo={point:Ze,lineStart:Ke,lineEnd:Qe,polygonStart:function(){qo.lineStart=Je},polygonEnd:function(){qo.point=Ze,qo.lineStart=Ke,qo.lineEnd=Qe}};nu.geo.path=function(){function t(t){return t&&("function"==typeof o&&a.pointRadius(+o.apply(this,arguments)),u&&u.valid||(u=i(a)),nu.geo.stream(t,u)),a.result()}function e(){return u=null,t}var n,r,i,a,u,o=4.5;return t.area=function(t){return Oo=0,nu.geo.stream(t,i($o)),Oo},t.centroid=function(t){return ko=Eo=Mo=Do=Co=So=To=Fo=Bo=0,nu.geo.stream(t,i(qo)),Bo?[To/Bo,Fo/Bo]:So?[Do/So,Co/So]:Mo?[ko/Mo,Eo/Mo]:[0/0,0/0]},t.bounds=function(t){return Yo=Uo=-(Ro=jo=1/0),nu.geo.stream(t,i(zo)),[[Ro,jo],[Yo,Uo]]},t.projection=function(t){return arguments.length?(i=(n=t)?t.stream||nn(t):_,e()):n},t.context=function(t){return arguments.length?(a=null==(r=t)?new Ve:new tn(t),"function"!=typeof o&&a.pointRadius(o),e()):r},t.pointRadius=function(e){return arguments.length?(o="function"==typeof e?e:(a.pointRadius(+e),+e),t):o},t.projection(nu.geo.albersUsa()).context(null)},nu.geo.transform=function(t){return{stream:function(e){var n=new rn(e);for(var r in t)n[r]=t[r];return n}}},rn.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},nu.geo.projection=un,nu.geo.projectionMutator=on,(nu.geo.equirectangular=function(){return un(cn)}).raw=cn.invert=cn,nu.geo.rotation=function(t){function e(e){return e=t(e[0]*Ou,e[1]*Ou),e[0]*=Pu,e[1]*=Pu,e}return t=hn(t[0]%360*Ou,t[1]*Ou,t.length>2?t[2]*Ou:0),e.invert=function(e){return e=t.invert(e[0]*Ou,e[1]*Ou),e[0]*=Pu,e[1]*=Pu,e},e},ln.invert=cn,nu.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=hn(-t[0]*Ou,-t[1]*Ou,0).invert,i=[];return n(null,null,1,{point:function(t,n){i.push(t=e(t,n)),t[0]*=Pu,t[1]*=Pu}}),{type:"Polygon",coordinates:[i]}}var e,n,r=[0,0],i=6;return t.origin=function(e){return arguments.length?(r=e,t):r},t.angle=function(r){return arguments.length?(n=gn((e=+r)*Ou,i*Ou),t):e},t.precision=function(r){return arguments.length?(n=gn(e*Ou,(i=+r)*Ou),t):i},t.angle(90)},nu.geo.distance=function(t,e){var n,r=(e[0]-t[0])*Ou,i=t[1]*Ou,a=e[1]*Ou,u=Math.sin(r),o=Math.cos(r),s=Math.sin(i),c=Math.cos(i),l=Math.sin(a),h=Math.cos(a);return Math.atan2(Math.sqrt((n=h*u)*n+(n=c*l-s*h*o)*n),s*l+c*h*o)},nu.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return nu.range(Math.ceil(a/y)*y,i,y).map(f).concat(nu.range(Math.ceil(c/m)*m,s,m).map(d)).concat(nu.range(Math.ceil(r/p)*p,n,p).filter(function(t){return pu(t%y)>Tu}).map(l)).concat(nu.range(Math.ceil(o/g)*g,u,g).filter(function(t){return pu(t%m)>Tu}).map(h))}var n,r,i,a,u,o,s,c,l,h,f,d,p=10,g=p,y=90,m=360,v=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(s).slice(1),f(i).reverse().slice(1),d(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],c=+e[0][1],s=+e[1][1],a>i&&(e=a,a=i,i=e),c>s&&(e=c,c=s,s=e),t.precision(v)):[[a,c],[i,s]]},t.minorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],o=+e[0][1],u=+e[1][1],r>n&&(e=r,r=n,n=e),o>u&&(e=o,o=u,u=e),t.precision(v)):[[r,o],[n,u]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(y=+e[0],m=+e[1],t):[y,m]},t.minorStep=function(e){return arguments.length?(p=+e[0],g=+e[1],t):[p,g]},t.precision=function(e){return arguments.length?(v=+e,l=mn(o,u,90),h=vn(r,n,v),f=mn(c,s,90),d=vn(a,i,v),t):v},t.majorExtent([[-180,-90+Tu],[180,90-Tu]]).minorExtent([[-180,-80-Tu],[180,80+Tu]])},nu.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||i.apply(this,arguments)]}}var e,n,r=_n,i=bn;return t.distance=function(){return nu.geo.distance(e||r.apply(this,arguments),n||i.apply(this,arguments))},t.source=function(n){return arguments.length?(r=n,e="function"==typeof n?null:n,t):r},t.target=function(e){return arguments.length?(i=e,n="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},nu.geo.interpolate=function(t,e){return xn(t[0]*Ou,t[1]*Ou,e[0]*Ou,e[1]*Ou)},nu.geo.length=function(t){return Go=0,nu.geo.stream(t,Wo),Go};var Go,Wo={sphere:w,point:w,lineStart:wn,lineEnd:w,polygonStart:w,polygonEnd:w},Ho=An(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(nu.geo.azimuthalEqualArea=function(){return un(Ho)}).raw=Ho;var Vo=An(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},_);(nu.geo.azimuthalEquidistant=function(){return un(Vo)}).raw=Vo,(nu.geo.conicConformal=function(){return qe(kn)}).raw=kn,(nu.geo.conicEquidistant=function(){return qe(En)}).raw=En;var Xo=An(function(t){return 1/t},Math.atan);(nu.geo.gnomonic=function(){return un(Xo)}).raw=Xo,Mn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Nu]},(nu.geo.mercator=function(){return Dn(Mn)}).raw=Mn;var Zo=An(function(){return 1},Math.asin);(nu.geo.orthographic=function(){return un(Zo)}).raw=Zo;var Ko=An(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(nu.geo.stereographic=function(){return un(Ko)}).raw=Ko,Cn.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Nu]},(nu.geo.transverseMercator=function(){var t=Dn(Cn),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90])}).raw=Cn,nu.geom={},nu.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=Dt(n),a=Dt(r),u=t.length,o=[],s=[];for(e=0;u>e;e++)o.push([+i.call(this,t[e],e),+a.call(this,t[e],e),e]);for(o.sort(Bn),e=0;u>e;e++)s.push([o[e][0],-o[e][1]]);var c=Fn(o),l=Fn(s),h=l[0]===c[0],f=l[l.length-1]===c[c.length-1],d=[];for(e=c.length-1;e>=0;--e)d.push(t[o[c[e]][2]]);for(e=+h;e=r&&c.x<=a&&c.y>=i&&c.y<=u?[[r,u],[a,u],[a,i],[r,i]]:[];l.point=t[o]}),e}function n(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Tu)*Tu,y:Math.round(u(t,e)/Tu)*Tu,i:e}})}var r=Sn,i=Tn,a=r,u=i,o=us;return t?e(t):(e.links=function(t){return or(n(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return or(n(t)).cells.forEach(function(n,r){for(var i,a,u=n.site,o=n.edges.sort(Gn),s=-1,c=o.length,l=o[c-1].edge,h=l.l===u?l.r:l.l;++s=c,f=r>=l,d=f<<1|h;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]=fr()),h?i=c:o=c,f?u=l:s=l,a(t,e,n,r,i,u,o,s)}var l,h,f,d,p,g,y,m,v,_=Dt(o),b=Dt(s);if(null!=e)g=e,y=n,m=r,v=i;else if(m=v=-(g=y=1/0),h=[],f=[],p=t.length,u)for(d=0;p>d;++d)l=t[d],l.xm&&(m=l.x),l.y>v&&(v=l.y),h.push(l.x),f.push(l.y);else for(d=0;p>d;++d){var x=+_(l=t[d],d),w=+b(l,d);g>x&&(g=x),y>w&&(y=w),x>m&&(m=x),w>v&&(v=w),h.push(x),f.push(w)}var A=m-g,k=v-y;A>k?v=y+A:m=g+k;var E=fr();if(E.add=function(t){a(E,t,+_(t,++d),+b(t,d),g,y,m,v)},E.visit=function(t){dr(t,E,g,y,m,v)},E.find=function(t){return pr(E,t[0],t[1],g,y,m,v)},d=-1,null==e){for(;++d=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";return n=ls.get(n)||cs,r=hs.get(r)||_,xr(r(n.apply(null,ru.call(arguments,1))))},nu.interpolateHcl=Ir,nu.interpolateHsl=Nr,nu.interpolateLab=Or,nu.interpolateRound=Pr,nu.transform=function(t){var e=au.createElementNS(nu.ns.prefix.svg,"g");return(nu.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Rr(n?n.matrix:fs)})(t)},Rr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var fs={a:1,b:0,c:0,d:1,e:0,f:0};nu.interpolateTransform=$r,nu.layout={},nu.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++no*o/y){if(p>s){var c=e.charge/s;t.px-=a*c,t.py-=u*c}return!0}if(e.point&&s&&p>s){var c=e.pointCharge/s;t.px-=a*c,t.py-=u*c}}return!e.charge}}function e(t){t.px=nu.event.x,t.py=nu.event.y,o.resume()}var n,r,i,a,u,o={},s=nu.dispatch("start","tick","end"),c=[1,1],l=.9,h=ds,f=ps,d=-30,p=gs,g=.1,y=.64,m=[],v=[];return o.tick=function(){if((r*=.99)<.005)return s.end({type:"end",alpha:r=0}),!0;var e,n,o,h,f,p,y,_,b,x=m.length,w=v.length;for(n=0;w>n;++n)o=v[n],h=o.source,f=o.target,_=f.x-h.x,b=f.y-h.y,(p=_*_+b*b)&&(p=r*a[n]*((p=Math.sqrt(p))-i[n])/p,_*=p,b*=p,f.x-=_*(y=h.weight/(f.weight+h.weight)),f.y-=b*y,h.x+=_*(y=1-y),h.y+=b*y);if((y=r*g)&&(_=c[0]/2,b=c[1]/2,n=-1,y))for(;++n0?t:0:t>0&&(s.start({type:"start",alpha:r=t}),nu.timer(o.tick)),o):r},o.start=function(){function t(t,r){if(!n){for(n=new Array(s),o=0;s>o;++o)n[o]=[];for(o=0;l>o;++o){var i=v[o];n[i.source.index].push(i.target),n[i.target.index].push(i.source)}}for(var a,u=n[e],o=-1,c=u.length;++oe;++e)(r=m[e]).index=e,r.weight=0;for(e=0;l>e;++e)r=v[e],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(e=0;s>e;++e)r=m[e],isNaN(r.x)&&(r.x=t("x",p)),isNaN(r.y)&&(r.y=t("y",g)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof h)for(e=0;l>e;++e)i[e]=+h.call(this,v[e],e);else for(e=0;l>e;++e)i[e]=h;if(a=[],"function"==typeof f)for(e=0;l>e;++e)a[e]=+f.call(this,v[e],e);else for(e=0;l>e;++e)a[e]=f;if(u=[],"function"==typeof d)for(e=0;s>e;++e)u[e]=+d.call(this,m[e],e);else for(e=0;s>e;++e)u[e]=d;return o.resume()},o.resume=function(){return o.alpha(.1)},o.stop=function(){return o.alpha(0)},o.drag=function(){return n||(n=nu.behavior.drag().origin(_).on("dragstart.force",Vr).on("drag.force",e).on("dragend.force",Xr)),arguments.length?void this.on("mouseover.force",Zr).on("mouseout.force",Kr).call(n):n},nu.rebind(o,s,"on")};var ds=20,ps=1,gs=1/0;nu.layout.hierarchy=function(){function t(i){var a,u=[i],o=[];for(i.depth=0;null!=(a=u.pop());)if(o.push(a),(c=n.call(t,a,a.depth))&&(s=c.length)){for(var s,c,l;--s>=0;)u.push(l=c[s]),l.parent=a,l.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(t,a,a.depth)||0),delete a.children;return ei(i,function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)}),o}var e=ii,n=ni,r=ri;return t.sort=function(n){return arguments.length?(e=n,t):e},t.children=function(e){return arguments.length?(n=e,t):n},t.value=function(e){return arguments.length?(r=e,t):r},t.revalue=function(e){return r&&(ti(e,function(t){t.children&&(t.value=0)}),ei(e,function(e){var n;e.children||(e.value=+r.call(t,e,e.depth)||0),(n=e.parent)&&(n.value+=e.value)})),e},t},nu.layout.partition=function(){function t(e,n,r,i){var a=e.children;if(e.x=n,e.y=e.depth*i,e.dx=r,e.dy=i,a&&(u=a.length)){var u,o,s,c=-1;for(r=e.value?r/e.value:0;++ch?-1:1),p=(h-s*d)/nu.sum(c),g=nu.range(s),y=[];return null!=n&&g.sort(n===ys?function(t,e){return c[e]-c[t]}:function(t,e){return n(u[t],u[e])}),g.forEach(function(t){y[t]={data:u[t],value:o=c[t],startAngle:l,endAngle:l+=o*p+d,padAngle:f}}),y}var e=Number,n=ys,r=0,i=Lu,a=0;return t.value=function(n){return arguments.length?(e=n,t):e},t.sort=function(e){return arguments.length?(n=e,t):n},t.startAngle=function(e){return arguments.length?(r=e,t):r},t.endAngle=function(e){return arguments.length?(i=e,t):i},t.padAngle=function(e){return arguments.length?(a=e,t):a},t};var ys={};nu.layout.stack=function(){function t(o,s){if(!(f=o.length))return o;var c=o.map(function(n,r){return e.call(t,n,r)}),l=c.map(function(e){return e.map(function(e,n){return[a.call(t,e,n),u.call(t,e,n)]})}),h=n.call(t,l,s);c=nu.permute(c,h),l=nu.permute(l,h);var f,d,p,g,y=r.call(t,l,s),m=c[0].length;for(p=0;m>p;++p)for(i.call(t,c[0][p],g=y[p],l[0][p][1]),d=1;f>d;++d)i.call(t,c[d][p],g+=l[d-1][p][1],l[d][p][1]);return o}var e=_,n=ci,r=li,i=si,a=ui,u=oi;return t.values=function(n){return arguments.length?(e=n,t):e},t.order=function(e){return arguments.length?(n="function"==typeof e?e:ms.get(e)||ci,t):n},t.offset=function(e){return arguments.length?(r="function"==typeof e?e:vs.get(e)||li,t):r},t.x=function(e){return arguments.length?(a=e,t):a},t.y=function(e){return arguments.length?(u=e,t):u},t.out=function(e){return arguments.length?(i=e,t):i},t};var ms=nu.map({"inside-out":function(t){var e,n,r=t.length,i=t.map(hi),a=t.map(fi),u=nu.range(r).sort(function(t,e){return i[t]-i[e]}),o=0,s=0,c=[],l=[];for(e=0;r>e;++e)n=u[e],s>o?(o+=a[n],c.push(n)):(s+=a[n],l.push(n));return l.reverse().concat(c)},reverse:function(t){return nu.range(t.length).reverse()},"default":ci}),vs=nu.map({silhouette:function(t){var e,n,r,i=t.length,a=t[0].length,u=[],o=0,s=[];for(n=0;a>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];r>o&&(o=r),u.push(r)}for(n=0;a>n;++n)s[n]=(o-u[n])/2;return s},wiggle:function(t){var e,n,r,i,a,u,o,s,c,l=t.length,h=t[0],f=h.length,d=[];for(d[0]=s=c=0,n=1;f>n;++n){for(e=0,i=0;l>e;++e)i+=t[e][n][1];for(e=0,a=0,o=h[n][0]-h[n-1][0];l>e;++e){for(r=0,u=(t[e][n][1]-t[e][n-1][1])/(2*o);e>r;++r)u+=(t[r][n][1]-t[r][n-1][1])/o;a+=u*t[e][n][1]}d[n]=s-=i?a/i*o:0,c>s&&(c=s)}for(n=0;f>n;++n)d[n]-=c;return d},expand:function(t){var e,n,r,i=t.length,a=t[0].length,u=1/i,o=[];for(n=0;a>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];if(r)for(e=0;i>e;e++)t[e][n][1]/=r;else for(e=0;i>e;e++)t[e][n][1]=u}for(n=0;a>n;++n)o[n]=0;return o},zero:li});nu.layout.histogram=function(){function t(t,a){for(var u,o,s=[],c=t.map(n,this),l=r.call(this,c,a),h=i.call(this,l,c,a),a=-1,f=c.length,d=h.length-1,p=e?1:1/f;++a0)for(a=-1;++a=l[0]&&o<=l[1]&&(u=s[nu.bisect(h,o,1,d)-1],u.y+=p,u.push(t[a]));return s}var e=!0,n=Number,r=yi,i=pi;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(r=Dt(e),t):r},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return gi(t,e)}:Dt(e),t):i},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},nu.layout.pack=function(){function t(t,a){var u=n.call(this,t,a),o=u[0],s=i[0],c=i[1],l=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(o.x=o.y=0,ei(o,function(t){t.r=+l(t.value)}),ei(o,xi),r){var h=r*(e?1:Math.max(2*o.r/s,2*o.r/c))/2;ei(o,function(t){t.r+=h; - -}),ei(o,xi),ei(o,function(t){t.r-=h})}return ki(o,s/2,c/2,e?1:1/Math.max(2*o.r/s,2*o.r/c)),u}var e,n=nu.layout.hierarchy().sort(mi),r=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(n){return arguments.length?(e=null==n||"function"==typeof n?n:+n,t):e},t.padding=function(e){return arguments.length?(r=+e,t):r},Jr(t,n)},nu.layout.tree=function(){function t(t,i){var l=u.call(this,t,i),h=l[0],f=e(h);if(ei(f,n),f.parent.m=-f.z,ti(f,r),c)ti(h,a);else{var d=h,p=h,g=h;ti(h,function(t){t.xp.x&&(p=t),t.depth>g.depth&&(g=t)});var y=o(d,p)/2-d.x,m=s[0]/(p.x+o(p,d)/2+y),v=s[1]/(g.depth||1);ti(h,function(t){t.x=(t.x+y)*m,t.y=t.depth*v})}return l}function e(t){for(var e,n={A:null,children:[t]},r=[n];null!=(e=r.pop());)for(var i,a=e.children,u=0,o=a.length;o>u;++u)r.push((a[u]=i={_:a[u],parent:e,children:(i=a[u].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:u}).a=i);return n.children[0]}function n(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e.length){Ti(t);var a=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+o(t._,r._),t.m=t.z-a):t.z=a}else r&&(t.z=r.z+o(t._,r._));t.parent.A=i(t,r,t.parent.A||n[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function i(t,e,n){if(e){for(var r,i=t,a=t,u=e,s=i.parent.children[0],c=i.m,l=a.m,h=u.m,f=s.m;u=Ci(u),i=Di(i),u&&i;)s=Di(s),a=Ci(a),a.a=t,r=u.z+h-i.z-c+o(u._,i._),r>0&&(Si(Fi(u,t,n),t,r),c+=r,l+=r),h+=u.m,c+=i.m,f+=s.m,l+=a.m;u&&!Ci(a)&&(a.t=u,a.m+=h-l),i&&!Di(s)&&(s.t=i,s.m+=c-f,n=t)}return n}function a(t){t.x*=s[0],t.y=t.depth*s[1]}var u=nu.layout.hierarchy().sort(null).value(null),o=Mi,s=[1,1],c=null;return t.separation=function(e){return arguments.length?(o=e,t):o},t.size=function(e){return arguments.length?(c=null==(s=e)?a:null,t):c?null:s},t.nodeSize=function(e){return arguments.length?(c=null==(s=e)?null:a,t):c?s:null},Jr(t,u)},nu.layout.cluster=function(){function t(t,a){var u,o=e.call(this,t,a),s=o[0],c=0;ei(s,function(t){var e=t.children;e&&e.length?(t.x=Li(e),t.y=Bi(e)):(t.x=u?c+=n(t,u):0,t.y=0,u=t)});var l=Ii(s),h=Ni(s),f=l.x-n(l,h)/2,d=h.x+n(h,l)/2;return ei(s,i?function(t){t.x=(t.x-s.x)*r[0],t.y=(s.y-t.y)*r[1]}:function(t){t.x=(t.x-f)/(d-f)*r[0],t.y=(1-(s.y?t.y/s.y:1))*r[1]}),o}var e=nu.layout.hierarchy().sort(null).value(null),n=Mi,r=[1,1],i=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(i=null==(r=e),t):i?null:r},t.nodeSize=function(e){return arguments.length?(i=null!=(r=e),t):i?r:null},Jr(t,e)},nu.layout.treemap=function(){function t(t,e){for(var n,r,i=-1,a=t.length;++ie?0:e),n.area=isNaN(r)||0>=r?0:r}function e(n){var a=n.children;if(a&&a.length){var u,o,s,c=h(n),l=[],f=a.slice(),p=1/0,g="slice"===d?c.dx:"dice"===d?c.dy:"slice-dice"===d?1&n.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(t(f,c.dx*c.dy/n.value),l.area=0;(s=f.length)>0;)l.push(u=f[s-1]),l.area+=u.area,"squarify"!==d||(o=r(l,g))<=p?(f.pop(),p=o):(l.area-=l.pop().area,i(l,g,c,!1),g=Math.min(c.dx,c.dy),l.length=l.area=0,p=1/0);l.length&&(i(l,g,c,!0),l.length=l.area=0),a.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var a,u=h(e),o=r.slice(),s=[];for(t(o,u.dx*u.dy/e.value),s.area=0;a=o.pop();)s.push(a),s.area+=a.area,null!=a.z&&(i(s,a.z?u.dx:u.dy,u,!o.length),s.length=s.area=0);r.forEach(n)}}function r(t,e){for(var n,r=t.area,i=0,a=1/0,u=-1,o=t.length;++un&&(a=n),n>i&&(i=n));return r*=r,e*=e,r?Math.max(e*i*p/r,r/(e*a*p)):1/0}function i(t,e,n,r){var i,a=-1,u=t.length,o=n.x,c=n.y,l=e?s(t.area/e):0;if(e==n.dx){for((r||l>n.dy)&&(l=n.dy);++an.dx)&&(l=n.dx);++an&&(e=1),1>n&&(t=0),function(){var n,r,i;do n=2*Math.random()-1,r=2*Math.random()-1,i=n*n+r*r;while(!i||i>1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=nu.random.normal.apply(nu,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=nu.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;t>n;n++)e+=Math.random();return e}}},nu.scale={};var _s={floor:_,ceil:_};nu.scale.linear=function(){return qi([0,1],[0,1],_r,!1)};var bs={s:1,g:1,p:1,r:1,e:1};nu.scale.log=function(){return Qi(nu.scale.linear().domain([0,1]),10,!0,[1,10])};var xs=nu.format(".0e"),ws={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};nu.scale.pow=function(){return Ji(nu.scale.linear(),1,[0,1])},nu.scale.sqrt=function(){return nu.scale.pow().exponent(.5)},nu.scale.ordinal=function(){return ea([],{t:"range",a:[[]]})},nu.scale.category10=function(){return nu.scale.ordinal().range(As)},nu.scale.category20=function(){return nu.scale.ordinal().range(ks)},nu.scale.category20b=function(){return nu.scale.ordinal().range(Es)},nu.scale.category20c=function(){return nu.scale.ordinal().range(Ms)};var As=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(bt),ks=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(bt),Es=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(bt),Ms=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(bt);nu.scale.quantile=function(){return na([],[])},nu.scale.quantize=function(){return ra(0,1,[0,1])},nu.scale.threshold=function(){return ia([.5],[0,1])},nu.scale.identity=function(){return aa([0,1])},nu.svg={},nu.svg.arc=function(){function t(){var t=Math.max(0,+n.apply(this,arguments)),c=Math.max(0,+r.apply(this,arguments)),l=u.apply(this,arguments)-Nu,h=o.apply(this,arguments)-Nu,f=Math.abs(h-l),d=l>h?0:1;if(t>c&&(p=c,c=t,t=p),f>=Iu)return e(c,d)+(t?e(t,1-d):"")+"Z";var p,g,y,m,v,_,b,x,w,A,k,E,M=0,D=0,C=[];if((m=(+s.apply(this,arguments)||0)/2)&&(y=a===Ds?Math.sqrt(t*t+c*c):+a.apply(this,arguments),d||(D*=-1),c&&(D=nt(y/c*Math.sin(m))),t&&(M=nt(y/t*Math.sin(m)))),c){v=c*Math.cos(l+D),_=c*Math.sin(l+D),b=c*Math.cos(h-D),x=c*Math.sin(h-D);var S=Math.abs(h-l-2*D)<=Bu?0:1;if(D&&fa(v,_,b,x)===d^S){var T=(l+h)/2;v=c*Math.cos(T),_=c*Math.sin(T),b=x=null}}else v=_=0;if(t){w=t*Math.cos(h-M),A=t*Math.sin(h-M),k=t*Math.cos(l+M),E=t*Math.sin(l+M);var F=Math.abs(l-h+2*M)<=Bu?0:1;if(M&&fa(w,A,k,E)===1-d^F){var B=(l+h)/2;w=t*Math.cos(B),A=t*Math.sin(B),k=E=null}}else w=A=0;if((p=Math.min(Math.abs(c-t)/2,+i.apply(this,arguments)))>.001){g=c>t^d?0:1;var L=null==k?[w,A]:null==b?[v,_]:In([v,_],[k,E],[b,x],[w,A]),I=v-L[0],N=_-L[1],O=b-L[0],P=x-L[1],R=1/Math.sin(Math.acos((I*O+N*P)/(Math.sqrt(I*I+N*N)*Math.sqrt(O*O+P*P)))/2),j=Math.sqrt(L[0]*L[0]+L[1]*L[1]);if(null!=b){var Y=Math.min(p,(c-j)/(R+1)),U=da(null==k?[w,A]:[k,E],[v,_],c,Y,d),$=da([b,x],[w,A],c,Y,d);p===Y?C.push("M",U[0],"A",Y,",",Y," 0 0,",g," ",U[1],"A",c,",",c," 0 ",1-d^fa(U[1][0],U[1][1],$[1][0],$[1][1]),",",d," ",$[1],"A",Y,",",Y," 0 0,",g," ",$[0]):C.push("M",U[0],"A",Y,",",Y," 0 1,",g," ",$[0])}else C.push("M",v,",",_);if(null!=k){var z=Math.min(p,(t-j)/(R-1)),q=da([v,_],[k,E],t,-z,d),G=da([w,A],null==b?[v,_]:[b,x],t,-z,d);p===z?C.push("L",G[0],"A",z,",",z," 0 0,",g," ",G[1],"A",t,",",t," 0 ",d^fa(G[1][0],G[1][1],q[1][0],q[1][1]),",",1-d," ",q[1],"A",z,",",z," 0 0,",g," ",q[0]):C.push("L",G[0],"A",z,",",z," 0 0,",g," ",q[0])}else C.push("L",w,",",A)}else C.push("M",v,",",_),null!=b&&C.push("A",c,",",c," 0 ",S,",",d," ",b,",",x),C.push("L",w,",",A),null!=k&&C.push("A",t,",",t," 0 ",F,",",1-d," ",k,",",E);return C.push("Z"),C.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var n=oa,r=sa,i=ua,a=Ds,u=ca,o=la,s=ha;return t.innerRadius=function(e){return arguments.length?(n=Dt(e),t):n},t.outerRadius=function(e){return arguments.length?(r=Dt(e),t):r},t.cornerRadius=function(e){return arguments.length?(i=Dt(e),t):i},t.padRadius=function(e){return arguments.length?(a=e==Ds?Ds:Dt(e),t):a},t.startAngle=function(e){return arguments.length?(u=Dt(e),t):u},t.endAngle=function(e){return arguments.length?(o=Dt(e),t):o},t.padAngle=function(e){return arguments.length?(s=Dt(e),t):s},t.centroid=function(){var t=(+n.apply(this,arguments)+ +r.apply(this,arguments))/2,e=(+u.apply(this,arguments)+ +o.apply(this,arguments))/2-Nu;return[Math.cos(e)*t,Math.sin(e)*t]},t};var Ds="auto";nu.svg.line=function(){return pa(_)};var Cs=nu.map({linear:ga,"linear-closed":ya,step:ma,"step-before":va,"step-after":_a,basis:Ea,"basis-open":Ma,"basis-closed":Da,bundle:Ca,cardinal:wa,"cardinal-open":ba,"cardinal-closed":xa,monotone:Ia});Cs.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Ss=[0,2/3,1/3,0],Ts=[0,1/3,2/3,0],Fs=[0,1/6,2/3,1/6];nu.svg.line.radial=function(){var t=pa(Na);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},va.reverse=_a,_a.reverse=va,nu.svg.area=function(){return Oa(_)},nu.svg.area.radial=function(){var t=Oa(Na);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},nu.svg.chord=function(){function t(t,o){var s=e(this,a,t,o),c=e(this,u,t,o);return"M"+s.p0+r(s.r,s.p1,s.a1-s.a0)+(n(s,c)?i(s.r,s.p1,s.r,s.p0):i(s.r,s.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+i(c.r,c.p1,s.r,s.p0))+"Z"}function e(t,e,n,r){var i=e.call(t,n,r),a=o.call(t,i,r),u=s.call(t,i,r)-Nu,l=c.call(t,i,r)-Nu;return{r:a,a0:u,a1:l,p0:[a*Math.cos(u),a*Math.sin(u)],p1:[a*Math.cos(l),a*Math.sin(l)]}}function n(t,e){return t.a0==e.a0&&t.a1==e.a1}function r(t,e,n){return"A"+t+","+t+" 0 "+ +(n>Bu)+",1 "+e}function i(t,e,n,r){return"Q 0,0 "+r}var a=_n,u=bn,o=Pa,s=ca,c=la;return t.radius=function(e){return arguments.length?(o=Dt(e),t):o},t.source=function(e){return arguments.length?(a=Dt(e),t):a},t.target=function(e){return arguments.length?(u=Dt(e),t):u},t.startAngle=function(e){return arguments.length?(s=Dt(e),t):s},t.endAngle=function(e){return arguments.length?(c=Dt(e),t):c},t},nu.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),u=n.call(this,t,i),o=(a.y+u.y)/2,s=[a,{x:a.x,y:o},{x:u.x,y:o},u];return s=s.map(r),"M"+s[0]+"C"+s[1]+" "+s[2]+" "+s[3]}var e=_n,n=bn,r=Ra;return t.source=function(n){return arguments.length?(e=Dt(n),t):e},t.target=function(e){return arguments.length?(n=Dt(e),t):n},t.projection=function(e){return arguments.length?(r=e,t):r},t},nu.svg.diagonal.radial=function(){var t=nu.svg.diagonal(),e=Ra,n=t.projection;return t.projection=function(t){return arguments.length?n(ja(e=t)):e},t},nu.svg.symbol=function(){function t(t,r){return(Bs.get(e.call(this,t,r))||$a)(n.call(this,t,r))}var e=Ua,n=Ya;return t.type=function(n){return arguments.length?(e=Dt(n),t):e},t.size=function(e){return arguments.length?(n=Dt(e),t):n},t};var Bs=nu.map({circle:$a,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Is)),n=e*Is;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Ls),n=e*Ls/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Ls),n=e*Ls/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});nu.svg.symbolTypes=Bs.keys();var Ls=Math.sqrt(3),Is=Math.tan(30*Ou);Au.transition=function(t){for(var e,n,r=Ns||++js,i=Ha(t),a=[],u=Os||{time:Date.now(),ease:Mr,delay:0,duration:250},o=-1,s=this.length;++oa;a++){i.push(e=[]);for(var n=this[a],o=0,s=n.length;s>o;o++)(r=n[o])&&t.call(r,r.__data__,o,a)&&e.push(r)}return qa(i,this.namespace,this.id)},Rs.tween=function(t,e){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(t):q(this,null==e?function(e){e[r][n].tween.remove(t)}:function(i){i[r][n].tween.set(t,e)})},Rs.attr=function(t,e){function n(){this.removeAttribute(o)}function r(){this.removeAttributeNS(o.space,o.local)}function i(t){return null==t?n:(t+="",function(){var e,n=this.getAttribute(o);return n!==t&&(e=u(n,t),function(t){this.setAttribute(o,e(t))})})}function a(t){return null==t?r:(t+="",function(){var e,n=this.getAttributeNS(o.space,o.local);return n!==t&&(e=u(n,t),function(t){this.setAttributeNS(o.space,o.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var u="transform"==t?$r:_r,o=nu.ns.qualify(t);return Ga(this,"attr."+t,e,o.local?a:i)},Rs.attrTween=function(t,e){function n(t,n){var r=e.call(this,t,n,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,n){var r=e.call(this,t,n,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=nu.ns.qualify(t);return this.tween("attr."+t,i.local?r:n)},Rs.style=function(t,e,r){function i(){this.style.removeProperty(t)}function a(e){return null==e?i:(e+="",function(){var i,a=n(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(i=_r(a,e),function(e){this.style.setProperty(t,i(e),r)})})}var u=arguments.length;if(3>u){if("string"!=typeof t){2>u&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return Ga(this,"style."+t,e,a)},Rs.styleTween=function(t,e,r){function i(i,a){var u=e.call(this,i,a,n(this).getComputedStyle(this,null).getPropertyValue(t));return u&&function(e){this.style.setProperty(t,u(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,i)},Rs.text=function(t){return Ga(this,"text",t,Wa)},Rs.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Rs.ease=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].ease:("function"!=typeof t&&(t=nu.ease.apply(nu,arguments)),q(this,function(r){r[n][e].ease=t}))},Rs.delay=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].delay:q(this,"function"==typeof t?function(r,i,a){r[n][e].delay=+t.call(r,r.__data__,i,a)}:(t=+t,function(r){r[n][e].delay=t}))},Rs.duration=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].duration:q(this,"function"==typeof t?function(r,i,a){r[n][e].duration=Math.max(1,t.call(r,r.__data__,i,a))}:(t=Math.max(1,t),function(r){r[n][e].duration=t}))},Rs.each=function(t,e){var n=this.id,r=this.namespace;if(arguments.length<2){var i=Os,a=Ns;try{Ns=n,q(this,function(e,i,a){Os=e[r][n],t.call(e,e.__data__,i,a)})}finally{Os=i,Ns=a}}else q(this,function(i){var a=i[r][n];(a.event||(a.event=nu.dispatch("start","end","interrupt"))).on(t,e)});return this},Rs.transition=function(){for(var t,e,n,r,i=this.id,a=++js,u=this.namespace,o=[],s=0,c=this.length;c>s;s++){o.push(t=[]);for(var e=this[s],l=0,h=e.length;h>l;l++)(n=e[l])&&(r=n[u][i],Va(n,l,u,a,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),t.push(n)}return qa(o,u,a)},nu.svg.axis=function(){function t(t){t.each(function(){var t,c=nu.select(this),l=this.__chart__||n,h=this.__chart__=n.copy(),f=null==s?h.ticks?h.ticks.apply(h,o):h.domain():s,d=null==e?h.tickFormat?h.tickFormat.apply(h,o):_:e,p=c.selectAll(".tick").data(f,h),g=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Tu),y=nu.transition(p.exit()).style("opacity",Tu).remove(),m=nu.transition(p.order()).style("opacity",1),v=Math.max(i,0)+u,b=ji(h),x=c.selectAll(".domain").data([0]),w=(x.enter().append("path").attr("class","domain"),nu.transition(x));g.append("line"),g.append("text");var A,k,E,M,D=g.select("line"),C=m.select("line"),S=p.select("text").text(d),T=g.select("text"),F=m.select("text"),B="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(t=Xa,A="x",E="y",k="x2",M="y2",S.attr("dy",0>B?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+b[0]+","+B*a+"V0H"+b[1]+"V"+B*a)):(t=Za,A="y",E="x",k="y2",M="x2",S.attr("dy",".32em").style("text-anchor",0>B?"end":"start"),w.attr("d","M"+B*a+","+b[0]+"H0V"+b[1]+"H"+B*a)),D.attr(M,B*i),T.attr(E,B*v),C.attr(k,0).attr(M,B*i),F.attr(A,0).attr(E,B*v),h.rangeBand){var L=h,I=L.rangeBand()/2;l=h=function(t){return L(t)+I}}else l.rangeBand?l=h:y.call(t,h,l);g.call(t,l,h),m.call(t,h,h)})}var e,n=nu.scale.linear(),r=Ys,i=6,a=6,u=3,o=[10],s=null;return t.scale=function(e){return arguments.length?(n=e,t):n},t.orient=function(e){return arguments.length?(r=e in Us?e+"":Ys,t):r},t.ticks=function(){return arguments.length?(o=arguments,t):o},t.tickValues=function(e){return arguments.length?(s=e,t):s},t.tickFormat=function(n){return arguments.length?(e=n,t):e},t.tickSize=function(e){var n=arguments.length;return n?(i=+e,a=+arguments[n-1],t):i},t.innerTickSize=function(e){return arguments.length?(i=+e,t):i},t.outerTickSize=function(e){return arguments.length?(a=+e,t):a},t.tickPadding=function(e){return arguments.length?(u=+e,t):u},t.tickSubdivide=function(){return arguments.length&&t},t};var Ys="bottom",Us={top:1,right:1,bottom:1,left:1};nu.svg.brush=function(){function t(n){n.each(function(){var n=nu.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",a).on("touchstart.brush",a),u=n.selectAll(".background").data([0]);u.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var o=n.selectAll(".resize").data(g,_);o.exit().remove(),o.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return $s[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),o.style("display",t.empty()?"none":null);var s,h=nu.transition(n),f=nu.transition(u);c&&(s=ji(c),f.attr("x",s[0]).attr("width",s[1]-s[0]),r(h)),l&&(s=ji(l),f.attr("y",s[0]).attr("height",s[1]-s[0]),i(h)),e(h)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+h[+/e$/.test(t)]+","+f[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",h[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",h[1]-h[0])}function i(t){t.select(".extent").attr("y",f[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function a(){function a(){32==nu.event.keyCode&&(S||(_=null,F[0]-=h[1],F[1]-=f[1],S=2),E())}function g(){32==nu.event.keyCode&&2==S&&(F[0]+=h[1],F[1]+=f[1],S=0,E())}function y(){var t=nu.mouse(x),n=!1;b&&(t[0]+=b[0],t[1]+=b[1]),S||(nu.event.altKey?(_||(_=[(h[0]+h[1])/2,(f[0]+f[1])/2]),F[0]=h[+(t[0]<_[0])],F[1]=f[+(t[1]<_[1])]):_=null),D&&m(t,c,0)&&(r(k),n=!0),C&&m(t,l,1)&&(i(k),n=!0),n&&(e(k),A({type:"brush",mode:S?"move":"resize"}))}function m(t,e,n){var r,i,a=ji(e),s=a[0],c=a[1],l=F[n],g=n?f:h,y=g[1]-g[0];return S&&(s-=l,c-=y+l),r=(n?p:d)?Math.max(s,Math.min(c,t[n])):t[n],S?i=(r+=l)+y:(_&&(l=Math.max(s,Math.min(c,2*_[n]-r))),r>l?(i=r,r=l):i=l),g[0]!=r||g[1]!=i?(n?o=null:u=null,g[0]=r,g[1]=i,!0):void 0}function v(){y(),k.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),nu.select("body").style("cursor",null),B.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),T(),A({type:"brushend"})}var _,b,x=this,w=nu.select(nu.event.target),A=s.of(x,arguments),k=nu.select(x),M=w.datum(),D=!/^(n|s)$/.test(M)&&c,C=!/^(e|w)$/.test(M)&&l,S=w.classed("extent"),T=Z(x),F=nu.mouse(x),B=nu.select(n(x)).on("keydown.brush",a).on("keyup.brush",g);if(nu.event.changedTouches?B.on("touchmove.brush",y).on("touchend.brush",v):B.on("mousemove.brush",y).on("mouseup.brush",v),k.interrupt().selectAll("*").interrupt(),S)F[0]=h[0]-F[0],F[1]=f[0]-F[1];else if(M){var L=+/w$/.test(M),I=+/^n/.test(M);b=[h[1-L]-F[0],f[1-I]-F[1]],F[0]=h[L],F[1]=f[I]}else nu.event.altKey&&(_=F.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),nu.select("body").style("cursor",w.style("cursor")),A({type:"brushstart"}),y()}var u,o,s=D(t,"brushstart","brush","brushend"),c=null,l=null,h=[0,0],f=[0,0],d=!0,p=!0,g=zs[0];return t.event=function(t){t.each(function(){var t=s.of(this,arguments),e={x:h,y:f,i:u,j:o},n=this.__chart__||e;this.__chart__=e,Ns?nu.select(this).transition().each("start.brush",function(){u=n.i,o=n.j,h=n.x,f=n.y,t({type:"brushstart"})}).tween("brush:brush",function(){var n=br(h,e.x),r=br(f,e.y);return u=o=null,function(i){h=e.x=n(i),f=e.y=r(i),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){u=e.i,o=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(c=e,g=zs[!c<<1|!l],t):c},t.y=function(e){return arguments.length?(l=e,g=zs[!c<<1|!l],t):l},t.clamp=function(e){return arguments.length?(c&&l?(d=!!e[0],p=!!e[1]):c?d=!!e:l&&(p=!!e),t):c&&l?[d,p]:c?d:l?p:null},t.extent=function(e){var n,r,i,a,s;return arguments.length?(c&&(n=e[0],r=e[1],l&&(n=n[0],r=r[0]),u=[n,r],c.invert&&(n=c(n),r=c(r)),n>r&&(s=n,n=r,r=s),(n!=h[0]||r!=h[1])&&(h=[n,r])),l&&(i=e[0],a=e[1],c&&(i=i[1],a=a[1]),o=[i,a],l.invert&&(i=l(i),a=l(a)),i>a&&(s=i,i=a,a=s),(i!=f[0]||a!=f[1])&&(f=[i,a])),t):(c&&(u?(n=u[0],r=u[1]):(n=h[0],r=h[1],c.invert&&(n=c.invert(n),r=c.invert(r)),n>r&&(s=n,n=r,r=s))),l&&(o?(i=o[0],a=o[1]):(i=f[0],a=f[1],l.invert&&(i=l.invert(i),a=l.invert(a)),i>a&&(s=i,i=a,a=s))),c&&l?[[n,i],[r,a]]:c?[n,r]:l&&[i,a])},t.clear=function(){return t.empty()||(h=[0,0],f=[0,0],u=o=null),t},t.empty=function(){return!!c&&h[0]==h[1]||!!l&&f[0]==f[1]},nu.rebind(t,s,"on")};var $s={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},zs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],qs=so.format=go.timeFormat,Gs=qs.utc,Ws=Gs("%Y-%m-%dT%H:%M:%S.%LZ");qs.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ka:Ws,Ka.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Ka.toString=Ws.toString,so.second=Yt(function(t){return new co(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),so.seconds=so.second.range,so.seconds.utc=so.second.utc.range,so.minute=Yt(function(t){return new co(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),so.minutes=so.minute.range,so.minutes.utc=so.minute.utc.range,so.hour=Yt(function(t){var e=t.getTimezoneOffset()/60;return new co(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),so.hours=so.hour.range,so.hours.utc=so.hour.utc.range,so.month=Yt(function(t){return t=so.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),so.months=so.month.range,so.months.utc=so.month.utc.range;var Hs=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Vs=[[so.second,1],[so.second,5],[so.second,15],[so.second,30],[so.minute,1],[so.minute,5],[so.minute,15],[so.minute,30],[so.hour,1],[so.hour,3],[so.hour,6],[so.hour,12],[so.day,1],[so.day,2],[so.week,1],[so.month,1],[so.month,3],[so.year,1]],Xs=qs.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Se]]),Zs={range:function(t,e,n){return nu.range(Math.ceil(t/n)*n,+e,n).map(Ja)},floor:_,ceil:_};Vs.year=so.year,so.scale=function(){return Qa(nu.scale.linear(),Vs,Xs)};var Ks=Vs.map(function(t){return[t[0].utc,t[1]]}),Qs=Gs.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Se]]);Ks.year=so.year.utc,so.scale.utc=function(){return Qa(nu.scale.linear(),Ks,Qs)},nu.text=Ct(function(t){return t.responseText}),nu.json=function(t,e){return St(t,"application/json",tu,e)},nu.html=function(t,e){return St(t,"text/html",eu,e)},nu.xml=Ct(function(t){return t.responseXML}),"function"==typeof define&&define.amd?define(nu):"object"==typeof e&&e.exports&&(e.exports=nu),this.d3=nu}()},{}],5:[function(t,e){e.exports={graphlib:t("./lib/graphlib"),dagre:t("./lib/dagre"),intersect:t("./lib/intersect"),render:t("./lib/render"),util:t("./lib/util"),version:t("./lib/version")}},{"./lib/dagre":12,"./lib/graphlib":13,"./lib/intersect":14,"./lib/render":29,"./lib/util":31,"./lib/version":32}],6:[function(t,e){function n(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),u=i.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(u,n[r+"Style"])}function r(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),u=i.append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(u,n[r+"Style"])}function i(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),u=i.append("path").attr("d","M 0 5 L 10 5").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(u,n[r+"Style"])}var a=t("./util");e.exports={"default":n,normal:n,vee:r,undirected:i}},{"./util":31}],7:[function(t,e){function n(t,e){var n=e.nodes().filter(function(t){return r.isSubgraph(e,t)}),a=t.selectAll("g.cluster").data(n,function(t){return t});return a.selectAll("*").remove(),a.enter().append("g").attr("class","cluster").attr("id",function(t){var n=e.node(t);return n.id}).style("opacity",0),r.applyTransition(a,e).style("opacity",1),a.each(function(t){var n=e.node(t),r=d3.select(this);d3.select(this).append("rect");var a=r.append("g").attr("class","label");i(a,n,n.clusterLabelPos)}),a.selectAll("rect").each(function(t){var n=e.node(t),i=d3.select(this);r.applyStyle(i,n.style)}),r.applyTransition(a.exit(),e).style("opacity",0).remove(),a}var r=t("./util"),i=t("./label/add-label");e.exports=n},{"./label/add-label":22,"./util":31}],8:[function(t,e){"use strict";function n(t,e){var n=t.selectAll("g.edgeLabel").data(e.edges(),function(t){return a.edgeToId(t)}).classed("update",!0);return n.selectAll("*").remove(),n.enter().append("g").classed("edgeLabel",!0).style("opacity",0),n.each(function(t){var n=e.edge(t),a=i(u.select(this),e.edge(t),0,0).classed("label",!0),o=a.node().getBBox();n.labelId&&a.attr("id",n.labelId),r.has(n,"width")||(n.width=o.width),r.has(n,"height")||(n.height=o.height)}),a.applyTransition(n.exit(),e).style("opacity",0).remove(),n}var r=t("./lodash"),i=t("./label/add-label"),a=t("./util"),u=t("./d3");e.exports=n},{"./d3":11,"./label/add-label":22,"./lodash":25,"./util":31}],9:[function(t,e){"use strict";function n(t,e,n){var i=t.selectAll("g.edgePath").data(e.edges(),function(t){return l.edgeToId(t)}).classed("update",!0);return u(i,e),o(i,e),l.applyTransition(i,e).style("opacity",1),i.each(function(t){var n=h.select(this),r=e.edge(t);r.elem=this,r.id&&n.attr("id",r.id),l.applyClass(n,r["class"],(n.classed("update")?"update ":"")+"edgePath")}),i.selectAll("path.path").each(function(t){var n=e.edge(t);n.arrowheadId=s.uniqueId("arrowhead");var i=h.select(this).attr("marker-end",function(){return"url(#"+n.arrowheadId+")"}).style("fill","none");l.applyTransition(i,e).attr("d",function(t){return r(e,t)}),l.applyStyle(i,n.style)}),i.selectAll("defs *").remove(),i.selectAll("defs").each(function(t){var r=e.edge(t),i=n[r.arrowhead];i(h.select(this),r.arrowheadId,r,"arrowhead")}),i}function r(t,e){var n=t.edge(e),r=t.node(e.v),a=t.node(e.w),u=n.points.slice(1,n.points.length-1);return u.unshift(c(r,u[0])),u.push(c(a,u[u.length-1])),i(n,u)}function i(t,e){var n=h.svg.line().x(function(t){return t.x}).y(function(t){return t.y});return s.has(t,"lineInterpolate")&&n.interpolate(t.lineInterpolate),s.has(t,"lineTension")&&n.tension(Number(t.lineTension)),n(e)}function a(t){var e=t.getBBox(),n=t.getTransformToElement(t.ownerSVGElement).translate(e.width/2,e.height/2);return{x:n.e,y:n.f}}function u(t,e){var n=t.enter().append("g").attr("class","edgePath").style("opacity",0);n.append("path").attr("class","path").attr("d",function(t){var n=e.edge(t),r=e.node(t.v).elem,u=s.range(n.points.length).map(function(){return a(r)});return i(n,u)}),n.append("defs")}function o(t,e){var n=t.exit();l.applyTransition(n,e).style("opacity",0).remove(),l.applyTransition(n.select("path.path"),e).attr("d",function(t){var n=e.node(t.v);if(n){var r=s.range(this.pathSegList.length).map(function(){return n});return i({},r)}return h.select(this).attr("d")})}var s=t("./lodash"),c=t("./intersect/intersect-node"),l=t("./util"),h=t("./d3");e.exports=n},{"./d3":11,"./intersect/intersect-node":18,"./lodash":25,"./util":31}],10:[function(t,e){"use strict"; - -function n(t,e,n){var o=e.nodes().filter(function(t){return!a.isSubgraph(e,t)}),s=t.selectAll("g.node").data(o,function(t){return t}).classed("update",!0);return s.selectAll("*").remove(),s.enter().append("g").attr("class","node").style("opacity",0),s.each(function(t){var o=e.node(t),s=u.select(this),c=s.append("g").attr("class","label"),l=i(c,o),h=n[o.shape],f=r.pick(l.node().getBBox(),"width","height");o.elem=this,o.id&&s.attr("id",o.id),o.labelId&&c.attr("id",o.labelId),a.applyClass(s,o["class"],(s.classed("update")?"update ":"")+"node"),r.has(o,"width")&&(f.width=o.width),r.has(o,"height")&&(f.height=o.height),f.width+=o.paddingLeft+o.paddingRight,f.height+=o.paddingTop+o.paddingBottom,c.attr("transform","translate("+(o.paddingLeft-o.paddingRight)/2+","+(o.paddingTop-o.paddingBottom)/2+")");var d=h(u.select(this),f,o);a.applyStyle(d,o.style);var p=d.node().getBBox();o.width=p.width,o.height=p.height}),a.applyTransition(s.exit(),e).style("opacity",0).remove(),s}var r=t("./lodash"),i=t("./label/add-label"),a=t("./util"),u=t("./d3");e.exports=n},{"./d3":11,"./label/add-label":22,"./lodash":25,"./util":31}],11:[function(t,e){e.exports=window.d3},{}],12:[function(t,e){var n;if(t)try{n=t("dagre")}catch(r){}n||(n=window.dagre),e.exports=n},{dagre:54}],13:[function(t,e){var n;if(t)try{n=t("graphlib")}catch(r){}n||(n=window.graphlib),e.exports=n},{graphlib:33}],14:[function(t,e){e.exports={node:t("./intersect-node"),circle:t("./intersect-circle"),ellipse:t("./intersect-ellipse"),polygon:t("./intersect-polygon"),rect:t("./intersect-rect")}},{"./intersect-circle":15,"./intersect-ellipse":16,"./intersect-node":18,"./intersect-polygon":19,"./intersect-rect":20}],15:[function(t,e){function n(t,e,n){return r(t,e,e,n)}var r=t("./intersect-ellipse");e.exports=n},{"./intersect-ellipse":16}],16:[function(t,e){function n(t,e,n,r){var i=t.x,a=t.y,u=i-r.x,o=a-r.y,s=Math.sqrt(e*e*o*o+n*n*u*u),c=Math.abs(e*n*u/s);r.xm?(m-y)/g:(m+y)/g,m=u*c-a*l,_=0>m?(m-y)/g:(m+y)/g,{x:v,y:_})}function r(t,e){return t*e>0}e.exports=n},{}],18:[function(t,e){function n(t,e){return t.intersect(e)}e.exports=n},{}],19:[function(t,e){function n(t,e,n){var i=t.x,a=t.y,u=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;e.forEach(function(t){o=Math.min(o,t.x),s=Math.min(s,t.y)});for(var c=i-t.width/2-o,l=a-t.height/2-s,h=0;h1&&u.sort(function(t,e){var r=t.x-n.x,i=t.y-n.y,a=Math.sqrt(r*r+i*i),u=e.x-n.x,o=e.y-n.y,s=Math.sqrt(u*u+o*o);return s>a?-1:a===s?0:1}),u[0]):(console.log("NO INTERSECTION FOUND, RETURN NODE CENTER",t),t)}var r=t("./intersect-line");e.exports=n},{"./intersect-line":17}],20:[function(t,e){function n(t,e){var n,r,i=t.x,a=t.y,u=e.x-i,o=e.y-a,s=t.width/2,c=t.height/2;return Math.abs(o)*s>Math.abs(u)*c?(0>o&&(c=-c),n=0===o?0:c*u/o,r=c):(0>u&&(s=-s),n=s,r=0===u?0:s*o/u),{x:i+n,y:a+r}}e.exports=n},{}],21:[function(t,e){function n(t,e){var n=t.append("foreignObject").attr("width","100000"),i=n.append("xhtml:div"),a=e.label;switch(typeof a){case"function":i.insert(a);break;case"object":i.insert(function(){return a});break;default:i.html(a)}r.applyStyle(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap");var u,o;return i.each(function(){u=this.clientWidth,o=this.clientHeight}),n.attr("width",u).attr("height",o),n}var r=t("../util");e.exports=n},{"../util":31}],22:[function(t,e){function n(t,e,n){var u=e.label,o=t.append("g");"svg"===e.labelType?a(o,e):"string"!=typeof u||"html"===e.labelType?i(o,e):r(o,e);var s,c=o.node().getBBox();switch(n){case"top":s=-e.height/2;break;case"bottom":s=e.height/2-c.height;break;default:s=-c.height/2}return o.attr("transform","translate("+-c.width/2+","+s+")"),o}var r=t("./add-text-label"),i=t("./add-html-label"),a=t("./add-svg-label");e.exports=n},{"./add-html-label":21,"./add-svg-label":23,"./add-text-label":24}],23:[function(t,e){function n(t,e){var n=t;return n.node().appendChild(e.label),r.applyStyle(n,e.labelStyle),n}var r=t("../util");e.exports=n},{"../util":31}],24:[function(t,e){function n(t,e){for(var n=t.append("text"),a=r(e.label).split("\n"),u=0;ua)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+a);c0&&(i=s.removeMin(),u=o[i],u.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(c);return o}var i=t("../lodash"),a=t("../data/priority-queue");e.exports=n;var u=i.constant(1)},{"../data/priority-queue":47,"../lodash":51}],38:[function(t,e){function n(t){return r.filter(i(t),function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})}var r=t("../lodash"),i=t("./tarjan");e.exports=n},{"../lodash":51,"./tarjan":45}],39:[function(t,e){function n(t,e,n){return r(t,e||a,n||function(e){return t.outEdges(e)})}function r(t,e,n){var r={},i=t.nodes();return i.forEach(function(t){r[t]={},r[t][t]={distance:0},i.forEach(function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})}),n(t).forEach(function(n){var i=n.v===t?n.w:n.v,a=e(n);r[t][i]={distance:a,predecessor:t}})}),i.forEach(function(t){var e=r[t];i.forEach(function(n){var a=r[n];i.forEach(function(n){var r=a[t],i=e[n],u=a[n],o=r.distance+i.distance;oi&&(s[n]=u,c.decrease(n,i))}}var u,o=new i,s={},c=new a;if(0===t.nodeCount())return o;r.each(t.nodes(),function(t){c.add(t,Number.POSITIVE_INFINITY),o.setNode(t)}),c.decrease(t.nodes()[0],0);for(var l=!1;c.size()>0;){if(u=c.removeMin(),r.has(s,u))o.setEdge(u,s[u]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(u).forEach(n)}return o}var r=t("../lodash"),i=t("../graph"),a=t("../data/priority-queue");e.exports=n},{"../data/priority-queue":47,"../graph":48,"../lodash":51}],45:[function(t,e){function n(t){function e(o){var s=a[o]={onStack:!0,lowlink:n,index:n++};if(i.push(o),t.successors(o).forEach(function(t){r.has(a,t)?a[t].onStack&&(s.lowlink=Math.min(s.lowlink,a[t].index)):(e(t),s.lowlink=Math.min(s.lowlink,a[t].lowlink))}),s.lowlink===s.index){var c,l=[];do c=i.pop(),a[c].onStack=!1,l.push(c);while(o!==c);u.push(l)}}var n=0,i=[],a={},u=[];return t.nodes().forEach(function(t){r.has(a,t)||e(t)}),u}var r=t("../lodash");e.exports=n},{"../lodash":51}],46:[function(t,e){function n(t){function e(o){if(i.has(a,o))throw new r;i.has(n,o)||(a[o]=!0,n[o]=!0,i.each(t.predecessors(o),e),delete a[o],u.push(o))}var n={},a={},u=[];if(i.each(t.sinks(),e),i.size(n)!==t.nodeCount())throw new r;return u}function r(){}var i=t("../lodash");e.exports=n,n.CycleException=r},{"../lodash":51}],47:[function(t,e){function n(){this._arr=[],this._keyIndices={}}var r=t("../lodash");e.exports=n,n.prototype.size=function(){return this._arr.length},n.prototype.keys=function(){return this._arr.map(function(t){return t.key})},n.prototype.has=function(t){return r.has(this._keyIndices,t)},n.prototype.priority=function(t){var e=this._keyIndices[t];return void 0!==e?this._arr[e].priority:void 0},n.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},n.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,a=i.length;return n[t]=a,i.push({key:t,priority:e}),this._decrease(a),!0}return!1},n.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},n.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},n.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n>1,!(n[e].prioritya){var u=i;i=a,a=u}return i+h+a+h+(s.isUndefined(r)?c:r)}function u(t,e,n,r){var i=""+e,a=""+n;if(!t&&i>a){var u=i;i=a,a=u}var o={v:i,w:a};return r&&(o.name=r),o}function o(t,e){return a(t,e.v,e.w,e.name)}var s=t("./lodash");e.exports=n;var c="\x00",l="\x00",h="";n.prototype._nodeCount=0,n.prototype._edgeCount=0,n.prototype.isDirected=function(){return this._isDirected},n.prototype.isMultigraph=function(){return this._isMultigraph},n.prototype.isCompound=function(){return this._isCompound},n.prototype.setGraph=function(t){return this._label=t,this},n.prototype.graph=function(){return this._label},n.prototype.setDefaultNodeLabel=function(t){return s.isFunction(t)||(t=s.constant(t)),this._defaultNodeLabelFn=t,this},n.prototype.nodeCount=function(){return this._nodeCount},n.prototype.nodes=function(){return s.keys(this._nodes)},n.prototype.sources=function(){return s.filter(this.nodes(),function(t){return s.isEmpty(this._in[t])},this)},n.prototype.sinks=function(){return s.filter(this.nodes(),function(t){return s.isEmpty(this._out[t])},this)},n.prototype.setNodes=function(t,e){var n=arguments;return s.each(t,function(t){n.length>1?this.setNode(t,e):this.setNode(t)},this),this},n.prototype.setNode=function(t,e){return s.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=l,this._children[t]={},this._children[l][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},n.prototype.node=function(t){return this._nodes[t]},n.prototype.hasNode=function(t){return s.has(this._nodes,t)},n.prototype.removeNode=function(t){var e=this;if(s.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],s.each(this.children(t),function(t){this.setParent(t)},this),delete this._children[t]),s.each(s.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],s.each(s.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},n.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(s.isUndefined(e))e=l;else{e+="";for(var n=e;!s.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},n.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},n.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==l)return e}},n.prototype.children=function(t){if(s.isUndefined(t)&&(t=l),this._isCompound){var e=this._children[t];if(e)return s.keys(e)}else{if(t===l)return this.nodes();if(this.hasNode(t))return[]}},n.prototype.predecessors=function(t){var e=this._preds[t];return e?s.keys(e):void 0},n.prototype.successors=function(t){var e=this._sucs[t];return e?s.keys(e):void 0},n.prototype.neighbors=function(t){var e=this.predecessors(t);return e?s.union(e,this.successors(t)):void 0},n.prototype.filterNodes=function(t){function e(t){var a=r.parent(t);return void 0===a||n.hasNode(a)?(i[t]=a,a):a in i?i[a]:e(a)}var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph()),s.each(this._nodes,function(e,r){t(r)&&n.setNode(r,e)},this),s.each(this._edgeObjs,function(t){n.hasNode(t.v)&&n.hasNode(t.w)&&n.setEdge(t,this.edge(t))},this);var r=this,i={};return this._isCompound&&s.each(n.nodes(),function(t){n.setParent(t,e(t))}),n},n.prototype.setDefaultEdgeLabel=function(t){return s.isFunction(t)||(t=s.constant(t)),this._defaultEdgeLabelFn=t,this},n.prototype.edgeCount=function(){return this._edgeCount},n.prototype.edges=function(){return s.values(this._edgeObjs)},n.prototype.setPath=function(t,e){var n=this,r=arguments;return s.reduce(t,function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i}),this},n.prototype.setEdge=function(){var t,e,n,i,o=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(t=c.v,e=c.w,n=c.name,2===arguments.length&&(i=arguments[1],o=!0)):(t=c,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,e=""+e,s.isUndefined(n)||(n=""+n);var l=a(this._isDirected,t,e,n);if(s.has(this._edgeLabels,l))return o&&(this._edgeLabels[l]=i),this;if(!s.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=o?i:this._defaultEdgeLabelFn(t,e,n);var h=u(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[l]=h,r(this._preds[e],t),r(this._sucs[t],e),this._in[e][l]=h,this._out[t][l]=h,this._edgeCount++,this},n.prototype.edge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return this._edgeLabels[r]},n.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return s.has(this._edgeLabels,r)},n.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n),u=this._edgeObjs[r];return u&&(t=u.v,e=u.w,delete this._edgeLabels[r],delete this._edgeObjs[r],i(this._preds[e],t),i(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},n.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=s.values(n);return e?s.filter(r,function(t){return t.v===e}):r}},n.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=s.values(n);return e?s.filter(r,function(t){return t.w===e}):r}},n.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);return n?n.concat(this.outEdges(t,e)):void 0}},{"./lodash":51}],49:[function(t,e){e.exports={Graph:t("./graph"),version:t("./version")}},{"./graph":48,"./version":52}],50:[function(t,e){function n(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:r(t),edges:i(t)};return u.isUndefined(t.graph())||(e.value=u.clone(t.graph())),e}function r(t){return u.map(t.nodes(),function(e){var n=t.node(e),r=t.parent(e),i={v:e};return u.isUndefined(n)||(i.value=n),u.isUndefined(r)||(i.parent=r),i})}function i(t){return u.map(t.edges(),function(e){var n=t.edge(e),r={v:e.v,w:e.w};return u.isUndefined(e.name)||(r.name=e.name),u.isUndefined(n)||(r.value=n),r})}function a(t){var e=new o(t.options).setGraph(t.value);return u.each(t.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),u.each(t.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}var u=t("./lodash"),o=t("./graph");e.exports={write:n,read:a}},{"./graph":48,"./lodash":51}],51:[function(t,e){var n;if("function"==typeof t)try{n=t("lodash")}catch(r){}n||(n=window._),e.exports=n},{lodash:53}],52:[function(t,e){e.exports="1.0.7"},{}],53:[function(t,e,n){(function(t){(function(){function r(t,e){if(t!==e){var n=null===t,r=t===E,i=t===t,a=null===e,u=e===E,o=e===e;if(t>e&&!a||!i||n&&!u&&o||r&&o)return 1;if(e>t&&!n||!o||a&&!r&&i||u&&i)return-1}return 0}function i(t,e,n){for(var r=t.length,i=n?r:-1;n?i--:++i-1;);return n}function c(t,e){for(var n=t.length;n--&&e.indexOf(t.charAt(n))>-1;);return n}function l(t,e){return r(t.criteria,e.criteria)||t.index-e.index}function h(t,e,n){for(var i=-1,a=t.criteria,u=e.criteria,o=a.length,s=n.length;++i=s)return c;var l=n[i];return c*("asc"===l||l===!0?1:-1)}}return t.index-e.index}function f(t){return qt[t]}function d(t){return Gt[t]}function p(t,e,n){return e?t=Vt[t]:n&&(t=Xt[t]),"\\"+t}function g(t){return"\\"+Xt[t]}function y(t,e,n){for(var r=t.length,i=e+(n?0:-1);n?i--:++i=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function _(t,e){for(var n=-1,r=t.length,i=-1,a=[];++ne,i=n?t.length:0,a=Wn(0,i,this.__views__),u=a.start,o=a.end,s=o-u,c=r?o:u-1,l=this.__iteratees__,h=l.length,f=0,d=wu(s,this.__takeCount__);if(!n||Y>i||i==s&&d==s)return nn(r&&n?t.reverse():t,this.__actions__);var p=[];t:for(;s--&&d>f;){c+=e;for(var g=-1,y=t[c];++g=Y?gn(e):null,c=e.length;s&&(u=Kt,o=!1,e=s);t:for(;++in&&(n=-n>i?0:i+n),r=r===E||r>i?i:+r||0,0>r&&(r+=i),i=n>r?0:r>>>0,n>>>=0;i>n;)t[n++]=e;return t}function De(t,e){var n=[];return Nu(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function Ce(t,e,n,r){var i;return n(t,function(t,n,a){return e(t,n,a)?(i=r?n:t,!1):void 0}),i}function Se(t,e,n,r){r||(r=[]);for(var i=-1,a=t.length;++ir;)t=t[e[r++]];return r&&r==i?t:E}}function Ne(t,e,n,r,i,a){return t===e?!0:null==t||null==e||!Ii(t)&&!m(e)?t!==t&&e!==e:Oe(t,e,Ne,n,r,i,a)}function Oe(t,e,n,r,i,a,u){var o=So(t),s=So(e),c=W,l=W;o||(c=nu.call(t),c==G?c=J:c!=J&&(o=zi(t))),s||(l=nu.call(e),l==G?l=J:l!=J&&(s=zi(e)));var h=c==J,f=l==J,d=c==l;if(d&&!o&&!h)return jn(t,e,c);if(!i){var p=h&&tu.call(t,"__wrapped__"),g=f&&tu.call(e,"__wrapped__");if(p||g)return n(p?t.value():t,g?e.value():e,r,i,a,u)}if(!d)return!1;a||(a=[]),u||(u=[]);for(var y=a.length;y--;)if(a[y]==t)return u[y]==e;a.push(t),u.push(e); - -var m=(o?Rn:Yn)(t,e,n,r,i,a,u);return a.pop(),u.pop(),m}function Pe(t,e,n){var r=e.length,i=r,a=!n;if(null==t)return!i;for(t=hr(t);r--;){var u=e[r];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++re&&(e=-e>i?0:i+e),n=n===E||n>i?i:+n||0,0>n&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=Ya(i);++r=Y,s=o?gn():null,c=[];s?(r=Kt,u=!1):(o=!1,s=e?[]:c);t:for(;++n=i){for(;i>r;){var a=r+i>>>1,u=t[a];(n?e>=u:e>u)&&null!==u?r=a+1:i=a}return i}return an(t,e,Da,n)}function an(t,e,n,r){e=n(e);for(var i=0,a=t?t.length:0,u=e!==e,o=null===e,s=e===E;a>i;){var c=mu((i+a)/2),l=n(t[c]),h=l!==E,f=l===l;if(u)var d=f||r;else d=o?f&&h&&(r||null!=l):s?f&&(r||h):null==l?!1:r?e>=l:e>l;d?i=c+1:a=c}return wu(a,Su)}function un(t,e,n){if("function"!=typeof t)return Da;if(e===E)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,a){return t.call(e,n,r,i,a)};case 5:return function(n,r,i,a,u){return t.call(e,n,r,i,a,u)}}return function(){return t.apply(e,arguments)}}function on(t){var e=new au(t.byteLength),n=new du(e);return n.set(new du(t)),e}function sn(t,e,n){for(var r=n.length,i=-1,a=xu(t.length-r,0),u=-1,o=e.length,s=Ya(o+a);++u2?n[i-2]:E,u=i>2?n[2]:E,o=i>1?n[i-1]:E;for("function"==typeof a?(a=un(a,o,5),i-=2):(a="function"==typeof o?o:E,i-=a?1:0),u&&Jn(n[0],n[1],u)&&(a=3>i?E:a,i=1);++r-1?n[u]:E}return Ce(n,r,t)}}function wn(t){return function(e,n,r){return e&&e.length?(n=Un(n,r,3),i(e,n,t)):-1}}function An(t){return function(e,n,r){return n=Un(n,r,3),Ce(e,n,t,!0)}}function kn(t){return function(){for(var e,n=arguments.length,r=t?n:-1,i=0,a=Ya(n);t?r--:++r=Y)return e.plant(r).value();for(var i=0,u=n?a[i].apply(this,t):r;++iv){var k=o?te(o):E,M=xu(c-v,0),S=p?A:E,T=p?E:A,F=p?x:E,I=p?E:x;e|=p?B:L,e&=~(p?L:B),g||(e&=~(D|C));var N=[t,e,n,F,S,I,T,k,s,M],O=Bn.apply(E,N);return er(t)&&$u(O,N),O.placeholder=w,O}}var P=f?n:this,R=d?P[t]:t;return o&&(x=sr(x,o)),h&&s=e||!_u(e))return"";var i=e-r;return n=null==n?" ":n+"",ya(n,gu(i/n.length)).slice(0,i)}function In(t,e,n,r){function i(){for(var e=-1,o=arguments.length,s=-1,c=r.length,l=Ya(c+o);++ss))return!1;for(;++o-1&&t%1==0&&e>t}function Jn(t,e,n){if(!Ii(n))return!1;var r=typeof e;if("number"==r?Kn(n)&&Qn(e,n.length):"string"==r&&e in n){var i=n[e];return t===t?t===i:i!==i}return!1}function tr(t,e){var n=typeof t;if("string"==n&&Et.test(t)||"number"==n)return!0;if(So(t))return!1;var r=!kt.test(t);return r||null!=e&&t in hr(e)}function er(t){var n=$n(t);if(!(n in K.prototype))return!1;var r=e[n];if(t===r)return!0;var i=Yu(r);return!!i&&t===i[0]}function nr(t){return"number"==typeof t&&t>-1&&t%1==0&&Fu>=t}function rr(t){return t===t&&!Ii(t)}function ir(t,e){var n=t[1],r=e[1],i=n|r,a=I>i,u=r==I&&n==T||r==I&&n==N&&t[7].length<=e[8]||r==(I|N)&&n==T;if(!a&&!u)return t;r&D&&(t[2]=e[2],i|=n&D?0:S);var o=e[3];if(o){var s=t[3];t[3]=s?sn(s,o,e[4]):te(o),t[4]=s?_(t[3],q):te(e[4])}return o=e[5],o&&(s=t[5],t[5]=s?cn(s,o,e[6]):te(o),t[6]=s?_(t[5],q):te(e[6])),o=e[7],o&&(t[7]=te(o)),r&I&&(t[8]=null==t[8]?e[8]:wu(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}function ar(t,e){return t===E?e:To(t,e,ar)}function ur(t,e){t=hr(t);for(var n=-1,r=e.length,i={};++nr;)u[++a]=Ve(t,r,r+=e);return u}function gr(t){for(var e=-1,n=t?t.length:0,r=-1,i=[];++ee?0:e)):[]}function mr(t,e,n){var r=t?t.length:0;return r?((n?Jn(t,e,n):null==e)&&(e=1),e=r-(+e||0),Ve(t,0,0>e?0:e)):[]}function vr(t,e,n){return t&&t.length?en(t,Un(e,n,3),!0,!0):[]}function _r(t,e,n){return t&&t.length?en(t,Un(e,n,3),!0):[]}function br(t,e,n,r){var i=t?t.length:0;return i?(n&&"number"!=typeof n&&Jn(t,e,n)&&(n=0,r=i),Me(t,e,n,r)):[]}function xr(t){return t?t[0]:E}function wr(t,e,n){var r=t?t.length:0;return n&&Jn(t,e,n)&&(e=!1),r?Se(t,e):[]}function Ar(t){var e=t?t.length:0;return e?Se(t,!0):[]}function kr(t,e,n){var r=t?t.length:0;if(!r)return-1;if("number"==typeof n)n=0>n?xu(r+n,0):n;else if(n){var i=rn(t,e);return r>i&&(e===e?e===t[i]:t[i]!==t[i])?i:-1}return a(t,e,n||0)}function Er(t){return mr(t,1)}function Mr(t){var e=t?t.length:0;return e?t[e-1]:E}function Dr(t,e,n){var r=t?t.length:0;if(!r)return-1;var i=r;if("number"==typeof n)i=(0>n?xu(r+n,0):wu(n||0,r-1))+1;else if(n){i=rn(t,e,!0)-1;var a=t[i];return(e===e?e===a:a!==a)?i:-1}if(e!==e)return y(t,i,!0);for(;i--;)if(t[i]===e)return i;return-1}function Cr(){var t=arguments,e=t[0];if(!e||!e.length)return e;for(var n=0,r=zn(),i=t.length;++n-1;)fu.call(e,a,1);return e}function Sr(t,e,n){var r=[];if(!t||!t.length)return r;var i=-1,a=[],u=t.length;for(e=Un(e,n,3);++ie?0:e)):[]}function Lr(t,e,n){var r=t?t.length:0;return r?((n?Jn(t,e,n):null==e)&&(e=1),e=r-(+e||0),Ve(t,0>e?0:e)):[]}function Ir(t,e,n){return t&&t.length?en(t,Un(e,n,3),!1,!0):[]}function Nr(t,e,n){return t&&t.length?en(t,Un(e,n,3)):[]}function Or(t,e,n,r){var i=t?t.length:0;if(!i)return[];null!=e&&"boolean"!=typeof e&&(r=n,n=Jn(t,e,r)?E:e,e=!1);var u=Un();return(null!=n||u!==be)&&(n=u(n,r,3)),e&&zn()==a?b(t,n):Je(t,n)}function Pr(t){if(!t||!t.length)return[];var e=-1,n=0;t=oe(t,function(t){return Kn(t)?(n=xu(t.length,n),!0):void 0});for(var r=Ya(n);++en?xu(i+n,0):n||0,"string"==typeof t||!So(t)&&$i(t)?i>=n&&t.indexOf(e,n)>-1:!!i&&zn(t,e,n)>-1}function ti(t,e,n){var r=So(t)?se:Re;return e=Un(e,n,3),r(t,e)}function ei(t,e){return ti(t,La(e))}function ni(t,e,n){var r=So(t)?oe:De;return e=Un(e,n,3),r(t,function(t,n,r){return!e(t,n,r)})}function ri(t,e,n){if(n?Jn(t,e,n):null==e){t=lr(t);var r=t.length;return r>0?t[We(0,r-1)]:E}var i=-1,a=Hi(t),r=a.length,u=r-1;for(e=wu(0>e?0:+e||0,r);++i0&&(n=e.apply(this,arguments)),1>=t&&(e=E),n}}function di(t,e,n){function r(){d&&uu(d),c&&uu(c),g=0,c=d=p=E}function i(e,n){n&&uu(n),c=d=p=E,e&&(g=go(),l=t.apply(f,s),d||c||(s=f=E))}function a(){var t=e-(go()-h);0>=t||t>e?i(p,c):d=hu(a,t)}function u(){i(m,d)}function o(){if(s=arguments,h=go(),f=this,p=m&&(d||!v),y===!1)var n=v&&!d;else{c||v||(g=h);var r=y-(h-g),i=0>=r||r>y;i?(c&&(c=uu(c)),g=h,l=t.apply(f,s)):c||(c=hu(u,r))}return i&&d?d=uu(d):d||e===y||(d=hu(a,e)),n&&(i=!0,l=t.apply(f,s)),!i||d||c||(s=f=E),l}var s,c,l,h,f,d,p,g=0,y=!1,m=!0;if("function"!=typeof t)throw new Xa(z);if(e=0>e?0:+e||0,n===!0){var v=!0;m=!1}else Ii(n)&&(v=!!n.leading,y="maxWait"in n&&xu(+n.maxWait||0,e),m="trailing"in n?!!n.trailing:m);return o.cancel=r,o}function pi(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new Xa(z);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var u=t.apply(this,r);return n.cache=a.set(i,u),u};return n.cache=new pi.Cache,n}function gi(t){if("function"!=typeof t)throw new Xa(z);return function(){return!t.apply(this,arguments)}}function yi(t){return fi(2,t)}function mi(t,e){if("function"!=typeof t)throw new Xa(z);return e=xu(e===E?t.length-1:+e||0,0),function(){for(var n=arguments,r=-1,i=xu(n.length-e,0),a=Ya(i);++re}function ki(t,e){return t>=e}function Ei(t){return m(t)&&Kn(t)&&tu.call(t,"callee")&&!cu.call(t,"callee")}function Mi(t){return t===!0||t===!1||m(t)&&nu.call(t)==H}function Di(t){return m(t)&&nu.call(t)==V}function Ci(t){return!!t&&1===t.nodeType&&m(t)&&!Yi(t)}function Si(t){return null==t?!0:Kn(t)&&(So(t)||$i(t)||Ei(t)||m(t)&&Li(t.splice))?!t.length:!Yo(t).length}function Ti(t,e,n,r){n="function"==typeof n?un(n,r,3):E;var i=n?n(t,e):E;return i===E?Ne(t,e,n):!!i}function Fi(t){return m(t)&&"string"==typeof t.message&&nu.call(t)==X}function Bi(t){return"number"==typeof t&&_u(t)}function Li(t){return Ii(t)&&nu.call(t)==Z}function Ii(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Ni(t,e,n,r){return n="function"==typeof n?un(n,r,3):E,Pe(t,qn(e),n)}function Oi(t){return ji(t)&&t!=+t}function Pi(t){return null==t?!1:Li(t)?iu.test(Ja.call(t)):m(t)&&It.test(t)}function Ri(t){return null===t}function ji(t){return"number"==typeof t||m(t)&&nu.call(t)==Q}function Yi(t){var e;if(!m(t)||nu.call(t)!=J||Ei(t)||!tu.call(t,"constructor")&&(e=t.constructor,"function"==typeof e&&!(e instanceof e)))return!1;var n;return Te(t,function(t,e){n=e}),n===E||tu.call(t,n)}function Ui(t){return Ii(t)&&nu.call(t)==tt}function $i(t){return"string"==typeof t||m(t)&&nu.call(t)==nt}function zi(t){return m(t)&&nr(t.length)&&!!$t[nu.call(t)]}function qi(t){return t===E}function Gi(t,e){return e>t}function Wi(t,e){return e>=t}function Hi(t){var e=t?Uu(t):0;return nr(e)?e?te(t):[]:aa(t)}function Vi(t){return _e(t,ta(t))}function Xi(t,e,n){var r=Iu(t);return n&&Jn(t,e,n)&&(e=E),e?me(r,e):r}function Zi(t){return Le(t,ta(t))}function Ki(t,e,n){var r=null==t?E:Ie(t,fr(e),e+"");return r===E?n:r}function Qi(t,e){if(null==t)return!1;var n=tu.call(t,e);if(!n&&!tr(e)){if(e=fr(e),t=1==e.length?t:Ie(t,Ve(e,0,-1)),null==t)return!1;e=Mr(e),n=tu.call(t,e)}return n||nr(t.length)&&Qn(e,t.length)&&(So(t)||Ei(t))}function Ji(t,e,n){n&&Jn(t,e,n)&&(e=E);for(var r=-1,i=Yo(t),a=i.length,u={};++r0;++r=wu(e,n)&&tn?0:+n||0,r),n-=e.length,n>=0&&t.indexOf(e,n)==n}function fa(t){return t=o(t),t&&bt.test(t)?t.replace(vt,d):t}function da(t){return t=o(t),t&&Ct.test(t)?t.replace(Dt,p):t||"(?:)"}function pa(t,e,n){t=o(t),e=+e;var r=t.length;if(r>=e||!_u(e))return t;var i=(e-r)/2,a=mu(i),u=gu(i);return n=Ln("",u,n),n.slice(0,a)+t+n}function ga(t,e,n){return(n?Jn(t,e,n):null==e)?e=0:e&&(e=+e),t=_a(t),ku(t,e||(Lt.test(t)?16:10))}function ya(t,e){var n="";if(t=o(t),e=+e,1>e||!t||!_u(e))return n;do e%2&&(n+=t),e=mu(e/2),t+=t;while(e);return n}function ma(t,e,n){return t=o(t),n=null==n?0:wu(0>n?0:+n||0,t.length),t.lastIndexOf(e,n)==n}function va(t,n,r){var i=e.templateSettings;r&&Jn(t,n,r)&&(n=r=E),t=o(t),n=ye(me({},r||n),i,ge);var a,u,s=ye(me({},n.imports),i.imports,ge),c=Yo(s),l=tn(s,c),h=0,f=n.interpolate||Pt,d="__p += '",p=Ha((n.escape||Pt).source+"|"+f.source+"|"+(f===At?Ft:Pt).source+"|"+(n.evaluate||Pt).source+"|$","g"),y="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++Ut+"]")+"\n";t.replace(p,function(e,n,r,i,o,s){return r||(r=i),d+=t.slice(h,s).replace(Rt,g),n&&(a=!0,d+="' +\n__e("+n+") +\n'"),o&&(u=!0,d+="';\n"+o+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),h=s+e.length,e}),d+="';\n";var m=n.variable;m||(d="with (obj) {\n"+d+"\n}\n"),d=(u?d.replace(pt,""):d).replace(gt,"$1").replace(yt,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=Ko(function(){return za(c,y+"return "+d).apply(E,l)});if(v.source=d,Fi(v))throw v;return v}function _a(t,e,n){var r=t;return(t=o(t))?(n?Jn(r,e,n):null==e)?t.slice(x(t),w(t)+1):(e+="",t.slice(s(t,e),c(t,e)+1)):t}function ba(t,e,n){var r=t;return t=o(t),t?t.slice((n?Jn(r,e,n):null==e)?x(t):s(t,e+"")):t}function xa(t,e,n){var r=t;return t=o(t),t?(n?Jn(r,e,n):null==e)?t.slice(0,w(t)+1):t.slice(0,c(t,e+"")+1):t}function wa(t,e,n){n&&Jn(t,e,n)&&(e=E);var r=O,i=P;if(null!=e)if(Ii(e)){var a="separator"in e?e.separator:a;r="length"in e?+e.length||0:r,i="omission"in e?o(e.omission):i}else r=+e||0;if(t=o(t),r>=t.length)return t;var u=r-i.length;if(1>u)return i;var s=t.slice(0,u);if(null==a)return s+i;if(Ui(a)){if(t.slice(u).search(a)){var c,l,h=t.slice(0,u);for(a.global||(a=Ha(a.source,(Bt.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(h);)l=c.index;s=s.slice(0,null==l?u:l)}}else if(t.indexOf(a,u)!=u){var f=s.lastIndexOf(a);f>-1&&(s=s.slice(0,f))}return s+i}function Aa(t){return t=o(t),t&&_t.test(t)?t.replace(mt,A):t}function ka(t,e,n){return n&&Jn(t,e,n)&&(e=E),t=o(t),t.match(e||jt)||[]}function Ea(t,e,n){return n&&Jn(t,e,n)&&(e=E),m(t)?Ca(t):be(t,e)}function Ma(t){return function(){return t}}function Da(t){return t}function Ca(t){return je(xe(t,!0))}function Sa(t,e){return Ye(t,xe(e,!0))}function Ta(t,e,n){if(null==n){var r=Ii(e),i=r?Yo(e):E,a=i&&i.length?Le(e,i):E;(a?a.length:r)||(a=!1,n=e,e=t,t=this)}a||(a=Le(e,Yo(e)));var u=!0,o=-1,s=Li(t),c=a.length;n===!1?u=!1:Ii(n)&&"chain"in n&&(u=n.chain);for(;++ot||!_u(t))return[];var r=-1,i=Ya(wu(t,Cu));for(e=un(e,n,1);++rr?i[r]=e(r):e(r);return i}function Pa(t){var e=++eu;return o(t)+e}function Ra(t,e){return(+t||0)+(+e||0)}function ja(t,e,n){return n&&Jn(t,e,n)&&(e=E),e=Un(e,n,3),1==e.length?de(So(t)?t:lr(t),e):Qe(t,e)}t=t?re.defaults(ne.Object(),t,re.pick(ne,Yt)):ne;{var Ya=t.Array,Ua=t.Date,$a=t.Error,za=t.Function,qa=t.Math,Ga=t.Number,Wa=t.Object,Ha=t.RegExp,Va=t.String,Xa=t.TypeError,Za=Ya.prototype,Ka=Wa.prototype,Qa=Va.prototype,Ja=za.prototype.toString,tu=Ka.hasOwnProperty,eu=0,nu=Ka.toString,ru=ne._,iu=Ha("^"+Ja.call(tu).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),au=t.ArrayBuffer,uu=t.clearTimeout,ou=t.parseFloat,su=qa.pow,cu=Ka.propertyIsEnumerable,lu=Gn(t,"Set"),hu=t.setTimeout,fu=Za.splice,du=t.Uint8Array,pu=Gn(t,"WeakMap"),gu=qa.ceil,yu=Gn(Wa,"create"),mu=qa.floor,vu=Gn(Ya,"isArray"),_u=t.isFinite,bu=Gn(Wa,"keys"),xu=qa.max,wu=qa.min,Au=Gn(Ua,"now"),ku=t.parseInt,Eu=qa.random,Mu=Ga.NEGATIVE_INFINITY,Du=Ga.POSITIVE_INFINITY,Cu=4294967295,Su=Cu-1,Tu=Cu>>>1,Fu=9007199254740991,Bu=pu&&new pu,Lu={};e.support={}}e.templateSettings={escape:xt,evaluate:wt,interpolate:At,variable:"",imports:{_:e}};var Iu=function(){function t(){}return function(e){if(Ii(e)){t.prototype=e;var n=new t;t.prototype=E}return n||{}}}(),Nu=fn(Fe),Ou=fn(Be,!0),Pu=dn(),Ru=dn(!0),ju=Bu?function(t,e){return Bu.set(t,e),t}:Da,Yu=Bu?function(t){return Bu.get(t)}:Ba,Uu=ze("length"),$u=function(){var t=0,e=0;return function(n,r){var i=go(),a=j-(i-e);if(e=i,a>0){if(++t>=R)return n}else t=0;return ju(n,r)}}(),zu=mi(function(t,e){return m(t)&&Kn(t)?Ae(t,Se(e,!1,!0)):[]}),qu=wn(),Gu=wn(!0),Wu=mi(function(t){for(var e=t.length,n=e,r=Ya(h),i=zn(),u=i==a,o=[];n--;){var s=t[n]=Kn(s=t[n])?s:[];r[n]=u&&s.length>=120?gn(n&&s):null}var c=t[0],l=-1,h=c?c.length:0,f=r[0];t:for(;++l2?t[e-2]:E,r=e>1?t[e-1]:E;return e>2&&"function"==typeof n?e-=2:(n=e>1&&"function"==typeof r?(--e,r):E,r=E),t.length=e,Rr(t,n,r)}),to=mi(function(t){return t=Se(t),this.thru(function(e){return Jt(So(e)?e:[hr(e)],t)})}),eo=mi(function(t,e){return ve(t,Se(e))}),no=ln(function(t,e,n){tu.call(t,n)?++t[n]:t[n]=1}),ro=xn(Nu),io=xn(Ou,!0),ao=En(ee,Nu),uo=En(ie,Ou),oo=ln(function(t,e,n){tu.call(t,n)?t[n].push(e):t[n]=[e]}),so=ln(function(t,e,n){t[n]=e}),co=mi(function(t,e,n){var r=-1,i="function"==typeof e,a=tr(e),u=Kn(t)?Ya(t.length):[];return Nu(t,function(t){var o=i?e:a&&null!=t?t[e]:E;u[++r]=o?o.apply(t,n):Zn(t,e,n)}),u}),lo=ln(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),ho=Fn(le,Nu),fo=Fn(he,Ou),po=mi(function(t,e){if(null==t)return[];var n=e[2];return n&&Jn(e[0],e[1],n)&&(e.length=1),Ke(t,Se(e),[])}),go=Au||function(){return(new Ua).getTime()},yo=mi(function(t,e,n){var r=D;if(n.length){var i=_(n,yo.placeholder);r|=B}return Pn(t,r,e,n,i)}),mo=mi(function(t,e){e=e.length?Se(e):Zi(t);for(var n=-1,r=e.length;++n0||0>e)?new K(n):(0>t?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==E&&(e=+e||0,n=0>e?n.dropRight(-e):n.take(e-t)),n)},K.prototype.takeRightWhile=function(t,e){return this.reverse().takeWhile(t,e).reverse()},K.prototype.toArray=function(){return this.take(Du)},Fe(K.prototype,function(t,n){var r=/^(?:filter|map|reject)|While$/.test(n),i=/^(?:first|last)$/.test(n),a=e[i?"take"+("last"==n?"Right":""):n];a&&(e.prototype[n]=function(){var e=i?[1]:arguments,n=this.__chain__,u=this.__wrapped__,o=!!this.__actions__.length,s=u instanceof K,c=e[0],l=s||So(u);l&&r&&"function"==typeof c&&1!=c.length&&(s=l=!1);var h=function(t){return i&&n?a(t,1)[0]:a.apply(E,ce([t],e))},f={func:zr,args:[h],thisArg:E},d=s&&!o;if(i&&!n)return d?(u=u.clone(),u.__actions__.push(f),t.call(u)):a.call(E,this.value())[0];if(!i&&l){u=d?u:new K(this);var p=t.apply(u,e);return p.__actions__.push(f),new v(p,n)}return this.thru(h)})}),ee(["join","pop","push","replace","shift","sort","splice","split","unshift"],function(t){var n=(/^(?:replace|split)$/.test(t)?Qa:Za)[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:join|pop|replace|shift)$/.test(t);e.prototype[t]=function(){var t=arguments;return i&&!this.__chain__?n.apply(this.value(),t):this[r](function(e){return n.apply(e,t)})}}),Fe(K.prototype,function(t,n){var r=e[n];if(r){var i=r.name,a=Lu[i]||(Lu[i]=[]);a.push({name:n,func:r})}}),Lu[Bn(E,C).name]=[{name:"wrapper",func:E}],K.prototype.clone=et,K.prototype.reverse=rt,K.prototype.value=qt,e.prototype.chain=qr,e.prototype.commit=Gr,e.prototype.concat=to,e.prototype.plant=Wr,e.prototype.reverse=Hr,e.prototype.toString=Vr,e.prototype.run=e.prototype.toJSON=e.prototype.valueOf=e.prototype.value=Xr,e.prototype.collect=e.prototype.map,e.prototype.head=e.prototype.first,e.prototype.select=e.prototype.filter,e.prototype.tail=e.prototype.rest,e}var E,M="3.10.1",D=1,C=2,S=4,T=8,F=16,B=32,L=64,I=128,N=256,O=30,P="...",R=150,j=16,Y=200,U=1,$=2,z="Expected a function",q="__lodash_placeholder__",G="[object Arguments]",W="[object Array]",H="[object Boolean]",V="[object Date]",X="[object Error]",Z="[object Function]",K="[object Map]",Q="[object Number]",J="[object Object]",tt="[object RegExp]",et="[object Set]",nt="[object String]",rt="[object WeakMap]",it="[object ArrayBuffer]",at="[object Float32Array]",ut="[object Float64Array]",ot="[object Int8Array]",st="[object Int16Array]",ct="[object Int32Array]",lt="[object Uint8Array]",ht="[object Uint8ClampedArray]",ft="[object Uint16Array]",dt="[object Uint32Array]",pt=/\b__p \+= '';/g,gt=/\b(__p \+=) '' \+/g,yt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mt=/&(?:amp|lt|gt|quot|#39|#96);/g,vt=/[&<>"'`]/g,_t=RegExp(mt.source),bt=RegExp(vt.source),xt=/<%-([\s\S]+?)%>/g,wt=/<%([\s\S]+?)%>/g,At=/<%=([\s\S]+?)%>/g,kt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,Et=/^\w*$/,Mt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,Dt=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,Ct=RegExp(Dt.source),St=/[\u0300-\u036f\ufe20-\ufe23]/g,Tt=/\\(\\)?/g,Ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Bt=/\w*$/,Lt=/^0[xX]/,It=/^\[object .+?Constructor\]$/,Nt=/^\d+$/,Ot=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Pt=/($^)/,Rt=/['\n\r\u2028\u2029\\]/g,jt=function(){var t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",e="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(t+"+(?="+t+e+")|"+t+"?"+e+"|"+t+"+|[0-9]+","g")}(),Yt=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Ut=-1,$t={};$t[at]=$t[ut]=$t[ot]=$t[st]=$t[ct]=$t[lt]=$t[ht]=$t[ft]=$t[dt]=!0,$t[G]=$t[W]=$t[it]=$t[H]=$t[V]=$t[X]=$t[Z]=$t[K]=$t[Q]=$t[J]=$t[tt]=$t[et]=$t[nt]=$t[rt]=!1;var zt={};zt[G]=zt[W]=zt[it]=zt[H]=zt[V]=zt[at]=zt[ut]=zt[ot]=zt[st]=zt[ct]=zt[Q]=zt[J]=zt[tt]=zt[nt]=zt[lt]=zt[ht]=zt[ft]=zt[dt]=!0,zt[X]=zt[Z]=zt[K]=zt[et]=zt[rt]=!1;var qt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},Gt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Wt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ht={"function":!0,object:!0},Vt={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Xt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Zt=Ht[typeof n]&&n&&!n.nodeType&&n,Kt=Ht[typeof e]&&e&&!e.nodeType&&e,Qt=Zt&&Kt&&"object"==typeof t&&t&&t.Object&&t,Jt=Ht[typeof self]&&self&&self.Object&&self,te=Ht[typeof window]&&window&&window.Object&&window,ee=Kt&&Kt.exports===Zt&&Zt,ne=Qt||te!==(this&&this.window)&&te||Jt||this,re=k();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(ne._=re,define(function(){return re})):Zt&&Kt?ee?(Kt.exports=re)._=re:Zt._=re:ne._=re}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],54:[function(t,e){e.exports={graphlib:t("./lib/graphlib"),layout:t("./lib/layout"),debug:t("./lib/debug"),util:{time:t("./lib/util").time,notime:t("./lib/util").notime},version:t("./lib/version")}},{"./lib/debug":59,"./lib/graphlib":60,"./lib/layout":62,"./lib/util":82,"./lib/version":83}],55:[function(t,e){"use strict";function n(t){function e(t){return function(e){return t.edge(e).weight}}var n="greedy"===t.graph().acyclicer?u(t,e(t)):r(t);a.each(n,function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,a.uniqueId("rev"))})}function r(t){function e(u){a.has(i,u)||(i[u]=!0,r[u]=!0,a.each(t.outEdges(u),function(t){a.has(r,t.w)?n.push(t):e(t.w)}),delete r[u])}var n=[],r={},i={};return a.each(t.nodes(),e),n}function i(t){a.each(t.edges(),function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}})}var a=t("./lodash"),u=t("./greedy-fas");e.exports={run:n,undo:i}},{"./greedy-fas":61,"./lodash":63}],56:[function(t,e){function n(t){function e(n){var a=t.children(n),u=t.node(n);if(a.length&&i.each(a,e),i.has(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(var o=u.minRank,s=u.maxRank+1;s>o;++o)r(t,"borderLeft","_bl",n,u,o),r(t,"borderRight","_br",n,u,o)}}i.each(t.children(),e)}function r(t,e,n,r,i,u){var o={width:0,height:0,rank:u,borderType:e},s=i[e][u-1],c=a.addDummyNode(t,"border",o,n);i[e][u]=c,t.setParent(c,r),s&&t.setEdge(s,c,{weight:1})}var i=t("./lodash"),a=t("./util");e.exports=n},{"./lodash":63,"./util":82}],57:[function(t,e){"use strict";function n(t){var e=t.graph().rankdir.toLowerCase();("lr"===e||"rl"===e)&&i(t)}function r(t){var e=t.graph().rankdir.toLowerCase();("bt"===e||"rl"===e)&&u(t),("lr"===e||"rl"===e)&&(s(t),i(t))}function i(t){l.each(t.nodes(),function(e){a(t.node(e))}),l.each(t.edges(),function(e){a(t.edge(e))})}function a(t){var e=t.width;t.width=t.height,t.height=e}function u(t){l.each(t.nodes(),function(e){o(t.node(e))}),l.each(t.edges(),function(e){var n=t.edge(e);l.each(n.points,o),l.has(n,"y")&&o(n)})}function o(t){t.y=-t.y}function s(t){l.each(t.nodes(),function(e){c(t.node(e))}),l.each(t.edges(),function(e){var n=t.edge(e);l.each(n.points,c),l.has(n,"x")&&c(n)})}function c(t){var e=t.x;t.x=t.y,t.y=e}var l=t("./lodash");e.exports={adjust:n,undo:r}},{"./lodash":63}],58:[function(t,e){function n(){var t={};t._next=t._prev=t,this._sentinel=t}function r(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function i(t,e){return"_next"!==t&&"_prev"!==t?e:void 0}e.exports=n,n.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;return e!==t?(r(e),e):void 0},n.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&r(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},n.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,i)),n=n._prev;return"["+t.join(", ")+"]"}},{}],59:[function(t,e){function n(t){var e=i.buildLayerMatrix(t),n=new a({compound:!0,multigraph:!0}).setGraph({});return r.each(t.nodes(),function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)}),r.each(t.edges(),function(t){n.setEdge(t.v,t.w,{},t.name)}),r.each(e,function(t,e){var i="layer"+e;n.setNode(i,{rank:"same"}),r.reduce(t,function(t,e){return n.setEdge(t,e,{style:"invis"}),e})}),n}var r=t("./lodash"),i=t("./util"),a=t("./graphlib").Graph;e.exports={debugOrdering:n}},{"./graphlib":60,"./lodash":63,"./util":82}],60:[function(t,e){var n;if("function"==typeof t)try{n=t("graphlib")}catch(r){}n||(n=window.graphlib),e.exports=n},{graphlib:84}],61:[function(t,e){function n(t,e){if(t.nodeCount()<=1)return[];var n=a(t,e||l),i=r(n.graph,n.buckets,n.zeroIdx);return o.flatten(o.map(i,function(e){return t.outEdges(e.v,e.w)}),!0)}function r(t,e,n){for(var r,a=[],u=e[e.length-1],o=e[0];t.nodeCount();){for(;r=o.dequeue();)i(t,e,n,r);for(;r=u.dequeue();)i(t,e,n,r);if(t.nodeCount())for(var s=e.length-2;s>0;--s)if(r=e[s].dequeue()){a=a.concat(i(t,e,n,r,!0));break}}return a}function i(t,e,n,r,i){var a=i?[]:void 0;return o.each(t.inEdges(r.v),function(r){var o=t.edge(r),s=t.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,u(e,n,s)}),o.each(t.outEdges(r.v),function(r){var i=t.edge(r),a=r.w,o=t.node(a);o["in"]-=i,u(e,n,o)}),t.removeNode(r.v),a}function a(t,e){var n=new s,r=0,i=0;o.each(t.nodes(),function(t){n.setNode(t,{v:t,"in":0,out:0})}),o.each(t.edges(),function(t){var a=n.edge(t.v,t.w)||0,u=e(t),o=a+u;n.setEdge(t.v,t.w,o),i=Math.max(i,n.node(t.v).out+=u),r=Math.max(r,n.node(t.w)["in"]+=u)});var a=o.range(i+r+3).map(function(){return new c}),l=r+1;return o.each(n.nodes(),function(t){u(a,l,n.node(t))}),{graph:n,buckets:a,zeroIdx:l}}function u(t,e,n){n.out?n["in"]?t[n.out-n["in"]+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}var o=t("./lodash"),s=t("./graphlib").Graph,c=t("./data/list");e.exports=n;var l=o.constant(1)},{"./data/list":58,"./graphlib":60,"./lodash":63}],62:[function(t,e){"use strict";function n(t,e){var n=e&&e.debugTiming?B.time:B.notime;n("layout",function(){var e=n(" buildLayoutGraph",function(){return a(t)});n(" runLayout",function(){r(e,n)}),n(" updateInputGraph",function(){i(t,e)})})}function r(t,e){e(" makeSpaceForEdgeLabels",function(){u(t)}),e(" removeSelfEdges",function(){g(t)}),e(" acyclic",function(){x.run(t)}),e(" nestingGraph.run",function(){D.run(t)}),e(" rank",function(){A(B.asNonCompoundGraph(t))}),e(" injectEdgeLabelProxies",function(){o(t)}),e(" removeEmptyRanks",function(){M(t)}),e(" nestingGraph.cleanup",function(){D.cleanup(t)}),e(" normalizeRanks",function(){k(t)}),e(" assignRankMinMax",function(){s(t)}),e(" removeEdgeLabelProxies",function(){c(t)}),e(" normalize.run",function(){w.run(t)}),e(" parentDummyChains",function(){E(t)}),e(" addBorderSegments",function(){C(t)}),e(" order",function(){T(t)}),e(" insertSelfEdges",function(){y(t)}),e(" adjustCoordinateSystem",function(){S.adjust(t)}),e(" position",function(){F(t)}),e(" positionSelfEdges",function(){m(t)}),e(" removeBorderNodes",function(){p(t)}),e(" normalize.undo",function(){w.undo(t)}),e(" fixupEdgeLabelCoords",function(){f(t)}),e(" undoCoordinateSystem",function(){S.undo(t)}),e(" translateGraph",function(){l(t)}),e(" assignNodeIntersects",function(){h(t)}),e(" reversePoints",function(){d(t)}),e(" acyclic.undo",function(){x.undo(t)})}function i(t,e){b.each(t.nodes(),function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))}),b.each(t.edges(),function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,b.has(i,"x")&&(r.x=i.x,r.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function a(t){var e=new L({multigraph:!0,compound:!0}),n=_(t.graph());return e.setGraph(b.merge({},N,v(n,I),b.pick(n,O))),b.each(t.nodes(),function(n){var r=_(t.node(n));e.setNode(n,b.defaults(v(r,P),R)),e.setParent(n,t.parent(n))}),b.each(t.edges(),function(n){var r=_(t.edge(n));e.setEdge(n,b.merge({},Y,v(r,j),b.pick(r,U)))}),e}function u(t){var e=t.graph();e.ranksep/=2,b.each(t.edges(),function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function o(t){b.each(t.edges(),function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-r.rank)/2+r.rank,e:e};B.addDummyNode(t,"edge-proxy",a,"_ep")}})}function s(t){var e=0;b.each(t.nodes(),function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=b.max(e,r.maxRank))}),t.graph().maxRank=e}function c(t){b.each(t.nodes(),function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}function l(t){function e(t){var e=t.x,u=t.y,o=t.width,s=t.height;n=Math.min(n,e-o/2),r=Math.max(r,e+o/2),i=Math.min(i,u-s/2),a=Math.max(a,u+s/2)}var n=Number.POSITIVE_INFINITY,r=0,i=Number.POSITIVE_INFINITY,a=0,u=t.graph(),o=u.marginx||0,s=u.marginy||0;b.each(t.nodes(),function(n){e(t.node(n))}),b.each(t.edges(),function(n){var r=t.edge(n);b.has(r,"x")&&e(r)}),n-=o,i-=s,b.each(t.nodes(),function(e){var r=t.node(e);r.x-=n,r.y-=i}),b.each(t.edges(),function(e){var r=t.edge(e);b.each(r.points,function(t){t.x-=n,t.y-=i}),b.has(r,"x")&&(r.x-=n),b.has(r,"y")&&(r.y-=i)}),u.width=r-n+o,u.height=a-i+s}function h(t){b.each(t.edges(),function(e){var n,r,i=t.edge(e),a=t.node(e.v),u=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=u,r=a),i.points.unshift(B.intersectRect(a,n)),i.points.push(B.intersectRect(u,r))})}function f(t){b.each(t.edges(),function(e){var n=t.edge(e);if(b.has(n,"x"))switch(("l"===n.labelpos||"r"===n.labelpos)&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}function d(t){b.each(t.edges(),function(e){var n=t.edge(e);n.reversed&&n.points.reverse()})}function p(t){b.each(t.nodes(),function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),a=t.node(b.last(n.borderLeft)),u=t.node(b.last(n.borderRight));n.width=Math.abs(u.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),b.each(t.nodes(),function(e){"border"===t.node(e).dummy&&t.removeNode(e)})}function g(t){b.each(t.edges(),function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}function y(t){var e=B.buildLayerMatrix(t);b.each(e,function(e){var n=0;b.each(e,function(e,r){var i=t.node(e);i.order=r+n,b.each(i.selfEdges,function(e){B.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")}),delete i.selfEdges})})}function m(t){b.each(t.nodes(),function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,a=r.y,u=n.x-i,o=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*u/3,y:a-o},{x:i+5*u/6,y:a-o},{x:i+u,y:a},{x:i+5*u/6,y:a+o},{x:i+2*u/3,y:a+o}],n.label.x=n.x,n.label.y=n.y}})}function v(t,e){return b.mapValues(b.pick(t,e),Number)}function _(t){var e={};return b.each(t,function(t,n){e[n.toLowerCase()]=t}),e}var b=t("./lodash"),x=t("./acyclic"),w=t("./normalize"),A=t("./rank"),k=t("./util").normalizeRanks,E=t("./parent-dummy-chains"),M=t("./util").removeEmptyRanks,D=t("./nesting-graph"),C=t("./add-border-segments"),S=t("./coordinate-system"),T=t("./order"),F=t("./position"),B=t("./util"),L=t("./graphlib").Graph;e.exports=n;var I=["nodesep","edgesep","ranksep","marginx","marginy"],N={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},O=["acyclicer","ranker","rankdir","align"],P=["width","height"],R={width:0,height:0},j=["minlen","weight","width","height","labeloffset"],Y={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},U=["labelpos"]},{"./acyclic":55,"./add-border-segments":56,"./coordinate-system":57,"./graphlib":60,"./lodash":63,"./nesting-graph":64,"./normalize":65,"./order":70,"./parent-dummy-chains":75,"./position":77,"./rank":79,"./util":82}],63:[function(t,e){e.exports=t(51)},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\lodash.js":51,lodash:104}],64:[function(t,e){function n(t){var e=s.addDummyNode(t,"root",{},"_root"),n=i(t),u=o.max(n)-1,c=2*u+1;t.graph().nestingRoot=e,o.each(t.edges(),function(e){t.edge(e).minlen*=c});var l=a(t)+1;o.each(t.children(),function(i){r(t,e,c,l,u,n,i)}),t.graph().nodeRankFactor=c}function r(t,e,n,i,a,u,c){var l=t.children(c);if(!l.length)return void(c!==e&&t.setEdge(e,c,{weight:0,minlen:n}));var h=s.addBorderNode(t,"_bt"),f=s.addBorderNode(t,"_bb"),d=t.node(c);t.setParent(h,c),d.borderTop=h,t.setParent(f,c),d.borderBottom=f,o.each(l,function(o){r(t,e,n,i,a,u,o);var s=t.node(o),l=s.borderTop?s.borderTop:o,d=s.borderBottom?s.borderBottom:o,p=s.borderTop?i:2*i,g=l!==d?1:a-u[c]+1;t.setEdge(h,l,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(d,f,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(c)||t.setEdge(e,h,{weight:0,minlen:a+u[c]})}function i(t){function e(r,i){var a=t.children(r);a&&a.length&&o.each(a,function(t){e(t,i+1)}),n[r]=i}var n={};return o.each(t.children(),function(t){e(t,1)}),n}function a(t){return o.reduce(t.edges(),function(e,n){return e+t.edge(n).weight},0)}function u(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,o.each(t.edges(),function(e){var n=t.edge(e);n.nestingEdge&&t.removeEdge(e)})}var o=t("./lodash"),s=t("./util");e.exports={run:n,cleanup:u}},{"./lodash":63,"./util":82}],65:[function(t,e){"use strict";function n(t){t.graph().dummyChains=[],a.each(t.edges(),function(e){r(t,e)})}function r(t,e){var n=e.v,r=t.node(n).rank,i=e.w,a=t.node(i).rank,o=e.name,s=t.edge(e),c=s.labelRank;if(a!==r+1){t.removeEdge(e);var l,h,f;for(f=0,++r;a>r;++f,++r)s.points=[],h={width:0,height:0,edgeLabel:s,edgeObj:e,rank:r},l=u.addDummyNode(t,"edge",h,"_d"),r===c&&(h.width=s.width,h.height=s.height,h.dummy="edge-label",h.labelpos=s.labelpos),t.setEdge(n,l,{weight:s.weight},o),0===f&&t.graph().dummyChains.push(l),n=l;t.setEdge(n,i,{weight:s.weight},o)}}function i(t){a.each(t.graph().dummyChains,function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)})}var a=t("./lodash"),u=t("./util");e.exports={run:n,undo:i}},{"./lodash":63,"./util":82}],66:[function(t,e){function n(t,e,n){var i,a={};r.each(n,function(n){for(var r,u,o=t.parent(n);o;){if(r=t.parent(o),r?(u=a[r],a[r]=o):(u=i,i=o),u&&u!==o)return void e.setEdge(u,o);o=r}})}var r=t("../lodash");e.exports=n},{"../lodash":63}],67:[function(t,e){function n(t,e){return r.map(e,function(e){var n=t.inEdges(e);if(n.length){var i=r.reduce(n,function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}},{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}})}var r=t("../lodash");e.exports=n},{"../lodash":63}],68:[function(t,e){function n(t,e,n){var u=r(t),o=new a({compound:!0}).setGraph({root:u}).setDefaultNodeLabel(function(e){return t.node(e)});return i.each(t.nodes(),function(r){var a=t.node(r),s=t.parent(r);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(o.setNode(r),o.setParent(r,s||u),i.each(t[n](r),function(e){var n=e.v===r?e.w:e.v,a=o.edge(n,r),u=i.isUndefined(a)?0:a.weight;o.setEdge(n,r,{weight:t.edge(e).weight+u})}),i.has(a,"minRank")&&o.setNode(r,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),o}function r(t){for(var e;t.hasNode(e=i.uniqueId("_root")););return e}var i=t("../lodash"),a=t("../graphlib").Graph;e.exports=n},{"../graphlib":60,"../lodash":63}],69:[function(t,e){"use strict";function n(t,e){for(var n=0,i=1;i0;)e%2&&(n+=s[e+1]),e=e-1>>1,s[e]+=t.weight;c+=t.weight*n})),c}var i=t("../lodash");e.exports=n},{"../lodash":63}],70:[function(t,e){"use strict";function n(t){var e=d.maxRank(t),n=r(t,u.range(1,e+1),"inEdges"),c=r(t,u.range(e-1,-1,-1),"outEdges"),l=o(t);a(t,l);for(var h,f=Number.POSITIVE_INFINITY,p=0,g=0;4>g;++p,++g){i(p%2?n:c,p%4>=2),l=d.buildLayerMatrix(t);var y=s(t,l);f>y&&(g=0,h=u.cloneDeep(l),f=y)}a(t,h)}function r(t,e,n){return u.map(e,function(e){return l(t,e,n)})}function i(t,e){var n=new f;u.each(t,function(t){var r=t.graph().root,i=c(t,r,n,e);u.each(i.vs,function(e,n){t.node(e).order=n}),h(t,n,i.vs)})}function a(t,e){u.each(e,function(e){u.each(e,function(e,n){t.node(e).order=n})})}var u=t("../lodash"),o=t("./init-order"),s=t("./cross-count"),c=t("./sort-subgraph"),l=t("./build-layer-graph"),h=t("./add-subgraph-constraints"),f=t("../graphlib").Graph,d=t("../util");e.exports=n},{"../graphlib":60,"../lodash":63,"../util":82,"./add-subgraph-constraints":66,"./build-layer-graph":68,"./cross-count":69,"./init-order":71,"./sort-subgraph":73}],71:[function(t,e){"use strict";function n(t){function e(i){if(!r.has(n,i)){n[i]=!0;var a=t.node(i);u[a.rank].push(i),r.each(t.successors(i),e)}}var n={},i=r.filter(t.nodes(),function(e){return!t.children(e).length}),a=r.max(r.map(i,function(e){return t.node(e).rank})),u=r.map(r.range(a+1),function(){return[]}),o=r.sortBy(i,function(e){return t.node(e).rank});return r.each(o,e),u}var r=t("../lodash");e.exports=n},{"../lodash":63}],72:[function(t,e){"use strict";function n(t,e){var n={};a.each(t,function(t,e){var r=n[t.v]={indegree:0,"in":[],out:[],vs:[t.v],i:e};a.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)}),a.each(e.edges(),function(t){var e=n[t.v],r=n[t.w];a.isUndefined(e)||a.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))});var i=a.filter(n,function(t){return!t.indegree});return r(i)}function r(t){function e(t){return function(e){e.merged||(a.isUndefined(e.barycenter)||a.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&i(t,e)}}function n(e){return function(n){n["in"].push(e),0===--n.indegree&&t.push(n)}}for(var r=[];t.length;){var u=t.pop();r.push(u),a.each(u["in"].reverse(),e(u)),a.each(u.out,n(u))}return a.chain(r).filter(function(t){return!t.merged}).map(function(t){return a.pick(t,["vs","i","barycenter","weight"])}).value()}function i(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}var a=t("../lodash");e.exports=n},{"../lodash":63}],73:[function(t,e){function n(t,e,c,l){var h=t.children(e),f=t.node(e),d=f?f.borderLeft:void 0,p=f?f.borderRight:void 0,g={};d&&(h=a.filter(h,function(t){return t!==d&&t!==p}));var y=u(t,h);a.each(y,function(e){if(t.children(e.v).length){var r=n(t,e.v,c,l);g[e.v]=r,a.has(r,"barycenter")&&i(e,r)}});var m=o(y,c);r(m,g);var v=s(m,l);if(d&&(v.vs=a.flatten([d,v.vs,p],!0),t.predecessors(d).length)){var _=t.node(t.predecessors(d)[0]),b=t.node(t.predecessors(p)[0]);a.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+_.order+b.order)/(v.weight+2),v.weight+=2}return v}function r(t,e){a.each(t,function(t){t.vs=a.flatten(t.vs.map(function(t){return e[t]?e[t].vs:t}),!0)})}function i(t,e){a.isUndefined(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}var a=t("../lodash"),u=t("./barycenter"),o=t("./resolve-conflicts"),s=t("./sort");e.exports=n},{"../lodash":63,"./barycenter":67,"./resolve-conflicts":72,"./sort":74}],74:[function(t,e){function n(t,e){var n=u.partition(t,function(t){return a.has(t,"barycenter")}),o=n.lhs,s=a.sortBy(n.rhs,function(t){return-t.i}),c=[],l=0,h=0,f=0;o.sort(i(!!e)),f=r(c,s,f),a.each(o,function(t){f+=t.vs.length,c.push(t.vs),l+=t.barycenter*t.weight,h+=t.weight,f=r(c,s,f)});var d={vs:a.flatten(c,!0)};return h&&(d.barycenter=l/h,d.weight=h),d}function r(t,e,n){for(var r;e.length&&(r=a.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}function i(t){return function(e,n){return e.barycentern.barycenter?1:t?n.i-e.i:e.i-n.i}}var a=t("../lodash"),u=t("../util");e.exports=n},{"../lodash":63,"../util":82}],75:[function(t,e){function n(t){var e=i(t);a.each(t.graph().dummyChains,function(n){for(var i=t.node(n),a=i.edgeObj,u=r(t,e,a.v,a.w),o=u.path,s=u.lca,c=0,l=o[c],h=!0;n!==a.w;){if(i=t.node(n),h){for(;(l=o[c])!==s&&t.node(l).maxRanks||c>e[i].lim));for(a=i,i=r;(i=t.parent(i))!==a;)o.push(i);return{path:u.concat(o.reverse()),lca:a}}function i(t){function e(i){var u=r;a.each(t.children(i),e),n[i]={low:u,lim:r++}}var n={},r=0;return a.each(t.children(),e),n}var a=t("./lodash");e.exports=n},{"./lodash":63}],76:[function(t,e){"use strict";function n(t,e){function n(e,n){ -var u=0,o=0,s=e.length,c=y.last(n);return y.each(n,function(e,l){var h=i(t,e),f=h?t.node(h).order:s;(h||e===c)&&(y.each(n.slice(o,l+1),function(e){y.each(t.predecessors(e),function(n){var i=t.node(n),o=i.order;!(u>o||o>f)||i.dummy&&t.node(e).dummy||a(r,n,e)})}),o=l+1,u=f)}),n}var r={};return y.reduce(e,n),r}function r(t,e){function n(e,n,r,u,o){var s;y.each(y.range(n,r),function(n){s=e[n],t.node(s).dummy&&y.each(t.predecessors(s),function(e){var n=t.node(e);n.dummy&&(n.ordero)&&a(i,e,s)})})}function r(e,r){var i,a=-1,u=0;return y.each(r,function(o,s){if("border"===t.node(o).dummy){var c=t.predecessors(o);c.length&&(i=t.node(c[0]).order,n(r,u,s,a,i),u=s,a=i)}n(r,u,r.length,i,e.length)}),r}var i={};return y.reduce(e,r),i}function i(t,e){return t.node(e).dummy?y.find(t.predecessors(e),function(e){return t.node(e).dummy}):void 0}function a(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function u(t,e,n){if(e>n){var r=e;e=n,n=r}return y.has(t[e],n)}function o(t,e,n,r){var i={},a={},o={};return y.each(e,function(t){y.each(t,function(t,e){i[t]=t,a[t]=t,o[t]=e})}),y.each(e,function(t){var e=-1;y.each(t,function(t){var s=r(t);if(s.length){s=y.sortBy(s,function(t){return o[t]});for(var c=(s.length-1)/2,l=Math.floor(c),h=Math.ceil(c);h>=l;++l){var f=s[l];a[t]===t&&eu.lim&&(o=u,s=!0);var c=p.filter(e.edges(),function(e){return s===d(t,t.node(e.v),o)&&s!==d(t,t.node(e.w),o)});return p.min(c,function(t){return y(e,t)})}function l(t,e,n,i){var a=n.v,o=n.w;t.removeEdge(a,o),t.setEdge(i.v,i.w,{}),u(t),r(t,e),h(t,e)}function h(t,e){var n=p.find(t.nodes(),function(t){return!e.node(t).parent}),r=v(t,n);r=r.slice(1),p.each(r,function(n){var r=t.node(n).parent,i=e.edge(n,r),a=!1;i||(i=e.edge(r,n),a=!0),e.node(n).rank=e.node(r).rank+(a?i.minlen:-i.minlen)})}function f(t,e,n){return t.hasEdge(e,n)}function d(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}var p=t("../lodash"),g=t("./feasible-tree"),y=t("./util").slack,m=t("./util").longestPath,v=t("../graphlib").alg.preorder,_=t("../graphlib").alg.postorder,b=t("../util").simplify;e.exports=n,n.initLowLimValues=u,n.initCutValues=r,n.calcCutValue=a,n.leaveEdge=s,n.enterEdge=c,n.exchangeEdges=l},{"../graphlib":60,"../lodash":63,"../util":82,"./feasible-tree":78,"./util":81}],81:[function(t,e){"use strict";function n(t){function e(r){var a=t.node(r);if(i.has(n,r))return a.rank;n[r]=!0;var u=i.min(i.map(t.outEdges(r),function(n){return e(n.w)-t.edge(n).minlen}));return u===Number.POSITIVE_INFINITY&&(u=0),a.rank=u}var n={};i.each(t.sources(),e)}function r(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var i=t("../lodash");e.exports={longestPath:n,slack:r}},{"../lodash":63}],82:[function(t,e){"use strict";function n(t,e,n,r){var i;do i=y.uniqueId(r);while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function r(t){var e=(new m).setGraph(t.graph());return y.each(t.nodes(),function(n){e.setNode(n,t.node(n))}),y.each(t.edges(),function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),e}function i(t){var e=new m({multigraph:t.isMultigraph()}).setGraph(t.graph());return y.each(t.nodes(),function(n){t.children(n).length||e.setNode(n,t.node(n))}),y.each(t.edges(),function(n){e.setEdge(n,t.edge(n))}),e}function a(t){var e=y.map(t.nodes(),function(e){var n={};return y.each(t.outEdges(e),function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight}),n});return y.zipObject(t.nodes(),e)}function u(t){var e=y.map(t.nodes(),function(e){var n={};return y.each(t.inEdges(e),function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight}),n});return y.zipObject(t.nodes(),e)}function o(t,e){var n=t.x,r=t.y,i=e.x-n,a=e.y-r,u=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var s,c;return Math.abs(a)*u>Math.abs(i)*o?(0>a&&(o=-o),s=o*i/a,c=o):(0>i&&(u=-u),s=u,c=u*a/i),{x:n+s,y:r+c}}function s(t){var e=y.map(y.range(f(t)+1),function(){return[]});return y.each(t.nodes(),function(n){var r=t.node(n),i=r.rank;y.isUndefined(i)||(e[i][r.order]=n)}),e}function c(t){var e=y.min(y.map(t.nodes(),function(e){return t.node(e).rank}));y.each(t.nodes(),function(n){var r=t.node(n);y.has(r,"rank")&&(r.rank-=e)})}function l(t){var e=y.min(y.map(t.nodes(),function(e){return t.node(e).rank})),n=[];y.each(t.nodes(),function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=t.graph().nodeRankFactor;y.each(n,function(e,n){y.isUndefined(e)&&n%i!==0?--r:r&&y.each(e,function(e){t.node(e).rank+=r})})}function h(t,e,r,i){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=i),n(t,"border",a,e)}function f(t){return y.max(y.map(t.nodes(),function(e){var n=t.node(e).rank;return y.isUndefined(n)?void 0:n}))}function d(t,e){var n={lhs:[],rhs:[]};return y.each(t,function(t){e(t)?n.lhs.push(t):n.rhs.push(t)}),n}function p(t,e){var n=y.now();try{return e()}finally{console.log(t+" time: "+(y.now()-n)+"ms")}}function g(t,e){return e()}var y=t("./lodash"),m=t("./graphlib").Graph;e.exports={addDummyNode:n,simplify:r,asNonCompoundGraph:i,successorWeights:a,predecessorWeights:u,intersectRect:o,buildLayerMatrix:s,normalizeRanks:c,removeEmptyRanks:l,addBorderNode:h,maxRank:f,partition:d,time:p,notime:g}},{"./graphlib":60,"./lodash":63}],83:[function(t,e){e.exports="0.7.4"},{}],84:[function(t,e){e.exports=t(33)},{"./lib":100,"./lib/alg":91,"./lib/json":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\index.js":33}],85:[function(t,e){e.exports=t(34)},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\components.js":34}],86:[function(t,e){e.exports=t(35)},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dfs.js":35}],87:[function(t,e){e.exports=t(36)},{"../lodash":102,"./dijkstra":88,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dijkstra-all.js":36}],88:[function(t,e){e.exports=t(37)},{"../data/priority-queue":98,"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dijkstra.js":37}],89:[function(t,e){e.exports=t(38)},{"../lodash":102,"./tarjan":96,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\find-cycles.js":38}],90:[function(t,e){e.exports=t(39)},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\floyd-warshall.js":39}],91:[function(t,e){e.exports=t(40)},{"./components":85,"./dijkstra":88,"./dijkstra-all":87,"./find-cycles":89,"./floyd-warshall":90,"./is-acyclic":92,"./postorder":93,"./preorder":94,"./prim":95,"./tarjan":96,"./topsort":97,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\index.js":40}],92:[function(t,e){e.exports=t(41)},{"./topsort":97,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\is-acyclic.js":41}],93:[function(t,e){e.exports=t(42)},{"./dfs":86,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\postorder.js":42}],94:[function(t,e){e.exports=t(43)},{"./dfs":86,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\preorder.js":43}],95:[function(t,e){e.exports=t(44)},{"../data/priority-queue":98,"../graph":99,"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\prim.js":44}],96:[function(t,e){e.exports=t(45)},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\tarjan.js":45}],97:[function(t,e){e.exports=t(46)},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\topsort.js":46}],98:[function(t,e){e.exports=t(47)},{"../lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\data\\priority-queue.js":47}],99:[function(t,e){e.exports=t(48)},{"./lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\graph.js":48}],100:[function(t,e){e.exports=t(49)},{"./graph":99,"./version":103,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\index.js":49}],101:[function(t,e){e.exports=t(50)},{"./graph":99,"./lodash":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\json.js":50}],102:[function(t,e){e.exports=t(51)},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\lodash.js":51,lodash:104}],103:[function(t,e){e.exports=t(52)},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\version.js":52}],104:[function(t,e){e.exports=t(53)},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\lodash\\index.js":53}],105:[function(t,e,n){!function(t,r){"object"==typeof n&&"undefined"!=typeof e?e.exports=r():"function"==typeof define&&define.amd?define(r):t.moment=r()}(this,function(){"use strict";function n(){return On.apply(null,arguments)}function r(t){On=t}function i(t){return"[object Array]"===Object.prototype.toString.call(t)}function a(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function u(t,e){var n,r=[];for(n=0;n0)for(n in Rn)r=Rn[n],i=e[r],"undefined"!=typeof i&&(t[r]=i);return t}function g(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():0/0),jn===!1&&(jn=!0,n.updateOffset(this),jn=!1)}function y(t){return t instanceof g||null!=t&&null!=t._isAMomentObject}function m(t){return 0>t?Math.ceil(t):Math.floor(t)}function v(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=m(e)),n}function _(t,e,n){var r,i=Math.min(t.length,e.length),a=Math.abs(t.length-e.length),u=0;for(r=0;i>r;r++)(n&&t[r]!==e[r]||!n&&v(t[r])!==v(e[r]))&&u++;return u+a}function b(){}function x(t){return t?t.toLowerCase().replace("_","-"):t}function w(t){for(var e,n,r,i,a=0;a0;){if(r=A(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&_(i,n,!0)>=e-1)break;e--}a++}return null}function A(n){var r=null;if(!Yn[n]&&"undefined"!=typeof e&&e&&e.exports)try{r=Pn._abbr,t("./locale/"+n),k(r)}catch(i){}return Yn[n]}function k(t,e){var n;return t&&(n="undefined"==typeof e?M(t):E(t,e),n&&(Pn=n)),Pn._abbr}function E(t,e){return null!==e?(e.abbr=t,Yn[t]=Yn[t]||new b,Yn[t].set(e),k(t),Yn[t]):(delete Yn[t],null)}function M(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Pn;if(!i(t)){if(e=A(t))return e;t=[t]}return w(t)}function D(t,e){var n=t.toLowerCase();Un[n]=Un[n+"s"]=Un[e]=t}function C(t){return"string"==typeof t?Un[t]||Un[t.toLowerCase()]:void 0}function S(t){var e,n,r={};for(n in t)o(t,n)&&(e=C(n),e&&(r[e]=t[n]));return r}function T(t,e){return function(r){return null!=r?(B(this,t,r),n.updateOffset(this,e),this):F(this,t)}}function F(t,e){return t._d["get"+(t._isUTC?"UTC":"")+e]()}function B(t,e,n){return t._d["set"+(t._isUTC?"UTC":"")+e](n)}function L(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if(t=C(t),"function"==typeof this[t])return this[t](e);return this}function I(t,e,n){var r=""+Math.abs(t),i=e-r.length,a=t>=0;return(a?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}function N(t,e,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),t&&(Gn[t]=i),e&&(Gn[e[0]]=function(){return I(i.apply(this,arguments),e[1],e[2])}),n&&(Gn[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function O(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function P(t){var e,n,r=t.match($n);for(e=0,n=r.length;n>e;e++)r[e]=Gn[r[e]]?Gn[r[e]]:O(r[e]);return function(i){var a="";for(e=0;n>e;e++)a+=r[e]instanceof Function?r[e].call(i,t):r[e];return a}}function R(t,e){return t.isValid()?(e=j(e,t.localeData()),qn[e]=qn[e]||P(e),qn[e](t)):t.localeData().invalidDate()}function j(t,e){function n(t){return e.longDateFormat(t)||t}var r=5;for(zn.lastIndex=0;r>=0&&zn.test(t);)t=t.replace(zn,n),zn.lastIndex=0,r-=1;return t}function Y(t){return"function"==typeof t&&"[object Function]"===Object.prototype.toString.call(t)}function U(t,e,n){ur[t]=Y(e)?e:function(t){return t&&n?n:e}}function $(t,e){return o(ur,t)?ur[t](e._strict,e._locale):new RegExp(z(t))}function z(t){return t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,r,i){return e||n||r||i}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function q(t,e){var n,r=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(r=function(t,n){n[e]=v(t)}),n=0;nr;r++){if(i=c([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[r].test(t))return r;if(n&&"MMM"===e&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function K(t,e){var n;return"string"==typeof e&&(e=t.localeData().monthsParse(e),"number"!=typeof e)?t:(n=Math.min(t.date(),H(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t)}function Q(t){return null!=t?(K(this,t),n.updateOffset(this,!0),this):F(this,"Month")}function J(){return H(this.year(),this.month())}function tt(t){var e,n=t._a;return n&&-2===h(t).overflow&&(e=n[cr]<0||n[cr]>11?cr:n[lr]<1||n[lr]>H(n[sr],n[cr])?lr:n[hr]<0||n[hr]>24||24===n[hr]&&(0!==n[fr]||0!==n[dr]||0!==n[pr])?hr:n[fr]<0||n[fr]>59?fr:n[dr]<0||n[dr]>59?dr:n[pr]<0||n[pr]>999?pr:-1,h(t)._overflowDayOfYear&&(sr>e||e>lr)&&(e=lr),h(t).overflow=e),t}function et(t){n.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function nt(t,e){var n=!0;return s(function(){return n&&(et(t+"\n"+(new Error).stack),n=!1),e.apply(this,arguments)},e)}function rt(t,e){mr[t]||(et(e),mr[t]=!0)}function it(t){var e,n,r=t._i,i=vr.exec(r);if(i){for(h(t).iso=!0,e=0,n=_r.length;n>e;e++)if(_r[e][1].exec(r)){t._f=_r[e][0];break}for(e=0,n=br.length;n>e;e++)if(br[e][1].exec(r)){t._f+=(i[6]||" ")+br[e][0];break}r.match(rr)&&(t._f+="Z"),At(t)}else t._isValid=!1}function at(t){var e=xr.exec(t._i);return null!==e?void(t._d=new Date(+e[1])):(it(t),void(t._isValid===!1&&(delete t._isValid,n.createFromInputFallback(t))))}function ut(t,e,n,r,i,a,u){var o=new Date(t,e,n,r,i,a,u);return 1970>t&&o.setFullYear(t),o}function ot(t){var e=new Date(Date.UTC.apply(null,arguments));return 1970>t&&e.setUTCFullYear(t),e}function st(t){return ct(t)?366:365}function ct(t){return t%4===0&&t%100!==0||t%400===0}function lt(){return ct(this.year())}function ht(t,e,n){var r,i=n-e,a=n-t.day();return a>i&&(a-=7),i-7>a&&(a+=7),r=Ft(t).add(a,"d"),{week:Math.ceil(r.dayOfYear()/7),year:r.year()}}function ft(t){return ht(t,this._week.dow,this._week.doy).week}function dt(){return this._week.dow}function pt(){return this._week.doy}function gt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function yt(t){var e=ht(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function mt(t,e,n,r,i){var a,u=6+i-r,o=ot(t,0,1+u),s=o.getUTCDay();return i>s&&(s+=7),n=null!=n?1*n:i,a=1+u+7*(e-1)-s+n,{year:a>0?t:t-1,dayOfYear:a>0?a:st(t-1)+a}}function vt(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function _t(t,e,n){return null!=t?t:null!=e?e:n}function bt(t){var e=new Date;return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function xt(t){var e,n,r,i,a=[];if(!t._d){for(r=bt(t),t._w&&null==t._a[lr]&&null==t._a[cr]&&wt(t),t._dayOfYear&&(i=_t(t._a[sr],r[sr]),t._dayOfYear>st(i)&&(h(t)._overflowDayOfYear=!0),n=ot(i,0,t._dayOfYear),t._a[cr]=n.getUTCMonth(),t._a[lr]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=a[e]=r[e];for(;7>e;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[hr]&&0===t._a[fr]&&0===t._a[dr]&&0===t._a[pr]&&(t._nextDay=!0,t._a[hr]=0),t._d=(t._useUTC?ot:ut).apply(null,a),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[hr]=24)}}function wt(t){var e,n,r,i,a,u,o;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(a=1,u=4,n=_t(e.GG,t._a[sr],ht(Ft(),1,4).year),r=_t(e.W,1),i=_t(e.E,1)):(a=t._locale._week.dow,u=t._locale._week.doy,n=_t(e.gg,t._a[sr],ht(Ft(),a,u).year),r=_t(e.w,1),null!=e.d?(i=e.d,a>i&&++r):i=null!=e.e?e.e+a:a),o=mt(n,r,i,u,a),t._a[sr]=o.year,t._dayOfYear=o.dayOfYear}function At(t){if(t._f===n.ISO_8601)return void it(t);t._a=[],h(t).empty=!0;var e,r,i,a,u,o=""+t._i,s=o.length,c=0;for(i=j(t._f,t._locale).match($n)||[],e=0;e0&&h(t).unusedInput.push(u),o=o.slice(o.indexOf(r)+r.length),c+=r.length),Gn[a]?(r?h(t).empty=!1:h(t).unusedTokens.push(a),W(a,r,t)):t._strict&&!r&&h(t).unusedTokens.push(a);h(t).charsLeftOver=s-c,o.length>0&&h(t).unusedInput.push(o),h(t).bigHour===!0&&t._a[hr]<=12&&t._a[hr]>0&&(h(t).bigHour=void 0),t._a[hr]=kt(t._locale,t._a[hr],t._meridiem),xt(t),tt(t)}function kt(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(r=t.isPM(n),r&&12>e&&(e+=12),r||12!==e||(e=0),e):e}function Et(t){var e,n,r,i,a;if(0===t._f.length)return h(t).invalidFormat=!0,void(t._d=new Date(0/0));for(i=0;ia)&&(r=a,n=e));s(t,n||e)}function Mt(t){if(!t._d){var e=S(t._i);t._a=[e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],xt(t)}}function Dt(t){var e=new g(tt(Ct(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Ct(t){var e=t._i,n=t._f;return t._locale=t._locale||M(t._l),null===e||void 0===n&&""===e?d({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),y(e)?new g(tt(e)):(i(n)?Et(t):n?At(t):a(e)?t._d=e:St(t),t))}function St(t){var e=t._i;void 0===e?t._d=new Date:a(e)?t._d=new Date(+e):"string"==typeof e?at(t):i(e)?(t._a=u(e.slice(0),function(t){return parseInt(t,10)}),xt(t)):"object"==typeof e?Mt(t):"number"==typeof e?t._d=new Date(e):n.createFromInputFallback(t)}function Tt(t,e,n,r,i){var a={};return"boolean"==typeof n&&(r=n,n=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=t,a._f=e,a._strict=r,Dt(a)}function Ft(t,e,n,r){return Tt(t,e,n,r,!1)}function Bt(t,e){var n,r;if(1===e.length&&i(e[0])&&(e=e[0]),!e.length)return Ft();for(n=e[0],r=1;rt&&(t=-t,n="-"),n+I(~~(t/60),2)+e+I(~~t%60,2)})}function Rt(t){var e=(t||"").match(rr)||[],n=e[e.length-1]||[],r=(n+"").match(Mr)||["-",0,0],i=+(60*r[1])+v(r[2]);return"+"===r[0]?i:-i}function jt(t,e){var r,i;return e._isUTC?(r=e.clone(),i=(y(t)||a(t)?+t:+Ft(t))-+r,r._d.setTime(+r._d+i),n.updateOffset(r,!1),r):Ft(t).local()}function Yt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Ut(t,e){var r,i=this._offset||0;return null!=t?("string"==typeof t&&(t=Rt(t)),Math.abs(t)<16&&(t=60*t),!this._isUTC&&e&&(r=Yt(this)),this._offset=t,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==t&&(!e||this._changeInProgress?re(this,Qt(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:Yt(this)}function $t(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function zt(t){return this.utcOffset(0,t)}function qt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Yt(this),"m")),this}function Gt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Rt(this._i)),this}function Wt(t){return t=t?Ft(t).utcOffset():0,(this.utcOffset()-t)%60===0}function Ht(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Vt(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var t={};if(p(t,this),t=Ct(t),t._a){var e=t._isUTC?c(t._a):Ft(t._a);this._isDSTShifted=this.isValid()&&_(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Xt(){return!this._isUTC}function Zt(){return this._isUTC}function Kt(){return this._isUTC&&0===this._offset}function Qt(t,e){var n,r,i,a=t,u=null;return Ot(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(a={},e?a[e]=t:a.milliseconds=t):(u=Dr.exec(t))?(n="-"===u[1]?-1:1,a={y:0,d:v(u[lr])*n,h:v(u[hr])*n,m:v(u[fr])*n,s:v(u[dr])*n,ms:v(u[pr])*n}):(u=Cr.exec(t))?(n="-"===u[1]?-1:1,a={y:Jt(u[2],n),M:Jt(u[3],n),d:Jt(u[4],n),h:Jt(u[5],n),m:Jt(u[6],n),s:Jt(u[7],n),w:Jt(u[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(i=ee(Ft(a.from),Ft(a.to)),a={},a.ms=i.milliseconds,a.M=i.months),r=new Nt(a),Ot(t)&&o(t,"_locale")&&(r._locale=t._locale),r}function Jt(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function te(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function ee(t,e){var n;return e=jt(e,t),t.isBefore(e)?n=te(t,e):(n=te(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n}function ne(t,e){return function(n,r){var i,a;return null===r||isNaN(+r)||(rt(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),a=n,n=r,r=a),n="string"==typeof n?+n:n,i=Qt(n,r),re(this,i,t),this}}function re(t,e,r,i){var a=e._milliseconds,u=e._days,o=e._months;i=null==i?!0:i,a&&t._d.setTime(+t._d+a*r),u&&B(t,"Date",F(t,"Date")+u*r),o&&K(t,F(t,"Month")+o*r),i&&n.updateOffset(t,u||o)}function ie(t,e){var n=t||Ft(),r=jt(n,this).startOf("day"),i=this.diff(r,"days",!0),a=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse";return this.format(e&&e[a]||this.localeData().calendar(a,this,Ft(n)))}function ae(){return new g(this)}function ue(t,e){var n;return e=C("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=y(t)?t:Ft(t),+this>+t):(n=y(t)?+t:+Ft(t),n<+this.clone().startOf(e))}function oe(t,e){var n;return e=C("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=y(t)?t:Ft(t),+t>+this):(n=y(t)?+t:+Ft(t),+this.clone().endOf(e)e-a?(n=t.clone().add(i-1,"months"),r=(e-a)/(a-n)):(n=t.clone().add(i+1,"months"),r=(e-a)/(n-a)),-(i+r)}function fe(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function de(){var t=this.clone().utc();return 0e;e++)if(this._weekdaysParse[e]||(n=Ft([2e3,1]).day(e),r="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[e]=new RegExp(r.replace(".",""),"i")),this._weekdaysParse[e].test(t))return e}function ze(t){var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Re(t,this.localeData()),this.add(t-e,"d")):e}function qe(t){var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Ge(t){return null==t?this.day()||7:this.day(this.day()%7?t:t-7)}function We(t,e){N(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function He(t,e){return e._meridiemParse}function Ve(t){return"p"===(t+"").toLowerCase().charAt(0)}function Xe(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function Ze(t,e){e[pr]=v(1e3*("0."+t))}function Ke(){return this._isUTC?"UTC":""}function Qe(){return this._isUTC?"Coordinated Universal Time":""}function Je(t){return Ft(1e3*t)}function tn(){return Ft.apply(null,arguments).parseZone()}function en(t,e,n){var r=this._calendar[t];return"function"==typeof r?r.call(e,n):r}function nn(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function rn(){return this._invalidDate}function an(t){return this._ordinal.replace("%d",t)}function un(t){return t}function on(t,e,n,r){var i=this._relativeTime[n];return"function"==typeof i?i(t,e,n,r):i.replace(/%d/i,t)}function sn(t,e){var n=this._relativeTime[t>0?"future":"past"];return"function"==typeof n?n(e):n.replace(/%s/i,e)}function cn(t){var e,n;for(n in t)e=t[n],"function"==typeof e?this[n]=e:this["_"+n]=e;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function ln(t,e,n,r){var i=M(),a=c().set(r,e);return i[n](a,t)}function hn(t,e,n,r,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return ln(t,e,n,i);var a,u=[];for(a=0;r>a;a++)u[a]=ln(t,a,n,i);return u}function fn(t,e){return hn(t,e,"months",12,"month")}function dn(t,e){return hn(t,e,"monthsShort",12,"month")}function pn(t,e){return hn(t,e,"weekdays",7,"day")}function gn(t,e){return hn(t,e,"weekdaysShort",7,"day")}function yn(t,e){return hn(t,e,"weekdaysMin",7,"day")}function mn(){var t=this._data;return this._milliseconds=Kr(this._milliseconds),this._days=Kr(this._days),this._months=Kr(this._months),t.milliseconds=Kr(t.milliseconds),t.seconds=Kr(t.seconds),t.minutes=Kr(t.minutes),t.hours=Kr(t.hours),t.months=Kr(t.months),t.years=Kr(t.years),this}function vn(t,e,n,r){var i=Qt(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function _n(t,e){return vn(this,t,e,1)}function bn(t,e){return vn(this,t,e,-1)}function xn(t){return 0>t?Math.floor(t):Math.ceil(t)}function wn(){var t,e,n,r,i,a=this._milliseconds,u=this._days,o=this._months,s=this._data;return a>=0&&u>=0&&o>=0||0>=a&&0>=u&&0>=o||(a+=864e5*xn(kn(o)+u),u=0,o=0),s.milliseconds=a%1e3,t=m(a/1e3),s.seconds=t%60,e=m(t/60),s.minutes=e%60,n=m(e/60),s.hours=n%24,u+=m(n/24),i=m(An(u)),o+=i,u-=xn(kn(i)),r=m(o/12),o%=12,s.days=u,s.months=o,s.years=r,this}function An(t){return 4800*t/146097}function kn(t){return 146097*t/4800}function En(t){var e,n,r=this._milliseconds;if(t=C(t),"month"===t||"year"===t)return e=this._days+r/864e5,n=this._months+An(e),"month"===t?n:n/12;switch(e=this._days+Math.round(kn(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}}function Mn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*v(this._months/12)}function Dn(t){return function(){return this.as(t)}}function Cn(t){return t=C(t),this[t+"s"]()}function Sn(t){return function(){return this._data[t]}}function Tn(){return m(this.days()/7)}function Fn(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function Bn(t,e,n){var r=Qt(t).abs(),i=di(r.as("s")),a=di(r.as("m")),u=di(r.as("h")),o=di(r.as("d")),s=di(r.as("M")),c=di(r.as("y")),l=i0,l[4]=n,Fn.apply(null,l)}function Ln(t,e){return void 0===pi[t]?!1:void 0===e?pi[t]:(pi[t]=e,!0)}function In(t){var e=this.localeData(),n=Bn(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function Nn(){var t,e,n,r=gi(this._milliseconds)/1e3,i=gi(this._days),a=gi(this._months);t=m(r/60),e=m(t/60),r%=60,t%=60,n=m(a/12),a%=12;var u=n,o=a,s=i,c=e,l=t,h=r,f=this.asSeconds();return f?(0>f?"-":"")+"P"+(u?u+"Y":"")+(o?o+"M":"")+(s?s+"D":"")+(c||l||h?"T":"")+(c?c+"H":"")+(l?l+"M":"")+(h?h+"S":""):"P0D"}var On,Pn,Rn=n.momentProperties=[],jn=!1,Yn={},Un={},$n=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,zn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,qn={},Gn={},Wn=/\d/,Hn=/\d\d/,Vn=/\d{3}/,Xn=/\d{4}/,Zn=/[+-]?\d{6}/,Kn=/\d\d?/,Qn=/\d{1,3}/,Jn=/\d{1,4}/,tr=/[+-]?\d{1,6}/,er=/\d+/,nr=/[+-]?\d+/,rr=/Z|[+-]\d\d:?\d\d/gi,ir=/[+-]?\d+(\.\d{1,3})?/,ar=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,ur={},or={},sr=0,cr=1,lr=2,hr=3,fr=4,dr=5,pr=6;N("M",["MM",2],"Mo",function(){return this.month()+1}),N("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),N("MMMM",0,0,function(t){return this.localeData().months(this,t)}),D("month","M"),U("M",Kn),U("MM",Kn,Hn),U("MMM",ar),U("MMMM",ar),q(["M","MM"],function(t,e){e[cr]=v(t)-1}),q(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);null!=i?e[cr]=i:h(n).invalidMonth=t});var gr="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),yr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),mr={};n.suppressDeprecationWarnings=!1;var vr=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_r=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],br=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],xr=/^\/?Date\((\-?\d+)/i;n.createFromInputFallback=nt("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),N(0,["YY",2],0,function(){return this.year()%100}),N(0,["YYYY",4],0,"year"),N(0,["YYYYY",5],0,"year"),N(0,["YYYYYY",6,!0],0,"year"),D("year","y"),U("Y",nr),U("YY",Kn,Hn),U("YYYY",Jn,Xn),U("YYYYY",tr,Zn),U("YYYYYY",tr,Zn),q(["YYYYY","YYYYYY"],sr),q("YYYY",function(t,e){e[sr]=2===t.length?n.parseTwoDigitYear(t):v(t)}),q("YY",function(t,e){e[sr]=n.parseTwoDigitYear(t)}),n.parseTwoDigitYear=function(t){return v(t)+(v(t)>68?1900:2e3)};var wr=T("FullYear",!1);N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),D("week","w"),D("isoWeek","W"),U("w",Kn),U("ww",Kn,Hn),U("W",Kn),U("WW",Kn,Hn),G(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=v(t)});var Ar={dow:0,doy:6};N("DDD",["DDDD",3],"DDDo","dayOfYear"),D("dayOfYear","DDD"),U("DDD",Qn),U("DDDD",Vn),q(["DDD","DDDD"],function(t,e,n){n._dayOfYear=v(t)}),n.ISO_8601=function(){};var kr=nt("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Ft.apply(null,arguments);return this>t?this:t}),Er=nt("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Ft.apply(null,arguments);return t>this?this:t});Pt("Z",":"),Pt("ZZ",""),U("Z",rr),U("ZZ",rr),q(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Rt(t)});var Mr=/([\+\-]|\d\d)/gi;n.updateOffset=function(){};var Dr=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Cr=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Qt.fn=Nt.prototype;var Sr=ne(1,"add"),Tr=ne(-1,"subtract");n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Fr=nt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});N(0,["gg",2],0,function(){return this.weekYear()%100}),N(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Fe("gggg","weekYear"),Fe("ggggg","weekYear"),Fe("GGGG","isoWeekYear"),Fe("GGGGG","isoWeekYear"),D("weekYear","gg"),D("isoWeekYear","GG"),U("G",nr),U("g",nr),U("GG",Kn,Hn),U("gg",Kn,Hn),U("GGGG",Jn,Xn),U("gggg",Jn,Xn),U("GGGGG",tr,Zn),U("ggggg",tr,Zn),G(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=v(t)}),G(["gg","GG"],function(t,e,r,i){e[i]=n.parseTwoDigitYear(t)}),N("Q",0,0,"quarter"),D("quarter","Q"),U("Q",Wn),q("Q",function(t,e){e[cr]=3*(v(t)-1)}),N("D",["DD",2],"Do","date"),D("date","D"),U("D",Kn),U("DD",Kn,Hn),U("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),q(["D","DD"],lr),q("Do",function(t,e){e[lr]=v(t.match(Kn)[0],10)});var Br=T("Date",!0);N("d",0,"do","day"),N("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),N("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),N("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),D("day","d"),D("weekday","e"),D("isoWeekday","E"),U("d",Kn),U("e",Kn),U("E",Kn),U("dd",ar),U("ddd",ar),U("dddd",ar),G(["dd","ddd","dddd"],function(t,e,n){var r=n._locale.weekdaysParse(t);null!=r?e.d=r:h(n).invalidWeekday=t}),G(["d","e","E"],function(t,e,n,r){e[r]=v(t)});var Lr="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ir="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Nr="Su_Mo_Tu_We_Th_Fr_Sa".split("_");N("H",["HH",2],0,"hour"),N("h",["hh",2],0,function(){return this.hours()%12||12}),We("a",!0),We("A",!1),D("hour","h"),U("a",He),U("A",He),U("H",Kn),U("h",Kn),U("HH",Kn,Hn),U("hh",Kn,Hn),q(["H","HH"],hr),q(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),q(["h","hh"],function(t,e,n){e[hr]=v(t),h(n).bigHour=!0});var Or=/[ap]\.?m?\.?/i,Pr=T("Hours",!0);N("m",["mm",2],0,"minute"),D("minute","m"),U("m",Kn),U("mm",Kn,Hn),q(["m","mm"],fr);var Rr=T("Minutes",!1);N("s",["ss",2],0,"second"),D("second","s"),U("s",Kn),U("ss",Kn,Hn),q(["s","ss"],dr);var jr=T("Seconds",!1);N("S",0,0,function(){return~~(this.millisecond()/100)}),N(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,function(){return 10*this.millisecond()}),N(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),N(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),N(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),N(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),N(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),D("millisecond","ms"),U("S",Qn,Wn),U("SS",Qn,Hn),U("SSS",Qn,Vn);var Yr;for(Yr="SSSS";Yr.length<=9;Yr+="S")U(Yr,er);for(Yr="S";Yr.length<=9;Yr+="S")q(Yr,Ze);var Ur=T("Milliseconds",!1);N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");var $r=g.prototype;$r.add=Sr,$r.calendar=ie,$r.clone=ae,$r.diff=le,$r.endOf=we,$r.format=pe,$r.from=ge,$r.fromNow=ye,$r.to=me,$r.toNow=ve,$r.get=L,$r.invalidAt=Te,$r.isAfter=ue,$r.isBefore=oe,$r.isBetween=se,$r.isSame=ce,$r.isValid=Ce,$r.lang=Fr,$r.locale=_e,$r.localeData=be,$r.max=Er,$r.min=kr,$r.parsingFlags=Se,$r.set=L,$r.startOf=xe,$r.subtract=Tr,$r.toArray=Me,$r.toObject=De,$r.toDate=Ee,$r.toISOString=de,$r.toJSON=de,$r.toString=fe,$r.unix=ke,$r.valueOf=Ae,$r.year=wr,$r.isLeapYear=lt,$r.weekYear=Le,$r.isoWeekYear=Ie,$r.quarter=$r.quarters=Pe,$r.month=Q,$r.daysInMonth=J,$r.week=$r.weeks=gt,$r.isoWeek=$r.isoWeeks=yt,$r.weeksInYear=Oe,$r.isoWeeksInYear=Ne,$r.date=Br,$r.day=$r.days=ze,$r.weekday=qe,$r.isoWeekday=Ge,$r.dayOfYear=vt,$r.hour=$r.hours=Pr,$r.minute=$r.minutes=Rr,$r.second=$r.seconds=jr,$r.millisecond=$r.milliseconds=Ur,$r.utcOffset=Ut,$r.utc=zt,$r.local=qt,$r.parseZone=Gt,$r.hasAlignedHourOffset=Wt,$r.isDST=Ht,$r.isDSTShifted=Vt,$r.isLocal=Xt,$r.isUtcOffset=Zt,$r.isUtc=Kt,$r.isUTC=Kt,$r.zoneAbbr=Ke,$r.zoneName=Qe,$r.dates=nt("dates accessor is deprecated. Use date instead.",Br),$r.months=nt("months accessor is deprecated. Use month instead",Q),$r.years=nt("years accessor is deprecated. Use year instead",wr),$r.zone=nt("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",$t);var zr=$r,qr={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Gr={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Wr="Invalid date",Hr="%d",Vr=/\d{1,2}/,Xr={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Zr=b.prototype;Zr._calendar=qr,Zr.calendar=en,Zr._longDateFormat=Gr,Zr.longDateFormat=nn,Zr._invalidDate=Wr,Zr.invalidDate=rn,Zr._ordinal=Hr,Zr.ordinal=an,Zr._ordinalParse=Vr,Zr.preparse=un,Zr.postformat=un,Zr._relativeTime=Xr,Zr.relativeTime=on,Zr.pastFuture=sn,Zr.set=cn,Zr.months=V,Zr._months=gr,Zr.monthsShort=X,Zr._monthsShort=yr,Zr.monthsParse=Z,Zr.week=ft,Zr._week=Ar,Zr.firstDayOfYear=pt,Zr.firstDayOfWeek=dt,Zr.weekdays=je,Zr._weekdays=Lr,Zr.weekdaysMin=Ue,Zr._weekdaysMin=Nr,Zr.weekdaysShort=Ye,Zr._weekdaysShort=Ir,Zr.weekdaysParse=$e,Zr.isPM=Ve,Zr._meridiemParse=Or,Zr.meridiem=Xe,k("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===v(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),n.lang=nt("moment.lang is deprecated. Use moment.locale instead.",k),n.langData=nt("moment.langData is deprecated. Use moment.localeData instead.",M);var Kr=Math.abs,Qr=Dn("ms"),Jr=Dn("s"),ti=Dn("m"),ei=Dn("h"),ni=Dn("d"),ri=Dn("w"),ii=Dn("M"),ai=Dn("y"),ui=Sn("milliseconds"),oi=Sn("seconds"),si=Sn("minutes"),ci=Sn("hours"),li=Sn("days"),hi=Sn("months"),fi=Sn("years"),di=Math.round,pi={s:45,m:45,h:22,d:26,M:11},gi=Math.abs,yi=Nt.prototype;yi.abs=mn,yi.add=_n,yi.subtract=bn,yi.as=En,yi.asMilliseconds=Qr,yi.asSeconds=Jr,yi.asMinutes=ti,yi.asHours=ei,yi.asDays=ni,yi.asWeeks=ri,yi.asMonths=ii,yi.asYears=ai,yi.valueOf=Mn,yi._bubble=wn,yi.get=Cn,yi.milliseconds=ui,yi.seconds=oi,yi.minutes=si,yi.hours=ci,yi.days=li,yi.weeks=Tn,yi.months=hi,yi.years=fi,yi.humanize=In,yi.toISOString=Nn,yi.toString=Nn,yi.toJSON=Nn,yi.locale=_e,yi.localeData=be,yi.toIsoString=nt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Nn),yi.lang=Fr,N("X",0,0,"unix"),N("x",0,0,"valueOf"),U("x",nr),U("X",ir),q("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),q("x",function(t,e,n){n._d=new Date(v(t))}),n.version="2.10.6",r(Ft),n.fn=zr,n.min=Lt,n.max=It,n.utc=c,n.unix=Je,n.months=fn,n.isDate=a,n.locale=k,n.invalid=d,n.duration=Qt,n.isMoment=y,n.weekdays=pn,n.parseZone=tn,n.localeData=M,n.isDuration=Ot,n.monthsShort=dn,n.weekdaysMin=yn,n.defineLocale=E,n.weekdaysShort=gn,n.normalizeUnits=C,n.relativeTimeThreshold=Ln;var mi=n;return mi})},{}],106:[function(t,e){e.exports={name:"mermaid",version:"0.5.8",description:"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams and gantt charts.",main:"src/mermaid.js",keywords:["diagram","markdown","flowchart","sequence diagram","gantt"],bin:{mermaid:"./bin/mermaid.js"},scripts:{live:"live-server ./test/examples",lint:"node node_modules/eslint/bin/eslint.js src",jison:"gulp jison_legacy",karma:"node node_modules/karma/bin/karma start karma.conf.js --single-run",watch:"source ./scripts/watch.sh",doc:"rm -r build;rm -r dist/www;gulp vartree;cp dist/www/all.html ../mermaid-pages/index.html;cp dist/mermaid.js ../mermaid-pages/javascripts/lib;cp dist/mermaid.forest.css ../mermaid-pages/stylesheets",tape:"node node_modules/tape/bin/tape test/cli_test-*.js",jasmine:"npm run jison &&node node_modules/jasmine-es6/bin/jasmine.js",pretest:"npm run jison",test:"npm run dist && npm run karma && npm run tape","dist-slim-mermaid":"node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.slim.js -x d3 && cat dist/mermaid.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.slim.min.js","dist-slim-mermaidAPI":"node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.slim.js -x d3 && cat dist/mermaidAPI.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.slim.min.js","dist-mermaid":"node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.js && cat dist/mermaid.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.min.js","dist-mermaidAPI":"node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.js && cat dist/mermaidAPI.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.min.js",dist:"npm run dist-slim-mermaid && npm run dist-slim-mermaidAPI && npm run dist-mermaid && npm run dist-mermaidAPI"},repository:{type:"git",url:"https://github.com/knsv/mermaid"},author:"Knut Sveidqvist",license:"MIT",dependencies:{chalk:"^0.5.1",d3:"3.5.6",dagre:"^0.7.4","dagre-d3":"0.4.10",he:"^0.5.0",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.9.0",semver:"^4.1.1",which:"^1.0.8"},devDependencies:{async:"^0.9.0","babel-eslint":"^4.1.3",babelify:"^6.4.0",browserify:"~6.2.0",clone:"^0.2.0","codeclimate-test-reporter":"0.0.4",dateformat:"^1.0.11",dox:"^0.8.0",eslint:"^1.6.0","eslint-watch":"^2.1.2","event-stream":"^3.2.0",foundation:"^4.2.1-1","front-matter":"^0.2.0",gulp:"~3.9.0","gulp-bower":"0.0.10","gulp-browserify":"^0.5.0","gulp-bump":"^0.1.11","gulp-concat":"~2.4.1","gulp-data":"^1.1.1","gulp-dox":"^0.1.6","gulp-ext-replace":"^0.2.0","gulp-filelog":"^0.4.1","gulp-front-matter":"^1.2.3","gulp-hogan":"^1.1.0","gulp-if":"^1.2.5","gulp-insert":"^0.4.0","gulp-istanbul":"^0.4.0","gulp-jasmine":"~2.1.0","gulp-jasmine-browser":"^0.2.3","gulp-jison":"~1.2.0","gulp-jshint":"^1.9.0","gulp-less":"^3.0.1","gulp-livereload":"^3.8.0","gulp-marked":"^1.0.0","gulp-mdvars":"^2.0.0","gulp-qunit":"~1.2.1","gulp-rename":"~1.2.0","gulp-shell":"^0.2.10","gulp-tag-version":"^1.2.1","gulp-uglify":"~1.0.1","gulp-util":"^3.0.7","gulp-vartree":"^2.0.1","hogan.js":"^3.0.2",jasmine:"2.3.2","jasmine-es6":"0.0.18",jison:"zaach/jison",jsdom:"^7.0.2","jshint-stylish":"^2.0.1",karma:"^0.13.15","karma-babel-preprocessor":"^6.0.1","karma-browserify":"^4.4.0","karma-jasmine":"^0.3.6","karma-phantomjs-launcher":"^0.2.1","live-server":"^0.9.0","map-stream":"0.0.6",marked:"^0.3.2","mock-browser":"^0.91.34",path:"^0.4.9",phantomjs:"^1.9.18",proxyquire:"^1.7.3","proxyquire-universal":"^1.0.8",proxyquireify:"^3.0.0","require-dir":"^0.3.0",rewire:"^2.1.3",rimraf:"^2.2.8",tape:"^3.0.3",testdom:"^2.0.0",uglifyjs:"^2.4.10","vinyl-source-stream":"^1.1.0",watchify:"^3.6.1"}}},{}],107:[function(t,e){"use strict";var n;if(t)try{n=t("d3")}catch(r){}n||(n=window.d3),e.exports=n,function(){var t=!1;if(t="tspans",n.selection.prototype.textwrap)return!1;if("undefined"==typeof t)var t=!1;n.selection.prototype.textwrap=n.selection.enter.prototype.textwrap=function(e,r){var i,r=parseInt(r)||0,a=this,u=function(t){var e=t[0][0],r=e.tagName.toString();if("rect"!==r)return!1;var i={};return i.x=n.select(e).attr("x")||0,i.y=n.select(e).attr("y")||0,i.width=n.select(e).attr("width")||0,i.height=n.select(e).attr("height")||0,i.attr=t.attr,i},o=function(t){if(t.attr||(t.attr=function(t){return this[t]?this[t]:void 0}),"object"==typeof t&&"undefined"!=typeof t.x&&"undefined"!=typeof t.y&&"undefined"!=typeof t.width&&"undefined"!=typeof t.height)return t;if("function"==typeof Array.isArray&&Array.isArray(t)||"[object Array]"===Object.prototype.toString.call(t)){var e=u(t);return e}return!1},s=function(t,e){var n=t;return 0!==e&&(n.x=parseInt(n.x)+e,n.y=parseInt(n.y)+e,n.width-=2*e,n.height-=2*e),n},c=o(e);if(r&&(c=s(c,r)),0!=a.length&&n&&e&&c){e=c;var l,h=function(t){var r=n.select(t[0].parentNode),a=r.select("text"),u=a.style("line-height"),o=a.text();a.remove();var s=r.append("foreignObject");s.attr("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility").attr("x",e.x).attr("y",e.y).attr("width",e.width).attr("height",e.height);var c=s.append("xhtml:div").attr("class","wrapped");c.style("height",e.height).style("width",e.width).html(o),u&&c.style("line-height",u),i=r.select("foreignObject")},f=function(t){var a,u=t[0],o=u.parentNode,s=n.select(u),c=u.getBBox().height,l=u.getBBox().width,h=c,f=s.style("line-height");if(a=f&&parseInt(f)?parseInt(f.replace("px","")):h,l>e.width){var d=s.text();if(s.text(""),d){var p,g;if(-1!==d.indexOf(" ")){var p=" ";g=d.split(" ")}else{p="";var y=d.length,m=Math.ceil(l/e.width),v=Math.floor(y/m);v*m>=y||m++;for(var _,b,g=[],x=0;m>x;x++)b=x*v,_=d.substr(b,v),g.push(_)}for(var w=[],A=0,k={},x=0;xe.width&&D&&""!==D&&(A+=C,k={string:D,width:C,offset:A},w.push(k),s.text(""),s.text(M),x==g.length-1&&(E=M,s.text(E),S=u.getComputedTextLength())),x==g.length-1){s.text("");var T=E;T&&""!==T&&(S-A>0&&(S-=A),k={string:T,width:S,offset:A},w.push(k))}}var F;s.text("");for(var x=0;x0){w[x-1]}x*a0?a:void 0}),F.attr("x",function(){var t=e.x;return r&&(t+=r),t}))}}}s.attr("y",function(){var t=e.y;return a&&(t+=a),r&&(t+=r),t}),s.attr("x",function(){var t=e.x;return r&&(t+=r),t}),i=n.select(o).selectAll("text")};t&&("foreignobjects"==t?l=h:"tspans"==t&&(l=f)),t||(l="undefined"!=typeof SVGForeignObjectElement?h:f);for(var d=0;d "+t.w+": "+JSON.stringify(u.edge(t))),p(i,u.edge(t),u.edge(t).relation)}),i.attr("height","100%"),i.attr("width","100%")}},{"../../d3":107,"../../logger":126,"./classDb":108,"./parser/classDiagram":110,dagre:54}],110:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,11],r=[1,12],i=[1,13],a=[1,15],u=[1,16],o=[1,17],s=[6,8],c=[1,26],l=[1,27],h=[1,28],f=[1,29],d=[1,30],p=[1,31],g=[6,8,13,17,23,26,27,28,29,30,31],y=[6,8,13,17,23,26,27,28,29,30,31,45,46,47],m=[23,45,46,47],v=[23,30,31,45,46,47],_=[23,26,27,28,29,45,46,47],b=[6,8,13],x=[1,46],w={trace:function(){},yy:{},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},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"},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]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 5:this.$=a[u-1]+a[u];break;case 6:this.$=a[u];break;case 7:r.addRelation(a[u]);break;case 8:a[u-1].title=r.cleanupLabel(a[u]),r.addRelation(a[u-1]);break;case 12:r.addMembers(a[u-3],a[u-1]);break;case 13:this.$=[a[u]];break;case 14:a[u].push(a[u-1]),this.$=a[u];break;case 15:break;case 16:r.addMembers(a[u-1],r.cleanupLabel(a[u]));break;case 17:console.warn("Member",a[u]);break;case 18:break;case 19:this.$={id1:a[u-2],id2:a[u],relation:a[u-1],relationTitle1:"none",relationTitle2:"none"};break;case 20:this.$={id1:a[u-3],id2:a[u],relation:a[u-1],relationTitle1:a[u-2],relationTitle2:"none"};break;case 21:this.$={id1:a[u-3],id2:a[u],relation:a[u-2],relationTitle1:"none",relationTitle2:a[u-1]};break;case 22:this.$={id1:a[u-4],id2:a[u],relation:a[u-2],relationTitle1:a[u-3],relationTitle2:a[u-1]};break;case 23:this.$={type1:a[u-2],type2:a[u],lineType:a[u-1]};break;case 24:this.$={type1:"none",type2:a[u],lineType:a[u-1]};break;case 25:this.$={type1:a[u-1],type2:"none",lineType:a[u]};break;case 26:this.$={type1:"none",type2:"none",lineType:a[u]};break;case 27:this.$=r.relationType.AGGREGATION;break;case 28:this.$=r.relationType.EXTENSION;break;case 29:this.$=r.relationType.COMPOSITION;break;case 30:this.$=r.relationType.DEPENDENCY;break;case 31:this.$=r.lineType.LINE;break;case 32:this.$=r.lineType.DOTTED_LINE}},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:n,20:r,21:i,45:a,46:u,47:o},{8:[1,18]},{6:[1,19],8:[2,3]},e(s,[2,7],{13:[1,20]}),e(s,[2,9]),e(s,[2,10]),e(s,[2,15],{22:21,24:24,25:25,13:[1,23],23:[1,22],26:c,27:l,28:h,29:f,30:d,31:p}),{10:32,11:14,45:a,46:u,47:o},e(s,[2,17]),e(s,[2,18]),e(g,[2,6],{11:14,10:33,45:a,46:u,47:o}),e(y,[2,46]),e(y,[2,47]),e(y,[2,48]),{1:[2,2]},{7:34,9:6,10:10,11:14,12:7,14:8,15:9,16:n,20:r,21:i,45:a,46:u,47:o},e(s,[2,8]),{10:35,11:14,23:[1,36],45:a,46:u,47:o},{22:37,24:24,25:25,26:c,27:l,28:h,29:f,30:d,31:p},e(s,[2,16]),{25:38,30:d,31:p},e(m,[2,26],{24:39,26:c,27:l,28:h,29:f}),e(v,[2,27]),e(v,[2,28]),e(v,[2,29]),e(v,[2,30]),e(_,[2,31]),e(_,[2,32]),e(s,[2,11],{17:[1,40]}),e(g,[2,5]),{8:[2,4]},e(b,[2,19]),{10:41,11:14,45:a,46:u,47:o},{10:42,11:14,23:[1,43],45:a,46:u,47:o},e(m,[2,25],{24:44,26:c,27:l,28:h,29:f}),e(m,[2,24]),{18:45,20:x},e(b,[2,21]),e(b,[2,20]),{10:47,11:14,45:a,46:u,47:o},e(m,[2,23]),{19:[1,48]},{18:49,19:[2,13],20:x},e(b,[2,22]),e(s,[2,12]),{19:[2,14]}],defaultActions:{2:[2,1],18:[2,2],34:[2,4],49:[2,14]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var y=d.yylloc;i.push(y);var m=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,x,w,A,k,E,M,D=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},C={};;){if(b=n[n.length-1],this.defaultActions[b]?x=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=D()),x=a[b]&&a[b][v]),"undefined"==typeof x||!x.length||!x[0]){var S="";M=[];for(A in a[b])this.terminals_[A]&&A>l&&M.push("'"+this.terminals_[A]+"'");S=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:y,expected:M})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,_?(v=_,_=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,y=d.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[x[1]][1],C.$=r[r.length-k],C._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(C._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(C,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[x[1]][0]),r.push(C.$),i.push(C._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},A=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:break;case 1:return 6;case 2:break;case 3:return 5;case 4:return this.begin("struct"),17;case 5:return this.popState(),19;case 6:break;case 7:return"MEMBER";case 8:return 16;case 9:this.begin("string");break;case 10:this.popState();break;case 11:return"STR";case 12:return 27;case 13:return 27;case 14:return 29;case 15:return 29;case 16:return 28;case 17:return 26;case 18:return 30;case 19:return 31;case 20:return 13;case 21:return 43;case 22:return"DOT";case 23:return"PLUS";case 24:return 40;case 25:return"EQUALS";case 26:return"EQUALS";case 27:return 47;case 28:return"PUNCTUATION";case 29:return 46;case 30:return 45;case 31:return 42;case 32:return 8}},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)/,/^(?:$)/],conditions:{string:{rules:[10,11],inclusive:!1},struct:{rules:[5,6,7],inclusive:!1},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:!0}}};return t}();return w.lexer=A,t.prototype=w,w.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],111:[function(t,e,n){(function(e){"use strict";var r=t("../../logger"),i=new r.Log,a="",u=!1;n.setMessage=function(t){i.debug("Setting message to: "+t),a=t},n.getMessage=function(){return a},n.setInfo=function(t){u=t},n.getInfo=function(){return u},n.parseError=function(t,n){e.mermaidAPI.parseError(t,n)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../logger":126}],112:[function(t,e,n){"use strict";var r=t("./exampleDb"),i=t("./parser/example.js"),a=t("../../d3"),u=t("../../logger"),o=new u.Log;n.draw=function(t,e,n){var u;u=i.parser,u.yy=r,o.debug("Renering example diagram"),u.parse(t);var s=a.select("#"+e),c=s.append("g");c.append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("mermaid "+n),s.attr("height",100),s.attr("width",400)}},{"../../d3":107,"../../logger":126,"./exampleDb":111,"./parser/example.js":113}],113:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[6,9,10,12],r={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,message:11,say:12,TXT:13,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo",12:"say",13:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1],[8,1],[11,2]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 1:return r;case 4:break;case 6:r.setInfo(!0);break;case 7:r.setMessage(a[u]);break;case 8:this.$=a[u-1].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},e(n,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8],11:9,12:[1,10]},{1:[2,1]},e(n,[2,3]),e(n,[2,4]),e(n,[2,5]),e(n,[2,6]),e(n,[2,7]),{13:[1,11]},e(n,[2,8])],defaultActions:{4:[2,1]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var y=d.yylloc;i.push(y);var m=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,x,w,A,k,E,M,D=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},C={};;){if(b=n[n.length-1],this.defaultActions[b]?x=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=D()),x=a[b]&&a[b][v]),"undefined"==typeof x||!x.length||!x[0]){var S="";M=[];for(A in a[b])this.terminals_[A]&&A>l&&M.push("'"+this.terminals_[A]+"'");S=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:y,expected:M})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,_?(v=_,_=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,y=d.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[x[1]][1],C.$=r[r.length-k],C._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(C._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(C,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[x[1]][0]),r.push(C.$),i.push(C._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},i=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 9;case 1:return 10;case 2:return 4;case 3:return 12;case 4:return 13;case 5:return 6;case 6:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:showInfo\b)/i,/^(?:info\b)/i,/^(?:say\b)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return t}();return r.lexer=i,t.prototype=r,r.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],114:[function(t,e){"use strict";var n,r=t("../../logger"),i=new r.Log;if(t)try{n=t("dagre-d3")}catch(a){i.debug("Could not load dagre-d3")}n||(n=window.dagreD3),e.exports=n},{"../../logger":126,"dagre-d3":5}],115:[function(t,e,n){"use strict";var r=t("./graphDb"),i=t("./parser/flow"),a=t("./parser/dot"),u=t("../../d3"),o=t("./dagre-d3"),s=t("../../logger"),c=new s.Log,l={};e.exports.setConf=function(t){var e,n=Object.keys(t);for(e=0;e0&&(u=a.classes.join(" "));var o="";o=r(o,a.styles),i="undefined"==typeof a.text?a.id:a.text;var s="";if(l.htmlLabels)s="html",i=i.replace(/fa:fa[\w\-]+/g,function(t){return''});else{var c=document.createElementNS("http://www.w3.org/2000/svg","text"),h=i.split(/
/),f=0;for(f=0;f/g,"\n");"undefined"==typeof t.style?l.htmlLabels?e.setEdge(t.start,t.end,{labelType:"html",style:a,labelpos:"c",label:''+t.text+"",arrowheadStyle:"fill: #333",arrowhead:n},i):e.setEdge(t.start,t.end,{labelType:"text",style:"stroke: #333; stroke-width: 1.5px;fill:none",labelpos:"c",label:u,arrowheadStyle:"fill: #333",arrowhead:n},i):e.setEdge(t.start,t.end,{labelType:"text",style:a,arrowheadStyle:"fill: #333",label:u,arrowhead:n},i)}})},n.getClasses=function(t,e){var n;r.clear(),n=e?a.parser:i.parser,n.yy=r,n.parse(t);var u=r.getClasses();return"undefined"==typeof u["default"]&&(u["default"]={id:"default"},u["default"].styles=[],u["default"].clusterStyles=["rx:4px","fill: rgb(255, 255, 222)","rx: 4px","stroke: rgb(170, 170, 51)","stroke-width: 1px"],u["default"].nodeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"],u["default"].edgeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"]),u},n.draw=function(t,e,s){c.debug("Drawing flowchart");var h;r.clear(),h=s?a.parser:i.parser,h.yy=r;try{h.parse(t)}catch(f){c.debug("Parsing failed")}var d;d=r.getDirection(),"undefined"==typeof d&&(d="TD");var p,g=new o.graphlib.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:d,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),y=r.getSubGraphs(),m=0;for(m=y.length-1;m>=0;m--)p=y[m],r.addVertex(p.id,p.title,"group",void 0);var v=r.getVertices(),_=r.getEdges();m=0;var b;for(m=y.length-1;m>=0;m--)for(p=y[m],u.selectAll("cluster").append("text"),b=0;b0?t.split(",").forEach(function(t){"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)}):"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)};var setTooltip=function(t,e){"undefined"!=typeof e&&(tooltips[t]=e)},setClickFun=function setClickFun(id,functionName){"undefined"!=typeof functionName&&"undefined"!=typeof vertices[id]&&funs.push(function(element){var elem=d3.select(element).select("#"+id);null!==elem&&elem.on("click",function(){eval(functionName+"('"+id+"')")})})},setLink=function(t,e){"undefined"!=typeof e&&"undefined"!=typeof vertices[t]&&funs.push(function(n){var r=d3.select(n).select("#"+t);null!==r&&r.on("click",function(){window.open(e,"newTab")})})};exports.getTooltip=function(t){return tooltips[t]},exports.setClickEvent=function(t,e,n,r){t.indexOf(",")>0?t.split(",").forEach(function(t){setTooltip(t,r),setClickFun(t,e),setLink(t,n)}):(setTooltip(t,r),setClickFun(t,e),setLink(t,n))},exports.bindFunctions=function(t){funs.forEach(function(e){e(t)})},exports.getDirection=function(){return direction},exports.getVertices=function(){return vertices},exports.getEdges=function(){return edges},exports.getClasses=function(){return classes};var setupToolTips=function(t){var e=d3.select(".mermaidTooltip");null===e[0][0]&&(e=d3.select("body").append("div").attr("class","mermaidTooltip").style("opacity",0));var n=d3.select(t).select("svg"),r=n.selectAll("g.node");r.on("mouseover",function(){var t=d3.select(this),n=t.attr("title");if(null!==n){var r=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.html(t.attr("title")).style("left",r.left+(r.right-r.left)/2+"px").style("top",r.top-14+document.body.scrollTop+"px"),t.classed("hover",!0)}}).on("mouseout",function(){e.transition().duration(500).style("opacity",0);var t=d3.select(this);t.classed("hover",!1)})};funs.push(setupToolTips),exports.clear=function(){vertices={},classes={},edges=[],funs=[],funs.push(setupToolTips),subGraphs=[],subCount=0,tooltips=[]},exports.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},exports.addSubGraph=function(t,e){function n(t){var e={"boolean":{},number:{},string:{}},n=[];return t.filter(function(t){var r=typeof t;return" "===t?!1:r in e?e[r].hasOwnProperty(t)?!1:e[r][t]=!0:n.indexOf(t)>=0?!1:n.push(t)})}var r=[];r=n(r.concat.apply(r,t));var i={id:"subGraph"+subCount,nodes:r,title:e};return subGraphs.push(i),subCount+=1,i.id};var getPosForId=function(t){var e;for(e=0;e2e3)){if(posCrossRef[secCount]=n,subGraphs[n].id===e)return{result:!0,count:0};for(var i=0,a=1;i=0){var o=t(e,u);if(o.result)return{result:!0,count:a+o.count};a+=o.count}i+=1}return{result:!1,count:a}}};exports.getDepthFirstPos=function(t){return posCrossRef[t]},exports.indexNodes=function(){secCount=-1,subGraphs.length>0&&indexNodes("none",subGraphs.length-1,0)},exports.getSubGraphs=function(){return subGraphs},exports.parseError=function(t,e){global.mermaidAPI.parseError(t,e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../d3":107,"../../logger":126}],117:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,5],r=[1,6],i=[1,12],a=[1,13],u=[1,14],o=[1,15],s=[1,16],c=[1,17],l=[1,18],h=[1,19],f=[1,20],d=[1,21],p=[1,22],g=[8,16,17,18,19,20,21,22,23,24,25,26],y=[1,37],m=[1,33],v=[1,34],_=[1,35],b=[1,36],x=[8,10,16,17,18,19,20,21,22,23,24,25,26,28,32,37,39,40,45,57,58],w=[10,28],A=[10,28,37,57,58],k=[2,49],E=[1,45],M=[1,48],D=[1,49],C=[1,52],S=[2,65],T=[1,65],F=[1,66],B=[1,67],L=[1,68],I=[1,69],N=[1,70],O=[1,71],P=[1,72],R=[1,73],j=[8,16,17,18,19,20,21,22,23,24,25,26,47],Y=[10,28,37],U={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graph:4,EOF:5,graphStatement:6,idStatement:7,"{":8,stmt_list:9,"}":10,strict:11,GRAPH:12,DIGRAPH:13,textNoTags:14,textNoTagsToken:15,ALPHA:16,NUM:17,COLON:18,PLUS:19,EQUALS:20,MULT:21,DOT:22,BRKT:23,SPACE:24,MINUS:25,keywords:26,stmt:27,";":28,node_stmt:29,edge_stmt:30,attr_stmt:31,"=":32,subgraph:33,attr_list:34,NODE:35,EDGE:36,"[":37,a_list:38,"]":39,",":40,edgeRHS:41,node_id:42,edgeop:43,port:44,":":45,compass_pt:46,SUBGRAPH:47,n:48,ne:49,e:50,se:51,s:52,sw:53,w:54,nw:55,c:56,ARROW_POINT:57,ARROW_OPEN:58,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"{",10:"}",11:"strict",12:"GRAPH",13:"DIGRAPH",16:"ALPHA",17:"NUM",18:"COLON",19:"PLUS",20:"EQUALS",21:"MULT",22:"DOT",23:"BRKT",24:"SPACE",25:"MINUS",26:"keywords",28:";",32:"=",35:"NODE",36:"EDGE",37:"[",39:"]",40:",",45:":",47:"SUBGRAPH",48:"n",49:"ne",50:"e",51:"se",52:"s",53:"sw",54:"w",55:"nw",56:"c",57:"ARROW_POINT",58:"ARROW_OPEN"},productions_:[0,[3,2],[4,5],[4,6],[4,4],[6,1],[6,1],[7,1],[14,1],[14,2],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[9,1],[9,3],[27,1],[27,1],[27,1],[27,3],[27,1],[31,2],[31,2],[31,2],[34,4],[34,3],[34,3],[34,2],[38,5],[38,5],[38,3],[30,3],[30,3],[30,2],[30,2],[41,3],[41,3],[41,2],[41,2],[29,2],[29,1],[42,2],[42,1],[44,4],[44,2],[44,2],[33,5],[33,4],[33,3],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,0],[43,1],[43,1]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 1:this.$=a[u-1];break;case 2:this.$=a[u-4];break;case 3:this.$=a[u-5];break;case 4:this.$=a[u-3];break;case 8:case 10:case 11:this.$=a[u];break;case 9:this.$=a[u-1]+""+a[u];break;case 12:case 13:case 14:case 15:case 16:case 18:case 19:case 20:this.$=a[u];break;case 17:this.$="
";break;case 39:this.$="oy";break;case 40:r.addLink(a[u-1],a[u].id,a[u].op),this.$="oy";break;case 42:r.addLink(a[u-1],a[u].id,a[u].op),this.$={op:a[u-2],id:a[u-1]};break;case 44:this.$={op:a[u-1],id:a[u]};break;case 48:r.addVertex(a[u-1]),this.$=a[u-1];break;case 49:r.addVertex(a[u]),this.$=a[u];break;case 66:this.$="arrow";break;case 67:this.$="arrow_open"}},table:[{3:1,4:2,6:3,11:[1,4],12:n,13:r},{1:[3]},{5:[1,7]},{7:8,8:[1,9],14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},{6:23,12:n,13:r},e(g,[2,5]),e(g,[2,6]),{1:[2,1]},{8:[1,24]},{7:30,8:y,9:25,12:m,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},e([8,10,28,32,37,39,40,45,57,58],[2,7],{15:38,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p}),e(x,[2,8]),e(x,[2,10]),e(x,[2,11]),e(x,[2,12]),e(x,[2,13]),e(x,[2,14]),e(x,[2,15]),e(x,[2,16]),e(x,[2,17]),e(x,[2,18]),e(x,[2,19]),e(x,[2,20]),{7:39,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},{7:30,8:y,9:40,12:m,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{10:[1,41]},{10:[2,21],28:[1,42]},e(w,[2,23]),e(w,[2,24]),e(w,[2,25]),e(A,k,{44:44,32:[1,43],45:E}),e(w,[2,27],{41:46,43:47,57:M,58:D}),e(w,[2,47],{43:47,34:50,41:51,37:C,57:M,58:D}),{34:53,37:C},{34:54,37:C},{34:55,37:C},{7:56,8:[1,57],14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},{7:30,8:y,9:58,12:m,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},e(x,[2,9]),{8:[1,59]},{10:[1,60]},{5:[2,4]},{7:30,8:y,9:61,12:m,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{7:62,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},e(A,[2,48]),e(A,S,{14:10,15:11,7:63,46:64,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,48:T,49:F,50:B,51:L,52:I,53:N,54:O,55:P,56:R}),e(w,[2,41],{34:74,37:C}),{7:77,8:y,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,33:76,42:75,47:b},e(j,[2,66]),e(j,[2,67]),e(w,[2,46]),e(w,[2,40],{34:78,37:C}),{7:81,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,38:79,39:[1,80]},e(w,[2,28]),e(w,[2,29]),e(w,[2,30]),{8:[1,82]},{7:30,8:y,9:83,12:m,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{10:[1,84]},{7:30,8:y,9:85,12:m,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{5:[2,2]},{10:[2,22]},e(w,[2,26]),e(A,[2,51],{45:[1,86]}),e(A,[2,52]),e(A,[2,56]),e(A,[2,57]),e(A,[2,58]),e(A,[2,59]),e(A,[2,60]),e(A,[2,61]),e(A,[2,62]),e(A,[2,63]),e(A,[2,64]),e(w,[2,38]),e(Y,[2,44],{43:47,41:87,57:M,58:D}),e(Y,[2,45],{43:47,41:88,57:M,58:D}),e(A,k,{44:44,45:E}),e(w,[2,39]),{39:[1,89]},e(w,[2,34],{34:90,37:C}),{32:[1,91]},{7:30,8:y,9:92,12:m,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{10:[1,93]},e(A,[2,55]),{10:[1,94]},e(A,S,{46:95,48:T,49:F,50:B,51:L,52:I,53:N,54:O,55:P,56:R}),e(Y,[2,42]),e(Y,[2,43]),e(w,[2,33],{34:96,37:C}),e(w,[2,32]),{7:97,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},{10:[1,98]},e(A,[2,54]),{5:[2,3]},e(A,[2,50]),e(w,[2,31]),{28:[1,99],39:[2,37],40:[1,100]},e(A,[2,53]),{7:81,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,38:101},{7:81,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,38:102},{39:[2,35]},{39:[2,36]}],defaultActions:{7:[2,1],41:[2,4],60:[2,2],61:[2,22],94:[2,3],101:[2,35],102:[2,36]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var y=d.yylloc;i.push(y);var m=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,x,w,A,k,E,M,D=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},C={};;){if(b=n[n.length-1],this.defaultActions[b]?x=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=D()),x=a[b]&&a[b][v]),"undefined"==typeof x||!x.length||!x[0]){var S="";M=[];for(A in a[b])this.terminals_[A]&&A>l&&M.push("'"+this.terminals_[A]+"'");S=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:y,expected:M})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,_?(v=_,_=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,y=d.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[x[1]][1],C.$=r[r.length-k],C._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(C._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(C,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[x[1]][0]),r.push(C.$),i.push(C._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},$=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:return"STYLE";case 1:return"LINKSTYLE";case 2:return"CLASSDEF";case 3:return"CLASS";case 4:return"CLICK";case 5:return 12;case 6:return 13;case 7:return 47;case 8:return 35;case 9:return 36;case 10:return"DIR";case 11:return"DIR";case 12:return"DIR";case 13:return"DIR";case 14:return"DIR";case 15:return"DIR";case 16:return 17;case 17:return 23;case 18:return 18;case 19:return 28;case 20:return 40;case 21:return 32;case 22:return 21;case 23:return 22;case 24:return"ARROW_CROSS";case 25:return 57;case 26:return"ARROW_CIRCLE";case 27:return 58;case 28:return 25;case 29:return 19;case 30:return 20;case 31:return 16;case 32:return"PIPE";case 33:return"PS";case 34:return"PE";case 35:return 37;case 36:return 39;case 37:return 8;case 38:return 10;case 39:return"QUOTE";case 40:return 24;case 41:return"NEWLINE";case 42:return 5}},rules:[/^(?:style\b)/,/^(?:linkStyle\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:digraph\b)/,/^(?:subgraph\b)/,/^(?:node\b)/,/^(?:edge\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:--[x])/,/^(?:->)/,/^(?:--[o])/,/^(?:--)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u0061-\u007A\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)/,/^(?:\n)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],inclusive:!0}}};return t}();return U.lexer=$,t.prototype=U,U.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],118:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,4],r=[1,3],i=[1,5],a=[1,8,9,10,11,13,18,30,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],u=[2,2],o=[1,12],s=[1,13],c=[1,14],l=[1,15],h=[1,31],f=[1,33],d=[1,22],p=[1,34],g=[1,24],y=[1,25],m=[1,26],v=[1,27],_=[1,28],b=[1,38],x=[1,40],w=[1,35],A=[1,39],k=[1,45],E=[1,44],M=[1,36],D=[1,37],C=[1,41],S=[1,42],T=[1,43],F=[1,8,9,10,11,13,18,30,32,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],B=[1,53],L=[1,52],I=[1,54],N=[1,72],O=[1,80],P=[1,81],R=[1,66],j=[1,65],Y=[1,85],U=[1,84],$=[1,82],z=[1,83],q=[1,73],G=[1,68],W=[1,67],H=[1,63],V=[1,75],X=[1,76],Z=[1,77],K=[1,78],Q=[1,79],J=[1,70],tt=[1,69],et=[8,9,11],nt=[8,9,11,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64],rt=[1,115],it=[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,85,87,88,90,91,93,94,95,96,97],at=[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,83,85,87,88,90,91,93,94,95,96,97],ut=[1,117],ot=[1,118],st=[8,9,10,11,13,18,30,32,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],ct=[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,83,85,87,88,90,91,93,94,95,96,97],lt=[13,18,46,81,85,87,88,90,91,93,94,95,96,97],ht=[13,18,46,49,65,81,85,87,88,90,91,93,94,95,96,97],ft=[1,191],dt=[1,188],pt=[1,195],gt=[1,192],yt=[1,189],mt=[1,196],vt=[1,186],_t=[1,187],bt=[1,190],xt=[1,193],wt=[1,194],At=[1,211],kt=[8,9,11,85],Et=[8,9,10,11,46,71,80,81,83,85,87,88,89,90,91],Mt={trace:function(){},yy:{},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,commentStatement:82,PCT:83,style:84,COMMA:85,styleComponent:86,ALPHA:87,COLON:88,UNIT:89,BRKT:90,DOT:91,graphCodeTokens:92,PUNCTUATION:93,UNICODE_TEXT:94,PLUS:95,EQUALS:96,MULT:97,TAG_START:98,TAG_END:99,QUOTE:100,$accept:0,$end:1},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",83:"PCT",85:"COMMA",87:"ALPHA",88:"COLON",89:"UNIT",90:"BRKT",91:"DOT",93:"PUNCTUATION",94:"UNICODE_TEXT",95:"PLUS",96:"EQUALS",97:"MULT",98:"TAG_START",99:"TAG_END",100:"QUOTE"},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],[82,3],[79,1],[79,3],[84,1],[84,2],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,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],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 2:this.$=[];break;case 3:a[u]!==[]&&a[u-1].push(a[u]),this.$=a[u-1];break;case 4:case 57:case 59:case 60:case 92:case 94:case 95:case 108:this.$=a[u];break;case 11:r.setDirection(a[u-1]),this.$=a[u-1];break;case 12:r.setDirection("LR"),this.$=a[u-1];break;case 13:r.setDirection("RL"),this.$=a[u-1];break;case 14:r.setDirection("BT"),this.$=a[u-1];break;case 15:r.setDirection("TB"),this.$=a[u-1];break;case 30:this.$=a[u-1];break;case 31:case 32:case 33:case 34:case 35:this.$=[];break;case 36:this.$=r.addSubGraph(a[u-1],a[u-3]);break;case 37:this.$=r.addSubGraph(a[u-1],void 0);break;case 41:r.addLink(a[u-2],a[u],a[u-1]),this.$=[a[u-2],a[u]];break;case 42:this.$=[a[u]];break;case 43:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"square");break;case 44:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"square");break;case 45:this.$=a[u-5],r.addVertex(a[u-5],a[u-2],"circle");break;case 46:this.$=a[u-6],r.addVertex(a[u-6],a[u-3],"circle");break;case 47:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"ellipse");break;case 48:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"ellipse");break;case 49:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"round");break;case 50:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"round");break;case 51:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"diamond");break;case 52: -this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"diamond");break;case 53:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"odd");break;case 54:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"odd");break;case 55:this.$=a[u],r.addVertex(a[u]);break;case 56:this.$=a[u-1],r.addVertex(a[u-1]);break;case 58:case 93:case 96:case 109:this.$=a[u-1]+""+a[u];break;case 61:this.$="v";break;case 62:this.$="-";break;case 63:a[u-1].text=a[u],this.$=a[u-1];break;case 64:case 65:a[u-2].text=a[u-1],this.$=a[u-2];break;case 66:this.$=a[u];break;case 67:this.$={type:"arrow",stroke:"normal",text:a[u-1]};break;case 68:this.$={type:"arrow_circle",stroke:"normal",text:a[u-1]};break;case 69:this.$={type:"arrow_cross",stroke:"normal",text:a[u-1]};break;case 70:this.$={type:"arrow_open",stroke:"normal",text:a[u-1]};break;case 71:this.$={type:"arrow",stroke:"dotted",text:a[u-1]};break;case 72:this.$={type:"arrow_circle",stroke:"dotted",text:a[u-1]};break;case 73:this.$={type:"arrow_cross",stroke:"dotted",text:a[u-1]};break;case 74:this.$={type:"arrow_open",stroke:"dotted",text:a[u-1]};break;case 75:this.$={type:"arrow",stroke:"thick",text:a[u-1]};break;case 76:this.$={type:"arrow_circle",stroke:"thick",text:a[u-1]};break;case 77:this.$={type:"arrow_cross",stroke:"thick",text:a[u-1]};break;case 78:this.$={type:"arrow_open",stroke:"thick",text:a[u-1]};break;case 79:this.$={type:"arrow",stroke:"normal"};break;case 80:this.$={type:"arrow_circle",stroke:"normal"};break;case 81:this.$={type:"arrow_cross",stroke:"normal"};break;case 82:this.$={type:"arrow_open",stroke:"normal"};break;case 83:this.$={type:"arrow",stroke:"dotted"};break;case 84:this.$={type:"arrow_circle",stroke:"dotted"};break;case 85:this.$={type:"arrow_cross",stroke:"dotted"};break;case 86:this.$={type:"arrow_open",stroke:"dotted"};break;case 87:this.$={type:"arrow",stroke:"thick"};break;case 88:this.$={type:"arrow_circle",stroke:"thick"};break;case 89:this.$={type:"arrow_cross",stroke:"thick"};break;case 90:this.$={type:"arrow_open",stroke:"thick"};break;case 91:this.$=a[u-1];break;case 110:case 111:this.$=a[u-4],r.addClass(a[u-2],a[u]);break;case 112:this.$=a[u-4],r.setClass(a[u-2],a[u]);break;case 113:this.$=a[u-4],r.setClickEvent(a[u-2],a[u],void 0,void 0);break;case 114:this.$=a[u-6],r.setClickEvent(a[u-4],a[u-2],void 0,a[u]);break;case 115:this.$=a[u-4],r.setClickEvent(a[u-2],void 0,a[u],void 0);break;case 116:this.$=a[u-6],r.setClickEvent(a[u-4],void 0,a[u-2],a[u]);break;case 117:this.$=a[u-4],r.addVertex(a[u-2],void 0,void 0,a[u]);break;case 118:case 119:case 120:this.$=a[u-4],r.updateLink(a[u-2],a[u]);break;case 122:this.$=[a[u]];break;case 123:a[u-2].push(a[u]),this.$=a[u-2];break;case 125:this.$=a[u-1]+a[u]}},table:[{3:1,4:2,9:n,10:r,12:i},{1:[3]},e(a,u,{5:6}),{4:7,9:n,10:r,12:i},{4:8,9:n,10:r,12:i},{10:[1,9]},{1:[2,1],6:10,7:11,8:o,9:s,10:c,11:l,13:h,18:f,23:16,25:17,26:18,27:19,28:20,29:21,30:d,33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:_,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},e(a,[2,9]),e(a,[2,10]),{13:[1,46],15:[1,47],16:[1,48],17:[1,49],18:[1,50]},e(F,[2,3]),e(F,[2,4]),e(F,[2,5]),e(F,[2,6]),e(F,[2,7]),e(F,[2,8]),{8:B,9:L,11:I,24:51},{8:B,9:L,11:I,24:55},{8:B,9:L,11:I,24:56},{8:B,9:L,11:I,24:57},{8:B,9:L,11:I,24:58},{8:B,9:L,11:I,24:59},{8:B,9:L,10:N,11:I,12:O,13:P,15:R,16:j,17:Y,18:U,24:61,30:$,31:60,32:z,45:71,46:q,50:G,60:W,66:62,67:H,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},e(et,[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]},e(nt,[2,55],{45:32,21:113,44:114,10:rt,13:h,15:[1,112],18:f,36:[1,108],38:[1,109],40:[1,110],42:[1,111],46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T}),e(it,[2,57]),e(it,[2,59]),e(it,[2,60]),e(it,[2,61]),e(it,[2,62]),e(at,[2,150]),e(at,[2,151]),e(at,[2,152]),e(at,[2,153]),e(at,[2,154]),e(at,[2,155]),e(at,[2,156]),e(at,[2,157]),e(at,[2,158]),e(at,[2,159]),e(at,[2,160]),{8:ut,9:ot,10:rt,14:116,21:119},{8:ut,9:ot,10:rt,14:120,21:119},{8:ut,9:ot,10:rt,14:121,21:119},{8:ut,9:ot,10:rt,14:122,21:119},{8:ut,9:ot,10:rt,14:123,21:119},e(F,[2,30]),e(F,[2,38]),e(F,[2,39]),e(F,[2,40]),e(F,[2,31]),e(F,[2,32]),e(F,[2,33]),e(F,[2,34]),e(F,[2,35]),{8:B,9:L,10:N,11:I,12:O,13:P,15:R,16:j,17:Y,18:U,24:124,30:$,32:z,45:71,46:q,50:G,60:W,66:125,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},e(st,u,{5:126}),e(ct,[2,92]),e(ct,[2,94]),e(ct,[2,139]),e(ct,[2,140]),e(ct,[2,141]),e(ct,[2,142]),e(ct,[2,143]),e(ct,[2,144]),e(ct,[2,145]),e(ct,[2,146]),e(ct,[2,147]),e(ct,[2,148]),e(ct,[2,149]),e(ct,[2,97]),e(ct,[2,98]),e(ct,[2,99]),e(ct,[2,100]),e(ct,[2,101]),e(ct,[2,102]),e(ct,[2,103]),e(ct,[2,104]),e(ct,[2,105]),e(ct,[2,106]),e(ct,[2,107]),{13:h,18:f,33:127,35:29,44:30,45:32,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},e(lt,[2,66],{48:128,49:[1,129],65:[1,130]}),{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:131,32:z,45:71,46:q,50:G,60:W,66:62,67:H,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:132,32:z,45:71,46:q,50:G,60:W,66:62,67:H,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:133,32:z,45:71,46:q,50:G,60:W,66:62,67:H,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},e(ht,[2,79]),e(ht,[2,80]),e(ht,[2,81]),e(ht,[2,82]),e(ht,[2,83]),e(ht,[2,84]),e(ht,[2,85]),e(ht,[2,86]),e(ht,[2,87]),e(ht,[2,88]),e(ht,[2,89]),e(ht,[2,90]),{13:h,18:f,35:134,44:30,45:32,46:p,80:[1,135],81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{78:[1,136],81:[1,137]},{13:h,18:f,35:139,44:30,45:32,46:p,78:[1,138],81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{13:h,18:f,35:140,44:30,45:32,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{13:h,18:f,35:141,44:30,45:32,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:142,32:z,45:71,46:q,50:G,60:W,66:62,67:H,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:144,32:z,38:[1,143],45:71,46:q,50:G,60:W,66:62,67:H,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:145,32:z,45:71,46:q,50:G,60:W,66:62,67:H,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:146,32:z,45:71,46:q,50:G,60:W,66:62,67:H,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:147,32:z,45:71,46:q,50:G,60:W,66:62,67:H,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},e(nt,[2,56]),e(it,[2,58]),e(nt,[2,29],{21:148,10:rt}),e(a,[2,11]),e(a,[2,21]),e(a,[2,22]),{9:[1,149]},e(a,[2,12]),e(a,[2,13]),e(a,[2,14]),e(a,[2,15]),e(st,u,{5:150}),e(ct,[2,93]),{6:10,7:11,8:o,9:s,10:c,11:l,13:h,18:f,23:16,25:17,26:18,27:19,28:20,29:21,30:d,32:[1,151],33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:_,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},e(et,[2,41]),e(lt,[2,63],{10:[1,152]}),{10:[1,153]},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:154,32:z,45:71,46:q,50:G,60:W,66:62,67:H,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,45:71,46:q,50:G,51:[1,155],52:[1,156],53:[1,157],54:[1,158],60:W,66:125,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,45:71,46:q,50:G,56:[1,159],57:[1,160],58:[1,161],59:[1,162],60:W,66:125,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,45:71,46:q,50:G,60:W,61:[1,163],62:[1,164],63:[1,165],64:[1,166],66:125,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:[1,167],13:h,18:f,44:114,45:32,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:[1,168]},{10:[1,169]},{10:[1,170]},{10:[1,171]},{10:[1,172],13:h,18:f,44:114,45:32,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:[1,173],13:h,18:f,44:114,45:32,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:[1,174],13:h,18:f,44:114,45:32,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,37:[1,175],45:71,46:q,50:G,60:W,66:125,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:176,32:z,45:71,46:q,50:G,60:W,66:62,67:H,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,39:[1,177],45:71,46:q,50:G,60:W,66:125,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,41:[1,178],45:71,46:q,50:G,60:W,66:125,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,43:[1,179],45:71,46:q,50:G,60:W,66:125,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,37:[1,180],45:71,46:q,50:G,60:W,66:125,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},e(nt,[2,28]),e(a,[2,23]),{6:10,7:11,8:o,9:s,10:c,11:l,13:h,18:f,23:16,25:17,26:18,27:19,28:20,29:21,30:d,32:[1,181],33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:_,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},e(F,[2,37]),e(lt,[2,65]),e(lt,[2,64]),{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,45:71,46:q,50:G,60:W,65:[1,182],66:125,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},e(lt,[2,67]),e(lt,[2,68]),e(lt,[2,69]),e(lt,[2,70]),e(lt,[2,71]),e(lt,[2,72]),e(lt,[2,73]),e(lt,[2,74]),e(lt,[2,75]),e(lt,[2,76]),e(lt,[2,77]),e(lt,[2,78]),{10:ft,46:dt,71:pt,79:183,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:xt,91:wt},{10:ft,46:dt,71:pt,79:197,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:xt,91:wt},{10:ft,46:dt,71:pt,79:198,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:xt,91:wt},{10:ft,46:dt,71:pt,79:199,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:xt,91:wt},{10:ft,46:dt,71:pt,79:200,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:xt,91:wt},{10:ft,46:dt,71:pt,79:201,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:xt,91:wt},{13:h,18:f,35:202,44:30,45:32,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},{13:h,18:f,35:203,44:30,45:32,46:p,67:[1,204],81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},e(nt,[2,43],{21:205,10:rt}),{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,39:[1,206],45:71,46:q,50:G,60:W,66:125,70:74,71:V,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T},e(nt,[2,49],{21:207,10:rt}),e(nt,[2,47],{21:208,10:rt}),e(nt,[2,51],{21:209,10:rt}),e(nt,[2,53],{21:210,10:rt}),e(F,[2,36]),e([10,13,18,46,81,85,87,88,90,91,93,94,95,96,97],[2,91]),e(et,[2,117],{85:At}),e(kt,[2,122],{86:212,10:ft,46:dt,71:pt,80:gt,81:yt,83:mt,87:vt,88:_t,89:bt,90:xt,91:wt}),e(Et,[2,124]),e(Et,[2,126]),e(Et,[2,127]),e(Et,[2,128]),e(Et,[2,129]),e(Et,[2,130]),e(Et,[2,131]),e(Et,[2,132]),e(Et,[2,133]),e(Et,[2,134]),e(Et,[2,135]),e(Et,[2,136]),e(et,[2,118],{85:At}),e(et,[2,119],{85:At}),e(et,[2,120],{85:At}),e(et,[2,110],{85:At}),e(et,[2,111],{85:At}),e(et,[2,112],{45:32,44:114,13:h,18:f,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T}),e(et,[2,113],{45:32,44:114,10:[1,213],13:h,18:f,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:C,96:S,97:T}),e(et,[2,115],{10:[1,214]}),e(nt,[2,44]),{39:[1,215]},e(nt,[2,50]),e(nt,[2,48]),e(nt,[2,52]),e(nt,[2,54]),{10:ft,46:dt,71:pt,80:gt,81:yt,83:mt,84:216,86:185,87:vt,88:_t,89:bt,90:xt,91:wt},e(Et,[2,125]),{67:[1,217]},{67:[1,218]},e(nt,[2,45],{21:219,10:rt}),e(kt,[2,123],{86:212,10:ft,46:dt,71:pt,80:gt,81:yt,83:mt,87:vt,88:_t,89:bt,90:xt,91:wt}),e(et,[2,114]),e(et,[2,116]),e(nt,[2,46])],defaultActions:{},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var y=d.yylloc;i.push(y);var m=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,x,w,A,k,E,M,D=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},C={};;){if(b=n[n.length-1],this.defaultActions[b]?x=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=D()),x=a[b]&&a[b][v]),"undefined"==typeof x||!x.length||!x[0]){var S="";M=[];for(A in a[b])this.terminals_[A]&&A>l&&M.push("'"+this.terminals_[A]+"'");S=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:y,expected:M})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,_?(v=_,_=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,y=d.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[x[1]][1],C.$=r[r.length-k],C._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(C._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(C,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[x[1]][0]),r.push(C.$),i.push(C._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},Dt=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:break;case 1:this.begin("string");break;case 2:this.popState();break;case 3:return"STR";case 4:return 71;case 5:return 78;case 6:return 72;case 7:return 73;case 8:return 74;case 9:return 75;case 10:return 12;case 11:return 30;case 12:return 32;case 13:return 13;case 14:return 13;case 15:return 13;case 16:return 13;case 17:return 13;case 18:return 13;case 19:return 81;case 20:return 90;case 21:return 88;case 22:return 8;case 23:return 85;case 24:return 97;case 25:return 16;case 26:return 15;case 27:return 17;case 28:return 18;case 29:return 53;case 30:return 51;case 31:return 52;case 32:return 54;case 33:return 58;case 34:return 56;case 35:return 57;case 36:return 59;case 37:return 58;case 38:return 56;case 39:return 57;case 40:return 59;case 41:return 63;case 42:return 61;case 43:return 62;case 44:return 64;case 45:return 50;case 46:return 55;case 47:return 60;case 48:return 40;case 49:return 41;case 50:return 46;case 51:return 91;case 52:return 95;case 53:return 83;case 54:return 96;case 55:return 96;case 56:return 87;case 57:return 93;case 58:return 94;case 59:return 65;case 60:return 38;case 61:return 39;case 62:return 36;case 63:return 37;case 64:return 42;case 65:return 43;case 66:return 100;case 67:return 9;case 68:return 10;case 69:return 11}},rules:[/^(?:%%[^\n]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\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)/,/^(?:$)/],conditions:{string:{rules:[2,3],inclusive:!1},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],inclusive:!0}}};return t}();return Mt.lexer=Dt,t.prototype=Mt,Mt.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],119:[function(t,e,n){(function(e){"use strict";var r=t("moment"),i=t("../../logger"),a=new i.Log,u="",o="",s=[],c=[],l="";n.clear=function(){s=[],c=[],l="",o="",g=0,h=void 0,f=void 0,_=[]},n.setDateFormat=function(t){u=t},n.getDateFormat=function(){return u},n.setTitle=function(t){o=t},n.getTitle=function(){return o},n.addSection=function(t){l=t,s.push(t)},n.getTasks=function(){for(var t=x(),e=10,n=0;!t&&e>n;)t=x(),n++;return c=_};var h,f,d=function(t,e,i){i=i.trim();var u=/^after\s+([\d\w\-]+)/,o=u.exec(i.trim());if(null!==o){var s=n.findTaskById(o[1]);if("undefined"==typeof s){var c=new Date;return c.setHours(0,0,0,0),c}return s.endTime}return r(i,e.trim(),!0).isValid()?r(i,e.trim(),!0).toDate():(a.debug("Invalid date:"+i),a.debug("With date format:"+e.trim()),new Date)},p=function(t,e,n){if(n=n.trim(),r(n,e.trim(),!0).isValid())return r(n,e.trim()).toDate();var i=r(t),a=/^([\d]+)([wdhms])/,u=a.exec(n.trim());if(null!==u){switch(u[2]){case"s":i.add(u[1],"seconds");break;case"m":i.add(u[1],"minutes");break;case"h":i.add(u[1],"hours");break;case"d":i.add(u[1],"days");break;case"w":i.add(u[1],"weeks")}return i.toDate()}return i.toDate()},g=0,y=function(t){return"undefined"==typeof t?(g+=1,"task"+g):t},m=function(t,e){var r;r=":"===e.substr(0,1)?e.substr(1,e.length):e;for(var i=r.split(","),a={},u=n.getDateFormat(),o=!0;o;)o=!1,i[0].match(/^\s*active\s*$/)&&(a.active=!0,i.shift(1),o=!0),i[0].match(/^\s*done\s*$/)&&(a.done=!0,i.shift(1),o=!0),i[0].match(/^\s*crit\s*$/)&&(a.crit=!0,i.shift(1),o=!0);var s;for(s=0;sn-e?n+i+1.5*u.sidePadding>o?e+r-5:n+r+5:(n-e)/2+e+r}).attr("y",function(t,r){return r*e+u.barHeight/2+(u.fontSize/2-2)+n}).attr("text-height",i).attr("class",function(t){for(var e=w(t.startTime),n=w(t.endTime),r=this.getBBox().width,i=0,a=0;an-e?n+r+1.5*u.sidePadding>o?"taskTextOutsideLeft taskTextOutside"+i+" "+s:"taskTextOutsideRight taskTextOutside"+i+" "+s:"taskText taskText"+i+" "+s})}function l(t,e,n,a){var o,s=[[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["h1 %I:%M",function(t){return t.getMinutes()}]],c=[["%Y",function(){return!0}]],l=[["%I:%M",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}]];"undefined"!=typeof u.axisFormatter&&(l=[],u.axisFormatter.forEach(function(t){var e=[];e[0]=t[0],e[1]=t[1],l.push(e)})),o=s.concat(l).concat(c);var h=i.svg.axis().scale(w).orient("bottom").tickSize(-a+e+u.gridLineStartPadding,0,0).tickFormat(i.time.format.multi(o));r>7&&230>r&&(h=h.ticks(i.time.monday.range)),_.append("g").attr("class","grid").attr("transform","translate("+t+", "+(a-50)+")").call(h).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em")}function h(t,e){for(var n=[],r=0,i=0;i0))return i[1]*t/2+e;for(var u=0;a>u;u++)return r+=n[a-1][1],i[1]*t/2+r*t+e}).attr("class",function(t){for(var e=0;er;++r)e.hasOwnProperty(t[r])||(e[t[r]]=!0,n.push(t[r]));return n}function p(t){for(var e=t.length,n={};e;)n[t[--e]]=(n[t[e]]||0)+1;return n}function g(t,e){return p(e)[t]||0}n.yy.clear(),n.parse(t);var y=document.getElementById(e);o=y.parentElement.offsetWidth,"undefined"==typeof o&&(o=1200),"undefined"!=typeof u.useWidth&&(o=u.useWidth);var m=n.yy.getTasks(),v=m.length*(u.barHeight+u.barGap)+2*u.topPadding;y.setAttribute("height","100%"),y.setAttribute("viewBox","0 0 "+o+" "+v);var _=i.select("#"+e),b=i.min(m,function(t){return t.startTime}),x=i.max(m,function(t){return t.endTime}),w=i.time.scale().domain([i.min(m,function(t){return t.startTime}),i.max(m,function(t){return t.endTime})]).rangeRound([0,o-150]),A=[];r=a.duration(x-b).asDays();for(var k=0;kl&&M.push("'"+this.terminals_[A]+"'");S=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:y,expected:M})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,_?(v=_,_=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,y=d.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[x[1]][1],C.$=r[r.length-k],C._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(C._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(C,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[x[1]][0]),r.push(C.$),i.push(C._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},s=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 10;case 1:break;case 2:break;case 3:break;case 4:return 4;case 5:return 11;case 6:return"date";case 7:return 12;case 8:return 13;case 9:return 14;case 10:return 15;case 11:return":";case 12:return 6;case 13:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\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],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return t}();return o.lexer=s,t.prototype=o,o.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],122:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[2,2],r=[1,5],i=[1,7],a=[1,8],u=[1,11],o=[1,12],s=[1,13],c=[1,14],l=[1,16],h=[1,17],f=[1,7,9,10,16,18,19,20,21,22,23,33],d=[7,9,10,16,18,19,20,21,23,33],p=[1,53],g={trace:function(){},yy:{},symbols_:{error:2,start:3,SD:4,document:5,line:6,SPACE:7,statement:8,NL:9,participant:10,actor:11,AS:12,restOfLine:13,signal:14,note_statement:15,title:16,text:17,loop:18,end:19,opt:20,alt:21,"else":22,note:23,placement:24,text2:25,over:26,actor_pair:27,spaceList:28,",":29,left_of:30,right_of:31,signaltype:32,ACTOR:33,SOLID_OPEN_ARROW:34,DOTTED_OPEN_ARROW:35,SOLID_ARROW:36,DOTTED_ARROW:37,SOLID_CROSS:38,DOTTED_CROSS:39,TXT:40,$accept:0,$end:1},terminals_:{2:"error",4:"SD",7:"SPACE",9:"NL",10:"participant",12:"AS",13:"restOfLine",16:"title",17:"text",18:"loop",19:"end",20:"opt",21:"alt",22:"else",23:"note",26:"over",29:",",30:"left_of",31:"right_of",33:"ACTOR",34:"SOLID_OPEN_ARROW",35:"DOTTED_OPEN_ARROW",36:"SOLID_ARROW",37:"DOTTED_ARROW",38:"SOLID_CROSS",39:"DOTTED_CROSS",40:"TXT"},productions_:[0,[3,2],[5,0],[5,2],[6,2],[6,1],[6,1],[8,5],[8,3],[8,2],[8,2],[8,4],[8,4],[8,4],[8,7],[15,4],[15,4],[28,2],[28,1],[27,3],[27,1],[24,1],[24,1],[14,4],[11,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[25,1]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 1:return r.apply(a[u]),a[u];case 2:this.$=[];break;case 3:a[u-1].push(a[u]),this.$=a[u-1];break;case 4:case 5:this.$=a[u];break;case 6:this.$=[];break;case 7:a[u-3].description=a[u-1],this.$=a[u-3];break;case 8:this.$=a[u-1];break;case 12:a[u-1].unshift({type:"loopStart",loopText:a[u-2],signalType:r.LINETYPE.LOOP_START}),a[u-1].push({type:"loopEnd",loopText:a[u-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[u-1];break;case 13:a[u-1].unshift({type:"optStart",optText:a[u-2],signalType:r.LINETYPE.OPT_START}),a[u-1].push({type:"optEnd",optText:a[u-2],signalType:r.LINETYPE.OPT_END}),this.$=a[u-1];break;case 14:a[u-4].unshift({type:"altStart",altText:a[u-5],signalType:r.LINETYPE.ALT_START}),a[u-4].push({type:"else",altText:a[u-2],signalType:r.LINETYPE.ALT_ELSE}),a[u-4]=a[u-4].concat(a[u-1]),a[u-4].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=a[u-4];break;case 15:this.$=[a[u-1],{type:"addNote",placement:a[u-2],actor:a[u-1].actor,text:a[u]}];break;case 16:a[u-2]=[].concat(a[u-1],a[u-1]).slice(0,2),a[u-2][0]=a[u-2][0].actor,a[u-2][1]=a[u-2][1].actor,this.$=[a[u-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:a[u-2].slice(0,2),text:a[u]}];break;case 19:this.$=[a[u-2],a[u]];break;case 20:this.$=a[u];break;case 21:this.$=r.PLACEMENT.LEFTOF;break;case 22:this.$=r.PLACEMENT.RIGHTOF;break;case 23:this.$=[a[u-3],a[u-1],{type:"addMessage",from:a[u-3].actor,to:a[u-1].actor,signalType:a[u-2],msg:a[u]}];break;case 24:this.$={type:"addActor",actor:a[u]};break;case 25:this.$=r.LINETYPE.SOLID_OPEN;break;case 26:this.$=r.LINETYPE.DOTTED_OPEN;break;case 27:this.$=r.LINETYPE.SOLID;break;case 28:this.$=r.LINETYPE.DOTTED;break;case 29:this.$=r.LINETYPE.SOLID_CROSS;break;case 30:this.$=r.LINETYPE.DOTTED_CROSS;break;case 31:this.$=a[u].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},e([1,7,9,10,16,18,20,21,23,33],n,{5:3}),{1:[2,1],6:4,7:r,8:6,9:i,10:a,11:15,14:9,15:10,16:u,18:o,20:s,21:c,23:l,33:h},e(f,[2,3]),{8:18,10:a,11:15,14:9,15:10,16:u,18:o,20:s,21:c,23:l,33:h},e(f,[2,5]),e(f,[2,6]),{11:19,33:h},{9:[1,20]},{9:[1,21]},{7:[1,22]},{13:[1,23]},{13:[1,24]},{13:[1,25]},{32:26,34:[1,27],35:[1,28],36:[1,29],37:[1,30],38:[1,31],39:[1,32]},{24:33,26:[1,34],30:[1,35],31:[1,36]},e([9,12,29,34,35,36,37,38,39,40],[2,24]),e(f,[2,4]),{9:[1,38],12:[1,37]},e(f,[2,9]),e(f,[2,10]),{17:[1,39]},e(d,n,{5:40}),e(d,n,{5:41}),e([7,9,10,16,18,20,21,22,23,33],n,{5:42}),{11:43,33:h},{33:[2,25]},{33:[2,26]},{33:[2,27]},{33:[2,28]},{33:[2,29]},{33:[2,30]},{11:44,33:h},{11:46,27:45,33:h},{33:[2,21]},{33:[2,22]},{13:[1,47]},e(f,[2,8]),{9:[1,48]},{6:4,7:r,8:6,9:i,10:a,11:15,14:9,15:10,16:u,18:o,19:[1,49],20:s,21:c,23:l,33:h},{6:4,7:r,8:6,9:i,10:a,11:15,14:9,15:10,16:u,18:o,19:[1,50],20:s,21:c,23:l,33:h},{6:4,7:r,8:6,9:i,10:a,11:15,14:9,15:10,16:u,18:o,20:s,21:c,22:[1,51],23:l,33:h},{25:52,40:p},{25:54,40:p},{25:55,40:p},{29:[1,56],40:[2,20]},{9:[1,57]},e(f,[2,11]),e(f,[2,12]),e(f,[2,13]),{13:[1,58]},{9:[2,23]},{9:[2,31]},{9:[2,15]},{9:[2,16]},{11:59,33:h},e(f,[2,7]),e(d,n,{5:60}),{40:[2,19]},{6:4,7:r,8:6,9:i,10:a,11:15,14:9,15:10,16:u,18:o,19:[1,61],20:s,21:c,23:l,33:h},e(f,[2,14])],defaultActions:{27:[2,25],28:[2,26],29:[2,27],30:[2,28],31:[2,29],32:[2,30],35:[2,21],36:[2,22],52:[2,23],53:[2,31],54:[2,15],55:[2,16],59:[2,19]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var y=d.yylloc;i.push(y);var m=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,x,w,A,k,E,M,D=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},C={};;){if(b=n[n.length-1],this.defaultActions[b]?x=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=D()),x=a[b]&&a[b][v]),"undefined"==typeof x||!x.length||!x[0]){var S="";M=[];for(A in a[b])this.terminals_[A]&&A>l&&M.push("'"+this.terminals_[A]+"'");S=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:y,expected:M})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,_?(v=_,_=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,y=d.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[x[1]][1],C.$=r[r.length-k],C._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(C._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(C,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[x[1]][0]),r.push(C.$),i.push(C._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},y=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 9;case 1:break;case 2:break;case 3:break;case 4:break;case 5:return this.begin("ID"),10;case 6:return this.begin("ALIAS"),33;case 7:return this.popState(),this.popState(),this.begin("LINE"),12;case 8:return this.popState(),this.popState(),9;case 9:return this.begin("LINE"),18;case 10:return this.begin("LINE"),20;case 11:return this.begin("LINE"),21;case 12:return this.begin("LINE"),22;case 13:return this.popState(),13;case 14:return 19;case 15:return 30;case 16:return 31;case 17:return 26;case 18:return 23;case 19:return 16;case 20:return 4;case 21:return 29;case 22:return 9;case 23:return 33;case 24:return 36;case 25:return 37;case 26:return 34;case 27:return 35;case 28:return 38;case 29:return 39;case 30:return 40;case 31:return 9;case 32:return"INVALID"}},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,/^(?:[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\->:\n,;]+)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[2,3,13],inclusive:!1},ALIAS:{rules:[2,3,7,8],inclusive:!1},ID:{rules:[2,3,6],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],inclusive:!0}}};return t}();return g.lexer=y,t.prototype=g,g.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],123:[function(t,e,n){(function(e){"use strict";var r={},i=[],a=[],u=t("../../logger"),o=new u.Log;n.addActor=function(t,e,n){var i=r[t];i&&e===i.name&&null==n||(null==n&&(n=e),r[t]={name:e,description:n})},n.addMessage=function(t,e,n,r){i.push({from:t,to:e,message:n,answer:r})},n.addSignal=function(t,e,n,r){o.debug("Adding message from="+t+" to="+e+" message="+n+" type="+r),i.push({from:t,to:e,message:n,type:r})},n.getMessages=function(){return i},n.getActors=function(){return r},n.getActor=function(t){return r[t]},n.getActorKeys=function(){return Object.keys(r)},n.clear=function(){r={},i=[]},n.LINETYPE={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16},n.ARROWTYPE={FILLED:0,OPEN:1},n.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2},n.addNote=function(t,e,r){var u={actor:t,placement:e,message:r},o=[].concat(t,t);a.push(u),i.push({from:o[0],to:o[1],message:r,type:n.LINETYPE.NOTE,placement:e})},n.parseError=function(t,n){e.mermaidAPI.parseError(t,n)},n.apply=function(t){if(t instanceof Array)t.forEach(function(t){n.apply(t)});else switch(t.type){case"addActor":n.addActor(t.actor,t.actor,t.description);break;case"addNote":n.addNote(t.actor,t.placement,t.text);break;case"addMessage":n.addSignal(t.from,t.to,t.msg,t.signalType);break;case"loopStart":n.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":n.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":n.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":n.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":n.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":n.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":n.addSignal(void 0,void 0,void 0,t.signalType)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../logger":126}],124:[function(t,e,n){"use strict";var r=t("./parser/sequenceDiagram").parser;r.yy=t("./sequenceDb");var i=t("./svgDraw"),a=t("../../d3"),u=t("../../logger"),o=new u.Log,s={diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!1,bottomMarginAdj:1};n.bounds={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,list:[],init:function(){this.list=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,n,r){t[e]="undefined"==typeof t[e]?n:r(n,t[e])},updateLoops:function(t,e,r,i){var a=this,u=0;this.list.forEach(function(o){u++;var c=a.list.length-u+1;a.updateVal(o,"startx",t-c*s.boxMargin,Math.min),a.updateVal(o,"starty",e-c*s.boxMargin,Math.min),a.updateVal(o,"stopx",r+c*s.boxMargin,Math.max),a.updateVal(o,"stopy",i+c*s.boxMargin,Math.max),a.updateVal(n.bounds.data,"startx",t-c*s.boxMargin,Math.min),a.updateVal(n.bounds.data,"starty",e-c*s.boxMargin,Math.min),a.updateVal(n.bounds.data,"stopx",r+c*s.boxMargin,Math.max),a.updateVal(n.bounds.data,"stopy",i+c*s.boxMargin,Math.max)})},insert:function(t,e,r,i){var a,u,o,s;a=Math.min(t,r),o=Math.max(t,r),u=Math.min(e,i),s=Math.max(e,i),this.updateVal(n.bounds.data,"startx",a,Math.min),this.updateVal(n.bounds.data,"starty",u,Math.min),this.updateVal(n.bounds.data,"stopx",o,Math.max),this.updateVal(n.bounds.data,"stopy",s,Math.max),this.updateLoops(a,u,o,s)},newLoop:function(t){this.list.push({startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t})},endLoop:function(){var t=this.list.pop();return t},addElseToLoop:function(t){var e=this.list.pop();e.elsey=n.bounds.getVerticalPos(),e.elseText=t,this.list.push(e)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}};var c=function(t,e,r,a,u){var o=i.getNoteRect();o.x=e,o.y=r,o.width=u||s.width,o["class"]="note";var c=t.append("g"),l=i.drawRect(c,o),h=i.getTextObj();h.x=e-4,h.y=r-13,h.textMargin=s.noteMargin,h.dy="1em",h.text=a.message,h["class"]="noteText";var f=i.drawText(c,h,o.width-s.noteMargin),d=f[0][0].getBBox().height;!u&&d>s.width?(f.remove(),c=t.append("g"),f=i.drawText(c,h,2*o.width-s.noteMargin),d=f[0][0].getBBox().height,l.attr("width",2*o.width),n.bounds.insert(e,r,e+2*o.width,r+2*s.noteMargin+d)):n.bounds.insert(e,r,e+o.width,r+2*s.noteMargin+d),l.attr("height",d+2*s.noteMargin),n.bounds.bumpVerticalPos(d+2*s.noteMargin)},l=function(t,e,i,a,u){var o,c=t.append("g"),l=e+(i-e)/2,h=c.append("text").attr("x",l).attr("y",a-7).style("text-anchor","middle").attr("class","messageText").text(u.message);o="undefined"!=typeof h[0][0].getBBox?h[0][0].getBBox().width:h[0][0].getBoundingClientRect(); - -var f;if(e===i){f=c.append("path").attr("d","M "+e+","+a+" C "+(e+60)+","+(a-10)+" "+(e+60)+","+(a+30)+" "+e+","+(a+20)),n.bounds.bumpVerticalPos(30);var d=Math.max(o/2,100);n.bounds.insert(e-d,n.bounds.getVerticalPos()-10,i+d,n.bounds.getVerticalPos())}else f=c.append("line"),f.attr("x1",e),f.attr("y1",a),f.attr("x2",i),f.attr("y2",a),n.bounds.insert(e,n.bounds.getVerticalPos()-10,i,n.bounds.getVerticalPos());u.type===r.yy.LINETYPE.DOTTED||u.type===r.yy.LINETYPE.DOTTED_CROSS||u.type===r.yy.LINETYPE.DOTTED_OPEN?(f.style("stroke-dasharray","3, 3"),f.attr("class","messageLine1")):f.attr("class","messageLine0");var p="";s.arrowMarkerAbsolute&&(p=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,p=p.replace(/\(/g,"\\("),p=p.replace(/\)/g,"\\)")),f.attr("stroke-width",2),f.attr("stroke","black"),f.style("fill","none"),(u.type===r.yy.LINETYPE.SOLID||u.type===r.yy.LINETYPE.DOTTED)&&f.attr("marker-end","url("+p+"#arrowhead)"),(u.type===r.yy.LINETYPE.SOLID_CROSS||u.type===r.yy.LINETYPE.DOTTED_CROSS)&&f.attr("marker-end","url("+p+"#crosshead)")};e.exports.drawActors=function(t,e,r,a){var u;for(u=0;u/gi," "),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.attr("fill",e.fill),"undefined"!=typeof e["class"]&&i.attr("class",e["class"]);var a=i.append("tspan");return a.attr("x",e.x+2*e.textMargin),a.text(r),"undefined"!=typeof i.textwrap&&i.textwrap({x:e.x,y:e.y,width:n,height:1800},e.textMargin),i},n.drawLabel=function(t,e){var r=n.getNoteRect();r.x=e.x,r.y=e.y,r.width=50,r.height=20,r.fill="#526e52",r.stroke="none",r["class"]="labelBox",n.drawRect(t,r),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,e.fill="white",n.drawText(t,e)};var r=-1;n.drawActor=function(t,e,i,a,u){var o=e+u.width/2,s=t.append("g");0===i&&(r++,s.append("line").attr("id","actor"+r).attr("x1",o).attr("y1",5).attr("x2",o).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"));var c=n.getNoteRect();c.x=e,c.y=i,c.fill="#eaeaea",c.width=u.width,c.height=u.height,c["class"]="actor",c.rx=3,c.ry=3,n.drawRect(s,c),s.append("text").attr("x",o).attr("y",i+u.height/2+5).attr("class","actor").style("text-anchor","middle").text(a)},n.drawLoop=function(t,e,r,i){var a=t.append("g"),u=function(t,e,n,r){a.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",r).attr("stroke-width",2).attr("stroke","#526e52").attr("class","loopLine")};u(e.startx,e.starty,e.stopx,e.starty),u(e.stopx,e.starty,e.stopx,e.stopy),u(e.startx,e.stopy,e.stopx,e.stopy),u(e.startx,e.starty,e.startx,e.stopy),"undefined"!=typeof e.elsey&&u(e.startx,e.elsey,e.stopx,e.elsey);var o=n.getTextObj();o.text=r,o.x=e.startx,o.y=e.starty,o.labelMargin=15,o["class"]="labelText",o.fill="white",n.drawLabel(a,o),o=n.getTextObj(),o.text="[ "+e.title+" ]",o.x=e.startx+(e.stopx-e.startx)/2,o.y=e.starty+1.5*i.boxMargin,o.anchor="middle",o["class"]="loopText",n.drawText(a,o),"undefined"!=typeof e.elseText&&(o.text="[ "+e.elseText+" ]",o.y=e.elsey+1.5*i.boxMargin,n.drawText(a,o))},n.insertArrowHead=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},n.insertArrowCrossHead=function(t){var e=t.append("defs"),n=e.append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.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"),n.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")},n.getTextObj=function(){var t={x:0,y:0,fill:"black","text-anchor":"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0};return t},n.getNoteRect=function(){var t={x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0};return t}},{}],126:[function(t,e,n){"use strict";function r(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getSeconds(),i=t.getMilliseconds();10>e&&(e="0"+e),10>n&&(n="0"+n),10>r&&(r="0"+r),100>i&&(i="0"+i),10>i&&(i="00"+i);var a=e+":"+n+":"+r+" ("+i+")";return a}function i(t){this.level=t,this.log=function(t,e){var n=this.level;return"undefined"==typeof n&&(n=u),e>=n&&"undefined"!=typeof console&&"undefined"!=typeof console.log?console.log("["+r(new Date)+"] "+t):void 0},this.trace=function(t){this.log(t,a.trace)},this.debug=function(t){this.log(t,a.debug)},this.info=function(t){this.log(t,a.info)},this.warn=function(t){this.log(t,a.warn)},this.error=function(t){this.log(t,a.error)}}var a={debug:1,info:2,warn:3,error:4,fatal:5,"default":5},u=a.error;n.setLogLevel=function(t){u=t},n.Log=i},{}],127:[function(t,e,n){(function(e){"use strict";var r=t("./logger"),i=new r.Log,a=t("./diagrams/flowchart/graphDb"),u=t("./utils"),o=t("./diagrams/flowchart/flowRenderer"),s=t("./diagrams/sequenceDiagram/sequenceRenderer"),c=t("./diagrams/example/exampleRenderer"),l=t("./diagrams/example/parser/example"),h=t("./diagrams/flowchart/parser/flow"),f=t("./diagrams/flowchart/parser/dot"),d=t("./diagrams/sequenceDiagram/parser/sequenceDiagram"),p=t("./diagrams/sequenceDiagram/sequenceDb"),g=t("./diagrams/example/exampleDb"),y=t("./diagrams/gantt/ganttRenderer"),m=t("./diagrams/gantt/parser/gantt"),v=t("./diagrams/gantt/ganttDb"),_=t("./diagrams/classDiagram/parser/classDiagram"),b=t("./diagrams/classDiagram/classRenderer"),x=t("./diagrams/classDiagram/classDb"),w=t("./d3");SVGElement.prototype.getTransformToElement=SVGElement.prototype.getTransformToElement||function(t){return t.getScreenCTM().inverse().multiply(this.getScreenCTM())};var A={logLevel:5,cloneCssStyles:!0,startOnLoad:!0,arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequenceDiagram:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,sidePadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:3,axisFormatter:[["%I:%M",function(t){return t.getHours()}],["w. %U",function(t){return 1==t.getDay()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%m-%y",function(t){return t.getMonth()}]]},classDiagram:{},info:{}};r.setLogLevel(A.logLevel);var k=function(t){var e,n=u.detectType(t);switch(n){case"graph":e=h,e.parser.yy=a;break;case"dotGraph":e=f,e.parser.yy=a;break;case"sequenceDiagram":e=d,e.parser.yy=p;break;case"info":e=l,e.parser.yy=g;break;case"gantt":e=m,e.parser.yy=v;break;case"classDiagram":e=_,e.parser.yy=x}try{return e.parse(t),!0}catch(r){return!1}};n.parse=k,n.version=function(){return t("../package.json").version},n.encodeEntities=function(t){var e=t;return e=e.replace(/style.*:\S*#.*;/g,function(t){var e=t.substring(0,t.length-1);return e}),e=e.replace(/classDef.*:\S*#.*;/g,function(t){var e=t.substring(0,t.length-1);return e}),e=e.replace(/#\w+\;/g,function(t){var e=t.substring(1,t.length-1),n=/^\+?\d+$/.test(e);return n?"fl°°"+e+"¶ß":"fl°"+e+"¶ß"})},n.decodeEntities=function(t){var e=t;return e=e.replace(/\fl\°\°/g,function(){return"&#"}),e=e.replace(/\fl\°/g,function(){return"&"}),e=e.replace(/¶ß/g,function(){return";"})};var E=function(t,e,r,l){"undefined"!=typeof l?w.select(l).append("div").attr("id","d"+t).append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg").append("g"):w.select("body").append("div").attr("id","d"+t).append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg").append("g"),window.txt=e,e=n.encodeEntities(e);var h=w.select("#d"+t).node(),f=u.detectType(e),d={};switch(f){case"graph":A.flowchart.arrowMarkerAbsolute=A.arrowMarkerAbsolute,o.setConf(A.flowchart),o.draw(e,t,!1),A.cloneCssStyles&&(d=o.getClasses(e,!1),u.cloneCssStyles(h.firstChild,d));break;case"dotGraph":A.flowchart.arrowMarkerAbsolute=A.arrowMarkerAbsolute,o.setConf(A.flowchart),o.draw(e,t,!0),A.cloneCssStyles&&(d=o.getClasses(e,!0),u.cloneCssStyles(h.firstChild,d));break;case"sequenceDiagram":A.sequenceDiagram.arrowMarkerAbsolute=A.arrowMarkerAbsolute,s.setConf(A.sequenceDiagram),s.draw(e,t),A.cloneCssStyles&&u.cloneCssStyles(h.firstChild,[]);break;case"gantt":A.gantt.arrowMarkerAbsolute=A.arrowMarkerAbsolute,y.setConf(A.gantt),y.draw(e,t),A.cloneCssStyles&&u.cloneCssStyles(h.firstChild,[]);break;case"classDiagram":A.classDiagram.arrowMarkerAbsolute=A.arrowMarkerAbsolute,b.setConf(A.classDiagram),b.draw(e,t),A.cloneCssStyles&&u.cloneCssStyles(h.firstChild,[]);break;case"info":A.info.arrowMarkerAbsolute=A.arrowMarkerAbsolute,c.draw(e,t,n.version()),A.cloneCssStyles&&u.cloneCssStyles(h.firstChild,[])}w.select("#d"+t).selectAll("foreignobject div").attr("xmlns","http://www.w3.org/1999/xhtml");var p="";A.arrowMarkerAbsolute&&(p=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,p=p.replace(/\(/g,"\\("),p=p.replace(/\)/g,"\\)"));var g=w.select("#d"+t).node().innerHTML.replace(/url\(#arrowhead/g,"url("+p+"#arrowhead","g");g=n.decodeEntities(g),"undefined"!=typeof r?r(g,a.bindFunctions):i.warn("CB = undefined!");var m=w.select("#d"+t).node();return null!==m&&"function"==typeof m.remove&&w.select("#d"+t).node().remove(),g};n.render=function(t,e,n,r){try{if(1===arguments.length&&(e=t,t="mermaidId0"),"undefined"!=typeof document)return E(t,e,n,r)}catch(a){i.warn(a)}};var M=function(t){var e,n=Object.keys(t);for(e=0;e0&&(r+=n.selectorText+" { "+n.style.cssText+"}\n")}}catch(l){"undefined"!=typeof n&&i.warn('Invalid CSS selector "'+n.selectorText+'"',l)}var h="",f="";for(var d in e)e.hasOwnProperty(d)&&"undefined"!=typeof d&&("default"===d?(e["default"].styles instanceof Array&&(h+="#"+t.id.trim()+" .node>rect { "+e[d].styles.join("; ")+"; }\n"),e["default"].nodeLabelStyles instanceof Array&&(h+="#"+t.id.trim()+" .node text { "+e[d].nodeLabelStyles.join("; ")+"; }\n"),e["default"].edgeLabelStyles instanceof Array&&(h+="#"+t.id.trim()+" .edgeLabel text { "+e[d].edgeLabelStyles.join("; ")+"; }\n"),e["default"].clusterStyles instanceof Array&&(h+="#"+t.id.trim()+" .cluster rect { "+e[d].clusterStyles.join("; ")+"; }\n")):e[d].styles instanceof Array&&(f+="#"+t.id.trim()+" ."+d+">rect, ."+d+">polygon, ."+d+">ellipse { "+e[d].styles.join("; ")+"; }\n"));if(""!==r||""!==h||""!==f){var p=document.createElement("style");p.setAttribute("type","text/css"),p.setAttribute("title","mermaid-svg-internal-css"),p.innerHTML="/* */\n",t.insertBefore(p,t.firstChild)}};n.cloneCssStyles=u},{"./logger":126}]},{},[127])(127)}); \ No newline at end of file +}}),so.week=so.sunday,so.weeks=so.sunday.range,so.weeks.utc=so.sunday.utc.range,so.weekOfYear=so.sundayOfYear;var ho={"-":"",_:" ",0:"0"},fo=/^\s*\d+/,po=/^%/;nu.locale=function(t){return{numberFormat:Pt(t),timeFormat:$t(t)}};var go=nu.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});nu.format=go.numberFormat,nu.geo={},ce.prototype={s:0,t:0,add:function(t){le(t,this.t,yo),le(yo.s,this.s,this),this.s?this.t+=yo.t:this.s=yo.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var yo=new ce;nu.geo.stream=function(t,e){t&&mo.hasOwnProperty(t.type)?mo[t.type](t,e):he(t,e)};var mo={Feature:function(t,e){he(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++rt?4*Bu+t:t,xo.lineStart=xo.lineEnd=xo.point=w}};nu.geo.bounds=function(){function t(t,e){_.push(b=[l=t,f=t]),h>e&&(h=e),e>d&&(d=e)}function e(e,n){var r=ge([e*Ou,n*Ou]);if(m){var i=me(m,r),a=[i[1],-i[0],0],u=me(a,i);be(u),u=xe(u);var s=e-p,c=s>0?1:-1,g=u[0]*Pu*c,y=pu(s)>180;if(y^(g>c*p&&c*e>g)){var v=u[1]*Pu;v>d&&(d=v)}else if(g=(g+360)%360-180,y^(g>c*p&&c*e>g)){var v=-u[1]*Pu;h>v&&(h=v)}else h>n&&(h=n),n>d&&(d=n);y?p>e?o(l,e)>o(l,f)&&(f=e):o(e,f)>o(l,f)&&(l=e):f>=l?(l>e&&(l=e),e>f&&(f=e)):e>p?o(l,e)>o(l,f)&&(f=e):o(e,f)>o(l,f)&&(l=e)}else t(e,n);m=r,p=e}function n(){x.point=e}function r(){b[0]=l,b[1]=f,x.point=t,m=null}function i(t,n){if(m){var r=t-p;v+=pu(r)>180?r+(r>0?360:-360):r}else g=t,y=n;xo.point(t,n),e(t,n)}function a(){xo.lineStart()}function u(){i(g,y),xo.lineEnd(),pu(v)>Tu&&(l=-(f=180)),b[0]=l,b[1]=f,m=null}function o(t,e){return(e-=t)<0?e+360:e}function s(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tbo?(l=-(f=180),h=-(d=90)):v>Tu?d=90:-Tu>v&&(h=-90),b[0]=l,b[1]=f}};return function(t){d=f=-(l=h=1/0),_=[],nu.geo.stream(t,x);var e=_.length;if(e){_.sort(s);for(var n,r=1,i=_[0],a=[i];e>r;++r)n=_[r],c(n[0],i)||c(n[1],i)?(o(i[0],n[1])>o(i[0],i[1])&&(i[1]=n[1]),o(n[0],i[1])>o(i[0],i[1])&&(i[0]=n[0])):a.push(i=n);for(var u,n,p=-(1/0),e=a.length-1,r=0,i=a[e];e>=r;i=n,++r)n=a[r],(u=o(i[1],n[0]))>p&&(p=u,l=n[0],f=i[1])}return _=b=null,l===1/0||h===1/0?[[0/0,0/0],[0/0,0/0]]:[[l,h],[f,d]]}}(),nu.geo.centroid=function(t){wo=Ao=ko=Eo=Mo=Do=So=Co=To=Fo=Bo=0,nu.geo.stream(t,Lo);var e=To,n=Fo,r=Bo,i=e*e+n*n+r*r;return Fu>i&&(e=Do,n=So,r=Co,Tu>Ao&&(e=ko,n=Eo,r=Mo),i=e*e+n*n+r*r,Fu>i)?[0/0,0/0]:[Math.atan2(n,e)*Pu,nt(r/Math.sqrt(i))*Pu]};var wo,Ao,ko,Eo,Mo,Do,So,Co,To,Fo,Bo,Lo={sphere:w,point:Ae,lineStart:Ee,lineEnd:Me,polygonStart:function(){Lo.lineStart=De},polygonEnd:function(){Lo.lineStart=Ee}},Io=Le(Ce,Pe,je,[-Bu,-Bu/2]),No=1e9;nu.geo.clipExtent=function(){var t,e,n,r,i,a,u={stream:function(t){return i&&(i.valid=!1),i=a(t),i.valid=!0,i},extent:function(o){return arguments.length?(a=ze(t=+o[0][0],e=+o[0][1],n=+o[1][0],r=+o[1][1]),i&&(i.valid=!1,i=null),u):[[t,e],[n,r]]}};return u.extent([[0,0],[960,500]])},(nu.geo.conicEqualArea=function(){return We(qe)}).raw=qe,nu.geo.albers=function(){return nu.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},nu.geo.albersUsa=function(){function t(t){var a=t[0],u=t[1];return e=null,n(a,u),e||(r(a,u),e)||i(a,u),e}var e,n,r,i,a=nu.geo.albers(),u=nu.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o=nu.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,n){e=[t,n]}};return t.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?u:i>=.166&&.234>i&&r>=-.214&&-.115>r?o:a).invert(t)},t.stream=function(t){var e=a.stream(t),n=u.stream(t),r=o.stream(t);return{point:function(t,i){e.point(t,i),n.point(t,i),r.point(t,i)},sphere:function(){e.sphere(),n.sphere(),r.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),u.precision(e),o.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),u.scale(.35*e),o.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var c=a.scale(),l=+e[0],h=+e[1];return n=a.translate(e).clipExtent([[l-.455*c,h-.238*c],[l+.455*c,h+.238*c]]).stream(s).point,r=u.translate([l-.307*c,h+.201*c]).clipExtent([[l-.425*c+Tu,h+.12*c+Tu],[l-.214*c-Tu,h+.234*c-Tu]]).stream(s).point,i=o.translate([l-.205*c,h+.212*c]).clipExtent([[l-.214*c+Tu,h+.166*c+Tu],[l-.115*c-Tu,h+.234*c-Tu]]).stream(s).point,t},t.scale(1070)};var Oo,Po,Ro,jo,Yo,Uo,$o={point:w,lineStart:w,lineEnd:w,polygonStart:function(){Po=0,$o.lineStart=Ve},polygonEnd:function(){$o.lineStart=$o.lineEnd=$o.point=w,Oo+=pu(Po/2)}},zo={point:He,lineStart:w,lineEnd:w,polygonStart:w,polygonEnd:w},Wo={point:Ze,lineStart:Ke,lineEnd:Qe,polygonStart:function(){Wo.lineStart=Je},polygonEnd:function(){Wo.point=Ze,Wo.lineStart=Ke,Wo.lineEnd=Qe}};nu.geo.path=function(){function t(t){return t&&("function"==typeof o&&a.pointRadius(+o.apply(this,arguments)),u&&u.valid||(u=i(a)),nu.geo.stream(t,u)),a.result()}function e(){return u=null,t}var n,r,i,a,u,o=4.5;return t.area=function(t){return Oo=0,nu.geo.stream(t,i($o)),Oo},t.centroid=function(t){return ko=Eo=Mo=Do=So=Co=To=Fo=Bo=0,nu.geo.stream(t,i(Wo)),Bo?[To/Bo,Fo/Bo]:Co?[Do/Co,So/Co]:Mo?[ko/Mo,Eo/Mo]:[0/0,0/0]},t.bounds=function(t){return Yo=Uo=-(Ro=jo=1/0),nu.geo.stream(t,i(zo)),[[Ro,jo],[Yo,Uo]]},t.projection=function(t){return arguments.length?(i=(n=t)?t.stream||nn(t):_,e()):n},t.context=function(t){return arguments.length?(a=null==(r=t)?new Ge:new tn(t),"function"!=typeof o&&a.pointRadius(o),e()):r},t.pointRadius=function(e){return arguments.length?(o="function"==typeof e?e:(a.pointRadius(+e),+e),t):o},t.projection(nu.geo.albersUsa()).context(null)},nu.geo.transform=function(t){return{stream:function(e){var n=new rn(e);for(var r in t)n[r]=t[r];return n}}},rn.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},nu.geo.projection=un,nu.geo.projectionMutator=on,(nu.geo.equirectangular=function(){return un(cn)}).raw=cn.invert=cn,nu.geo.rotation=function(t){function e(e){return e=t(e[0]*Ou,e[1]*Ou),e[0]*=Pu,e[1]*=Pu,e}return t=hn(t[0]%360*Ou,t[1]*Ou,t.length>2?t[2]*Ou:0),e.invert=function(e){return e=t.invert(e[0]*Ou,e[1]*Ou),e[0]*=Pu,e[1]*=Pu,e},e},ln.invert=cn,nu.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=hn(-t[0]*Ou,-t[1]*Ou,0).invert,i=[];return n(null,null,1,{point:function(t,n){i.push(t=e(t,n)),t[0]*=Pu,t[1]*=Pu}}),{type:"Polygon",coordinates:[i]}}var e,n,r=[0,0],i=6;return t.origin=function(e){return arguments.length?(r=e,t):r},t.angle=function(r){return arguments.length?(n=gn((e=+r)*Ou,i*Ou),t):e},t.precision=function(r){return arguments.length?(n=gn(e*Ou,(i=+r)*Ou),t):i},t.angle(90)},nu.geo.distance=function(t,e){var n,r=(e[0]-t[0])*Ou,i=t[1]*Ou,a=e[1]*Ou,u=Math.sin(r),o=Math.cos(r),s=Math.sin(i),c=Math.cos(i),l=Math.sin(a),h=Math.cos(a);return Math.atan2(Math.sqrt((n=h*u)*n+(n=c*l-s*h*o)*n),s*l+c*h*o)},nu.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return nu.range(Math.ceil(a/y)*y,i,y).map(f).concat(nu.range(Math.ceil(c/m)*m,s,m).map(d)).concat(nu.range(Math.ceil(r/p)*p,n,p).filter(function(t){return pu(t%y)>Tu}).map(l)).concat(nu.range(Math.ceil(o/g)*g,u,g).filter(function(t){return pu(t%m)>Tu}).map(h))}var n,r,i,a,u,o,s,c,l,h,f,d,p=10,g=p,y=90,m=360,v=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(s).slice(1),f(i).reverse().slice(1),d(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],c=+e[0][1],s=+e[1][1],a>i&&(e=a,a=i,i=e),c>s&&(e=c,c=s,s=e),t.precision(v)):[[a,c],[i,s]]},t.minorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],o=+e[0][1],u=+e[1][1],r>n&&(e=r,r=n,n=e),o>u&&(e=o,o=u,u=e),t.precision(v)):[[r,o],[n,u]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(y=+e[0],m=+e[1],t):[y,m]},t.minorStep=function(e){return arguments.length?(p=+e[0],g=+e[1],t):[p,g]},t.precision=function(e){return arguments.length?(v=+e,l=mn(o,u,90),h=vn(r,n,v),f=mn(c,s,90),d=vn(a,i,v),t):v},t.majorExtent([[-180,-90+Tu],[180,90-Tu]]).minorExtent([[-180,-80-Tu],[180,80+Tu]])},nu.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||i.apply(this,arguments)]}}var e,n,r=_n,i=bn;return t.distance=function(){return nu.geo.distance(e||r.apply(this,arguments),n||i.apply(this,arguments))},t.source=function(n){return arguments.length?(r=n,e="function"==typeof n?null:n,t):r},t.target=function(e){return arguments.length?(i=e,n="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},nu.geo.interpolate=function(t,e){return xn(t[0]*Ou,t[1]*Ou,e[0]*Ou,e[1]*Ou)},nu.geo.length=function(t){return qo=0,nu.geo.stream(t,Vo),qo};var qo,Vo={sphere:w,point:w,lineStart:wn,lineEnd:w,polygonStart:w,polygonEnd:w},Ho=An(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(nu.geo.azimuthalEqualArea=function(){return un(Ho)}).raw=Ho;var Go=An(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},_);(nu.geo.azimuthalEquidistant=function(){return un(Go)}).raw=Go,(nu.geo.conicConformal=function(){return We(kn)}).raw=kn,(nu.geo.conicEquidistant=function(){return We(En)}).raw=En;var Xo=An(function(t){return 1/t},Math.atan);(nu.geo.gnomonic=function(){return un(Xo)}).raw=Xo,Mn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Nu]},(nu.geo.mercator=function(){return Dn(Mn)}).raw=Mn;var Zo=An(function(){return 1},Math.asin);(nu.geo.orthographic=function(){return un(Zo)}).raw=Zo;var Ko=An(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(nu.geo.stereographic=function(){return un(Ko)}).raw=Ko,Sn.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Nu]},(nu.geo.transverseMercator=function(){var t=Dn(Sn),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90])}).raw=Sn,nu.geom={},nu.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=Dt(n),a=Dt(r),u=t.length,o=[],s=[];for(e=0;u>e;e++)o.push([+i.call(this,t[e],e),+a.call(this,t[e],e),e]);for(o.sort(Bn),e=0;u>e;e++)s.push([o[e][0],-o[e][1]]);var c=Fn(o),l=Fn(s),h=l[0]===c[0],f=l[l.length-1]===c[c.length-1],d=[];for(e=c.length-1;e>=0;--e)d.push(t[o[c[e]][2]]);for(e=+h;e=r&&c.x<=a&&c.y>=i&&c.y<=u?[[r,u],[a,u],[a,i],[r,i]]:[];l.point=t[o]}),e}function n(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Tu)*Tu,y:Math.round(u(t,e)/Tu)*Tu,i:e}})}var r=Cn,i=Tn,a=r,u=i,o=us;return t?e(t):(e.links=function(t){return or(n(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return or(n(t)).cells.forEach(function(n,r){for(var i,a,u=n.site,o=n.edges.sort(qn),s=-1,c=o.length,l=o[c-1].edge,h=l.l===u?l.r:l.l;++s=c,f=r>=l,d=f<<1|h;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]=fr()),h?i=c:o=c,f?u=l:s=l,a(t,e,n,r,i,u,o,s)}var l,h,f,d,p,g,y,m,v,_=Dt(o),b=Dt(s);if(null!=e)g=e,y=n,m=r,v=i;else if(m=v=-(g=y=1/0),h=[],f=[],p=t.length,u)for(d=0;p>d;++d)l=t[d],l.xm&&(m=l.x),l.y>v&&(v=l.y),h.push(l.x),f.push(l.y);else for(d=0;p>d;++d){var x=+_(l=t[d],d),w=+b(l,d);g>x&&(g=x),y>w&&(y=w),x>m&&(m=x),w>v&&(v=w),h.push(x),f.push(w)}var A=m-g,k=v-y;A>k?v=y+A:m=g+k;var E=fr();if(E.add=function(t){a(E,t,+_(t,++d),+b(t,d),g,y,m,v)},E.visit=function(t){dr(t,E,g,y,m,v)},E.find=function(t){return pr(E,t[0],t[1],g,y,m,v)},d=-1,null==e){for(;++d=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";return n=ls.get(n)||cs,r=hs.get(r)||_,xr(r(n.apply(null,ru.call(arguments,1))))},nu.interpolateHcl=Ir,nu.interpolateHsl=Nr,nu.interpolateLab=Or,nu.interpolateRound=Pr,nu.transform=function(t){var e=au.createElementNS(nu.ns.prefix.svg,"g");return(nu.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Rr(n?n.matrix:fs)})(t)},Rr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var fs={a:1,b:0,c:0,d:1,e:0,f:0};nu.interpolateTransform=$r,nu.layout={},nu.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++no*o/y){if(p>s){var c=e.charge/s;t.px-=a*c,t.py-=u*c}return!0}if(e.point&&s&&p>s){var c=e.pointCharge/s;t.px-=a*c,t.py-=u*c}}return!e.charge}}function e(t){t.px=nu.event.x,t.py=nu.event.y,o.resume()}var n,r,i,a,u,o={},s=nu.dispatch("start","tick","end"),c=[1,1],l=.9,h=ds,f=ps,d=-30,p=gs,g=.1,y=.64,m=[],v=[];return o.tick=function(){if((r*=.99)<.005)return s.end({type:"end",alpha:r=0}),!0;var e,n,o,h,f,p,y,_,b,x=m.length,w=v.length;for(n=0;w>n;++n)o=v[n],h=o.source,f=o.target,_=f.x-h.x,b=f.y-h.y,(p=_*_+b*b)&&(p=r*a[n]*((p=Math.sqrt(p))-i[n])/p,_*=p,b*=p,f.x-=_*(y=h.weight/(f.weight+h.weight)),f.y-=b*y,h.x+=_*(y=1-y),h.y+=b*y);if((y=r*g)&&(_=c[0]/2,b=c[1]/2,n=-1,y))for(;++n0?t:0:t>0&&(s.start({type:"start",alpha:r=t}),nu.timer(o.tick)),o):r},o.start=function(){function t(t,r){if(!n){for(n=new Array(s),o=0;s>o;++o)n[o]=[];for(o=0;l>o;++o){var i=v[o];n[i.source.index].push(i.target),n[i.target.index].push(i.source)}}for(var a,u=n[e],o=-1,c=u.length;++oe;++e)(r=m[e]).index=e,r.weight=0;for(e=0;l>e;++e)r=v[e],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(e=0;s>e;++e)r=m[e],isNaN(r.x)&&(r.x=t("x",p)),isNaN(r.y)&&(r.y=t("y",g)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof h)for(e=0;l>e;++e)i[e]=+h.call(this,v[e],e);else for(e=0;l>e;++e)i[e]=h;if(a=[],"function"==typeof f)for(e=0;l>e;++e)a[e]=+f.call(this,v[e],e);else for(e=0;l>e;++e)a[e]=f;if(u=[],"function"==typeof d)for(e=0;s>e;++e)u[e]=+d.call(this,m[e],e);else for(e=0;s>e;++e)u[e]=d;return o.resume()},o.resume=function(){return o.alpha(.1)},o.stop=function(){return o.alpha(0)},o.drag=function(){return n||(n=nu.behavior.drag().origin(_).on("dragstart.force",Gr).on("drag.force",e).on("dragend.force",Xr)),arguments.length?void this.on("mouseover.force",Zr).on("mouseout.force",Kr).call(n):n},nu.rebind(o,s,"on")};var ds=20,ps=1,gs=1/0;nu.layout.hierarchy=function(){function t(i){var a,u=[i],o=[];for(i.depth=0;null!=(a=u.pop());)if(o.push(a),(c=n.call(t,a,a.depth))&&(s=c.length)){for(var s,c,l;--s>=0;)u.push(l=c[s]),l.parent=a,l.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(t,a,a.depth)||0),delete a.children;return ei(i,function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)}),o}var e=ii,n=ni,r=ri;return t.sort=function(n){return arguments.length?(e=n,t):e},t.children=function(e){return arguments.length?(n=e,t):n},t.value=function(e){return arguments.length?(r=e,t):r},t.revalue=function(e){return r&&(ti(e,function(t){t.children&&(t.value=0)}),ei(e,function(e){var n;e.children||(e.value=+r.call(t,e,e.depth)||0),(n=e.parent)&&(n.value+=e.value)})),e},t},nu.layout.partition=function(){function t(e,n,r,i){var a=e.children;if(e.x=n,e.y=e.depth*i,e.dx=r,e.dy=i,a&&(u=a.length)){var u,o,s,c=-1;for(r=e.value?r/e.value:0;++ch?-1:1),p=(h-s*d)/nu.sum(c),g=nu.range(s),y=[];return null!=n&&g.sort(n===ys?function(t,e){return c[e]-c[t]}:function(t,e){return n(u[t],u[e])}),g.forEach(function(t){y[t]={data:u[t],value:o=c[t],startAngle:l,endAngle:l+=o*p+d,padAngle:f}}),y}var e=Number,n=ys,r=0,i=Lu,a=0;return t.value=function(n){return arguments.length?(e=n,t):e},t.sort=function(e){return arguments.length?(n=e,t):n},t.startAngle=function(e){return arguments.length?(r=e,t):r},t.endAngle=function(e){return arguments.length?(i=e,t):i},t.padAngle=function(e){return arguments.length?(a=e,t):a},t};var ys={};nu.layout.stack=function(){function t(o,s){if(!(f=o.length))return o;var c=o.map(function(n,r){return e.call(t,n,r)}),l=c.map(function(e){return e.map(function(e,n){return[a.call(t,e,n),u.call(t,e,n)]})}),h=n.call(t,l,s);c=nu.permute(c,h),l=nu.permute(l,h);var f,d,p,g,y=r.call(t,l,s),m=c[0].length;for(p=0;m>p;++p)for(i.call(t,c[0][p],g=y[p],l[0][p][1]),d=1;f>d;++d)i.call(t,c[d][p],g+=l[d-1][p][1],l[d][p][1]);return o}var e=_,n=ci,r=li,i=si,a=ui,u=oi;return t.values=function(n){return arguments.length?(e=n,t):e},t.order=function(e){return arguments.length?(n="function"==typeof e?e:ms.get(e)||ci,t):n},t.offset=function(e){return arguments.length?(r="function"==typeof e?e:vs.get(e)||li,t):r},t.x=function(e){return arguments.length?(a=e,t):a},t.y=function(e){return arguments.length?(u=e,t):u},t.out=function(e){return arguments.length?(i=e,t):i},t};var ms=nu.map({"inside-out":function(t){var e,n,r=t.length,i=t.map(hi),a=t.map(fi),u=nu.range(r).sort(function(t,e){return i[t]-i[e]}),o=0,s=0,c=[],l=[];for(e=0;r>e;++e)n=u[e],s>o?(o+=a[n],c.push(n)):(s+=a[n],l.push(n));return l.reverse().concat(c)},reverse:function(t){return nu.range(t.length).reverse()},"default":ci}),vs=nu.map({silhouette:function(t){var e,n,r,i=t.length,a=t[0].length,u=[],o=0,s=[];for(n=0;a>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];r>o&&(o=r),u.push(r)}for(n=0;a>n;++n)s[n]=(o-u[n])/2;return s},wiggle:function(t){var e,n,r,i,a,u,o,s,c,l=t.length,h=t[0],f=h.length,d=[];for(d[0]=s=c=0,n=1;f>n;++n){for(e=0,i=0;l>e;++e)i+=t[e][n][1];for(e=0,a=0,o=h[n][0]-h[n-1][0];l>e;++e){for(r=0,u=(t[e][n][1]-t[e][n-1][1])/(2*o);e>r;++r)u+=(t[r][n][1]-t[r][n-1][1])/o;a+=u*t[e][n][1]}d[n]=s-=i?a/i*o:0,c>s&&(c=s)}for(n=0;f>n;++n)d[n]-=c;return d},expand:function(t){var e,n,r,i=t.length,a=t[0].length,u=1/i,o=[];for(n=0;a>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];if(r)for(e=0;i>e;e++)t[e][n][1]/=r;else for(e=0;i>e;e++)t[e][n][1]=u}for(n=0;a>n;++n)o[n]=0;return o},zero:li});nu.layout.histogram=function(){function t(t,a){for(var u,o,s=[],c=t.map(n,this),l=r.call(this,c,a),h=i.call(this,l,c,a),a=-1,f=c.length,d=h.length-1,p=e?1:1/f;++a0)for(a=-1;++a=l[0]&&o<=l[1]&&(u=s[nu.bisect(h,o,1,d)-1],u.y+=p,u.push(t[a]));return s}var e=!0,n=Number,r=yi,i=pi;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(r=Dt(e),t):r},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return gi(t,e)}:Dt(e),t):i},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},nu.layout.pack=function(){function t(t,a){var u=n.call(this,t,a),o=u[0],s=i[0],c=i[1],l=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(o.x=o.y=0,ei(o,function(t){t.r=+l(t.value)}),ei(o,xi),r){var h=r*(e?1:Math.max(2*o.r/s,2*o.r/c))/2;ei(o,function(t){t.r+=h}),ei(o,xi),ei(o,function(t){t.r-=h})}return ki(o,s/2,c/2,e?1:1/Math.max(2*o.r/s,2*o.r/c)),u}var e,n=nu.layout.hierarchy().sort(mi),r=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(n){return arguments.length?(e=null==n||"function"==typeof n?n:+n,t):e},t.padding=function(e){return arguments.length?(r=+e,t):r},Jr(t,n)},nu.layout.tree=function(){function t(t,i){var l=u.call(this,t,i),h=l[0],f=e(h);if(ei(f,n),f.parent.m=-f.z,ti(f,r),c)ti(h,a);else{var d=h,p=h,g=h;ti(h,function(t){t.xp.x&&(p=t),t.depth>g.depth&&(g=t)});var y=o(d,p)/2-d.x,m=s[0]/(p.x+o(p,d)/2+y),v=s[1]/(g.depth||1);ti(h,function(t){t.x=(t.x+y)*m,t.y=t.depth*v})}return l}function e(t){for(var e,n={A:null,children:[t]},r=[n];null!=(e=r.pop());)for(var i,a=e.children,u=0,o=a.length;o>u;++u)r.push((a[u]=i={_:a[u],parent:e,children:(i=a[u].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:u}).a=i);return n.children[0]}function n(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e.length){Ti(t);var a=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+o(t._,r._),t.m=t.z-a):t.z=a}else r&&(t.z=r.z+o(t._,r._));t.parent.A=i(t,r,t.parent.A||n[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function i(t,e,n){if(e){for(var r,i=t,a=t,u=e,s=i.parent.children[0],c=i.m,l=a.m,h=u.m,f=s.m;u=Si(u),i=Di(i),u&&i;)s=Di(s),a=Si(a),a.a=t,r=u.z+h-i.z-c+o(u._,i._),r>0&&(Ci(Fi(u,t,n),t,r),c+=r,l+=r),h+=u.m,c+=i.m,f+=s.m,l+=a.m;u&&!Si(a)&&(a.t=u,a.m+=h-l),i&&!Di(s)&&(s.t=i,s.m+=c-f,n=t)}return n}function a(t){t.x*=s[0],t.y=t.depth*s[1]}var u=nu.layout.hierarchy().sort(null).value(null),o=Mi,s=[1,1],c=null;return t.separation=function(e){return arguments.length?(o=e,t):o},t.size=function(e){return arguments.length?(c=null==(s=e)?a:null,t):c?null:s},t.nodeSize=function(e){return arguments.length?(c=null==(s=e)?null:a,t):c?s:null},Jr(t,u)},nu.layout.cluster=function(){function t(t,a){var u,o=e.call(this,t,a),s=o[0],c=0;ei(s,function(t){var e=t.children;e&&e.length?(t.x=Li(e),t.y=Bi(e)):(t.x=u?c+=n(t,u):0,t.y=0,u=t)});var l=Ii(s),h=Ni(s),f=l.x-n(l,h)/2,d=h.x+n(h,l)/2;return ei(s,i?function(t){t.x=(t.x-s.x)*r[0],t.y=(s.y-t.y)*r[1]}:function(t){t.x=(t.x-f)/(d-f)*r[0],t.y=(1-(s.y?t.y/s.y:1))*r[1]}),o}var e=nu.layout.hierarchy().sort(null).value(null),n=Mi,r=[1,1],i=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(i=null==(r=e),t):i?null:r},t.nodeSize=function(e){return arguments.length?(i=null!=(r=e),t):i?r:null},Jr(t,e)},nu.layout.treemap=function(){function t(t,e){for(var n,r,i=-1,a=t.length;++ie?0:e),n.area=isNaN(r)||0>=r?0:r}function e(n){var a=n.children;if(a&&a.length){var u,o,s,c=h(n),l=[],f=a.slice(),p=1/0,g="slice"===d?c.dx:"dice"===d?c.dy:"slice-dice"===d?1&n.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(t(f,c.dx*c.dy/n.value),l.area=0;(s=f.length)>0;)l.push(u=f[s-1]),l.area+=u.area,"squarify"!==d||(o=r(l,g))<=p?(f.pop(),p=o):(l.area-=l.pop().area,i(l,g,c,!1),g=Math.min(c.dx,c.dy),l.length=l.area=0,p=1/0);l.length&&(i(l,g,c,!0),l.length=l.area=0),a.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){ +var a,u=h(e),o=r.slice(),s=[];for(t(o,u.dx*u.dy/e.value),s.area=0;a=o.pop();)s.push(a),s.area+=a.area,null!=a.z&&(i(s,a.z?u.dx:u.dy,u,!o.length),s.length=s.area=0);r.forEach(n)}}function r(t,e){for(var n,r=t.area,i=0,a=1/0,u=-1,o=t.length;++un&&(a=n),n>i&&(i=n));return r*=r,e*=e,r?Math.max(e*i*p/r,r/(e*a*p)):1/0}function i(t,e,n,r){var i,a=-1,u=t.length,o=n.x,c=n.y,l=e?s(t.area/e):0;if(e==n.dx){for((r||l>n.dy)&&(l=n.dy);++an.dx)&&(l=n.dx);++an&&(e=1),1>n&&(t=0),function(){var n,r,i;do n=2*Math.random()-1,r=2*Math.random()-1,i=n*n+r*r;while(!i||i>1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=nu.random.normal.apply(nu,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=nu.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;t>n;n++)e+=Math.random();return e}}},nu.scale={};var _s={floor:_,ceil:_};nu.scale.linear=function(){return Wi([0,1],[0,1],_r,!1)};var bs={s:1,g:1,p:1,r:1,e:1};nu.scale.log=function(){return Qi(nu.scale.linear().domain([0,1]),10,!0,[1,10])};var xs=nu.format(".0e"),ws={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};nu.scale.pow=function(){return Ji(nu.scale.linear(),1,[0,1])},nu.scale.sqrt=function(){return nu.scale.pow().exponent(.5)},nu.scale.ordinal=function(){return ea([],{t:"range",a:[[]]})},nu.scale.category10=function(){return nu.scale.ordinal().range(As)},nu.scale.category20=function(){return nu.scale.ordinal().range(ks)},nu.scale.category20b=function(){return nu.scale.ordinal().range(Es)},nu.scale.category20c=function(){return nu.scale.ordinal().range(Ms)};var As=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(bt),ks=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(bt),Es=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(bt),Ms=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(bt);nu.scale.quantile=function(){return na([],[])},nu.scale.quantize=function(){return ra(0,1,[0,1])},nu.scale.threshold=function(){return ia([.5],[0,1])},nu.scale.identity=function(){return aa([0,1])},nu.svg={},nu.svg.arc=function(){function t(){var t=Math.max(0,+n.apply(this,arguments)),c=Math.max(0,+r.apply(this,arguments)),l=u.apply(this,arguments)-Nu,h=o.apply(this,arguments)-Nu,f=Math.abs(h-l),d=l>h?0:1;if(t>c&&(p=c,c=t,t=p),f>=Iu)return e(c,d)+(t?e(t,1-d):"")+"Z";var p,g,y,m,v,_,b,x,w,A,k,E,M=0,D=0,S=[];if((m=(+s.apply(this,arguments)||0)/2)&&(y=a===Ds?Math.sqrt(t*t+c*c):+a.apply(this,arguments),d||(D*=-1),c&&(D=nt(y/c*Math.sin(m))),t&&(M=nt(y/t*Math.sin(m)))),c){v=c*Math.cos(l+D),_=c*Math.sin(l+D),b=c*Math.cos(h-D),x=c*Math.sin(h-D);var C=Math.abs(h-l-2*D)<=Bu?0:1;if(D&&fa(v,_,b,x)===d^C){var T=(l+h)/2;v=c*Math.cos(T),_=c*Math.sin(T),b=x=null}}else v=_=0;if(t){w=t*Math.cos(h-M),A=t*Math.sin(h-M),k=t*Math.cos(l+M),E=t*Math.sin(l+M);var F=Math.abs(l-h+2*M)<=Bu?0:1;if(M&&fa(w,A,k,E)===1-d^F){var B=(l+h)/2;w=t*Math.cos(B),A=t*Math.sin(B),k=E=null}}else w=A=0;if((p=Math.min(Math.abs(c-t)/2,+i.apply(this,arguments)))>.001){g=c>t^d?0:1;var L=null==k?[w,A]:null==b?[v,_]:In([v,_],[k,E],[b,x],[w,A]),I=v-L[0],N=_-L[1],O=b-L[0],P=x-L[1],R=1/Math.sin(Math.acos((I*O+N*P)/(Math.sqrt(I*I+N*N)*Math.sqrt(O*O+P*P)))/2),j=Math.sqrt(L[0]*L[0]+L[1]*L[1]);if(null!=b){var Y=Math.min(p,(c-j)/(R+1)),U=da(null==k?[w,A]:[k,E],[v,_],c,Y,d),$=da([b,x],[w,A],c,Y,d);p===Y?S.push("M",U[0],"A",Y,",",Y," 0 0,",g," ",U[1],"A",c,",",c," 0 ",1-d^fa(U[1][0],U[1][1],$[1][0],$[1][1]),",",d," ",$[1],"A",Y,",",Y," 0 0,",g," ",$[0]):S.push("M",U[0],"A",Y,",",Y," 0 1,",g," ",$[0])}else S.push("M",v,",",_);if(null!=k){var z=Math.min(p,(t-j)/(R-1)),W=da([v,_],[k,E],t,-z,d),q=da([w,A],null==b?[v,_]:[b,x],t,-z,d);p===z?S.push("L",q[0],"A",z,",",z," 0 0,",g," ",q[1],"A",t,",",t," 0 ",d^fa(q[1][0],q[1][1],W[1][0],W[1][1]),",",1-d," ",W[1],"A",z,",",z," 0 0,",g," ",W[0]):S.push("L",q[0],"A",z,",",z," 0 0,",g," ",W[0])}else S.push("L",w,",",A)}else S.push("M",v,",",_),null!=b&&S.push("A",c,",",c," 0 ",C,",",d," ",b,",",x),S.push("L",w,",",A),null!=k&&S.push("A",t,",",t," 0 ",F,",",1-d," ",k,",",E);return S.push("Z"),S.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var n=oa,r=sa,i=ua,a=Ds,u=ca,o=la,s=ha;return t.innerRadius=function(e){return arguments.length?(n=Dt(e),t):n},t.outerRadius=function(e){return arguments.length?(r=Dt(e),t):r},t.cornerRadius=function(e){return arguments.length?(i=Dt(e),t):i},t.padRadius=function(e){return arguments.length?(a=e==Ds?Ds:Dt(e),t):a},t.startAngle=function(e){return arguments.length?(u=Dt(e),t):u},t.endAngle=function(e){return arguments.length?(o=Dt(e),t):o},t.padAngle=function(e){return arguments.length?(s=Dt(e),t):s},t.centroid=function(){var t=(+n.apply(this,arguments)+ +r.apply(this,arguments))/2,e=(+u.apply(this,arguments)+ +o.apply(this,arguments))/2-Nu;return[Math.cos(e)*t,Math.sin(e)*t]},t};var Ds="auto";nu.svg.line=function(){return pa(_)};var Ss=nu.map({linear:ga,"linear-closed":ya,step:ma,"step-before":va,"step-after":_a,basis:Ea,"basis-open":Ma,"basis-closed":Da,bundle:Sa,cardinal:wa,"cardinal-open":ba,"cardinal-closed":xa,monotone:Ia});Ss.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Cs=[0,2/3,1/3,0],Ts=[0,1/3,2/3,0],Fs=[0,1/6,2/3,1/6];nu.svg.line.radial=function(){var t=pa(Na);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},va.reverse=_a,_a.reverse=va,nu.svg.area=function(){return Oa(_)},nu.svg.area.radial=function(){var t=Oa(Na);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},nu.svg.chord=function(){function t(t,o){var s=e(this,a,t,o),c=e(this,u,t,o);return"M"+s.p0+r(s.r,s.p1,s.a1-s.a0)+(n(s,c)?i(s.r,s.p1,s.r,s.p0):i(s.r,s.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+i(c.r,c.p1,s.r,s.p0))+"Z"}function e(t,e,n,r){var i=e.call(t,n,r),a=o.call(t,i,r),u=s.call(t,i,r)-Nu,l=c.call(t,i,r)-Nu;return{r:a,a0:u,a1:l,p0:[a*Math.cos(u),a*Math.sin(u)],p1:[a*Math.cos(l),a*Math.sin(l)]}}function n(t,e){return t.a0==e.a0&&t.a1==e.a1}function r(t,e,n){return"A"+t+","+t+" 0 "+ +(n>Bu)+",1 "+e}function i(t,e,n,r){return"Q 0,0 "+r}var a=_n,u=bn,o=Pa,s=ca,c=la;return t.radius=function(e){return arguments.length?(o=Dt(e),t):o},t.source=function(e){return arguments.length?(a=Dt(e),t):a},t.target=function(e){return arguments.length?(u=Dt(e),t):u},t.startAngle=function(e){return arguments.length?(s=Dt(e),t):s},t.endAngle=function(e){return arguments.length?(c=Dt(e),t):c},t},nu.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),u=n.call(this,t,i),o=(a.y+u.y)/2,s=[a,{x:a.x,y:o},{x:u.x,y:o},u];return s=s.map(r),"M"+s[0]+"C"+s[1]+" "+s[2]+" "+s[3]}var e=_n,n=bn,r=Ra;return t.source=function(n){return arguments.length?(e=Dt(n),t):e},t.target=function(e){return arguments.length?(n=Dt(e),t):n},t.projection=function(e){return arguments.length?(r=e,t):r},t},nu.svg.diagonal.radial=function(){var t=nu.svg.diagonal(),e=Ra,n=t.projection;return t.projection=function(t){return arguments.length?n(ja(e=t)):e},t},nu.svg.symbol=function(){function t(t,r){return(Bs.get(e.call(this,t,r))||$a)(n.call(this,t,r))}var e=Ua,n=Ya;return t.type=function(n){return arguments.length?(e=Dt(n),t):e},t.size=function(e){return arguments.length?(n=Dt(e),t):n},t};var Bs=nu.map({circle:$a,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Is)),n=e*Is;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Ls),n=e*Ls/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Ls),n=e*Ls/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});nu.svg.symbolTypes=Bs.keys();var Ls=Math.sqrt(3),Is=Math.tan(30*Ou);Au.transition=function(t){for(var e,n,r=Ns||++js,i=Ha(t),a=[],u=Os||{time:Date.now(),ease:Mr,delay:0,duration:250},o=-1,s=this.length;++oa;a++){i.push(e=[]);for(var n=this[a],o=0,s=n.length;s>o;o++)(r=n[o])&&t.call(r,r.__data__,o,a)&&e.push(r)}return Wa(i,this.namespace,this.id)},Rs.tween=function(t,e){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(t):W(this,null==e?function(e){e[r][n].tween.remove(t)}:function(i){i[r][n].tween.set(t,e)})},Rs.attr=function(t,e){function n(){this.removeAttribute(o)}function r(){this.removeAttributeNS(o.space,o.local)}function i(t){return null==t?n:(t+="",function(){var e,n=this.getAttribute(o);return n!==t&&(e=u(n,t),function(t){this.setAttribute(o,e(t))})})}function a(t){return null==t?r:(t+="",function(){var e,n=this.getAttributeNS(o.space,o.local);return n!==t&&(e=u(n,t),function(t){this.setAttributeNS(o.space,o.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var u="transform"==t?$r:_r,o=nu.ns.qualify(t);return qa(this,"attr."+t,e,o.local?a:i)},Rs.attrTween=function(t,e){function n(t,n){var r=e.call(this,t,n,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,n){var r=e.call(this,t,n,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=nu.ns.qualify(t);return this.tween("attr."+t,i.local?r:n)},Rs.style=function(t,e,r){function i(){this.style.removeProperty(t)}function a(e){return null==e?i:(e+="",function(){var i,a=n(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(i=_r(a,e),function(e){this.style.setProperty(t,i(e),r)})})}var u=arguments.length;if(3>u){if("string"!=typeof t){2>u&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return qa(this,"style."+t,e,a)},Rs.styleTween=function(t,e,r){function i(i,a){var u=e.call(this,i,a,n(this).getComputedStyle(this,null).getPropertyValue(t));return u&&function(e){this.style.setProperty(t,u(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,i)},Rs.text=function(t){return qa(this,"text",t,Va)},Rs.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Rs.ease=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].ease:("function"!=typeof t&&(t=nu.ease.apply(nu,arguments)),W(this,function(r){r[n][e].ease=t}))},Rs.delay=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].delay:W(this,"function"==typeof t?function(r,i,a){r[n][e].delay=+t.call(r,r.__data__,i,a)}:(t=+t,function(r){r[n][e].delay=t}))},Rs.duration=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].duration:W(this,"function"==typeof t?function(r,i,a){r[n][e].duration=Math.max(1,t.call(r,r.__data__,i,a))}:(t=Math.max(1,t),function(r){r[n][e].duration=t}))},Rs.each=function(t,e){var n=this.id,r=this.namespace;if(arguments.length<2){var i=Os,a=Ns;try{Ns=n,W(this,function(e,i,a){Os=e[r][n],t.call(e,e.__data__,i,a)})}finally{Os=i,Ns=a}}else W(this,function(i){var a=i[r][n];(a.event||(a.event=nu.dispatch("start","end","interrupt"))).on(t,e)});return this},Rs.transition=function(){for(var t,e,n,r,i=this.id,a=++js,u=this.namespace,o=[],s=0,c=this.length;c>s;s++){o.push(t=[]);for(var e=this[s],l=0,h=e.length;h>l;l++)(n=e[l])&&(r=n[u][i],Ga(n,l,u,a,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),t.push(n)}return Wa(o,u,a)},nu.svg.axis=function(){function t(t){t.each(function(){var t,c=nu.select(this),l=this.__chart__||n,h=this.__chart__=n.copy(),f=null==s?h.ticks?h.ticks.apply(h,o):h.domain():s,d=null==e?h.tickFormat?h.tickFormat.apply(h,o):_:e,p=c.selectAll(".tick").data(f,h),g=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Tu),y=nu.transition(p.exit()).style("opacity",Tu).remove(),m=nu.transition(p.order()).style("opacity",1),v=Math.max(i,0)+u,b=ji(h),x=c.selectAll(".domain").data([0]),w=(x.enter().append("path").attr("class","domain"),nu.transition(x));g.append("line"),g.append("text");var A,k,E,M,D=g.select("line"),S=m.select("line"),C=p.select("text").text(d),T=g.select("text"),F=m.select("text"),B="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(t=Xa,A="x",E="y",k="x2",M="y2",C.attr("dy",0>B?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+b[0]+","+B*a+"V0H"+b[1]+"V"+B*a)):(t=Za,A="y",E="x",k="y2",M="x2",C.attr("dy",".32em").style("text-anchor",0>B?"end":"start"),w.attr("d","M"+B*a+","+b[0]+"H0V"+b[1]+"H"+B*a)),D.attr(M,B*i),T.attr(E,B*v),S.attr(k,0).attr(M,B*i),F.attr(A,0).attr(E,B*v),h.rangeBand){var L=h,I=L.rangeBand()/2;l=h=function(t){return L(t)+I}}else l.rangeBand?l=h:y.call(t,h,l);g.call(t,l,h),m.call(t,h,h)})}var e,n=nu.scale.linear(),r=Ys,i=6,a=6,u=3,o=[10],s=null;return t.scale=function(e){return arguments.length?(n=e,t):n},t.orient=function(e){return arguments.length?(r=e in Us?e+"":Ys,t):r},t.ticks=function(){return arguments.length?(o=arguments,t):o},t.tickValues=function(e){return arguments.length?(s=e,t):s},t.tickFormat=function(n){return arguments.length?(e=n,t):e},t.tickSize=function(e){var n=arguments.length;return n?(i=+e,a=+arguments[n-1],t):i},t.innerTickSize=function(e){return arguments.length?(i=+e,t):i},t.outerTickSize=function(e){return arguments.length?(a=+e,t):a},t.tickPadding=function(e){return arguments.length?(u=+e,t):u},t.tickSubdivide=function(){return arguments.length&&t},t};var Ys="bottom",Us={top:1,right:1,bottom:1,left:1};nu.svg.brush=function(){function t(n){n.each(function(){var n=nu.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",a).on("touchstart.brush",a),u=n.selectAll(".background").data([0]);u.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var o=n.selectAll(".resize").data(g,_);o.exit().remove(),o.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return $s[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),o.style("display",t.empty()?"none":null);var s,h=nu.transition(n),f=nu.transition(u);c&&(s=ji(c),f.attr("x",s[0]).attr("width",s[1]-s[0]),r(h)),l&&(s=ji(l),f.attr("y",s[0]).attr("height",s[1]-s[0]),i(h)),e(h)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+h[+/e$/.test(t)]+","+f[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",h[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",h[1]-h[0])}function i(t){t.select(".extent").attr("y",f[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function a(){function a(){32==nu.event.keyCode&&(C||(_=null,F[0]-=h[1],F[1]-=f[1],C=2),E())}function g(){32==nu.event.keyCode&&2==C&&(F[0]+=h[1],F[1]+=f[1],C=0,E())}function y(){var t=nu.mouse(x),n=!1;b&&(t[0]+=b[0],t[1]+=b[1]),C||(nu.event.altKey?(_||(_=[(h[0]+h[1])/2,(f[0]+f[1])/2]),F[0]=h[+(t[0]<_[0])],F[1]=f[+(t[1]<_[1])]):_=null),D&&m(t,c,0)&&(r(k),n=!0),S&&m(t,l,1)&&(i(k),n=!0),n&&(e(k),A({type:"brush",mode:C?"move":"resize"}))}function m(t,e,n){var r,i,a=ji(e),s=a[0],c=a[1],l=F[n],g=n?f:h,y=g[1]-g[0];return C&&(s-=l,c-=y+l),r=(n?p:d)?Math.max(s,Math.min(c,t[n])):t[n],C?i=(r+=l)+y:(_&&(l=Math.max(s,Math.min(c,2*_[n]-r))),r>l?(i=r,r=l):i=l),g[0]!=r||g[1]!=i?(n?o=null:u=null,g[0]=r,g[1]=i,!0):void 0}function v(){y(),k.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),nu.select("body").style("cursor",null),B.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),T(),A({type:"brushend"})}var _,b,x=this,w=nu.select(nu.event.target),A=s.of(x,arguments),k=nu.select(x),M=w.datum(),D=!/^(n|s)$/.test(M)&&c,S=!/^(e|w)$/.test(M)&&l,C=w.classed("extent"),T=Z(x),F=nu.mouse(x),B=nu.select(n(x)).on("keydown.brush",a).on("keyup.brush",g);if(nu.event.changedTouches?B.on("touchmove.brush",y).on("touchend.brush",v):B.on("mousemove.brush",y).on("mouseup.brush",v),k.interrupt().selectAll("*").interrupt(),C)F[0]=h[0]-F[0],F[1]=f[0]-F[1];else if(M){var L=+/w$/.test(M),I=+/^n/.test(M);b=[h[1-L]-F[0],f[1-I]-F[1]],F[0]=h[L],F[1]=f[I]}else nu.event.altKey&&(_=F.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),nu.select("body").style("cursor",w.style("cursor")),A({type:"brushstart"}),y()}var u,o,s=D(t,"brushstart","brush","brushend"),c=null,l=null,h=[0,0],f=[0,0],d=!0,p=!0,g=zs[0];return t.event=function(t){t.each(function(){var t=s.of(this,arguments),e={x:h,y:f,i:u,j:o},n=this.__chart__||e;this.__chart__=e,Ns?nu.select(this).transition().each("start.brush",function(){u=n.i,o=n.j,h=n.x,f=n.y,t({type:"brushstart"})}).tween("brush:brush",function(){var n=br(h,e.x),r=br(f,e.y);return u=o=null,function(i){h=e.x=n(i),f=e.y=r(i),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){u=e.i,o=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(c=e,g=zs[!c<<1|!l],t):c},t.y=function(e){return arguments.length?(l=e,g=zs[!c<<1|!l],t):l},t.clamp=function(e){return arguments.length?(c&&l?(d=!!e[0],p=!!e[1]):c?d=!!e:l&&(p=!!e),t):c&&l?[d,p]:c?d:l?p:null},t.extent=function(e){var n,r,i,a,s;return arguments.length?(c&&(n=e[0],r=e[1],l&&(n=n[0],r=r[0]),u=[n,r],c.invert&&(n=c(n),r=c(r)),n>r&&(s=n,n=r,r=s),(n!=h[0]||r!=h[1])&&(h=[n,r])),l&&(i=e[0],a=e[1],c&&(i=i[1],a=a[1]),o=[i,a],l.invert&&(i=l(i),a=l(a)),i>a&&(s=i,i=a,a=s),(i!=f[0]||a!=f[1])&&(f=[i,a])),t):(c&&(u?(n=u[0],r=u[1]):(n=h[0],r=h[1],c.invert&&(n=c.invert(n),r=c.invert(r)),n>r&&(s=n,n=r,r=s))),l&&(o?(i=o[0],a=o[1]):(i=f[0],a=f[1],l.invert&&(i=l.invert(i),a=l.invert(a)),i>a&&(s=i,i=a,a=s))),c&&l?[[n,i],[r,a]]:c?[n,r]:l&&[i,a])},t.clear=function(){return t.empty()||(h=[0,0],f=[0,0],u=o=null),t},t.empty=function(){return!!c&&h[0]==h[1]||!!l&&f[0]==f[1]},nu.rebind(t,s,"on")};var $s={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},zs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Ws=so.format=go.timeFormat,qs=Ws.utc,Vs=qs("%Y-%m-%dT%H:%M:%S.%LZ");Ws.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ka:Vs,Ka.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Ka.toString=Vs.toString,so.second=Yt(function(t){return new co(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),so.seconds=so.second.range,so.seconds.utc=so.second.utc.range,so.minute=Yt(function(t){return new co(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),so.minutes=so.minute.range,so.minutes.utc=so.minute.utc.range,so.hour=Yt(function(t){var e=t.getTimezoneOffset()/60;return new co(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),so.hours=so.hour.range,so.hours.utc=so.hour.utc.range,so.month=Yt(function(t){return t=so.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),so.months=so.month.range,so.months.utc=so.month.utc.range;var Hs=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Gs=[[so.second,1],[so.second,5],[so.second,15],[so.second,30],[so.minute,1],[so.minute,5],[so.minute,15],[so.minute,30],[so.hour,1],[so.hour,3],[so.hour,6],[so.hour,12],[so.day,1],[so.day,2],[so.week,1],[so.month,1],[so.month,3],[so.year,1]],Xs=Ws.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Ce]]),Zs={range:function(t,e,n){return nu.range(Math.ceil(t/n)*n,+e,n).map(Ja)},floor:_,ceil:_};Gs.year=so.year,so.scale=function(){return Qa(nu.scale.linear(),Gs,Xs)};var Ks=Gs.map(function(t){return[t[0].utc,t[1]]}),Qs=qs.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Ce]]);Ks.year=so.year.utc,so.scale.utc=function(){return Qa(nu.scale.linear(),Ks,Qs)},nu.text=St(function(t){return t.responseText}),nu.json=function(t,e){return Ct(t,"application/json",tu,e)},nu.html=function(t,e){return Ct(t,"text/html",eu,e)},nu.xml=St(function(t){return t.responseXML}),"function"==typeof define&&define.amd?define(nu):"object"==typeof e&&e.exports&&(e.exports=nu),this.d3=nu}()},{}],3:[function(t,e){e.exports={graphlib:t("./lib/graphlib"),dagre:t("./lib/dagre"),intersect:t("./lib/intersect"),render:t("./lib/render"),util:t("./lib/util"),version:t("./lib/version")}},{"./lib/dagre":10,"./lib/graphlib":11,"./lib/intersect":12,"./lib/render":27,"./lib/util":29,"./lib/version":30}],4:[function(t,e){function n(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),u=i.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(u,n[r+"Style"])}function r(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),u=i.append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(u,n[r+"Style"])}function i(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),u=i.append("path").attr("d","M 0 5 L 10 5").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(u,n[r+"Style"])}var a=t("./util");e.exports={"default":n,normal:n,vee:r,undirected:i}},{"./util":29}],5:[function(t,e){function n(t,e){var n=e.nodes().filter(function(t){return r.isSubgraph(e,t)}),a=t.selectAll("g.cluster").data(n,function(t){return t});return a.selectAll("*").remove(),a.enter().append("g").attr("class","cluster").attr("id",function(t){var n=e.node(t);return n.id}).style("opacity",0),r.applyTransition(a,e).style("opacity",1),a.each(function(t){var n=e.node(t),r=d3.select(this);d3.select(this).append("rect");var a=r.append("g").attr("class","label");i(a,n,n.clusterLabelPos)}),a.selectAll("rect").each(function(t){var n=e.node(t),i=d3.select(this);r.applyStyle(i,n.style)}),r.applyTransition(a.exit(),e).style("opacity",0).remove(),a}var r=t("./util"),i=t("./label/add-label");e.exports=n},{"./label/add-label":20,"./util":29}],6:[function(t,e){"use strict";function n(t,e){var n=t.selectAll("g.edgeLabel").data(e.edges(),function(t){return a.edgeToId(t)}).classed("update",!0);return n.selectAll("*").remove(),n.enter().append("g").classed("edgeLabel",!0).style("opacity",0),n.each(function(t){var n=e.edge(t),a=i(u.select(this),e.edge(t),0,0).classed("label",!0),o=a.node().getBBox();n.labelId&&a.attr("id",n.labelId),r.has(n,"width")||(n.width=o.width),r.has(n,"height")||(n.height=o.height)}),a.applyTransition(n.exit(),e).style("opacity",0).remove(),n}var r=t("./lodash"),i=t("./label/add-label"),a=t("./util"),u=t("./d3");e.exports=n},{"./d3":9,"./label/add-label":20,"./lodash":23,"./util":29}],7:[function(t,e){"use strict";function n(t,e,n){var i=t.selectAll("g.edgePath").data(e.edges(),function(t){return l.edgeToId(t)}).classed("update",!0);return u(i,e),o(i,e),l.applyTransition(i,e).style("opacity",1),i.each(function(t){var n=h.select(this),r=e.edge(t);r.elem=this,r.id&&n.attr("id",r.id),l.applyClass(n,r["class"],(n.classed("update")?"update ":"")+"edgePath")}),i.selectAll("path.path").each(function(t){var n=e.edge(t);n.arrowheadId=s.uniqueId("arrowhead");var i=h.select(this).attr("marker-end",function(){return"url(#"+n.arrowheadId+")"}).style("fill","none");l.applyTransition(i,e).attr("d",function(t){return r(e,t)}),l.applyStyle(i,n.style)}),i.selectAll("defs *").remove(),i.selectAll("defs").each(function(t){var r=e.edge(t),i=n[r.arrowhead];i(h.select(this),r.arrowheadId,r,"arrowhead")}),i}function r(t,e){var n=t.edge(e),r=t.node(e.v),a=t.node(e.w),u=n.points.slice(1,n.points.length-1);return u.unshift(c(r,u[0])),u.push(c(a,u[u.length-1])),i(n,u)}function i(t,e){var n=h.svg.line().x(function(t){return t.x}).y(function(t){return t.y});return s.has(t,"lineInterpolate")&&n.interpolate(t.lineInterpolate),s.has(t,"lineTension")&&n.tension(Number(t.lineTension)),n(e)}function a(t){var e=t.getBBox(),n=t.getTransformToElement(t.ownerSVGElement).translate(e.width/2,e.height/2);return{x:n.e,y:n.f}}function u(t,e){var n=t.enter().append("g").attr("class","edgePath").style("opacity",0);n.append("path").attr("class","path").attr("d",function(t){var n=e.edge(t),r=e.node(t.v).elem,u=s.range(n.points.length).map(function(){return a(r)});return i(n,u)}),n.append("defs")}function o(t,e){var n=t.exit();l.applyTransition(n,e).style("opacity",0).remove(),l.applyTransition(n.select("path.path"),e).attr("d",function(t){var n=e.node(t.v);if(n){var r=s.range(this.pathSegList.length).map(function(){return n});return i({},r)}return h.select(this).attr("d")})}var s=t("./lodash"),c=t("./intersect/intersect-node"),l=t("./util"),h=t("./d3");e.exports=n},{"./d3":9,"./intersect/intersect-node":16,"./lodash":23,"./util":29}],8:[function(t,e){"use strict";function n(t,e,n){var o=e.nodes().filter(function(t){return!a.isSubgraph(e,t)}),s=t.selectAll("g.node").data(o,function(t){return t}).classed("update",!0);return s.selectAll("*").remove(),s.enter().append("g").attr("class","node").style("opacity",0),s.each(function(t){var o=e.node(t),s=u.select(this),c=s.append("g").attr("class","label"),l=i(c,o),h=n[o.shape],f=r.pick(l.node().getBBox(),"width","height");o.elem=this,o.id&&s.attr("id",o.id),o.labelId&&c.attr("id",o.labelId),a.applyClass(s,o["class"],(s.classed("update")?"update ":"")+"node"),r.has(o,"width")&&(f.width=o.width),r.has(o,"height")&&(f.height=o.height),f.width+=o.paddingLeft+o.paddingRight,f.height+=o.paddingTop+o.paddingBottom,c.attr("transform","translate("+(o.paddingLeft-o.paddingRight)/2+","+(o.paddingTop-o.paddingBottom)/2+")");var d=h(u.select(this),f,o);a.applyStyle(d,o.style);var p=d.node().getBBox();o.width=p.width,o.height=p.height}),a.applyTransition(s.exit(),e).style("opacity",0).remove(),s}var r=t("./lodash"),i=t("./label/add-label"),a=t("./util"),u=t("./d3");e.exports=n},{"./d3":9,"./label/add-label":20,"./lodash":23,"./util":29}],9:[function(t,e){e.exports=window.d3},{}],10:[function(t,e){var n;if(t)try{n=t("dagre")}catch(r){}n||(n=window.dagre),e.exports=n},{dagre:31}],11:[function(t,e){var n;if(t)try{n=t("graphlib")}catch(r){}n||(n=window.graphlib),e.exports=n},{graphlib:61}],12:[function(t,e){e.exports={node:t("./intersect-node"),circle:t("./intersect-circle"),ellipse:t("./intersect-ellipse"),polygon:t("./intersect-polygon"),rect:t("./intersect-rect")}},{"./intersect-circle":13,"./intersect-ellipse":14,"./intersect-node":16,"./intersect-polygon":17,"./intersect-rect":18}],13:[function(t,e){function n(t,e,n){return r(t,e,e,n)}var r=t("./intersect-ellipse");e.exports=n},{"./intersect-ellipse":14}],14:[function(t,e){function n(t,e,n,r){var i=t.x,a=t.y,u=i-r.x,o=a-r.y,s=Math.sqrt(e*e*o*o+n*n*u*u),c=Math.abs(e*n*u/s);r.xm?(m-y)/g:(m+y)/g,m=u*c-a*l,_=0>m?(m-y)/g:(m+y)/g,{x:v,y:_})}function r(t,e){return t*e>0}e.exports=n},{}],16:[function(t,e){function n(t,e){return t.intersect(e)}e.exports=n},{}],17:[function(t,e){function n(t,e,n){var i=t.x,a=t.y,u=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;e.forEach(function(t){o=Math.min(o,t.x),s=Math.min(s,t.y)});for(var c=i-t.width/2-o,l=a-t.height/2-s,h=0;h1&&u.sort(function(t,e){var r=t.x-n.x,i=t.y-n.y,a=Math.sqrt(r*r+i*i),u=e.x-n.x,o=e.y-n.y,s=Math.sqrt(u*u+o*o);return s>a?-1:a===s?0:1}),u[0]):(console.log("NO INTERSECTION FOUND, RETURN NODE CENTER",t),t)}var r=t("./intersect-line");e.exports=n},{"./intersect-line":15}],18:[function(t,e){ +function n(t,e){var n,r,i=t.x,a=t.y,u=e.x-i,o=e.y-a,s=t.width/2,c=t.height/2;return Math.abs(o)*s>Math.abs(u)*c?(0>o&&(c=-c),n=0===o?0:c*u/o,r=c):(0>u&&(s=-s),n=s,r=0===u?0:s*o/u),{x:i+n,y:a+r}}e.exports=n},{}],19:[function(t,e){function n(t,e){var n=t.append("foreignObject").attr("width","100000"),i=n.append("xhtml:div"),a=e.label;switch(typeof a){case"function":i.insert(a);break;case"object":i.insert(function(){return a});break;default:i.html(a)}r.applyStyle(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap");var u,o;return i.each(function(){u=this.clientWidth,o=this.clientHeight}),n.attr("width",u).attr("height",o),n}var r=t("../util");e.exports=n},{"../util":29}],20:[function(t,e){function n(t,e,n){var u=e.label,o=t.append("g");"svg"===e.labelType?a(o,e):"string"!=typeof u||"html"===e.labelType?i(o,e):r(o,e);var s,c=o.node().getBBox();switch(n){case"top":s=-e.height/2;break;case"bottom":s=e.height/2-c.height;break;default:s=-c.height/2}return o.attr("transform","translate("+-c.width/2+","+s+")"),o}var r=t("./add-text-label"),i=t("./add-html-label"),a=t("./add-svg-label");e.exports=n},{"./add-html-label":19,"./add-svg-label":21,"./add-text-label":22}],21:[function(t,e){function n(t,e){var n=t;return n.node().appendChild(e.label),r.applyStyle(n,e.labelStyle),n}var r=t("../util");e.exports=n},{"../util":29}],22:[function(t,e){function n(t,e){for(var n=t.append("text"),a=r(e.label).split("\n"),u=0;uo;++o)r(t,"borderLeft","_bl",n,u,o),r(t,"borderRight","_br",n,u,o)}}i.each(t.children(),e)}function r(t,e,n,r,i,u){var o={width:0,height:0,rank:u,borderType:e},s=i[e][u-1],c=a.addDummyNode(t,"border",o,n);i[e][u]=c,t.setParent(c,r),s&&t.setEdge(s,c,{weight:1})}var i=t("./lodash"),a=t("./util");e.exports=n},{"./lodash":40,"./util":59}],34:[function(t,e){"use strict";function n(t){var e=t.graph().rankdir.toLowerCase();("lr"===e||"rl"===e)&&i(t)}function r(t){var e=t.graph().rankdir.toLowerCase();("bt"===e||"rl"===e)&&u(t),("lr"===e||"rl"===e)&&(s(t),i(t))}function i(t){l.each(t.nodes(),function(e){a(t.node(e))}),l.each(t.edges(),function(e){a(t.edge(e))})}function a(t){var e=t.width;t.width=t.height,t.height=e}function u(t){l.each(t.nodes(),function(e){o(t.node(e))}),l.each(t.edges(),function(e){var n=t.edge(e);l.each(n.points,o),l.has(n,"y")&&o(n)})}function o(t){t.y=-t.y}function s(t){l.each(t.nodes(),function(e){c(t.node(e))}),l.each(t.edges(),function(e){var n=t.edge(e);l.each(n.points,c),l.has(n,"x")&&c(n)})}function c(t){var e=t.x;t.x=t.y,t.y=e}var l=t("./lodash");e.exports={adjust:n,undo:r}},{"./lodash":40}],35:[function(t,e){function n(){var t={};t._next=t._prev=t,this._sentinel=t}function r(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function i(t,e){return"_next"!==t&&"_prev"!==t?e:void 0}e.exports=n,n.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;return e!==t?(r(e),e):void 0},n.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&r(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},n.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,i)),n=n._prev;return"["+t.join(", ")+"]"}},{}],36:[function(t,e){function n(t){var e=i.buildLayerMatrix(t),n=new a({compound:!0,multigraph:!0}).setGraph({});return r.each(t.nodes(),function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)}),r.each(t.edges(),function(t){n.setEdge(t.v,t.w,{},t.name)}),r.each(e,function(t,e){var i="layer"+e;n.setNode(i,{rank:"same"}),r.reduce(t,function(t,e){return n.setEdge(t,e,{style:"invis"}),e})}),n}var r=t("./lodash"),i=t("./util"),a=t("./graphlib").Graph;e.exports={debugOrdering:n}},{"./graphlib":37,"./lodash":40,"./util":59}],37:[function(t,e){var n;if("function"==typeof t)try{n=t("graphlib")}catch(r){}n||(n=window.graphlib),e.exports=n},{graphlib:61}],38:[function(t,e){function n(t,e){if(t.nodeCount()<=1)return[];var n=a(t,e||l),i=r(n.graph,n.buckets,n.zeroIdx);return o.flatten(o.map(i,function(e){return t.outEdges(e.v,e.w)}),!0)}function r(t,e,n){for(var r,a=[],u=e[e.length-1],o=e[0];t.nodeCount();){for(;r=o.dequeue();)i(t,e,n,r);for(;r=u.dequeue();)i(t,e,n,r);if(t.nodeCount())for(var s=e.length-2;s>0;--s)if(r=e[s].dequeue()){a=a.concat(i(t,e,n,r,!0));break}}return a}function i(t,e,n,r,i){var a=i?[]:void 0;return o.each(t.inEdges(r.v),function(r){var o=t.edge(r),s=t.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,u(e,n,s)}),o.each(t.outEdges(r.v),function(r){var i=t.edge(r),a=r.w,o=t.node(a);o["in"]-=i,u(e,n,o)}),t.removeNode(r.v),a}function a(t,e){var n=new s,r=0,i=0;o.each(t.nodes(),function(t){n.setNode(t,{v:t,"in":0,out:0})}),o.each(t.edges(),function(t){var a=n.edge(t.v,t.w)||0,u=e(t),o=a+u;n.setEdge(t.v,t.w,o),i=Math.max(i,n.node(t.v).out+=u),r=Math.max(r,n.node(t.w)["in"]+=u)});var a=o.range(i+r+3).map(function(){return new c}),l=r+1;return o.each(n.nodes(),function(t){u(a,l,n.node(t))}),{graph:n,buckets:a,zeroIdx:l}}function u(t,e,n){n.out?n["in"]?t[n.out-n["in"]+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}var o=t("./lodash"),s=t("./graphlib").Graph,c=t("./data/list");e.exports=n;var l=o.constant(1)},{"./data/list":35,"./graphlib":37,"./lodash":40}],39:[function(t,e){"use strict";function n(t,e){var n=e&&e.debugTiming?B.time:B.notime;n("layout",function(){var e=n(" buildLayoutGraph",function(){return a(t)});n(" runLayout",function(){r(e,n)}),n(" updateInputGraph",function(){i(t,e)})})}function r(t,e){e(" makeSpaceForEdgeLabels",function(){u(t)}),e(" removeSelfEdges",function(){g(t)}),e(" acyclic",function(){x.run(t)}),e(" nestingGraph.run",function(){D.run(t)}),e(" rank",function(){A(B.asNonCompoundGraph(t))}),e(" injectEdgeLabelProxies",function(){o(t)}),e(" removeEmptyRanks",function(){M(t)}),e(" nestingGraph.cleanup",function(){D.cleanup(t)}),e(" normalizeRanks",function(){k(t)}),e(" assignRankMinMax",function(){s(t)}),e(" removeEdgeLabelProxies",function(){c(t)}),e(" normalize.run",function(){w.run(t)}),e(" parentDummyChains",function(){E(t)}),e(" addBorderSegments",function(){S(t)}),e(" order",function(){T(t)}),e(" insertSelfEdges",function(){y(t)}),e(" adjustCoordinateSystem",function(){C.adjust(t)}),e(" position",function(){F(t)}),e(" positionSelfEdges",function(){m(t)}),e(" removeBorderNodes",function(){p(t)}),e(" normalize.undo",function(){w.undo(t)}),e(" fixupEdgeLabelCoords",function(){f(t)}),e(" undoCoordinateSystem",function(){C.undo(t)}),e(" translateGraph",function(){l(t)}),e(" assignNodeIntersects",function(){h(t)}),e(" reversePoints",function(){d(t)}),e(" acyclic.undo",function(){x.undo(t)})}function i(t,e){b.each(t.nodes(),function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))}),b.each(t.edges(),function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,b.has(i,"x")&&(r.x=i.x,r.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function a(t){var e=new L({multigraph:!0,compound:!0}),n=_(t.graph());return e.setGraph(b.merge({},N,v(n,I),b.pick(n,O))),b.each(t.nodes(),function(n){var r=_(t.node(n));e.setNode(n,b.defaults(v(r,P),R)),e.setParent(n,t.parent(n))}),b.each(t.edges(),function(n){var r=_(t.edge(n));e.setEdge(n,b.merge({},Y,v(r,j),b.pick(r,U)))}),e}function u(t){var e=t.graph();e.ranksep/=2,b.each(t.edges(),function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function o(t){b.each(t.edges(),function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-r.rank)/2+r.rank,e:e};B.addDummyNode(t,"edge-proxy",a,"_ep")}})}function s(t){var e=0;b.each(t.nodes(),function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=b.max(e,r.maxRank))}),t.graph().maxRank=e}function c(t){b.each(t.nodes(),function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}function l(t){function e(t){var e=t.x,u=t.y,o=t.width,s=t.height;n=Math.min(n,e-o/2),r=Math.max(r,e+o/2),i=Math.min(i,u-s/2),a=Math.max(a,u+s/2)}var n=Number.POSITIVE_INFINITY,r=0,i=Number.POSITIVE_INFINITY,a=0,u=t.graph(),o=u.marginx||0,s=u.marginy||0;b.each(t.nodes(),function(n){e(t.node(n))}),b.each(t.edges(),function(n){var r=t.edge(n);b.has(r,"x")&&e(r)}),n-=o,i-=s,b.each(t.nodes(),function(e){var r=t.node(e);r.x-=n,r.y-=i}),b.each(t.edges(),function(e){var r=t.edge(e);b.each(r.points,function(t){t.x-=n,t.y-=i}),b.has(r,"x")&&(r.x-=n),b.has(r,"y")&&(r.y-=i)}),u.width=r-n+o,u.height=a-i+s}function h(t){b.each(t.edges(),function(e){var n,r,i=t.edge(e),a=t.node(e.v),u=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=u,r=a),i.points.unshift(B.intersectRect(a,n)),i.points.push(B.intersectRect(u,r))})}function f(t){b.each(t.edges(),function(e){var n=t.edge(e);if(b.has(n,"x"))switch(("l"===n.labelpos||"r"===n.labelpos)&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}function d(t){b.each(t.edges(),function(e){var n=t.edge(e);n.reversed&&n.points.reverse()})}function p(t){b.each(t.nodes(),function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),a=t.node(b.last(n.borderLeft)),u=t.node(b.last(n.borderRight));n.width=Math.abs(u.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),b.each(t.nodes(),function(e){"border"===t.node(e).dummy&&t.removeNode(e)})}function g(t){b.each(t.edges(),function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}function y(t){var e=B.buildLayerMatrix(t);b.each(e,function(e){var n=0;b.each(e,function(e,r){var i=t.node(e);i.order=r+n,b.each(i.selfEdges,function(e){B.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")}),delete i.selfEdges})})}function m(t){b.each(t.nodes(),function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,a=r.y,u=n.x-i,o=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*u/3,y:a-o},{x:i+5*u/6,y:a-o},{x:i+u,y:a},{x:i+5*u/6,y:a+o},{x:i+2*u/3,y:a+o}],n.label.x=n.x,n.label.y=n.y}})}function v(t,e){return b.mapValues(b.pick(t,e),Number)}function _(t){var e={};return b.each(t,function(t,n){e[n.toLowerCase()]=t}),e}var b=t("./lodash"),x=t("./acyclic"),w=t("./normalize"),A=t("./rank"),k=t("./util").normalizeRanks,E=t("./parent-dummy-chains"),M=t("./util").removeEmptyRanks,D=t("./nesting-graph"),S=t("./add-border-segments"),C=t("./coordinate-system"),T=t("./order"),F=t("./position"),B=t("./util"),L=t("./graphlib").Graph;e.exports=n;var I=["nodesep","edgesep","ranksep","marginx","marginy"],N={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},O=["acyclicer","ranker","rankdir","align"],P=["width","height"],R={width:0,height:0},j=["minlen","weight","width","height","labeloffset"],Y={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},U=["labelpos"]},{"./acyclic":32,"./add-border-segments":33,"./coordinate-system":34,"./graphlib":37,"./lodash":40,"./nesting-graph":41,"./normalize":42,"./order":47,"./parent-dummy-chains":52,"./position":54,"./rank":56,"./util":59}],40:[function(t,e){var n;if("function"==typeof t)try{n=t("lodash")}catch(r){}n||(n=window._),e.exports=n},{lodash:81}],41:[function(t,e){function n(t){var e=s.addDummyNode(t,"root",{},"_root"),n=i(t),u=o.max(n)-1,c=2*u+1;t.graph().nestingRoot=e,o.each(t.edges(),function(e){t.edge(e).minlen*=c});var l=a(t)+1;o.each(t.children(),function(i){r(t,e,c,l,u,n,i)}),t.graph().nodeRankFactor=c}function r(t,e,n,i,a,u,c){var l=t.children(c);if(!l.length)return void(c!==e&&t.setEdge(e,c,{weight:0,minlen:n}));var h=s.addBorderNode(t,"_bt"),f=s.addBorderNode(t,"_bb"),d=t.node(c);t.setParent(h,c),d.borderTop=h,t.setParent(f,c),d.borderBottom=f,o.each(l,function(o){r(t,e,n,i,a,u,o);var s=t.node(o),l=s.borderTop?s.borderTop:o,d=s.borderBottom?s.borderBottom:o,p=s.borderTop?i:2*i,g=l!==d?1:a-u[c]+1;t.setEdge(h,l,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(d,f,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(c)||t.setEdge(e,h,{weight:0,minlen:a+u[c]})}function i(t){function e(r,i){var a=t.children(r);a&&a.length&&o.each(a,function(t){e(t,i+1)}),n[r]=i}var n={};return o.each(t.children(),function(t){e(t,1)}),n}function a(t){return o.reduce(t.edges(),function(e,n){return e+t.edge(n).weight},0)}function u(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,o.each(t.edges(),function(e){var n=t.edge(e);n.nestingEdge&&t.removeEdge(e)})}var o=t("./lodash"),s=t("./util");e.exports={run:n,cleanup:u}},{"./lodash":40,"./util":59}],42:[function(t,e){"use strict";function n(t){t.graph().dummyChains=[],a.each(t.edges(),function(e){r(t,e)})}function r(t,e){var n=e.v,r=t.node(n).rank,i=e.w,a=t.node(i).rank,o=e.name,s=t.edge(e),c=s.labelRank;if(a!==r+1){t.removeEdge(e);var l,h,f;for(f=0,++r;a>r;++f,++r)s.points=[],h={width:0,height:0,edgeLabel:s,edgeObj:e,rank:r},l=u.addDummyNode(t,"edge",h,"_d"),r===c&&(h.width=s.width,h.height=s.height,h.dummy="edge-label",h.labelpos=s.labelpos),t.setEdge(n,l,{weight:s.weight},o),0===f&&t.graph().dummyChains.push(l),n=l;t.setEdge(n,i,{weight:s.weight},o)}}function i(t){a.each(t.graph().dummyChains,function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)})}var a=t("./lodash"),u=t("./util");e.exports={run:n,undo:i}},{"./lodash":40,"./util":59}],43:[function(t,e){function n(t,e,n){var i,a={};r.each(n,function(n){for(var r,u,o=t.parent(n);o;){if(r=t.parent(o),r?(u=a[r],a[r]=o):(u=i,i=o),u&&u!==o)return void e.setEdge(u,o);o=r}})}var r=t("../lodash");e.exports=n},{"../lodash":40}],44:[function(t,e){function n(t,e){return r.map(e,function(e){var n=t.inEdges(e);if(n.length){var i=r.reduce(n,function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}},{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}})}var r=t("../lodash");e.exports=n},{"../lodash":40}],45:[function(t,e){function n(t,e,n){var u=r(t),o=new a({compound:!0}).setGraph({root:u}).setDefaultNodeLabel(function(e){return t.node(e)});return i.each(t.nodes(),function(r){var a=t.node(r),s=t.parent(r);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(o.setNode(r),o.setParent(r,s||u),i.each(t[n](r),function(e){var n=e.v===r?e.w:e.v,a=o.edge(n,r),u=i.isUndefined(a)?0:a.weight;o.setEdge(n,r,{weight:t.edge(e).weight+u})}),i.has(a,"minRank")&&o.setNode(r,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),o}function r(t){for(var e;t.hasNode(e=i.uniqueId("_root")););return e}var i=t("../lodash"),a=t("../graphlib").Graph;e.exports=n},{"../graphlib":37,"../lodash":40}],46:[function(t,e){"use strict";function n(t,e){for(var n=0,i=1;i0;)e%2&&(n+=s[e+1]),e=e-1>>1,s[e]+=t.weight;c+=t.weight*n})),c}var i=t("../lodash");e.exports=n},{"../lodash":40}],47:[function(t,e){"use strict";function n(t){var e=d.maxRank(t),n=r(t,u.range(1,e+1),"inEdges"),c=r(t,u.range(e-1,-1,-1),"outEdges"),l=o(t);a(t,l);for(var h,f=Number.POSITIVE_INFINITY,p=0,g=0;4>g;++p,++g){i(p%2?n:c,p%4>=2),l=d.buildLayerMatrix(t);var y=s(t,l);f>y&&(g=0,h=u.cloneDeep(l),f=y)}a(t,h)}function r(t,e,n){return u.map(e,function(e){return l(t,e,n)})}function i(t,e){var n=new f;u.each(t,function(t){var r=t.graph().root,i=c(t,r,n,e);u.each(i.vs,function(e,n){t.node(e).order=n}),h(t,n,i.vs)})}function a(t,e){u.each(e,function(e){u.each(e,function(e,n){t.node(e).order=n})})}var u=t("../lodash"),o=t("./init-order"),s=t("./cross-count"),c=t("./sort-subgraph"),l=t("./build-layer-graph"),h=t("./add-subgraph-constraints"),f=t("../graphlib").Graph,d=t("../util");e.exports=n},{"../graphlib":37,"../lodash":40,"../util":59,"./add-subgraph-constraints":43,"./build-layer-graph":45,"./cross-count":46,"./init-order":48,"./sort-subgraph":50}],48:[function(t,e){"use strict";function n(t){function e(i){if(!r.has(n,i)){n[i]=!0;var a=t.node(i);u[a.rank].push(i),r.each(t.successors(i),e)}}var n={},i=r.filter(t.nodes(),function(e){return!t.children(e).length}),a=r.max(r.map(i,function(e){return t.node(e).rank})),u=r.map(r.range(a+1),function(){return[]}),o=r.sortBy(i,function(e){return t.node(e).rank});return r.each(o,e),u}var r=t("../lodash");e.exports=n},{"../lodash":40}],49:[function(t,e){"use strict";function n(t,e){var n={};a.each(t,function(t,e){var r=n[t.v]={indegree:0,"in":[],out:[],vs:[t.v],i:e};a.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)}),a.each(e.edges(),function(t){var e=n[t.v],r=n[t.w];a.isUndefined(e)||a.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))});var i=a.filter(n,function(t){return!t.indegree});return r(i)}function r(t){function e(t){return function(e){e.merged||(a.isUndefined(e.barycenter)||a.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&i(t,e)}}function n(e){return function(n){n["in"].push(e),0===--n.indegree&&t.push(n)}}for(var r=[];t.length;){var u=t.pop();r.push(u),a.each(u["in"].reverse(),e(u)),a.each(u.out,n(u))}return a.chain(r).filter(function(t){return!t.merged}).map(function(t){return a.pick(t,["vs","i","barycenter","weight"])}).value()}function i(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}var a=t("../lodash");e.exports=n},{"../lodash":40}],50:[function(t,e){function n(t,e,c,l){var h=t.children(e),f=t.node(e),d=f?f.borderLeft:void 0,p=f?f.borderRight:void 0,g={};d&&(h=a.filter(h,function(t){return t!==d&&t!==p}));var y=u(t,h);a.each(y,function(e){if(t.children(e.v).length){var r=n(t,e.v,c,l);g[e.v]=r,a.has(r,"barycenter")&&i(e,r)}});var m=o(y,c);r(m,g);var v=s(m,l);if(d&&(v.vs=a.flatten([d,v.vs,p],!0),t.predecessors(d).length)){var _=t.node(t.predecessors(d)[0]),b=t.node(t.predecessors(p)[0]);a.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+_.order+b.order)/(v.weight+2),v.weight+=2}return v}function r(t,e){a.each(t,function(t){t.vs=a.flatten(t.vs.map(function(t){return e[t]?e[t].vs:t}),!0)})}function i(t,e){a.isUndefined(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}var a=t("../lodash"),u=t("./barycenter"),o=t("./resolve-conflicts"),s=t("./sort");e.exports=n},{"../lodash":40,"./barycenter":44,"./resolve-conflicts":49,"./sort":51}],51:[function(t,e){function n(t,e){var n=u.partition(t,function(t){return a.has(t,"barycenter")}),o=n.lhs,s=a.sortBy(n.rhs,function(t){return-t.i}),c=[],l=0,h=0,f=0;o.sort(i(!!e)),f=r(c,s,f),a.each(o,function(t){f+=t.vs.length,c.push(t.vs),l+=t.barycenter*t.weight,h+=t.weight,f=r(c,s,f)});var d={vs:a.flatten(c,!0)};return h&&(d.barycenter=l/h,d.weight=h),d}function r(t,e,n){for(var r;e.length&&(r=a.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}function i(t){return function(e,n){return e.barycentern.barycenter?1:t?n.i-e.i:e.i-n.i}}var a=t("../lodash"),u=t("../util");e.exports=n},{"../lodash":40,"../util":59}],52:[function(t,e){function n(t){var e=i(t);a.each(t.graph().dummyChains,function(n){for(var i=t.node(n),a=i.edgeObj,u=r(t,e,a.v,a.w),o=u.path,s=u.lca,c=0,l=o[c],h=!0;n!==a.w;){if(i=t.node(n),h){for(;(l=o[c])!==s&&t.node(l).maxRanks||c>e[i].lim));for(a=i,i=r;(i=t.parent(i))!==a;)o.push(i);return{path:u.concat(o.reverse()),lca:a}}function i(t){function e(i){var u=r;a.each(t.children(i),e),n[i]={low:u,lim:r++}}var n={},r=0;return a.each(t.children(),e),n}var a=t("./lodash");e.exports=n},{"./lodash":40}],53:[function(t,e){"use strict";function n(t,e){function n(e,n){var u=0,o=0,s=e.length,c=y.last(n);return y.each(n,function(e,l){var h=i(t,e),f=h?t.node(h).order:s;(h||e===c)&&(y.each(n.slice(o,l+1),function(e){y.each(t.predecessors(e),function(n){var i=t.node(n),o=i.order;!(u>o||o>f)||i.dummy&&t.node(e).dummy||a(r,n,e)})}),o=l+1,u=f)}),n}var r={};return y.reduce(e,n),r}function r(t,e){function n(e,n,r,u,o){var s;y.each(y.range(n,r),function(n){s=e[n],t.node(s).dummy&&y.each(t.predecessors(s),function(e){var n=t.node(e);n.dummy&&(n.ordero)&&a(i,e,s)})})}function r(e,r){var i,a=-1,u=0;return y.each(r,function(o,s){if("border"===t.node(o).dummy){var c=t.predecessors(o);c.length&&(i=t.node(c[0]).order,n(r,u,s,a,i),u=s,a=i)}n(r,u,r.length,i,e.length)}),r}var i={};return y.reduce(e,r),i}function i(t,e){return t.node(e).dummy?y.find(t.predecessors(e),function(e){return t.node(e).dummy}):void 0}function a(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function u(t,e,n){if(e>n){var r=e;e=n,n=r}return y.has(t[e],n)}function o(t,e,n,r){var i={},a={},o={};return y.each(e,function(t){y.each(t,function(t,e){i[t]=t,a[t]=t,o[t]=e})}),y.each(e,function(t){var e=-1;y.each(t,function(t){var s=r(t);if(s.length){s=y.sortBy(s,function(t){return o[t]});for(var c=(s.length-1)/2,l=Math.floor(c),h=Math.ceil(c);h>=l;++l){var f=s[l];a[t]===t&&eu.lim&&(o=u,s=!0);var c=p.filter(e.edges(),function(e){return s===d(t,t.node(e.v),o)&&s!==d(t,t.node(e.w),o)});return p.min(c,function(t){return y(e,t)})}function l(t,e,n,i){var a=n.v,o=n.w;t.removeEdge(a,o),t.setEdge(i.v,i.w,{}),u(t),r(t,e),h(t,e)}function h(t,e){var n=p.find(t.nodes(),function(t){return!e.node(t).parent}),r=v(t,n);r=r.slice(1),p.each(r,function(n){var r=t.node(n).parent,i=e.edge(n,r),a=!1;i||(i=e.edge(r,n),a=!0),e.node(n).rank=e.node(r).rank+(a?i.minlen:-i.minlen)})}function f(t,e,n){return t.hasEdge(e,n)}function d(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}var p=t("../lodash"),g=t("./feasible-tree"),y=t("./util").slack,m=t("./util").longestPath,v=t("../graphlib").alg.preorder,_=t("../graphlib").alg.postorder,b=t("../util").simplify;e.exports=n,n.initLowLimValues=u,n.initCutValues=r,n.calcCutValue=a,n.leaveEdge=s,n.enterEdge=c,n.exchangeEdges=l},{"../graphlib":37,"../lodash":40,"../util":59,"./feasible-tree":55,"./util":58}],58:[function(t,e){"use strict";function n(t){function e(r){var a=t.node(r);if(i.has(n,r))return a.rank;n[r]=!0;var u=i.min(i.map(t.outEdges(r),function(n){return e(n.w)-t.edge(n).minlen}));return u===Number.POSITIVE_INFINITY&&(u=0),a.rank=u}var n={};i.each(t.sources(),e)}function r(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var i=t("../lodash");e.exports={longestPath:n,slack:r}},{"../lodash":40}],59:[function(t,e){"use strict";function n(t,e,n,r){var i;do i=y.uniqueId(r);while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function r(t){var e=(new m).setGraph(t.graph());return y.each(t.nodes(),function(n){e.setNode(n,t.node(n))}),y.each(t.edges(),function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),e}function i(t){var e=new m({multigraph:t.isMultigraph()}).setGraph(t.graph());return y.each(t.nodes(),function(n){t.children(n).length||e.setNode(n,t.node(n))}),y.each(t.edges(),function(n){e.setEdge(n,t.edge(n))}),e}function a(t){var e=y.map(t.nodes(),function(e){var n={};return y.each(t.outEdges(e),function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight}),n});return y.zipObject(t.nodes(),e)}function u(t){var e=y.map(t.nodes(),function(e){var n={};return y.each(t.inEdges(e),function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight}),n});return y.zipObject(t.nodes(),e)}function o(t,e){var n=t.x,r=t.y,i=e.x-n,a=e.y-r,u=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var s,c;return Math.abs(a)*u>Math.abs(i)*o?(0>a&&(o=-o),s=o*i/a,c=o):(0>i&&(u=-u),s=u,c=u*a/i),{x:n+s,y:r+c}}function s(t){var e=y.map(y.range(f(t)+1),function(){return[]});return y.each(t.nodes(),function(n){var r=t.node(n),i=r.rank;y.isUndefined(i)||(e[i][r.order]=n)}),e}function c(t){var e=y.min(y.map(t.nodes(),function(e){return t.node(e).rank}));y.each(t.nodes(),function(n){var r=t.node(n);y.has(r,"rank")&&(r.rank-=e)})}function l(t){var e=y.min(y.map(t.nodes(),function(e){return t.node(e).rank})),n=[];y.each(t.nodes(),function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=t.graph().nodeRankFactor;y.each(n,function(e,n){y.isUndefined(e)&&n%i!==0?--r:r&&y.each(e,function(e){t.node(e).rank+=r})})}function h(t,e,r,i){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=i),n(t,"border",a,e)}function f(t){return y.max(y.map(t.nodes(),function(e){var n=t.node(e).rank;return y.isUndefined(n)?void 0:n}))}function d(t,e){var n={lhs:[],rhs:[]};return y.each(t,function(t){e(t)?n.lhs.push(t):n.rhs.push(t)}),n}function p(t,e){var n=y.now();try{return e()}finally{console.log(t+" time: "+(y.now()-n)+"ms")}}function g(t,e){return e()}var y=t("./lodash"),m=t("./graphlib").Graph;e.exports={addDummyNode:n,simplify:r,asNonCompoundGraph:i,successorWeights:a,predecessorWeights:u,intersectRect:o,buildLayerMatrix:s,normalizeRanks:c,removeEmptyRanks:l,addBorderNode:h,maxRank:f,partition:d,time:p,notime:g}},{"./graphlib":37,"./lodash":40}],60:[function(t,e){e.exports="0.7.4"},{}],61:[function(t,e){var n=t("./lib");e.exports={Graph:n.Graph,json:t("./lib/json"),alg:t("./lib/alg"),version:n.version}},{"./lib":77,"./lib/alg":68,"./lib/json":78}],62:[function(t,e){function n(t){function e(a){r.has(i,a)||(i[a]=!0,n.push(a),r.each(t.successors(a),e),r.each(t.predecessors(a),e))}var n,i={},a=[];return r.each(t.nodes(),function(t){n=[],e(t),n.length&&a.push(n)}),a}var r=t("../lodash");e.exports=n},{"../lodash":79}],63:[function(t,e){function n(t,e,n){i.isArray(e)||(e=[e]);var a=[],u={};return i.each(e,function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);r(t,e,"post"===n,u,a)}),a}function r(t,e,n,a,u){i.has(a,e)||(a[e]=!0,n||u.push(e),i.each(t.neighbors(e),function(e){r(t,e,n,a,u)}),n&&u.push(e))}var i=t("../lodash");e.exports=n},{"../lodash":79}],64:[function(t,e){function n(t,e,n){return i.transform(t.nodes(),function(i,a){i[a]=r(t,a,e,n)},{})}var r=t("./dijkstra"),i=t("../lodash");e.exports=n},{"../lodash":79,"./dijkstra":65}],65:[function(t,e){function n(t,e,n,i){return r(t,String(e),n||u,i||function(e){return t.outEdges(e)})}function r(t,e,n,r){var i,u,o={},s=new a,c=function(t){var e=t.v!==i?t.v:t.w,r=o[e],a=n(t),c=u.distance+a;if(0>a)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+a);c0&&(i=s.removeMin(),u=o[i],u.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(c);return o}var i=t("../lodash"),a=t("../data/priority-queue");e.exports=n;var u=i.constant(1)},{"../data/priority-queue":75,"../lodash":79}],66:[function(t,e){function n(t){return r.filter(i(t),function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})}var r=t("../lodash"),i=t("./tarjan");e.exports=n},{"../lodash":79,"./tarjan":73}],67:[function(t,e){function n(t,e,n){return r(t,e||a,n||function(e){return t.outEdges(e)})}function r(t,e,n){var r={},i=t.nodes();return i.forEach(function(t){r[t]={},r[t][t]={distance:0},i.forEach(function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})}),n(t).forEach(function(n){var i=n.v===t?n.w:n.v,a=e(n);r[t][i]={distance:a,predecessor:t}})}),i.forEach(function(t){var e=r[t];i.forEach(function(n){var a=r[n];i.forEach(function(n){var r=a[t],i=e[n],u=a[n],o=r.distance+i.distance;oi&&(s[n]=u,c.decrease(n,i))}}var u,o=new i,s={},c=new a;if(0===t.nodeCount())return o;r.each(t.nodes(),function(t){c.add(t,Number.POSITIVE_INFINITY),o.setNode(t)}),c.decrease(t.nodes()[0],0);for(var l=!1;c.size()>0;){if(u=c.removeMin(),r.has(s,u))o.setEdge(u,s[u]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(u).forEach(n)}return o}var r=t("../lodash"),i=t("../graph"),a=t("../data/priority-queue");e.exports=n},{"../data/priority-queue":75,"../graph":76,"../lodash":79}],73:[function(t,e){function n(t){function e(o){var s=a[o]={onStack:!0,lowlink:n,index:n++};if(i.push(o),t.successors(o).forEach(function(t){r.has(a,t)?a[t].onStack&&(s.lowlink=Math.min(s.lowlink,a[t].index)):(e(t),s.lowlink=Math.min(s.lowlink,a[t].lowlink))}),s.lowlink===s.index){var c,l=[];do c=i.pop(),a[c].onStack=!1,l.push(c);while(o!==c);u.push(l)}}var n=0,i=[],a={},u=[];return t.nodes().forEach(function(t){r.has(a,t)||e(t)}),u}var r=t("../lodash");e.exports=n},{"../lodash":79}],74:[function(t,e){function n(t){function e(o){if(i.has(a,o))throw new r;i.has(n,o)||(a[o]=!0,n[o]=!0,i.each(t.predecessors(o),e),delete a[o],u.push(o))}var n={},a={},u=[];if(i.each(t.sinks(),e),i.size(n)!==t.nodeCount())throw new r;return u}function r(){}var i=t("../lodash");e.exports=n,n.CycleException=r},{"../lodash":79}],75:[function(t,e){function n(){this._arr=[],this._keyIndices={}}var r=t("../lodash");e.exports=n,n.prototype.size=function(){return this._arr.length},n.prototype.keys=function(){return this._arr.map(function(t){return t.key})},n.prototype.has=function(t){return r.has(this._keyIndices,t)},n.prototype.priority=function(t){var e=this._keyIndices[t];return void 0!==e?this._arr[e].priority:void 0},n.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},n.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,a=i.length;return n[t]=a,i.push({key:t,priority:e}),this._decrease(a),!0}return!1},n.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},n.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},n.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n>1,!(n[e].prioritya){var u=i;i=a,a=u}return i+h+a+h+(s.isUndefined(r)?c:r)}function u(t,e,n,r){var i=""+e,a=""+n;if(!t&&i>a){var u=i;i=a,a=u}var o={v:i,w:a};return r&&(o.name=r),o}function o(t,e){return a(t,e.v,e.w,e.name)}var s=t("./lodash");e.exports=n;var c="\x00",l="\x00",h="";n.prototype._nodeCount=0,n.prototype._edgeCount=0,n.prototype.isDirected=function(){return this._isDirected},n.prototype.isMultigraph=function(){return this._isMultigraph},n.prototype.isCompound=function(){return this._isCompound},n.prototype.setGraph=function(t){return this._label=t,this},n.prototype.graph=function(){return this._label},n.prototype.setDefaultNodeLabel=function(t){return s.isFunction(t)||(t=s.constant(t)),this._defaultNodeLabelFn=t,this},n.prototype.nodeCount=function(){return this._nodeCount},n.prototype.nodes=function(){return s.keys(this._nodes)},n.prototype.sources=function(){return s.filter(this.nodes(),function(t){return s.isEmpty(this._in[t])},this)},n.prototype.sinks=function(){return s.filter(this.nodes(),function(t){return s.isEmpty(this._out[t])},this)},n.prototype.setNodes=function(t,e){var n=arguments;return s.each(t,function(t){n.length>1?this.setNode(t,e):this.setNode(t)},this),this},n.prototype.setNode=function(t,e){return s.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=l,this._children[t]={},this._children[l][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},n.prototype.node=function(t){return this._nodes[t]},n.prototype.hasNode=function(t){return s.has(this._nodes,t)},n.prototype.removeNode=function(t){var e=this;if(s.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],s.each(this.children(t),function(t){this.setParent(t)},this),delete this._children[t]),s.each(s.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],s.each(s.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},n.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(s.isUndefined(e))e=l;else{e+="";for(var n=e;!s.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},n.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},n.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==l)return e}},n.prototype.children=function(t){if(s.isUndefined(t)&&(t=l),this._isCompound){var e=this._children[t];if(e)return s.keys(e)}else{if(t===l)return this.nodes();if(this.hasNode(t))return[]}},n.prototype.predecessors=function(t){var e=this._preds[t];return e?s.keys(e):void 0},n.prototype.successors=function(t){var e=this._sucs[t];return e?s.keys(e):void 0},n.prototype.neighbors=function(t){var e=this.predecessors(t);return e?s.union(e,this.successors(t)):void 0},n.prototype.filterNodes=function(t){function e(t){var a=r.parent(t);return void 0===a||n.hasNode(a)?(i[t]=a,a):a in i?i[a]:e(a)}var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph()),s.each(this._nodes,function(e,r){t(r)&&n.setNode(r,e)},this),s.each(this._edgeObjs,function(t){n.hasNode(t.v)&&n.hasNode(t.w)&&n.setEdge(t,this.edge(t))},this);var r=this,i={};return this._isCompound&&s.each(n.nodes(),function(t){n.setParent(t,e(t))}),n},n.prototype.setDefaultEdgeLabel=function(t){return s.isFunction(t)||(t=s.constant(t)),this._defaultEdgeLabelFn=t,this},n.prototype.edgeCount=function(){return this._edgeCount},n.prototype.edges=function(){return s.values(this._edgeObjs)},n.prototype.setPath=function(t,e){var n=this,r=arguments;return s.reduce(t,function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i}),this},n.prototype.setEdge=function(){var t,e,n,i,o=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(t=c.v,e=c.w,n=c.name,2===arguments.length&&(i=arguments[1],o=!0)):(t=c,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,e=""+e,s.isUndefined(n)||(n=""+n);var l=a(this._isDirected,t,e,n);if(s.has(this._edgeLabels,l))return o&&(this._edgeLabels[l]=i),this;if(!s.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=o?i:this._defaultEdgeLabelFn(t,e,n);var h=u(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[l]=h,r(this._preds[e],t),r(this._sucs[t],e),this._in[e][l]=h,this._out[t][l]=h,this._edgeCount++,this},n.prototype.edge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return this._edgeLabels[r]},n.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return s.has(this._edgeLabels,r)},n.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n),u=this._edgeObjs[r];return u&&(t=u.v,e=u.w,delete this._edgeLabels[r],delete this._edgeObjs[r],i(this._preds[e],t),i(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},n.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=s.values(n);return e?s.filter(r,function(t){return t.v===e}):r}},n.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=s.values(n);return e?s.filter(r,function(t){return t.w===e}):r}},n.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);return n?n.concat(this.outEdges(t,e)):void 0}},{"./lodash":79}],77:[function(t,e){e.exports={Graph:t("./graph"),version:t("./version")}},{"./graph":76,"./version":80}],78:[function(t,e){function n(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:r(t),edges:i(t)};return u.isUndefined(t.graph())||(e.value=u.clone(t.graph())),e}function r(t){return u.map(t.nodes(),function(e){var n=t.node(e),r=t.parent(e),i={v:e};return u.isUndefined(n)||(i.value=n),u.isUndefined(r)||(i.parent=r),i})}function i(t){return u.map(t.edges(),function(e){var n=t.edge(e),r={v:e.v,w:e.w};return u.isUndefined(e.name)||(r.name=e.name),u.isUndefined(n)||(r.value=n),r})}function a(t){var e=new o(t.options).setGraph(t.value);return u.each(t.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),u.each(t.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}var u=t("./lodash"),o=t("./graph");e.exports={write:n,read:a}},{"./graph":76,"./lodash":79}],79:[function(t,e){e.exports=t(40)},{"/Users/knut/source/mermaid/node_modules/dagre/lib/lodash.js":40,lodash:81}],80:[function(t,e){e.exports="1.0.7"},{}],81:[function(t,e,n){(function(t){(function(){function r(t,e){if(t!==e){var n=null===t,r=t===E,i=t===t,a=null===e,u=e===E,o=e===e;if(t>e&&!a||!i||n&&!u&&o||r&&o)return 1;if(e>t&&!n||!o||a&&!r&&i||u&&i)return-1}return 0}function i(t,e,n){for(var r=t.length,i=n?r:-1;n?i--:++i-1;);return n}function c(t,e){for(var n=t.length;n--&&e.indexOf(t.charAt(n))>-1;);return n}function l(t,e){return r(t.criteria,e.criteria)||t.index-e.index}function h(t,e,n){for(var i=-1,a=t.criteria,u=e.criteria,o=a.length,s=n.length;++i=s)return c;var l=n[i];return c*("asc"===l||l===!0?1:-1)}}return t.index-e.index}function f(t){return Wt[t]}function d(t){return qt[t]}function p(t,e,n){return e?t=Gt[t]:n&&(t=Xt[t]),"\\"+t}function g(t){return"\\"+Xt[t]}function y(t,e,n){for(var r=t.length,i=e+(n?0:-1);n?i--:++i=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function _(t,e){for(var n=-1,r=t.length,i=-1,a=[];++ne,i=n?t.length:0,a=Vn(0,i,this.__views__),u=a.start,o=a.end,s=o-u,c=r?o:u-1,l=this.__iteratees__,h=l.length,f=0,d=wu(s,this.__takeCount__);if(!n||Y>i||i==s&&d==s)return nn(r&&n?t.reverse():t,this.__actions__);var p=[];t:for(;s--&&d>f;){c+=e;for(var g=-1,y=t[c];++g=Y?gn(e):null,c=e.length;s&&(u=Kt,o=!1,e=s);t:for(;++in&&(n=-n>i?0:i+n),r=r===E||r>i?i:+r||0,0>r&&(r+=i),i=n>r?0:r>>>0,n>>>=0;i>n;)t[n++]=e;return t}function De(t,e){var n=[];return Nu(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function Se(t,e,n,r){var i;return n(t,function(t,n,a){return e(t,n,a)?(i=r?n:t,!1):void 0}),i}function Ce(t,e,n,r){r||(r=[]);for(var i=-1,a=t.length;++ir;)t=t[e[r++]];return r&&r==i?t:E}}function Ne(t,e,n,r,i,a){return t===e?!0:null==t||null==e||!Ii(t)&&!m(e)?t!==t&&e!==e:Oe(t,e,Ne,n,r,i,a)}function Oe(t,e,n,r,i,a,u){var o=Co(t),s=Co(e),c=V,l=V;o||(c=nu.call(t),c==q?c=J:c!=J&&(o=zi(t))),s||(l=nu.call(e),l==q?l=J:l!=J&&(s=zi(e)));var h=c==J,f=l==J,d=c==l;if(d&&!o&&!h)return jn(t,e,c);if(!i){var p=h&&tu.call(t,"__wrapped__"),g=f&&tu.call(e,"__wrapped__");if(p||g)return n(p?t.value():t,g?e.value():e,r,i,a,u)}if(!d)return!1;a||(a=[]),u||(u=[]);for(var y=a.length;y--;)if(a[y]==t)return u[y]==e;a.push(t),u.push(e);var m=(o?Rn:Yn)(t,e,n,r,i,a,u);return a.pop(),u.pop(),m}function Pe(t,e,n){var r=e.length,i=r,a=!n;if(null==t)return!i;for(t=hr(t);r--;){var u=e[r];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++re&&(e=-e>i?0:i+e),n=n===E||n>i?i:+n||0,0>n&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=Ya(i);++r=Y,s=o?gn():null,c=[];s?(r=Kt,u=!1):(o=!1,s=e?[]:c);t:for(;++n=i){for(;i>r;){var a=r+i>>>1,u=t[a];(n?e>=u:e>u)&&null!==u?r=a+1:i=a}return i}return an(t,e,Da,n)}function an(t,e,n,r){e=n(e);for(var i=0,a=t?t.length:0,u=e!==e,o=null===e,s=e===E;a>i;){var c=mu((i+a)/2),l=n(t[c]),h=l!==E,f=l===l;if(u)var d=f||r;else d=o?f&&h&&(r||null!=l):s?f&&(r||h):null==l?!1:r?e>=l:e>l;d?i=c+1:a=c}return wu(a,Cu)}function un(t,e,n){if("function"!=typeof t)return Da;if(e===E)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,a){return t.call(e,n,r,i,a)};case 5:return function(n,r,i,a,u){return t.call(e,n,r,i,a,u)}}return function(){return t.apply(e,arguments)}}function on(t){var e=new au(t.byteLength),n=new du(e);return n.set(new du(t)),e}function sn(t,e,n){for(var r=n.length,i=-1,a=xu(t.length-r,0),u=-1,o=e.length,s=Ya(o+a);++u2?n[i-2]:E,u=i>2?n[2]:E,o=i>1?n[i-1]:E;for("function"==typeof a?(a=un(a,o,5),i-=2):(a="function"==typeof o?o:E,i-=a?1:0),u&&Jn(n[0],n[1],u)&&(a=3>i?E:a,i=1);++r-1?n[u]:E}return Se(n,r,t)}}function wn(t){return function(e,n,r){return e&&e.length?(n=Un(n,r,3),i(e,n,t)):-1}}function An(t){return function(e,n,r){return n=Un(n,r,3),Se(e,n,t,!0)}}function kn(t){return function(){for(var e,n=arguments.length,r=t?n:-1,i=0,a=Ya(n);t?r--:++r=Y)return e.plant(r).value();for(var i=0,u=n?a[i].apply(this,t):r;++iv){var k=o?te(o):E,M=xu(c-v,0),C=p?A:E,T=p?E:A,F=p?x:E,I=p?E:x;e|=p?B:L,e&=~(p?L:B),g||(e&=~(D|S));var N=[t,e,n,F,C,I,T,k,s,M],O=Bn.apply(E,N);return er(t)&&$u(O,N),O.placeholder=w,O}}var P=f?n:this,R=d?P[t]:t;return o&&(x=sr(x,o)),h&&s=e||!_u(e))return"";var i=e-r;return n=null==n?" ":n+"",ya(n,gu(i/n.length)).slice(0,i)}function In(t,e,n,r){function i(){for(var e=-1,o=arguments.length,s=-1,c=r.length,l=Ya(c+o);++ss))return!1;for(;++o-1&&t%1==0&&e>t}function Jn(t,e,n){if(!Ii(n))return!1;var r=typeof e;if("number"==r?Kn(n)&&Qn(e,n.length):"string"==r&&e in n){var i=n[e];return t===t?t===i:i!==i}return!1}function tr(t,e){var n=typeof t;if("string"==n&&Et.test(t)||"number"==n)return!0;if(Co(t))return!1;var r=!kt.test(t);return r||null!=e&&t in hr(e)}function er(t){var n=$n(t);if(!(n in K.prototype))return!1;var r=e[n];if(t===r)return!0;var i=Yu(r);return!!i&&t===i[0]}function nr(t){return"number"==typeof t&&t>-1&&t%1==0&&Fu>=t}function rr(t){return t===t&&!Ii(t)}function ir(t,e){var n=t[1],r=e[1],i=n|r,a=I>i,u=r==I&&n==T||r==I&&n==N&&t[7].length<=e[8]||r==(I|N)&&n==T;if(!a&&!u)return t;r&D&&(t[2]=e[2],i|=n&D?0:C);var o=e[3];if(o){var s=t[3];t[3]=s?sn(s,o,e[4]):te(o),t[4]=s?_(t[3],W):te(e[4])}return o=e[5],o&&(s=t[5],t[5]=s?cn(s,o,e[6]):te(o),t[6]=s?_(t[5],W):te(e[6])),o=e[7],o&&(t[7]=te(o)),r&I&&(t[8]=null==t[8]?e[8]:wu(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}function ar(t,e){return t===E?e:To(t,e,ar)}function ur(t,e){t=hr(t);for(var n=-1,r=e.length,i={};++nr;)u[++a]=Ge(t,r,r+=e);return u}function gr(t){for(var e=-1,n=t?t.length:0,r=-1,i=[];++ee?0:e)):[]}function mr(t,e,n){var r=t?t.length:0;return r?((n?Jn(t,e,n):null==e)&&(e=1),e=r-(+e||0),Ge(t,0,0>e?0:e)):[]}function vr(t,e,n){return t&&t.length?en(t,Un(e,n,3),!0,!0):[]}function _r(t,e,n){return t&&t.length?en(t,Un(e,n,3),!0):[]}function br(t,e,n,r){var i=t?t.length:0;return i?(n&&"number"!=typeof n&&Jn(t,e,n)&&(n=0,r=i),Me(t,e,n,r)):[]}function xr(t){return t?t[0]:E}function wr(t,e,n){var r=t?t.length:0;return n&&Jn(t,e,n)&&(e=!1),r?Ce(t,e):[]}function Ar(t){var e=t?t.length:0;return e?Ce(t,!0):[]}function kr(t,e,n){var r=t?t.length:0;if(!r)return-1;if("number"==typeof n)n=0>n?xu(r+n,0):n;else if(n){var i=rn(t,e);return r>i&&(e===e?e===t[i]:t[i]!==t[i])?i:-1}return a(t,e,n||0)}function Er(t){return mr(t,1)}function Mr(t){var e=t?t.length:0;return e?t[e-1]:E}function Dr(t,e,n){var r=t?t.length:0;if(!r)return-1;var i=r;if("number"==typeof n)i=(0>n?xu(r+n,0):wu(n||0,r-1))+1;else if(n){i=rn(t,e,!0)-1;var a=t[i];return(e===e?e===a:a!==a)?i:-1}if(e!==e)return y(t,i,!0);for(;i--;)if(t[i]===e)return i;return-1}function Sr(){var t=arguments,e=t[0];if(!e||!e.length)return e;for(var n=0,r=zn(),i=t.length;++n-1;)fu.call(e,a,1);return e}function Cr(t,e,n){var r=[];if(!t||!t.length)return r;var i=-1,a=[],u=t.length;for(e=Un(e,n,3);++ie?0:e)):[]}function Lr(t,e,n){var r=t?t.length:0;return r?((n?Jn(t,e,n):null==e)&&(e=1),e=r-(+e||0),Ge(t,0>e?0:e)):[]}function Ir(t,e,n){return t&&t.length?en(t,Un(e,n,3),!1,!0):[]}function Nr(t,e,n){return t&&t.length?en(t,Un(e,n,3)):[]}function Or(t,e,n,r){var i=t?t.length:0;if(!i)return[];null!=e&&"boolean"!=typeof e&&(r=n,n=Jn(t,e,r)?E:e,e=!1);var u=Un();return(null!=n||u!==be)&&(n=u(n,r,3)),e&&zn()==a?b(t,n):Je(t,n)}function Pr(t){if(!t||!t.length)return[];var e=-1,n=0;t=oe(t,function(t){return Kn(t)?(n=xu(t.length,n),!0):void 0});for(var r=Ya(n);++en?xu(i+n,0):n||0,"string"==typeof t||!Co(t)&&$i(t)?i>=n&&t.indexOf(e,n)>-1:!!i&&zn(t,e,n)>-1}function ti(t,e,n){var r=Co(t)?se:Re;return e=Un(e,n,3),r(t,e)}function ei(t,e){return ti(t,La(e))}function ni(t,e,n){var r=Co(t)?oe:De;return e=Un(e,n,3),r(t,function(t,n,r){return!e(t,n,r)})}function ri(t,e,n){if(n?Jn(t,e,n):null==e){t=lr(t);var r=t.length;return r>0?t[Ve(0,r-1)]:E}var i=-1,a=Hi(t),r=a.length,u=r-1;for(e=wu(0>e?0:+e||0,r);++i0&&(n=e.apply(this,arguments)),1>=t&&(e=E),n}}function di(t,e,n){function r(){d&&uu(d),c&&uu(c),g=0,c=d=p=E}function i(e,n){n&&uu(n),c=d=p=E,e&&(g=go(),l=t.apply(f,s),d||c||(s=f=E))}function a(){var t=e-(go()-h);0>=t||t>e?i(p,c):d=hu(a,t)}function u(){i(m,d)}function o(){if(s=arguments,h=go(),f=this,p=m&&(d||!v),y===!1)var n=v&&!d;else{c||v||(g=h);var r=y-(h-g),i=0>=r||r>y;i?(c&&(c=uu(c)),g=h,l=t.apply(f,s)):c||(c=hu(u,r))}return i&&d?d=uu(d):d||e===y||(d=hu(a,e)),n&&(i=!0,l=t.apply(f,s)),!i||d||c||(s=f=E),l}var s,c,l,h,f,d,p,g=0,y=!1,m=!0;if("function"!=typeof t)throw new Xa(z);if(e=0>e?0:+e||0,n===!0){var v=!0;m=!1}else Ii(n)&&(v=!!n.leading,y="maxWait"in n&&xu(+n.maxWait||0,e),m="trailing"in n?!!n.trailing:m);return o.cancel=r,o}function pi(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new Xa(z);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var u=t.apply(this,r);return n.cache=a.set(i,u),u};return n.cache=new pi.Cache,n}function gi(t){if("function"!=typeof t)throw new Xa(z);return function(){return!t.apply(this,arguments)}}function yi(t){return fi(2,t)}function mi(t,e){if("function"!=typeof t)throw new Xa(z);return e=xu(e===E?t.length-1:+e||0,0),function(){for(var n=arguments,r=-1,i=xu(n.length-e,0),a=Ya(i);++re}function ki(t,e){return t>=e}function Ei(t){return m(t)&&Kn(t)&&tu.call(t,"callee")&&!cu.call(t,"callee")}function Mi(t){return t===!0||t===!1||m(t)&&nu.call(t)==H}function Di(t){return m(t)&&nu.call(t)==G}function Si(t){return!!t&&1===t.nodeType&&m(t)&&!Yi(t)}function Ci(t){return null==t?!0:Kn(t)&&(Co(t)||$i(t)||Ei(t)||m(t)&&Li(t.splice))?!t.length:!Yo(t).length}function Ti(t,e,n,r){n="function"==typeof n?un(n,r,3):E;var i=n?n(t,e):E;return i===E?Ne(t,e,n):!!i}function Fi(t){return m(t)&&"string"==typeof t.message&&nu.call(t)==X}function Bi(t){return"number"==typeof t&&_u(t)}function Li(t){return Ii(t)&&nu.call(t)==Z}function Ii(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Ni(t,e,n,r){return n="function"==typeof n?un(n,r,3):E,Pe(t,Wn(e),n)}function Oi(t){return ji(t)&&t!=+t}function Pi(t){return null==t?!1:Li(t)?iu.test(Ja.call(t)):m(t)&&It.test(t)}function Ri(t){return null===t}function ji(t){return"number"==typeof t||m(t)&&nu.call(t)==Q}function Yi(t){var e;if(!m(t)||nu.call(t)!=J||Ei(t)||!tu.call(t,"constructor")&&(e=t.constructor,"function"==typeof e&&!(e instanceof e)))return!1;var n;return Te(t,function(t,e){n=e}),n===E||tu.call(t,n)}function Ui(t){return Ii(t)&&nu.call(t)==tt}function $i(t){return"string"==typeof t||m(t)&&nu.call(t)==nt}function zi(t){return m(t)&&nr(t.length)&&!!$t[nu.call(t)]}function Wi(t){return t===E}function qi(t,e){return e>t}function Vi(t,e){return e>=t}function Hi(t){var e=t?Uu(t):0;return nr(e)?e?te(t):[]:aa(t)}function Gi(t){return _e(t,ta(t))}function Xi(t,e,n){var r=Iu(t);return n&&Jn(t,e,n)&&(e=E),e?me(r,e):r}function Zi(t){return Le(t,ta(t))}function Ki(t,e,n){var r=null==t?E:Ie(t,fr(e),e+"");return r===E?n:r}function Qi(t,e){if(null==t)return!1;var n=tu.call(t,e);if(!n&&!tr(e)){if(e=fr(e),t=1==e.length?t:Ie(t,Ge(e,0,-1)),null==t)return!1;e=Mr(e),n=tu.call(t,e)}return n||nr(t.length)&&Qn(e,t.length)&&(Co(t)||Ei(t))}function Ji(t,e,n){n&&Jn(t,e,n)&&(e=E);for(var r=-1,i=Yo(t),a=i.length,u={};++r0;++r=wu(e,n)&&tn?0:+n||0,r),n-=e.length,n>=0&&t.indexOf(e,n)==n}function fa(t){return t=o(t),t&&bt.test(t)?t.replace(vt,d):t}function da(t){return t=o(t),t&&St.test(t)?t.replace(Dt,p):t||"(?:)"}function pa(t,e,n){t=o(t),e=+e;var r=t.length;if(r>=e||!_u(e))return t;var i=(e-r)/2,a=mu(i),u=gu(i);return n=Ln("",u,n),n.slice(0,a)+t+n}function ga(t,e,n){return(n?Jn(t,e,n):null==e)?e=0:e&&(e=+e),t=_a(t),ku(t,e||(Lt.test(t)?16:10))}function ya(t,e){var n="";if(t=o(t),e=+e,1>e||!t||!_u(e))return n;do e%2&&(n+=t),e=mu(e/2),t+=t;while(e);return n}function ma(t,e,n){return t=o(t),n=null==n?0:wu(0>n?0:+n||0,t.length),t.lastIndexOf(e,n)==n}function va(t,n,r){var i=e.templateSettings;r&&Jn(t,n,r)&&(n=r=E),t=o(t),n=ye(me({},r||n),i,ge);var a,u,s=ye(me({},n.imports),i.imports,ge),c=Yo(s),l=tn(s,c),h=0,f=n.interpolate||Pt,d="__p += '",p=Ha((n.escape||Pt).source+"|"+f.source+"|"+(f===At?Ft:Pt).source+"|"+(n.evaluate||Pt).source+"|$","g"),y="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++Ut+"]")+"\n";t.replace(p,function(e,n,r,i,o,s){return r||(r=i),d+=t.slice(h,s).replace(Rt,g),n&&(a=!0,d+="' +\n__e("+n+") +\n'"),o&&(u=!0,d+="';\n"+o+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),h=s+e.length,e}),d+="';\n";var m=n.variable;m||(d="with (obj) {\n"+d+"\n}\n"),d=(u?d.replace(pt,""):d).replace(gt,"$1").replace(yt,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=Ko(function(){return za(c,y+"return "+d).apply(E,l)});if(v.source=d,Fi(v))throw v;return v}function _a(t,e,n){var r=t;return(t=o(t))?(n?Jn(r,e,n):null==e)?t.slice(x(t),w(t)+1):(e+="",t.slice(s(t,e),c(t,e)+1)):t}function ba(t,e,n){var r=t;return t=o(t),t?t.slice((n?Jn(r,e,n):null==e)?x(t):s(t,e+"")):t}function xa(t,e,n){var r=t;return t=o(t),t?(n?Jn(r,e,n):null==e)?t.slice(0,w(t)+1):t.slice(0,c(t,e+"")+1):t}function wa(t,e,n){n&&Jn(t,e,n)&&(e=E);var r=O,i=P;if(null!=e)if(Ii(e)){var a="separator"in e?e.separator:a;r="length"in e?+e.length||0:r,i="omission"in e?o(e.omission):i}else r=+e||0;if(t=o(t),r>=t.length)return t;var u=r-i.length;if(1>u)return i;var s=t.slice(0,u);if(null==a)return s+i;if(Ui(a)){if(t.slice(u).search(a)){var c,l,h=t.slice(0,u);for(a.global||(a=Ha(a.source,(Bt.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(h);)l=c.index;s=s.slice(0,null==l?u:l)}}else if(t.indexOf(a,u)!=u){var f=s.lastIndexOf(a);f>-1&&(s=s.slice(0,f))}return s+i}function Aa(t){return t=o(t),t&&_t.test(t)?t.replace(mt,A):t}function ka(t,e,n){return n&&Jn(t,e,n)&&(e=E),t=o(t),t.match(e||jt)||[]}function Ea(t,e,n){return n&&Jn(t,e,n)&&(e=E),m(t)?Sa(t):be(t,e)}function Ma(t){return function(){return t}}function Da(t){return t}function Sa(t){return je(xe(t,!0))}function Ca(t,e){return Ye(t,xe(e,!0))}function Ta(t,e,n){if(null==n){var r=Ii(e),i=r?Yo(e):E,a=i&&i.length?Le(e,i):E;(a?a.length:r)||(a=!1,n=e,e=t,t=this)}a||(a=Le(e,Yo(e)));var u=!0,o=-1,s=Li(t),c=a.length;n===!1?u=!1:Ii(n)&&"chain"in n&&(u=n.chain);for(;++ot||!_u(t))return[];var r=-1,i=Ya(wu(t,Su));for(e=un(e,n,1);++rr?i[r]=e(r):e(r);return i}function Pa(t){var e=++eu;return o(t)+e}function Ra(t,e){return(+t||0)+(+e||0)}function ja(t,e,n){return n&&Jn(t,e,n)&&(e=E),e=Un(e,n,3),1==e.length?de(Co(t)?t:lr(t),e):Qe(t,e)}t=t?re.defaults(ne.Object(),t,re.pick(ne,Yt)):ne;{var Ya=t.Array,Ua=t.Date,$a=t.Error,za=t.Function,Wa=t.Math,qa=t.Number,Va=t.Object,Ha=t.RegExp,Ga=t.String,Xa=t.TypeError,Za=Ya.prototype,Ka=Va.prototype,Qa=Ga.prototype,Ja=za.prototype.toString,tu=Ka.hasOwnProperty,eu=0,nu=Ka.toString,ru=ne._,iu=Ha("^"+Ja.call(tu).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),au=t.ArrayBuffer,uu=t.clearTimeout,ou=t.parseFloat,su=Wa.pow,cu=Ka.propertyIsEnumerable,lu=qn(t,"Set"),hu=t.setTimeout,fu=Za.splice,du=t.Uint8Array,pu=qn(t,"WeakMap"),gu=Wa.ceil,yu=qn(Va,"create"),mu=Wa.floor,vu=qn(Ya,"isArray"),_u=t.isFinite,bu=qn(Va,"keys"),xu=Wa.max,wu=Wa.min,Au=qn(Ua,"now"),ku=t.parseInt,Eu=Wa.random,Mu=qa.NEGATIVE_INFINITY,Du=qa.POSITIVE_INFINITY,Su=4294967295,Cu=Su-1,Tu=Su>>>1,Fu=9007199254740991,Bu=pu&&new pu,Lu={};e.support={}}e.templateSettings={escape:xt,evaluate:wt,interpolate:At,variable:"",imports:{_:e}};var Iu=function(){function t(){}return function(e){if(Ii(e)){t.prototype=e;var n=new t;t.prototype=E}return n||{}}}(),Nu=fn(Fe),Ou=fn(Be,!0),Pu=dn(),Ru=dn(!0),ju=Bu?function(t,e){return Bu.set(t,e),t}:Da,Yu=Bu?function(t){return Bu.get(t)}:Ba,Uu=ze("length"),$u=function(){var t=0,e=0;return function(n,r){var i=go(),a=j-(i-e);if(e=i,a>0){if(++t>=R)return n}else t=0;return ju(n,r)}}(),zu=mi(function(t,e){return m(t)&&Kn(t)?Ae(t,Ce(e,!1,!0)):[]}),Wu=wn(),qu=wn(!0),Vu=mi(function(t){for(var e=t.length,n=e,r=Ya(h),i=zn(),u=i==a,o=[];n--;){var s=t[n]=Kn(s=t[n])?s:[];r[n]=u&&s.length>=120?gn(n&&s):null}var c=t[0],l=-1,h=c?c.length:0,f=r[0];t:for(;++l2?t[e-2]:E,r=e>1?t[e-1]:E;return e>2&&"function"==typeof n?e-=2:(n=e>1&&"function"==typeof r?(--e,r):E,r=E),t.length=e,Rr(t,n,r)}),to=mi(function(t){return t=Ce(t),this.thru(function(e){return Jt(Co(e)?e:[hr(e)],t)})}),eo=mi(function(t,e){return ve(t,Ce(e))}),no=ln(function(t,e,n){tu.call(t,n)?++t[n]:t[n]=1}),ro=xn(Nu),io=xn(Ou,!0),ao=En(ee,Nu),uo=En(ie,Ou),oo=ln(function(t,e,n){tu.call(t,n)?t[n].push(e):t[n]=[e]}),so=ln(function(t,e,n){t[n]=e}),co=mi(function(t,e,n){var r=-1,i="function"==typeof e,a=tr(e),u=Kn(t)?Ya(t.length):[];return Nu(t,function(t){var o=i?e:a&&null!=t?t[e]:E;u[++r]=o?o.apply(t,n):Zn(t,e,n)}),u}),lo=ln(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),ho=Fn(le,Nu),fo=Fn(he,Ou),po=mi(function(t,e){if(null==t)return[];var n=e[2];return n&&Jn(e[0],e[1],n)&&(e.length=1),Ke(t,Ce(e),[])}),go=Au||function(){return(new Ua).getTime()},yo=mi(function(t,e,n){var r=D;if(n.length){var i=_(n,yo.placeholder);r|=B}return Pn(t,r,e,n,i)}),mo=mi(function(t,e){e=e.length?Ce(e):Zi(t);for(var n=-1,r=e.length;++n0||0>e)?new K(n):(0>t?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==E&&(e=+e||0,n=0>e?n.dropRight(-e):n.take(e-t)),n)},K.prototype.takeRightWhile=function(t,e){return this.reverse().takeWhile(t,e).reverse()},K.prototype.toArray=function(){return this.take(Du)},Fe(K.prototype,function(t,n){var r=/^(?:filter|map|reject)|While$/.test(n),i=/^(?:first|last)$/.test(n),a=e[i?"take"+("last"==n?"Right":""):n];a&&(e.prototype[n]=function(){var e=i?[1]:arguments,n=this.__chain__,u=this.__wrapped__,o=!!this.__actions__.length,s=u instanceof K,c=e[0],l=s||Co(u);l&&r&&"function"==typeof c&&1!=c.length&&(s=l=!1);var h=function(t){return i&&n?a(t,1)[0]:a.apply(E,ce([t],e))},f={func:zr,args:[h],thisArg:E},d=s&&!o;if(i&&!n)return d?(u=u.clone(),u.__actions__.push(f),t.call(u)):a.call(E,this.value())[0];if(!i&&l){u=d?u:new K(this);var p=t.apply(u,e);return p.__actions__.push(f),new v(p,n)}return this.thru(h)})}),ee(["join","pop","push","replace","shift","sort","splice","split","unshift"],function(t){var n=(/^(?:replace|split)$/.test(t)?Qa:Za)[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:join|pop|replace|shift)$/.test(t);e.prototype[t]=function(){var t=arguments;return i&&!this.__chain__?n.apply(this.value(),t):this[r](function(e){return n.apply(e,t)})}}),Fe(K.prototype,function(t,n){var r=e[n];if(r){var i=r.name,a=Lu[i]||(Lu[i]=[]);a.push({name:n,func:r})}}),Lu[Bn(E,S).name]=[{name:"wrapper",func:E}],K.prototype.clone=et,K.prototype.reverse=rt,K.prototype.value=Wt,e.prototype.chain=Wr,e.prototype.commit=qr,e.prototype.concat=to,e.prototype.plant=Vr,e.prototype.reverse=Hr,e.prototype.toString=Gr,e.prototype.run=e.prototype.toJSON=e.prototype.valueOf=e.prototype.value=Xr,e.prototype.collect=e.prototype.map,e.prototype.head=e.prototype.first,e.prototype.select=e.prototype.filter,e.prototype.tail=e.prototype.rest,e}var E,M="3.10.1",D=1,S=2,C=4,T=8,F=16,B=32,L=64,I=128,N=256,O=30,P="...",R=150,j=16,Y=200,U=1,$=2,z="Expected a function",W="__lodash_placeholder__",q="[object Arguments]",V="[object Array]",H="[object Boolean]",G="[object Date]",X="[object Error]",Z="[object Function]",K="[object Map]",Q="[object Number]",J="[object Object]",tt="[object RegExp]",et="[object Set]",nt="[object String]",rt="[object WeakMap]",it="[object ArrayBuffer]",at="[object Float32Array]",ut="[object Float64Array]",ot="[object Int8Array]",st="[object Int16Array]",ct="[object Int32Array]",lt="[object Uint8Array]",ht="[object Uint8ClampedArray]",ft="[object Uint16Array]",dt="[object Uint32Array]",pt=/\b__p \+= '';/g,gt=/\b(__p \+=) '' \+/g,yt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mt=/&(?:amp|lt|gt|quot|#39|#96);/g,vt=/[&<>"'`]/g,_t=RegExp(mt.source),bt=RegExp(vt.source),xt=/<%-([\s\S]+?)%>/g,wt=/<%([\s\S]+?)%>/g,At=/<%=([\s\S]+?)%>/g,kt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,Et=/^\w*$/,Mt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,Dt=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,St=RegExp(Dt.source),Ct=/[\u0300-\u036f\ufe20-\ufe23]/g,Tt=/\\(\\)?/g,Ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Bt=/\w*$/,Lt=/^0[xX]/,It=/^\[object .+?Constructor\]$/,Nt=/^\d+$/,Ot=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Pt=/($^)/,Rt=/['\n\r\u2028\u2029\\]/g,jt=function(){var t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",e="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(t+"+(?="+t+e+")|"+t+"?"+e+"|"+t+"+|[0-9]+","g")}(),Yt=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Ut=-1,$t={};$t[at]=$t[ut]=$t[ot]=$t[st]=$t[ct]=$t[lt]=$t[ht]=$t[ft]=$t[dt]=!0,$t[q]=$t[V]=$t[it]=$t[H]=$t[G]=$t[X]=$t[Z]=$t[K]=$t[Q]=$t[J]=$t[tt]=$t[et]=$t[nt]=$t[rt]=!1;var zt={};zt[q]=zt[V]=zt[it]=zt[H]=zt[G]=zt[at]=zt[ut]=zt[ot]=zt[st]=zt[ct]=zt[Q]=zt[J]=zt[tt]=zt[nt]=zt[lt]=zt[ht]=zt[ft]=zt[dt]=!0,zt[X]=zt[Z]=zt[K]=zt[et]=zt[rt]=!1;var Wt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},qt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Vt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ht={"function":!0,object:!0},Gt={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Xt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Zt=Ht[typeof n]&&n&&!n.nodeType&&n,Kt=Ht[typeof e]&&e&&!e.nodeType&&e,Qt=Zt&&Kt&&"object"==typeof t&&t&&t.Object&&t,Jt=Ht[typeof self]&&self&&self.Object&&self,te=Ht[typeof window]&&window&&window.Object&&window,ee=Kt&&Kt.exports===Zt&&Zt,ne=Qt||te!==(this&&this.window)&&te||Jt||this,re=k();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(ne._=re,define(function(){return re})):Zt&&Kt?ee?(Kt.exports=re)._=re:Zt._=re:ne._=re}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],82:[function(t,e,n){!function(t,r){"object"==typeof n&&"undefined"!=typeof e?e.exports=r():"function"==typeof define&&define.amd?define(r):t.moment=r()}(this,function(){"use strict";function n(){return tr.apply(null,arguments)}function r(t){tr=t}function i(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function a(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function u(t,e){var n,r=[];for(n=0;n0)for(n in er)r=er[n],i=e[r],p(i)||(t[r]=i);return t}function y(t){g(this,t),this._d=new Date(null!=t._d?t._d.getTime():0/0),nr===!1&&(nr=!0,n.updateOffset(this),nr=!1)}function m(t){return t instanceof y||null!=t&&null!=t._isAMomentObject}function v(t){return 0>t?Math.ceil(t):Math.floor(t)}function _(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=v(e)),n}function b(t,e,n){var r,i=Math.min(t.length,e.length),a=Math.abs(t.length-e.length),u=0;for(r=0;i>r;r++)(n&&t[r]!==e[r]||!n&&_(t[r])!==_(e[r]))&&u++;return u+a}function x(t){n.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function w(t,e){var n=!0;return s(function(){return n&&(x(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),n=!1),e.apply(this,arguments)},e)}function A(t,e){rr[t]||(x(e),rr[t]=!0)}function k(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function E(t){return"[object Object]"===Object.prototype.toString.call(t)}function M(t){var e,n;for(n in t)e=t[n],k(e)?this[n]=e:this["_"+n]=e;this._config=t,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function D(t,e){var n,r=s({},t);for(n in e)o(e,n)&&(E(t[n])&&E(e[n])?(r[n]={},s(r[n],t[n]),s(r[n],e[n])):null!=e[n]?r[n]=e[n]:delete r[n]);return r}function S(t){null!=t&&this.set(t)}function C(t){return t?t.toLowerCase().replace("_","-"):t}function T(t){for(var e,n,r,i,a=0;a0;){if(r=F(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&b(i,n,!0)>=e-1)break;e--}a++}return null}function F(n){var r=null;if(!ar[n]&&"undefined"!=typeof e&&e&&e.exports)try{r=ir._abbr,t("./locale/"+n),B(r)}catch(i){}return ar[n]}function B(t,e){var n;return t&&(n=p(e)?N(t):L(t,e),n&&(ir=n)),ir._abbr}function L(t,e){return null!==e?(e.abbr=t,null!=ar[t]?(A("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),e=D(ar[t]._config,e)):null!=e.parentLocale&&(null!=ar[e.parentLocale]?e=D(ar[e.parentLocale]._config,e):A("parentLocaleUndefined","specified parentLocale is not defined yet")),ar[t]=new S(e),B(t),ar[t]):(delete ar[t],null)}function I(t,e){if(null!=e){var n;null!=ar[t]&&(e=D(ar[t]._config,e)),n=new S(e),n.parentLocale=ar[t],ar[t]=n,B(t)}else null!=ar[t]&&(null!=ar[t].parentLocale?ar[t]=ar[t].parentLocale:null!=ar[t]&&delete ar[t]);return ar[t]}function N(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return ir;if(!i(t)){if(e=F(t))return e;t=[t]}return T(t)}function O(){return Object.keys(ar)}function P(t,e){var n=t.toLowerCase();ur[n]=ur[n+"s"]=ur[e]=t}function R(t){return"string"==typeof t?ur[t]||ur[t.toLowerCase()]:void 0}function j(t){var e,n,r={};for(n in t)o(t,n)&&(e=R(n),e&&(r[e]=t[n]));return r}function Y(t,e){return function(r){return null!=r?($(this,t,r),n.updateOffset(this,e),this):U(this,t)}}function U(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():0/0}function $(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function z(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if(t=R(t),k(this[t]))return this[t](e);return this}function W(t,e,n){var r=""+Math.abs(t),i=e-r.length,a=t>=0;return(a?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}function q(t,e,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),t&&(lr[t]=i),e&&(lr[e[0]]=function(){return W(i.apply(this,arguments),e[1],e[2])}),n&&(lr[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function V(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function H(t){var e,n,r=t.match(or);for(e=0,n=r.length;n>e;e++)r[e]=lr[r[e]]?lr[r[e]]:V(r[e]);return function(i){var a="";for(e=0;n>e;e++)a+=r[e]instanceof Function?r[e].call(i,t):r[e];return a}}function G(t,e){return t.isValid()?(e=X(e,t.localeData()),cr[e]=cr[e]||H(e),cr[e](t)):t.localeData().invalidDate()}function X(t,e){function n(t){return e.longDateFormat(t)||t}var r=5;for(sr.lastIndex=0;r>=0&&sr.test(t);)t=t.replace(sr,n),sr.lastIndex=0,r-=1;return t}function Z(t,e,n){Sr[t]=k(e)?e:function(t){return t&&n?n:e}}function K(t,e){return o(Sr,t)?Sr[t](e._strict,e._locale):new RegExp(Q(t))}function Q(t){return J(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,r,i){return e||n||r||i}))}function J(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function tt(t,e){var n,r=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(r=function(t,n){n[e]=_(t)}),n=0;nr;r++){if(i=c([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[r].test(t))return r;if(n&&"MMM"===e&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function ot(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=_(e);else if(e=t.localeData().monthsParse(e),"number"!=typeof e)return t;return n=Math.min(t.date(),rt(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function st(t){return null!=t?(ot(this,t),n.updateOffset(this,!0),this):U(this,"Month")}function ct(){return rt(this.year(),this.month())}function lt(t){return this._monthsParseExact?(o(this,"_monthsRegex")||ft.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex}function ht(t){return this._monthsParseExact?(o(this,"_monthsRegex")||ft.call(this),t?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex}function ft(){function t(t,e){return e.length-t.length}var e,n,r=[],i=[],a=[];for(e=0;12>e;e++)n=c([2e3,e]),r.push(this.monthsShort(n,"")),i.push(this.months(n,"")),a.push(this.months(n,"")),a.push(this.monthsShort(n,""));for(r.sort(t),i.sort(t),a.sort(t),e=0;12>e;e++)r[e]=J(r[e]),i[e]=J(i[e]),a[e]=J(a[e]);this._monthsRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")$","i")}function dt(t){var e,n=t._a;return n&&-2===h(t).overflow&&(e=n[Fr]<0||n[Fr]>11?Fr:n[Br]<1||n[Br]>rt(n[Tr],n[Fr])?Br:n[Lr]<0||n[Lr]>24||24===n[Lr]&&(0!==n[Ir]||0!==n[Nr]||0!==n[Or])?Lr:n[Ir]<0||n[Ir]>59?Ir:n[Nr]<0||n[Nr]>59?Nr:n[Or]<0||n[Or]>999?Or:-1,h(t)._overflowDayOfYear&&(Tr>e||e>Br)&&(e=Br),h(t)._overflowWeeks&&-1===e&&(e=Pr),h(t)._overflowWeekday&&-1===e&&(e=Rr),h(t).overflow=e),t}function pt(t){var e,n,r,i,a,u,o=t._i,s=Wr.exec(o)||qr.exec(o);if(s){for(h(t).iso=!0,e=0,n=Hr.length;n>e;e++)if(Hr[e][1].exec(s[1])){i=Hr[e][0],r=Hr[e][2]!==!1;break}if(null==i)return void(t._isValid=!1);if(s[3]){for(e=0,n=Gr.length;n>e;e++)if(Gr[e][1].exec(s[3])){a=(s[2]||" ")+Gr[e][0];break}if(null==a)return void(t._isValid=!1)}if(!r&&null!=a)return void(t._isValid=!1);if(s[4]){if(!Vr.exec(s[4]))return void(t._isValid=!1);u="Z"}t._f=i+(a||"")+(u||""),Ct(t)}else t._isValid=!1}function gt(t){var e=Xr.exec(t._i);return null!==e?void(t._d=new Date(+e[1])):(pt(t),void(t._isValid===!1&&(delete t._isValid,n.createFromInputFallback(t))))}function yt(t,e,n,r,i,a,u){var o=new Date(t,e,n,r,i,a,u);return 100>t&&t>=0&&isFinite(o.getFullYear())&&o.setFullYear(t),o}function mt(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function vt(t){return _t(t)?366:365}function _t(t){return t%4===0&&t%100!==0||t%400===0}function bt(){return _t(this.year())}function xt(t,e,n){var r=7+e-n,i=(7+mt(t,0,r).getUTCDay()-e)%7;return-i+r-1}function wt(t,e,n,r,i){var a,u,o=(7+n-r)%7,s=xt(t,r,i),c=1+7*(e-1)+o+s;return 0>=c?(a=t-1,u=vt(a)+c):c>vt(t)?(a=t+1,u=c-vt(t)):(a=t,u=c),{year:a,dayOfYear:u}}function At(t,e,n){var r,i,a=xt(t.year(),e,n),u=Math.floor((t.dayOfYear()-a-1)/7)+1;return 1>u?(i=t.year()-1,r=u+kt(i,e,n)):u>kt(t.year(),e,n)?(r=u-kt(t.year(),e,n),i=t.year()+1):(i=t.year(),r=u),{week:r,year:i}}function kt(t,e,n){var r=xt(t,e,n),i=xt(t+1,e,n);return(vt(t)-r+i)/7}function Et(t,e,n){return null!=t?t:null!=e?e:n}function Mt(t){var e=new Date(n.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Dt(t){var e,n,r,i,a=[];if(!t._d){for(r=Mt(t),t._w&&null==t._a[Br]&&null==t._a[Fr]&&St(t),t._dayOfYear&&(i=Et(t._a[Tr],r[Tr]),t._dayOfYear>vt(i)&&(h(t)._overflowDayOfYear=!0),n=mt(i,0,t._dayOfYear),t._a[Fr]=n.getUTCMonth(),t._a[Br]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=a[e]=r[e];for(;7>e;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Lr]&&0===t._a[Ir]&&0===t._a[Nr]&&0===t._a[Or]&&(t._nextDay=!0,t._a[Lr]=0),t._d=(t._useUTC?mt:yt).apply(null,a),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Lr]=24)}}function St(t){var e,n,r,i,a,u,o,s;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(a=1,u=4,n=Et(e.GG,t._a[Tr],At(Pt(),1,4).year),r=Et(e.W,1),i=Et(e.E,1),(1>i||i>7)&&(s=!0)):(a=t._locale._week.dow,u=t._locale._week.doy,n=Et(e.gg,t._a[Tr],At(Pt(),a,u).year),r=Et(e.w,1),null!=e.d?(i=e.d,(0>i||i>6)&&(s=!0)):null!=e.e?(i=e.e+a,(e.e<0||e.e>6)&&(s=!0)):i=a),1>r||r>kt(n,a,u)?h(t)._overflowWeeks=!0:null!=s?h(t)._overflowWeekday=!0:(o=wt(n,r,i,a,u),t._a[Tr]=o.year,t._dayOfYear=o.dayOfYear)}function Ct(t){if(t._f===n.ISO_8601)return void pt(t);t._a=[],h(t).empty=!0;var e,r,i,a,u,o=""+t._i,s=o.length,c=0;for(i=X(t._f,t._locale).match(or)||[],e=0;e0&&h(t).unusedInput.push(u),o=o.slice(o.indexOf(r)+r.length),c+=r.length),lr[a]?(r?h(t).empty=!1:h(t).unusedTokens.push(a),nt(a,r,t)):t._strict&&!r&&h(t).unusedTokens.push(a);h(t).charsLeftOver=s-c,o.length>0&&h(t).unusedInput.push(o),h(t).bigHour===!0&&t._a[Lr]<=12&&t._a[Lr]>0&&(h(t).bigHour=void 0),t._a[Lr]=Tt(t._locale,t._a[Lr],t._meridiem),Dt(t),dt(t)}function Tt(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(r=t.isPM(n),r&&12>e&&(e+=12),r||12!==e||(e=0),e):e}function Ft(t){var e,n,r,i,a;if(0===t._f.length)return h(t).invalidFormat=!0,void(t._d=new Date(0/0));for(i=0;ia)&&(r=a,n=e));s(t,n||e)}function Bt(t){if(!t._d){var e=j(t._i);t._a=u([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),Dt(t)}}function Lt(t){var e=new y(dt(It(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function It(t){var e=t._i,n=t._f;return t._locale=t._locale||N(t._l),null===e||void 0===n&&""===e?d({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),m(e)?new y(dt(e)):(i(n)?Ft(t):n?Ct(t):a(e)?t._d=e:Nt(t),f(t)||(t._d=null),t))}function Nt(t){var e=t._i;void 0===e?t._d=new Date(n.now()):a(e)?t._d=new Date(+e):"string"==typeof e?gt(t):i(e)?(t._a=u(e.slice(0),function(t){return parseInt(t,10)}),Dt(t)):"object"==typeof e?Bt(t):"number"==typeof e?t._d=new Date(e):n.createFromInputFallback(t)}function Ot(t,e,n,r,i){var a={};return"boolean"==typeof n&&(r=n,n=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=t,a._f=e,a._strict=r,Lt(a)}function Pt(t,e,n,r){return Ot(t,e,n,r,!1)}function Rt(t,e){var n,r;if(1===e.length&&i(e[0])&&(e=e[0]),!e.length)return Pt();for(n=e[0],r=1;rt&&(t=-t,n="-"),n+W(~~(t/60),2)+e+W(~~t%60,2)})}function Wt(t,e){var n=(e||"").match(t)||[],r=n[n.length-1]||[],i=(r+"").match(ti)||["-",0,0],a=+(60*i[1])+_(i[2]);return"+"===i[0]?a:-a}function qt(t,e){var r,i;return e._isUTC?(r=e.clone(),i=(m(t)||a(t)?+t:+Pt(t))-+r,r._d.setTime(+r._d+i),n.updateOffset(r,!1),r):Pt(t).local()}function Vt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Ht(t,e){var r,i=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=Wt(Er,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&e&&(r=Vt(this)),this._offset=t,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==t&&(!e||this._changeInProgress?le(this,ie(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:Vt(this):null!=t?this:0/0}function Gt(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Xt(t){return this.utcOffset(0,t)}function Zt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Vt(this),"m")),this}function Kt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Wt(kr,this._i)),this}function Qt(t){return this.isValid()?(t=t?Pt(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function Jt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function te(){if(!p(this._isDSTShifted))return this._isDSTShifted;var t={};if(g(t,this),t=It(t),t._a){var e=t._isUTC?c(t._a):Pt(t._a);this._isDSTShifted=this.isValid()&&b(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function ee(){return this.isValid()?!this._isUTC:!1}function ne(){return this.isValid()?this._isUTC:!1}function re(){return this.isValid()?this._isUTC&&0===this._offset:!1}function ie(t,e){var n,r,i,a=t,u=null;return $t(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(a={},e?a[e]=t:a.milliseconds=t):(u=ei.exec(t))?(n="-"===u[1]?-1:1,a={y:0,d:_(u[Br])*n,h:_(u[Lr])*n,m:_(u[Ir])*n,s:_(u[Nr])*n,ms:_(u[Or])*n}):(u=ni.exec(t))?(n="-"===u[1]?-1:1,a={y:ae(u[2],n),M:ae(u[3],n),w:ae(u[4],n),d:ae(u[5],n),h:ae(u[6],n),m:ae(u[7],n),s:ae(u[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(i=oe(Pt(a.from),Pt(a.to)),a={},a.ms=i.milliseconds,a.M=i.months),r=new Ut(a),$t(t)&&o(t,"_locale")&&(r._locale=t._locale),r}function ae(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function ue(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function oe(t,e){var n;return t.isValid()&&e.isValid()?(e=qt(e,t),t.isBefore(e)?n=ue(t,e):(n=ue(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function se(t){return 0>t?-1*Math.round(-1*t):Math.round(t)}function ce(t,e){return function(n,r){var i,a;return null===r||isNaN(+r)||(A(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),a=n,n=r,r=a),n="string"==typeof n?+n:n,i=ie(n,r),le(this,i,t),this}}function le(t,e,r,i){var a=e._milliseconds,u=se(e._days),o=se(e._months);t.isValid()&&(i=null==i?!0:i,a&&t._d.setTime(+t._d+a*r),u&&$(t,"Date",U(t,"Date")+u*r),o&&ot(t,U(t,"Month")+o*r),i&&n.updateOffset(t,u||o))}function he(t,e){var n=t||Pt(),r=qt(n,this).startOf("day"),i=this.diff(r,"days",!0),a=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse",u=e&&(k(e[a])?e[a]():e[a]);return this.format(u||this.localeData().calendar(a,this,Pt(n)))}function fe(){return new y(this)}function de(t,e){var n=m(t)?t:Pt(t);return this.isValid()&&n.isValid()?(e=R(p(e)?"millisecond":e),"millisecond"===e?+this>+n:+n<+this.clone().startOf(e)):!1}function pe(t,e){var n=m(t)?t:Pt(t);return this.isValid()&&n.isValid()?(e=R(p(e)?"millisecond":e),"millisecond"===e?+n>+this:+this.clone().endOf(e)<+n):!1}function ge(t,e,n){return this.isAfter(t,n)&&this.isBefore(e,n)}function ye(t,e){var n,r=m(t)?t:Pt(t);return this.isValid()&&r.isValid()?(e=R(e||"millisecond"),"millisecond"===e?+this===+r:(n=+r,+this.clone().startOf(e)<=n&&n<=+this.clone().endOf(e))):!1}function me(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function ve(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function _e(t,e,n){var r,i,a,u;return this.isValid()?(r=qt(t,this),r.isValid()?(i=6e4*(r.utcOffset()-this.utcOffset()),e=R(e),"year"===e||"month"===e||"quarter"===e?(u=be(this,r),"quarter"===e?u/=3:"year"===e&&(u/=12)):(a=this-r,u="second"===e?a/1e3:"minute"===e?a/6e4:"hour"===e?a/36e5:"day"===e?(a-i)/864e5:"week"===e?(a-i)/6048e5:a),n?u:v(u)):0/0):0/0}function be(t,e){var n,r,i=12*(e.year()-t.year())+(e.month()-t.month()),a=t.clone().add(i,"months");return 0>e-a?(n=t.clone().add(i-1,"months"),r=(e-a)/(a-n)):(n=t.clone().add(i+1,"months"),r=(e-a)/(n-a)),-(i+r)}function xe(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function we(){var t=this.clone().utc();return 0a&&(e=a),Ge.call(this,t,e,n,r,i))}function Ge(t,e,n,r,i){var a=wt(t,e,n,r,i),u=mt(a.year,0,a.dayOfYear);return this.year(u.getUTCFullYear()),this.month(u.getUTCMonth()),this.date(u.getUTCDate()),this}function Xe(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Ze(t){return At(t,this._week.dow,this._week.doy).week}function Ke(){return this._week.dow}function Qe(){return this._week.doy}function Je(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function tn(t){var e=At(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function en(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function nn(t,e){return i(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]}function rn(t){return this._weekdaysShort[t.day()]}function an(t){return this._weekdaysMin[t.day()]}function un(t,e,n){var r,i,a;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;7>r;r++){if(i=Pt([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[r].test(t))return r;if(n&&"ddd"===e&&this._shortWeekdaysParse[r].test(t))return r;if(n&&"dd"===e&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function on(t){if(!this.isValid())return null!=t?this:0/0;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=en(t,this.localeData()),this.add(t-e,"d")):e}function sn(t){if(!this.isValid())return null!=t?this:0/0;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function cn(t){return this.isValid()?null==t?this.day()||7:this.day(this.day()%7?t:t-7):null!=t?this:0/0}function ln(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function hn(){return this.hours()%12||12}function fn(t,e){q(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function dn(t,e){ +return e._meridiemParse}function pn(t){return"p"===(t+"").toLowerCase().charAt(0)}function gn(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function yn(t,e){e[Or]=_(1e3*("0."+t))}function mn(){return this._isUTC?"UTC":""}function vn(){return this._isUTC?"Coordinated Universal Time":""}function _n(t){return Pt(1e3*t)}function bn(){return Pt.apply(null,arguments).parseZone()}function xn(t,e,n){var r=this._calendar[t];return k(r)?r.call(e,n):r}function wn(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function An(){return this._invalidDate}function kn(t){return this._ordinal.replace("%d",t)}function En(t){return t}function Mn(t,e,n,r){var i=this._relativeTime[n];return k(i)?i(t,e,n,r):i.replace(/%d/i,t)}function Dn(t,e){var n=this._relativeTime[t>0?"future":"past"];return k(n)?n(e):n.replace(/%s/i,e)}function Sn(t,e,n,r){var i=N(),a=c().set(r,e);return i[n](a,t)}function Cn(t,e,n,r,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return Sn(t,e,n,i);var a,u=[];for(a=0;r>a;a++)u[a]=Sn(t,a,n,i);return u}function Tn(t,e){return Cn(t,e,"months",12,"month")}function Fn(t,e){return Cn(t,e,"monthsShort",12,"month")}function Bn(t,e){return Cn(t,e,"weekdays",7,"day")}function Ln(t,e){return Cn(t,e,"weekdaysShort",7,"day")}function In(t,e){return Cn(t,e,"weekdaysMin",7,"day")}function Nn(){var t=this._data;return this._milliseconds=Mi(this._milliseconds),this._days=Mi(this._days),this._months=Mi(this._months),t.milliseconds=Mi(t.milliseconds),t.seconds=Mi(t.seconds),t.minutes=Mi(t.minutes),t.hours=Mi(t.hours),t.months=Mi(t.months),t.years=Mi(t.years),this}function On(t,e,n,r){var i=ie(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function Pn(t,e){return On(this,t,e,1)}function Rn(t,e){return On(this,t,e,-1)}function jn(t){return 0>t?Math.floor(t):Math.ceil(t)}function Yn(){var t,e,n,r,i,a=this._milliseconds,u=this._days,o=this._months,s=this._data;return a>=0&&u>=0&&o>=0||0>=a&&0>=u&&0>=o||(a+=864e5*jn($n(o)+u),u=0,o=0),s.milliseconds=a%1e3,t=v(a/1e3),s.seconds=t%60,e=v(t/60),s.minutes=e%60,n=v(e/60),s.hours=n%24,u+=v(n/24),i=v(Un(u)),o+=i,u-=jn($n(i)),r=v(o/12),o%=12,s.days=u,s.months=o,s.years=r,this}function Un(t){return 4800*t/146097}function $n(t){return 146097*t/4800}function zn(t){var e,n,r=this._milliseconds;if(t=R(t),"month"===t||"year"===t)return e=this._days+r/864e5,n=this._months+Un(e),"month"===t?n:n/12;switch(e=this._days+Math.round($n(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}}function Wn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*_(this._months/12)}function qn(t){return function(){return this.as(t)}}function Vn(t){return t=R(t),this[t+"s"]()}function Hn(t){return function(){return this._data[t]}}function Gn(){return v(this.days()/7)}function Xn(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function Zn(t,e,n){var r=ie(t).abs(),i=$i(r.as("s")),a=$i(r.as("m")),u=$i(r.as("h")),o=$i(r.as("d")),s=$i(r.as("M")),c=$i(r.as("y")),l=i=a&&["m"]||a=u&&["h"]||u=o&&["d"]||o=s&&["M"]||s=c&&["y"]||["yy",c];return l[2]=e,l[3]=+t>0,l[4]=n,Xn.apply(null,l)}function Kn(t,e){return void 0===zi[t]?!1:void 0===e?zi[t]:(zi[t]=e,!0)}function Qn(t){var e=this.localeData(),n=Zn(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function Jn(){var t,e,n,r=Wi(this._milliseconds)/1e3,i=Wi(this._days),a=Wi(this._months);t=v(r/60),e=v(t/60),r%=60,t%=60,n=v(a/12),a%=12;var u=n,o=a,s=i,c=e,l=t,h=r,f=this.asSeconds();return f?(0>f?"-":"")+"P"+(u?u+"Y":"")+(o?o+"M":"")+(s?s+"D":"")+(c||l||h?"T":"")+(c?c+"H":"")+(l?l+"M":"")+(h?h+"S":""):"P0D"}var tr,er=n.momentProperties=[],nr=!1,rr={};n.suppressDeprecationWarnings=!1;var ir,ar={},ur={},or=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,sr=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,cr={},lr={},hr=/\d/,fr=/\d\d/,dr=/\d{3}/,pr=/\d{4}/,gr=/[+-]?\d{6}/,yr=/\d\d?/,mr=/\d\d\d\d?/,vr=/\d\d\d\d\d\d?/,_r=/\d{1,3}/,br=/\d{1,4}/,xr=/[+-]?\d{1,6}/,wr=/\d+/,Ar=/[+-]?\d+/,kr=/Z|[+-]\d\d:?\d\d/gi,Er=/Z|[+-]\d\d(?::?\d\d)?/gi,Mr=/[+-]?\d+(\.\d{1,3})?/,Dr=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Sr={},Cr={},Tr=0,Fr=1,Br=2,Lr=3,Ir=4,Nr=5,Or=6,Pr=7,Rr=8;q("M",["MM",2],"Mo",function(){return this.month()+1}),q("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),q("MMMM",0,0,function(t){return this.localeData().months(this,t)}),P("month","M"),Z("M",yr),Z("MM",yr,fr),Z("MMM",function(t,e){return e.monthsShortRegex(t)}),Z("MMMM",function(t,e){return e.monthsRegex(t)}),tt(["M","MM"],function(t,e){e[Fr]=_(t)-1}),tt(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);null!=i?e[Fr]=i:h(n).invalidMonth=t});var jr=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Yr="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ur="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),$r=Dr,zr=Dr,Wr=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,qr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Vr=/Z|[+-]\d\d(?::?\d\d)?/,Hr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Gr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Xr=/^\/?Date\((\-?\d+)/i;n.createFromInputFallback=w("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),q("Y",0,0,function(){var t=this.year();return 9999>=t?""+t:"+"+t}),q(0,["YY",2],0,function(){return this.year()%100}),q(0,["YYYY",4],0,"year"),q(0,["YYYYY",5],0,"year"),q(0,["YYYYYY",6,!0],0,"year"),P("year","y"),Z("Y",Ar),Z("YY",yr,fr),Z("YYYY",br,pr),Z("YYYYY",xr,gr),Z("YYYYYY",xr,gr),tt(["YYYYY","YYYYYY"],Tr),tt("YYYY",function(t,e){e[Tr]=2===t.length?n.parseTwoDigitYear(t):_(t)}),tt("YY",function(t,e){e[Tr]=n.parseTwoDigitYear(t)}),tt("Y",function(t,e){e[Tr]=parseInt(t,10)}),n.parseTwoDigitYear=function(t){return _(t)+(_(t)>68?1900:2e3)};var Zr=Y("FullYear",!1);n.ISO_8601=function(){};var Kr=w("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Pt.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:d()}),Qr=w("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Pt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:d()}),Jr=function(){return Date.now?Date.now():+new Date};zt("Z",":"),zt("ZZ",""),Z("Z",Er),Z("ZZ",Er),tt(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Wt(Er,t)});var ti=/([\+\-]|\d\d)/gi;n.updateOffset=function(){};var ei=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,ni=/^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/;ie.fn=Ut.prototype;var ri=ce(1,"add"),ii=ce(-1,"subtract");n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var ai=w("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});q(0,["gg",2],0,function(){return this.weekYear()%100}),q(0,["GG",2],0,function(){return this.isoWeekYear()%100}),$e("gggg","weekYear"),$e("ggggg","weekYear"),$e("GGGG","isoWeekYear"),$e("GGGGG","isoWeekYear"),P("weekYear","gg"),P("isoWeekYear","GG"),Z("G",Ar),Z("g",Ar),Z("GG",yr,fr),Z("gg",yr,fr),Z("GGGG",br,pr),Z("gggg",br,pr),Z("GGGGG",xr,gr),Z("ggggg",xr,gr),et(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=_(t)}),et(["gg","GG"],function(t,e,r,i){e[i]=n.parseTwoDigitYear(t)}),q("Q",0,"Qo","quarter"),P("quarter","Q"),Z("Q",hr),tt("Q",function(t,e){e[Fr]=3*(_(t)-1)}),q("w",["ww",2],"wo","week"),q("W",["WW",2],"Wo","isoWeek"),P("week","w"),P("isoWeek","W"),Z("w",yr),Z("ww",yr,fr),Z("W",yr),Z("WW",yr,fr),et(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=_(t)});var ui={dow:0,doy:6};q("D",["DD",2],"Do","date"),P("date","D"),Z("D",yr),Z("DD",yr,fr),Z("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),tt(["D","DD"],Br),tt("Do",function(t,e){e[Br]=_(t.match(yr)[0],10)});var oi=Y("Date",!0);q("d",0,"do","day"),q("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),q("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),q("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),q("e",0,0,"weekday"),q("E",0,0,"isoWeekday"),P("day","d"),P("weekday","e"),P("isoWeekday","E"),Z("d",yr),Z("e",yr),Z("E",yr),Z("dd",Dr),Z("ddd",Dr),Z("dddd",Dr),et(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);null!=i?e.d=i:h(n).invalidWeekday=t}),et(["d","e","E"],function(t,e,n,r){e[r]=_(t)});var si="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ci="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),li="Su_Mo_Tu_We_Th_Fr_Sa".split("_");q("DDD",["DDDD",3],"DDDo","dayOfYear"),P("dayOfYear","DDD"),Z("DDD",_r),Z("DDDD",dr),tt(["DDD","DDDD"],function(t,e,n){n._dayOfYear=_(t)}),q("H",["HH",2],0,"hour"),q("h",["hh",2],0,hn),q("hmm",0,0,function(){return""+hn.apply(this)+W(this.minutes(),2)}),q("hmmss",0,0,function(){return""+hn.apply(this)+W(this.minutes(),2)+W(this.seconds(),2)}),q("Hmm",0,0,function(){return""+this.hours()+W(this.minutes(),2)}),q("Hmmss",0,0,function(){return""+this.hours()+W(this.minutes(),2)+W(this.seconds(),2)}),fn("a",!0),fn("A",!1),P("hour","h"),Z("a",dn),Z("A",dn),Z("H",yr),Z("h",yr),Z("HH",yr,fr),Z("hh",yr,fr),Z("hmm",mr),Z("hmmss",vr),Z("Hmm",mr),Z("Hmmss",vr),tt(["H","HH"],Lr),tt(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),tt(["h","hh"],function(t,e,n){e[Lr]=_(t),h(n).bigHour=!0}),tt("hmm",function(t,e,n){var r=t.length-2;e[Lr]=_(t.substr(0,r)),e[Ir]=_(t.substr(r)),h(n).bigHour=!0}),tt("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[Lr]=_(t.substr(0,r)),e[Ir]=_(t.substr(r,2)),e[Nr]=_(t.substr(i)),h(n).bigHour=!0}),tt("Hmm",function(t,e){var n=t.length-2;e[Lr]=_(t.substr(0,n)),e[Ir]=_(t.substr(n))}),tt("Hmmss",function(t,e){var n=t.length-4,r=t.length-2;e[Lr]=_(t.substr(0,n)),e[Ir]=_(t.substr(n,2)),e[Nr]=_(t.substr(r))});var hi=/[ap]\.?m?\.?/i,fi=Y("Hours",!0);q("m",["mm",2],0,"minute"),P("minute","m"),Z("m",yr),Z("mm",yr,fr),tt(["m","mm"],Ir);var di=Y("Minutes",!1);q("s",["ss",2],0,"second"),P("second","s"),Z("s",yr),Z("ss",yr,fr),tt(["s","ss"],Nr);var pi=Y("Seconds",!1);q("S",0,0,function(){return~~(this.millisecond()/100)}),q(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),q(0,["SSS",3],0,"millisecond"),q(0,["SSSS",4],0,function(){return 10*this.millisecond()}),q(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),q(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),q(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),q(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),q(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),P("millisecond","ms"),Z("S",_r,hr),Z("SS",_r,fr),Z("SSS",_r,dr);var gi;for(gi="SSSS";gi.length<=9;gi+="S")Z(gi,wr);for(gi="S";gi.length<=9;gi+="S")tt(gi,yn);var yi=Y("Milliseconds",!1);q("z",0,0,"zoneAbbr"),q("zz",0,0,"zoneName");var mi=y.prototype;mi.add=ri,mi.calendar=he,mi.clone=fe,mi.diff=_e,mi.endOf=Fe,mi.format=Ae,mi.from=ke,mi.fromNow=Ee,mi.to=Me,mi.toNow=De,mi.get=z,mi.invalidAt=Ye,mi.isAfter=de,mi.isBefore=pe,mi.isBetween=ge,mi.isSame=ye,mi.isSameOrAfter=me,mi.isSameOrBefore=ve,mi.isValid=Re,mi.lang=ai,mi.locale=Se,mi.localeData=Ce,mi.max=Qr,mi.min=Kr,mi.parsingFlags=je,mi.set=z,mi.startOf=Te,mi.subtract=ii,mi.toArray=Ne,mi.toObject=Oe,mi.toDate=Ie,mi.toISOString=we,mi.toJSON=Pe,mi.toString=xe,mi.unix=Le,mi.valueOf=Be,mi.creationData=Ue,mi.year=Zr,mi.isLeapYear=bt,mi.weekYear=ze,mi.isoWeekYear=We,mi.quarter=mi.quarters=Xe,mi.month=st,mi.daysInMonth=ct,mi.week=mi.weeks=Je,mi.isoWeek=mi.isoWeeks=tn,mi.weeksInYear=Ve,mi.isoWeeksInYear=qe,mi.date=oi,mi.day=mi.days=on,mi.weekday=sn,mi.isoWeekday=cn,mi.dayOfYear=ln,mi.hour=mi.hours=fi,mi.minute=mi.minutes=di,mi.second=mi.seconds=pi,mi.millisecond=mi.milliseconds=yi,mi.utcOffset=Ht,mi.utc=Xt,mi.local=Zt,mi.parseZone=Kt,mi.hasAlignedHourOffset=Qt,mi.isDST=Jt,mi.isDSTShifted=te,mi.isLocal=ee,mi.isUtcOffset=ne,mi.isUtc=re,mi.isUTC=re,mi.zoneAbbr=mn,mi.zoneName=vn,mi.dates=w("dates accessor is deprecated. Use date instead.",oi),mi.months=w("months accessor is deprecated. Use month instead",st),mi.years=w("years accessor is deprecated. Use year instead",Zr),mi.zone=w("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Gt);var vi=mi,_i={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},bi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},xi="Invalid date",wi="%d",Ai=/\d{1,2}/,ki={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Ei=S.prototype;Ei._calendar=_i,Ei.calendar=xn,Ei._longDateFormat=bi,Ei.longDateFormat=wn,Ei._invalidDate=xi,Ei.invalidDate=An,Ei._ordinal=wi,Ei.ordinal=kn,Ei._ordinalParse=Ai,Ei.preparse=En,Ei.postformat=En,Ei._relativeTime=ki,Ei.relativeTime=Mn,Ei.pastFuture=Dn,Ei.set=M,Ei.months=it,Ei._months=Yr,Ei.monthsShort=at,Ei._monthsShort=Ur,Ei.monthsParse=ut,Ei._monthsRegex=zr,Ei.monthsRegex=ht,Ei._monthsShortRegex=$r,Ei.monthsShortRegex=lt,Ei.week=Ze,Ei._week=ui,Ei.firstDayOfYear=Qe,Ei.firstDayOfWeek=Ke,Ei.weekdays=nn,Ei._weekdays=si,Ei.weekdaysMin=an,Ei._weekdaysMin=li,Ei.weekdaysShort=rn,Ei._weekdaysShort=ci,Ei.weekdaysParse=un,Ei.isPM=pn,Ei._meridiemParse=hi,Ei.meridiem=gn,B("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===_(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),n.lang=w("moment.lang is deprecated. Use moment.locale instead.",B),n.langData=w("moment.langData is deprecated. Use moment.localeData instead.",N);var Mi=Math.abs,Di=qn("ms"),Si=qn("s"),Ci=qn("m"),Ti=qn("h"),Fi=qn("d"),Bi=qn("w"),Li=qn("M"),Ii=qn("y"),Ni=Hn("milliseconds"),Oi=Hn("seconds"),Pi=Hn("minutes"),Ri=Hn("hours"),ji=Hn("days"),Yi=Hn("months"),Ui=Hn("years"),$i=Math.round,zi={s:45,m:45,h:22,d:26,M:11},Wi=Math.abs,qi=Ut.prototype;qi.abs=Nn,qi.add=Pn,qi.subtract=Rn,qi.as=zn,qi.asMilliseconds=Di,qi.asSeconds=Si,qi.asMinutes=Ci,qi.asHours=Ti,qi.asDays=Fi,qi.asWeeks=Bi,qi.asMonths=Li,qi.asYears=Ii,qi.valueOf=Wn,qi._bubble=Yn,qi.get=Vn,qi.milliseconds=Ni,qi.seconds=Oi,qi.minutes=Pi,qi.hours=Ri,qi.days=ji,qi.weeks=Gn,qi.months=Yi,qi.years=Ui,qi.humanize=Qn,qi.toISOString=Jn,qi.toString=Jn,qi.toJSON=Jn,qi.locale=Se,qi.localeData=Ce,qi.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Jn),qi.lang=ai,q("X",0,0,"unix"),q("x",0,0,"valueOf"),Z("x",Ar),Z("X",Mr),tt("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),tt("x",function(t,e,n){n._d=new Date(_(t))}),n.version="2.12.0",r(Pt),n.fn=vi,n.min=jt,n.max=Yt,n.now=Jr,n.utc=c,n.unix=_n,n.months=Tn,n.isDate=a,n.locale=B,n.invalid=d,n.duration=ie,n.isMoment=m,n.weekdays=Bn,n.parseZone=bn,n.localeData=N,n.isDuration=$t,n.monthsShort=Fn,n.weekdaysMin=In,n.defineLocale=L,n.updateLocale=I,n.locales=O,n.weekdaysShort=Ln,n.normalizeUnits=R,n.relativeTimeThreshold=Kn,n.prototype=vi;var Vi=n;return Vi})},{}],83:[function(t,e,n){(function(t){function e(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!i;a--){var u=a>=0?arguments[a]:t.cwd();if("string"!=typeof u)throw new TypeError("Arguments to path.resolve must be strings");u&&(n=u+"/"+n,i="/"===u.charAt(0))}return n=e(r(n.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(t){var i=n.isAbsolute(t),a="/"===u(t,-1);return t=e(r(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(r(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function r(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),a=r(e.split("/")),u=Math.min(i.length,a.length),o=u,s=0;u>s;s++)if(i[s]!==a[s]){o=s;break}for(var c=[],s=o;se&&(e=t.length+e),t.substr(e,n)}}).call(this,t("_process"))},{_process:84}],84:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.MutationObserver,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};var r=[];if(e){var i=document.createElement("div"),a=new MutationObserver(function(){var t=r.slice();r.length=0,t.forEach(function(t){t()})});return a.observe(i,{attributes:!0}),function(t){r.length||i.setAttribute("yes","no"),r.push(t)}}return n?(window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),r.length>0)){var n=r.shift();n()}},!0),function(t){r.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],85:[function(t,e){e.exports={name:"mermaid",version:"0.5.8",description:"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams and gantt charts.",main:"src/mermaid.js",keywords:["diagram","markdown","flowchart","sequence diagram","gantt"],bin:{mermaid:"./bin/mermaid.js"},scripts:{live:"live-server ./test/examples",lint:"node node_modules/eslint/bin/eslint.js src",jison:"gulp jison_legacy",karma:"node node_modules/karma/bin/karma start karma.conf.js --single-run",watch:"source ./scripts/watch.sh",doc:"rm -r build;rm -r dist/www;gulp vartree;cp dist/www/all.html ../mermaid-pages/index.html;cp dist/mermaid.js ../mermaid-pages/javascripts/lib;cp dist/mermaid.forest.css ../mermaid-pages/stylesheets",tape:"node node_modules/tape/bin/tape test/cli_test-*.js",jasmine:"npm run jison &&node node_modules/jasmine-es6/bin/jasmine.js",pretest:"npm run jison",test:"npm run dist && npm run karma && npm run tape","dist-slim-mermaid":"node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.slim.js -x d3 && cat dist/mermaid.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.slim.min.js","dist-slim-mermaidAPI":"node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.slim.js -x d3 && cat dist/mermaidAPI.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.slim.min.js","dist-mermaid":"node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.js && cat dist/mermaid.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.min.js","dist-mermaidAPI":"node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.js && cat dist/mermaidAPI.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.min.js",dist:"npm run dist-slim-mermaid && npm run dist-slim-mermaidAPI && npm run dist-mermaid && npm run dist-mermaidAPI"},repository:{type:"git",url:"https://github.com/knsv/mermaid"},author:"Knut Sveidqvist",license:"MIT",dependencies:{chalk:"^0.5.1",d3:"3.5.6",dagre:"^0.7.4","dagre-d3":"0.4.10",he:"^0.5.0",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.9.0",semver:"^4.1.1",which:"^1.0.8"},devDependencies:{async:"^0.9.0","babel-eslint":"^4.1.3",babelify:"^6.4.0",browserify:"~6.2.0",clone:"^0.2.0","codeclimate-test-reporter":"0.0.4",dateformat:"^1.0.11",dox:"^0.8.0",eslint:"^1.6.0","eslint-watch":"^2.1.2","event-stream":"^3.2.0",foundation:"^4.2.1-1","front-matter":"^0.2.0",gulp:"~3.9.0","gulp-bower":"0.0.10","gulp-browserify":"^0.5.0","gulp-bump":"^0.1.11","gulp-concat":"~2.4.1","gulp-data":"^1.1.1","gulp-dox":"^0.1.6","gulp-ext-replace":"^0.2.0","gulp-filelog":"^0.4.1","gulp-front-matter":"^1.2.3","gulp-hogan":"^1.1.0","gulp-if":"^1.2.5","gulp-insert":"^0.4.0","gulp-istanbul":"^0.4.0","gulp-jasmine":"~2.1.0","gulp-jasmine-browser":"^0.2.3","gulp-jison":"~1.2.0","gulp-jshint":"^1.9.0","gulp-less":"^3.0.1","gulp-livereload":"^3.8.0","gulp-marked":"^1.0.0","gulp-mdvars":"^2.0.0","gulp-qunit":"~1.2.1","gulp-rename":"~1.2.0","gulp-shell":"^0.2.10","gulp-tag-version":"^1.2.1","gulp-uglify":"~1.0.1","gulp-util":"^3.0.7","gulp-vartree":"^2.0.1","hogan.js":"^3.0.2",jasmine:"2.3.2","jasmine-es6":"0.0.18",jison:"zaach/jison",jsdom:"^7.0.2","jshint-stylish":"^2.0.1",karma:"^0.13.15","karma-babel-preprocessor":"^6.0.1","karma-browserify":"^4.4.0","karma-jasmine":"^0.3.6","karma-phantomjs-launcher":"^0.2.1","live-server":"^0.9.0","map-stream":"0.0.6",marked:"^0.3.2","mock-browser":"^0.91.34",path:"^0.4.9",phantomjs:"^2.1.3",proxyquire:"^1.7.3","proxyquire-universal":"^1.0.8",proxyquireify:"^3.0.0","require-dir":"^0.3.0",rewire:"^2.1.3",rimraf:"^2.2.8",tape:"^3.0.3",testdom:"^2.0.0",uglifyjs:"^2.4.10","vinyl-source-stream":"^1.1.0",watchify:"^3.6.1"}}},{}],86:[function(t,e){"use strict";var n;if(t)try{n=t("d3")}catch(r){}n||(n=window.d3),e.exports=n,function(){var t=!1;if(t="tspans",n.selection.prototype.textwrap)return!1;if("undefined"==typeof t)var t=!1;n.selection.prototype.textwrap=n.selection.enter.prototype.textwrap=function(e,r){var i,r=parseInt(r)||0,a=this,u=function(t){var e=t[0][0],r=e.tagName.toString();if("rect"!==r)return!1;var i={};return i.x=n.select(e).attr("x")||0,i.y=n.select(e).attr("y")||0,i.width=n.select(e).attr("width")||0,i.height=n.select(e).attr("height")||0,i.attr=t.attr,i},o=function(t){if(t.attr||(t.attr=function(t){return this[t]?this[t]:void 0}),"object"==typeof t&&"undefined"!=typeof t.x&&"undefined"!=typeof t.y&&"undefined"!=typeof t.width&&"undefined"!=typeof t.height)return t;if("function"==typeof Array.isArray&&Array.isArray(t)||"[object Array]"===Object.prototype.toString.call(t)){var e=u(t);return e}return!1},s=function(t,e){var n=t;return 0!==e&&(n.x=parseInt(n.x)+e,n.y=parseInt(n.y)+e,n.width-=2*e,n.height-=2*e),n},c=o(e);if(r&&(c=s(c,r)),0!=a.length&&n&&e&&c){e=c;var l,h=function(t){var r=n.select(t[0].parentNode),a=r.select("text"),u=a.style("line-height"),o=a.text();a.remove();var s=r.append("foreignObject");s.attr("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility").attr("x",e.x).attr("y",e.y).attr("width",e.width).attr("height",e.height);var c=s.append("xhtml:div").attr("class","wrapped");c.style("height",e.height).style("width",e.width).html(o),u&&c.style("line-height",u),i=r.select("foreignObject")},f=function(t){var a,u=t[0],o=u.parentNode,s=n.select(u),c=u.getBBox().height,l=u.getBBox().width,h=c,f=s.style("line-height");if(a=f&&parseInt(f)?parseInt(f.replace("px","")):h,l>e.width){var d=s.text();if(s.text(""),d){var p,g;if(-1!==d.indexOf(" ")){var p=" ";g=d.split(" ")}else{p="";var y=d.length,m=Math.ceil(l/e.width),v=Math.floor(y/m);v*m>=y||m++;for(var _,b,g=[],x=0;m>x;x++)b=x*v,_=d.substr(b,v),g.push(_)}for(var w=[],A=0,k={},x=0;xe.width&&D&&""!==D&&(A+=S,k={string:D,width:S,offset:A},w.push(k),s.text(""),s.text(M),x==g.length-1&&(E=M,s.text(E),C=u.getComputedTextLength())),x==g.length-1){s.text("");var T=E;T&&""!==T&&(C-A>0&&(C-=A),k={string:T,width:C,offset:A},w.push(k))}}var F;s.text("");for(var x=0;x0){w[x-1]}x*a0?a:void 0}),F.attr("x",function(){var t=e.x;return r&&(t+=r),t}))}}}s.attr("y",function(){var t=e.y;return a&&(t+=a),r&&(t+=r),t}),s.attr("x",function(){var t=e.x;return r&&(t+=r),t}),i=n.select(o).selectAll("text")};t&&("foreignobjects"==t?l=h:"tspans"==t&&(l=f)),t||(l="undefined"!=typeof SVGForeignObjectElement?h:f);for(var d=0;d "+t.w+": "+JSON.stringify(u.edge(t))),p(i,u.edge(t),u.edge(t).relation)}),i.attr("height","100%"),i.attr("width","100%")}},{"../../d3":86,"../../logger":105,"./classDb":87,"./parser/classDiagram":89,dagre:31}],89:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,11],r=[1,12],i=[1,13],a=[1,15],u=[1,16],o=[1,17],s=[6,8],c=[1,26],l=[1,27],h=[1,28],f=[1,29],d=[1,30],p=[1,31],g=[6,8,13,17,23,26,27,28,29,30,31],y=[6,8,13,17,23,26,27,28,29,30,31,45,46,47],m=[23,45,46,47],v=[23,30,31,45,46,47],_=[23,26,27,28,29,45,46,47],b=[6,8,13],x=[1,46],w={trace:function(){},yy:{},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},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"},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]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 5:this.$=a[u-1]+a[u];break;case 6:this.$=a[u];break;case 7:r.addRelation(a[u]);break;case 8:a[u-1].title=r.cleanupLabel(a[u]),r.addRelation(a[u-1]);break;case 12:r.addMembers(a[u-3],a[u-1]);break;case 13:this.$=[a[u]];break;case 14:a[u].push(a[u-1]),this.$=a[u];break;case 15:break;case 16:r.addMembers(a[u-1],r.cleanupLabel(a[u]));break;case 17:console.warn("Member",a[u]);break;case 18:break;case 19:this.$={id1:a[u-2],id2:a[u],relation:a[u-1],relationTitle1:"none",relationTitle2:"none"};break;case 20:this.$={id1:a[u-3],id2:a[u],relation:a[u-1],relationTitle1:a[u-2],relationTitle2:"none"};break;case 21:this.$={id1:a[u-3],id2:a[u],relation:a[u-2],relationTitle1:"none",relationTitle2:a[u-1]};break;case 22:this.$={id1:a[u-4],id2:a[u],relation:a[u-2],relationTitle1:a[u-3],relationTitle2:a[u-1]};break;case 23:this.$={type1:a[u-2],type2:a[u],lineType:a[u-1]};break;case 24:this.$={type1:"none",type2:a[u],lineType:a[u-1]};break;case 25:this.$={type1:a[u-1],type2:"none",lineType:a[u]};break;case 26:this.$={type1:"none",type2:"none",lineType:a[u]};break;case 27:this.$=r.relationType.AGGREGATION;break;case 28:this.$=r.relationType.EXTENSION;break;case 29:this.$=r.relationType.COMPOSITION;break;case 30:this.$=r.relationType.DEPENDENCY;break;case 31:this.$=r.lineType.LINE;break;case 32:this.$=r.lineType.DOTTED_LINE}},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:n,20:r,21:i,45:a,46:u,47:o},{8:[1,18]},{6:[1,19],8:[2,3]},e(s,[2,7],{13:[1,20]}),e(s,[2,9]),e(s,[2,10]),e(s,[2,15],{22:21,24:24,25:25,13:[1,23],23:[1,22],26:c,27:l,28:h,29:f,30:d,31:p}),{10:32,11:14,45:a,46:u,47:o},e(s,[2,17]),e(s,[2,18]),e(g,[2,6],{11:14,10:33,45:a,46:u,47:o}),e(y,[2,46]),e(y,[2,47]),e(y,[2,48]),{1:[2,2]},{7:34,9:6,10:10,11:14,12:7,14:8,15:9,16:n,20:r,21:i,45:a,46:u,47:o},e(s,[2,8]),{10:35,11:14,23:[1,36],45:a,46:u,47:o},{22:37,24:24,25:25,26:c,27:l,28:h,29:f,30:d,31:p},e(s,[2,16]),{25:38,30:d,31:p},e(m,[2,26],{24:39,26:c,27:l,28:h,29:f}),e(v,[2,27]),e(v,[2,28]),e(v,[2,29]),e(v,[2,30]),e(_,[2,31]),e(_,[2,32]),e(s,[2,11],{17:[1,40]}),e(g,[2,5]),{8:[2,4]},e(b,[2,19]),{10:41,11:14,45:a,46:u,47:o},{10:42,11:14,23:[1,43],45:a,46:u,47:o},e(m,[2,25],{24:44,26:c,27:l,28:h,29:f}),e(m,[2,24]),{18:45,20:x},e(b,[2,21]),e(b,[2,20]),{10:47,11:14,45:a,46:u,47:o},e(m,[2,23]),{19:[1,48]},{18:49,19:[2,13],20:x},e(b,[2,22]),e(s,[2,12]),{19:[2,14]}],defaultActions:{2:[2,1],18:[2,2],34:[2,4],49:[2,14]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var y=d.yylloc;i.push(y);var m=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,x,w,A,k,E,M,D=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},S={};;){if(b=n[n.length-1],this.defaultActions[b]?x=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=D()),x=a[b]&&a[b][v]),"undefined"==typeof x||!x.length||!x[0]){var C="";M=[];for(A in a[b])this.terminals_[A]&&A>l&&M.push("'"+this.terminals_[A]+"'");C=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(C,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:y,expected:M})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,_?(v=_,_=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,y=d.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[x[1]][1],S.$=r[r.length-k],S._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(S._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(S,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[x[1]][0]),r.push(S.$),i.push(S._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},A=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:break;case 1:return 6;case 2:break;case 3:return 5;case 4:return this.begin("struct"),17;case 5:return this.popState(),19;case 6:break;case 7:return"MEMBER";case 8:return 16;case 9:this.begin("string");break;case 10:this.popState();break;case 11:return"STR";case 12:return 27;case 13:return 27;case 14:return 29;case 15:return 29;case 16:return 28;case 17:return 26;case 18:return 30;case 19:return 31;case 20:return 13;case 21:return 43;case 22:return"DOT";case 23:return"PLUS";case 24:return 40;case 25:return"EQUALS";case 26:return"EQUALS";case 27:return 47;case 28:return"PUNCTUATION";case 29:return 46;case 30:return 45;case 31:return 42;case 32:return 8}},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)/,/^(?:$)/],conditions:{string:{rules:[10,11],inclusive:!1},struct:{rules:[5,6,7],inclusive:!1},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:!0}}};return t}();return w.lexer=A,t.prototype=w,w.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:84,fs:1,path:83}],90:[function(t,e,n){(function(e){"use strict";var r=t("../../logger"),i=new r.Log,a="",u=!1;n.setMessage=function(t){i.debug("Setting message to: "+t),a=t},n.getMessage=function(){return a},n.setInfo=function(t){u=t},n.getInfo=function(){return u},n.parseError=function(t,n){e.mermaidAPI.parseError(t,n)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../logger":105}],91:[function(t,e,n){"use strict";var r=t("./exampleDb"),i=t("./parser/example.js"),a=t("../../d3"),u=t("../../logger"),o=new u.Log;n.draw=function(t,e,n){var u;u=i.parser,u.yy=r,o.debug("Renering example diagram"),u.parse(t);var s=a.select("#"+e),c=s.append("g");c.append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("mermaid "+n),s.attr("height",100),s.attr("width",400)}},{"../../d3":86,"../../logger":105,"./exampleDb":90,"./parser/example.js":92}],92:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[6,9,10,12],r={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,message:11,say:12,TXT:13,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo",12:"say",13:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1],[8,1],[11,2]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 1:return r;case 4:break;case 6:r.setInfo(!0);break;case 7:r.setMessage(a[u]);break;case 8:this.$=a[u-1].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},e(n,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8],11:9,12:[1,10]},{1:[2,1]},e(n,[2,3]),e(n,[2,4]),e(n,[2,5]),e(n,[2,6]),e(n,[2,7]),{13:[1,11]},e(n,[2,8])],defaultActions:{4:[2,1]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var y=d.yylloc;i.push(y);var m=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,x,w,A,k,E,M,D=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},S={};;){if(b=n[n.length-1],this.defaultActions[b]?x=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=D()),x=a[b]&&a[b][v]),"undefined"==typeof x||!x.length||!x[0]){var C="";M=[];for(A in a[b])this.terminals_[A]&&A>l&&M.push("'"+this.terminals_[A]+"'");C=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(C,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:y,expected:M})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,_?(v=_,_=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,y=d.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[x[1]][1],S.$=r[r.length-k],S._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(S._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(S,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[x[1]][0]),r.push(S.$),i.push(S._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},i=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 9;case 1:return 10;case 2:return 4;case 3:return 12;case 4:return 13;case 5:return 6;case 6:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:showInfo\b)/i,/^(?:info\b)/i,/^(?:say\b)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return t}();return r.lexer=i,t.prototype=r,r.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:84,fs:1,path:83}],93:[function(t,e){"use strict";var n,r=t("../../logger"),i=new r.Log;if(t)try{n=t("dagre-d3")}catch(a){i.debug("Could not load dagre-d3")}n||(n=window.dagreD3),e.exports=n},{"../../logger":105,"dagre-d3":3}],94:[function(t,e,n){"use strict";var r=t("./graphDb"),i=t("./parser/flow"),a=t("./parser/dot"),u=t("../../d3"),o=t("./dagre-d3"),s=t("../../logger"),c=new s.Log,l={};e.exports.setConf=function(t){var e,n=Object.keys(t);for(e=0;e0&&(u=a.classes.join(" "));var o="";o=r(o,a.styles),i="undefined"==typeof a.text?a.id:a.text;var s="";if(l.htmlLabels)s="html",i=i.replace(/fa:fa[\w\-]+/g,function(t){return''});else{var c=document.createElementNS("http://www.w3.org/2000/svg","text"),h=i.split(/
/),f=0;for(f=0;f/g,"\n");"undefined"==typeof t.style?l.htmlLabels?e.setEdge(t.start,t.end,{labelType:"html",style:a,labelpos:"c",label:''+t.text+"",arrowheadStyle:"fill: #333",arrowhead:n},i):e.setEdge(t.start,t.end,{labelType:"text",style:"stroke: #333; stroke-width: 1.5px;fill:none",labelpos:"c",label:u,arrowheadStyle:"fill: #333",arrowhead:n},i):e.setEdge(t.start,t.end,{labelType:"text",style:a,arrowheadStyle:"fill: #333",label:u,arrowhead:n},i)}})},n.getClasses=function(t,e){var n;r.clear(),n=e?a.parser:i.parser,n.yy=r,n.parse(t);var u=r.getClasses();return"undefined"==typeof u["default"]&&(u["default"]={id:"default"},u["default"].styles=[],u["default"].clusterStyles=["rx:4px","fill: rgb(255, 255, 222)","rx: 4px","stroke: rgb(170, 170, 51)","stroke-width: 1px"], +u["default"].nodeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"],u["default"].edgeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"]),u},n.draw=function(t,e,s){c.debug("Drawing flowchart");var h;r.clear(),h=s?a.parser:i.parser,h.yy=r;try{h.parse(t)}catch(f){c.debug("Parsing failed")}var d;d=r.getDirection(),"undefined"==typeof d&&(d="TD");var p,g=new o.graphlib.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:d,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),y=r.getSubGraphs(),m=0;for(m=y.length-1;m>=0;m--)p=y[m],r.addVertex(p.id,p.title,"group",void 0);var v=r.getVertices(),_=r.getEdges();m=0;var b;for(m=y.length-1;m>=0;m--)for(p=y[m],u.selectAll("cluster").append("text"),b=0;b0?t.split(",").forEach(function(t){"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)}):"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)};var setTooltip=function(t,e){"undefined"!=typeof e&&(tooltips[t]=e)},setClickFun=function setClickFun(id,functionName){"undefined"!=typeof functionName&&"undefined"!=typeof vertices[id]&&funs.push(function(element){var elem=d3.select(element).select("#"+id);null!==elem&&elem.on("click",function(){eval(functionName+"('"+id+"')")})})},setLink=function(t,e){"undefined"!=typeof e&&"undefined"!=typeof vertices[t]&&funs.push(function(n){var r=d3.select(n).select("#"+t);null!==r&&r.on("click",function(){window.open(e,"newTab")})})};exports.getTooltip=function(t){return tooltips[t]},exports.setClickEvent=function(t,e,n,r){t.indexOf(",")>0?t.split(",").forEach(function(t){setTooltip(t,r),setClickFun(t,e),setLink(t,n)}):(setTooltip(t,r),setClickFun(t,e),setLink(t,n))},exports.bindFunctions=function(t){funs.forEach(function(e){e(t)})},exports.getDirection=function(){return direction},exports.getVertices=function(){return vertices},exports.getEdges=function(){return edges},exports.getClasses=function(){return classes};var setupToolTips=function(t){var e=d3.select(".mermaidTooltip");null===e[0][0]&&(e=d3.select("body").append("div").attr("class","mermaidTooltip").style("opacity",0));var n=d3.select(t).select("svg"),r=n.selectAll("g.node");r.on("mouseover",function(){var t=d3.select(this),n=t.attr("title");if(null!==n){var r=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.html(t.attr("title")).style("left",r.left+(r.right-r.left)/2+"px").style("top",r.top-14+document.body.scrollTop+"px"),t.classed("hover",!0)}}).on("mouseout",function(){e.transition().duration(500).style("opacity",0);var t=d3.select(this);t.classed("hover",!1)})};funs.push(setupToolTips),exports.clear=function(){vertices={},classes={},edges=[],funs=[],funs.push(setupToolTips),subGraphs=[],subCount=0,tooltips=[]},exports.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},exports.addSubGraph=function(t,e){function n(t){var e={"boolean":{},number:{},string:{}},n=[];return t.filter(function(t){var r=typeof t;return" "===t?!1:r in e?e[r].hasOwnProperty(t)?!1:e[r][t]=!0:n.indexOf(t)>=0?!1:n.push(t)})}var r=[];r=n(r.concat.apply(r,t));var i={id:"subGraph"+subCount,nodes:r,title:e};return subGraphs.push(i),subCount+=1,i.id};var getPosForId=function(t){var e;for(e=0;e2e3)){if(posCrossRef[secCount]=n,subGraphs[n].id===e)return{result:!0,count:0};for(var i=0,a=1;i=0){var o=t(e,u);if(o.result)return{result:!0,count:a+o.count};a+=o.count}i+=1}return{result:!1,count:a}}};exports.getDepthFirstPos=function(t){return posCrossRef[t]},exports.indexNodes=function(){secCount=-1,subGraphs.length>0&&indexNodes("none",subGraphs.length-1,0)},exports.getSubGraphs=function(){return subGraphs},exports.parseError=function(t,e){global.mermaidAPI.parseError(t,e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../d3":86,"../../logger":105}],96:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,5],r=[1,6],i=[1,12],a=[1,13],u=[1,14],o=[1,15],s=[1,16],c=[1,17],l=[1,18],h=[1,19],f=[1,20],d=[1,21],p=[1,22],g=[8,16,17,18,19,20,21,22,23,24,25,26],y=[1,37],m=[1,33],v=[1,34],_=[1,35],b=[1,36],x=[8,10,16,17,18,19,20,21,22,23,24,25,26,28,32,37,39,40,45,57,58],w=[10,28],A=[10,28,37,57,58],k=[2,49],E=[1,45],M=[1,48],D=[1,49],S=[1,52],C=[2,65],T=[1,65],F=[1,66],B=[1,67],L=[1,68],I=[1,69],N=[1,70],O=[1,71],P=[1,72],R=[1,73],j=[8,16,17,18,19,20,21,22,23,24,25,26,47],Y=[10,28,37],U={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graph:4,EOF:5,graphStatement:6,idStatement:7,"{":8,stmt_list:9,"}":10,strict:11,GRAPH:12,DIGRAPH:13,textNoTags:14,textNoTagsToken:15,ALPHA:16,NUM:17,COLON:18,PLUS:19,EQUALS:20,MULT:21,DOT:22,BRKT:23,SPACE:24,MINUS:25,keywords:26,stmt:27,";":28,node_stmt:29,edge_stmt:30,attr_stmt:31,"=":32,subgraph:33,attr_list:34,NODE:35,EDGE:36,"[":37,a_list:38,"]":39,",":40,edgeRHS:41,node_id:42,edgeop:43,port:44,":":45,compass_pt:46,SUBGRAPH:47,n:48,ne:49,e:50,se:51,s:52,sw:53,w:54,nw:55,c:56,ARROW_POINT:57,ARROW_OPEN:58,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"{",10:"}",11:"strict",12:"GRAPH",13:"DIGRAPH",16:"ALPHA",17:"NUM",18:"COLON",19:"PLUS",20:"EQUALS",21:"MULT",22:"DOT",23:"BRKT",24:"SPACE",25:"MINUS",26:"keywords",28:";",32:"=",35:"NODE",36:"EDGE",37:"[",39:"]",40:",",45:":",47:"SUBGRAPH",48:"n",49:"ne",50:"e",51:"se",52:"s",53:"sw",54:"w",55:"nw",56:"c",57:"ARROW_POINT",58:"ARROW_OPEN"},productions_:[0,[3,2],[4,5],[4,6],[4,4],[6,1],[6,1],[7,1],[14,1],[14,2],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[9,1],[9,3],[27,1],[27,1],[27,1],[27,3],[27,1],[31,2],[31,2],[31,2],[34,4],[34,3],[34,3],[34,2],[38,5],[38,5],[38,3],[30,3],[30,3],[30,2],[30,2],[41,3],[41,3],[41,2],[41,2],[29,2],[29,1],[42,2],[42,1],[44,4],[44,2],[44,2],[33,5],[33,4],[33,3],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,0],[43,1],[43,1]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 1:this.$=a[u-1];break;case 2:this.$=a[u-4];break;case 3:this.$=a[u-5];break;case 4:this.$=a[u-3];break;case 8:case 10:case 11:this.$=a[u];break;case 9:this.$=a[u-1]+""+a[u];break;case 12:case 13:case 14:case 15:case 16:case 18:case 19:case 20:this.$=a[u];break;case 17:this.$="
";break;case 39:this.$="oy";break;case 40:r.addLink(a[u-1],a[u].id,a[u].op),this.$="oy";break;case 42:r.addLink(a[u-1],a[u].id,a[u].op),this.$={op:a[u-2],id:a[u-1]};break;case 44:this.$={op:a[u-1],id:a[u]};break;case 48:r.addVertex(a[u-1]),this.$=a[u-1];break;case 49:r.addVertex(a[u]),this.$=a[u];break;case 66:this.$="arrow";break;case 67:this.$="arrow_open"}},table:[{3:1,4:2,6:3,11:[1,4],12:n,13:r},{1:[3]},{5:[1,7]},{7:8,8:[1,9],14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},{6:23,12:n,13:r},e(g,[2,5]),e(g,[2,6]),{1:[2,1]},{8:[1,24]},{7:30,8:y,9:25,12:m,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},e([8,10,28,32,37,39,40,45,57,58],[2,7],{15:38,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p}),e(x,[2,8]),e(x,[2,10]),e(x,[2,11]),e(x,[2,12]),e(x,[2,13]),e(x,[2,14]),e(x,[2,15]),e(x,[2,16]),e(x,[2,17]),e(x,[2,18]),e(x,[2,19]),e(x,[2,20]),{7:39,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},{7:30,8:y,9:40,12:m,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{10:[1,41]},{10:[2,21],28:[1,42]},e(w,[2,23]),e(w,[2,24]),e(w,[2,25]),e(A,k,{44:44,32:[1,43],45:E}),e(w,[2,27],{41:46,43:47,57:M,58:D}),e(w,[2,47],{43:47,34:50,41:51,37:S,57:M,58:D}),{34:53,37:S},{34:54,37:S},{34:55,37:S},{7:56,8:[1,57],14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},{7:30,8:y,9:58,12:m,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},e(x,[2,9]),{8:[1,59]},{10:[1,60]},{5:[2,4]},{7:30,8:y,9:61,12:m,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{7:62,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},e(A,[2,48]),e(A,C,{14:10,15:11,7:63,46:64,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,48:T,49:F,50:B,51:L,52:I,53:N,54:O,55:P,56:R}),e(w,[2,41],{34:74,37:S}),{7:77,8:y,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,33:76,42:75,47:b},e(j,[2,66]),e(j,[2,67]),e(w,[2,46]),e(w,[2,40],{34:78,37:S}),{7:81,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,38:79,39:[1,80]},e(w,[2,28]),e(w,[2,29]),e(w,[2,30]),{8:[1,82]},{7:30,8:y,9:83,12:m,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{10:[1,84]},{7:30,8:y,9:85,12:m,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{5:[2,2]},{10:[2,22]},e(w,[2,26]),e(A,[2,51],{45:[1,86]}),e(A,[2,52]),e(A,[2,56]),e(A,[2,57]),e(A,[2,58]),e(A,[2,59]),e(A,[2,60]),e(A,[2,61]),e(A,[2,62]),e(A,[2,63]),e(A,[2,64]),e(w,[2,38]),e(Y,[2,44],{43:47,41:87,57:M,58:D}),e(Y,[2,45],{43:47,41:88,57:M,58:D}),e(A,k,{44:44,45:E}),e(w,[2,39]),{39:[1,89]},e(w,[2,34],{34:90,37:S}),{32:[1,91]},{7:30,8:y,9:92,12:m,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{10:[1,93]},e(A,[2,55]),{10:[1,94]},e(A,C,{46:95,48:T,49:F,50:B,51:L,52:I,53:N,54:O,55:P,56:R}),e(Y,[2,42]),e(Y,[2,43]),e(w,[2,33],{34:96,37:S}),e(w,[2,32]),{7:97,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p},{10:[1,98]},e(A,[2,54]),{5:[2,3]},e(A,[2,50]),e(w,[2,31]),{28:[1,99],39:[2,37],40:[1,100]},e(A,[2,53]),{7:81,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,38:101},{7:81,14:10,15:11,16:i,17:a,18:u,19:o,20:s,21:c,22:l,23:h,24:f,25:d,26:p,38:102},{39:[2,35]},{39:[2,36]}],defaultActions:{7:[2,1],41:[2,4],60:[2,2],61:[2,22],94:[2,3],101:[2,35],102:[2,36]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var y=d.yylloc;i.push(y);var m=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,x,w,A,k,E,M,D=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},S={};;){if(b=n[n.length-1],this.defaultActions[b]?x=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=D()),x=a[b]&&a[b][v]),"undefined"==typeof x||!x.length||!x[0]){var C="";M=[];for(A in a[b])this.terminals_[A]&&A>l&&M.push("'"+this.terminals_[A]+"'");C=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(C,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:y,expected:M})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,_?(v=_,_=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,y=d.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[x[1]][1],S.$=r[r.length-k],S._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(S._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(S,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[x[1]][0]),r.push(S.$),i.push(S._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},$=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:return"STYLE";case 1:return"LINKSTYLE";case 2:return"CLASSDEF";case 3:return"CLASS";case 4:return"CLICK";case 5:return 12;case 6:return 13;case 7:return 47;case 8:return 35;case 9:return 36;case 10:return"DIR";case 11:return"DIR";case 12:return"DIR";case 13:return"DIR";case 14:return"DIR";case 15:return"DIR";case 16:return 17;case 17:return 23;case 18:return 18;case 19:return 28;case 20:return 40;case 21:return 32;case 22:return 21;case 23:return 22;case 24:return"ARROW_CROSS";case 25:return 57;case 26:return"ARROW_CIRCLE";case 27:return 58;case 28:return 25;case 29:return 19;case 30:return 20;case 31:return 16;case 32:return"PIPE";case 33:return"PS";case 34:return"PE";case 35:return 37;case 36:return 39;case 37:return 8;case 38:return 10;case 39:return"QUOTE";case 40:return 24;case 41:return"NEWLINE";case 42:return 5}},rules:[/^(?:style\b)/,/^(?:linkStyle\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:digraph\b)/,/^(?:subgraph\b)/,/^(?:node\b)/,/^(?:edge\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:--[x])/,/^(?:->)/,/^(?:--[o])/,/^(?:--)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u0061-\u007A\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)/,/^(?:\n)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],inclusive:!0}}};return t}();return U.lexer=$,t.prototype=U,U.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:84,fs:1,path:83}],97:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,4],r=[1,3],i=[1,5],a=[1,8,9,10,11,13,18,30,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],u=[2,2],o=[1,12],s=[1,13],c=[1,14],l=[1,15],h=[1,31],f=[1,33],d=[1,22],p=[1,34],g=[1,24],y=[1,25],m=[1,26],v=[1,27],_=[1,28],b=[1,38],x=[1,40],w=[1,35],A=[1,39],k=[1,45],E=[1,44],M=[1,36],D=[1,37],S=[1,41],C=[1,42],T=[1,43],F=[1,8,9,10,11,13,18,30,32,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],B=[1,53],L=[1,52],I=[1,54],N=[1,72],O=[1,80],P=[1,81],R=[1,66],j=[1,65],Y=[1,85],U=[1,84],$=[1,82],z=[1,83],W=[1,73],q=[1,68],V=[1,67],H=[1,63],G=[1,75],X=[1,76],Z=[1,77],K=[1,78],Q=[1,79],J=[1,70],tt=[1,69],et=[8,9,11],nt=[8,9,11,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64],rt=[1,115],it=[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,85,87,88,90,91,93,94,95,96,97],at=[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,83,85,87,88,90,91,93,94,95,96,97],ut=[1,117],ot=[1,118],st=[8,9,10,11,13,18,30,32,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],ct=[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,83,85,87,88,90,91,93,94,95,96,97],lt=[13,18,46,81,85,87,88,90,91,93,94,95,96,97],ht=[13,18,46,49,65,81,85,87,88,90,91,93,94,95,96,97],ft=[1,191],dt=[1,188],pt=[1,195],gt=[1,192],yt=[1,189],mt=[1,196],vt=[1,186],_t=[1,187],bt=[1,190],xt=[1,193],wt=[1,194],At=[1,211],kt=[8,9,11,85],Et=[8,9,10,11,46,71,80,81,83,85,87,88,89,90,91],Mt={trace:function(){},yy:{},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,commentStatement:82,PCT:83,style:84,COMMA:85,styleComponent:86,ALPHA:87,COLON:88,UNIT:89,BRKT:90,DOT:91,graphCodeTokens:92,PUNCTUATION:93,UNICODE_TEXT:94,PLUS:95,EQUALS:96,MULT:97,TAG_START:98,TAG_END:99,QUOTE:100,$accept:0,$end:1},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",83:"PCT",85:"COMMA",87:"ALPHA",88:"COLON",89:"UNIT",90:"BRKT",91:"DOT",93:"PUNCTUATION", +94:"UNICODE_TEXT",95:"PLUS",96:"EQUALS",97:"MULT",98:"TAG_START",99:"TAG_END",100:"QUOTE"},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],[82,3],[79,1],[79,3],[84,1],[84,2],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,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],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 2:this.$=[];break;case 3:a[u]!==[]&&a[u-1].push(a[u]),this.$=a[u-1];break;case 4:case 57:case 59:case 60:case 92:case 94:case 95:case 108:this.$=a[u];break;case 11:r.setDirection(a[u-1]),this.$=a[u-1];break;case 12:r.setDirection("LR"),this.$=a[u-1];break;case 13:r.setDirection("RL"),this.$=a[u-1];break;case 14:r.setDirection("BT"),this.$=a[u-1];break;case 15:r.setDirection("TB"),this.$=a[u-1];break;case 30:this.$=a[u-1];break;case 31:case 32:case 33:case 34:case 35:this.$=[];break;case 36:this.$=r.addSubGraph(a[u-1],a[u-3]);break;case 37:this.$=r.addSubGraph(a[u-1],void 0);break;case 41:r.addLink(a[u-2],a[u],a[u-1]),this.$=[a[u-2],a[u]];break;case 42:this.$=[a[u]];break;case 43:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"square");break;case 44:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"square");break;case 45:this.$=a[u-5],r.addVertex(a[u-5],a[u-2],"circle");break;case 46:this.$=a[u-6],r.addVertex(a[u-6],a[u-3],"circle");break;case 47:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"ellipse");break;case 48:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"ellipse");break;case 49:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"round");break;case 50:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"round");break;case 51:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"diamond");break;case 52:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"diamond");break;case 53:this.$=a[u-3],r.addVertex(a[u-3],a[u-1],"odd");break;case 54:this.$=a[u-4],r.addVertex(a[u-4],a[u-2],"odd");break;case 55:this.$=a[u],r.addVertex(a[u]);break;case 56:this.$=a[u-1],r.addVertex(a[u-1]);break;case 58:case 93:case 96:case 109:this.$=a[u-1]+""+a[u];break;case 61:this.$="v";break;case 62:this.$="-";break;case 63:a[u-1].text=a[u],this.$=a[u-1];break;case 64:case 65:a[u-2].text=a[u-1],this.$=a[u-2];break;case 66:this.$=a[u];break;case 67:this.$={type:"arrow",stroke:"normal",text:a[u-1]};break;case 68:this.$={type:"arrow_circle",stroke:"normal",text:a[u-1]};break;case 69:this.$={type:"arrow_cross",stroke:"normal",text:a[u-1]};break;case 70:this.$={type:"arrow_open",stroke:"normal",text:a[u-1]};break;case 71:this.$={type:"arrow",stroke:"dotted",text:a[u-1]};break;case 72:this.$={type:"arrow_circle",stroke:"dotted",text:a[u-1]};break;case 73:this.$={type:"arrow_cross",stroke:"dotted",text:a[u-1]};break;case 74:this.$={type:"arrow_open",stroke:"dotted",text:a[u-1]};break;case 75:this.$={type:"arrow",stroke:"thick",text:a[u-1]};break;case 76:this.$={type:"arrow_circle",stroke:"thick",text:a[u-1]};break;case 77:this.$={type:"arrow_cross",stroke:"thick",text:a[u-1]};break;case 78:this.$={type:"arrow_open",stroke:"thick",text:a[u-1]};break;case 79:this.$={type:"arrow",stroke:"normal"};break;case 80:this.$={type:"arrow_circle",stroke:"normal"};break;case 81:this.$={type:"arrow_cross",stroke:"normal"};break;case 82:this.$={type:"arrow_open",stroke:"normal"};break;case 83:this.$={type:"arrow",stroke:"dotted"};break;case 84:this.$={type:"arrow_circle",stroke:"dotted"};break;case 85:this.$={type:"arrow_cross",stroke:"dotted"};break;case 86:this.$={type:"arrow_open",stroke:"dotted"};break;case 87:this.$={type:"arrow",stroke:"thick"};break;case 88:this.$={type:"arrow_circle",stroke:"thick"};break;case 89:this.$={type:"arrow_cross",stroke:"thick"};break;case 90:this.$={type:"arrow_open",stroke:"thick"};break;case 91:this.$=a[u-1];break;case 110:case 111:this.$=a[u-4],r.addClass(a[u-2],a[u]);break;case 112:this.$=a[u-4],r.setClass(a[u-2],a[u]);break;case 113:this.$=a[u-4],r.setClickEvent(a[u-2],a[u],void 0,void 0);break;case 114:this.$=a[u-6],r.setClickEvent(a[u-4],a[u-2],void 0,a[u]);break;case 115:this.$=a[u-4],r.setClickEvent(a[u-2],void 0,a[u],void 0);break;case 116:this.$=a[u-6],r.setClickEvent(a[u-4],void 0,a[u-2],a[u]);break;case 117:this.$=a[u-4],r.addVertex(a[u-2],void 0,void 0,a[u]);break;case 118:case 119:case 120:this.$=a[u-4],r.updateLink(a[u-2],a[u]);break;case 122:this.$=[a[u]];break;case 123:a[u-2].push(a[u]),this.$=a[u-2];break;case 125:this.$=a[u-1]+a[u]}},table:[{3:1,4:2,9:n,10:r,12:i},{1:[3]},e(a,u,{5:6}),{4:7,9:n,10:r,12:i},{4:8,9:n,10:r,12:i},{10:[1,9]},{1:[2,1],6:10,7:11,8:o,9:s,10:c,11:l,13:h,18:f,23:16,25:17,26:18,27:19,28:20,29:21,30:d,33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:_,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},e(a,[2,9]),e(a,[2,10]),{13:[1,46],15:[1,47],16:[1,48],17:[1,49],18:[1,50]},e(F,[2,3]),e(F,[2,4]),e(F,[2,5]),e(F,[2,6]),e(F,[2,7]),e(F,[2,8]),{8:B,9:L,11:I,24:51},{8:B,9:L,11:I,24:55},{8:B,9:L,11:I,24:56},{8:B,9:L,11:I,24:57},{8:B,9:L,11:I,24:58},{8:B,9:L,11:I,24:59},{8:B,9:L,10:N,11:I,12:O,13:P,15:R,16:j,17:Y,18:U,24:61,30:$,31:60,32:z,45:71,46:W,50:q,60:V,66:62,67:H,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},e(et,[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]},e(nt,[2,55],{45:32,21:113,44:114,10:rt,13:h,15:[1,112],18:f,36:[1,108],38:[1,109],40:[1,110],42:[1,111],46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T}),e(it,[2,57]),e(it,[2,59]),e(it,[2,60]),e(it,[2,61]),e(it,[2,62]),e(at,[2,150]),e(at,[2,151]),e(at,[2,152]),e(at,[2,153]),e(at,[2,154]),e(at,[2,155]),e(at,[2,156]),e(at,[2,157]),e(at,[2,158]),e(at,[2,159]),e(at,[2,160]),{8:ut,9:ot,10:rt,14:116,21:119},{8:ut,9:ot,10:rt,14:120,21:119},{8:ut,9:ot,10:rt,14:121,21:119},{8:ut,9:ot,10:rt,14:122,21:119},{8:ut,9:ot,10:rt,14:123,21:119},e(F,[2,30]),e(F,[2,38]),e(F,[2,39]),e(F,[2,40]),e(F,[2,31]),e(F,[2,32]),e(F,[2,33]),e(F,[2,34]),e(F,[2,35]),{8:B,9:L,10:N,11:I,12:O,13:P,15:R,16:j,17:Y,18:U,24:124,30:$,32:z,45:71,46:W,50:q,60:V,66:125,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},e(st,u,{5:126}),e(ct,[2,92]),e(ct,[2,94]),e(ct,[2,139]),e(ct,[2,140]),e(ct,[2,141]),e(ct,[2,142]),e(ct,[2,143]),e(ct,[2,144]),e(ct,[2,145]),e(ct,[2,146]),e(ct,[2,147]),e(ct,[2,148]),e(ct,[2,149]),e(ct,[2,97]),e(ct,[2,98]),e(ct,[2,99]),e(ct,[2,100]),e(ct,[2,101]),e(ct,[2,102]),e(ct,[2,103]),e(ct,[2,104]),e(ct,[2,105]),e(ct,[2,106]),e(ct,[2,107]),{13:h,18:f,33:127,35:29,44:30,45:32,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},e(lt,[2,66],{48:128,49:[1,129],65:[1,130]}),{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:131,32:z,45:71,46:W,50:q,60:V,66:62,67:H,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:132,32:z,45:71,46:W,50:q,60:V,66:62,67:H,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:133,32:z,45:71,46:W,50:q,60:V,66:62,67:H,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},e(ht,[2,79]),e(ht,[2,80]),e(ht,[2,81]),e(ht,[2,82]),e(ht,[2,83]),e(ht,[2,84]),e(ht,[2,85]),e(ht,[2,86]),e(ht,[2,87]),e(ht,[2,88]),e(ht,[2,89]),e(ht,[2,90]),{13:h,18:f,35:134,44:30,45:32,46:p,80:[1,135],81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{78:[1,136],81:[1,137]},{13:h,18:f,35:139,44:30,45:32,46:p,78:[1,138],81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{13:h,18:f,35:140,44:30,45:32,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{13:h,18:f,35:141,44:30,45:32,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:142,32:z,45:71,46:W,50:q,60:V,66:62,67:H,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:144,32:z,38:[1,143],45:71,46:W,50:q,60:V,66:62,67:H,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:145,32:z,45:71,46:W,50:q,60:V,66:62,67:H,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:146,32:z,45:71,46:W,50:q,60:V,66:62,67:H,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:147,32:z,45:71,46:W,50:q,60:V,66:62,67:H,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},e(nt,[2,56]),e(it,[2,58]),e(nt,[2,29],{21:148,10:rt}),e(a,[2,11]),e(a,[2,21]),e(a,[2,22]),{9:[1,149]},e(a,[2,12]),e(a,[2,13]),e(a,[2,14]),e(a,[2,15]),e(st,u,{5:150}),e(ct,[2,93]),{6:10,7:11,8:o,9:s,10:c,11:l,13:h,18:f,23:16,25:17,26:18,27:19,28:20,29:21,30:d,32:[1,151],33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:_,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},e(et,[2,41]),e(lt,[2,63],{10:[1,152]}),{10:[1,153]},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:154,32:z,45:71,46:W,50:q,60:V,66:62,67:H,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,45:71,46:W,50:q,51:[1,155],52:[1,156],53:[1,157],54:[1,158],60:V,66:125,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,45:71,46:W,50:q,56:[1,159],57:[1,160],58:[1,161],59:[1,162],60:V,66:125,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,45:71,46:W,50:q,60:V,61:[1,163],62:[1,164],63:[1,165],64:[1,166],66:125,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:[1,167],13:h,18:f,44:114,45:32,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:[1,168]},{10:[1,169]},{10:[1,170]},{10:[1,171]},{10:[1,172],13:h,18:f,44:114,45:32,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:[1,173],13:h,18:f,44:114,45:32,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:[1,174],13:h,18:f,44:114,45:32,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,37:[1,175],45:71,46:W,50:q,60:V,66:125,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,31:176,32:z,45:71,46:W,50:q,60:V,66:62,67:H,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,39:[1,177],45:71,46:W,50:q,60:V,66:125,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,41:[1,178],45:71,46:W,50:q,60:V,66:125,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,43:[1,179],45:71,46:W,50:q,60:V,66:125,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,37:[1,180],45:71,46:W,50:q,60:V,66:125,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},e(nt,[2,28]),e(a,[2,23]),{6:10,7:11,8:o,9:s,10:c,11:l,13:h,18:f,23:16,25:17,26:18,27:19,28:20,29:21,30:d,32:[1,181],33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:_,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},e(F,[2,37]),e(lt,[2,65]),e(lt,[2,64]),{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,45:71,46:W,50:q,60:V,65:[1,182],66:125,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},e(lt,[2,67]),e(lt,[2,68]),e(lt,[2,69]),e(lt,[2,70]),e(lt,[2,71]),e(lt,[2,72]),e(lt,[2,73]),e(lt,[2,74]),e(lt,[2,75]),e(lt,[2,76]),e(lt,[2,77]),e(lt,[2,78]),{10:ft,46:dt,71:pt,79:183,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:xt,91:wt},{10:ft,46:dt,71:pt,79:197,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:xt,91:wt},{10:ft,46:dt,71:pt,79:198,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:xt,91:wt},{10:ft,46:dt,71:pt,79:199,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:xt,91:wt},{10:ft,46:dt,71:pt,79:200,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:xt,91:wt},{10:ft,46:dt,71:pt,79:201,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:xt,91:wt},{13:h,18:f,35:202,44:30,45:32,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},{13:h,18:f,35:203,44:30,45:32,46:p,67:[1,204],81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},e(nt,[2,43],{21:205,10:rt}),{10:N,12:O,13:P,15:R,16:j,17:Y,18:U,30:$,32:z,39:[1,206],45:71,46:W,50:q,60:V,66:125,70:74,71:G,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T},e(nt,[2,49],{21:207,10:rt}),e(nt,[2,47],{21:208,10:rt}),e(nt,[2,51],{21:209,10:rt}),e(nt,[2,53],{21:210,10:rt}),e(F,[2,36]),e([10,13,18,46,81,85,87,88,90,91,93,94,95,96,97],[2,91]),e(et,[2,117],{85:At}),e(kt,[2,122],{86:212,10:ft,46:dt,71:pt,80:gt,81:yt,83:mt,87:vt,88:_t,89:bt,90:xt,91:wt}),e(Et,[2,124]),e(Et,[2,126]),e(Et,[2,127]),e(Et,[2,128]),e(Et,[2,129]),e(Et,[2,130]),e(Et,[2,131]),e(Et,[2,132]),e(Et,[2,133]),e(Et,[2,134]),e(Et,[2,135]),e(Et,[2,136]),e(et,[2,118],{85:At}),e(et,[2,119],{85:At}),e(et,[2,120],{85:At}),e(et,[2,110],{85:At}),e(et,[2,111],{85:At}),e(et,[2,112],{45:32,44:114,13:h,18:f,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T}),e(et,[2,113],{45:32,44:114,10:[1,213],13:h,18:f,46:p,81:b,85:x,87:w,88:A,90:k,91:E,93:M,94:D,95:S,96:C,97:T}),e(et,[2,115],{10:[1,214]}),e(nt,[2,44]),{39:[1,215]},e(nt,[2,50]),e(nt,[2,48]),e(nt,[2,52]),e(nt,[2,54]),{10:ft,46:dt,71:pt,80:gt,81:yt,83:mt,84:216,86:185,87:vt,88:_t,89:bt,90:xt,91:wt},e(Et,[2,125]),{67:[1,217]},{67:[1,218]},e(nt,[2,45],{21:219,10:rt}),e(kt,[2,123],{86:212,10:ft,46:dt,71:pt,80:gt,81:yt,83:mt,87:vt,88:_t,89:bt,90:xt,91:wt}),e(et,[2,114]),e(et,[2,116]),e(nt,[2,46])],defaultActions:{},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var y=d.yylloc;i.push(y);var m=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,x,w,A,k,E,M,D=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},S={};;){if(b=n[n.length-1],this.defaultActions[b]?x=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=D()),x=a[b]&&a[b][v]),"undefined"==typeof x||!x.length||!x[0]){var C="";M=[];for(A in a[b])this.terminals_[A]&&A>l&&M.push("'"+this.terminals_[A]+"'");C=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(C,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:y,expected:M})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,_?(v=_,_=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,y=d.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[x[1]][1],S.$=r[r.length-k],S._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(S._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(S,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[x[1]][0]),r.push(S.$),i.push(S._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},Dt=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:break;case 1:this.begin("string");break;case 2:this.popState();break;case 3:return"STR";case 4:return 71;case 5:return 78;case 6:return 72;case 7:return 73;case 8:return 74;case 9:return 75;case 10:return 12;case 11:return 30;case 12:return 32;case 13:return 13;case 14:return 13;case 15:return 13;case 16:return 13;case 17:return 13;case 18:return 13;case 19:return 81;case 20:return 90;case 21:return 88;case 22:return 8;case 23:return 85;case 24:return 97;case 25:return 16;case 26:return 15;case 27:return 17;case 28:return 18;case 29:return 53;case 30:return 51;case 31:return 52;case 32:return 54;case 33:return 58;case 34:return 56;case 35:return 57;case 36:return 59;case 37:return 58;case 38:return 56;case 39:return 57;case 40:return 59;case 41:return 63;case 42:return 61;case 43:return 62;case 44:return 64;case 45:return 50;case 46:return 55;case 47:return 60;case 48:return 40;case 49:return 41;case 50:return 46;case 51:return 91;case 52:return 95;case 53:return 83;case 54:return 96;case 55:return 96;case 56:return 87;case 57:return 93;case 58:return 94;case 59:return 65;case 60:return 38;case 61:return 39;case 62:return 36;case 63:return 37;case 64:return 42;case 65:return 43;case 66:return 100;case 67:return 9;case 68:return 10;case 69:return 11}},rules:[/^(?:%%[^\n]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\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)/,/^(?:$)/],conditions:{string:{rules:[2,3],inclusive:!1},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],inclusive:!0}}};return t}();return Mt.lexer=Dt,t.prototype=Mt,Mt.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:84,fs:1,path:83}],98:[function(t,e,n){(function(e){"use strict";var r=t("moment"),i=t("../../logger"),a=new i.Log,u="",o="",s=[],c=[],l="";n.clear=function(){s=[],c=[],l="",o="",g=0,h=void 0,f=void 0,_=[]},n.setDateFormat=function(t){u=t},n.getDateFormat=function(){return u},n.setTitle=function(t){o=t},n.getTitle=function(){return o},n.addSection=function(t){l=t,s.push(t)},n.getTasks=function(){for(var t=x(),e=10,n=0;!t&&e>n;)t=x(),n++;return c=_};var h,f,d=function(t,e,i){i=i.trim();var u=/^after\s+([\d\w\-]+)/,o=u.exec(i.trim());if(null!==o){var s=n.findTaskById(o[1]);if("undefined"==typeof s){var c=new Date;return c.setHours(0,0,0,0),c}return s.endTime}return r(i,e.trim(),!0).isValid()?r(i,e.trim(),!0).toDate():(a.debug("Invalid date:"+i),a.debug("With date format:"+e.trim()),new Date)},p=function(t,e,n){if(n=n.trim(),r(n,e.trim(),!0).isValid())return r(n,e.trim()).toDate();var i=r(t),a=/^([\d]+)([wdhms])/,u=a.exec(n.trim());if(null!==u){switch(u[2]){case"s":i.add(u[1],"seconds");break;case"m":i.add(u[1],"minutes");break;case"h":i.add(u[1],"hours");break;case"d":i.add(u[1],"days");break;case"w":i.add(u[1],"weeks")}return i.toDate()}return i.toDate()},g=0,y=function(t){return"undefined"==typeof t?(g+=1,"task"+g):t},m=function(t,e){var r;r=":"===e.substr(0,1)?e.substr(1,e.length):e;for(var i=r.split(","),a={},u=n.getDateFormat(),o=!0;o;)o=!1,i[0].match(/^\s*active\s*$/)&&(a.active=!0,i.shift(1),o=!0),i[0].match(/^\s*done\s*$/)&&(a.done=!0,i.shift(1),o=!0),i[0].match(/^\s*crit\s*$/)&&(a.crit=!0,i.shift(1),o=!0);var s;for(s=0;sn-e?n+i+1.5*u.sidePadding>o?e+r-5:n+r+5:(n-e)/2+e+r}).attr("y",function(t,r){return r*e+u.barHeight/2+(u.fontSize/2-2)+n}).attr("text-height",i).attr("class",function(t){for(var e=w(t.startTime),n=w(t.endTime),r=this.getBBox().width,i=0,a=0;an-e?n+r+1.5*u.sidePadding>o?"taskTextOutsideLeft taskTextOutside"+i+" "+s:"taskTextOutsideRight taskTextOutside"+i+" "+s:"taskText taskText"+i+" "+s})}function l(t,e,n,a){var o,s=[[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["h1 %I:%M",function(t){return t.getMinutes()}]],c=[["%Y",function(){return!0}]],l=[["%I:%M",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}]];"undefined"!=typeof u.axisFormatter&&(l=[],u.axisFormatter.forEach(function(t){var e=[];e[0]=t[0],e[1]=t[1],l.push(e)})),o=s.concat(l).concat(c);var h=i.svg.axis().scale(w).orient("bottom").tickSize(-a+e+u.gridLineStartPadding,0,0).tickFormat(i.time.format.multi(o));r>7&&230>r&&(h=h.ticks(i.time.monday.range)),_.append("g").attr("class","grid").attr("transform","translate("+t+", "+(a-50)+")").call(h).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em")}function h(t,e){for(var n=[],r=0,i=0;i0))return i[1]*t/2+e;for(var u=0;a>u;u++)return r+=n[a-1][1],i[1]*t/2+r*t+e}).attr("class",function(t){for(var e=0;er;++r)e.hasOwnProperty(t[r])||(e[t[r]]=!0,n.push(t[r]));return n}function p(t){for(var e=t.length,n={};e;)n[t[--e]]=(n[t[e]]||0)+1;return n}function g(t,e){return p(e)[t]||0}n.yy.clear(),n.parse(t);var y=document.getElementById(e);o=y.parentElement.offsetWidth,"undefined"==typeof o&&(o=1200),"undefined"!=typeof u.useWidth&&(o=u.useWidth);var m=n.yy.getTasks(),v=m.length*(u.barHeight+u.barGap)+2*u.topPadding;y.setAttribute("height","100%"),y.setAttribute("viewBox","0 0 "+o+" "+v);var _=i.select("#"+e),b=i.min(m,function(t){return t.startTime}),x=i.max(m,function(t){return t.endTime}),w=i.time.scale().domain([i.min(m,function(t){return t.startTime}),i.max(m,function(t){return t.endTime})]).rangeRound([0,o-150]),A=[];r=a.duration(x-b).asDays();for(var k=0;kl&&M.push("'"+this.terminals_[A]+"'");C=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(C,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:y,expected:M})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,_?(v=_,_=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,y=d.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[x[1]][1],S.$=r[r.length-k],S._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(S._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(S,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[x[1]][0]),r.push(S.$),i.push(S._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},s=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 10;case 1:break;case 2:break;case 3:break;case 4:return 4;case 5:return 11;case 6:return"date";case 7:return 12;case 8:return 13;case 9:return 14;case 10:return 15;case 11:return":";case 12:return 6;case 13:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\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],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return t}();return o.lexer=s,t.prototype=o,o.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:84,fs:1,path:83}],101:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,2],r=[1,3],i=[1,4],a=[2,4],u=[1,9],o=[1,11],s=[1,12],c=[1,14],l=[1,15],h=[1,17],f=[1,18],d=[1,19],p=[1,20],g=[1,22],y=[1,23],m=[1,4,5,10,15,16,18,20,21,22,23,24,25,37],v=[4,5,10,15,16,18,20,21,22,23,25,37],_=[35,36,37],b=[1,67],x={trace:function(){},yy:{},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,text:19,loop:20,end:21,opt:22,alt:23,"else":24,note:25,placement:26,text2:27,over:28,actor_pair:29,spaceList:30,",":31,left_of:32,right_of:33,signaltype:34,"+":35,"-":36,ACTOR:37,SOLID_OPEN_ARROW:38,DOTTED_OPEN_ARROW:39,SOLID_ARROW:40,DOTTED_ARROW:41,SOLID_CROSS:42,DOTTED_CROSS:43,TXT:44,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",10:"participant",12:"AS",13:"restOfLine",15:"activate",16:"deactivate",18:"title",19:"text",20:"loop",21:"end",22:"opt",23:"alt",24:"else",25:"note",28:"over",31:",",32:"left_of",33:"right_of",35:"+",36:"-",37:"ACTOR",38:"SOLID_OPEN_ARROW",39:"DOTTED_OPEN_ARROW",40:"SOLID_ARROW",41:"DOTTED_ARROW",42:"SOLID_CROSS",43:"DOTTED_CROSS",44:"TXT"},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,4],[9,4],[9,4],[9,7],[17,4],[17,4],[30,2],[30,1],[29,3],[29,1],[26,1],[26,1],[14,5],[14,5],[14,4],[11,1],[34,1],[34,1],[34,1],[34,1],[34,1],[34,1],[27,1]],performAction:function(t,e,n,r,i,a){var u=a.length-1;switch(i){case 3:return r.apply(a[u]),a[u];case 4:this.$=[];break;case 5:a[u-1].push(a[u]),this.$=a[u-1];break;case 6:case 7:this.$=a[u];break;case 8:this.$=[];break;case 9:a[u-3].description=a[u-1],this.$=a[u-3];break;case 10:this.$=a[u-1];break;case 12:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:a[u-1]};break;case 13:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:a[u-1]};break;case 16:a[u-1].unshift({type:"loopStart",loopText:a[u-2],signalType:r.LINETYPE.LOOP_START}),a[u-1].push({type:"loopEnd",loopText:a[u-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[u-1];break;case 17:a[u-1].unshift({type:"optStart",optText:a[u-2],signalType:r.LINETYPE.OPT_START}),a[u-1].push({type:"optEnd",optText:a[u-2],signalType:r.LINETYPE.OPT_END}),this.$=a[u-1];break;case 18:a[u-4].unshift({type:"altStart",altText:a[u-5],signalType:r.LINETYPE.ALT_START}),a[u-4].push({type:"else",altText:a[u-2],signalType:r.LINETYPE.ALT_ELSE}),a[u-4]=a[u-4].concat(a[u-1]),a[u-4].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=a[u-4];break;case 19:this.$=[a[u-1],{type:"addNote",placement:a[u-2],actor:a[u-1].actor,text:a[u]}];break;case 20:a[u-2]=[].concat(a[u-1],a[u-1]).slice(0,2),a[u-2][0]=a[u-2][0].actor,a[u-2][1]=a[u-2][1].actor,this.$=[a[u-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:a[u-2].slice(0,2),text:a[u]}];break;case 23:this.$=[a[u-2],a[u]];break;case 24:this.$=a[u];break;case 25:this.$=r.PLACEMENT.LEFTOF;break;case 26:this.$=r.PLACEMENT.RIGHTOF;break;case 27:this.$=[a[u-4],a[u-1],{type:"addMessage",from:a[u-4].actor,to:a[u-1].actor,signalType:a[u-3],msg:a[u]},{type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:a[u-1]}];break;case 28:this.$=[a[u-4],a[u-1],{type:"addMessage",from:a[u-4].actor,to:a[u-1].actor,signalType:a[u-3],msg:a[u]},{type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:a[u-4]}];break;case 29:this.$=[a[u-3],a[u-1],{type:"addMessage",from:a[u-3].actor,to:a[u-1].actor,signalType:a[u-2],msg:a[u]}];break;case 30:this.$={type:"addActor",actor:a[u]};break;case 31:this.$=r.LINETYPE.SOLID_OPEN;break;case 32:this.$=r.LINETYPE.DOTTED_OPEN;break;case 33:this.$=r.LINETYPE.SOLID;break;case 34:this.$=r.LINETYPE.DOTTED;break;case 35:this.$=r.LINETYPE.SOLID_CROSS;break;case 36:this.$=r.LINETYPE.DOTTED_CROSS;break;case 37:this.$=a[u].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},e([1,4,5,10,15,16,18,20,22,23,25,37],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:u,5:o,8:8,9:10,10:s,11:21,14:13,15:c,16:l,17:16,18:h,20:f,22:d,23:p,25:g,37:y},e(m,[2,5]),{9:24,10:s,11:21,14:13,15:c,16:l,17:16,18:h,20:f,22:d,23:p,25:g,37:y},e(m,[2,7]),e(m,[2,8]),{11:25,37:y},{5:[1,26]},{11:27,37:y},{11:28,37:y},{5:[1,29]},{4:[1,30]},{13:[1,31]},{13:[1,32]},{13:[1,33]},{34:34,38:[1,35],39:[1,36],40:[1,37],41:[1,38],42:[1,39],43:[1,40]},{26:41,28:[1,42],32:[1,43],33:[1,44]},e([5,12,31,38,39,40,41,42,43,44],[2,30]),e(m,[2,6]),{5:[1,46],12:[1,45]},e(m,[2,11]),{5:[1,47]},{5:[1,48]},e(m,[2,14]),{19:[1,49]},e(v,a,{7:50}),e(v,a,{7:51}),e([4,5,10,15,16,18,20,22,23,24,25,37],a,{7:52}),{11:55,35:[1,53],36:[1,54],37:y},e(_,[2,31]),e(_,[2,32]),e(_,[2,33]),e(_,[2,34]),e(_,[2,35]),e(_,[2,36]),{11:56,37:y},{11:58,29:57,37:y},{37:[2,25]},{37:[2,26]},{13:[1,59]},e(m,[2,10]),e(m,[2,12]),e(m,[2,13]),{5:[1,60]},{4:u,5:o,8:8,9:10,10:s,11:21,14:13,15:c,16:l,17:16,18:h,20:f,21:[1,61],22:d,23:p,25:g,37:y},{4:u,5:o,8:8,9:10,10:s,11:21,14:13,15:c,16:l,17:16,18:h,20:f,21:[1,62],22:d,23:p,25:g,37:y},{4:u,5:o,8:8,9:10,10:s,11:21,14:13,15:c,16:l,17:16,18:h,20:f,22:d,23:p,24:[1,63],25:g,37:y},{11:64,37:y},{11:65,37:y},{27:66,44:b},{27:68,44:b},{27:69,44:b},{31:[1,70],44:[2,24]},{5:[1,71]},e(m,[2,15]),e(m,[2,16]),e(m,[2,17]),{13:[1,72]},{27:73,44:b},{27:74,44:b},{5:[2,29]},{5:[2,37]},{5:[2,19]},{5:[2,20]},{11:75,37:y},e(m,[2,9]),e(v,a,{7:76}),{5:[2,27]},{5:[2,28]},{44:[2,23]},{4:u,5:o,8:8,9:10,10:s,11:21,14:13,15:c,16:l,17:16,18:h,20:f,21:[1,77],22:d,23:p,25:g,37:y},e(m,[2,18])],defaultActions:{5:[2,1],6:[2,2],43:[2,25],44:[2,26],66:[2,29],67:[2,37],68:[2,19],69:[2,20],73:[2,27],74:[2,28],75:[2,23]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,u="",o=0,s=0,c=0,l=2,h=1,f=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var y=d.yylloc;i.push(y);var m=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,x,w,A,k,E,M,D=function(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},S={};;){if(b=n[n.length-1],this.defaultActions[b]?x=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=D()),x=a[b]&&a[b][v]),"undefined"==typeof x||!x.length||!x[0]){var C="";M=[];for(A in a[b])this.terminals_[A]&&A>l&&M.push("'"+this.terminals_[A]+"'");C=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(C,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:y,expected:M})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(x[0]){case 1:n.push(v),r.push(d.yytext),i.push(d.yylloc),n.push(x[1]),v=null,_?(v=_,_=null):(s=d.yyleng,u=d.yytext,o=d.yylineno,y=d.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[x[1]][1],S.$=r[r.length-k],S._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(S._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(S,[u,s,o,p.yy,x[1],r,i].concat(f)),"undefined"!=typeof w)return w;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[x[1]][0]),r.push(S.$),i.push(S._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},w=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:return this.begin("ID"),10;case 6:return this.begin("ALIAS"),37;case 7:return this.popState(),this.popState(),this.begin("LINE"),12;case 8:return this.popState(),this.popState(),5;case 9:return this.begin("LINE"),20;case 10:return this.begin("LINE"),22;case 11:return this.begin("LINE"),23;case 12:return this.begin("LINE"),24;case 13:return this.popState(),13;case 14:return 21;case 15:return 32;case 16:return 33;case 17:return 28;case 18:return 25;case 19:return this.begin("ID"),15;case 20:return this.begin("ID"),16;case 21:return 18;case 22:return 6;case 23:return 31;case 24:return 5;case 25:return e.yytext=e.yytext.trim(),37;case 26:return 40;case 27:return 41;case 28:return 38;case 29:return 39;case 30:return 42;case 31:return 43;case 32:return 44;case 33:return 35;case 34:return 36;case 35:return 5;case 36:return"INVALID"}},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,/^(?:[^#\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],conditions:{LINE:{rules:[2,3,13],inclusive:!1},ALIAS:{rules:[2,3,7,8],inclusive:!1},ID:{rules:[2,3,6],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],inclusive:!0}}};return t}();return x.lexer=w,t.prototype=x,x.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:84,fs:1,path:83}],102:[function(t,e,n){(function(e){"use strict";var r={},i=[],a=[],u=t("../../logger"),o=new u.Log;n.addActor=function(t,e,n){var i=r[t];i&&e===i.name&&null==n||(null==n&&(n=e),r[t]={name:e,description:n})},n.addMessage=function(t,e,n,r){i.push({from:t,to:e,message:n,answer:r})},n.addSignal=function(t,e,n,r){o.debug("Adding message from="+t+" to="+e+" message="+n+" type="+r),i.push({from:t,to:e,message:n,type:r})},n.getMessages=function(){return i},n.getActors=function(){return r},n.getActor=function(t){return r[t]},n.getActorKeys=function(){return Object.keys(r)},n.clear=function(){r={},i=[]},n.LINETYPE={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18},n.ARROWTYPE={FILLED:0,OPEN:1},n.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2},n.addNote=function(t,e,r){ +var u={actor:t,placement:e,message:r},o=[].concat(t,t);a.push(u),i.push({from:o[0],to:o[1],message:r,type:n.LINETYPE.NOTE,placement:e})},n.parseError=function(t,n){e.mermaidAPI.parseError(t,n)},n.apply=function(t){if(t instanceof Array)t.forEach(function(t){n.apply(t)});else switch(t.type){case"addActor":n.addActor(t.actor,t.actor,t.description);break;case"activeStart":n.addSignal(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":n.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":n.addNote(t.actor,t.placement,t.text);break;case"addMessage":n.addSignal(t.from,t.to,t.msg,t.signalType);break;case"loopStart":n.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":n.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":n.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":n.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":n.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":n.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":n.addSignal(void 0,void 0,void 0,t.signalType)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../logger":105}],103:[function(t,e,n){"use strict";var r=t("./parser/sequenceDiagram").parser;r.yy=t("./sequenceDb");var i=t("./svgDraw"),a=t("../../d3"),u=t("../../logger"),o=new u.Log,s={diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!1,bottomMarginAdj:1,activationWidth:10};n.bounds={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],init:function(){this.sequenceItems=[],this.activations=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,n,r){t[e]="undefined"==typeof t[e]?n:r(n,t[e])},updateBounds:function(t,e,r,i){function a(a){return function(c){o++;var l=u.sequenceItems.length-o+1;u.updateVal(c,"starty",e-l*s.boxMargin,Math.min),u.updateVal(c,"stopy",i+l*s.boxMargin,Math.max),u.updateVal(n.bounds.data,"startx",t-l*s.boxMargin,Math.min),u.updateVal(n.bounds.data,"stopx",r+l*s.boxMargin,Math.max),"activation"!=a&&(u.updateVal(c,"startx",t-l*s.boxMargin,Math.min),u.updateVal(c,"stopx",r+l*s.boxMargin,Math.max),u.updateVal(n.bounds.data,"starty",e-l*s.boxMargin,Math.min),u.updateVal(n.bounds.data,"stopy",i+l*s.boxMargin,Math.max))}}var u=this,o=0;this.sequenceItems.forEach(a()),this.activations.forEach(a("activation"))},insert:function(t,e,r,i){var a,u,o,s;a=Math.min(t,r),o=Math.max(t,r),u=Math.min(e,i),s=Math.max(e,i),this.updateVal(n.bounds.data,"startx",a,Math.min),this.updateVal(n.bounds.data,"starty",u,Math.min),this.updateVal(n.bounds.data,"stopx",o,Math.max),this.updateVal(n.bounds.data,"stopy",s,Math.max),this.updateBounds(a,u,o,s)},newActivation:function(t,e){var n=r.yy.getActors()[t.from.actor],a=h(t.from.actor).length,u=n.x+s.width/2+(a-1)*s.activationWidth/2;this.activations.push({startx:u,starty:this.verticalPos+2,stopx:u+s.activationWidth,stopy:void 0,actor:t.from.actor,anchored:i.anchorElement(e)})},endActivation:function(t){var e=this.activations.map(function(t){return t.actor}).lastIndexOf(t.from.actor),n=this.activations.splice(e,1)[0];return n},newLoop:function(t){this.sequenceItems.push({startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t})},endLoop:function(){var t=this.sequenceItems.pop();return t},addElseToLoop:function(t){var e=this.sequenceItems.pop();e.elsey=n.bounds.getVerticalPos(),e.elseText=t,this.sequenceItems.push(e)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}};var c=function(t,e,r,a,u){var o=i.getNoteRect();o.x=e,o.y=r,o.width=u||s.width,o["class"]="note";var c=t.append("g"),l=i.drawRect(c,o),h=i.getTextObj();h.x=e-4,h.y=r-13,h.textMargin=s.noteMargin,h.dy="1em",h.text=a.message,h["class"]="noteText";var f=i.drawText(c,h,o.width-s.noteMargin),d=f[0][0].getBBox().height;!u&&d>s.width?(f.remove(),c=t.append("g"),f=i.drawText(c,h,2*o.width-s.noteMargin),d=f[0][0].getBBox().height,l.attr("width",2*o.width),n.bounds.insert(e,r,e+2*o.width,r+2*s.noteMargin+d)):n.bounds.insert(e,r,e+o.width,r+2*s.noteMargin+d),l.attr("height",d+2*s.noteMargin),n.bounds.bumpVerticalPos(d+2*s.noteMargin)},l=function(t,e,i,a,u){var o,c=t.append("g"),l=e+(i-e)/2,h=c.append("text").attr("x",l).attr("y",a-7).style("text-anchor","middle").attr("class","messageText").text(u.message);o="undefined"!=typeof h[0][0].getBBox?h[0][0].getBBox().width:h[0][0].getBoundingClientRect();var f;if(e===i){f=c.append("path").attr("d","M "+e+","+a+" C "+(e+60)+","+(a-10)+" "+(e+60)+","+(a+30)+" "+e+","+(a+20)),n.bounds.bumpVerticalPos(30);var d=Math.max(o/2,100);n.bounds.insert(e-d,n.bounds.getVerticalPos()-10,i+d,n.bounds.getVerticalPos())}else f=c.append("line"),f.attr("x1",e),f.attr("y1",a),f.attr("x2",i),f.attr("y2",a),n.bounds.insert(e,n.bounds.getVerticalPos()-10,i,n.bounds.getVerticalPos());u.type===r.yy.LINETYPE.DOTTED||u.type===r.yy.LINETYPE.DOTTED_CROSS||u.type===r.yy.LINETYPE.DOTTED_OPEN?(f.style("stroke-dasharray","3, 3"),f.attr("class","messageLine1")):f.attr("class","messageLine0");var p="";s.arrowMarkerAbsolute&&(p=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,p=p.replace(/\(/g,"\\("),p=p.replace(/\)/g,"\\)")),f.attr("stroke-width",2),f.attr("stroke","black"),f.style("fill","none"),(u.type===r.yy.LINETYPE.SOLID||u.type===r.yy.LINETYPE.DOTTED)&&f.attr("marker-end","url("+p+"#arrowhead)"),(u.type===r.yy.LINETYPE.SOLID_CROSS||u.type===r.yy.LINETYPE.DOTTED_CROSS)&&f.attr("marker-end","url("+p+"#crosshead)")};e.exports.drawActors=function(t,e,r,a){var u;for(u=0;ue&&(r.starty=e-6,e+=12),i.drawActivation(y,r,e,s),n.bounds.insert(r.startx,e-10,r.stopx,e)}r.yy.clear(),r.parse(t+"\n"),n.bounds.init();var d,p,g,y=a.select("#"+u),m=r.yy.getActors(),v=r.yy.getActorKeys(),_=r.yy.getMessages();e.exports.drawActors(y,m,v,0),i.insertArrowHead(y),i.insertArrowCrossHead(y);var b;_.forEach(function(t){var e;switch(t.type){case r.yy.LINETYPE.NOTE:n.bounds.bumpVerticalPos(s.boxMargin),d=m[t.from].x,p=m[t.to].x,t.placement===r.yy.PLACEMENT.RIGHTOF?c(y,d+(s.width+s.actorMargin)/2,n.bounds.getVerticalPos(),t):t.placement===r.yy.PLACEMENT.LEFTOF?c(y,d-(s.width+s.actorMargin)/2,n.bounds.getVerticalPos(),t):t.to===t.from?c(y,d,n.bounds.getVerticalPos(),t):(g=Math.abs(d-p)+s.actorMargin,c(y,(d+p+s.width-g)/2,n.bounds.getVerticalPos(),t,g));break;case r.yy.LINETYPE.ACTIVE_START:n.bounds.newActivation(t,y);break;case r.yy.LINETYPE.ACTIVE_END:h(t,n.bounds.getVerticalPos());break;case r.yy.LINETYPE.LOOP_START:n.bounds.bumpVerticalPos(s.boxMargin),n.bounds.newLoop(t.message),n.bounds.bumpVerticalPos(s.boxMargin+s.boxTextMargin);break;case r.yy.LINETYPE.LOOP_END:e=n.bounds.endLoop(),i.drawLoop(y,e,"loop",s),n.bounds.bumpVerticalPos(s.boxMargin);break;case r.yy.LINETYPE.OPT_START:n.bounds.bumpVerticalPos(s.boxMargin),n.bounds.newLoop(t.message),n.bounds.bumpVerticalPos(s.boxMargin+s.boxTextMargin);break;case r.yy.LINETYPE.OPT_END:e=n.bounds.endLoop(),i.drawLoop(y,e,"opt",s),n.bounds.bumpVerticalPos(s.boxMargin);break;case r.yy.LINETYPE.ALT_START:n.bounds.bumpVerticalPos(s.boxMargin),n.bounds.newLoop(t.message),n.bounds.bumpVerticalPos(s.boxMargin+s.boxTextMargin);break;case r.yy.LINETYPE.ALT_ELSE:n.bounds.bumpVerticalPos(s.boxMargin),e=n.bounds.addElseToLoop(t.message),n.bounds.bumpVerticalPos(s.boxMargin);break;case r.yy.LINETYPE.ALT_END:e=n.bounds.endLoop(),i.drawLoop(y,e,"alt",s),n.bounds.bumpVerticalPos(s.boxMargin);break;default:try{b=t,n.bounds.bumpVerticalPos(s.messageMargin);var a=f(t.from),u=f(t.to),o=a[0]<=u[0]?1:0,v=a[0]/gi," "),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.attr("fill",e.fill),"undefined"!=typeof e["class"]&&i.attr("class",e["class"]);var a=i.append("tspan");return a.attr("x",e.x+2*e.textMargin),a.text(r),"undefined"!=typeof i.textwrap&&i.textwrap({x:e.x,y:e.y,width:n,height:1800},e.textMargin),i},n.drawLabel=function(t,e){var r=n.getNoteRect();r.x=e.x,r.y=e.y,r.width=50,r.height=20,r.fill="#526e52",r.stroke="none",r["class"]="labelBox",n.drawRect(t,r),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,e.fill="white",n.drawText(t,e)};var r=-1;n.drawActor=function(t,e,i,a,u){var o=e+u.width/2,s=t.append("g");0===i&&(r++,s.append("line").attr("id","actor"+r).attr("x1",o).attr("y1",5).attr("x2",o).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"));var c=n.getNoteRect();c.x=e,c.y=i,c.fill="#eaeaea",c.width=u.width,c.height=u.height,c["class"]="actor",c.rx=3,c.ry=3,n.drawRect(s,c),s.append("text").attr("x",o).attr("y",i+u.height/2+5).attr("class","actor").style("text-anchor","middle").text(a)},n.anchorElement=function(t){return t.append("g")},n.drawActivation=function(t,e,r){var i=n.getNoteRect(),a=e.anchored;i.x=e.startx,i.y=e.starty,i.fill="#f4f4f4",i.width=e.stopx-e.startx,i.height=r-e.starty,n.drawRect(a,i)},n.drawLoop=function(t,e,r,i){var a=t.append("g"),u=function(t,e,n,r){a.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",r).attr("stroke-width",2).attr("stroke","#526e52").attr("class","loopLine")};u(e.startx,e.starty,e.stopx,e.starty),u(e.stopx,e.starty,e.stopx,e.stopy),u(e.startx,e.stopy,e.stopx,e.stopy),u(e.startx,e.starty,e.startx,e.stopy),"undefined"!=typeof e.elsey&&u(e.startx,e.elsey,e.stopx,e.elsey);var o=n.getTextObj();o.text=r,o.x=e.startx,o.y=e.starty,o.labelMargin=15,o["class"]="labelText",o.fill="white",n.drawLabel(a,o),o=n.getTextObj(),o.text="[ "+e.title+" ]",o.x=e.startx+(e.stopx-e.startx)/2,o.y=e.starty+1.5*i.boxMargin,o.anchor="middle",o["class"]="loopText",n.drawText(a,o),"undefined"!=typeof e.elseText&&(o.text="[ "+e.elseText+" ]",o.y=e.elsey+1.5*i.boxMargin,n.drawText(a,o))},n.insertArrowHead=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},n.insertArrowCrossHead=function(t){var e=t.append("defs"),n=e.append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.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"),n.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")},n.getTextObj=function(){var t={x:0,y:0,fill:"black","text-anchor":"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0};return t},n.getNoteRect=function(){var t={x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0};return t}},{}],105:[function(t,e,n){"use strict";function r(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getSeconds(),i=t.getMilliseconds();10>e&&(e="0"+e),10>n&&(n="0"+n),10>r&&(r="0"+r),100>i&&(i="0"+i),10>i&&(i="00"+i);var a=e+":"+n+":"+r+" ("+i+")";return a}function i(t){this.level=t,this.log=function(t,e){var n=this.level;return"undefined"==typeof n&&(n=u),e>=n&&"undefined"!=typeof console&&"undefined"!=typeof console.log?console.log("["+r(new Date)+"] "+t):void 0},this.trace=function(t){this.log(t,a.trace)},this.debug=function(t){this.log(t,a.debug)},this.info=function(t){this.log(t,a.info)},this.warn=function(t){this.log(t,a.warn)},this.error=function(t){this.log(t,a.error)}}var a={debug:1,info:2,warn:3,error:4,fatal:5,"default":5},u=a.error;n.setLogLevel=function(t){u=t},n.Log=i},{}],106:[function(t,e,n){(function(e){"use strict";var r=t("./logger"),i=new r.Log,a=t("./diagrams/flowchart/graphDb"),u=t("./utils"),o=t("./diagrams/flowchart/flowRenderer"),s=t("./diagrams/sequenceDiagram/sequenceRenderer"),c=t("./diagrams/example/exampleRenderer"),l=t("./diagrams/example/parser/example"),h=t("./diagrams/flowchart/parser/flow"),f=t("./diagrams/flowchart/parser/dot"),d=t("./diagrams/sequenceDiagram/parser/sequenceDiagram"),p=t("./diagrams/sequenceDiagram/sequenceDb"),g=t("./diagrams/example/exampleDb"),y=t("./diagrams/gantt/ganttRenderer"),m=t("./diagrams/gantt/parser/gantt"),v=t("./diagrams/gantt/ganttDb"),_=t("./diagrams/classDiagram/parser/classDiagram"),b=t("./diagrams/classDiagram/classRenderer"),x=t("./diagrams/classDiagram/classDb"),w=t("./d3");SVGElement.prototype.getTransformToElement=SVGElement.prototype.getTransformToElement||function(t){return t.getScreenCTM().inverse().multiply(this.getScreenCTM())};var A={logLevel:5,cloneCssStyles:!0,startOnLoad:!0,arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequenceDiagram:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,sidePadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:3,axisFormatter:[["%I:%M",function(t){return t.getHours()}],["w. %U",function(t){return 1==t.getDay()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%m-%y",function(t){return t.getMonth()}]]},classDiagram:{},info:{}};r.setLogLevel(A.logLevel);var k=function(t){var e,n=u.detectType(t);switch(n){case"graph":e=h,e.parser.yy=a;break;case"dotGraph":e=f,e.parser.yy=a;break;case"sequenceDiagram":e=d,e.parser.yy=p;break;case"info":e=l,e.parser.yy=g;break;case"gantt":e=m,e.parser.yy=v;break;case"classDiagram":e=_,e.parser.yy=x}try{return e.parse(t),!0}catch(r){return!1}};n.parse=k,n.version=function(){return t("../package.json").version},n.encodeEntities=function(t){var e=t;return e=e.replace(/style.*:\S*#.*;/g,function(t){var e=t.substring(0,t.length-1);return e}),e=e.replace(/classDef.*:\S*#.*;/g,function(t){var e=t.substring(0,t.length-1);return e}),e=e.replace(/#\w+\;/g,function(t){var e=t.substring(1,t.length-1),n=/^\+?\d+$/.test(e);return n?"fl°°"+e+"¶ß":"fl°"+e+"¶ß"})},n.decodeEntities=function(t){var e=t;return e=e.replace(/\fl\°\°/g,function(){return"&#"}),e=e.replace(/\fl\°/g,function(){return"&"}),e=e.replace(/¶ß/g,function(){return";"})};var E=function(t,e,r,l){"undefined"!=typeof l?w.select(l).append("div").attr("id","d"+t).append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg").append("g"):w.select("body").append("div").attr("id","d"+t).append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg").append("g"),window.txt=e,e=n.encodeEntities(e);var h=w.select("#d"+t).node(),f=u.detectType(e),d={};switch(f){case"graph":A.flowchart.arrowMarkerAbsolute=A.arrowMarkerAbsolute,o.setConf(A.flowchart),o.draw(e,t,!1),A.cloneCssStyles&&(d=o.getClasses(e,!1),u.cloneCssStyles(h.firstChild,d));break;case"dotGraph":A.flowchart.arrowMarkerAbsolute=A.arrowMarkerAbsolute,o.setConf(A.flowchart),o.draw(e,t,!0),A.cloneCssStyles&&(d=o.getClasses(e,!0),u.cloneCssStyles(h.firstChild,d));break;case"sequenceDiagram":A.sequenceDiagram.arrowMarkerAbsolute=A.arrowMarkerAbsolute,s.setConf(A.sequenceDiagram),s.draw(e,t),A.cloneCssStyles&&u.cloneCssStyles(h.firstChild,[]);break;case"gantt":A.gantt.arrowMarkerAbsolute=A.arrowMarkerAbsolute,y.setConf(A.gantt),y.draw(e,t),A.cloneCssStyles&&u.cloneCssStyles(h.firstChild,[]);break;case"classDiagram":A.classDiagram.arrowMarkerAbsolute=A.arrowMarkerAbsolute,b.setConf(A.classDiagram),b.draw(e,t),A.cloneCssStyles&&u.cloneCssStyles(h.firstChild,[]);break;case"info":A.info.arrowMarkerAbsolute=A.arrowMarkerAbsolute,c.draw(e,t,n.version()),A.cloneCssStyles&&u.cloneCssStyles(h.firstChild,[])}w.select("#d"+t).selectAll("foreignobject div").attr("xmlns","http://www.w3.org/1999/xhtml");var p="";A.arrowMarkerAbsolute&&(p=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,p=p.replace(/\(/g,"\\("),p=p.replace(/\)/g,"\\)"));var g=w.select("#d"+t).node().innerHTML.replace(/url\(#arrowhead/g,"url("+p+"#arrowhead","g");g=n.decodeEntities(g),"undefined"!=typeof r?r(g,a.bindFunctions):i.warn("CB = undefined!");var m=w.select("#d"+t).node();return null!==m&&"function"==typeof m.remove&&w.select("#d"+t).node().remove(),g};n.render=function(t,e,n,r){try{if(1===arguments.length&&(e=t,t="mermaidId0"),"undefined"!=typeof document)return E(t,e,n,r)}catch(a){i.warn(a)}};var M=function(t){var e,n=Object.keys(t);for(e=0;e0&&(r+=n.selectorText+" { "+n.style.cssText+"}\n")}}catch(l){"undefined"!=typeof n&&i.warn('Invalid CSS selector "'+n.selectorText+'"',l)}var h="",f="";for(var d in e)e.hasOwnProperty(d)&&"undefined"!=typeof d&&("default"===d?(e["default"].styles instanceof Array&&(h+="#"+t.id.trim()+" .node>rect { "+e[d].styles.join("; ")+"; }\n"),e["default"].nodeLabelStyles instanceof Array&&(h+="#"+t.id.trim()+" .node text { "+e[d].nodeLabelStyles.join("; ")+"; }\n"),e["default"].edgeLabelStyles instanceof Array&&(h+="#"+t.id.trim()+" .edgeLabel text { "+e[d].edgeLabelStyles.join("; ")+"; }\n"),e["default"].clusterStyles instanceof Array&&(h+="#"+t.id.trim()+" .cluster rect { "+e[d].clusterStyles.join("; ")+"; }\n")):e[d].styles instanceof Array&&(f+="#"+t.id.trim()+" ."+d+">rect, ."+d+">polygon, ."+d+">ellipse { "+e[d].styles.join("; ")+"; }\n"));if(""!==r||""!==h||""!==f){var p=document.createElement("style");p.setAttribute("type","text/css"),p.setAttribute("title","mermaid-svg-internal-css"),p.innerHTML="/* */\n",t.insertBefore(p,t.firstChild)}};n.cloneCssStyles=u},{"./logger":105}]},{},[106])(106)}); \ No newline at end of file diff --git a/dist/mermaidAPI.slim.js b/dist/mermaidAPI.slim.js index d013afd86..c6172e57a 100644 --- a/dist/mermaidAPI.slim.js +++ b/dist/mermaidAPI.slim.js @@ -1,322 +1,6 @@ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.mermaidAPI=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0 - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift('..'); - } - } - - return parts; -} - -// Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; -var splitPath = function(filename) { - return splitPathRe.exec(filename).slice(1); -}; - -// path.resolve([from ...], to) -// posix version -exports.resolve = function() { - var resolvedPath = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) ? arguments[i] : process.cwd(); - - // Skip empty and invalid entries - if (typeof path !== 'string') { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - continue; - } - - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; - } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path - resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { - return !!p; - }), !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; -}; - -// path.normalize(path) -// posix version -exports.normalize = function(path) { - var isAbsolute = exports.isAbsolute(path), - trailingSlash = substr(path, -1) === '/'; - - // Normalize the path - path = normalizeArray(filter(path.split('/'), function(p) { - return !!p; - }), !isAbsolute).join('/'); - - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - - return (isAbsolute ? '/' : '') + path; -}; - -// posix version -exports.isAbsolute = function(path) { - return path.charAt(0) === '/'; -}; - -// posix version -exports.join = function() { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(filter(paths, function(p, index) { - if (typeof p !== 'string') { - throw new TypeError('Arguments to path.join must be strings'); - } - return p; - }).join('/')); -}; - - -// path.relative(from, to) -// posix version -exports.relative = function(from, to) { - from = exports.resolve(from).substr(1); - to = exports.resolve(to).substr(1); - - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') break; - } - - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') break; - } - - if (start > end) return []; - return arr.slice(start, end - start + 1); - } - - var fromParts = trim(from.split('/')); - var toParts = trim(to.split('/')); - - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('/'); -}; - -exports.sep = '/'; -exports.delimiter = ':'; - -exports.dirname = function(path) { - var result = splitPath(path), - root = result[0], - dir = result[1]; - - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } - - return root + dir; -}; - - -exports.basename = function(path, ext) { - var f = splitPath(path)[2]; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -exports.extname = function(path) { - return splitPath(path)[3]; -}; - -function filter (xs, f) { - if (xs.filter) return xs.filter(f); - var res = []; - for (var i = 0; i < xs.length; i++) { - if (f(xs[i], i, xs)) res.push(xs[i]); - } - return res; -} - -// String.prototype.substr - negative index don't work in IE8 -var substr = 'ab'.substr(-1) === 'b' - ? function (str, start, len) { return str.substr(start, len) } - : function (str, start, len) { - if (start < 0) start = str.length + start; - return str.substr(start, len); - } -; - -}).call(this,require('_process')) -},{"_process":3}],3:[function(require,module,exports){ -// shim for using process in browser - -var process = module.exports = {}; - -process.nextTick = (function () { - var canSetImmediate = typeof window !== 'undefined' - && window.setImmediate; - var canMutationObserver = typeof window !== 'undefined' - && window.MutationObserver; - var canPost = typeof window !== 'undefined' - && window.postMessage && window.addEventListener - ; - - if (canSetImmediate) { - return function (f) { return window.setImmediate(f) }; - } - - var queue = []; - - if (canMutationObserver) { - var hiddenDiv = document.createElement("div"); - var observer = new MutationObserver(function () { - var queueList = queue.slice(); - queue.length = 0; - queueList.forEach(function (fn) { - fn(); - }); - }); - - observer.observe(hiddenDiv, { attributes: true }); - - return function nextTick(fn) { - if (!queue.length) { - hiddenDiv.setAttribute('yes', 'no'); - } - queue.push(fn); - }; - } - - if (canPost) { - window.addEventListener('message', function (ev) { - var source = ev.source; - if ((source === window || source === null) && ev.data === 'process-tick') { - ev.stopPropagation(); - if (queue.length > 0) { - var fn = queue.shift(); - fn(); - } - } - }, true); - - return function nextTick(fn) { - queue.push(fn); - window.postMessage('process-tick', '*'); - }; - } - - return function nextTick(fn) { - setTimeout(fn, 0); - }; -})(); - -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -// TODO(shtylman) -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; - -},{}],4:[function(require,module,exports){ /** * @license * Copyright (c) 2012-2013 Chris Pettitt @@ -348,7 +32,7 @@ module.exports = { version: require("./lib/version") }; -},{"./lib/dagre":11,"./lib/graphlib":12,"./lib/intersect":13,"./lib/render":28,"./lib/util":30,"./lib/version":31}],5:[function(require,module,exports){ +},{"./lib/dagre":9,"./lib/graphlib":10,"./lib/intersect":11,"./lib/render":26,"./lib/util":28,"./lib/version":29}],3:[function(require,module,exports){ var util = require("./util"); module.exports = { @@ -412,7 +96,7 @@ function undirected(parent, id, edge, type) { util.applyStyle(path, edge[type + "Style"]); } -},{"./util":30}],6:[function(require,module,exports){ +},{"./util":28}],4:[function(require,module,exports){ var util = require("./util"), addLabel = require("./label/add-label"); @@ -457,7 +141,7 @@ function createClusters(selection, g) { return svgClusters; } -},{"./label/add-label":21,"./util":30}],7:[function(require,module,exports){ +},{"./label/add-label":19,"./util":28}],5:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -494,7 +178,7 @@ function createEdgeLabels(selection, g) { return svgEdgeLabels; } -},{"./d3":10,"./label/add-label":21,"./lodash":24,"./util":30}],8:[function(require,module,exports){ +},{"./d3":8,"./label/add-label":19,"./lodash":22,"./util":28}],6:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -626,7 +310,7 @@ function exit(svgPaths, g) { }); } -},{"./d3":10,"./intersect/intersect-node":17,"./lodash":24,"./util":30}],9:[function(require,module,exports){ +},{"./d3":8,"./intersect/intersect-node":15,"./lodash":22,"./util":28}],7:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -686,11 +370,11 @@ function createNodes(selection, g, shapes) { return svgNodes; } -},{"./d3":10,"./label/add-label":21,"./lodash":24,"./util":30}],10:[function(require,module,exports){ +},{"./d3":8,"./label/add-label":19,"./lodash":22,"./util":28}],8:[function(require,module,exports){ // Stub to get D3 either via NPM or from the global object module.exports = window.d3; -},{}],11:[function(require,module,exports){ +},{}],9:[function(require,module,exports){ /* global window */ var dagre; @@ -707,7 +391,7 @@ if (!dagre) { module.exports = dagre; -},{"dagre":53}],12:[function(require,module,exports){ +},{"dagre":30}],10:[function(require,module,exports){ /* global window */ var graphlib; @@ -724,7 +408,7 @@ if (!graphlib) { module.exports = graphlib; -},{"graphlib":32}],13:[function(require,module,exports){ +},{"graphlib":60}],11:[function(require,module,exports){ module.exports = { node: require("./intersect-node"), circle: require("./intersect-circle"), @@ -733,7 +417,7 @@ module.exports = { rect: require("./intersect-rect") }; -},{"./intersect-circle":14,"./intersect-ellipse":15,"./intersect-node":17,"./intersect-polygon":18,"./intersect-rect":19}],14:[function(require,module,exports){ +},{"./intersect-circle":12,"./intersect-ellipse":13,"./intersect-node":15,"./intersect-polygon":16,"./intersect-rect":17}],12:[function(require,module,exports){ var intersectEllipse = require("./intersect-ellipse"); module.exports = intersectCircle; @@ -742,7 +426,7 @@ function intersectCircle(node, rx, point) { return intersectEllipse(node, rx, rx, point); } -},{"./intersect-ellipse":15}],15:[function(require,module,exports){ +},{"./intersect-ellipse":13}],13:[function(require,module,exports){ module.exports = intersectEllipse; function intersectEllipse(node, rx, ry, point) { @@ -769,7 +453,7 @@ function intersectEllipse(node, rx, ry, point) { } -},{}],16:[function(require,module,exports){ +},{}],14:[function(require,module,exports){ module.exports = intersectLine; /* @@ -841,14 +525,14 @@ function sameSign(r1, r2) { return r1 * r2 > 0; } -},{}],17:[function(require,module,exports){ +},{}],15:[function(require,module,exports){ module.exports = intersectNode; function intersectNode(node, point) { return node.intersect(point); } -},{}],18:[function(require,module,exports){ +},{}],16:[function(require,module,exports){ var intersectLine = require("./intersect-line"); module.exports = intersectPolygon; @@ -905,7 +589,7 @@ function intersectPolygon(node, polyPoints, point) { return intersections[0]; } -},{"./intersect-line":16}],19:[function(require,module,exports){ +},{"./intersect-line":14}],17:[function(require,module,exports){ module.exports = intersectRect; function intersectRect(node, point) { @@ -939,7 +623,7 @@ function intersectRect(node, point) { return {x: x + sx, y: y + sy}; } -},{}],20:[function(require,module,exports){ +},{}],18:[function(require,module,exports){ var util = require("../util"); module.exports = addHtmlLabel; @@ -984,7 +668,7 @@ function addHtmlLabel(root, node) { return fo; } -},{"../util":30}],21:[function(require,module,exports){ +},{"../util":28}],19:[function(require,module,exports){ var addTextLabel = require("./add-text-label"), addHtmlLabel = require("./add-html-label"), addSVGLabel = require("./add-svg-label"); @@ -1023,7 +707,7 @@ function addLabel(root, node, location) { return labelSvg; } -},{"./add-html-label":20,"./add-svg-label":22,"./add-text-label":23}],22:[function(require,module,exports){ +},{"./add-html-label":18,"./add-svg-label":20,"./add-text-label":21}],20:[function(require,module,exports){ var util = require("../util"); module.exports = addSVGLabel; @@ -1038,7 +722,7 @@ function addSVGLabel(root, node) { return domNode; } -},{"../util":30}],23:[function(require,module,exports){ +},{"../util":28}],21:[function(require,module,exports){ var util = require("../util"); module.exports = addTextLabel; @@ -1085,7 +769,7 @@ function processEscapeSequences(text) { return newText; } -},{"../util":30}],24:[function(require,module,exports){ +},{"../util":28}],22:[function(require,module,exports){ /* global window */ var lodash; @@ -1102,7 +786,7 @@ if (!lodash) { module.exports = lodash; -},{"lodash":52}],25:[function(require,module,exports){ +},{"lodash":80}],23:[function(require,module,exports){ "use strict"; var util = require("./util"), @@ -1138,7 +822,7 @@ function positionClusters(selection, g) { } -},{"./d3":10,"./util":30}],26:[function(require,module,exports){ +},{"./d3":8,"./util":28}],24:[function(require,module,exports){ "use strict"; var util = require("./util"), @@ -1162,7 +846,7 @@ function positionEdgeLabels(selection, g) { .attr("transform", translate); } -},{"./d3":10,"./lodash":24,"./util":30}],27:[function(require,module,exports){ +},{"./d3":8,"./lodash":22,"./util":28}],25:[function(require,module,exports){ "use strict"; var util = require("./util"), @@ -1185,7 +869,7 @@ function positionNodes(selection, g) { .attr("transform", translate); } -},{"./d3":10,"./util":30}],28:[function(require,module,exports){ +},{"./d3":8,"./util":28}],26:[function(require,module,exports){ var _ = require("./lodash"), layout = require("./dagre").layout; @@ -1354,7 +1038,7 @@ function createOrSelectGroup(root, name) { return selection; } -},{"./arrows":5,"./create-clusters":6,"./create-edge-labels":7,"./create-edge-paths":8,"./create-nodes":9,"./dagre":11,"./lodash":24,"./position-clusters":25,"./position-edge-labels":26,"./position-nodes":27,"./shapes":29}],29:[function(require,module,exports){ +},{"./arrows":3,"./create-clusters":4,"./create-edge-labels":5,"./create-edge-paths":6,"./create-nodes":7,"./dagre":9,"./lodash":22,"./position-clusters":23,"./position-edge-labels":24,"./position-nodes":25,"./shapes":27}],27:[function(require,module,exports){ "use strict"; var intersectRect = require("./intersect/intersect-rect"), @@ -1437,7 +1121,7 @@ function diamond(parent, bbox, node) { return shapeSvg; } -},{"./intersect/intersect-circle":14,"./intersect/intersect-ellipse":15,"./intersect/intersect-polygon":18,"./intersect/intersect-rect":19}],30:[function(require,module,exports){ +},{"./intersect/intersect-circle":12,"./intersect/intersect-ellipse":13,"./intersect/intersect-polygon":16,"./intersect/intersect-rect":17}],28:[function(require,module,exports){ var _ = require("./lodash"); // Public utility functions @@ -1493,10 +1177,2912 @@ function applyTransition(selection, g) { return selection; } -},{"./lodash":24}],31:[function(require,module,exports){ +},{"./lodash":22}],29:[function(require,module,exports){ module.exports = "0.4.10"; -},{}],32:[function(require,module,exports){ +},{}],30:[function(require,module,exports){ +/* +Copyright (c) 2012-2014 Chris Pettitt + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +module.exports = { + graphlib: require("./lib/graphlib"), + + layout: require("./lib/layout"), + debug: require("./lib/debug"), + util: { + time: require("./lib/util").time, + notime: require("./lib/util").notime + }, + version: require("./lib/version") +}; + +},{"./lib/debug":35,"./lib/graphlib":36,"./lib/layout":38,"./lib/util":58,"./lib/version":59}],31:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"), + greedyFAS = require("./greedy-fas"); + +module.exports = { + run: run, + undo: undo +}; + +function run(g) { + var fas = (g.graph().acyclicer === "greedy" + ? greedyFAS(g, weightFn(g)) + : dfsFAS(g)); + _.each(fas, function(e) { + var label = g.edge(e); + g.removeEdge(e); + label.forwardName = e.name; + label.reversed = true; + g.setEdge(e.w, e.v, label, _.uniqueId("rev")); + }); + + function weightFn(g) { + return function(e) { + return g.edge(e).weight; + }; + } +} + +function dfsFAS(g) { + var fas = [], + stack = {}, + visited = {}; + + function dfs(v) { + if (_.has(visited, v)) { + return; + } + visited[v] = true; + stack[v] = true; + _.each(g.outEdges(v), function(e) { + if (_.has(stack, e.w)) { + fas.push(e); + } else { + dfs(e.w); + } + }); + delete stack[v]; + } + + _.each(g.nodes(), dfs); + return fas; +} + +function undo(g) { + _.each(g.edges(), function(e) { + var label = g.edge(e); + if (label.reversed) { + g.removeEdge(e); + + var forwardName = label.forwardName; + delete label.reversed; + delete label.forwardName; + g.setEdge(e.w, e.v, label, forwardName); + } + }); +} + +},{"./greedy-fas":37,"./lodash":39}],32:[function(require,module,exports){ +var _ = require("./lodash"), + util = require("./util"); + +module.exports = addBorderSegments; + +function addBorderSegments(g) { + function dfs(v) { + var children = g.children(v), + node = g.node(v); + if (children.length) { + _.each(children, dfs); + } + + if (_.has(node, "minRank")) { + node.borderLeft = []; + node.borderRight = []; + for (var rank = node.minRank, maxRank = node.maxRank + 1; + rank < maxRank; + ++rank) { + addBorderNode(g, "borderLeft", "_bl", v, node, rank); + addBorderNode(g, "borderRight", "_br", v, node, rank); + } + } + } + + _.each(g.children(), dfs); +} + +function addBorderNode(g, prop, prefix, sg, sgNode, rank) { + var label = { width: 0, height: 0, rank: rank, borderType: prop }, + prev = sgNode[prop][rank - 1], + curr = util.addDummyNode(g, "border", label, prefix); + sgNode[prop][rank] = curr; + g.setParent(curr, sg); + if (prev) { + g.setEdge(prev, curr, { weight: 1 }); + } +} + +},{"./lodash":39,"./util":58}],33:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"); + +module.exports = { + adjust: adjust, + undo: undo +}; + +function adjust(g) { + var rankDir = g.graph().rankdir.toLowerCase(); + if (rankDir === "lr" || rankDir === "rl") { + swapWidthHeight(g); + } +} + +function undo(g) { + var rankDir = g.graph().rankdir.toLowerCase(); + if (rankDir === "bt" || rankDir === "rl") { + reverseY(g); + } + + if (rankDir === "lr" || rankDir === "rl") { + swapXY(g); + swapWidthHeight(g); + } +} + +function swapWidthHeight(g) { + _.each(g.nodes(), function(v) { swapWidthHeightOne(g.node(v)); }); + _.each(g.edges(), function(e) { swapWidthHeightOne(g.edge(e)); }); +} + +function swapWidthHeightOne(attrs) { + var w = attrs.width; + attrs.width = attrs.height; + attrs.height = w; +} + +function reverseY(g) { + _.each(g.nodes(), function(v) { reverseYOne(g.node(v)); }); + + _.each(g.edges(), function(e) { + var edge = g.edge(e); + _.each(edge.points, reverseYOne); + if (_.has(edge, "y")) { + reverseYOne(edge); + } + }); +} + +function reverseYOne(attrs) { + attrs.y = -attrs.y; +} + +function swapXY(g) { + _.each(g.nodes(), function(v) { swapXYOne(g.node(v)); }); + + _.each(g.edges(), function(e) { + var edge = g.edge(e); + _.each(edge.points, swapXYOne); + if (_.has(edge, "x")) { + swapXYOne(edge); + } + }); +} + +function swapXYOne(attrs) { + var x = attrs.x; + attrs.x = attrs.y; + attrs.y = x; +} + +},{"./lodash":39}],34:[function(require,module,exports){ +/* + * Simple doubly linked list implementation derived from Cormen, et al., + * "Introduction to Algorithms". + */ + +module.exports = List; + +function List() { + var sentinel = {}; + sentinel._next = sentinel._prev = sentinel; + this._sentinel = sentinel; +} + +List.prototype.dequeue = function() { + var sentinel = this._sentinel, + entry = sentinel._prev; + if (entry !== sentinel) { + unlink(entry); + return entry; + } +}; + +List.prototype.enqueue = function(entry) { + var sentinel = this._sentinel; + if (entry._prev && entry._next) { + unlink(entry); + } + entry._next = sentinel._next; + sentinel._next._prev = entry; + sentinel._next = entry; + entry._prev = sentinel; +}; + +List.prototype.toString = function() { + var strs = [], + sentinel = this._sentinel, + curr = sentinel._prev; + while (curr !== sentinel) { + strs.push(JSON.stringify(curr, filterOutLinks)); + curr = curr._prev; + } + return "[" + strs.join(", ") + "]"; +}; + +function unlink(entry) { + entry._prev._next = entry._next; + entry._next._prev = entry._prev; + delete entry._next; + delete entry._prev; +} + +function filterOutLinks(k, v) { + if (k !== "_next" && k !== "_prev") { + return v; + } +} + +},{}],35:[function(require,module,exports){ +var _ = require("./lodash"), + util = require("./util"), + Graph = require("./graphlib").Graph; + +module.exports = { + debugOrdering: debugOrdering +}; + +/* istanbul ignore next */ +function debugOrdering(g) { + var layerMatrix = util.buildLayerMatrix(g); + + var h = new Graph({ compound: true, multigraph: true }).setGraph({}); + + _.each(g.nodes(), function(v) { + h.setNode(v, { label: v }); + h.setParent(v, "layer" + g.node(v).rank); + }); + + _.each(g.edges(), function(e) { + h.setEdge(e.v, e.w, {}, e.name); + }); + + _.each(layerMatrix, function(layer, i) { + var layerV = "layer" + i; + h.setNode(layerV, { rank: "same" }); + _.reduce(layer, function(u, v) { + h.setEdge(u, v, { style: "invis" }); + return v; + }); + }); + + return h; +} + +},{"./graphlib":36,"./lodash":39,"./util":58}],36:[function(require,module,exports){ +/* global window */ + +var graphlib; + +if (typeof require === "function") { + try { + graphlib = require("graphlib"); + } catch (e) {} +} + +if (!graphlib) { + graphlib = window.graphlib; +} + +module.exports = graphlib; + +},{"graphlib":60}],37:[function(require,module,exports){ +var _ = require("./lodash"), + Graph = require("./graphlib").Graph, + List = require("./data/list"); + +/* + * A greedy heuristic for finding a feedback arc set for a graph. A feedback + * arc set is a set of edges that can be removed to make a graph acyclic. + * The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, "A fast and + * effective heuristic for the feedback arc set problem." This implementation + * adjusts that from the paper to allow for weighted edges. + */ +module.exports = greedyFAS; + +var DEFAULT_WEIGHT_FN = _.constant(1); + +function greedyFAS(g, weightFn) { + if (g.nodeCount() <= 1) { + return []; + } + var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN); + var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx); + + // Expand multi-edges + return _.flatten(_.map(results, function(e) { + return g.outEdges(e.v, e.w); + }), true); +} + +function doGreedyFAS(g, buckets, zeroIdx) { + var results = [], + sources = buckets[buckets.length - 1], + sinks = buckets[0]; + + var entry; + while (g.nodeCount()) { + while ((entry = sinks.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } + while ((entry = sources.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } + if (g.nodeCount()) { + for (var i = buckets.length - 2; i > 0; --i) { + entry = buckets[i].dequeue(); + if (entry) { + results = results.concat(removeNode(g, buckets, zeroIdx, entry, true)); + break; + } + } + } + } + + return results; +} + +function removeNode(g, buckets, zeroIdx, entry, collectPredecessors) { + var results = collectPredecessors ? [] : undefined; + + _.each(g.inEdges(entry.v), function(edge) { + var weight = g.edge(edge), + uEntry = g.node(edge.v); + + if (collectPredecessors) { + results.push({ v: edge.v, w: edge.w }); + } + + uEntry.out -= weight; + assignBucket(buckets, zeroIdx, uEntry); + }); + + _.each(g.outEdges(entry.v), function(edge) { + var weight = g.edge(edge), + w = edge.w, + wEntry = g.node(w); + wEntry["in"] -= weight; + assignBucket(buckets, zeroIdx, wEntry); + }); + + g.removeNode(entry.v); + + return results; +} + +function buildState(g, weightFn) { + var fasGraph = new Graph(), + maxIn = 0, + maxOut = 0; + + _.each(g.nodes(), function(v) { + fasGraph.setNode(v, { v: v, "in": 0, out: 0 }); + }); + + // Aggregate weights on nodes, but also sum the weights across multi-edges + // into a single edge for the fasGraph. + _.each(g.edges(), function(e) { + var prevWeight = fasGraph.edge(e.v, e.w) || 0, + weight = weightFn(e), + edgeWeight = prevWeight + weight; + fasGraph.setEdge(e.v, e.w, edgeWeight); + maxOut = Math.max(maxOut, fasGraph.node(e.v).out += weight); + maxIn = Math.max(maxIn, fasGraph.node(e.w)["in"] += weight); + }); + + var buckets = _.range(maxOut + maxIn + 3).map(function() { return new List(); }); + var zeroIdx = maxIn + 1; + + _.each(fasGraph.nodes(), function(v) { + assignBucket(buckets, zeroIdx, fasGraph.node(v)); + }); + + return { graph: fasGraph, buckets: buckets, zeroIdx: zeroIdx }; +} + +function assignBucket(buckets, zeroIdx, entry) { + if (!entry.out) { + buckets[0].enqueue(entry); + } else if (!entry["in"]) { + buckets[buckets.length - 1].enqueue(entry); + } else { + buckets[entry.out - entry["in"] + zeroIdx].enqueue(entry); + } +} + +},{"./data/list":34,"./graphlib":36,"./lodash":39}],38:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"), + acyclic = require("./acyclic"), + normalize = require("./normalize"), + rank = require("./rank"), + normalizeRanks = require("./util").normalizeRanks, + parentDummyChains = require("./parent-dummy-chains"), + removeEmptyRanks = require("./util").removeEmptyRanks, + nestingGraph = require("./nesting-graph"), + addBorderSegments = require("./add-border-segments"), + coordinateSystem = require("./coordinate-system"), + order = require("./order"), + position = require("./position"), + util = require("./util"), + Graph = require("./graphlib").Graph; + +module.exports = layout; + +function layout(g, opts) { + var time = opts && opts.debugTiming ? util.time : util.notime; + time("layout", function() { + var layoutGraph = time(" buildLayoutGraph", + function() { return buildLayoutGraph(g); }); + time(" runLayout", function() { runLayout(layoutGraph, time); }); + time(" updateInputGraph", function() { updateInputGraph(g, layoutGraph); }); + }); +} + +function runLayout(g, time) { + time(" makeSpaceForEdgeLabels", function() { makeSpaceForEdgeLabels(g); }); + time(" removeSelfEdges", function() { removeSelfEdges(g); }); + time(" acyclic", function() { acyclic.run(g); }); + time(" nestingGraph.run", function() { nestingGraph.run(g); }); + time(" rank", function() { rank(util.asNonCompoundGraph(g)); }); + time(" injectEdgeLabelProxies", function() { injectEdgeLabelProxies(g); }); + time(" removeEmptyRanks", function() { removeEmptyRanks(g); }); + time(" nestingGraph.cleanup", function() { nestingGraph.cleanup(g); }); + time(" normalizeRanks", function() { normalizeRanks(g); }); + time(" assignRankMinMax", function() { assignRankMinMax(g); }); + time(" removeEdgeLabelProxies", function() { removeEdgeLabelProxies(g); }); + time(" normalize.run", function() { normalize.run(g); }); + time(" parentDummyChains", function() { parentDummyChains(g); }); + time(" addBorderSegments", function() { addBorderSegments(g); }); + time(" order", function() { order(g); }); + time(" insertSelfEdges", function() { insertSelfEdges(g); }); + time(" adjustCoordinateSystem", function() { coordinateSystem.adjust(g); }); + time(" position", function() { position(g); }); + time(" positionSelfEdges", function() { positionSelfEdges(g); }); + time(" removeBorderNodes", function() { removeBorderNodes(g); }); + time(" normalize.undo", function() { normalize.undo(g); }); + time(" fixupEdgeLabelCoords", function() { fixupEdgeLabelCoords(g); }); + time(" undoCoordinateSystem", function() { coordinateSystem.undo(g); }); + time(" translateGraph", function() { translateGraph(g); }); + time(" assignNodeIntersects", function() { assignNodeIntersects(g); }); + time(" reversePoints", function() { reversePointsForReversedEdges(g); }); + time(" acyclic.undo", function() { acyclic.undo(g); }); +} + +/* + * Copies final layout information from the layout graph back to the input + * graph. This process only copies whitelisted attributes from the layout graph + * to the input graph, so it serves as a good place to determine what + * attributes can influence layout. + */ +function updateInputGraph(inputGraph, layoutGraph) { + _.each(inputGraph.nodes(), function(v) { + var inputLabel = inputGraph.node(v), + layoutLabel = layoutGraph.node(v); + + if (inputLabel) { + inputLabel.x = layoutLabel.x; + inputLabel.y = layoutLabel.y; + + if (layoutGraph.children(v).length) { + inputLabel.width = layoutLabel.width; + inputLabel.height = layoutLabel.height; + } + } + }); + + _.each(inputGraph.edges(), function(e) { + var inputLabel = inputGraph.edge(e), + layoutLabel = layoutGraph.edge(e); + + inputLabel.points = layoutLabel.points; + if (_.has(layoutLabel, "x")) { + inputLabel.x = layoutLabel.x; + inputLabel.y = layoutLabel.y; + } + }); + + inputGraph.graph().width = layoutGraph.graph().width; + inputGraph.graph().height = layoutGraph.graph().height; +} + +var graphNumAttrs = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], + graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, + graphAttrs = ["acyclicer", "ranker", "rankdir", "align"], + nodeNumAttrs = ["width", "height"], + nodeDefaults = { width: 0, height: 0 }, + edgeNumAttrs = ["minlen", "weight", "width", "height", "labeloffset"], + edgeDefaults = { + minlen: 1, weight: 1, width: 0, height: 0, + labeloffset: 10, labelpos: "r" + }, + edgeAttrs = ["labelpos"]; + +/* + * Constructs a new graph from the input graph, which can be used for layout. + * This process copies only whitelisted attributes from the input graph to the + * layout graph. Thus this function serves as a good place to determine what + * attributes can influence layout. + */ +function buildLayoutGraph(inputGraph) { + var g = new Graph({ multigraph: true, compound: true }), + graph = canonicalize(inputGraph.graph()); + + g.setGraph(_.merge({}, + graphDefaults, + selectNumberAttrs(graph, graphNumAttrs), + _.pick(graph, graphAttrs))); + + _.each(inputGraph.nodes(), function(v) { + var node = canonicalize(inputGraph.node(v)); + g.setNode(v, _.defaults(selectNumberAttrs(node, nodeNumAttrs), nodeDefaults)); + g.setParent(v, inputGraph.parent(v)); + }); + + _.each(inputGraph.edges(), function(e) { + var edge = canonicalize(inputGraph.edge(e)); + g.setEdge(e, _.merge({}, + edgeDefaults, + selectNumberAttrs(edge, edgeNumAttrs), + _.pick(edge, edgeAttrs))); + }); + + return g; +} + +/* + * This idea comes from the Gansner paper: to account for edge labels in our + * layout we split each rank in half by doubling minlen and halving ranksep. + * Then we can place labels at these mid-points between nodes. + * + * We also add some minimal padding to the width to push the label for the edge + * away from the edge itself a bit. + */ +function makeSpaceForEdgeLabels(g) { + var graph = g.graph(); + graph.ranksep /= 2; + _.each(g.edges(), function(e) { + var edge = g.edge(e); + edge.minlen *= 2; + if (edge.labelpos.toLowerCase() !== "c") { + if (graph.rankdir === "TB" || graph.rankdir === "BT") { + edge.width += edge.labeloffset; + } else { + edge.height += edge.labeloffset; + } + } + }); +} + +/* + * Creates temporary dummy nodes that capture the rank in which each edge's + * label is going to, if it has one of non-zero width and height. We do this + * so that we can safely remove empty ranks while preserving balance for the + * label's position. + */ +function injectEdgeLabelProxies(g) { + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (edge.width && edge.height) { + var v = g.node(e.v), + w = g.node(e.w), + label = { rank: (w.rank - v.rank) / 2 + v.rank, e: e }; + util.addDummyNode(g, "edge-proxy", label, "_ep"); + } + }); +} + +function assignRankMinMax(g) { + var maxRank = 0; + _.each(g.nodes(), function(v) { + var node = g.node(v); + if (node.borderTop) { + node.minRank = g.node(node.borderTop).rank; + node.maxRank = g.node(node.borderBottom).rank; + maxRank = _.max(maxRank, node.maxRank); + } + }); + g.graph().maxRank = maxRank; +} + +function removeEdgeLabelProxies(g) { + _.each(g.nodes(), function(v) { + var node = g.node(v); + if (node.dummy === "edge-proxy") { + g.edge(node.e).labelRank = node.rank; + g.removeNode(v); + } + }); +} + +function translateGraph(g) { + var minX = Number.POSITIVE_INFINITY, + maxX = 0, + minY = Number.POSITIVE_INFINITY, + maxY = 0, + graphLabel = g.graph(), + marginX = graphLabel.marginx || 0, + marginY = graphLabel.marginy || 0; + + function getExtremes(attrs) { + var x = attrs.x, + y = attrs.y, + w = attrs.width, + h = attrs.height; + minX = Math.min(minX, x - w / 2); + maxX = Math.max(maxX, x + w / 2); + minY = Math.min(minY, y - h / 2); + maxY = Math.max(maxY, y + h / 2); + } + + _.each(g.nodes(), function(v) { getExtremes(g.node(v)); }); + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (_.has(edge, "x")) { + getExtremes(edge); + } + }); + + minX -= marginX; + minY -= marginY; + + _.each(g.nodes(), function(v) { + var node = g.node(v); + node.x -= minX; + node.y -= minY; + }); + + _.each(g.edges(), function(e) { + var edge = g.edge(e); + _.each(edge.points, function(p) { + p.x -= minX; + p.y -= minY; + }); + if (_.has(edge, "x")) { edge.x -= minX; } + if (_.has(edge, "y")) { edge.y -= minY; } + }); + + graphLabel.width = maxX - minX + marginX; + graphLabel.height = maxY - minY + marginY; +} + +function assignNodeIntersects(g) { + _.each(g.edges(), function(e) { + var edge = g.edge(e), + nodeV = g.node(e.v), + nodeW = g.node(e.w), + p1, p2; + if (!edge.points) { + edge.points = []; + p1 = nodeW; + p2 = nodeV; + } else { + p1 = edge.points[0]; + p2 = edge.points[edge.points.length - 1]; + } + edge.points.unshift(util.intersectRect(nodeV, p1)); + edge.points.push(util.intersectRect(nodeW, p2)); + }); +} + +function fixupEdgeLabelCoords(g) { + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (_.has(edge, "x")) { + if (edge.labelpos === "l" || edge.labelpos === "r") { + edge.width -= edge.labeloffset; + } + switch (edge.labelpos) { + case "l": edge.x -= edge.width / 2 + edge.labeloffset; break; + case "r": edge.x += edge.width / 2 + edge.labeloffset; break; + } + } + }); +} + +function reversePointsForReversedEdges(g) { + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (edge.reversed) { + edge.points.reverse(); + } + }); +} + +function removeBorderNodes(g) { + _.each(g.nodes(), function(v) { + if (g.children(v).length) { + var node = g.node(v), + t = g.node(node.borderTop), + b = g.node(node.borderBottom), + l = g.node(_.last(node.borderLeft)), + r = g.node(_.last(node.borderRight)); + + node.width = Math.abs(r.x - l.x); + node.height = Math.abs(b.y - t.y); + node.x = l.x + node.width / 2; + node.y = t.y + node.height / 2; + } + }); + + _.each(g.nodes(), function(v) { + if (g.node(v).dummy === "border") { + g.removeNode(v); + } + }); +} + +function removeSelfEdges(g) { + _.each(g.edges(), function(e) { + if (e.v === e.w) { + var node = g.node(e.v); + if (!node.selfEdges) { + node.selfEdges = []; + } + node.selfEdges.push({ e: e, label: g.edge(e) }); + g.removeEdge(e); + } + }); +} + +function insertSelfEdges(g) { + var layers = util.buildLayerMatrix(g); + _.each(layers, function(layer) { + var orderShift = 0; + _.each(layer, function(v, i) { + var node = g.node(v); + node.order = i + orderShift; + _.each(node.selfEdges, function(selfEdge) { + util.addDummyNode(g, "selfedge", { + width: selfEdge.label.width, + height: selfEdge.label.height, + rank: node.rank, + order: i + (++orderShift), + e: selfEdge.e, + label: selfEdge.label + }, "_se"); + }); + delete node.selfEdges; + }); + }); +} + +function positionSelfEdges(g) { + _.each(g.nodes(), function(v) { + var node = g.node(v); + if (node.dummy === "selfedge") { + var selfNode = g.node(node.e.v), + x = selfNode.x + selfNode.width / 2, + y = selfNode.y, + dx = node.x - x, + dy = selfNode.height / 2; + g.setEdge(node.e, node.label); + g.removeNode(v); + node.label.points = [ + { x: x + 2 * dx / 3, y: y - dy }, + { x: x + 5 * dx / 6, y: y - dy }, + { x: x + dx , y: y }, + { x: x + 5 * dx / 6, y: y + dy }, + { x: x + 2 * dx / 3, y: y + dy }, + ]; + node.label.x = node.x; + node.label.y = node.y; + } + }); +} + +function selectNumberAttrs(obj, attrs) { + return _.mapValues(_.pick(obj, attrs), Number); +} + +function canonicalize(attrs) { + var newAttrs = {}; + _.each(attrs, function(v, k) { + newAttrs[k.toLowerCase()] = v; + }); + return newAttrs; +} + +},{"./acyclic":31,"./add-border-segments":32,"./coordinate-system":33,"./graphlib":36,"./lodash":39,"./nesting-graph":40,"./normalize":41,"./order":46,"./parent-dummy-chains":51,"./position":53,"./rank":55,"./util":58}],39:[function(require,module,exports){ +/* global window */ + +var lodash; + +if (typeof require === "function") { + try { + lodash = require("lodash"); + } catch (e) {} +} + +if (!lodash) { + lodash = window._; +} + +module.exports = lodash; + +},{"lodash":80}],40:[function(require,module,exports){ +var _ = require("./lodash"), + util = require("./util"); + +module.exports = { + run: run, + cleanup: cleanup +}; + +/* + * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs, + * adds appropriate edges to ensure that all cluster nodes are placed between + * these boundries, and ensures that the graph is connected. + * + * In addition we ensure, through the use of the minlen property, that nodes + * and subgraph border nodes to not end up on the same rank. + * + * Preconditions: + * + * 1. Input graph is a DAG + * 2. Nodes in the input graph has a minlen attribute + * + * Postconditions: + * + * 1. Input graph is connected. + * 2. Dummy nodes are added for the tops and bottoms of subgraphs. + * 3. The minlen attribute for nodes is adjusted to ensure nodes do not + * get placed on the same rank as subgraph border nodes. + * + * The nesting graph idea comes from Sander, "Layout of Compound Directed + * Graphs." + */ +function run(g) { + var root = util.addDummyNode(g, "root", {}, "_root"), + depths = treeDepths(g), + height = _.max(depths) - 1, + nodeSep = 2 * height + 1; + + g.graph().nestingRoot = root; + + // Multiply minlen by nodeSep to align nodes on non-border ranks. + _.each(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; }); + + // Calculate a weight that is sufficient to keep subgraphs vertically compact + var weight = sumWeights(g) + 1; + + // Create border nodes and link them up + _.each(g.children(), function(child) { + dfs(g, root, nodeSep, weight, height, depths, child); + }); + + // Save the multiplier for node layers for later removal of empty border + // layers. + g.graph().nodeRankFactor = nodeSep; +} + +function dfs(g, root, nodeSep, weight, height, depths, v) { + var children = g.children(v); + if (!children.length) { + if (v !== root) { + g.setEdge(root, v, { weight: 0, minlen: nodeSep }); + } + return; + } + + var top = util.addBorderNode(g, "_bt"), + bottom = util.addBorderNode(g, "_bb"), + label = g.node(v); + + g.setParent(top, v); + label.borderTop = top; + g.setParent(bottom, v); + label.borderBottom = bottom; + + _.each(children, function(child) { + dfs(g, root, nodeSep, weight, height, depths, child); + + var childNode = g.node(child), + childTop = childNode.borderTop ? childNode.borderTop : child, + childBottom = childNode.borderBottom ? childNode.borderBottom : child, + thisWeight = childNode.borderTop ? weight : 2 * weight, + minlen = childTop !== childBottom ? 1 : height - depths[v] + 1; + + g.setEdge(top, childTop, { + weight: thisWeight, + minlen: minlen, + nestingEdge: true + }); + + g.setEdge(childBottom, bottom, { + weight: thisWeight, + minlen: minlen, + nestingEdge: true + }); + }); + + if (!g.parent(v)) { + g.setEdge(root, top, { weight: 0, minlen: height + depths[v] }); + } +} + +function treeDepths(g) { + var depths = {}; + function dfs(v, depth) { + var children = g.children(v); + if (children && children.length) { + _.each(children, function(child) { + dfs(child, depth + 1); + }); + } + depths[v] = depth; + } + _.each(g.children(), function(v) { dfs(v, 1); }); + return depths; +} + +function sumWeights(g) { + return _.reduce(g.edges(), function(acc, e) { + return acc + g.edge(e).weight; + }, 0); +} + +function cleanup(g) { + var graphLabel = g.graph(); + g.removeNode(graphLabel.nestingRoot); + delete graphLabel.nestingRoot; + _.each(g.edges(), function(e) { + var edge = g.edge(e); + if (edge.nestingEdge) { + g.removeEdge(e); + } + }); +} + +},{"./lodash":39,"./util":58}],41:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"), + util = require("./util"); + +module.exports = { + run: run, + undo: undo +}; + +/* + * Breaks any long edges in the graph into short segments that span 1 layer + * each. This operation is undoable with the denormalize function. + * + * Pre-conditions: + * + * 1. The input graph is a DAG. + * 2. Each node in the graph has a "rank" property. + * + * Post-condition: + * + * 1. All edges in the graph have a length of 1. + * 2. Dummy nodes are added where edges have been split into segments. + * 3. The graph is augmented with a "dummyChains" attribute which contains + * the first dummy in each chain of dummy nodes produced. + */ +function run(g) { + g.graph().dummyChains = []; + _.each(g.edges(), function(edge) { normalizeEdge(g, edge); }); +} + +function normalizeEdge(g, e) { + var v = e.v, + vRank = g.node(v).rank, + w = e.w, + wRank = g.node(w).rank, + name = e.name, + edgeLabel = g.edge(e), + labelRank = edgeLabel.labelRank; + + if (wRank === vRank + 1) return; + + g.removeEdge(e); + + var dummy, attrs, i; + for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) { + edgeLabel.points = []; + attrs = { + width: 0, height: 0, + edgeLabel: edgeLabel, edgeObj: e, + rank: vRank + }; + dummy = util.addDummyNode(g, "edge", attrs, "_d"); + if (vRank === labelRank) { + attrs.width = edgeLabel.width; + attrs.height = edgeLabel.height; + attrs.dummy = "edge-label"; + attrs.labelpos = edgeLabel.labelpos; + } + g.setEdge(v, dummy, { weight: edgeLabel.weight }, name); + if (i === 0) { + g.graph().dummyChains.push(dummy); + } + v = dummy; + } + + g.setEdge(v, w, { weight: edgeLabel.weight }, name); +} + +function undo(g) { + _.each(g.graph().dummyChains, function(v) { + var node = g.node(v), + origLabel = node.edgeLabel, + w; + g.setEdge(node.edgeObj, origLabel); + while (node.dummy) { + w = g.successors(v)[0]; + g.removeNode(v); + origLabel.points.push({ x: node.x, y: node.y }); + if (node.dummy === "edge-label") { + origLabel.x = node.x; + origLabel.y = node.y; + origLabel.width = node.width; + origLabel.height = node.height; + } + v = w; + node = g.node(v); + } + }); +} + +},{"./lodash":39,"./util":58}],42:[function(require,module,exports){ +var _ = require("../lodash"); + +module.exports = addSubgraphConstraints; + +function addSubgraphConstraints(g, cg, vs) { + var prev = {}, + rootPrev; + + _.each(vs, function(v) { + var child = g.parent(v), + parent, + prevChild; + while (child) { + parent = g.parent(child); + if (parent) { + prevChild = prev[parent]; + prev[parent] = child; + } else { + prevChild = rootPrev; + rootPrev = child; + } + if (prevChild && prevChild !== child) { + cg.setEdge(prevChild, child); + return; + } + child = parent; + } + }); + + /* + function dfs(v) { + var children = v ? g.children(v) : g.children(); + if (children.length) { + var min = Number.POSITIVE_INFINITY, + subgraphs = []; + _.each(children, function(child) { + var childMin = dfs(child); + if (g.children(child).length) { + subgraphs.push({ v: child, order: childMin }); + } + min = Math.min(min, childMin); + }); + _.reduce(_.sortBy(subgraphs, "order"), function(prev, curr) { + cg.setEdge(prev.v, curr.v); + return curr; + }); + return min; + } + return g.node(v).order; + } + dfs(undefined); + */ +} + +},{"../lodash":39}],43:[function(require,module,exports){ +var _ = require("../lodash"); + +module.exports = barycenter; + +function barycenter(g, movable) { + return _.map(movable, function(v) { + var inV = g.inEdges(v); + if (!inV.length) { + return { v: v }; + } else { + var result = _.reduce(inV, function(acc, e) { + var edge = g.edge(e), + nodeU = g.node(e.v); + return { + sum: acc.sum + (edge.weight * nodeU.order), + weight: acc.weight + edge.weight + }; + }, { sum: 0, weight: 0 }); + + return { + v: v, + barycenter: result.sum / result.weight, + weight: result.weight + }; + } + }); +} + + +},{"../lodash":39}],44:[function(require,module,exports){ +var _ = require("../lodash"), + Graph = require("../graphlib").Graph; + +module.exports = buildLayerGraph; + +/* + * Constructs a graph that can be used to sort a layer of nodes. The graph will + * contain all base and subgraph nodes from the request layer in their original + * hierarchy and any edges that are incident on these nodes and are of the type + * requested by the "relationship" parameter. + * + * Nodes from the requested rank that do not have parents are assigned a root + * node in the output graph, which is set in the root graph attribute. This + * makes it easy to walk the hierarchy of movable nodes during ordering. + * + * Pre-conditions: + * + * 1. Input graph is a DAG + * 2. Base nodes in the input graph have a rank attribute + * 3. Subgraph nodes in the input graph has minRank and maxRank attributes + * 4. Edges have an assigned weight + * + * Post-conditions: + * + * 1. Output graph has all nodes in the movable rank with preserved + * hierarchy. + * 2. Root nodes in the movable layer are made children of the node + * indicated by the root attribute of the graph. + * 3. Non-movable nodes incident on movable nodes, selected by the + * relationship parameter, are included in the graph (without hierarchy). + * 4. Edges incident on movable nodes, selected by the relationship + * parameter, are added to the output graph. + * 5. The weights for copied edges are aggregated as need, since the output + * graph is not a multi-graph. + */ +function buildLayerGraph(g, rank, relationship) { + var root = createRootNode(g), + result = new Graph({ compound: true }).setGraph({ root: root }) + .setDefaultNodeLabel(function(v) { return g.node(v); }); + + _.each(g.nodes(), function(v) { + var node = g.node(v), + parent = g.parent(v); + + if (node.rank === rank || node.minRank <= rank && rank <= node.maxRank) { + result.setNode(v); + result.setParent(v, parent || root); + + // This assumes we have only short edges! + _.each(g[relationship](v), function(e) { + var u = e.v === v ? e.w : e.v, + edge = result.edge(u, v), + weight = !_.isUndefined(edge) ? edge.weight : 0; + result.setEdge(u, v, { weight: g.edge(e).weight + weight }); + }); + + if (_.has(node, "minRank")) { + result.setNode(v, { + borderLeft: node.borderLeft[rank], + borderRight: node.borderRight[rank] + }); + } + } + }); + + return result; +} + +function createRootNode(g) { + var v; + while (g.hasNode((v = _.uniqueId("_root")))); + return v; +} + +},{"../graphlib":36,"../lodash":39}],45:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"); + +module.exports = crossCount; + +/* + * A function that takes a layering (an array of layers, each with an array of + * ordererd nodes) and a graph and returns a weighted crossing count. + * + * Pre-conditions: + * + * 1. Input graph must be simple (not a multigraph), directed, and include + * only simple edges. + * 2. Edges in the input graph must have assigned weights. + * + * Post-conditions: + * + * 1. The graph and layering matrix are left unchanged. + * + * This algorithm is derived from Barth, et al., "Bilayer Cross Counting." + */ +function crossCount(g, layering) { + var cc = 0; + for (var i = 1; i < layering.length; ++i) { + cc += twoLayerCrossCount(g, layering[i-1], layering[i]); + } + return cc; +} + +function twoLayerCrossCount(g, northLayer, southLayer) { + // Sort all of the edges between the north and south layers by their position + // in the north layer and then the south. Map these edges to the position of + // their head in the south layer. + var southPos = _.zipObject(southLayer, + _.map(southLayer, function (v, i) { return i; })); + var southEntries = _.flatten(_.map(northLayer, function(v) { + return _.chain(g.outEdges(v)) + .map(function(e) { + return { pos: southPos[e.w], weight: g.edge(e).weight }; + }) + .sortBy("pos") + .value(); + }), true); + + // Build the accumulator tree + var firstIndex = 1; + while (firstIndex < southLayer.length) firstIndex <<= 1; + var treeSize = 2 * firstIndex - 1; + firstIndex -= 1; + var tree = _.map(new Array(treeSize), function() { return 0; }); + + // Calculate the weighted crossings + var cc = 0; + _.each(southEntries.forEach(function(entry) { + var index = entry.pos + firstIndex; + tree[index] += entry.weight; + var weightSum = 0; + while (index > 0) { + if (index % 2) { + weightSum += tree[index + 1]; + } + index = (index - 1) >> 1; + tree[index] += entry.weight; + } + cc += entry.weight * weightSum; + })); + + return cc; +} + +},{"../lodash":39}],46:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + initOrder = require("./init-order"), + crossCount = require("./cross-count"), + sortSubgraph = require("./sort-subgraph"), + buildLayerGraph = require("./build-layer-graph"), + addSubgraphConstraints = require("./add-subgraph-constraints"), + Graph = require("../graphlib").Graph, + util = require("../util"); + +module.exports = order; + +/* + * Applies heuristics to minimize edge crossings in the graph and sets the best + * order solution as an order attribute on each node. + * + * Pre-conditions: + * + * 1. Graph must be DAG + * 2. Graph nodes must be objects with a "rank" attribute + * 3. Graph edges must have the "weight" attribute + * + * Post-conditions: + * + * 1. Graph nodes will have an "order" attribute based on the results of the + * algorithm. + */ +function order(g) { + var maxRank = util.maxRank(g), + downLayerGraphs = buildLayerGraphs(g, _.range(1, maxRank + 1), "inEdges"), + upLayerGraphs = buildLayerGraphs(g, _.range(maxRank - 1, -1, -1), "outEdges"); + + var layering = initOrder(g); + assignOrder(g, layering); + + var bestCC = Number.POSITIVE_INFINITY, + best; + + for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) { + sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2); + + layering = util.buildLayerMatrix(g); + var cc = crossCount(g, layering); + if (cc < bestCC) { + lastBest = 0; + best = _.cloneDeep(layering); + bestCC = cc; + } + } + + assignOrder(g, best); +} + +function buildLayerGraphs(g, ranks, relationship) { + return _.map(ranks, function(rank) { + return buildLayerGraph(g, rank, relationship); + }); +} + +function sweepLayerGraphs(layerGraphs, biasRight) { + var cg = new Graph(); + _.each(layerGraphs, function(lg) { + var root = lg.graph().root; + var sorted = sortSubgraph(lg, root, cg, biasRight); + _.each(sorted.vs, function(v, i) { + lg.node(v).order = i; + }); + addSubgraphConstraints(lg, cg, sorted.vs); + }); +} + +function assignOrder(g, layering) { + _.each(layering, function(layer) { + _.each(layer, function(v, i) { + g.node(v).order = i; + }); + }); +} + +},{"../graphlib":36,"../lodash":39,"../util":58,"./add-subgraph-constraints":42,"./build-layer-graph":44,"./cross-count":45,"./init-order":47,"./sort-subgraph":49}],47:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"); + +module.exports = initOrder; + +/* + * Assigns an initial order value for each node by performing a DFS search + * starting from nodes in the first rank. Nodes are assigned an order in their + * rank as they are first visited. + * + * This approach comes from Gansner, et al., "A Technique for Drawing Directed + * Graphs." + * + * Returns a layering matrix with an array per layer and each layer sorted by + * the order of its nodes. + */ +function initOrder(g) { + var visited = {}, + simpleNodes = _.filter(g.nodes(), function(v) { + return !g.children(v).length; + }), + maxRank = _.max(_.map(simpleNodes, function(v) { return g.node(v).rank; })), + layers = _.map(_.range(maxRank + 1), function() { return []; }); + + function dfs(v) { + if (_.has(visited, v)) return; + visited[v] = true; + var node = g.node(v); + layers[node.rank].push(v); + _.each(g.successors(v), dfs); + } + + var orderedVs = _.sortBy(simpleNodes, function(v) { return g.node(v).rank; }); + _.each(orderedVs, dfs); + + return layers; +} + +},{"../lodash":39}],48:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"); + +module.exports = resolveConflicts; + +/* + * Given a list of entries of the form {v, barycenter, weight} and a + * constraint graph this function will resolve any conflicts between the + * constraint graph and the barycenters for the entries. If the barycenters for + * an entry would violate a constraint in the constraint graph then we coalesce + * the nodes in the conflict into a new node that respects the contraint and + * aggregates barycenter and weight information. + * + * This implementation is based on the description in Forster, "A Fast and + * Simple Hueristic for Constrained Two-Level Crossing Reduction," thought it + * differs in some specific details. + * + * Pre-conditions: + * + * 1. Each entry has the form {v, barycenter, weight}, or if the node has + * no barycenter, then {v}. + * + * Returns: + * + * A new list of entries of the form {vs, i, barycenter, weight}. The list + * `vs` may either be a singleton or it may be an aggregation of nodes + * ordered such that they do not violate constraints from the constraint + * graph. The property `i` is the lowest original index of any of the + * elements in `vs`. + */ +function resolveConflicts(entries, cg) { + var mappedEntries = {}; + _.each(entries, function(entry, i) { + var tmp = mappedEntries[entry.v] = { + indegree: 0, + "in": [], + out: [], + vs: [entry.v], + i: i + }; + if (!_.isUndefined(entry.barycenter)) { + tmp.barycenter = entry.barycenter; + tmp.weight = entry.weight; + } + }); + + _.each(cg.edges(), function(e) { + var entryV = mappedEntries[e.v], + entryW = mappedEntries[e.w]; + if (!_.isUndefined(entryV) && !_.isUndefined(entryW)) { + entryW.indegree++; + entryV.out.push(mappedEntries[e.w]); + } + }); + + var sourceSet = _.filter(mappedEntries, function(entry) { + return !entry.indegree; + }); + + return doResolveConflicts(sourceSet); +} + +function doResolveConflicts(sourceSet) { + var entries = []; + + function handleIn(vEntry) { + return function(uEntry) { + if (uEntry.merged) { + return; + } + if (_.isUndefined(uEntry.barycenter) || + _.isUndefined(vEntry.barycenter) || + uEntry.barycenter >= vEntry.barycenter) { + mergeEntries(vEntry, uEntry); + } + }; + } + + function handleOut(vEntry) { + return function(wEntry) { + wEntry["in"].push(vEntry); + if (--wEntry.indegree === 0) { + sourceSet.push(wEntry); + } + }; + } + + while (sourceSet.length) { + var entry = sourceSet.pop(); + entries.push(entry); + _.each(entry["in"].reverse(), handleIn(entry)); + _.each(entry.out, handleOut(entry)); + } + + return _.chain(entries) + .filter(function(entry) { return !entry.merged; }) + .map(function(entry) { + return _.pick(entry, ["vs", "i", "barycenter", "weight"]); + }) + .value(); +} + +function mergeEntries(target, source) { + var sum = 0, + weight = 0; + + if (target.weight) { + sum += target.barycenter * target.weight; + weight += target.weight; + } + + if (source.weight) { + sum += source.barycenter * source.weight; + weight += source.weight; + } + + target.vs = source.vs.concat(target.vs); + target.barycenter = sum / weight; + target.weight = weight; + target.i = Math.min(source.i, target.i); + source.merged = true; +} + +},{"../lodash":39}],49:[function(require,module,exports){ +var _ = require("../lodash"), + barycenter = require("./barycenter"), + resolveConflicts = require("./resolve-conflicts"), + sort = require("./sort"); + +module.exports = sortSubgraph; + +function sortSubgraph(g, v, cg, biasRight) { + var movable = g.children(v), + node = g.node(v), + bl = node ? node.borderLeft : undefined, + br = node ? node.borderRight: undefined, + subgraphs = {}; + + if (bl) { + movable = _.filter(movable, function(w) { + return w !== bl && w !== br; + }); + } + + var barycenters = barycenter(g, movable); + _.each(barycenters, function(entry) { + if (g.children(entry.v).length) { + var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight); + subgraphs[entry.v] = subgraphResult; + if (_.has(subgraphResult, "barycenter")) { + mergeBarycenters(entry, subgraphResult); + } + } + }); + + var entries = resolveConflicts(barycenters, cg); + expandSubgraphs(entries, subgraphs); + + var result = sort(entries, biasRight); + + if (bl) { + result.vs = _.flatten([bl, result.vs, br], true); + if (g.predecessors(bl).length) { + var blPred = g.node(g.predecessors(bl)[0]), + brPred = g.node(g.predecessors(br)[0]); + if (!_.has(result, "barycenter")) { + result.barycenter = 0; + result.weight = 0; + } + result.barycenter = (result.barycenter * result.weight + + blPred.order + brPred.order) / (result.weight + 2); + result.weight += 2; + } + } + + return result; +} + +function expandSubgraphs(entries, subgraphs) { + _.each(entries, function(entry) { + entry.vs = _.flatten(entry.vs.map(function(v) { + if (subgraphs[v]) { + return subgraphs[v].vs; + } + return v; + }), true); + }); +} + +function mergeBarycenters(target, other) { + if (!_.isUndefined(target.barycenter)) { + target.barycenter = (target.barycenter * target.weight + + other.barycenter * other.weight) / + (target.weight + other.weight); + target.weight += other.weight; + } else { + target.barycenter = other.barycenter; + target.weight = other.weight; + } +} + +},{"../lodash":39,"./barycenter":43,"./resolve-conflicts":48,"./sort":50}],50:[function(require,module,exports){ +var _ = require("../lodash"), + util = require("../util"); + +module.exports = sort; + +function sort(entries, biasRight) { + var parts = util.partition(entries, function(entry) { + return _.has(entry, "barycenter"); + }); + var sortable = parts.lhs, + unsortable = _.sortBy(parts.rhs, function(entry) { return -entry.i; }), + vs = [], + sum = 0, + weight = 0, + vsIndex = 0; + + sortable.sort(compareWithBias(!!biasRight)); + + vsIndex = consumeUnsortable(vs, unsortable, vsIndex); + + _.each(sortable, function (entry) { + vsIndex += entry.vs.length; + vs.push(entry.vs); + sum += entry.barycenter * entry.weight; + weight += entry.weight; + vsIndex = consumeUnsortable(vs, unsortable, vsIndex); + }); + + var result = { vs: _.flatten(vs, true) }; + if (weight) { + result.barycenter = sum / weight; + result.weight = weight; + } + return result; +} + +function consumeUnsortable(vs, unsortable, index) { + var last; + while (unsortable.length && (last = _.last(unsortable)).i <= index) { + unsortable.pop(); + vs.push(last.vs); + index++; + } + return index; +} + +function compareWithBias(bias) { + return function(entryV, entryW) { + if (entryV.barycenter < entryW.barycenter) { + return -1; + } else if (entryV.barycenter > entryW.barycenter) { + return 1; + } + + return !bias ? entryV.i - entryW.i : entryW.i - entryV.i; + }; +} + +},{"../lodash":39,"../util":58}],51:[function(require,module,exports){ +var _ = require("./lodash"); + +module.exports = parentDummyChains; + +function parentDummyChains(g) { + var postorderNums = postorder(g); + + _.each(g.graph().dummyChains, function(v) { + var node = g.node(v), + edgeObj = node.edgeObj, + pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w), + path = pathData.path, + lca = pathData.lca, + pathIdx = 0, + pathV = path[pathIdx], + ascending = true; + + while (v !== edgeObj.w) { + node = g.node(v); + + if (ascending) { + while ((pathV = path[pathIdx]) !== lca && + g.node(pathV).maxRank < node.rank) { + pathIdx++; + } + + if (pathV === lca) { + ascending = false; + } + } + + if (!ascending) { + while (pathIdx < path.length - 1 && + g.node(pathV = path[pathIdx + 1]).minRank <= node.rank) { + pathIdx++; + } + pathV = path[pathIdx]; + } + + g.setParent(v, pathV); + v = g.successors(v)[0]; + } + }); +} + +// Find a path from v to w through the lowest common ancestor (LCA). Return the +// full path and the LCA. +function findPath(g, postorderNums, v, w) { + var vPath = [], + wPath = [], + low = Math.min(postorderNums[v].low, postorderNums[w].low), + lim = Math.max(postorderNums[v].lim, postorderNums[w].lim), + parent, + lca; + + // Traverse up from v to find the LCA + parent = v; + do { + parent = g.parent(parent); + vPath.push(parent); + } while (parent && + (postorderNums[parent].low > low || lim > postorderNums[parent].lim)); + lca = parent; + + // Traverse from w to LCA + parent = w; + while ((parent = g.parent(parent)) !== lca) { + wPath.push(parent); + } + + return { path: vPath.concat(wPath.reverse()), lca: lca }; +} + +function postorder(g) { + var result = {}, + lim = 0; + + function dfs(v) { + var low = lim; + _.each(g.children(v), dfs); + result[v] = { low: low, lim: lim++ }; + } + _.each(g.children(), dfs); + + return result; +} + +},{"./lodash":39}],52:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + Graph = require("../graphlib").Graph, + util = require("../util"); + +/* + * This module provides coordinate assignment based on Brandes and Köpf, "Fast + * and Simple Horizontal Coordinate Assignment." + */ + +module.exports = { + positionX: positionX, + findType1Conflicts: findType1Conflicts, + findType2Conflicts: findType2Conflicts, + addConflict: addConflict, + hasConflict: hasConflict, + verticalAlignment: verticalAlignment, + horizontalCompaction: horizontalCompaction, + alignCoordinates: alignCoordinates, + findSmallestWidthAlignment: findSmallestWidthAlignment, + balance: balance +}; + +/* + * Marks all edges in the graph with a type-1 conflict with the "type1Conflict" + * property. A type-1 conflict is one where a non-inner segment crosses an + * inner segment. An inner segment is an edge with both incident nodes marked + * with the "dummy" property. + * + * This algorithm scans layer by layer, starting with the second, for type-1 + * conflicts between the current layer and the previous layer. For each layer + * it scans the nodes from left to right until it reaches one that is incident + * on an inner segment. It then scans predecessors to determine if they have + * edges that cross that inner segment. At the end a final scan is done for all + * nodes on the current rank to see if they cross the last visited inner + * segment. + * + * This algorithm (safely) assumes that a dummy node will only be incident on a + * single node in the layers being scanned. + */ +function findType1Conflicts(g, layering) { + var conflicts = {}; + + function visitLayer(prevLayer, layer) { + var + // last visited node in the previous layer that is incident on an inner + // segment. + k0 = 0, + // Tracks the last node in this layer scanned for crossings with a type-1 + // segment. + scanPos = 0, + prevLayerLength = prevLayer.length, + lastNode = _.last(layer); + + _.each(layer, function(v, i) { + var w = findOtherInnerSegmentNode(g, v), + k1 = w ? g.node(w).order : prevLayerLength; + + if (w || v === lastNode) { + _.each(layer.slice(scanPos, i +1), function(scanNode) { + _.each(g.predecessors(scanNode), function(u) { + var uLabel = g.node(u), + uPos = uLabel.order; + if ((uPos < k0 || k1 < uPos) && + !(uLabel.dummy && g.node(scanNode).dummy)) { + addConflict(conflicts, u, scanNode); + } + }); + }); + scanPos = i + 1; + k0 = k1; + } + }); + + return layer; + } + + _.reduce(layering, visitLayer); + return conflicts; +} + +function findType2Conflicts(g, layering) { + var conflicts = {}; + + function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) { + var v; + _.each(_.range(southPos, southEnd), function(i) { + v = south[i]; + if (g.node(v).dummy) { + _.each(g.predecessors(v), function(u) { + var uNode = g.node(u); + if (uNode.dummy && + (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) { + addConflict(conflicts, u, v); + } + }); + } + }); + } + + + function visitLayer(north, south) { + var prevNorthPos = -1, + nextNorthPos, + southPos = 0; + + _.each(south, function(v, southLookahead) { + if (g.node(v).dummy === "border") { + var predecessors = g.predecessors(v); + if (predecessors.length) { + nextNorthPos = g.node(predecessors[0]).order; + scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos); + southPos = southLookahead; + prevNorthPos = nextNorthPos; + } + } + scan(south, southPos, south.length, nextNorthPos, north.length); + }); + + return south; + } + + _.reduce(layering, visitLayer); + return conflicts; +} + +function findOtherInnerSegmentNode(g, v) { + if (g.node(v).dummy) { + return _.find(g.predecessors(v), function(u) { + return g.node(u).dummy; + }); + } +} + +function addConflict(conflicts, v, w) { + if (v > w) { + var tmp = v; + v = w; + w = tmp; + } + + var conflictsV = conflicts[v]; + if (!conflictsV) { + conflicts[v] = conflictsV = {}; + } + conflictsV[w] = true; +} + +function hasConflict(conflicts, v, w) { + if (v > w) { + var tmp = v; + v = w; + w = tmp; + } + return _.has(conflicts[v], w); +} + +/* + * Try to align nodes into vertical "blocks" where possible. This algorithm + * attempts to align a node with one of its median neighbors. If the edge + * connecting a neighbor is a type-1 conflict then we ignore that possibility. + * If a previous node has already formed a block with a node after the node + * we're trying to form a block with, we also ignore that possibility - our + * blocks would be split in that scenario. + */ +function verticalAlignment(g, layering, conflicts, neighborFn) { + var root = {}, + align = {}, + pos = {}; + + // We cache the position here based on the layering because the graph and + // layering may be out of sync. The layering matrix is manipulated to + // generate different extreme alignments. + _.each(layering, function(layer) { + _.each(layer, function(v, order) { + root[v] = v; + align[v] = v; + pos[v] = order; + }); + }); + + _.each(layering, function(layer) { + var prevIdx = -1; + _.each(layer, function(v) { + var ws = neighborFn(v); + if (ws.length) { + ws = _.sortBy(ws, function(w) { return pos[w]; }); + var mp = (ws.length - 1) / 2; + for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) { + var w = ws[i]; + if (align[v] === v && + prevIdx < pos[w] && + !hasConflict(conflicts, v, w)) { + align[w] = v; + align[v] = root[v] = root[w]; + prevIdx = pos[w]; + } + } + } + }); + }); + + return { root: root, align: align }; +} + +function horizontalCompaction(g, layering, root, align, reverseSep) { + // This portion of the algorithm differs from BK due to a number of problems. + // Instead of their algorithm we construct a new block graph and do two + // sweeps. The first sweep places blocks with the smallest possible + // coordinates. The second sweep removes unused space by moving blocks to the + // greatest coordinates without violating separation. + var xs = {}, + blockG = buildBlockGraph(g, layering, root, reverseSep); + + // First pass, assign smallest coordinates via DFS + var visited = {}; + function pass1(v) { + if (!_.has(visited, v)) { + visited[v] = true; + xs[v] = _.reduce(blockG.inEdges(v), function(max, e) { + pass1(e.v); + return Math.max(max, xs[e.v] + blockG.edge(e)); + }, 0); + } + } + _.each(blockG.nodes(), pass1); + + var borderType = reverseSep ? "borderLeft" : "borderRight"; + function pass2(v) { + if (visited[v] !== 2) { + visited[v]++; + var node = g.node(v); + var min = _.reduce(blockG.outEdges(v), function(min, e) { + pass2(e.w); + return Math.min(min, xs[e.w] - blockG.edge(e)); + }, Number.POSITIVE_INFINITY); + if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) { + xs[v] = Math.max(xs[v], min); + } + } + } + _.each(blockG.nodes(), pass2); + + // Assign x coordinates to all nodes + _.each(align, function(v) { + xs[v] = xs[root[v]]; + }); + + return xs; +} + + +function buildBlockGraph(g, layering, root, reverseSep) { + var blockGraph = new Graph(), + graphLabel = g.graph(), + sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep); + + _.each(layering, function(layer) { + var u; + _.each(layer, function(v) { + var vRoot = root[v]; + blockGraph.setNode(vRoot); + if (u) { + var uRoot = root[u], + prevMax = blockGraph.edge(uRoot, vRoot); + blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0)); + } + u = v; + }); + }); + + return blockGraph; +} + +/* + * Returns the alignment that has the smallest width of the given alignments. + */ +function findSmallestWidthAlignment(g, xss) { + return _.min(xss, function(xs) { + var min = _.min(xs, function(x, v) { return x - width(g, v) / 2; }), + max = _.max(xs, function(x, v) { return x + width(g, v) / 2; }); + return max - min; + }); +} + +/* + * Align the coordinates of each of the layout alignments such that + * left-biased alignments have their minimum coordinate at the same point as + * the minimum coordinate of the smallest width alignment and right-biased + * alignments have their maximum coordinate at the same point as the maximum + * coordinate of the smallest width alignment. + */ +function alignCoordinates(xss, alignTo) { + var alignToMin = _.min(alignTo), + alignToMax = _.max(alignTo); + + _.each(["u", "d"], function(vert) { + _.each(["l", "r"], function(horiz) { + var alignment = vert + horiz, + xs = xss[alignment], + delta; + if (xs === alignTo) return; + + delta = horiz === "l" ? alignToMin - _.min(xs) : alignToMax - _.max(xs); + + if (delta) { + xss[alignment] = _.mapValues(xs, function(x) { return x + delta; }); + } + }); + }); +} + +function balance(xss, align) { + return _.mapValues(xss.ul, function(ignore, v) { + if (align) { + return xss[align.toLowerCase()][v]; + } else { + var xs = _.sortBy(_.pluck(xss, v)); + return (xs[1] + xs[2]) / 2; + } + }); +} + +function positionX(g) { + var layering = util.buildLayerMatrix(g), + conflicts = _.merge(findType1Conflicts(g, layering), + findType2Conflicts(g, layering)); + + var xss = {}, + adjustedLayering; + _.each(["u", "d"], function(vert) { + adjustedLayering = vert === "u" ? layering : _.values(layering).reverse(); + _.each(["l", "r"], function(horiz) { + if (horiz === "r") { + adjustedLayering = _.map(adjustedLayering, function(inner) { + return _.values(inner).reverse(); + }); + } + + var neighborFn = _.bind(vert === "u" ? g.predecessors : g.successors, g); + var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn); + var xs = horizontalCompaction(g, adjustedLayering, + align.root, align.align, + horiz === "r"); + if (horiz === "r") { + xs = _.mapValues(xs, function(x) { return -x; }); + } + xss[vert + horiz] = xs; + }); + }); + + var smallestWidth = findSmallestWidthAlignment(g, xss); + alignCoordinates(xss, smallestWidth); + return balance(xss, g.graph().align); +} + +function sep(nodeSep, edgeSep, reverseSep) { + return function(g, v, w) { + var vLabel = g.node(v), + wLabel = g.node(w), + sum = 0, + delta; + + sum += vLabel.width / 2; + if (_.has(vLabel, "labelpos")) { + switch (vLabel.labelpos.toLowerCase()) { + case "l": delta = -vLabel.width / 2; break; + case "r": delta = vLabel.width / 2; break; + } + } + if (delta) { + sum += reverseSep ? delta : -delta; + } + delta = 0; + + sum += (vLabel.dummy ? edgeSep : nodeSep) / 2; + sum += (wLabel.dummy ? edgeSep : nodeSep) / 2; + + sum += wLabel.width / 2; + if (_.has(wLabel, "labelpos")) { + switch (wLabel.labelpos.toLowerCase()) { + case "l": delta = wLabel.width / 2; break; + case "r": delta = -wLabel.width / 2; break; + } + } + if (delta) { + sum += reverseSep ? delta : -delta; + } + delta = 0; + + return sum; + }; +} + +function width(g, v) { + return g.node(v).width; +} + +},{"../graphlib":36,"../lodash":39,"../util":58}],53:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + util = require("../util"), + positionX = require("./bk").positionX; + +module.exports = position; + +function position(g) { + g = util.asNonCompoundGraph(g); + + positionY(g); + _.each(positionX(g), function(x, v) { + g.node(v).x = x; + }); +} + +function positionY(g) { + var layering = util.buildLayerMatrix(g), + rankSep = g.graph().ranksep, + prevY = 0; + _.each(layering, function(layer) { + var maxHeight = _.max(_.map(layer, function(v) { return g.node(v).height; })); + _.each(layer, function(v) { + g.node(v).y = prevY + maxHeight / 2; + }); + prevY += maxHeight + rankSep; + }); +} + + +},{"../lodash":39,"../util":58,"./bk":52}],54:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + Graph = require("../graphlib").Graph, + slack = require("./util").slack; + +module.exports = feasibleTree; + +/* + * Constructs a spanning tree with tight edges and adjusted the input node's + * ranks to achieve this. A tight edge is one that is has a length that matches + * its "minlen" attribute. + * + * The basic structure for this function is derived from Gansner, et al., "A + * Technique for Drawing Directed Graphs." + * + * Pre-conditions: + * + * 1. Graph must be a DAG. + * 2. Graph must be connected. + * 3. Graph must have at least one node. + * 5. Graph nodes must have been previously assigned a "rank" property that + * respects the "minlen" property of incident edges. + * 6. Graph edges must have a "minlen" property. + * + * Post-conditions: + * + * - Graph nodes will have their rank adjusted to ensure that all edges are + * tight. + * + * Returns a tree (undirected graph) that is constructed using only "tight" + * edges. + */ +function feasibleTree(g) { + var t = new Graph({ directed: false }); + + // Choose arbitrary node from which to start our tree + var start = g.nodes()[0], + size = g.nodeCount(); + t.setNode(start, {}); + + var edge, delta; + while (tightTree(t, g) < size) { + edge = findMinSlackEdge(t, g); + delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge); + shiftRanks(t, g, delta); + } + + return t; +} + +/* + * Finds a maximal tree of tight edges and returns the number of nodes in the + * tree. + */ +function tightTree(t, g) { + function dfs(v) { + _.each(g.nodeEdges(v), function(e) { + var edgeV = e.v, + w = (v === edgeV) ? e.w : edgeV; + if (!t.hasNode(w) && !slack(g, e)) { + t.setNode(w, {}); + t.setEdge(v, w, {}); + dfs(w); + } + }); + } + + _.each(t.nodes(), dfs); + return t.nodeCount(); +} + +/* + * Finds the edge with the smallest slack that is incident on tree and returns + * it. + */ +function findMinSlackEdge(t, g) { + return _.min(g.edges(), function(e) { + if (t.hasNode(e.v) !== t.hasNode(e.w)) { + return slack(g, e); + } + }); +} + +function shiftRanks(t, g, delta) { + _.each(t.nodes(), function(v) { + g.node(v).rank += delta; + }); +} + +},{"../graphlib":36,"../lodash":39,"./util":57}],55:[function(require,module,exports){ +"use strict"; + +var rankUtil = require("./util"), + longestPath = rankUtil.longestPath, + feasibleTree = require("./feasible-tree"), + networkSimplex = require("./network-simplex"); + +module.exports = rank; + +/* + * Assigns a rank to each node in the input graph that respects the "minlen" + * constraint specified on edges between nodes. + * + * This basic structure is derived from Gansner, et al., "A Technique for + * Drawing Directed Graphs." + * + * Pre-conditions: + * + * 1. Graph must be a connected DAG + * 2. Graph nodes must be objects + * 3. Graph edges must have "weight" and "minlen" attributes + * + * Post-conditions: + * + * 1. Graph nodes will have a "rank" attribute based on the results of the + * algorithm. Ranks can start at any index (including negative), we'll + * fix them up later. + */ +function rank(g) { + switch(g.graph().ranker) { + case "network-simplex": networkSimplexRanker(g); break; + case "tight-tree": tightTreeRanker(g); break; + case "longest-path": longestPathRanker(g); break; + default: networkSimplexRanker(g); + } +} + +// A fast and simple ranker, but results are far from optimal. +var longestPathRanker = longestPath; + +function tightTreeRanker(g) { + longestPath(g); + feasibleTree(g); +} + +function networkSimplexRanker(g) { + networkSimplex(g); +} + +},{"./feasible-tree":54,"./network-simplex":56,"./util":57}],56:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"), + feasibleTree = require("./feasible-tree"), + slack = require("./util").slack, + initRank = require("./util").longestPath, + preorder = require("../graphlib").alg.preorder, + postorder = require("../graphlib").alg.postorder, + simplify = require("../util").simplify; + +module.exports = networkSimplex; + +// Expose some internals for testing purposes +networkSimplex.initLowLimValues = initLowLimValues; +networkSimplex.initCutValues = initCutValues; +networkSimplex.calcCutValue = calcCutValue; +networkSimplex.leaveEdge = leaveEdge; +networkSimplex.enterEdge = enterEdge; +networkSimplex.exchangeEdges = exchangeEdges; + +/* + * The network simplex algorithm assigns ranks to each node in the input graph + * and iteratively improves the ranking to reduce the length of edges. + * + * Preconditions: + * + * 1. The input graph must be a DAG. + * 2. All nodes in the graph must have an object value. + * 3. All edges in the graph must have "minlen" and "weight" attributes. + * + * Postconditions: + * + * 1. All nodes in the graph will have an assigned "rank" attribute that has + * been optimized by the network simplex algorithm. Ranks start at 0. + * + * + * A rough sketch of the algorithm is as follows: + * + * 1. Assign initial ranks to each node. We use the longest path algorithm, + * which assigns ranks to the lowest position possible. In general this + * leads to very wide bottom ranks and unnecessarily long edges. + * 2. Construct a feasible tight tree. A tight tree is one such that all + * edges in the tree have no slack (difference between length of edge + * and minlen for the edge). This by itself greatly improves the assigned + * rankings by shorting edges. + * 3. Iteratively find edges that have negative cut values. Generally a + * negative cut value indicates that the edge could be removed and a new + * tree edge could be added to produce a more compact graph. + * + * Much of the algorithms here are derived from Gansner, et al., "A Technique + * for Drawing Directed Graphs." The structure of the file roughly follows the + * structure of the overall algorithm. + */ +function networkSimplex(g) { + g = simplify(g); + initRank(g); + var t = feasibleTree(g); + initLowLimValues(t); + initCutValues(t, g); + + var e, f; + while ((e = leaveEdge(t))) { + f = enterEdge(t, g, e); + exchangeEdges(t, g, e, f); + } +} + +/* + * Initializes cut values for all edges in the tree. + */ +function initCutValues(t, g) { + var vs = postorder(t, t.nodes()); + vs = vs.slice(0, vs.length - 1); + _.each(vs, function(v) { + assignCutValue(t, g, v); + }); +} + +function assignCutValue(t, g, child) { + var childLab = t.node(child), + parent = childLab.parent; + t.edge(child, parent).cutvalue = calcCutValue(t, g, child); +} + +/* + * Given the tight tree, its graph, and a child in the graph calculate and + * return the cut value for the edge between the child and its parent. + */ +function calcCutValue(t, g, child) { + var childLab = t.node(child), + parent = childLab.parent, + // True if the child is on the tail end of the edge in the directed graph + childIsTail = true, + // The graph's view of the tree edge we're inspecting + graphEdge = g.edge(child, parent), + // The accumulated cut value for the edge between this node and its parent + cutValue = 0; + + if (!graphEdge) { + childIsTail = false; + graphEdge = g.edge(parent, child); + } + + cutValue = graphEdge.weight; + + _.each(g.nodeEdges(child), function(e) { + var isOutEdge = e.v === child, + other = isOutEdge ? e.w : e.v; + + if (other !== parent) { + var pointsToHead = isOutEdge === childIsTail, + otherWeight = g.edge(e).weight; + + cutValue += pointsToHead ? otherWeight : -otherWeight; + if (isTreeEdge(t, child, other)) { + var otherCutValue = t.edge(child, other).cutvalue; + cutValue += pointsToHead ? -otherCutValue : otherCutValue; + } + } + }); + + return cutValue; +} + +function initLowLimValues(tree, root) { + if (arguments.length < 2) { + root = tree.nodes()[0]; + } + dfsAssignLowLim(tree, {}, 1, root); +} + +function dfsAssignLowLim(tree, visited, nextLim, v, parent) { + var low = nextLim, + label = tree.node(v); + + visited[v] = true; + _.each(tree.neighbors(v), function(w) { + if (!_.has(visited, w)) { + nextLim = dfsAssignLowLim(tree, visited, nextLim, w, v); + } + }); + + label.low = low; + label.lim = nextLim++; + if (parent) { + label.parent = parent; + } else { + // TODO should be able to remove this when we incrementally update low lim + delete label.parent; + } + + return nextLim; +} + +function leaveEdge(tree) { + return _.find(tree.edges(), function(e) { + return tree.edge(e).cutvalue < 0; + }); +} + +function enterEdge(t, g, edge) { + var v = edge.v, + w = edge.w; + + // For the rest of this function we assume that v is the tail and w is the + // head, so if we don't have this edge in the graph we should flip it to + // match the correct orientation. + if (!g.hasEdge(v, w)) { + v = edge.w; + w = edge.v; + } + + var vLabel = t.node(v), + wLabel = t.node(w), + tailLabel = vLabel, + flip = false; + + // If the root is in the tail of the edge then we need to flip the logic that + // checks for the head and tail nodes in the candidates function below. + if (vLabel.lim > wLabel.lim) { + tailLabel = wLabel; + flip = true; + } + + var candidates = _.filter(g.edges(), function(edge) { + return flip === isDescendant(t, t.node(edge.v), tailLabel) && + flip !== isDescendant(t, t.node(edge.w), tailLabel); + }); + + return _.min(candidates, function(edge) { return slack(g, edge); }); +} + +function exchangeEdges(t, g, e, f) { + var v = e.v, + w = e.w; + t.removeEdge(v, w); + t.setEdge(f.v, f.w, {}); + initLowLimValues(t); + initCutValues(t, g); + updateRanks(t, g); +} + +function updateRanks(t, g) { + var root = _.find(t.nodes(), function(v) { return !g.node(v).parent; }), + vs = preorder(t, root); + vs = vs.slice(1); + _.each(vs, function(v) { + var parent = t.node(v).parent, + edge = g.edge(v, parent), + flipped = false; + + if (!edge) { + edge = g.edge(parent, v); + flipped = true; + } + + g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen); + }); +} + +/* + * Returns true if the edge is in the tree. + */ +function isTreeEdge(tree, u, v) { + return tree.hasEdge(u, v); +} + +/* + * Returns true if the specified node is descendant of the root node per the + * assigned low and lim attributes in the tree. + */ +function isDescendant(tree, vLabel, rootLabel) { + return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim; +} + +},{"../graphlib":36,"../lodash":39,"../util":58,"./feasible-tree":54,"./util":57}],57:[function(require,module,exports){ +"use strict"; + +var _ = require("../lodash"); + +module.exports = { + longestPath: longestPath, + slack: slack +}; + +/* + * Initializes ranks for the input graph using the longest path algorithm. This + * algorithm scales well and is fast in practice, it yields rather poor + * solutions. Nodes are pushed to the lowest layer possible, leaving the bottom + * ranks wide and leaving edges longer than necessary. However, due to its + * speed, this algorithm is good for getting an initial ranking that can be fed + * into other algorithms. + * + * This algorithm does not normalize layers because it will be used by other + * algorithms in most cases. If using this algorithm directly, be sure to + * run normalize at the end. + * + * Pre-conditions: + * + * 1. Input graph is a DAG. + * 2. Input graph node labels can be assigned properties. + * + * Post-conditions: + * + * 1. Each node will be assign an (unnormalized) "rank" property. + */ +function longestPath(g) { + var visited = {}; + + function dfs(v) { + var label = g.node(v); + if (_.has(visited, v)) { + return label.rank; + } + visited[v] = true; + + var rank = _.min(_.map(g.outEdges(v), function(e) { + return dfs(e.w) - g.edge(e).minlen; + })); + + if (rank === Number.POSITIVE_INFINITY) { + rank = 0; + } + + return (label.rank = rank); + } + + _.each(g.sources(), dfs); +} + +/* + * Returns the amount of slack for the given edge. The slack is defined as the + * difference between the length of the edge and its minimum length. + */ +function slack(g, e) { + return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen; +} + +},{"../lodash":39}],58:[function(require,module,exports){ +"use strict"; + +var _ = require("./lodash"), + Graph = require("./graphlib").Graph; + +module.exports = { + addDummyNode: addDummyNode, + simplify: simplify, + asNonCompoundGraph: asNonCompoundGraph, + successorWeights: successorWeights, + predecessorWeights: predecessorWeights, + intersectRect: intersectRect, + buildLayerMatrix: buildLayerMatrix, + normalizeRanks: normalizeRanks, + removeEmptyRanks: removeEmptyRanks, + addBorderNode: addBorderNode, + maxRank: maxRank, + partition: partition, + time: time, + notime: notime +}; + +/* + * Adds a dummy node to the graph and return v. + */ +function addDummyNode(g, type, attrs, name) { + var v; + do { + v = _.uniqueId(name); + } while (g.hasNode(v)); + + attrs.dummy = type; + g.setNode(v, attrs); + return v; +} + +/* + * Returns a new graph with only simple edges. Handles aggregation of data + * associated with multi-edges. + */ +function simplify(g) { + var simplified = new Graph().setGraph(g.graph()); + _.each(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); }); + _.each(g.edges(), function(e) { + var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 }, + label = g.edge(e); + simplified.setEdge(e.v, e.w, { + weight: simpleLabel.weight + label.weight, + minlen: Math.max(simpleLabel.minlen, label.minlen) + }); + }); + return simplified; +} + +function asNonCompoundGraph(g) { + var simplified = new Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph()); + _.each(g.nodes(), function(v) { + if (!g.children(v).length) { + simplified.setNode(v, g.node(v)); + } + }); + _.each(g.edges(), function(e) { + simplified.setEdge(e, g.edge(e)); + }); + return simplified; +} + +function successorWeights(g) { + var weightMap = _.map(g.nodes(), function(v) { + var sucs = {}; + _.each(g.outEdges(v), function(e) { + sucs[e.w] = (sucs[e.w] || 0) + g.edge(e).weight; + }); + return sucs; + }); + return _.zipObject(g.nodes(), weightMap); +} + +function predecessorWeights(g) { + var weightMap = _.map(g.nodes(), function(v) { + var preds = {}; + _.each(g.inEdges(v), function(e) { + preds[e.v] = (preds[e.v] || 0) + g.edge(e).weight; + }); + return preds; + }); + return _.zipObject(g.nodes(), weightMap); +} + +/* + * Finds where a line starting at point ({x, y}) would intersect a rectangle + * ({x, y, width, height}) if it were pointing at the rectangle's center. + */ +function intersectRect(rect, point) { + var x = rect.x; + var y = rect.y; + + // Rectangle intersection algorithm from: + // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes + var dx = point.x - x; + var dy = point.y - y; + var w = rect.width / 2; + var h = rect.height / 2; + + if (!dx && !dy) { + throw new Error("Not possible to find intersection inside of the rectangle"); + } + + var sx, sy; + if (Math.abs(dy) * w > Math.abs(dx) * h) { + // Intersection is top or bottom of rect. + if (dy < 0) { + h = -h; + } + sx = h * dx / dy; + sy = h; + } else { + // Intersection is left or right of rect. + if (dx < 0) { + w = -w; + } + sx = w; + sy = w * dy / dx; + } + + return { x: x + sx, y: y + sy }; +} + +/* + * Given a DAG with each node assigned "rank" and "order" properties, this + * function will produce a matrix with the ids of each node. + */ +function buildLayerMatrix(g) { + var layering = _.map(_.range(maxRank(g) + 1), function() { return []; }); + _.each(g.nodes(), function(v) { + var node = g.node(v), + rank = node.rank; + if (!_.isUndefined(rank)) { + layering[rank][node.order] = v; + } + }); + return layering; +} + +/* + * Adjusts the ranks for all nodes in the graph such that all nodes v have + * rank(v) >= 0 and at least one node w has rank(w) = 0. + */ +function normalizeRanks(g) { + var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); + _.each(g.nodes(), function(v) { + var node = g.node(v); + if (_.has(node, "rank")) { + node.rank -= min; + } + }); +} + +function removeEmptyRanks(g) { + // Ranks may not start at 0, so we need to offset them + var offset = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); + + var layers = []; + _.each(g.nodes(), function(v) { + var rank = g.node(v).rank - offset; + if (!layers[rank]) { + layers[rank] = []; + } + layers[rank].push(v); + }); + + var delta = 0, + nodeRankFactor = g.graph().nodeRankFactor; + _.each(layers, function(vs, i) { + if (_.isUndefined(vs) && i % nodeRankFactor !== 0) { + --delta; + } else if (delta) { + _.each(vs, function(v) { g.node(v).rank += delta; }); + } + }); +} + +function addBorderNode(g, prefix, rank, order) { + var node = { + width: 0, + height: 0 + }; + if (arguments.length >= 4) { + node.rank = rank; + node.order = order; + } + return addDummyNode(g, "border", node, prefix); +} + +function maxRank(g) { + return _.max(_.map(g.nodes(), function(v) { + var rank = g.node(v).rank; + if (!_.isUndefined(rank)) { + return rank; + } + })); +} + +/* + * Partition a collection into two groups: `lhs` and `rhs`. If the supplied + * function returns true for an entry it goes into `lhs`. Otherwise it goes + * into `rhs. + */ +function partition(collection, fn) { + var result = { lhs: [], rhs: [] }; + _.each(collection, function(value) { + if (fn(value)) { + result.lhs.push(value); + } else { + result.rhs.push(value); + } + }); + return result; +} + +/* + * Returns a new function that wraps `fn` with a timer. The wrapper logs the + * time it takes to execute the function. + */ +function time(name, fn) { + var start = _.now(); + try { + return fn(); + } finally { + console.log(name + " time: " + (_.now() - start) + "ms"); + } +} + +function notime(name, fn) { + return fn(); +} + +},{"./graphlib":36,"./lodash":39}],59:[function(require,module,exports){ +module.exports = "0.7.4"; + +},{}],60:[function(require,module,exports){ /** * Copyright (c) 2014, Chris Pettitt * All rights reserved. @@ -1536,7 +4122,7 @@ module.exports = { version: lib.version }; -},{"./lib":48,"./lib/alg":39,"./lib/json":49}],33:[function(require,module,exports){ +},{"./lib":76,"./lib/alg":67,"./lib/json":77}],61:[function(require,module,exports){ var _ = require("../lodash"); module.exports = components; @@ -1565,7 +4151,7 @@ function components(g) { return cmpts; } -},{"../lodash":50}],34:[function(require,module,exports){ +},{"../lodash":78}],62:[function(require,module,exports){ var _ = require("../lodash"); module.exports = dfs; @@ -1606,7 +4192,7 @@ function doDfs(g, v, postorder, visited, acc) { } } -},{"../lodash":50}],35:[function(require,module,exports){ +},{"../lodash":78}],63:[function(require,module,exports){ var dijkstra = require("./dijkstra"), _ = require("../lodash"); @@ -1618,7 +4204,7 @@ function dijkstraAll(g, weightFunc, edgeFunc) { }, {}); } -},{"../lodash":50,"./dijkstra":36}],36:[function(require,module,exports){ +},{"../lodash":78,"./dijkstra":64}],64:[function(require,module,exports){ var _ = require("../lodash"), PriorityQueue = require("../data/priority-queue"); @@ -1674,7 +4260,7 @@ function runDijkstra(g, source, weightFn, edgeFn) { return results; } -},{"../data/priority-queue":46,"../lodash":50}],37:[function(require,module,exports){ +},{"../data/priority-queue":74,"../lodash":78}],65:[function(require,module,exports){ var _ = require("../lodash"), tarjan = require("./tarjan"); @@ -1686,7 +4272,7 @@ function findCycles(g) { }); } -},{"../lodash":50,"./tarjan":44}],38:[function(require,module,exports){ +},{"../lodash":78,"./tarjan":72}],66:[function(require,module,exports){ var _ = require("../lodash"); module.exports = floydWarshall; @@ -1738,7 +4324,7 @@ function runFloydWarshall(g, weightFn, edgeFn) { return results; } -},{"../lodash":50}],39:[function(require,module,exports){ +},{"../lodash":78}],67:[function(require,module,exports){ module.exports = { components: require("./components"), dijkstra: require("./dijkstra"), @@ -1753,7 +4339,7 @@ module.exports = { topsort: require("./topsort") }; -},{"./components":33,"./dijkstra":36,"./dijkstra-all":35,"./find-cycles":37,"./floyd-warshall":38,"./is-acyclic":40,"./postorder":41,"./preorder":42,"./prim":43,"./tarjan":44,"./topsort":45}],40:[function(require,module,exports){ +},{"./components":61,"./dijkstra":64,"./dijkstra-all":63,"./find-cycles":65,"./floyd-warshall":66,"./is-acyclic":68,"./postorder":69,"./preorder":70,"./prim":71,"./tarjan":72,"./topsort":73}],68:[function(require,module,exports){ var topsort = require("./topsort"); module.exports = isAcyclic; @@ -1770,7 +4356,7 @@ function isAcyclic(g) { return true; } -},{"./topsort":45}],41:[function(require,module,exports){ +},{"./topsort":73}],69:[function(require,module,exports){ var dfs = require("./dfs"); module.exports = postorder; @@ -1779,7 +4365,7 @@ function postorder(g, vs) { return dfs(g, vs, "post"); } -},{"./dfs":34}],42:[function(require,module,exports){ +},{"./dfs":62}],70:[function(require,module,exports){ var dfs = require("./dfs"); module.exports = preorder; @@ -1788,7 +4374,7 @@ function preorder(g, vs) { return dfs(g, vs, "pre"); } -},{"./dfs":34}],43:[function(require,module,exports){ +},{"./dfs":62}],71:[function(require,module,exports){ var _ = require("../lodash"), Graph = require("../graph"), PriorityQueue = require("../data/priority-queue"); @@ -1842,7 +4428,7 @@ function prim(g, weightFunc) { return result; } -},{"../data/priority-queue":46,"../graph":47,"../lodash":50}],44:[function(require,module,exports){ +},{"../data/priority-queue":74,"../graph":75,"../lodash":78}],72:[function(require,module,exports){ var _ = require("../lodash"); module.exports = tarjan; @@ -1891,7 +4477,7 @@ function tarjan(g) { return results; } -},{"../lodash":50}],45:[function(require,module,exports){ +},{"../lodash":78}],73:[function(require,module,exports){ var _ = require("../lodash"); module.exports = topsort; @@ -1927,7 +4513,7 @@ function topsort(g) { function CycleException() {} -},{"../lodash":50}],46:[function(require,module,exports){ +},{"../lodash":78}],74:[function(require,module,exports){ var _ = require("../lodash"); module.exports = PriorityQueue; @@ -2081,7 +4667,7 @@ PriorityQueue.prototype._swap = function(i, j) { keyIndices[origArrI.key] = j; }; -},{"../lodash":50}],47:[function(require,module,exports){ +},{"../lodash":78}],75:[function(require,module,exports){ "use strict"; var _ = require("./lodash"); @@ -2602,14 +5188,14 @@ function edgeObjToId(isDirected, edgeObj) { return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name); } -},{"./lodash":50}],48:[function(require,module,exports){ +},{"./lodash":78}],76:[function(require,module,exports){ // Includes only the "core" of graphlib module.exports = { Graph: require("./graph"), version: require("./version") }; -},{"./graph":47,"./version":51}],49:[function(require,module,exports){ +},{"./graph":75,"./version":79}],77:[function(require,module,exports){ var _ = require("./lodash"), Graph = require("./graph"); @@ -2677,27 +5263,12 @@ function read(json) { return g; } -},{"./graph":47,"./lodash":50}],50:[function(require,module,exports){ -/* global window */ - -var lodash; - -if (typeof require === "function") { - try { - lodash = require("lodash"); - } catch (e) {} -} - -if (!lodash) { - lodash = window._; -} - -module.exports = lodash; - -},{"lodash":52}],51:[function(require,module,exports){ +},{"./graph":75,"./lodash":78}],78:[function(require,module,exports){ +module.exports=require(39) +},{"/Users/knut/source/mermaid/node_modules/dagre/lib/lodash.js":39,"lodash":80}],79:[function(require,module,exports){ module.exports = '1.0.7'; -},{}],52:[function(require,module,exports){ +},{}],80:[function(require,module,exports){ (function (global){ /** * @license @@ -15052,2943 +17623,14 @@ module.exports = '1.0.7'; }.call(this)); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],53:[function(require,module,exports){ -/* -Copyright (c) 2012-2014 Chris Pettitt - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -module.exports = { - graphlib: require("./lib/graphlib"), - - layout: require("./lib/layout"), - debug: require("./lib/debug"), - util: { - time: require("./lib/util").time, - notime: require("./lib/util").notime - }, - version: require("./lib/version") -}; - -},{"./lib/debug":58,"./lib/graphlib":59,"./lib/layout":61,"./lib/util":81,"./lib/version":82}],54:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"), - greedyFAS = require("./greedy-fas"); - -module.exports = { - run: run, - undo: undo -}; - -function run(g) { - var fas = (g.graph().acyclicer === "greedy" - ? greedyFAS(g, weightFn(g)) - : dfsFAS(g)); - _.each(fas, function(e) { - var label = g.edge(e); - g.removeEdge(e); - label.forwardName = e.name; - label.reversed = true; - g.setEdge(e.w, e.v, label, _.uniqueId("rev")); - }); - - function weightFn(g) { - return function(e) { - return g.edge(e).weight; - }; - } -} - -function dfsFAS(g) { - var fas = [], - stack = {}, - visited = {}; - - function dfs(v) { - if (_.has(visited, v)) { - return; - } - visited[v] = true; - stack[v] = true; - _.each(g.outEdges(v), function(e) { - if (_.has(stack, e.w)) { - fas.push(e); - } else { - dfs(e.w); - } - }); - delete stack[v]; - } - - _.each(g.nodes(), dfs); - return fas; -} - -function undo(g) { - _.each(g.edges(), function(e) { - var label = g.edge(e); - if (label.reversed) { - g.removeEdge(e); - - var forwardName = label.forwardName; - delete label.reversed; - delete label.forwardName; - g.setEdge(e.w, e.v, label, forwardName); - } - }); -} - -},{"./greedy-fas":60,"./lodash":62}],55:[function(require,module,exports){ -var _ = require("./lodash"), - util = require("./util"); - -module.exports = addBorderSegments; - -function addBorderSegments(g) { - function dfs(v) { - var children = g.children(v), - node = g.node(v); - if (children.length) { - _.each(children, dfs); - } - - if (_.has(node, "minRank")) { - node.borderLeft = []; - node.borderRight = []; - for (var rank = node.minRank, maxRank = node.maxRank + 1; - rank < maxRank; - ++rank) { - addBorderNode(g, "borderLeft", "_bl", v, node, rank); - addBorderNode(g, "borderRight", "_br", v, node, rank); - } - } - } - - _.each(g.children(), dfs); -} - -function addBorderNode(g, prop, prefix, sg, sgNode, rank) { - var label = { width: 0, height: 0, rank: rank, borderType: prop }, - prev = sgNode[prop][rank - 1], - curr = util.addDummyNode(g, "border", label, prefix); - sgNode[prop][rank] = curr; - g.setParent(curr, sg); - if (prev) { - g.setEdge(prev, curr, { weight: 1 }); - } -} - -},{"./lodash":62,"./util":81}],56:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"); - -module.exports = { - adjust: adjust, - undo: undo -}; - -function adjust(g) { - var rankDir = g.graph().rankdir.toLowerCase(); - if (rankDir === "lr" || rankDir === "rl") { - swapWidthHeight(g); - } -} - -function undo(g) { - var rankDir = g.graph().rankdir.toLowerCase(); - if (rankDir === "bt" || rankDir === "rl") { - reverseY(g); - } - - if (rankDir === "lr" || rankDir === "rl") { - swapXY(g); - swapWidthHeight(g); - } -} - -function swapWidthHeight(g) { - _.each(g.nodes(), function(v) { swapWidthHeightOne(g.node(v)); }); - _.each(g.edges(), function(e) { swapWidthHeightOne(g.edge(e)); }); -} - -function swapWidthHeightOne(attrs) { - var w = attrs.width; - attrs.width = attrs.height; - attrs.height = w; -} - -function reverseY(g) { - _.each(g.nodes(), function(v) { reverseYOne(g.node(v)); }); - - _.each(g.edges(), function(e) { - var edge = g.edge(e); - _.each(edge.points, reverseYOne); - if (_.has(edge, "y")) { - reverseYOne(edge); - } - }); -} - -function reverseYOne(attrs) { - attrs.y = -attrs.y; -} - -function swapXY(g) { - _.each(g.nodes(), function(v) { swapXYOne(g.node(v)); }); - - _.each(g.edges(), function(e) { - var edge = g.edge(e); - _.each(edge.points, swapXYOne); - if (_.has(edge, "x")) { - swapXYOne(edge); - } - }); -} - -function swapXYOne(attrs) { - var x = attrs.x; - attrs.x = attrs.y; - attrs.y = x; -} - -},{"./lodash":62}],57:[function(require,module,exports){ -/* - * Simple doubly linked list implementation derived from Cormen, et al., - * "Introduction to Algorithms". - */ - -module.exports = List; - -function List() { - var sentinel = {}; - sentinel._next = sentinel._prev = sentinel; - this._sentinel = sentinel; -} - -List.prototype.dequeue = function() { - var sentinel = this._sentinel, - entry = sentinel._prev; - if (entry !== sentinel) { - unlink(entry); - return entry; - } -}; - -List.prototype.enqueue = function(entry) { - var sentinel = this._sentinel; - if (entry._prev && entry._next) { - unlink(entry); - } - entry._next = sentinel._next; - sentinel._next._prev = entry; - sentinel._next = entry; - entry._prev = sentinel; -}; - -List.prototype.toString = function() { - var strs = [], - sentinel = this._sentinel, - curr = sentinel._prev; - while (curr !== sentinel) { - strs.push(JSON.stringify(curr, filterOutLinks)); - curr = curr._prev; - } - return "[" + strs.join(", ") + "]"; -}; - -function unlink(entry) { - entry._prev._next = entry._next; - entry._next._prev = entry._prev; - delete entry._next; - delete entry._prev; -} - -function filterOutLinks(k, v) { - if (k !== "_next" && k !== "_prev") { - return v; - } -} - -},{}],58:[function(require,module,exports){ -var _ = require("./lodash"), - util = require("./util"), - Graph = require("./graphlib").Graph; - -module.exports = { - debugOrdering: debugOrdering -}; - -/* istanbul ignore next */ -function debugOrdering(g) { - var layerMatrix = util.buildLayerMatrix(g); - - var h = new Graph({ compound: true, multigraph: true }).setGraph({}); - - _.each(g.nodes(), function(v) { - h.setNode(v, { label: v }); - h.setParent(v, "layer" + g.node(v).rank); - }); - - _.each(g.edges(), function(e) { - h.setEdge(e.v, e.w, {}, e.name); - }); - - _.each(layerMatrix, function(layer, i) { - var layerV = "layer" + i; - h.setNode(layerV, { rank: "same" }); - _.reduce(layer, function(u, v) { - h.setEdge(u, v, { style: "invis" }); - return v; - }); - }); - - return h; -} - -},{"./graphlib":59,"./lodash":62,"./util":81}],59:[function(require,module,exports){ -/* global window */ - -var graphlib; - -if (typeof require === "function") { - try { - graphlib = require("graphlib"); - } catch (e) {} -} - -if (!graphlib) { - graphlib = window.graphlib; -} - -module.exports = graphlib; - -},{"graphlib":83}],60:[function(require,module,exports){ -var _ = require("./lodash"), - Graph = require("./graphlib").Graph, - List = require("./data/list"); - -/* - * A greedy heuristic for finding a feedback arc set for a graph. A feedback - * arc set is a set of edges that can be removed to make a graph acyclic. - * The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, "A fast and - * effective heuristic for the feedback arc set problem." This implementation - * adjusts that from the paper to allow for weighted edges. - */ -module.exports = greedyFAS; - -var DEFAULT_WEIGHT_FN = _.constant(1); - -function greedyFAS(g, weightFn) { - if (g.nodeCount() <= 1) { - return []; - } - var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN); - var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx); - - // Expand multi-edges - return _.flatten(_.map(results, function(e) { - return g.outEdges(e.v, e.w); - }), true); -} - -function doGreedyFAS(g, buckets, zeroIdx) { - var results = [], - sources = buckets[buckets.length - 1], - sinks = buckets[0]; - - var entry; - while (g.nodeCount()) { - while ((entry = sinks.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } - while ((entry = sources.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } - if (g.nodeCount()) { - for (var i = buckets.length - 2; i > 0; --i) { - entry = buckets[i].dequeue(); - if (entry) { - results = results.concat(removeNode(g, buckets, zeroIdx, entry, true)); - break; - } - } - } - } - - return results; -} - -function removeNode(g, buckets, zeroIdx, entry, collectPredecessors) { - var results = collectPredecessors ? [] : undefined; - - _.each(g.inEdges(entry.v), function(edge) { - var weight = g.edge(edge), - uEntry = g.node(edge.v); - - if (collectPredecessors) { - results.push({ v: edge.v, w: edge.w }); - } - - uEntry.out -= weight; - assignBucket(buckets, zeroIdx, uEntry); - }); - - _.each(g.outEdges(entry.v), function(edge) { - var weight = g.edge(edge), - w = edge.w, - wEntry = g.node(w); - wEntry["in"] -= weight; - assignBucket(buckets, zeroIdx, wEntry); - }); - - g.removeNode(entry.v); - - return results; -} - -function buildState(g, weightFn) { - var fasGraph = new Graph(), - maxIn = 0, - maxOut = 0; - - _.each(g.nodes(), function(v) { - fasGraph.setNode(v, { v: v, "in": 0, out: 0 }); - }); - - // Aggregate weights on nodes, but also sum the weights across multi-edges - // into a single edge for the fasGraph. - _.each(g.edges(), function(e) { - var prevWeight = fasGraph.edge(e.v, e.w) || 0, - weight = weightFn(e), - edgeWeight = prevWeight + weight; - fasGraph.setEdge(e.v, e.w, edgeWeight); - maxOut = Math.max(maxOut, fasGraph.node(e.v).out += weight); - maxIn = Math.max(maxIn, fasGraph.node(e.w)["in"] += weight); - }); - - var buckets = _.range(maxOut + maxIn + 3).map(function() { return new List(); }); - var zeroIdx = maxIn + 1; - - _.each(fasGraph.nodes(), function(v) { - assignBucket(buckets, zeroIdx, fasGraph.node(v)); - }); - - return { graph: fasGraph, buckets: buckets, zeroIdx: zeroIdx }; -} - -function assignBucket(buckets, zeroIdx, entry) { - if (!entry.out) { - buckets[0].enqueue(entry); - } else if (!entry["in"]) { - buckets[buckets.length - 1].enqueue(entry); - } else { - buckets[entry.out - entry["in"] + zeroIdx].enqueue(entry); - } -} - -},{"./data/list":57,"./graphlib":59,"./lodash":62}],61:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"), - acyclic = require("./acyclic"), - normalize = require("./normalize"), - rank = require("./rank"), - normalizeRanks = require("./util").normalizeRanks, - parentDummyChains = require("./parent-dummy-chains"), - removeEmptyRanks = require("./util").removeEmptyRanks, - nestingGraph = require("./nesting-graph"), - addBorderSegments = require("./add-border-segments"), - coordinateSystem = require("./coordinate-system"), - order = require("./order"), - position = require("./position"), - util = require("./util"), - Graph = require("./graphlib").Graph; - -module.exports = layout; - -function layout(g, opts) { - var time = opts && opts.debugTiming ? util.time : util.notime; - time("layout", function() { - var layoutGraph = time(" buildLayoutGraph", - function() { return buildLayoutGraph(g); }); - time(" runLayout", function() { runLayout(layoutGraph, time); }); - time(" updateInputGraph", function() { updateInputGraph(g, layoutGraph); }); - }); -} - -function runLayout(g, time) { - time(" makeSpaceForEdgeLabels", function() { makeSpaceForEdgeLabels(g); }); - time(" removeSelfEdges", function() { removeSelfEdges(g); }); - time(" acyclic", function() { acyclic.run(g); }); - time(" nestingGraph.run", function() { nestingGraph.run(g); }); - time(" rank", function() { rank(util.asNonCompoundGraph(g)); }); - time(" injectEdgeLabelProxies", function() { injectEdgeLabelProxies(g); }); - time(" removeEmptyRanks", function() { removeEmptyRanks(g); }); - time(" nestingGraph.cleanup", function() { nestingGraph.cleanup(g); }); - time(" normalizeRanks", function() { normalizeRanks(g); }); - time(" assignRankMinMax", function() { assignRankMinMax(g); }); - time(" removeEdgeLabelProxies", function() { removeEdgeLabelProxies(g); }); - time(" normalize.run", function() { normalize.run(g); }); - time(" parentDummyChains", function() { parentDummyChains(g); }); - time(" addBorderSegments", function() { addBorderSegments(g); }); - time(" order", function() { order(g); }); - time(" insertSelfEdges", function() { insertSelfEdges(g); }); - time(" adjustCoordinateSystem", function() { coordinateSystem.adjust(g); }); - time(" position", function() { position(g); }); - time(" positionSelfEdges", function() { positionSelfEdges(g); }); - time(" removeBorderNodes", function() { removeBorderNodes(g); }); - time(" normalize.undo", function() { normalize.undo(g); }); - time(" fixupEdgeLabelCoords", function() { fixupEdgeLabelCoords(g); }); - time(" undoCoordinateSystem", function() { coordinateSystem.undo(g); }); - time(" translateGraph", function() { translateGraph(g); }); - time(" assignNodeIntersects", function() { assignNodeIntersects(g); }); - time(" reversePoints", function() { reversePointsForReversedEdges(g); }); - time(" acyclic.undo", function() { acyclic.undo(g); }); -} - -/* - * Copies final layout information from the layout graph back to the input - * graph. This process only copies whitelisted attributes from the layout graph - * to the input graph, so it serves as a good place to determine what - * attributes can influence layout. - */ -function updateInputGraph(inputGraph, layoutGraph) { - _.each(inputGraph.nodes(), function(v) { - var inputLabel = inputGraph.node(v), - layoutLabel = layoutGraph.node(v); - - if (inputLabel) { - inputLabel.x = layoutLabel.x; - inputLabel.y = layoutLabel.y; - - if (layoutGraph.children(v).length) { - inputLabel.width = layoutLabel.width; - inputLabel.height = layoutLabel.height; - } - } - }); - - _.each(inputGraph.edges(), function(e) { - var inputLabel = inputGraph.edge(e), - layoutLabel = layoutGraph.edge(e); - - inputLabel.points = layoutLabel.points; - if (_.has(layoutLabel, "x")) { - inputLabel.x = layoutLabel.x; - inputLabel.y = layoutLabel.y; - } - }); - - inputGraph.graph().width = layoutGraph.graph().width; - inputGraph.graph().height = layoutGraph.graph().height; -} - -var graphNumAttrs = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], - graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, - graphAttrs = ["acyclicer", "ranker", "rankdir", "align"], - nodeNumAttrs = ["width", "height"], - nodeDefaults = { width: 0, height: 0 }, - edgeNumAttrs = ["minlen", "weight", "width", "height", "labeloffset"], - edgeDefaults = { - minlen: 1, weight: 1, width: 0, height: 0, - labeloffset: 10, labelpos: "r" - }, - edgeAttrs = ["labelpos"]; - -/* - * Constructs a new graph from the input graph, which can be used for layout. - * This process copies only whitelisted attributes from the input graph to the - * layout graph. Thus this function serves as a good place to determine what - * attributes can influence layout. - */ -function buildLayoutGraph(inputGraph) { - var g = new Graph({ multigraph: true, compound: true }), - graph = canonicalize(inputGraph.graph()); - - g.setGraph(_.merge({}, - graphDefaults, - selectNumberAttrs(graph, graphNumAttrs), - _.pick(graph, graphAttrs))); - - _.each(inputGraph.nodes(), function(v) { - var node = canonicalize(inputGraph.node(v)); - g.setNode(v, _.defaults(selectNumberAttrs(node, nodeNumAttrs), nodeDefaults)); - g.setParent(v, inputGraph.parent(v)); - }); - - _.each(inputGraph.edges(), function(e) { - var edge = canonicalize(inputGraph.edge(e)); - g.setEdge(e, _.merge({}, - edgeDefaults, - selectNumberAttrs(edge, edgeNumAttrs), - _.pick(edge, edgeAttrs))); - }); - - return g; -} - -/* - * This idea comes from the Gansner paper: to account for edge labels in our - * layout we split each rank in half by doubling minlen and halving ranksep. - * Then we can place labels at these mid-points between nodes. - * - * We also add some minimal padding to the width to push the label for the edge - * away from the edge itself a bit. - */ -function makeSpaceForEdgeLabels(g) { - var graph = g.graph(); - graph.ranksep /= 2; - _.each(g.edges(), function(e) { - var edge = g.edge(e); - edge.minlen *= 2; - if (edge.labelpos.toLowerCase() !== "c") { - if (graph.rankdir === "TB" || graph.rankdir === "BT") { - edge.width += edge.labeloffset; - } else { - edge.height += edge.labeloffset; - } - } - }); -} - -/* - * Creates temporary dummy nodes that capture the rank in which each edge's - * label is going to, if it has one of non-zero width and height. We do this - * so that we can safely remove empty ranks while preserving balance for the - * label's position. - */ -function injectEdgeLabelProxies(g) { - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (edge.width && edge.height) { - var v = g.node(e.v), - w = g.node(e.w), - label = { rank: (w.rank - v.rank) / 2 + v.rank, e: e }; - util.addDummyNode(g, "edge-proxy", label, "_ep"); - } - }); -} - -function assignRankMinMax(g) { - var maxRank = 0; - _.each(g.nodes(), function(v) { - var node = g.node(v); - if (node.borderTop) { - node.minRank = g.node(node.borderTop).rank; - node.maxRank = g.node(node.borderBottom).rank; - maxRank = _.max(maxRank, node.maxRank); - } - }); - g.graph().maxRank = maxRank; -} - -function removeEdgeLabelProxies(g) { - _.each(g.nodes(), function(v) { - var node = g.node(v); - if (node.dummy === "edge-proxy") { - g.edge(node.e).labelRank = node.rank; - g.removeNode(v); - } - }); -} - -function translateGraph(g) { - var minX = Number.POSITIVE_INFINITY, - maxX = 0, - minY = Number.POSITIVE_INFINITY, - maxY = 0, - graphLabel = g.graph(), - marginX = graphLabel.marginx || 0, - marginY = graphLabel.marginy || 0; - - function getExtremes(attrs) { - var x = attrs.x, - y = attrs.y, - w = attrs.width, - h = attrs.height; - minX = Math.min(minX, x - w / 2); - maxX = Math.max(maxX, x + w / 2); - minY = Math.min(minY, y - h / 2); - maxY = Math.max(maxY, y + h / 2); - } - - _.each(g.nodes(), function(v) { getExtremes(g.node(v)); }); - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (_.has(edge, "x")) { - getExtremes(edge); - } - }); - - minX -= marginX; - minY -= marginY; - - _.each(g.nodes(), function(v) { - var node = g.node(v); - node.x -= minX; - node.y -= minY; - }); - - _.each(g.edges(), function(e) { - var edge = g.edge(e); - _.each(edge.points, function(p) { - p.x -= minX; - p.y -= minY; - }); - if (_.has(edge, "x")) { edge.x -= minX; } - if (_.has(edge, "y")) { edge.y -= minY; } - }); - - graphLabel.width = maxX - minX + marginX; - graphLabel.height = maxY - minY + marginY; -} - -function assignNodeIntersects(g) { - _.each(g.edges(), function(e) { - var edge = g.edge(e), - nodeV = g.node(e.v), - nodeW = g.node(e.w), - p1, p2; - if (!edge.points) { - edge.points = []; - p1 = nodeW; - p2 = nodeV; - } else { - p1 = edge.points[0]; - p2 = edge.points[edge.points.length - 1]; - } - edge.points.unshift(util.intersectRect(nodeV, p1)); - edge.points.push(util.intersectRect(nodeW, p2)); - }); -} - -function fixupEdgeLabelCoords(g) { - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (_.has(edge, "x")) { - if (edge.labelpos === "l" || edge.labelpos === "r") { - edge.width -= edge.labeloffset; - } - switch (edge.labelpos) { - case "l": edge.x -= edge.width / 2 + edge.labeloffset; break; - case "r": edge.x += edge.width / 2 + edge.labeloffset; break; - } - } - }); -} - -function reversePointsForReversedEdges(g) { - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (edge.reversed) { - edge.points.reverse(); - } - }); -} - -function removeBorderNodes(g) { - _.each(g.nodes(), function(v) { - if (g.children(v).length) { - var node = g.node(v), - t = g.node(node.borderTop), - b = g.node(node.borderBottom), - l = g.node(_.last(node.borderLeft)), - r = g.node(_.last(node.borderRight)); - - node.width = Math.abs(r.x - l.x); - node.height = Math.abs(b.y - t.y); - node.x = l.x + node.width / 2; - node.y = t.y + node.height / 2; - } - }); - - _.each(g.nodes(), function(v) { - if (g.node(v).dummy === "border") { - g.removeNode(v); - } - }); -} - -function removeSelfEdges(g) { - _.each(g.edges(), function(e) { - if (e.v === e.w) { - var node = g.node(e.v); - if (!node.selfEdges) { - node.selfEdges = []; - } - node.selfEdges.push({ e: e, label: g.edge(e) }); - g.removeEdge(e); - } - }); -} - -function insertSelfEdges(g) { - var layers = util.buildLayerMatrix(g); - _.each(layers, function(layer) { - var orderShift = 0; - _.each(layer, function(v, i) { - var node = g.node(v); - node.order = i + orderShift; - _.each(node.selfEdges, function(selfEdge) { - util.addDummyNode(g, "selfedge", { - width: selfEdge.label.width, - height: selfEdge.label.height, - rank: node.rank, - order: i + (++orderShift), - e: selfEdge.e, - label: selfEdge.label - }, "_se"); - }); - delete node.selfEdges; - }); - }); -} - -function positionSelfEdges(g) { - _.each(g.nodes(), function(v) { - var node = g.node(v); - if (node.dummy === "selfedge") { - var selfNode = g.node(node.e.v), - x = selfNode.x + selfNode.width / 2, - y = selfNode.y, - dx = node.x - x, - dy = selfNode.height / 2; - g.setEdge(node.e, node.label); - g.removeNode(v); - node.label.points = [ - { x: x + 2 * dx / 3, y: y - dy }, - { x: x + 5 * dx / 6, y: y - dy }, - { x: x + dx , y: y }, - { x: x + 5 * dx / 6, y: y + dy }, - { x: x + 2 * dx / 3, y: y + dy }, - ]; - node.label.x = node.x; - node.label.y = node.y; - } - }); -} - -function selectNumberAttrs(obj, attrs) { - return _.mapValues(_.pick(obj, attrs), Number); -} - -function canonicalize(attrs) { - var newAttrs = {}; - _.each(attrs, function(v, k) { - newAttrs[k.toLowerCase()] = v; - }); - return newAttrs; -} - -},{"./acyclic":54,"./add-border-segments":55,"./coordinate-system":56,"./graphlib":59,"./lodash":62,"./nesting-graph":63,"./normalize":64,"./order":69,"./parent-dummy-chains":74,"./position":76,"./rank":78,"./util":81}],62:[function(require,module,exports){ -module.exports=require(50) -},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\lodash.js":50,"lodash":103}],63:[function(require,module,exports){ -var _ = require("./lodash"), - util = require("./util"); - -module.exports = { - run: run, - cleanup: cleanup -}; - -/* - * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs, - * adds appropriate edges to ensure that all cluster nodes are placed between - * these boundries, and ensures that the graph is connected. - * - * In addition we ensure, through the use of the minlen property, that nodes - * and subgraph border nodes to not end up on the same rank. - * - * Preconditions: - * - * 1. Input graph is a DAG - * 2. Nodes in the input graph has a minlen attribute - * - * Postconditions: - * - * 1. Input graph is connected. - * 2. Dummy nodes are added for the tops and bottoms of subgraphs. - * 3. The minlen attribute for nodes is adjusted to ensure nodes do not - * get placed on the same rank as subgraph border nodes. - * - * The nesting graph idea comes from Sander, "Layout of Compound Directed - * Graphs." - */ -function run(g) { - var root = util.addDummyNode(g, "root", {}, "_root"), - depths = treeDepths(g), - height = _.max(depths) - 1, - nodeSep = 2 * height + 1; - - g.graph().nestingRoot = root; - - // Multiply minlen by nodeSep to align nodes on non-border ranks. - _.each(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; }); - - // Calculate a weight that is sufficient to keep subgraphs vertically compact - var weight = sumWeights(g) + 1; - - // Create border nodes and link them up - _.each(g.children(), function(child) { - dfs(g, root, nodeSep, weight, height, depths, child); - }); - - // Save the multiplier for node layers for later removal of empty border - // layers. - g.graph().nodeRankFactor = nodeSep; -} - -function dfs(g, root, nodeSep, weight, height, depths, v) { - var children = g.children(v); - if (!children.length) { - if (v !== root) { - g.setEdge(root, v, { weight: 0, minlen: nodeSep }); - } - return; - } - - var top = util.addBorderNode(g, "_bt"), - bottom = util.addBorderNode(g, "_bb"), - label = g.node(v); - - g.setParent(top, v); - label.borderTop = top; - g.setParent(bottom, v); - label.borderBottom = bottom; - - _.each(children, function(child) { - dfs(g, root, nodeSep, weight, height, depths, child); - - var childNode = g.node(child), - childTop = childNode.borderTop ? childNode.borderTop : child, - childBottom = childNode.borderBottom ? childNode.borderBottom : child, - thisWeight = childNode.borderTop ? weight : 2 * weight, - minlen = childTop !== childBottom ? 1 : height - depths[v] + 1; - - g.setEdge(top, childTop, { - weight: thisWeight, - minlen: minlen, - nestingEdge: true - }); - - g.setEdge(childBottom, bottom, { - weight: thisWeight, - minlen: minlen, - nestingEdge: true - }); - }); - - if (!g.parent(v)) { - g.setEdge(root, top, { weight: 0, minlen: height + depths[v] }); - } -} - -function treeDepths(g) { - var depths = {}; - function dfs(v, depth) { - var children = g.children(v); - if (children && children.length) { - _.each(children, function(child) { - dfs(child, depth + 1); - }); - } - depths[v] = depth; - } - _.each(g.children(), function(v) { dfs(v, 1); }); - return depths; -} - -function sumWeights(g) { - return _.reduce(g.edges(), function(acc, e) { - return acc + g.edge(e).weight; - }, 0); -} - -function cleanup(g) { - var graphLabel = g.graph(); - g.removeNode(graphLabel.nestingRoot); - delete graphLabel.nestingRoot; - _.each(g.edges(), function(e) { - var edge = g.edge(e); - if (edge.nestingEdge) { - g.removeEdge(e); - } - }); -} - -},{"./lodash":62,"./util":81}],64:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"), - util = require("./util"); - -module.exports = { - run: run, - undo: undo -}; - -/* - * Breaks any long edges in the graph into short segments that span 1 layer - * each. This operation is undoable with the denormalize function. - * - * Pre-conditions: - * - * 1. The input graph is a DAG. - * 2. Each node in the graph has a "rank" property. - * - * Post-condition: - * - * 1. All edges in the graph have a length of 1. - * 2. Dummy nodes are added where edges have been split into segments. - * 3. The graph is augmented with a "dummyChains" attribute which contains - * the first dummy in each chain of dummy nodes produced. - */ -function run(g) { - g.graph().dummyChains = []; - _.each(g.edges(), function(edge) { normalizeEdge(g, edge); }); -} - -function normalizeEdge(g, e) { - var v = e.v, - vRank = g.node(v).rank, - w = e.w, - wRank = g.node(w).rank, - name = e.name, - edgeLabel = g.edge(e), - labelRank = edgeLabel.labelRank; - - if (wRank === vRank + 1) return; - - g.removeEdge(e); - - var dummy, attrs, i; - for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) { - edgeLabel.points = []; - attrs = { - width: 0, height: 0, - edgeLabel: edgeLabel, edgeObj: e, - rank: vRank - }; - dummy = util.addDummyNode(g, "edge", attrs, "_d"); - if (vRank === labelRank) { - attrs.width = edgeLabel.width; - attrs.height = edgeLabel.height; - attrs.dummy = "edge-label"; - attrs.labelpos = edgeLabel.labelpos; - } - g.setEdge(v, dummy, { weight: edgeLabel.weight }, name); - if (i === 0) { - g.graph().dummyChains.push(dummy); - } - v = dummy; - } - - g.setEdge(v, w, { weight: edgeLabel.weight }, name); -} - -function undo(g) { - _.each(g.graph().dummyChains, function(v) { - var node = g.node(v), - origLabel = node.edgeLabel, - w; - g.setEdge(node.edgeObj, origLabel); - while (node.dummy) { - w = g.successors(v)[0]; - g.removeNode(v); - origLabel.points.push({ x: node.x, y: node.y }); - if (node.dummy === "edge-label") { - origLabel.x = node.x; - origLabel.y = node.y; - origLabel.width = node.width; - origLabel.height = node.height; - } - v = w; - node = g.node(v); - } - }); -} - -},{"./lodash":62,"./util":81}],65:[function(require,module,exports){ -var _ = require("../lodash"); - -module.exports = addSubgraphConstraints; - -function addSubgraphConstraints(g, cg, vs) { - var prev = {}, - rootPrev; - - _.each(vs, function(v) { - var child = g.parent(v), - parent, - prevChild; - while (child) { - parent = g.parent(child); - if (parent) { - prevChild = prev[parent]; - prev[parent] = child; - } else { - prevChild = rootPrev; - rootPrev = child; - } - if (prevChild && prevChild !== child) { - cg.setEdge(prevChild, child); - return; - } - child = parent; - } - }); - - /* - function dfs(v) { - var children = v ? g.children(v) : g.children(); - if (children.length) { - var min = Number.POSITIVE_INFINITY, - subgraphs = []; - _.each(children, function(child) { - var childMin = dfs(child); - if (g.children(child).length) { - subgraphs.push({ v: child, order: childMin }); - } - min = Math.min(min, childMin); - }); - _.reduce(_.sortBy(subgraphs, "order"), function(prev, curr) { - cg.setEdge(prev.v, curr.v); - return curr; - }); - return min; - } - return g.node(v).order; - } - dfs(undefined); - */ -} - -},{"../lodash":62}],66:[function(require,module,exports){ -var _ = require("../lodash"); - -module.exports = barycenter; - -function barycenter(g, movable) { - return _.map(movable, function(v) { - var inV = g.inEdges(v); - if (!inV.length) { - return { v: v }; - } else { - var result = _.reduce(inV, function(acc, e) { - var edge = g.edge(e), - nodeU = g.node(e.v); - return { - sum: acc.sum + (edge.weight * nodeU.order), - weight: acc.weight + edge.weight - }; - }, { sum: 0, weight: 0 }); - - return { - v: v, - barycenter: result.sum / result.weight, - weight: result.weight - }; - } - }); -} - - -},{"../lodash":62}],67:[function(require,module,exports){ -var _ = require("../lodash"), - Graph = require("../graphlib").Graph; - -module.exports = buildLayerGraph; - -/* - * Constructs a graph that can be used to sort a layer of nodes. The graph will - * contain all base and subgraph nodes from the request layer in their original - * hierarchy and any edges that are incident on these nodes and are of the type - * requested by the "relationship" parameter. - * - * Nodes from the requested rank that do not have parents are assigned a root - * node in the output graph, which is set in the root graph attribute. This - * makes it easy to walk the hierarchy of movable nodes during ordering. - * - * Pre-conditions: - * - * 1. Input graph is a DAG - * 2. Base nodes in the input graph have a rank attribute - * 3. Subgraph nodes in the input graph has minRank and maxRank attributes - * 4. Edges have an assigned weight - * - * Post-conditions: - * - * 1. Output graph has all nodes in the movable rank with preserved - * hierarchy. - * 2. Root nodes in the movable layer are made children of the node - * indicated by the root attribute of the graph. - * 3. Non-movable nodes incident on movable nodes, selected by the - * relationship parameter, are included in the graph (without hierarchy). - * 4. Edges incident on movable nodes, selected by the relationship - * parameter, are added to the output graph. - * 5. The weights for copied edges are aggregated as need, since the output - * graph is not a multi-graph. - */ -function buildLayerGraph(g, rank, relationship) { - var root = createRootNode(g), - result = new Graph({ compound: true }).setGraph({ root: root }) - .setDefaultNodeLabel(function(v) { return g.node(v); }); - - _.each(g.nodes(), function(v) { - var node = g.node(v), - parent = g.parent(v); - - if (node.rank === rank || node.minRank <= rank && rank <= node.maxRank) { - result.setNode(v); - result.setParent(v, parent || root); - - // This assumes we have only short edges! - _.each(g[relationship](v), function(e) { - var u = e.v === v ? e.w : e.v, - edge = result.edge(u, v), - weight = !_.isUndefined(edge) ? edge.weight : 0; - result.setEdge(u, v, { weight: g.edge(e).weight + weight }); - }); - - if (_.has(node, "minRank")) { - result.setNode(v, { - borderLeft: node.borderLeft[rank], - borderRight: node.borderRight[rank] - }); - } - } - }); - - return result; -} - -function createRootNode(g) { - var v; - while (g.hasNode((v = _.uniqueId("_root")))); - return v; -} - -},{"../graphlib":59,"../lodash":62}],68:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"); - -module.exports = crossCount; - -/* - * A function that takes a layering (an array of layers, each with an array of - * ordererd nodes) and a graph and returns a weighted crossing count. - * - * Pre-conditions: - * - * 1. Input graph must be simple (not a multigraph), directed, and include - * only simple edges. - * 2. Edges in the input graph must have assigned weights. - * - * Post-conditions: - * - * 1. The graph and layering matrix are left unchanged. - * - * This algorithm is derived from Barth, et al., "Bilayer Cross Counting." - */ -function crossCount(g, layering) { - var cc = 0; - for (var i = 1; i < layering.length; ++i) { - cc += twoLayerCrossCount(g, layering[i-1], layering[i]); - } - return cc; -} - -function twoLayerCrossCount(g, northLayer, southLayer) { - // Sort all of the edges between the north and south layers by their position - // in the north layer and then the south. Map these edges to the position of - // their head in the south layer. - var southPos = _.zipObject(southLayer, - _.map(southLayer, function (v, i) { return i; })); - var southEntries = _.flatten(_.map(northLayer, function(v) { - return _.chain(g.outEdges(v)) - .map(function(e) { - return { pos: southPos[e.w], weight: g.edge(e).weight }; - }) - .sortBy("pos") - .value(); - }), true); - - // Build the accumulator tree - var firstIndex = 1; - while (firstIndex < southLayer.length) firstIndex <<= 1; - var treeSize = 2 * firstIndex - 1; - firstIndex -= 1; - var tree = _.map(new Array(treeSize), function() { return 0; }); - - // Calculate the weighted crossings - var cc = 0; - _.each(southEntries.forEach(function(entry) { - var index = entry.pos + firstIndex; - tree[index] += entry.weight; - var weightSum = 0; - while (index > 0) { - if (index % 2) { - weightSum += tree[index + 1]; - } - index = (index - 1) >> 1; - tree[index] += entry.weight; - } - cc += entry.weight * weightSum; - })); - - return cc; -} - -},{"../lodash":62}],69:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - initOrder = require("./init-order"), - crossCount = require("./cross-count"), - sortSubgraph = require("./sort-subgraph"), - buildLayerGraph = require("./build-layer-graph"), - addSubgraphConstraints = require("./add-subgraph-constraints"), - Graph = require("../graphlib").Graph, - util = require("../util"); - -module.exports = order; - -/* - * Applies heuristics to minimize edge crossings in the graph and sets the best - * order solution as an order attribute on each node. - * - * Pre-conditions: - * - * 1. Graph must be DAG - * 2. Graph nodes must be objects with a "rank" attribute - * 3. Graph edges must have the "weight" attribute - * - * Post-conditions: - * - * 1. Graph nodes will have an "order" attribute based on the results of the - * algorithm. - */ -function order(g) { - var maxRank = util.maxRank(g), - downLayerGraphs = buildLayerGraphs(g, _.range(1, maxRank + 1), "inEdges"), - upLayerGraphs = buildLayerGraphs(g, _.range(maxRank - 1, -1, -1), "outEdges"); - - var layering = initOrder(g); - assignOrder(g, layering); - - var bestCC = Number.POSITIVE_INFINITY, - best; - - for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) { - sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2); - - layering = util.buildLayerMatrix(g); - var cc = crossCount(g, layering); - if (cc < bestCC) { - lastBest = 0; - best = _.cloneDeep(layering); - bestCC = cc; - } - } - - assignOrder(g, best); -} - -function buildLayerGraphs(g, ranks, relationship) { - return _.map(ranks, function(rank) { - return buildLayerGraph(g, rank, relationship); - }); -} - -function sweepLayerGraphs(layerGraphs, biasRight) { - var cg = new Graph(); - _.each(layerGraphs, function(lg) { - var root = lg.graph().root; - var sorted = sortSubgraph(lg, root, cg, biasRight); - _.each(sorted.vs, function(v, i) { - lg.node(v).order = i; - }); - addSubgraphConstraints(lg, cg, sorted.vs); - }); -} - -function assignOrder(g, layering) { - _.each(layering, function(layer) { - _.each(layer, function(v, i) { - g.node(v).order = i; - }); - }); -} - -},{"../graphlib":59,"../lodash":62,"../util":81,"./add-subgraph-constraints":65,"./build-layer-graph":67,"./cross-count":68,"./init-order":70,"./sort-subgraph":72}],70:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"); - -module.exports = initOrder; - -/* - * Assigns an initial order value for each node by performing a DFS search - * starting from nodes in the first rank. Nodes are assigned an order in their - * rank as they are first visited. - * - * This approach comes from Gansner, et al., "A Technique for Drawing Directed - * Graphs." - * - * Returns a layering matrix with an array per layer and each layer sorted by - * the order of its nodes. - */ -function initOrder(g) { - var visited = {}, - simpleNodes = _.filter(g.nodes(), function(v) { - return !g.children(v).length; - }), - maxRank = _.max(_.map(simpleNodes, function(v) { return g.node(v).rank; })), - layers = _.map(_.range(maxRank + 1), function() { return []; }); - - function dfs(v) { - if (_.has(visited, v)) return; - visited[v] = true; - var node = g.node(v); - layers[node.rank].push(v); - _.each(g.successors(v), dfs); - } - - var orderedVs = _.sortBy(simpleNodes, function(v) { return g.node(v).rank; }); - _.each(orderedVs, dfs); - - return layers; -} - -},{"../lodash":62}],71:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"); - -module.exports = resolveConflicts; - -/* - * Given a list of entries of the form {v, barycenter, weight} and a - * constraint graph this function will resolve any conflicts between the - * constraint graph and the barycenters for the entries. If the barycenters for - * an entry would violate a constraint in the constraint graph then we coalesce - * the nodes in the conflict into a new node that respects the contraint and - * aggregates barycenter and weight information. - * - * This implementation is based on the description in Forster, "A Fast and - * Simple Hueristic for Constrained Two-Level Crossing Reduction," thought it - * differs in some specific details. - * - * Pre-conditions: - * - * 1. Each entry has the form {v, barycenter, weight}, or if the node has - * no barycenter, then {v}. - * - * Returns: - * - * A new list of entries of the form {vs, i, barycenter, weight}. The list - * `vs` may either be a singleton or it may be an aggregation of nodes - * ordered such that they do not violate constraints from the constraint - * graph. The property `i` is the lowest original index of any of the - * elements in `vs`. - */ -function resolveConflicts(entries, cg) { - var mappedEntries = {}; - _.each(entries, function(entry, i) { - var tmp = mappedEntries[entry.v] = { - indegree: 0, - "in": [], - out: [], - vs: [entry.v], - i: i - }; - if (!_.isUndefined(entry.barycenter)) { - tmp.barycenter = entry.barycenter; - tmp.weight = entry.weight; - } - }); - - _.each(cg.edges(), function(e) { - var entryV = mappedEntries[e.v], - entryW = mappedEntries[e.w]; - if (!_.isUndefined(entryV) && !_.isUndefined(entryW)) { - entryW.indegree++; - entryV.out.push(mappedEntries[e.w]); - } - }); - - var sourceSet = _.filter(mappedEntries, function(entry) { - return !entry.indegree; - }); - - return doResolveConflicts(sourceSet); -} - -function doResolveConflicts(sourceSet) { - var entries = []; - - function handleIn(vEntry) { - return function(uEntry) { - if (uEntry.merged) { - return; - } - if (_.isUndefined(uEntry.barycenter) || - _.isUndefined(vEntry.barycenter) || - uEntry.barycenter >= vEntry.barycenter) { - mergeEntries(vEntry, uEntry); - } - }; - } - - function handleOut(vEntry) { - return function(wEntry) { - wEntry["in"].push(vEntry); - if (--wEntry.indegree === 0) { - sourceSet.push(wEntry); - } - }; - } - - while (sourceSet.length) { - var entry = sourceSet.pop(); - entries.push(entry); - _.each(entry["in"].reverse(), handleIn(entry)); - _.each(entry.out, handleOut(entry)); - } - - return _.chain(entries) - .filter(function(entry) { return !entry.merged; }) - .map(function(entry) { - return _.pick(entry, ["vs", "i", "barycenter", "weight"]); - }) - .value(); -} - -function mergeEntries(target, source) { - var sum = 0, - weight = 0; - - if (target.weight) { - sum += target.barycenter * target.weight; - weight += target.weight; - } - - if (source.weight) { - sum += source.barycenter * source.weight; - weight += source.weight; - } - - target.vs = source.vs.concat(target.vs); - target.barycenter = sum / weight; - target.weight = weight; - target.i = Math.min(source.i, target.i); - source.merged = true; -} - -},{"../lodash":62}],72:[function(require,module,exports){ -var _ = require("../lodash"), - barycenter = require("./barycenter"), - resolveConflicts = require("./resolve-conflicts"), - sort = require("./sort"); - -module.exports = sortSubgraph; - -function sortSubgraph(g, v, cg, biasRight) { - var movable = g.children(v), - node = g.node(v), - bl = node ? node.borderLeft : undefined, - br = node ? node.borderRight: undefined, - subgraphs = {}; - - if (bl) { - movable = _.filter(movable, function(w) { - return w !== bl && w !== br; - }); - } - - var barycenters = barycenter(g, movable); - _.each(barycenters, function(entry) { - if (g.children(entry.v).length) { - var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight); - subgraphs[entry.v] = subgraphResult; - if (_.has(subgraphResult, "barycenter")) { - mergeBarycenters(entry, subgraphResult); - } - } - }); - - var entries = resolveConflicts(barycenters, cg); - expandSubgraphs(entries, subgraphs); - - var result = sort(entries, biasRight); - - if (bl) { - result.vs = _.flatten([bl, result.vs, br], true); - if (g.predecessors(bl).length) { - var blPred = g.node(g.predecessors(bl)[0]), - brPred = g.node(g.predecessors(br)[0]); - if (!_.has(result, "barycenter")) { - result.barycenter = 0; - result.weight = 0; - } - result.barycenter = (result.barycenter * result.weight + - blPred.order + brPred.order) / (result.weight + 2); - result.weight += 2; - } - } - - return result; -} - -function expandSubgraphs(entries, subgraphs) { - _.each(entries, function(entry) { - entry.vs = _.flatten(entry.vs.map(function(v) { - if (subgraphs[v]) { - return subgraphs[v].vs; - } - return v; - }), true); - }); -} - -function mergeBarycenters(target, other) { - if (!_.isUndefined(target.barycenter)) { - target.barycenter = (target.barycenter * target.weight + - other.barycenter * other.weight) / - (target.weight + other.weight); - target.weight += other.weight; - } else { - target.barycenter = other.barycenter; - target.weight = other.weight; - } -} - -},{"../lodash":62,"./barycenter":66,"./resolve-conflicts":71,"./sort":73}],73:[function(require,module,exports){ -var _ = require("../lodash"), - util = require("../util"); - -module.exports = sort; - -function sort(entries, biasRight) { - var parts = util.partition(entries, function(entry) { - return _.has(entry, "barycenter"); - }); - var sortable = parts.lhs, - unsortable = _.sortBy(parts.rhs, function(entry) { return -entry.i; }), - vs = [], - sum = 0, - weight = 0, - vsIndex = 0; - - sortable.sort(compareWithBias(!!biasRight)); - - vsIndex = consumeUnsortable(vs, unsortable, vsIndex); - - _.each(sortable, function (entry) { - vsIndex += entry.vs.length; - vs.push(entry.vs); - sum += entry.barycenter * entry.weight; - weight += entry.weight; - vsIndex = consumeUnsortable(vs, unsortable, vsIndex); - }); - - var result = { vs: _.flatten(vs, true) }; - if (weight) { - result.barycenter = sum / weight; - result.weight = weight; - } - return result; -} - -function consumeUnsortable(vs, unsortable, index) { - var last; - while (unsortable.length && (last = _.last(unsortable)).i <= index) { - unsortable.pop(); - vs.push(last.vs); - index++; - } - return index; -} - -function compareWithBias(bias) { - return function(entryV, entryW) { - if (entryV.barycenter < entryW.barycenter) { - return -1; - } else if (entryV.barycenter > entryW.barycenter) { - return 1; - } - - return !bias ? entryV.i - entryW.i : entryW.i - entryV.i; - }; -} - -},{"../lodash":62,"../util":81}],74:[function(require,module,exports){ -var _ = require("./lodash"); - -module.exports = parentDummyChains; - -function parentDummyChains(g) { - var postorderNums = postorder(g); - - _.each(g.graph().dummyChains, function(v) { - var node = g.node(v), - edgeObj = node.edgeObj, - pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w), - path = pathData.path, - lca = pathData.lca, - pathIdx = 0, - pathV = path[pathIdx], - ascending = true; - - while (v !== edgeObj.w) { - node = g.node(v); - - if (ascending) { - while ((pathV = path[pathIdx]) !== lca && - g.node(pathV).maxRank < node.rank) { - pathIdx++; - } - - if (pathV === lca) { - ascending = false; - } - } - - if (!ascending) { - while (pathIdx < path.length - 1 && - g.node(pathV = path[pathIdx + 1]).minRank <= node.rank) { - pathIdx++; - } - pathV = path[pathIdx]; - } - - g.setParent(v, pathV); - v = g.successors(v)[0]; - } - }); -} - -// Find a path from v to w through the lowest common ancestor (LCA). Return the -// full path and the LCA. -function findPath(g, postorderNums, v, w) { - var vPath = [], - wPath = [], - low = Math.min(postorderNums[v].low, postorderNums[w].low), - lim = Math.max(postorderNums[v].lim, postorderNums[w].lim), - parent, - lca; - - // Traverse up from v to find the LCA - parent = v; - do { - parent = g.parent(parent); - vPath.push(parent); - } while (parent && - (postorderNums[parent].low > low || lim > postorderNums[parent].lim)); - lca = parent; - - // Traverse from w to LCA - parent = w; - while ((parent = g.parent(parent)) !== lca) { - wPath.push(parent); - } - - return { path: vPath.concat(wPath.reverse()), lca: lca }; -} - -function postorder(g) { - var result = {}, - lim = 0; - - function dfs(v) { - var low = lim; - _.each(g.children(v), dfs); - result[v] = { low: low, lim: lim++ }; - } - _.each(g.children(), dfs); - - return result; -} - -},{"./lodash":62}],75:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - Graph = require("../graphlib").Graph, - util = require("../util"); - -/* - * This module provides coordinate assignment based on Brandes and Köpf, "Fast - * and Simple Horizontal Coordinate Assignment." - */ - -module.exports = { - positionX: positionX, - findType1Conflicts: findType1Conflicts, - findType2Conflicts: findType2Conflicts, - addConflict: addConflict, - hasConflict: hasConflict, - verticalAlignment: verticalAlignment, - horizontalCompaction: horizontalCompaction, - alignCoordinates: alignCoordinates, - findSmallestWidthAlignment: findSmallestWidthAlignment, - balance: balance -}; - -/* - * Marks all edges in the graph with a type-1 conflict with the "type1Conflict" - * property. A type-1 conflict is one where a non-inner segment crosses an - * inner segment. An inner segment is an edge with both incident nodes marked - * with the "dummy" property. - * - * This algorithm scans layer by layer, starting with the second, for type-1 - * conflicts between the current layer and the previous layer. For each layer - * it scans the nodes from left to right until it reaches one that is incident - * on an inner segment. It then scans predecessors to determine if they have - * edges that cross that inner segment. At the end a final scan is done for all - * nodes on the current rank to see if they cross the last visited inner - * segment. - * - * This algorithm (safely) assumes that a dummy node will only be incident on a - * single node in the layers being scanned. - */ -function findType1Conflicts(g, layering) { - var conflicts = {}; - - function visitLayer(prevLayer, layer) { - var - // last visited node in the previous layer that is incident on an inner - // segment. - k0 = 0, - // Tracks the last node in this layer scanned for crossings with a type-1 - // segment. - scanPos = 0, - prevLayerLength = prevLayer.length, - lastNode = _.last(layer); - - _.each(layer, function(v, i) { - var w = findOtherInnerSegmentNode(g, v), - k1 = w ? g.node(w).order : prevLayerLength; - - if (w || v === lastNode) { - _.each(layer.slice(scanPos, i +1), function(scanNode) { - _.each(g.predecessors(scanNode), function(u) { - var uLabel = g.node(u), - uPos = uLabel.order; - if ((uPos < k0 || k1 < uPos) && - !(uLabel.dummy && g.node(scanNode).dummy)) { - addConflict(conflicts, u, scanNode); - } - }); - }); - scanPos = i + 1; - k0 = k1; - } - }); - - return layer; - } - - _.reduce(layering, visitLayer); - return conflicts; -} - -function findType2Conflicts(g, layering) { - var conflicts = {}; - - function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) { - var v; - _.each(_.range(southPos, southEnd), function(i) { - v = south[i]; - if (g.node(v).dummy) { - _.each(g.predecessors(v), function(u) { - var uNode = g.node(u); - if (uNode.dummy && - (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) { - addConflict(conflicts, u, v); - } - }); - } - }); - } - - - function visitLayer(north, south) { - var prevNorthPos = -1, - nextNorthPos, - southPos = 0; - - _.each(south, function(v, southLookahead) { - if (g.node(v).dummy === "border") { - var predecessors = g.predecessors(v); - if (predecessors.length) { - nextNorthPos = g.node(predecessors[0]).order; - scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos); - southPos = southLookahead; - prevNorthPos = nextNorthPos; - } - } - scan(south, southPos, south.length, nextNorthPos, north.length); - }); - - return south; - } - - _.reduce(layering, visitLayer); - return conflicts; -} - -function findOtherInnerSegmentNode(g, v) { - if (g.node(v).dummy) { - return _.find(g.predecessors(v), function(u) { - return g.node(u).dummy; - }); - } -} - -function addConflict(conflicts, v, w) { - if (v > w) { - var tmp = v; - v = w; - w = tmp; - } - - var conflictsV = conflicts[v]; - if (!conflictsV) { - conflicts[v] = conflictsV = {}; - } - conflictsV[w] = true; -} - -function hasConflict(conflicts, v, w) { - if (v > w) { - var tmp = v; - v = w; - w = tmp; - } - return _.has(conflicts[v], w); -} - -/* - * Try to align nodes into vertical "blocks" where possible. This algorithm - * attempts to align a node with one of its median neighbors. If the edge - * connecting a neighbor is a type-1 conflict then we ignore that possibility. - * If a previous node has already formed a block with a node after the node - * we're trying to form a block with, we also ignore that possibility - our - * blocks would be split in that scenario. - */ -function verticalAlignment(g, layering, conflicts, neighborFn) { - var root = {}, - align = {}, - pos = {}; - - // We cache the position here based on the layering because the graph and - // layering may be out of sync. The layering matrix is manipulated to - // generate different extreme alignments. - _.each(layering, function(layer) { - _.each(layer, function(v, order) { - root[v] = v; - align[v] = v; - pos[v] = order; - }); - }); - - _.each(layering, function(layer) { - var prevIdx = -1; - _.each(layer, function(v) { - var ws = neighborFn(v); - if (ws.length) { - ws = _.sortBy(ws, function(w) { return pos[w]; }); - var mp = (ws.length - 1) / 2; - for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) { - var w = ws[i]; - if (align[v] === v && - prevIdx < pos[w] && - !hasConflict(conflicts, v, w)) { - align[w] = v; - align[v] = root[v] = root[w]; - prevIdx = pos[w]; - } - } - } - }); - }); - - return { root: root, align: align }; -} - -function horizontalCompaction(g, layering, root, align, reverseSep) { - // This portion of the algorithm differs from BK due to a number of problems. - // Instead of their algorithm we construct a new block graph and do two - // sweeps. The first sweep places blocks with the smallest possible - // coordinates. The second sweep removes unused space by moving blocks to the - // greatest coordinates without violating separation. - var xs = {}, - blockG = buildBlockGraph(g, layering, root, reverseSep); - - // First pass, assign smallest coordinates via DFS - var visited = {}; - function pass1(v) { - if (!_.has(visited, v)) { - visited[v] = true; - xs[v] = _.reduce(blockG.inEdges(v), function(max, e) { - pass1(e.v); - return Math.max(max, xs[e.v] + blockG.edge(e)); - }, 0); - } - } - _.each(blockG.nodes(), pass1); - - var borderType = reverseSep ? "borderLeft" : "borderRight"; - function pass2(v) { - if (visited[v] !== 2) { - visited[v]++; - var node = g.node(v); - var min = _.reduce(blockG.outEdges(v), function(min, e) { - pass2(e.w); - return Math.min(min, xs[e.w] - blockG.edge(e)); - }, Number.POSITIVE_INFINITY); - if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) { - xs[v] = Math.max(xs[v], min); - } - } - } - _.each(blockG.nodes(), pass2); - - // Assign x coordinates to all nodes - _.each(align, function(v) { - xs[v] = xs[root[v]]; - }); - - return xs; -} - - -function buildBlockGraph(g, layering, root, reverseSep) { - var blockGraph = new Graph(), - graphLabel = g.graph(), - sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep); - - _.each(layering, function(layer) { - var u; - _.each(layer, function(v) { - var vRoot = root[v]; - blockGraph.setNode(vRoot); - if (u) { - var uRoot = root[u], - prevMax = blockGraph.edge(uRoot, vRoot); - blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0)); - } - u = v; - }); - }); - - return blockGraph; -} - -/* - * Returns the alignment that has the smallest width of the given alignments. - */ -function findSmallestWidthAlignment(g, xss) { - return _.min(xss, function(xs) { - var min = _.min(xs, function(x, v) { return x - width(g, v) / 2; }), - max = _.max(xs, function(x, v) { return x + width(g, v) / 2; }); - return max - min; - }); -} - -/* - * Align the coordinates of each of the layout alignments such that - * left-biased alignments have their minimum coordinate at the same point as - * the minimum coordinate of the smallest width alignment and right-biased - * alignments have their maximum coordinate at the same point as the maximum - * coordinate of the smallest width alignment. - */ -function alignCoordinates(xss, alignTo) { - var alignToMin = _.min(alignTo), - alignToMax = _.max(alignTo); - - _.each(["u", "d"], function(vert) { - _.each(["l", "r"], function(horiz) { - var alignment = vert + horiz, - xs = xss[alignment], - delta; - if (xs === alignTo) return; - - delta = horiz === "l" ? alignToMin - _.min(xs) : alignToMax - _.max(xs); - - if (delta) { - xss[alignment] = _.mapValues(xs, function(x) { return x + delta; }); - } - }); - }); -} - -function balance(xss, align) { - return _.mapValues(xss.ul, function(ignore, v) { - if (align) { - return xss[align.toLowerCase()][v]; - } else { - var xs = _.sortBy(_.pluck(xss, v)); - return (xs[1] + xs[2]) / 2; - } - }); -} - -function positionX(g) { - var layering = util.buildLayerMatrix(g), - conflicts = _.merge(findType1Conflicts(g, layering), - findType2Conflicts(g, layering)); - - var xss = {}, - adjustedLayering; - _.each(["u", "d"], function(vert) { - adjustedLayering = vert === "u" ? layering : _.values(layering).reverse(); - _.each(["l", "r"], function(horiz) { - if (horiz === "r") { - adjustedLayering = _.map(adjustedLayering, function(inner) { - return _.values(inner).reverse(); - }); - } - - var neighborFn = _.bind(vert === "u" ? g.predecessors : g.successors, g); - var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn); - var xs = horizontalCompaction(g, adjustedLayering, - align.root, align.align, - horiz === "r"); - if (horiz === "r") { - xs = _.mapValues(xs, function(x) { return -x; }); - } - xss[vert + horiz] = xs; - }); - }); - - var smallestWidth = findSmallestWidthAlignment(g, xss); - alignCoordinates(xss, smallestWidth); - return balance(xss, g.graph().align); -} - -function sep(nodeSep, edgeSep, reverseSep) { - return function(g, v, w) { - var vLabel = g.node(v), - wLabel = g.node(w), - sum = 0, - delta; - - sum += vLabel.width / 2; - if (_.has(vLabel, "labelpos")) { - switch (vLabel.labelpos.toLowerCase()) { - case "l": delta = -vLabel.width / 2; break; - case "r": delta = vLabel.width / 2; break; - } - } - if (delta) { - sum += reverseSep ? delta : -delta; - } - delta = 0; - - sum += (vLabel.dummy ? edgeSep : nodeSep) / 2; - sum += (wLabel.dummy ? edgeSep : nodeSep) / 2; - - sum += wLabel.width / 2; - if (_.has(wLabel, "labelpos")) { - switch (wLabel.labelpos.toLowerCase()) { - case "l": delta = wLabel.width / 2; break; - case "r": delta = -wLabel.width / 2; break; - } - } - if (delta) { - sum += reverseSep ? delta : -delta; - } - delta = 0; - - return sum; - }; -} - -function width(g, v) { - return g.node(v).width; -} - -},{"../graphlib":59,"../lodash":62,"../util":81}],76:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - util = require("../util"), - positionX = require("./bk").positionX; - -module.exports = position; - -function position(g) { - g = util.asNonCompoundGraph(g); - - positionY(g); - _.each(positionX(g), function(x, v) { - g.node(v).x = x; - }); -} - -function positionY(g) { - var layering = util.buildLayerMatrix(g), - rankSep = g.graph().ranksep, - prevY = 0; - _.each(layering, function(layer) { - var maxHeight = _.max(_.map(layer, function(v) { return g.node(v).height; })); - _.each(layer, function(v) { - g.node(v).y = prevY + maxHeight / 2; - }); - prevY += maxHeight + rankSep; - }); -} - - -},{"../lodash":62,"../util":81,"./bk":75}],77:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - Graph = require("../graphlib").Graph, - slack = require("./util").slack; - -module.exports = feasibleTree; - -/* - * Constructs a spanning tree with tight edges and adjusted the input node's - * ranks to achieve this. A tight edge is one that is has a length that matches - * its "minlen" attribute. - * - * The basic structure for this function is derived from Gansner, et al., "A - * Technique for Drawing Directed Graphs." - * - * Pre-conditions: - * - * 1. Graph must be a DAG. - * 2. Graph must be connected. - * 3. Graph must have at least one node. - * 5. Graph nodes must have been previously assigned a "rank" property that - * respects the "minlen" property of incident edges. - * 6. Graph edges must have a "minlen" property. - * - * Post-conditions: - * - * - Graph nodes will have their rank adjusted to ensure that all edges are - * tight. - * - * Returns a tree (undirected graph) that is constructed using only "tight" - * edges. - */ -function feasibleTree(g) { - var t = new Graph({ directed: false }); - - // Choose arbitrary node from which to start our tree - var start = g.nodes()[0], - size = g.nodeCount(); - t.setNode(start, {}); - - var edge, delta; - while (tightTree(t, g) < size) { - edge = findMinSlackEdge(t, g); - delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge); - shiftRanks(t, g, delta); - } - - return t; -} - -/* - * Finds a maximal tree of tight edges and returns the number of nodes in the - * tree. - */ -function tightTree(t, g) { - function dfs(v) { - _.each(g.nodeEdges(v), function(e) { - var edgeV = e.v, - w = (v === edgeV) ? e.w : edgeV; - if (!t.hasNode(w) && !slack(g, e)) { - t.setNode(w, {}); - t.setEdge(v, w, {}); - dfs(w); - } - }); - } - - _.each(t.nodes(), dfs); - return t.nodeCount(); -} - -/* - * Finds the edge with the smallest slack that is incident on tree and returns - * it. - */ -function findMinSlackEdge(t, g) { - return _.min(g.edges(), function(e) { - if (t.hasNode(e.v) !== t.hasNode(e.w)) { - return slack(g, e); - } - }); -} - -function shiftRanks(t, g, delta) { - _.each(t.nodes(), function(v) { - g.node(v).rank += delta; - }); -} - -},{"../graphlib":59,"../lodash":62,"./util":80}],78:[function(require,module,exports){ -"use strict"; - -var rankUtil = require("./util"), - longestPath = rankUtil.longestPath, - feasibleTree = require("./feasible-tree"), - networkSimplex = require("./network-simplex"); - -module.exports = rank; - -/* - * Assigns a rank to each node in the input graph that respects the "minlen" - * constraint specified on edges between nodes. - * - * This basic structure is derived from Gansner, et al., "A Technique for - * Drawing Directed Graphs." - * - * Pre-conditions: - * - * 1. Graph must be a connected DAG - * 2. Graph nodes must be objects - * 3. Graph edges must have "weight" and "minlen" attributes - * - * Post-conditions: - * - * 1. Graph nodes will have a "rank" attribute based on the results of the - * algorithm. Ranks can start at any index (including negative), we'll - * fix them up later. - */ -function rank(g) { - switch(g.graph().ranker) { - case "network-simplex": networkSimplexRanker(g); break; - case "tight-tree": tightTreeRanker(g); break; - case "longest-path": longestPathRanker(g); break; - default: networkSimplexRanker(g); - } -} - -// A fast and simple ranker, but results are far from optimal. -var longestPathRanker = longestPath; - -function tightTreeRanker(g) { - longestPath(g); - feasibleTree(g); -} - -function networkSimplexRanker(g) { - networkSimplex(g); -} - -},{"./feasible-tree":77,"./network-simplex":79,"./util":80}],79:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"), - feasibleTree = require("./feasible-tree"), - slack = require("./util").slack, - initRank = require("./util").longestPath, - preorder = require("../graphlib").alg.preorder, - postorder = require("../graphlib").alg.postorder, - simplify = require("../util").simplify; - -module.exports = networkSimplex; - -// Expose some internals for testing purposes -networkSimplex.initLowLimValues = initLowLimValues; -networkSimplex.initCutValues = initCutValues; -networkSimplex.calcCutValue = calcCutValue; -networkSimplex.leaveEdge = leaveEdge; -networkSimplex.enterEdge = enterEdge; -networkSimplex.exchangeEdges = exchangeEdges; - -/* - * The network simplex algorithm assigns ranks to each node in the input graph - * and iteratively improves the ranking to reduce the length of edges. - * - * Preconditions: - * - * 1. The input graph must be a DAG. - * 2. All nodes in the graph must have an object value. - * 3. All edges in the graph must have "minlen" and "weight" attributes. - * - * Postconditions: - * - * 1. All nodes in the graph will have an assigned "rank" attribute that has - * been optimized by the network simplex algorithm. Ranks start at 0. - * - * - * A rough sketch of the algorithm is as follows: - * - * 1. Assign initial ranks to each node. We use the longest path algorithm, - * which assigns ranks to the lowest position possible. In general this - * leads to very wide bottom ranks and unnecessarily long edges. - * 2. Construct a feasible tight tree. A tight tree is one such that all - * edges in the tree have no slack (difference between length of edge - * and minlen for the edge). This by itself greatly improves the assigned - * rankings by shorting edges. - * 3. Iteratively find edges that have negative cut values. Generally a - * negative cut value indicates that the edge could be removed and a new - * tree edge could be added to produce a more compact graph. - * - * Much of the algorithms here are derived from Gansner, et al., "A Technique - * for Drawing Directed Graphs." The structure of the file roughly follows the - * structure of the overall algorithm. - */ -function networkSimplex(g) { - g = simplify(g); - initRank(g); - var t = feasibleTree(g); - initLowLimValues(t); - initCutValues(t, g); - - var e, f; - while ((e = leaveEdge(t))) { - f = enterEdge(t, g, e); - exchangeEdges(t, g, e, f); - } -} - -/* - * Initializes cut values for all edges in the tree. - */ -function initCutValues(t, g) { - var vs = postorder(t, t.nodes()); - vs = vs.slice(0, vs.length - 1); - _.each(vs, function(v) { - assignCutValue(t, g, v); - }); -} - -function assignCutValue(t, g, child) { - var childLab = t.node(child), - parent = childLab.parent; - t.edge(child, parent).cutvalue = calcCutValue(t, g, child); -} - -/* - * Given the tight tree, its graph, and a child in the graph calculate and - * return the cut value for the edge between the child and its parent. - */ -function calcCutValue(t, g, child) { - var childLab = t.node(child), - parent = childLab.parent, - // True if the child is on the tail end of the edge in the directed graph - childIsTail = true, - // The graph's view of the tree edge we're inspecting - graphEdge = g.edge(child, parent), - // The accumulated cut value for the edge between this node and its parent - cutValue = 0; - - if (!graphEdge) { - childIsTail = false; - graphEdge = g.edge(parent, child); - } - - cutValue = graphEdge.weight; - - _.each(g.nodeEdges(child), function(e) { - var isOutEdge = e.v === child, - other = isOutEdge ? e.w : e.v; - - if (other !== parent) { - var pointsToHead = isOutEdge === childIsTail, - otherWeight = g.edge(e).weight; - - cutValue += pointsToHead ? otherWeight : -otherWeight; - if (isTreeEdge(t, child, other)) { - var otherCutValue = t.edge(child, other).cutvalue; - cutValue += pointsToHead ? -otherCutValue : otherCutValue; - } - } - }); - - return cutValue; -} - -function initLowLimValues(tree, root) { - if (arguments.length < 2) { - root = tree.nodes()[0]; - } - dfsAssignLowLim(tree, {}, 1, root); -} - -function dfsAssignLowLim(tree, visited, nextLim, v, parent) { - var low = nextLim, - label = tree.node(v); - - visited[v] = true; - _.each(tree.neighbors(v), function(w) { - if (!_.has(visited, w)) { - nextLim = dfsAssignLowLim(tree, visited, nextLim, w, v); - } - }); - - label.low = low; - label.lim = nextLim++; - if (parent) { - label.parent = parent; - } else { - // TODO should be able to remove this when we incrementally update low lim - delete label.parent; - } - - return nextLim; -} - -function leaveEdge(tree) { - return _.find(tree.edges(), function(e) { - return tree.edge(e).cutvalue < 0; - }); -} - -function enterEdge(t, g, edge) { - var v = edge.v, - w = edge.w; - - // For the rest of this function we assume that v is the tail and w is the - // head, so if we don't have this edge in the graph we should flip it to - // match the correct orientation. - if (!g.hasEdge(v, w)) { - v = edge.w; - w = edge.v; - } - - var vLabel = t.node(v), - wLabel = t.node(w), - tailLabel = vLabel, - flip = false; - - // If the root is in the tail of the edge then we need to flip the logic that - // checks for the head and tail nodes in the candidates function below. - if (vLabel.lim > wLabel.lim) { - tailLabel = wLabel; - flip = true; - } - - var candidates = _.filter(g.edges(), function(edge) { - return flip === isDescendant(t, t.node(edge.v), tailLabel) && - flip !== isDescendant(t, t.node(edge.w), tailLabel); - }); - - return _.min(candidates, function(edge) { return slack(g, edge); }); -} - -function exchangeEdges(t, g, e, f) { - var v = e.v, - w = e.w; - t.removeEdge(v, w); - t.setEdge(f.v, f.w, {}); - initLowLimValues(t); - initCutValues(t, g); - updateRanks(t, g); -} - -function updateRanks(t, g) { - var root = _.find(t.nodes(), function(v) { return !g.node(v).parent; }), - vs = preorder(t, root); - vs = vs.slice(1); - _.each(vs, function(v) { - var parent = t.node(v).parent, - edge = g.edge(v, parent), - flipped = false; - - if (!edge) { - edge = g.edge(parent, v); - flipped = true; - } - - g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen); - }); -} - -/* - * Returns true if the edge is in the tree. - */ -function isTreeEdge(tree, u, v) { - return tree.hasEdge(u, v); -} - -/* - * Returns true if the specified node is descendant of the root node per the - * assigned low and lim attributes in the tree. - */ -function isDescendant(tree, vLabel, rootLabel) { - return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim; -} - -},{"../graphlib":59,"../lodash":62,"../util":81,"./feasible-tree":77,"./util":80}],80:[function(require,module,exports){ -"use strict"; - -var _ = require("../lodash"); - -module.exports = { - longestPath: longestPath, - slack: slack -}; - -/* - * Initializes ranks for the input graph using the longest path algorithm. This - * algorithm scales well and is fast in practice, it yields rather poor - * solutions. Nodes are pushed to the lowest layer possible, leaving the bottom - * ranks wide and leaving edges longer than necessary. However, due to its - * speed, this algorithm is good for getting an initial ranking that can be fed - * into other algorithms. - * - * This algorithm does not normalize layers because it will be used by other - * algorithms in most cases. If using this algorithm directly, be sure to - * run normalize at the end. - * - * Pre-conditions: - * - * 1. Input graph is a DAG. - * 2. Input graph node labels can be assigned properties. - * - * Post-conditions: - * - * 1. Each node will be assign an (unnormalized) "rank" property. - */ -function longestPath(g) { - var visited = {}; - - function dfs(v) { - var label = g.node(v); - if (_.has(visited, v)) { - return label.rank; - } - visited[v] = true; - - var rank = _.min(_.map(g.outEdges(v), function(e) { - return dfs(e.w) - g.edge(e).minlen; - })); - - if (rank === Number.POSITIVE_INFINITY) { - rank = 0; - } - - return (label.rank = rank); - } - - _.each(g.sources(), dfs); -} - -/* - * Returns the amount of slack for the given edge. The slack is defined as the - * difference between the length of the edge and its minimum length. - */ -function slack(g, e) { - return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen; -} - -},{"../lodash":62}],81:[function(require,module,exports){ -"use strict"; - -var _ = require("./lodash"), - Graph = require("./graphlib").Graph; - -module.exports = { - addDummyNode: addDummyNode, - simplify: simplify, - asNonCompoundGraph: asNonCompoundGraph, - successorWeights: successorWeights, - predecessorWeights: predecessorWeights, - intersectRect: intersectRect, - buildLayerMatrix: buildLayerMatrix, - normalizeRanks: normalizeRanks, - removeEmptyRanks: removeEmptyRanks, - addBorderNode: addBorderNode, - maxRank: maxRank, - partition: partition, - time: time, - notime: notime -}; - -/* - * Adds a dummy node to the graph and return v. - */ -function addDummyNode(g, type, attrs, name) { - var v; - do { - v = _.uniqueId(name); - } while (g.hasNode(v)); - - attrs.dummy = type; - g.setNode(v, attrs); - return v; -} - -/* - * Returns a new graph with only simple edges. Handles aggregation of data - * associated with multi-edges. - */ -function simplify(g) { - var simplified = new Graph().setGraph(g.graph()); - _.each(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); }); - _.each(g.edges(), function(e) { - var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 }, - label = g.edge(e); - simplified.setEdge(e.v, e.w, { - weight: simpleLabel.weight + label.weight, - minlen: Math.max(simpleLabel.minlen, label.minlen) - }); - }); - return simplified; -} - -function asNonCompoundGraph(g) { - var simplified = new Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph()); - _.each(g.nodes(), function(v) { - if (!g.children(v).length) { - simplified.setNode(v, g.node(v)); - } - }); - _.each(g.edges(), function(e) { - simplified.setEdge(e, g.edge(e)); - }); - return simplified; -} - -function successorWeights(g) { - var weightMap = _.map(g.nodes(), function(v) { - var sucs = {}; - _.each(g.outEdges(v), function(e) { - sucs[e.w] = (sucs[e.w] || 0) + g.edge(e).weight; - }); - return sucs; - }); - return _.zipObject(g.nodes(), weightMap); -} - -function predecessorWeights(g) { - var weightMap = _.map(g.nodes(), function(v) { - var preds = {}; - _.each(g.inEdges(v), function(e) { - preds[e.v] = (preds[e.v] || 0) + g.edge(e).weight; - }); - return preds; - }); - return _.zipObject(g.nodes(), weightMap); -} - -/* - * Finds where a line starting at point ({x, y}) would intersect a rectangle - * ({x, y, width, height}) if it were pointing at the rectangle's center. - */ -function intersectRect(rect, point) { - var x = rect.x; - var y = rect.y; - - // Rectangle intersection algorithm from: - // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes - var dx = point.x - x; - var dy = point.y - y; - var w = rect.width / 2; - var h = rect.height / 2; - - if (!dx && !dy) { - throw new Error("Not possible to find intersection inside of the rectangle"); - } - - var sx, sy; - if (Math.abs(dy) * w > Math.abs(dx) * h) { - // Intersection is top or bottom of rect. - if (dy < 0) { - h = -h; - } - sx = h * dx / dy; - sy = h; - } else { - // Intersection is left or right of rect. - if (dx < 0) { - w = -w; - } - sx = w; - sy = w * dy / dx; - } - - return { x: x + sx, y: y + sy }; -} - -/* - * Given a DAG with each node assigned "rank" and "order" properties, this - * function will produce a matrix with the ids of each node. - */ -function buildLayerMatrix(g) { - var layering = _.map(_.range(maxRank(g) + 1), function() { return []; }); - _.each(g.nodes(), function(v) { - var node = g.node(v), - rank = node.rank; - if (!_.isUndefined(rank)) { - layering[rank][node.order] = v; - } - }); - return layering; -} - -/* - * Adjusts the ranks for all nodes in the graph such that all nodes v have - * rank(v) >= 0 and at least one node w has rank(w) = 0. - */ -function normalizeRanks(g) { - var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); - _.each(g.nodes(), function(v) { - var node = g.node(v); - if (_.has(node, "rank")) { - node.rank -= min; - } - }); -} - -function removeEmptyRanks(g) { - // Ranks may not start at 0, so we need to offset them - var offset = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); - - var layers = []; - _.each(g.nodes(), function(v) { - var rank = g.node(v).rank - offset; - if (!layers[rank]) { - layers[rank] = []; - } - layers[rank].push(v); - }); - - var delta = 0, - nodeRankFactor = g.graph().nodeRankFactor; - _.each(layers, function(vs, i) { - if (_.isUndefined(vs) && i % nodeRankFactor !== 0) { - --delta; - } else if (delta) { - _.each(vs, function(v) { g.node(v).rank += delta; }); - } - }); -} - -function addBorderNode(g, prefix, rank, order) { - var node = { - width: 0, - height: 0 - }; - if (arguments.length >= 4) { - node.rank = rank; - node.order = order; - } - return addDummyNode(g, "border", node, prefix); -} - -function maxRank(g) { - return _.max(_.map(g.nodes(), function(v) { - var rank = g.node(v).rank; - if (!_.isUndefined(rank)) { - return rank; - } - })); -} - -/* - * Partition a collection into two groups: `lhs` and `rhs`. If the supplied - * function returns true for an entry it goes into `lhs`. Otherwise it goes - * into `rhs. - */ -function partition(collection, fn) { - var result = { lhs: [], rhs: [] }; - _.each(collection, function(value) { - if (fn(value)) { - result.lhs.push(value); - } else { - result.rhs.push(value); - } - }); - return result; -} - -/* - * Returns a new function that wraps `fn` with a timer. The wrapper logs the - * time it takes to execute the function. - */ -function time(name, fn) { - var start = _.now(); - try { - return fn(); - } finally { - console.log(name + " time: " + (_.now() - start) + "ms"); - } -} - -function notime(name, fn) { - return fn(); -} - -},{"./graphlib":59,"./lodash":62}],82:[function(require,module,exports){ -module.exports = "0.7.4"; - -},{}],83:[function(require,module,exports){ -module.exports=require(32) -},{"./lib":99,"./lib/alg":90,"./lib/json":100,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\index.js":32}],84:[function(require,module,exports){ -module.exports=require(33) -},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\components.js":33}],85:[function(require,module,exports){ -module.exports=require(34) -},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dfs.js":34}],86:[function(require,module,exports){ -module.exports=require(35) -},{"../lodash":101,"./dijkstra":87,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dijkstra-all.js":35}],87:[function(require,module,exports){ -module.exports=require(36) -},{"../data/priority-queue":97,"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dijkstra.js":36}],88:[function(require,module,exports){ -module.exports=require(37) -},{"../lodash":101,"./tarjan":95,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\find-cycles.js":37}],89:[function(require,module,exports){ -module.exports=require(38) -},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\floyd-warshall.js":38}],90:[function(require,module,exports){ -module.exports=require(39) -},{"./components":84,"./dijkstra":87,"./dijkstra-all":86,"./find-cycles":88,"./floyd-warshall":89,"./is-acyclic":91,"./postorder":92,"./preorder":93,"./prim":94,"./tarjan":95,"./topsort":96,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\index.js":39}],91:[function(require,module,exports){ -module.exports=require(40) -},{"./topsort":96,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\is-acyclic.js":40}],92:[function(require,module,exports){ -module.exports=require(41) -},{"./dfs":85,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\postorder.js":41}],93:[function(require,module,exports){ -module.exports=require(42) -},{"./dfs":85,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\preorder.js":42}],94:[function(require,module,exports){ -module.exports=require(43) -},{"../data/priority-queue":97,"../graph":98,"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\prim.js":43}],95:[function(require,module,exports){ -module.exports=require(44) -},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\tarjan.js":44}],96:[function(require,module,exports){ -module.exports=require(45) -},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\topsort.js":45}],97:[function(require,module,exports){ -module.exports=require(46) -},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\data\\priority-queue.js":46}],98:[function(require,module,exports){ -module.exports=require(47) -},{"./lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\graph.js":47}],99:[function(require,module,exports){ -module.exports=require(48) -},{"./graph":98,"./version":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\index.js":48}],100:[function(require,module,exports){ -module.exports=require(49) -},{"./graph":98,"./lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\json.js":49}],101:[function(require,module,exports){ -module.exports=require(50) -},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\lodash.js":50,"lodash":103}],102:[function(require,module,exports){ -module.exports=require(51) -},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\version.js":51}],103:[function(require,module,exports){ -module.exports=require(52) -},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\lodash\\index.js":52}],104:[function(require,module,exports){ +},{}],81:[function(require,module,exports){ //! moment.js -//! version : 2.10.6 +//! version : 2.12.0 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com -(function (global, factory) { +;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory() @@ -18007,7 +17649,7 @@ module.exports=require(52) } function isArray(input) { - return Object.prototype.toString.call(input) === '[object Array]'; + return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; } function isDate(input) { @@ -18105,39 +17747,45 @@ module.exports=require(52) return m; } + function isUndefined(input) { + return input === void 0; + } + + // Plugins that add properties should also add the key here (null value), + // so we can properly clone ourselves. var momentProperties = utils_hooks__hooks.momentProperties = []; function copyConfig(to, from) { var i, prop, val; - if (typeof from._isAMomentObject !== 'undefined') { + if (!isUndefined(from._isAMomentObject)) { to._isAMomentObject = from._isAMomentObject; } - if (typeof from._i !== 'undefined') { + if (!isUndefined(from._i)) { to._i = from._i; } - if (typeof from._f !== 'undefined') { + if (!isUndefined(from._f)) { to._f = from._f; } - if (typeof from._l !== 'undefined') { + if (!isUndefined(from._l)) { to._l = from._l; } - if (typeof from._strict !== 'undefined') { + if (!isUndefined(from._strict)) { to._strict = from._strict; } - if (typeof from._tzm !== 'undefined') { + if (!isUndefined(from._tzm)) { to._tzm = from._tzm; } - if (typeof from._isUTC !== 'undefined') { + if (!isUndefined(from._isUTC)) { to._isUTC = from._isUTC; } - if (typeof from._offset !== 'undefined') { + if (!isUndefined(from._offset)) { to._offset = from._offset; } - if (typeof from._pf !== 'undefined') { + if (!isUndefined(from._pf)) { to._pf = getParsingFlags(from); } - if (typeof from._locale !== 'undefined') { + if (!isUndefined(from._locale)) { to._locale = from._locale; } @@ -18145,7 +17793,7 @@ module.exports=require(52) for (i in momentProperties) { prop = momentProperties[i]; val = from[prop]; - if (typeof val !== 'undefined') { + if (!isUndefined(val)) { to[prop] = val; } } @@ -18192,6 +17840,7 @@ module.exports=require(52) return value; } + // compare two arrays, return the number of differences function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), @@ -18206,9 +17855,85 @@ module.exports=require(52) return diffs + lengthDiff; } - function Locale() { + function warn(msg) { + if (utils_hooks__hooks.suppressDeprecationWarnings === false && + (typeof console !== 'undefined') && console.warn) { + console.warn('Deprecation warning: ' + msg); + } } + function deprecate(msg, fn) { + var firstTime = true; + + return extend(function () { + if (firstTime) { + warn(msg + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\n' + (new Error()).stack); + firstTime = false; + } + return fn.apply(this, arguments); + }, fn); + } + + var deprecations = {}; + + function deprecateSimple(name, msg) { + if (!deprecations[name]) { + warn(msg); + deprecations[name] = true; + } + } + + utils_hooks__hooks.suppressDeprecationWarnings = false; + + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + + function isObject(input) { + return Object.prototype.toString.call(input) === '[object Object]'; + } + + function locale_set__set (config) { + var prop, i; + for (i in config) { + prop = config[i]; + if (isFunction(prop)) { + this[i] = prop; + } else { + this['_' + i] = prop; + } + } + this._config = config; + // Lenient ordinal parsing accepts just a number in addition to + // number + (possibly) stuff coming from _ordinalParseLenient. + this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source); + } + + function mergeConfigs(parentConfig, childConfig) { + var res = extend({}, parentConfig), prop; + for (prop in childConfig) { + if (hasOwnProp(childConfig, prop)) { + if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { + res[prop] = {}; + extend(res[prop], parentConfig[prop]); + extend(res[prop], childConfig[prop]); + } else if (childConfig[prop] != null) { + res[prop] = childConfig[prop]; + } else { + delete res[prop]; + } + } + } + return res; + } + + function Locale(config) { + if (config != null) { + this.set(config); + } + } + + // internal storage for locale config files var locales = {}; var globalLocale; @@ -18246,7 +17971,7 @@ module.exports=require(52) function loadLocale(name) { var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node - if (!locales[name] && typeof module !== 'undefined' && + if (!locales[name] && (typeof module !== 'undefined') && module && module.exports) { try { oldLocale = globalLocale._abbr; @@ -18265,7 +17990,7 @@ module.exports=require(52) function locale_locales__getSetGlobalLocale (key, values) { var data; if (key) { - if (typeof values === 'undefined') { + if (isUndefined(values)) { data = locale_locales__getLocale(key); } else { @@ -18281,11 +18006,25 @@ module.exports=require(52) return globalLocale._abbr; } - function defineLocale (name, values) { - if (values !== null) { - values.abbr = name; - locales[name] = locales[name] || new Locale(); - locales[name].set(values); + function defineLocale (name, config) { + if (config !== null) { + config.abbr = name; + if (locales[name] != null) { + deprecateSimple('defineLocaleOverride', + 'use moment.updateLocale(localeName, config) to change ' + + 'an existing locale. moment.defineLocale(localeName, ' + + 'config) should only be used for creating a new locale'); + config = mergeConfigs(locales[name]._config, config); + } else if (config.parentLocale != null) { + if (locales[config.parentLocale] != null) { + config = mergeConfigs(locales[config.parentLocale]._config, config); + } else { + // treat as if there is no base config + deprecateSimple('parentLocaleUndefined', + 'specified parentLocale is not defined yet'); + } + } + locales[name] = new Locale(config); // backwards compat for now: also set the locale locale_locales__getSetGlobalLocale(name); @@ -18298,6 +18037,31 @@ module.exports=require(52) } } + function updateLocale(name, config) { + if (config != null) { + var locale; + if (locales[name] != null) { + config = mergeConfigs(locales[name]._config, config); + } + locale = new Locale(config); + locale.parentLocale = locales[name]; + locales[name] = locale; + + // backwards compat for now: also set the locale + locale_locales__getSetGlobalLocale(name); + } else { + // pass null for config to unupdate, useful for tests + if (locales[name] != null) { + if (locales[name].parentLocale != null) { + locales[name] = locales[name].parentLocale; + } else if (locales[name] != null) { + delete locales[name]; + } + } + } + return locales[name]; + } + // returns locale data function locale_locales__getLocale (key) { var locale; @@ -18322,6 +18086,10 @@ module.exports=require(52) return chooseLocale(key); } + function locale_locales__listLocales() { + return Object.keys(locales); + } + var aliases = {}; function addUnitAlias (unit, shorthand) { @@ -18363,11 +18131,14 @@ module.exports=require(52) } function get_set__get (mom, unit) { - return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit](); + return mom.isValid() ? + mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; } function get_set__set (mom, unit, value) { - return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + if (mom.isValid()) { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + } } // MOMENTS @@ -18380,7 +18151,7 @@ module.exports=require(52) } } else { units = normalizeUnits(units); - if (typeof this[units] === 'function') { + if (isFunction(this[units])) { return this[units](value); } } @@ -18395,7 +18166,7 @@ module.exports=require(52) Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; } - var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; + var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; @@ -18491,6 +18262,8 @@ module.exports=require(52) var match4 = /\d{4}/; // 0000 - 9999 var match6 = /[+-]?\d{6}/; // -999999 - 999999 var match1to2 = /\d\d?/; // 0 - 99 + var match3to4 = /\d\d\d\d?/; // 999 - 9999 + var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 var match1to3 = /\d{1,3}/; // 0 - 999 var match1to4 = /\d{1,4}/; // 0 - 9999 var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 @@ -18499,23 +18272,19 @@ module.exports=require(52) var matchSigned = /[+-]?\d+/; // -inf - inf var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z + var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. + // includes scottish gaelic two word and hyphenated months var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; + var regexes = {}; - function isFunction (sth) { - // https://github.com/moment/moment/issues/2325 - return typeof sth === 'function' && - Object.prototype.toString.call(sth) === '[object Function]'; - } - - function addRegexToken (token, regex, strictRegex) { - regexes[token] = isFunction(regex) ? regex : function (isStrict) { + regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { return (isStrict && strictRegex) ? strictRegex : regex; }; } @@ -18530,9 +18299,13 @@ module.exports=require(52) // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function unescapeFormat(s) { - return s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { + return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; - }).replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + })); + } + + function regexEscape(s) { + return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } var tokens = {}; @@ -18572,6 +18345,8 @@ module.exports=require(52) var MINUTE = 4; var SECOND = 5; var MILLISECOND = 6; + var WEEK = 7; + var WEEKDAY = 8; function daysInMonth(year, month) { return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); @@ -18599,8 +18374,12 @@ module.exports=require(52) addRegexToken('M', match1to2); addRegexToken('MM', match1to2, match2); - addRegexToken('MMM', matchWord); - addRegexToken('MMMM', matchWord); + addRegexToken('MMM', function (isStrict, locale) { + return locale.monthsShortRegex(isStrict); + }); + addRegexToken('MMMM', function (isStrict, locale) { + return locale.monthsRegex(isStrict); + }); addParseToken(['M', 'MM'], function (input, array) { array[MONTH] = toInt(input) - 1; @@ -18618,14 +18397,17 @@ module.exports=require(52) // LOCALES + var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/; var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); - function localeMonths (m) { - return this._months[m.month()]; + function localeMonths (m, format) { + return isArray(this._months) ? this._months[m.month()] : + this._months[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); - function localeMonthsShort (m) { - return this._monthsShort[m.month()]; + function localeMonthsShort (m, format) { + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : + this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } function localeMonthsParse (monthName, format, strict) { @@ -18664,12 +18446,20 @@ module.exports=require(52) function setMonth (mom, value) { var dayOfMonth; - // TODO: Move this out of here! + if (!mom.isValid()) { + // No op + return mom; + } + if (typeof value === 'string') { - value = mom.localeData().monthsParse(value); - // TODO: Another silent failure? - if (typeof value !== 'number') { - return mom; + if (/^\d+$/.test(value)) { + value = toInt(value); + } else { + value = mom.localeData().monthsParse(value); + // TODO: Another silent failure? + if (typeof value !== 'number') { + return mom; + } } } @@ -18692,6 +18482,72 @@ module.exports=require(52) return daysInMonth(this.year(), this.month()); } + var defaultMonthsShortRegex = matchWord; + function monthsShortRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsShortStrictRegex; + } else { + return this._monthsShortRegex; + } + } else { + return this._monthsShortStrictRegex && isStrict ? + this._monthsShortStrictRegex : this._monthsShortRegex; + } + } + + var defaultMonthsRegex = matchWord; + function monthsRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsStrictRegex; + } else { + return this._monthsRegex; + } + } else { + return this._monthsStrictRegex && isStrict ? + this._monthsStrictRegex : this._monthsRegex; + } + } + + function computeMonthsParse () { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var shortPieces = [], longPieces = [], mixedPieces = [], + i, mom; + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + mom = create_utc__createUTC([2000, i]); + shortPieces.push(this.monthsShort(mom, '')); + longPieces.push(this.months(mom, '')); + mixedPieces.push(this.months(mom, '')); + mixedPieces.push(this.monthsShort(mom, '')); + } + // Sorting makes sure if one month (or abbr) is a prefix of another it + // will match the longer piece. + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + for (i = 0; i < 12; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + + this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._monthsShortRegex = this._monthsRegex; + this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')$', 'i'); + this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')$', 'i'); + } + function checkOverflow (m) { var overflow; var a = m._a; @@ -18709,6 +18565,12 @@ module.exports=require(52) if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { overflow = DATE; } + if (getParsingFlags(m)._overflowWeeks && overflow === -1) { + overflow = WEEK; + } + if (getParsingFlags(m)._overflowWeekday && overflow === -1) { + overflow = WEEKDAY; + } getParsingFlags(m).overflow = overflow; } @@ -18716,51 +18578,39 @@ module.exports=require(52) return m; } - function warn(msg) { - if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { - console.warn('Deprecation warning: ' + msg); - } - } + // iso 8601 regex + // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) + var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; + var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; - function deprecate(msg, fn) { - var firstTime = true; - - return extend(function () { - if (firstTime) { - warn(msg + '\n' + (new Error()).stack); - firstTime = false; - } - return fn.apply(this, arguments); - }, fn); - } - - var deprecations = {}; - - function deprecateSimple(name, msg) { - if (!deprecations[name]) { - warn(msg); - deprecations[name] = true; - } - } - - utils_hooks__hooks.suppressDeprecationWarnings = false; - - var from_string__isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; + var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; var isoDates = [ - ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], - ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], - ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], - ['GGGG-[W]WW', /\d{4}-W\d{2}/], - ['YYYY-DDD', /\d{4}-\d{3}/] + ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], + ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], + ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], + ['GGGG-[W]WW', /\d{4}-W\d\d/, false], + ['YYYY-DDD', /\d{4}-\d{3}/], + ['YYYY-MM', /\d{4}-\d\d/, false], + ['YYYYYYMMDD', /[+-]\d{10}/], + ['YYYYMMDD', /\d{8}/], + // YYYYMM is NOT allowed by the standard + ['GGGG[W]WWE', /\d{4}W\d{3}/], + ['GGGG[W]WW', /\d{4}W\d{2}/, false], + ['YYYYDDD', /\d{7}/] ]; // iso time formats and regexes var isoTimes = [ - ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], - ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], - ['HH:mm', /(T| )\d\d:\d\d/], - ['HH', /(T| )\d\d/] + ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], + ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], + ['HH:mm:ss', /\d\d:\d\d:\d\d/], + ['HH:mm', /\d\d:\d\d/], + ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], + ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], + ['HHmmss', /\d\d\d\d\d\d/], + ['HHmm', /\d\d\d\d/], + ['HH', /\d\d/] ]; var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; @@ -18769,26 +18619,49 @@ module.exports=require(52) function configFromISO(config) { var i, l, string = config._i, - match = from_string__isoRegex.exec(string); + match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), + allowTime, dateFormat, timeFormat, tzFormat; if (match) { getParsingFlags(config).iso = true; + for (i = 0, l = isoDates.length; i < l; i++) { - if (isoDates[i][1].exec(string)) { - config._f = isoDates[i][0]; + if (isoDates[i][1].exec(match[1])) { + dateFormat = isoDates[i][0]; + allowTime = isoDates[i][2] !== false; break; } } - for (i = 0, l = isoTimes.length; i < l; i++) { - if (isoTimes[i][1].exec(string)) { - // match[6] should be 'T' or space - config._f += (match[6] || ' ') + isoTimes[i][0]; - break; + if (dateFormat == null) { + config._isValid = false; + return; + } + if (match[3]) { + for (i = 0, l = isoTimes.length; i < l; i++) { + if (isoTimes[i][1].exec(match[3])) { + // match[2] should be 'T' or space + timeFormat = (match[2] || ' ') + isoTimes[i][0]; + break; + } + } + if (timeFormat == null) { + config._isValid = false; + return; } } - if (string.match(matchOffset)) { - config._f += 'Z'; + if (!allowTime && timeFormat != null) { + config._isValid = false; + return; } + if (match[4]) { + if (tzRegex.exec(match[4])) { + tzFormat = 'Z'; + } else { + config._isValid = false; + return; + } + } + config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; @@ -18826,8 +18699,8 @@ module.exports=require(52) //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply var date = new Date(y, m, d, h, M, s, ms); - //the date constructor doesn't accept years < 1970 - if (y < 1970) { + //the date constructor remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { date.setFullYear(y); } return date; @@ -18835,12 +18708,21 @@ module.exports=require(52) function createUTCDate (y) { var date = new Date(Date.UTC.apply(null, arguments)); - if (y < 1970) { + + //the Date.UTC function remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } return date; } + // FORMATTING + + addFormatToken('Y', 0, 0, function () { + var y = this.year(); + return y <= 9999 ? '' + y : '+' + y; + }); + addFormatToken(0, ['YY', 2], 0, function () { return this.year() % 100; }); @@ -18868,6 +18750,9 @@ module.exports=require(52) addParseToken('YY', function (input, array) { array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input); }); + addParseToken('Y', function (input, array) { + array[YEAR] = parseInt(input, 10); + }); // HELPERS @@ -18893,124 +18778,66 @@ module.exports=require(52) return isLeapYear(this.year()); } - addFormatToken('w', ['ww', 2], 'wo', 'week'); - addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + // start-of-first-week - start-of-year + function firstWeekOffset(year, dow, doy) { + var // first-week day -- which january is always in the first week (4 for iso, 1 for other) + fwd = 7 + dow - doy, + // first-week day local weekday -- which local weekday is fwd + fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; - // ALIASES - - addUnitAlias('week', 'w'); - addUnitAlias('isoWeek', 'W'); - - // PARSING - - addRegexToken('w', match1to2); - addRegexToken('ww', match1to2, match2); - addRegexToken('W', match1to2); - addRegexToken('WW', match1to2, match2); - - addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { - week[token.substr(0, 1)] = toInt(input); - }); - - // HELPERS - - // firstDayOfWeek 0 = sun, 6 = sat - // the day of the week that starts the week - // (usually sunday or monday) - // firstDayOfWeekOfYear 0 = sun, 6 = sat - // the first week is the week that contains the first - // of this day of the week - // (eg. ISO weeks use thursday (4)) - function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { - var end = firstDayOfWeekOfYear - firstDayOfWeek, - daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), - adjustedMoment; - - - if (daysToDayOfWeek > end) { - daysToDayOfWeek -= 7; - } - - if (daysToDayOfWeek < end - 7) { - daysToDayOfWeek += 7; - } - - adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd'); - return { - week: Math.ceil(adjustedMoment.dayOfYear() / 7), - year: adjustedMoment.year() - }; + return -fwdlw + fwd - 1; } - // LOCALES - - function localeWeek (mom) { - return weekOfYear(mom, this._week.dow, this._week.doy).week; - } - - var defaultLocaleWeek = { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - }; - - function localeFirstDayOfWeek () { - return this._week.dow; - } - - function localeFirstDayOfYear () { - return this._week.doy; - } - - // MOMENTS - - function getSetWeek (input) { - var week = this.localeData().week(this); - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - function getSetISOWeek (input) { - var week = weekOfYear(this, 1, 4).week; - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); - - // ALIASES - - addUnitAlias('dayOfYear', 'DDD'); - - // PARSING - - addRegexToken('DDD', match1to3); - addRegexToken('DDDD', match3); - addParseToken(['DDD', 'DDDD'], function (input, array, config) { - config._dayOfYear = toInt(input); - }); - - // HELPERS - //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { - var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear; - if (d < firstDayOfWeek) { - d += 7; + function dayOfYearFromWeeks(year, week, weekday, dow, doy) { + var localWeekday = (7 + weekday - dow) % 7, + weekOffset = firstWeekOffset(year, dow, doy), + dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, + resYear, resDayOfYear; + + if (dayOfYear <= 0) { + resYear = year - 1; + resDayOfYear = daysInYear(resYear) + dayOfYear; + } else if (dayOfYear > daysInYear(year)) { + resYear = year + 1; + resDayOfYear = dayOfYear - daysInYear(year); + } else { + resYear = year; + resDayOfYear = dayOfYear; } - weekday = weekday != null ? 1 * weekday : firstDayOfWeek; - - dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday; - return { - year: dayOfYear > 0 ? year : year - 1, - dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear + year: resYear, + dayOfYear: resDayOfYear }; } - // MOMENTS + function weekOfYear(mom, dow, doy) { + var weekOffset = firstWeekOffset(mom.year(), dow, doy), + week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, + resWeek, resYear; - function getSetDayOfYear (input) { - var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; - return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + if (week < 1) { + resYear = mom.year() - 1; + resWeek = week + weeksInYear(resYear, dow, doy); + } else if (week > weeksInYear(mom.year(), dow, doy)) { + resWeek = week - weeksInYear(mom.year(), dow, doy); + resYear = mom.year() + 1; + } else { + resYear = mom.year(); + resWeek = week; + } + + return { + week: resWeek, + year: resYear + }; + } + + function weeksInYear(year, dow, doy) { + var weekOffset = firstWeekOffset(year, dow, doy), + weekOffsetNext = firstWeekOffset(year + 1, dow, doy); + return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; } // Pick the first defined of two or three arguments. @@ -19025,11 +18852,12 @@ module.exports=require(52) } function currentDateArray(config) { - var now = new Date(); + // hooks is actually the exported moment object + var nowValue = new Date(utils_hooks__hooks.now()); if (config._useUTC) { - return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()]; + return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; } - return [now.getFullYear(), now.getMonth(), now.getDate()]; + return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; } // convert an array to a date. @@ -19099,7 +18927,7 @@ module.exports=require(52) } function dayOfYearFromWeekInfo(config) { - var w, weekYear, week, weekday, dow, doy, temp; + var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; w = config._w; if (w.GG != null || w.W != null || w.E != null) { @@ -19113,6 +18941,9 @@ module.exports=require(52) weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year); week = defaults(w.W, 1); weekday = defaults(w.E, 1); + if (weekday < 1 || weekday > 7) { + weekdayOverflow = true; + } } else { dow = config._locale._week.dow; doy = config._locale._week.doy; @@ -19123,23 +18954,32 @@ module.exports=require(52) if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; - if (weekday < dow) { - ++week; + if (weekday < 0 || weekday > 6) { + weekdayOverflow = true; } } else if (w.e != null) { // local weekday -- counting starts from begining of week weekday = w.e + dow; + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; + } } else { // default to begining of week weekday = dow; } } - temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow); - - config._a[YEAR] = temp.year; - config._dayOfYear = temp.dayOfYear; + if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { + getParsingFlags(config)._overflowWeeks = true; + } else if (weekdayOverflow != null) { + getParsingFlags(config)._overflowWeekday = true; + } else { + temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); + config._a[YEAR] = temp.year; + config._dayOfYear = temp.dayOfYear; + } } + // constant that refers to the ISO standard utils_hooks__hooks.ISO_8601 = function () {}; // date from string and format string @@ -19164,6 +19004,8 @@ module.exports=require(52) for (i = 0; i < tokens.length; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; + // console.log('token', token, 'parsedInput', parsedInput, + // 'regex', getParseRegexForToken(token, config)); if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { @@ -19232,6 +19074,7 @@ module.exports=require(52) } } + // date from string and array of format strings function configFromStringAndArray(config) { var tempConfig, bestMoment, @@ -19282,7 +19125,9 @@ module.exports=require(52) } var i = normalizeObjectUnits(config._i); - config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond]; + config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { + return obj && parseInt(obj, 10); + }); configFromArray(config); } @@ -19324,13 +19169,17 @@ module.exports=require(52) configFromInput(config); } + if (!valid__isValid(config)) { + config._d = null; + } + return config; } function configFromInput(config) { var input = config._i; if (input === undefined) { - config._d = new Date(); + config._d = new Date(utils_hooks__hooks.now()); } else if (isDate(input)) { config._d = new Date(+input); } else if (typeof input === 'string') { @@ -19374,18 +19223,26 @@ module.exports=require(52) } var prototypeMin = deprecate( - 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', + 'moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); - return other < this ? this : other; + if (this.isValid() && other.isValid()) { + return other < this ? this : other; + } else { + return valid__createInvalid(); + } } ); var prototypeMax = deprecate( - 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', + 'moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); - return other > this ? this : other; + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return valid__createInvalid(); + } } ); @@ -19424,6 +19281,10 @@ module.exports=require(52) return pickBy('isAfter', args); } + var now = function () { + return Date.now ? Date.now() : +(new Date()); + }; + function Duration (duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, @@ -19463,6 +19324,8 @@ module.exports=require(52) return obj instanceof Duration; } + // FORMATTING + function offset (token, separator) { addFormatToken(token, 0, 0, function () { var offset = this.utcOffset(); @@ -19480,11 +19343,11 @@ module.exports=require(52) // PARSING - addRegexToken('Z', matchOffset); - addRegexToken('ZZ', matchOffset); + addRegexToken('Z', matchShortOffset); + addRegexToken('ZZ', matchShortOffset); addParseToken(['Z', 'ZZ'], function (input, array, config) { config._useUTC = true; - config._tzm = offsetFromString(input); + config._tzm = offsetFromString(matchShortOffset, input); }); // HELPERS @@ -19494,8 +19357,8 @@ module.exports=require(52) // '-1530' > ['-15', '30'] var chunkOffset = /([\+\-]|\d\d)/gi; - function offsetFromString(string) { - var matches = ((string || '').match(matchOffset) || []); + function offsetFromString(matcher, string) { + var matches = ((string || '').match(matcher) || []); var chunk = matches[matches.length - 1] || []; var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; var minutes = +(parts[1] * 60) + toInt(parts[2]); @@ -19545,11 +19408,13 @@ module.exports=require(52) function getSetOffset (input, keepLocalTime) { var offset = this._offset || 0, localAdjust; + if (!this.isValid()) { + return input != null ? this : NaN; + } if (input != null) { if (typeof input === 'string') { - input = offsetFromString(input); - } - if (Math.abs(input) < 16) { + input = offsetFromString(matchShortOffset, input); + } else if (Math.abs(input) < 16) { input = input * 60; } if (!this._isUTC && keepLocalTime) { @@ -19609,12 +19474,15 @@ module.exports=require(52) if (this._tzm) { this.utcOffset(this._tzm); } else if (typeof this._i === 'string') { - this.utcOffset(offsetFromString(this._i)); + this.utcOffset(offsetFromString(matchOffset, this._i)); } return this; } function hasAlignedHourOffset (input) { + if (!this.isValid()) { + return false; + } input = input ? local__createLocal(input).utcOffset() : 0; return (this.utcOffset() - input) % 60 === 0; @@ -19628,7 +19496,7 @@ module.exports=require(52) } function isDaylightSavingTimeShifted () { - if (typeof this._isDSTShifted !== 'undefined') { + if (!isUndefined(this._isDSTShifted)) { return this._isDSTShifted; } @@ -19649,22 +19517,24 @@ module.exports=require(52) } function isLocal () { - return !this._isUTC; + return this.isValid() ? !this._isUTC : false; } function isUtcOffset () { - return this._isUTC; + return this.isValid() ? this._isUTC : false; } function isUtc () { - return this._isUTC && this._offset === 0; + return this.isValid() ? this._isUTC && this._offset === 0 : false; } - var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; + // ASP.NET json date format regex + var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/; // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere - var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; + // and further modified to allow for strings containing both week and day + var isoRegex = /^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/; function create__createDuration (input, key) { var duration = input, @@ -19697,16 +19567,16 @@ module.exports=require(52) s : toInt(match[SECOND]) * sign, ms : toInt(match[MILLISECOND]) * sign }; - } else if (!!(match = create__isoRegex.exec(input))) { + } else if (!!(match = isoRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; duration = { y : parseIso(match[2], sign), M : parseIso(match[3], sign), - d : parseIso(match[4], sign), - h : parseIso(match[5], sign), - m : parseIso(match[6], sign), - s : parseIso(match[7], sign), - w : parseIso(match[8], sign) + w : parseIso(match[4], sign), + d : parseIso(match[5], sign), + h : parseIso(match[6], sign), + m : parseIso(match[7], sign), + s : parseIso(match[8], sign) }; } else if (duration == null) {// checks for null or undefined duration = {}; @@ -19754,6 +19624,10 @@ module.exports=require(52) function momentsDifference(base, other) { var res; + if (!(base.isValid() && other.isValid())) { + return {milliseconds: 0, months: 0}; + } + other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); @@ -19766,6 +19640,15 @@ module.exports=require(52) return res; } + function absRound (number) { + if (number < 0) { + return Math.round(-1 * number) * -1; + } else { + return Math.round(number); + } + } + + // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { var dur, tmp; @@ -19784,8 +19667,14 @@ module.exports=require(52) function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, - days = duration._days, - months = duration._months; + days = absRound(duration._days), + months = absRound(duration._months); + + if (!mom.isValid()) { + // No op + return; + } + updateOffset = updateOffset == null ? true : updateOffset; if (milliseconds) { @@ -19817,7 +19706,10 @@ module.exports=require(52) diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; - return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now))); + + var output = formats && (isFunction(formats[format]) ? formats[format]() : formats[format]); + + return this.format(output || this.localeData().calendar(format, this, local__createLocal(now))); } function clone () { @@ -19825,26 +19717,28 @@ module.exports=require(52) } function isAfter (input, units) { - var inputMs; - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this > +input; + return +this > +localInput; } else { - inputMs = isMoment(input) ? +input : +local__createLocal(input); - return inputMs < +this.clone().startOf(units); + return +localInput < +this.clone().startOf(units); } } function isBefore (input, units) { - var inputMs; - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this < +input; + return +this < +localInput; } else { - inputMs = isMoment(input) ? +input : +local__createLocal(input); - return +this.clone().endOf(units) < inputMs; + return +this.clone().endOf(units) < +localInput; } } @@ -19853,22 +19747,45 @@ module.exports=require(52) } function isSame (input, units) { - var inputMs; + var localInput = isMoment(input) ? input : local__createLocal(input), + inputMs; + if (!(this.isValid() && localInput.isValid())) { + return false; + } units = normalizeUnits(units || 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this === +input; + return +this === +localInput; } else { - inputMs = +local__createLocal(input); + inputMs = +localInput; return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units)); } } + function isSameOrAfter (input, units) { + return this.isSame(input, units) || this.isAfter(input,units); + } + + function isSameOrBefore (input, units) { + return this.isSame(input, units) || this.isBefore(input,units); + } + function diff (input, units, asFloat) { - var that = cloneWithOffset(input, this), - zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4, + var that, + zoneDelta, delta, output; + if (!this.isValid()) { + return NaN; + } + + that = cloneWithOffset(input, this); + + if (!that.isValid()) { + return NaN; + } + + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + units = normalizeUnits(units); if (units === 'year' || units === 'month' || units === 'quarter') { @@ -19919,7 +19836,7 @@ module.exports=require(52) function moment_format__toISOString () { var m = this.clone().utc(); if (0 < m.year() && m.year() <= 9999) { - if ('function' === typeof Date.prototype.toISOString) { + if (isFunction(Date.prototype.toISOString)) { // native implementation is ~50x faster, use it when we can return this.toDate().toISOString(); } else { @@ -19936,10 +19853,13 @@ module.exports=require(52) } function from (time, withoutSuffix) { - if (!this.isValid()) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { return this.localeData().invalidDate(); } - return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); } function fromNow (withoutSuffix) { @@ -19947,16 +19867,22 @@ module.exports=require(52) } function to (time, withoutSuffix) { - if (!this.isValid()) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { return this.localeData().invalidDate(); } - return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); } function toNow (withoutSuffix) { return this.to(local__createLocal(), withoutSuffix); } + // If passed a locale key, it will set the locale for this + // instance. Otherwise, it will return the locale configuration + // variables for this instance. function locale (key) { var newLocaleData; @@ -20067,6 +19993,11 @@ module.exports=require(52) }; } + function toJSON () { + // new Date(NaN).toJSON() === null + return this.isValid() ? this.toISOString() : null; + } + function moment_valid__isValid () { return valid__isValid(this); } @@ -20079,6 +20010,18 @@ module.exports=require(52) return getParsingFlags(this).overflow; } + function creationData() { + return { + input: this._i, + format: this._f, + locale: this._locale, + isUTC: this._isUTC, + strict: this._strict + }; + } + + // FORMATTING + addFormatToken(0, ['gg', 2], 0, function () { return this.weekYear() % 100; }); @@ -20120,22 +20063,20 @@ module.exports=require(52) week[token] = utils_hooks__hooks.parseTwoDigitYear(input); }); - // HELPERS - - function weeksInYear(year, dow, doy) { - return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week; - } - // MOMENTS function getSetWeekYear (input) { - var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; - return input == null ? year : this.add((input - year), 'y'); + return getSetWeekYearHelper.call(this, + input, + this.week(), + this.weekday(), + this.localeData()._week.dow, + this.localeData()._week.doy); } function getSetISOWeekYear (input) { - var year = weekOfYear(this, 1, 4).year; - return input == null ? year : this.add((input - year), 'y'); + return getSetWeekYearHelper.call(this, + input, this.isoWeek(), this.isoWeekday(), 1, 4); } function getISOWeeksInYear () { @@ -20147,7 +20088,32 @@ module.exports=require(52) return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } - addFormatToken('Q', 0, 0, 'quarter'); + function getSetWeekYearHelper(input, week, weekday, dow, doy) { + var weeksTarget; + if (input == null) { + return weekOfYear(this, dow, doy).year; + } else { + weeksTarget = weeksInYear(input, dow, doy); + if (week > weeksTarget) { + week = weeksTarget; + } + return setWeekAll.call(this, input, week, weekday, dow, doy); + } + } + + function setWeekAll(weekYear, week, weekday, dow, doy) { + var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), + date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); + + this.year(date.getUTCFullYear()); + this.month(date.getUTCMonth()); + this.date(date.getUTCDate()); + return this; + } + + // FORMATTING + + addFormatToken('Q', 0, 'Qo', 'quarter'); // ALIASES @@ -20166,6 +20132,62 @@ module.exports=require(52) return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); } + // FORMATTING + + addFormatToken('w', ['ww', 2], 'wo', 'week'); + addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + + // ALIASES + + addUnitAlias('week', 'w'); + addUnitAlias('isoWeek', 'W'); + + // PARSING + + addRegexToken('w', match1to2); + addRegexToken('ww', match1to2, match2); + addRegexToken('W', match1to2); + addRegexToken('WW', match1to2, match2); + + addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { + week[token.substr(0, 1)] = toInt(input); + }); + + // HELPERS + + // LOCALES + + function localeWeek (mom) { + return weekOfYear(mom, this._week.dow, this._week.doy).week; + } + + var defaultLocaleWeek = { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. + }; + + function localeFirstDayOfWeek () { + return this._week.dow; + } + + function localeFirstDayOfYear () { + return this._week.doy; + } + + // MOMENTS + + function getSetWeek (input) { + var week = this.localeData().week(this); + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + function getSetISOWeek (input) { + var week = weekOfYear(this, 1, 4).week; + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + // FORMATTING + addFormatToken('D', ['DD', 2], 'Do', 'date'); // ALIASES @@ -20189,6 +20211,8 @@ module.exports=require(52) var getSetDayOfMonth = makeGetSet('Date', true); + // FORMATTING + addFormatToken('d', 0, 'do', 'day'); addFormatToken('dd', 0, 0, function (format) { @@ -20221,8 +20245,8 @@ module.exports=require(52) addRegexToken('ddd', matchWord); addRegexToken('dddd', matchWord); - addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) { - var weekday = config._locale.weekdaysParse(input); + addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { + var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid if (weekday != null) { week.d = weekday; @@ -20257,8 +20281,9 @@ module.exports=require(52) // LOCALES var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); - function localeWeekdays (m) { - return this._weekdays[m.day()]; + function localeWeekdays (m, format) { + return isArray(this._weekdays) ? this._weekdays[m.day()] : + this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()]; } var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); @@ -20271,20 +20296,37 @@ module.exports=require(52) return this._weekdaysMin[m.day()]; } - function localeWeekdaysParse (weekdayName) { + function localeWeekdaysParse (weekdayName, format, strict) { var i, mom, regex; - this._weekdaysParse = this._weekdaysParse || []; + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._minWeekdaysParse = []; + this._shortWeekdaysParse = []; + this._fullWeekdaysParse = []; + } for (i = 0; i < 7; i++) { // make the regex if we don't have it already + + mom = local__createLocal([2000, 1]).day(i); + if (strict && !this._fullWeekdaysParse[i]) { + this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); + this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); + this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i'); + } if (!this._weekdaysParse[i]) { - mom = local__createLocal([2000, 1]).day(i); regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex - if (this._weekdaysParse[i].test(weekdayName)) { + if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { return i; } } @@ -20293,6 +20335,9 @@ module.exports=require(52) // MOMENTS function getSetDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); if (input != null) { input = parseWeekday(input, this.localeData()); @@ -20303,20 +20348,73 @@ module.exports=require(52) } function getSetLocaleDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); } function getSetISODayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); } - addFormatToken('H', ['HH', 2], 0, 'hour'); - addFormatToken('h', ['hh', 2], 0, function () { + // FORMATTING + + addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); + + // ALIASES + + addUnitAlias('dayOfYear', 'DDD'); + + // PARSING + + addRegexToken('DDD', match1to3); + addRegexToken('DDDD', match3); + addParseToken(['DDD', 'DDDD'], function (input, array, config) { + config._dayOfYear = toInt(input); + }); + + // HELPERS + + // MOMENTS + + function getSetDayOfYear (input) { + var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; + return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + } + + // FORMATTING + + function hFormat() { return this.hours() % 12 || 12; + } + + addFormatToken('H', ['HH', 2], 0, 'hour'); + addFormatToken('h', ['hh', 2], 0, hFormat); + + addFormatToken('hmm', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); + }); + + addFormatToken('hmmss', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); + }); + + addFormatToken('Hmm', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2); + }); + + addFormatToken('Hmmss', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); }); function meridiem (token, lowercase) { @@ -20345,6 +20443,11 @@ module.exports=require(52) addRegexToken('HH', match1to2, match2); addRegexToken('hh', match1to2, match2); + addRegexToken('hmm', match3to4); + addRegexToken('hmmss', match5to6); + addRegexToken('Hmm', match3to4); + addRegexToken('Hmmss', match5to6); + addParseToken(['H', 'HH'], HOUR); addParseToken(['a', 'A'], function (input, array, config) { config._isPm = config._locale.isPM(input); @@ -20354,6 +20457,32 @@ module.exports=require(52) array[HOUR] = toInt(input); getParsingFlags(config).bigHour = true; }); + addParseToken('hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('Hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + }); + addParseToken('Hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + }); // LOCALES @@ -20381,6 +20510,8 @@ module.exports=require(52) // this rule. var getSetHour = makeGetSet('Hours', true); + // FORMATTING + addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES @@ -20397,6 +20528,8 @@ module.exports=require(52) var getSetMinute = makeGetSet('Minutes', false); + // FORMATTING + addFormatToken('s', ['ss', 2], 0, 'second'); // ALIASES @@ -20413,6 +20546,8 @@ module.exports=require(52) var getSetSecond = makeGetSet('Seconds', false); + // FORMATTING + addFormatToken('S', 0, 0, function () { return ~~(this.millisecond() / 100); }); @@ -20468,6 +20603,8 @@ module.exports=require(52) var getSetMillisecond = makeGetSet('Milliseconds', false); + // FORMATTING + addFormatToken('z', 0, 0, 'zoneAbbr'); addFormatToken('zz', 0, 0, 'zoneName'); @@ -20483,40 +20620,43 @@ module.exports=require(52) var momentPrototype__proto = Moment.prototype; - momentPrototype__proto.add = add_subtract__add; - momentPrototype__proto.calendar = moment_calendar__calendar; - momentPrototype__proto.clone = clone; - momentPrototype__proto.diff = diff; - momentPrototype__proto.endOf = endOf; - momentPrototype__proto.format = format; - momentPrototype__proto.from = from; - momentPrototype__proto.fromNow = fromNow; - momentPrototype__proto.to = to; - momentPrototype__proto.toNow = toNow; - momentPrototype__proto.get = getSet; - momentPrototype__proto.invalidAt = invalidAt; - momentPrototype__proto.isAfter = isAfter; - momentPrototype__proto.isBefore = isBefore; - momentPrototype__proto.isBetween = isBetween; - momentPrototype__proto.isSame = isSame; - momentPrototype__proto.isValid = moment_valid__isValid; - momentPrototype__proto.lang = lang; - momentPrototype__proto.locale = locale; - momentPrototype__proto.localeData = localeData; - momentPrototype__proto.max = prototypeMax; - momentPrototype__proto.min = prototypeMin; - momentPrototype__proto.parsingFlags = parsingFlags; - momentPrototype__proto.set = getSet; - momentPrototype__proto.startOf = startOf; - momentPrototype__proto.subtract = add_subtract__subtract; - momentPrototype__proto.toArray = toArray; - momentPrototype__proto.toObject = toObject; - momentPrototype__proto.toDate = toDate; - momentPrototype__proto.toISOString = moment_format__toISOString; - momentPrototype__proto.toJSON = moment_format__toISOString; - momentPrototype__proto.toString = toString; - momentPrototype__proto.unix = unix; - momentPrototype__proto.valueOf = to_type__valueOf; + momentPrototype__proto.add = add_subtract__add; + momentPrototype__proto.calendar = moment_calendar__calendar; + momentPrototype__proto.clone = clone; + momentPrototype__proto.diff = diff; + momentPrototype__proto.endOf = endOf; + momentPrototype__proto.format = format; + momentPrototype__proto.from = from; + momentPrototype__proto.fromNow = fromNow; + momentPrototype__proto.to = to; + momentPrototype__proto.toNow = toNow; + momentPrototype__proto.get = getSet; + momentPrototype__proto.invalidAt = invalidAt; + momentPrototype__proto.isAfter = isAfter; + momentPrototype__proto.isBefore = isBefore; + momentPrototype__proto.isBetween = isBetween; + momentPrototype__proto.isSame = isSame; + momentPrototype__proto.isSameOrAfter = isSameOrAfter; + momentPrototype__proto.isSameOrBefore = isSameOrBefore; + momentPrototype__proto.isValid = moment_valid__isValid; + momentPrototype__proto.lang = lang; + momentPrototype__proto.locale = locale; + momentPrototype__proto.localeData = localeData; + momentPrototype__proto.max = prototypeMax; + momentPrototype__proto.min = prototypeMin; + momentPrototype__proto.parsingFlags = parsingFlags; + momentPrototype__proto.set = getSet; + momentPrototype__proto.startOf = startOf; + momentPrototype__proto.subtract = add_subtract__subtract; + momentPrototype__proto.toArray = toArray; + momentPrototype__proto.toObject = toObject; + momentPrototype__proto.toDate = toDate; + momentPrototype__proto.toISOString = moment_format__toISOString; + momentPrototype__proto.toJSON = toJSON; + momentPrototype__proto.toString = toString; + momentPrototype__proto.unix = unix; + momentPrototype__proto.valueOf = to_type__valueOf; + momentPrototype__proto.creationData = creationData; // Year momentPrototype__proto.year = getSetYear; @@ -20602,7 +20742,7 @@ module.exports=require(52) function locale_calendar__calendar (key, mom, now) { var output = this._calendar[key]; - return typeof output === 'function' ? output.call(mom, now) : output; + return isFunction(output) ? output.call(mom, now) : output; } var defaultLongDateFormat = { @@ -20664,29 +20804,14 @@ module.exports=require(52) function relative__relativeTime (number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; - return (typeof output === 'function') ? + return (isFunction(output)) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } function pastFuture (diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); - } - - function locale_set__set (config) { - var prop, i; - for (i in config) { - prop = config[i]; - if (typeof prop === 'function') { - this[i] = prop; - } else { - this['_' + i] = prop; - } - } - // Lenient ordinal parsing accepts just a number in addition to - // number + (possibly) stuff coming from _ordinalParseLenient. - this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source); + return isFunction(format) ? format(output) : format.replace(/%s/i, output); } var prototype__proto = Locale.prototype; @@ -20708,11 +20833,15 @@ module.exports=require(52) prototype__proto.set = locale_set__set; // Month - prototype__proto.months = localeMonths; - prototype__proto._months = defaultLocaleMonths; - prototype__proto.monthsShort = localeMonthsShort; - prototype__proto._monthsShort = defaultLocaleMonthsShort; - prototype__proto.monthsParse = localeMonthsParse; + prototype__proto.months = localeMonths; + prototype__proto._months = defaultLocaleMonths; + prototype__proto.monthsShort = localeMonthsShort; + prototype__proto._monthsShort = defaultLocaleMonthsShort; + prototype__proto.monthsParse = localeMonthsParse; + prototype__proto._monthsRegex = defaultMonthsRegex; + prototype__proto.monthsRegex = monthsRegex; + prototype__proto._monthsShortRegex = defaultMonthsShortRegex; + prototype__proto.monthsShortRegex = monthsShortRegex; // Week prototype__proto.week = localeWeek; @@ -21000,15 +21129,15 @@ module.exports=require(52) var years = round(duration.as('y')); var a = seconds < thresholds.s && ['s', seconds] || - minutes === 1 && ['m'] || + minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || - hours === 1 && ['h'] || + hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || - days === 1 && ['d'] || + days <= 1 && ['d'] || days < thresholds.d && ['dd', days] || - months === 1 && ['M'] || + months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || - years === 1 && ['y'] || ['yy', years]; + years <= 1 && ['y'] || ['yy', years]; a[2] = withoutSuffix; a[3] = +posNegDuration > 0; @@ -21129,6 +21258,8 @@ module.exports=require(52) // Side effect imports + // FORMATTING + addFormatToken('X', 0, 0, 'unix'); addFormatToken('x', 0, 0, 'valueOf'); @@ -21146,13 +21277,14 @@ module.exports=require(52) // Side effect imports - utils_hooks__hooks.version = '2.10.6'; + utils_hooks__hooks.version = '2.12.0'; setHookCallback(local__createLocal); utils_hooks__hooks.fn = momentPrototype; utils_hooks__hooks.min = min; utils_hooks__hooks.max = max; + utils_hooks__hooks.now = now; utils_hooks__hooks.utc = create_utc__createUTC; utils_hooks__hooks.unix = moment__createUnix; utils_hooks__hooks.months = lists__listMonths; @@ -21168,16 +21300,335 @@ module.exports=require(52) utils_hooks__hooks.monthsShort = lists__listMonthsShort; utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin; utils_hooks__hooks.defineLocale = defineLocale; + utils_hooks__hooks.updateLocale = updateLocale; + utils_hooks__hooks.locales = locale_locales__listLocales; utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort; utils_hooks__hooks.normalizeUnits = normalizeUnits; utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold; + utils_hooks__hooks.prototype = momentPrototype; var _moment = utils_hooks__hooks; return _moment; })); -},{}],105:[function(require,module,exports){ +},{}],82:[function(require,module,exports){ +(function (process){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// resolves . and .. elements in a path array with directory names there +// must be no slashes, empty elements, or device names (c:\) in the array +// (so also no leading and trailing slashes - it does not distinguish +// relative and absolute paths) +function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + + return parts; +} + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var splitPath = function(filename) { + return splitPathRe.exec(filename).slice(1); +}; + +// path.resolve([from ...], to) +// posix version +exports.resolve = function() { + var resolvedPath = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) ? arguments[i] : process.cwd(); + + // Skip empty and invalid entries + if (typeof path !== 'string') { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { + return !!p; + }), !resolvedAbsolute).join('/'); + + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; +}; + +// path.normalize(path) +// posix version +exports.normalize = function(path) { + var isAbsolute = exports.isAbsolute(path), + trailingSlash = substr(path, -1) === '/'; + + // Normalize the path + path = normalizeArray(filter(path.split('/'), function(p) { + return !!p; + }), !isAbsolute).join('/'); + + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + + return (isAbsolute ? '/' : '') + path; +}; + +// posix version +exports.isAbsolute = function(path) { + return path.charAt(0) === '/'; +}; + +// posix version +exports.join = function() { + var paths = Array.prototype.slice.call(arguments, 0); + return exports.normalize(filter(paths, function(p, index) { + if (typeof p !== 'string') { + throw new TypeError('Arguments to path.join must be strings'); + } + return p; + }).join('/')); +}; + + +// path.relative(from, to) +// posix version +exports.relative = function(from, to) { + from = exports.resolve(from).substr(1); + to = exports.resolve(to).substr(1); + + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('/'); +}; + +exports.sep = '/'; +exports.delimiter = ':'; + +exports.dirname = function(path) { + var result = splitPath(path), + root = result[0], + dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; +}; + + +exports.basename = function(path, ext) { + var f = splitPath(path)[2]; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +}; + + +exports.extname = function(path) { + return splitPath(path)[3]; +}; + +function filter (xs, f) { + if (xs.filter) return xs.filter(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + if (f(xs[i], i, xs)) res.push(xs[i]); + } + return res; +} + +// String.prototype.substr - negative index don't work in IE8 +var substr = 'ab'.substr(-1) === 'b' + ? function (str, start, len) { return str.substr(start, len) } + : function (str, start, len) { + if (start < 0) start = str.length + start; + return str.substr(start, len); + } +; + +}).call(this,require('_process')) +},{"_process":83}],83:[function(require,module,exports){ +// shim for using process in browser + +var process = module.exports = {}; + +process.nextTick = (function () { + var canSetImmediate = typeof window !== 'undefined' + && window.setImmediate; + var canMutationObserver = typeof window !== 'undefined' + && window.MutationObserver; + var canPost = typeof window !== 'undefined' + && window.postMessage && window.addEventListener + ; + + if (canSetImmediate) { + return function (f) { return window.setImmediate(f) }; + } + + var queue = []; + + if (canMutationObserver) { + var hiddenDiv = document.createElement("div"); + var observer = new MutationObserver(function () { + var queueList = queue.slice(); + queue.length = 0; + queueList.forEach(function (fn) { + fn(); + }); + }); + + observer.observe(hiddenDiv, { attributes: true }); + + return function nextTick(fn) { + if (!queue.length) { + hiddenDiv.setAttribute('yes', 'no'); + } + queue.push(fn); + }; + } + + if (canPost) { + window.addEventListener('message', function (ev) { + var source = ev.source; + if ((source === window || source === null) && ev.data === 'process-tick') { + ev.stopPropagation(); + if (queue.length > 0) { + var fn = queue.shift(); + fn(); + } + } + }, true); + + return function nextTick(fn) { + queue.push(fn); + window.postMessage('process-tick', '*'); + }; + } + + return function nextTick(fn) { + setTimeout(fn, 0); + }; +})(); + +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +// TODO(shtylman) +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; + +},{}],84:[function(require,module,exports){ module.exports={ "name": "mermaid", "version": "0.5.8", @@ -21287,7 +21738,7 @@ module.exports={ "marked": "^0.3.2", "mock-browser": "^0.91.34", "path": "^0.4.9", - "phantomjs": "^1.9.18", + "phantomjs": "^2.1.3", "proxyquire": "^1.7.3", "proxyquire-universal": "^1.0.8", "proxyquireify": "^3.0.0", @@ -21302,7 +21753,7 @@ module.exports={ } } -},{}],106:[function(require,module,exports){ +},{}],85:[function(require,module,exports){ /* global window */ //log.debug('Setting up d3'); 'use strict'; @@ -21773,7 +22224,7 @@ module.exports = d3; })(); /* jshint ignore:end */ -},{"d3":"d3"}],107:[function(require,module,exports){ +},{"d3":"d3"}],86:[function(require,module,exports){ 'use strict'; var Logger = require('../../logger'); @@ -21860,7 +22311,7 @@ exports.relationType = { DEPENDENCY: 3 }; -},{"../../logger":125}],108:[function(require,module,exports){ +},{"../../logger":104}],87:[function(require,module,exports){ /** * Created by knut on 14-11-23. */ @@ -22169,7 +22620,7 @@ module.exports.draw = function (text, id) { //diagram.attr('viewBox', (box.startx-conf.diagramMarginX) + ' -' +conf.diagramMarginY + ' ' + width + ' ' + height); }; -},{"../../d3":106,"../../logger":125,"./classDb":107,"./parser/classDiagram":109,"dagre":53}],109:[function(require,module,exports){ +},{"../../d3":85,"../../logger":104,"./classDb":86,"./parser/classDiagram":88,"dagre":30}],88:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -22971,7 +23422,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],110:[function(require,module,exports){ +},{"_process":83,"fs":1,"path":82}],89:[function(require,module,exports){ (function (global){ /** * Created by knut on 15-01-14. @@ -23006,7 +23457,7 @@ exports.parseError = function (err, hash) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../logger":125}],111:[function(require,module,exports){ +},{"../../logger":104}],90:[function(require,module,exports){ /** * Created by knut on 14-12-11. */ @@ -23041,7 +23492,7 @@ exports.draw = function (txt, id, ver) { /* var box = exports.bounds.getBounds(); - var height = box.stopy-box.starty+2*conf.diagramMarginY; + var height = box.stopy-box.starty+2*conf.diagramMarginY; var width = box.stopx-box.startx+2*conf.diagramMarginX;*/ svg.attr('height', 100); @@ -23049,7 +23500,7 @@ exports.draw = function (txt, id, ver) { //svg.attr('viewBox', '0 0 300 150'); }; -},{"../../d3":106,"../../logger":125,"./exampleDb":110,"./parser/example.js":112}],112:[function(require,module,exports){ +},{"../../d3":85,"../../logger":104,"./exampleDb":89,"./parser/example.js":91}],91:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -23695,7 +24146,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],113:[function(require,module,exports){ +},{"_process":83,"fs":1,"path":82}],92:[function(require,module,exports){ /* global window */ 'use strict'; @@ -23719,7 +24170,7 @@ if (!dagreD3) { module.exports = dagreD3; -},{"../../logger":125,"dagre-d3":4}],114:[function(require,module,exports){ +},{"../../logger":104,"dagre-d3":2}],93:[function(require,module,exports){ /** * Created by knut on 14-12-11. */ @@ -24192,7 +24643,7 @@ exports.draw = function (text, id, isDot) { } }; -},{"../../d3":106,"../../logger":125,"./dagre-d3":113,"./graphDb":115,"./parser/dot":116,"./parser/flow":117}],115:[function(require,module,exports){ +},{"../../d3":85,"../../logger":104,"./dagre-d3":92,"./graphDb":94,"./parser/dot":95,"./parser/flow":96}],94:[function(require,module,exports){ (function (global){ /** * Created by knut on 14-11-03. @@ -24581,7 +25032,7 @@ exports.parseError = function (err, hash) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../d3":106,"../../logger":125}],116:[function(require,module,exports){ +},{"../../d3":85,"../../logger":104}],95:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -25412,7 +25863,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],117:[function(require,module,exports){ +},{"_process":83,"fs":1,"path":82}],96:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -26522,7 +26973,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],118:[function(require,module,exports){ +},{"_process":83,"fs":1,"path":82}],97:[function(require,module,exports){ (function (global){ /** * Created by knut on 15-01-14. @@ -26909,7 +27360,7 @@ exports.parseError = function (err, hash) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../logger":125,"moment":104}],119:[function(require,module,exports){ +},{"../../logger":104,"moment":81}],98:[function(require,module,exports){ 'use strict'; var gantt = require('./parser/gantt').parser; @@ -27263,7 +27714,7 @@ module.exports.draw = function (text, id) { } }; -},{"../../d3":106,"./ganttDb":118,"./parser/gantt":120,"moment":104}],120:[function(require,module,exports){ +},{"../../d3":85,"./ganttDb":97,"./parser/gantt":99,"moment":81}],99:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -27946,9 +28397,9 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],121:[function(require,module,exports){ +},{"_process":83,"fs":1,"path":82}],100:[function(require,module,exports){ (function (process){ -/* parser generated by jison 0.4.15 */ +/* parser generated by jison 0.4.17 */ /* Returns a Parser object of the following structure: @@ -28027,63 +28478,75 @@ var sequenceDiagram = (function () { var o = function o(k, v, _o, l) { for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v);return _o; }, - $V0 = [2, 2], - $V1 = [1, 5], - $V2 = [1, 7], - $V3 = [1, 8], - $V4 = [1, 11], - $V5 = [1, 12], - $V6 = [1, 13], + $V0 = [1, 2], + $V1 = [1, 3], + $V2 = [1, 4], + $V3 = [2, 4], + $V4 = [1, 9], + $V5 = [1, 11], + $V6 = [1, 12], $V7 = [1, 14], - $V8 = [1, 16], + $V8 = [1, 15], $V9 = [1, 17], - $Va = [1, 7, 9, 10, 16, 18, 19, 20, 21, 22, 23, 33], - $Vb = [7, 9, 10, 16, 18, 19, 20, 21, 23, 33], - $Vc = [1, 53]; + $Va = [1, 18], + $Vb = [1, 19], + $Vc = [1, 20], + $Vd = [1, 22], + $Ve = [1, 23], + $Vf = [1, 4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 24, 25, 37], + $Vg = [4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 25, 37], + $Vh = [35, 36, 37], + $Vi = [1, 67]; var parser = { trace: function trace() {}, yy: {}, - symbols_: { "error": 2, "start": 3, "SD": 4, "document": 5, "line": 6, "SPACE": 7, "statement": 8, "NL": 9, "participant": 10, "actor": 11, "AS": 12, "restOfLine": 13, "signal": 14, "note_statement": 15, "title": 16, "text": 17, "loop": 18, "end": 19, "opt": 20, "alt": 21, "else": 22, "note": 23, "placement": 24, "text2": 25, "over": 26, "actor_pair": 27, "spaceList": 28, ",": 29, "left_of": 30, "right_of": 31, "signaltype": 32, "ACTOR": 33, "SOLID_OPEN_ARROW": 34, "DOTTED_OPEN_ARROW": 35, "SOLID_ARROW": 36, "DOTTED_ARROW": 37, "SOLID_CROSS": 38, "DOTTED_CROSS": 39, "TXT": 40, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "SD", 7: "SPACE", 9: "NL", 10: "participant", 12: "AS", 13: "restOfLine", 16: "title", 17: "text", 18: "loop", 19: "end", 20: "opt", 21: "alt", 22: "else", 23: "note", 26: "over", 29: ",", 30: "left_of", 31: "right_of", 33: "ACTOR", 34: "SOLID_OPEN_ARROW", 35: "DOTTED_OPEN_ARROW", 36: "SOLID_ARROW", 37: "DOTTED_ARROW", 38: "SOLID_CROSS", 39: "DOTTED_CROSS", 40: "TXT" }, - productions_: [0, [3, 2], [5, 0], [5, 2], [6, 2], [6, 1], [6, 1], [8, 5], [8, 3], [8, 2], [8, 2], [8, 4], [8, 4], [8, 4], [8, 7], [15, 4], [15, 4], [28, 2], [28, 1], [27, 3], [27, 1], [24, 1], [24, 1], [14, 4], [11, 1], [32, 1], [32, 1], [32, 1], [32, 1], [32, 1], [32, 1], [25, 1]], + 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, "text": 19, "loop": 20, "end": 21, "opt": 22, "alt": 23, "else": 24, "note": 25, "placement": 26, "text2": 27, "over": 28, "actor_pair": 29, "spaceList": 30, ",": 31, "left_of": 32, "right_of": 33, "signaltype": 34, "+": 35, "-": 36, "ACTOR": 37, "SOLID_OPEN_ARROW": 38, "DOTTED_OPEN_ARROW": 39, "SOLID_ARROW": 40, "DOTTED_ARROW": 41, "SOLID_CROSS": 42, "DOTTED_CROSS": 43, "TXT": 44, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 4: "SPACE", 5: "NL", 6: "SD", 10: "participant", 12: "AS", 13: "restOfLine", 15: "activate", 16: "deactivate", 18: "title", 19: "text", 20: "loop", 21: "end", 22: "opt", 23: "alt", 24: "else", 25: "note", 28: "over", 31: ",", 32: "left_of", 33: "right_of", 35: "+", 36: "-", 37: "ACTOR", 38: "SOLID_OPEN_ARROW", 39: "DOTTED_OPEN_ARROW", 40: "SOLID_ARROW", 41: "DOTTED_ARROW", 42: "SOLID_CROSS", 43: "DOTTED_CROSS", 44: "TXT" }, + 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, 4], [9, 4], [9, 4], [9, 7], [17, 4], [17, 4], [30, 2], [30, 1], [29, 3], [29, 1], [26, 1], [26, 1], [14, 5], [14, 5], [14, 4], [11, 1], [34, 1], [34, 1], [34, 1], [34, 1], [34, 1], [34, 1], [27, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, /* action[1] */$$, /* vstack */_$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { - case 1: + case 3: yy.apply($$[$0]);return $$[$0]; break; - case 2: + case 4: this.$ = []; break; - case 3: + case 5: $$[$0 - 1].push($$[$0]);this.$ = $$[$0 - 1]; break; - case 4:case 5: + case 6:case 7: this.$ = $$[$0]; break; - case 6: + case 8: this.$ = []; break; - case 7: + case 9: $$[$0 - 3].description = $$[$0 - 1];this.$ = $$[$0 - 3]; break; - case 8: + case 10: this.$ = $$[$0 - 1]; break; case 12: + this.$ = { type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] }; + break; + case 13: + this.$ = { type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 1] }; + break; + case 16: $$[$0 - 1].unshift({ type: 'loopStart', loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_START }); $$[$0 - 1].push({ type: 'loopEnd', loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_END }); this.$ = $$[$0 - 1]; break; - case 13: + case 17: $$[$0 - 1].unshift({ type: 'optStart', optText: $$[$0 - 2], signalType: yy.LINETYPE.OPT_START }); $$[$0 - 1].push({ type: 'optEnd', optText: $$[$0 - 2], signalType: yy.LINETYPE.OPT_END }); this.$ = $$[$0 - 1]; break; - case 14: + case 18: // Alt start $$[$0 - 4].unshift({ type: 'altStart', altText: $$[$0 - 5], signalType: yy.LINETYPE.ALT_START }); @@ -28097,11 +28560,11 @@ var sequenceDiagram = (function () { this.$ = $$[$0 - 4]; break; - case 15: + case 19: this.$ = [$$[$0 - 1], { type: 'addNote', placement: $$[$0 - 2], actor: $$[$0 - 1].actor, text: $$[$0] }]; break; - case 16: + case 20: // Coerce actor_pair into a [to, from, ...] array $$[$0 - 2] = [].concat($$[$0 - 1], $$[$0 - 1]).slice(0, 2); @@ -28109,49 +28572,55 @@ var sequenceDiagram = (function () { $$[$0 - 2][1] = $$[$0 - 2][1].actor; this.$ = [$$[$0 - 1], { type: 'addNote', placement: yy.PLACEMENT.OVER, actor: $$[$0 - 2].slice(0, 2), text: $$[$0] }]; break; - case 19: + case 23: this.$ = [$$[$0 - 2], $$[$0]]; break; - case 20: + case 24: this.$ = $$[$0]; break; - case 21: + case 25: this.$ = yy.PLACEMENT.LEFTOF; break; - case 22: + case 26: this.$ = yy.PLACEMENT.RIGHTOF; break; - case 23: - this.$ = [$$[$0 - 3], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }]; - break; - case 24: - this.$ = { type: 'addActor', actor: $$[$0] }; - break; - case 25: - this.$ = yy.LINETYPE.SOLID_OPEN; - break; - case 26: - this.$ = yy.LINETYPE.DOTTED_OPEN; - break; case 27: - this.$ = yy.LINETYPE.SOLID; + this.$ = [$$[$0 - 4], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, { type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] }]; break; case 28: - this.$ = yy.LINETYPE.DOTTED; + this.$ = [$$[$0 - 4], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, { type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 4] }]; break; case 29: - this.$ = yy.LINETYPE.SOLID_CROSS; + this.$ = [$$[$0 - 3], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }]; break; case 30: - this.$ = yy.LINETYPE.DOTTED_CROSS; + this.$ = { type: 'addActor', actor: $$[$0] }; break; case 31: + this.$ = yy.LINETYPE.SOLID_OPEN; + break; + case 32: + this.$ = yy.LINETYPE.DOTTED_OPEN; + break; + case 33: + this.$ = yy.LINETYPE.SOLID; + break; + case 34: + this.$ = yy.LINETYPE.DOTTED; + break; + case 35: + this.$ = yy.LINETYPE.SOLID_CROSS; + break; + case 36: + this.$ = yy.LINETYPE.DOTTED_CROSS; + break; + case 37: this.$ = $$[$0].substring(1).trim().replace(/\\n/gm, "\n"); break; } }, - table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o([1, 7, 9, 10, 16, 18, 20, 21, 23, 33], $V0, { 5: 3 }), { 1: [2, 1], 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, o($Va, [2, 3]), { 8: 18, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, o($Va, [2, 5]), o($Va, [2, 6]), { 11: 19, 33: $V9 }, { 9: [1, 20] }, { 9: [1, 21] }, { 7: [1, 22] }, { 13: [1, 23] }, { 13: [1, 24] }, { 13: [1, 25] }, { 32: 26, 34: [1, 27], 35: [1, 28], 36: [1, 29], 37: [1, 30], 38: [1, 31], 39: [1, 32] }, { 24: 33, 26: [1, 34], 30: [1, 35], 31: [1, 36] }, o([9, 12, 29, 34, 35, 36, 37, 38, 39, 40], [2, 24]), o($Va, [2, 4]), { 9: [1, 38], 12: [1, 37] }, o($Va, [2, 9]), o($Va, [2, 10]), { 17: [1, 39] }, o($Vb, $V0, { 5: 40 }), o($Vb, $V0, { 5: 41 }), o([7, 9, 10, 16, 18, 20, 21, 22, 23, 33], $V0, { 5: 42 }), { 11: 43, 33: $V9 }, { 33: [2, 25] }, { 33: [2, 26] }, { 33: [2, 27] }, { 33: [2, 28] }, { 33: [2, 29] }, { 33: [2, 30] }, { 11: 44, 33: $V9 }, { 11: 46, 27: 45, 33: $V9 }, { 33: [2, 21] }, { 33: [2, 22] }, { 13: [1, 47] }, o($Va, [2, 8]), { 9: [1, 48] }, { 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 19: [1, 49], 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, { 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 19: [1, 50], 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, { 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 20: $V6, 21: $V7, 22: [1, 51], 23: $V8, 33: $V9 }, { 25: 52, 40: $Vc }, { 25: 54, 40: $Vc }, { 25: 55, 40: $Vc }, { 29: [1, 56], 40: [2, 20] }, { 9: [1, 57] }, o($Va, [2, 11]), o($Va, [2, 12]), o($Va, [2, 13]), { 13: [1, 58] }, { 9: [2, 23] }, { 9: [2, 31] }, { 9: [2, 15] }, { 9: [2, 16] }, { 11: 59, 33: $V9 }, o($Va, [2, 7]), o($Vb, $V0, { 5: 60 }), { 40: [2, 19] }, { 6: 4, 7: $V1, 8: 6, 9: $V2, 10: $V3, 11: 15, 14: 9, 15: 10, 16: $V4, 18: $V5, 19: [1, 61], 20: $V6, 21: $V7, 23: $V8, 33: $V9 }, o($Va, [2, 14])], - defaultActions: { 27: [2, 25], 28: [2, 26], 29: [2, 27], 30: [2, 28], 31: [2, 29], 32: [2, 30], 35: [2, 21], 36: [2, 22], 52: [2, 23], 53: [2, 31], 54: [2, 15], 55: [2, 16], 59: [2, 19] }, + 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, 37], $V3, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, o($Vf, [2, 5]), { 9: 24, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, o($Vf, [2, 7]), o($Vf, [2, 8]), { 11: 25, 37: $Ve }, { 5: [1, 26] }, { 11: 27, 37: $Ve }, { 11: 28, 37: $Ve }, { 5: [1, 29] }, { 4: [1, 30] }, { 13: [1, 31] }, { 13: [1, 32] }, { 13: [1, 33] }, { 34: 34, 38: [1, 35], 39: [1, 36], 40: [1, 37], 41: [1, 38], 42: [1, 39], 43: [1, 40] }, { 26: 41, 28: [1, 42], 32: [1, 43], 33: [1, 44] }, o([5, 12, 31, 38, 39, 40, 41, 42, 43, 44], [2, 30]), o($Vf, [2, 6]), { 5: [1, 46], 12: [1, 45] }, o($Vf, [2, 11]), { 5: [1, 47] }, { 5: [1, 48] }, o($Vf, [2, 14]), { 19: [1, 49] }, o($Vg, $V3, { 7: 50 }), o($Vg, $V3, { 7: 51 }), o([4, 5, 10, 15, 16, 18, 20, 22, 23, 24, 25, 37], $V3, { 7: 52 }), { 11: 55, 35: [1, 53], 36: [1, 54], 37: $Ve }, o($Vh, [2, 31]), o($Vh, [2, 32]), o($Vh, [2, 33]), o($Vh, [2, 34]), o($Vh, [2, 35]), o($Vh, [2, 36]), { 11: 56, 37: $Ve }, { 11: 58, 29: 57, 37: $Ve }, { 37: [2, 25] }, { 37: [2, 26] }, { 13: [1, 59] }, o($Vf, [2, 10]), o($Vf, [2, 12]), o($Vf, [2, 13]), { 5: [1, 60] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 61], 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 62], 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 24: [1, 63], 25: $Vd, 37: $Ve }, { 11: 64, 37: $Ve }, { 11: 65, 37: $Ve }, { 27: 66, 44: $Vi }, { 27: 68, 44: $Vi }, { 27: 69, 44: $Vi }, { 31: [1, 70], 44: [2, 24] }, { 5: [1, 71] }, o($Vf, [2, 15]), o($Vf, [2, 16]), o($Vf, [2, 17]), { 13: [1, 72] }, { 27: 73, 44: $Vi }, { 27: 74, 44: $Vi }, { 5: [2, 29] }, { 5: [2, 37] }, { 5: [2, 19] }, { 5: [2, 20] }, { 11: 75, 37: $Ve }, o($Vf, [2, 9]), o($Vg, $V3, { 7: 76 }), { 5: [2, 27] }, { 5: [2, 28] }, { 44: [2, 23] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 21, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 77], 22: $Vb, 23: $Vc, 25: $Vd, 37: $Ve }, o($Vf, [2, 18])], + defaultActions: { 5: [2, 1], 6: [2, 2], 43: [2, 25], 44: [2, 26], 66: [2, 29], 67: [2, 37], 68: [2, 19], 69: [2, 20], 73: [2, 27], 74: [2, 28], 75: [2, 23] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); @@ -28161,7 +28630,7 @@ var sequenceDiagram = (function () { this.hash = hash; }; - _parseError.prototype = new Error(); + _parseError.prototype = Error; throw new _parseError(str, hash); } @@ -28631,7 +29100,7 @@ var sequenceDiagram = (function () { var YYSTATE = YY_START; switch ($avoiding_name_collisions) { case 0: - return 9; + return 5; break; case 1: /* skip all whitespace */ @@ -28649,70 +29118,70 @@ var sequenceDiagram = (function () { this.begin('ID');return 10; break; case 6: - this.begin('ALIAS');return 33; + this.begin('ALIAS');return 37; break; case 7: this.popState();this.popState();this.begin('LINE');return 12; break; case 8: - this.popState();this.popState();return 9; + this.popState();this.popState();return 5; break; case 9: - this.begin('LINE');return 18; - break; - case 10: this.begin('LINE');return 20; break; + case 10: + this.begin('LINE');return 22; + break; case 11: - this.begin('LINE');return 21; + this.begin('LINE');return 23; break; case 12: - this.begin('LINE');return 22; + this.begin('LINE');return 24; break; case 13: this.popState();return 13; break; case 14: - return 19; + return 21; break; case 15: - return 30; + return 32; break; case 16: - return 31; - break; - case 17: - return 26; - break; - case 18: - return 23; - break; - case 19: - return 16; - break; - case 20: - return 4; - break; - case 21: - return 29; - break; - case 22: - return 9; - break; - case 23: return 33; break; + case 17: + return 28; + break; + case 18: + return 25; + break; + case 19: + this.begin('ID');return 15; + break; + case 20: + this.begin('ID');return 16; + break; + case 21: + return 18; + break; + case 22: + return 6; + break; + case 23: + return 31; + break; case 24: - return 36; + return 5; break; case 25: - return 37; + yy_.yytext = yy_.yytext.trim();return 37; break; case 26: - return 34; + return 40; break; case 27: - return 35; + return 41; break; case 28: return 38; @@ -28721,18 +29190,30 @@ var sequenceDiagram = (function () { return 39; break; case 30: - return 40; + return 42; break; case 31: - return 9; + return 43; break; case 32: + return 44; + break; + case 33: + return 35; + break; + case 34: + return 36; + break; + case 35: + return 5; + break; + case 36: return 'INVALID'; break; } }, - 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, /^(?:[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:title\b)/i, /^(?:sequenceDiagram\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\->:\n,;]+)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?::[^#\n;]+)/i, /^(?:$)/i, /^(?:.)/i], - conditions: { "LINE": { "rules": [2, 3, 13], "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, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], "inclusive": true } } + 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, /^(?:[^#\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], + conditions: { "LINE": { "rules": [2, 3, 13], "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, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36], "inclusive": true } } }; return lexer; })(); @@ -28764,7 +29245,7 @@ if (typeof require !== 'undefined' && typeof exports !== 'undefined') { } }).call(this,require('_process')) -},{"_process":3,"fs":1,"path":2}],122:[function(require,module,exports){ +},{"_process":83,"fs":1,"path":82}],101:[function(require,module,exports){ (function (global){ /** * Created by knut on 14-11-19. @@ -28833,7 +29314,9 @@ exports.LINETYPE = { ALT_ELSE: 13, ALT_END: 14, OPT_START: 15, - OPT_END: 16 + OPT_END: 16, + ACTIVE_START: 17, + ACTIVE_END: 18 }; exports.ARROWTYPE = { @@ -28867,11 +29350,17 @@ exports.apply = function (param) { exports.apply(item); }); } else { - // log.debug(param); + // console.info(param); switch (param.type) { case 'addActor': exports.addActor(param.actor, param.actor, param.description); break; + case 'activeStart': + exports.addSignal(param.actor, undefined, undefined, param.signalType); + break; + case 'activeEnd': + exports.addSignal(param.actor, undefined, undefined, param.signalType); + break; case 'addNote': exports.addNote(param.actor, param.placement, param.text); break; @@ -28910,7 +29399,7 @@ exports.apply = function (param) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../logger":125}],123:[function(require,module,exports){ +},{"../../logger":104}],102:[function(require,module,exports){ /** * Created by knut on 14-11-23. */ @@ -28930,7 +29419,7 @@ var conf = { diagramMarginY: 10, // Margin between actors actorMargin: 50, - // Width of actor moxes + // Width of actor boxes width: 150, // Height of actor boxes height: 65, @@ -28944,7 +29433,10 @@ var conf = { mirrorActors: false, // Depending on css styling this might need adjustment // Prolongs the edge of the diagram downwards - bottomMarginAdj: 1 + bottomMarginAdj: 1, + + // width of activation box + activationWidth: 10 }; //var bb = getBBox('path'); @@ -28957,9 +29449,11 @@ exports.bounds = { }, verticalPos: 0, - list: [], + sequenceItems: [], + activations: [], init: function init() { - this.list = []; + this.sequenceItems = []; + this.activations = []; this.data = { startx: undefined, stopx: undefined, @@ -28975,24 +29469,33 @@ exports.bounds = { obj[key] = fun(val, obj[key]); } }, - updateLoops: function updateLoops(startx, starty, stopx, stopy) { + updateBounds: function updateBounds(startx, starty, stopx, stopy) { var _self = this; var cnt = 0; - this.list.forEach(function (loop) { - cnt++; - // The loop list is a stack so the biggest margins in the beginning of the list - var n = _self.list.length - cnt + 1; + function updateFn(type) { + return function updateItemBounds(item) { + cnt++; + // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems + var n = _self.sequenceItems.length - cnt + 1; - _self.updateVal(loop, 'startx', startx - n * conf.boxMargin, Math.min); - _self.updateVal(loop, 'starty', starty - n * conf.boxMargin, Math.min); - _self.updateVal(loop, 'stopx', stopx + n * conf.boxMargin, Math.max); - _self.updateVal(loop, 'stopy', stopy + n * conf.boxMargin, Math.max); + _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min); + _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max); - _self.updateVal(exports.bounds.data, 'startx', startx - n * conf.boxMargin, Math.min); - _self.updateVal(exports.bounds.data, 'starty', starty - n * conf.boxMargin, Math.min); - _self.updateVal(exports.bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max); - _self.updateVal(exports.bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max); - }); + _self.updateVal(exports.bounds.data, 'startx', startx - n * conf.boxMargin, Math.min); + _self.updateVal(exports.bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max); + + if (!(type == 'activation')) { + _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min); + _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max); + + _self.updateVal(exports.bounds.data, 'starty', starty - n * conf.boxMargin, Math.min); + _self.updateVal(exports.bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max); + } + }; + } + + this.sequenceItems.forEach(updateFn()); + this.activations.forEach(updateFn('activation')); }, insert: function insert(startx, starty, stopx, stopy) { @@ -29008,21 +29511,37 @@ exports.bounds = { this.updateVal(exports.bounds.data, 'stopx', _stopx, Math.max); this.updateVal(exports.bounds.data, 'stopy', _stopy, Math.max); - this.updateLoops(_startx, _starty, _stopx, _stopy); + this.updateBounds(_startx, _starty, _stopx, _stopy); + }, + newActivation: function newActivation(message, diagram) { + var actorRect = sq.yy.getActors()[message.from.actor]; + var stackedSize = actorActivations(message.from.actor).length; + var x = actorRect.x + conf.width / 2 + (stackedSize - 1) * conf.activationWidth / 2; + this.activations.push({ startx: x, starty: this.verticalPos + 2, stopx: x + conf.activationWidth, stopy: undefined, + actor: message.from.actor, + anchored: svgDraw.anchorElement(diagram) + }); + }, + endActivation: function endActivation(message) { + // find most recent activation for given actor + var lastActorActivationIdx = this.activations.map(function (activation) { + return activation.actor; + }).lastIndexOf(message.from.actor); + var activation = this.activations.splice(lastActorActivationIdx, 1)[0]; + return activation; }, newLoop: function newLoop(title) { - this.list.push({ startx: undefined, starty: this.verticalPos, stopx: undefined, stopy: undefined, title: title }); + this.sequenceItems.push({ startx: undefined, starty: this.verticalPos, stopx: undefined, stopy: undefined, title: title }); }, endLoop: function endLoop() { - var loop = this.list.pop(); - //loop.stopy = exports.bounds.getVerticalPos(); + var loop = this.sequenceItems.pop(); return loop; }, addElseToLoop: function addElseToLoop(message) { - var loop = this.list.pop(); + var loop = this.sequenceItems.pop(); loop.elsey = exports.bounds.getVerticalPos(); loop.elseText = message; - this.list.push(loop); + this.sequenceItems.push(loop); }, bumpVerticalPos: function bumpVerticalPos(bump) { this.verticalPos = this.verticalPos + bump; @@ -29158,7 +29677,7 @@ module.exports.drawActors = function (diagram, actors, actorKeys, verticalPos) { // Add some rendering data to the object actors[key].x = i * conf.actorMargin + i * conf.width; actors[key].y = verticalPos; - actors[key].width = conf.diagramMarginY; + actors[key].width = conf.diagramMarginX; actors[key].height = conf.diagramMarginY; // Draw the box with the attached line @@ -29178,6 +29697,27 @@ module.exports.setConf = function (cnf) { conf[key] = cnf[key]; }); }; + +var actorActivations = function actorActivations(actor) { + return module.exports.bounds.activations.filter(function (activation) { + return activation.actor == actor; + }); +}; + +var actorFlowVerticaBounds = function actorFlowVerticaBounds(actor) { + // handle multiple stacked activations for same actor + var actors = sq.yy.getActors(); + var activations = actorActivations(actor); + + var left = activations.reduce(function (acc, activation) { + return Math.min(acc, activation.startx); + }, actors[actor].x + conf.width / 2); + var right = activations.reduce(function (acc, activation) { + return Math.max(acc, activation.stopx); + }, actors[actor].x + conf.width / 2); + return [left, right]; +}; + /** * Draws a flowchart in the tag with id: id based on the graph definition in text. * @param text @@ -29204,6 +29744,19 @@ module.exports.draw = function (text, id) { svgDraw.insertArrowHead(diagram); svgDraw.insertArrowCrossHead(diagram); + function activeEnd(msg, verticalPos) { + var activationData = exports.bounds.endActivation(msg); + if (activationData.starty + 18 > verticalPos) { + activationData.starty = verticalPos - 6; + verticalPos += 12; + } + svgDraw.drawActivation(diagram, activationData, verticalPos, conf); + + exports.bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos); + } + + var lastMsg; + // Draw the messages/signals messages.forEach(function (msg) { var loopData; @@ -29228,6 +29781,12 @@ module.exports.draw = function (text, id) { drawNote(diagram, (startx + stopx + conf.width - forceWidth) / 2, exports.bounds.getVerticalPos(), msg, forceWidth); } break; + case sq.yy.LINETYPE.ACTIVE_START: + exports.bounds.newActivation(msg, diagram); + break; + case sq.yy.LINETYPE.ACTIVE_END: + activeEnd(msg, exports.bounds.getVerticalPos()); + break; case sq.yy.LINETYPE.LOOP_START: exports.bounds.bumpVerticalPos(conf.boxMargin); exports.bounds.newLoop(msg.message); @@ -29269,12 +29828,23 @@ module.exports.draw = function (text, id) { exports.bounds.bumpVerticalPos(conf.boxMargin); break; default: - exports.bounds.bumpVerticalPos(conf.messageMargin); - startx = actors[msg.from].x + conf.width / 2; - stopx = actors[msg.to].x + conf.width / 2; - - drawMessage(diagram, startx, stopx, exports.bounds.getVerticalPos(), msg); + try { + lastMsg = msg; + exports.bounds.bumpVerticalPos(conf.messageMargin); + var fromBounds = actorFlowVerticaBounds(msg.from); + var toBounds = actorFlowVerticaBounds(msg.to); + var fromIdx = fromBounds[0] <= toBounds[0] ? 1 : 0; + var toIdx = fromBounds[0] < toBounds[0] ? 0 : 1; + startx = fromBounds[fromIdx]; + stopx = toBounds[toIdx]; + var verticalPos = exports.bounds.getVerticalPos(); + drawMessage(diagram, startx, stopx, verticalPos, msg); + var allBounds = fromBounds.concat(toBounds); + exports.bounds.insert(Math.min.apply(null, allBounds), verticalPos, Math.max.apply(null, allBounds), verticalPos); + } catch (e) { + console.error('error while drawing message', e); + } } }); @@ -29309,7 +29879,7 @@ module.exports.draw = function (text, id) { diagram.attr('viewBox', box.startx - conf.diagramMarginX + ' -' + conf.diagramMarginY + ' ' + width + ' ' + height); }; -},{"../../d3":106,"../../logger":125,"./parser/sequenceDiagram":121,"./sequenceDb":122,"./svgDraw":124}],124:[function(require,module,exports){ +},{"../../d3":85,"../../logger":104,"./parser/sequenceDiagram":100,"./sequenceDb":101,"./svgDraw":103}],103:[function(require,module,exports){ /** * Created by knut on 14-12-20. */ @@ -29421,6 +29991,26 @@ exports.drawActor = function (elem, left, verticalPos, description, conf) { .attr('x', center).attr('y', verticalPos + conf.height / 2 + 5).attr('class', 'actor').style('text-anchor', 'middle').text(description); }; +exports.anchorElement = function (elem) { + return elem.append('g'); +}; +/** + * Draws an actor in the diagram with the attaced line + * @param elem - element to append activation rect + * @param bounds - activation box bounds + * @param verticalPos - precise y cooridnate of bottom activation box edge + */ +exports.drawActivation = function (elem, bounds, verticalPos) { + var rect = exports.getNoteRect(); + var g = bounds.anchored; + rect.x = bounds.startx; + rect.y = bounds.starty; + rect.fill = '#f4f4f4'; + rect.width = bounds.stopx - bounds.startx; + rect.height = verticalPos - bounds.starty; + exports.drawRect(g, rect); +}; + /** * Draws an actor in the diagram with the attaced line * @param center - The center of the the actor @@ -29517,7 +30107,7 @@ exports.getNoteRect = function () { return rect; }; -},{}],125:[function(require,module,exports){ +},{}],104:[function(require,module,exports){ /** * #logger * logger = require('logger').create() @@ -29617,7 +30207,7 @@ function Log(level) { exports.Log = Log; -},{}],126:[function(require,module,exports){ +},{}],105:[function(require,module,exports){ (function (global){ /** * --- @@ -30154,7 +30744,7 @@ global.mermaidAPI = { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../package.json":105,"./d3":106,"./diagrams/classDiagram/classDb":107,"./diagrams/classDiagram/classRenderer":108,"./diagrams/classDiagram/parser/classDiagram":109,"./diagrams/example/exampleDb":110,"./diagrams/example/exampleRenderer":111,"./diagrams/example/parser/example":112,"./diagrams/flowchart/flowRenderer":114,"./diagrams/flowchart/graphDb":115,"./diagrams/flowchart/parser/dot":116,"./diagrams/flowchart/parser/flow":117,"./diagrams/gantt/ganttDb":118,"./diagrams/gantt/ganttRenderer":119,"./diagrams/gantt/parser/gantt":120,"./diagrams/sequenceDiagram/parser/sequenceDiagram":121,"./diagrams/sequenceDiagram/sequenceDb":122,"./diagrams/sequenceDiagram/sequenceRenderer":123,"./logger":125,"./utils":127}],127:[function(require,module,exports){ +},{"../package.json":84,"./d3":85,"./diagrams/classDiagram/classDb":86,"./diagrams/classDiagram/classRenderer":87,"./diagrams/classDiagram/parser/classDiagram":88,"./diagrams/example/exampleDb":89,"./diagrams/example/exampleRenderer":90,"./diagrams/example/parser/example":91,"./diagrams/flowchart/flowRenderer":93,"./diagrams/flowchart/graphDb":94,"./diagrams/flowchart/parser/dot":95,"./diagrams/flowchart/parser/flow":96,"./diagrams/gantt/ganttDb":97,"./diagrams/gantt/ganttRenderer":98,"./diagrams/gantt/parser/gantt":99,"./diagrams/sequenceDiagram/parser/sequenceDiagram":100,"./diagrams/sequenceDiagram/sequenceDb":101,"./diagrams/sequenceDiagram/sequenceRenderer":102,"./logger":104,"./utils":106}],106:[function(require,module,exports){ /** * Created by knut on 14-11-23. */ @@ -30294,5 +30884,5 @@ var cloneCssStyles = function cloneCssStyles(svg, classes) { exports.cloneCssStyles = cloneCssStyles; -},{"./logger":125}]},{},[126])(126) +},{"./logger":104}]},{},[105])(105) }); \ No newline at end of file diff --git a/dist/mermaidAPI.slim.min.js b/dist/mermaidAPI.slim.min.js index e1e61e3e8..80f2d4ff9 100644 --- a/dist/mermaidAPI.slim.min.js +++ b/dist/mermaidAPI.slim.min.js @@ -1,11 +1,14 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.mermaidAPI=t()}}(function(){var define,module,exports;return function t(e,n,r){function i(s,o){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!o&&u)return u(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};e[s][0].call(l.exports,function(t){var n=e[s][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[s].exports}for(var a="function"==typeof require&&require,s=0;s=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!i;a--){var s=a>=0?arguments[a]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(n=s+"/"+n,i="/"===s.charAt(0))}return n=e(r(n.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(t){var i=n.isAbsolute(t),a="/"===s(t,-1);return t=e(r(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(r(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function r(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),a=r(e.split("/")),s=Math.min(i.length,a.length),o=s,u=0;s>u;u++)if(i[u]!==a[u]){o=u;break}for(var c=[],u=o;ue&&(e=t.length+e),t.substr(e,n)}}).call(this,t("_process"))},{_process:3}],3:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.MutationObserver,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};var r=[];if(e){var i=document.createElement("div"),a=new MutationObserver(function(){var t=r.slice();r.length=0,t.forEach(function(t){t()})});return a.observe(i,{attributes:!0}),function(t){r.length||i.setAttribute("yes","no"),r.push(t)}}return n?(window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),r.length>0)){var n=r.shift();n()}},!0),function(t){r.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],4:[function(t,e){e.exports={graphlib:t("./lib/graphlib"),dagre:t("./lib/dagre"),intersect:t("./lib/intersect"),render:t("./lib/render"),util:t("./lib/util"),version:t("./lib/version")}},{"./lib/dagre":11,"./lib/graphlib":12,"./lib/intersect":13,"./lib/render":28,"./lib/util":30,"./lib/version":31}],5:[function(t,e){function n(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=i.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(s,n[r+"Style"])}function r(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=i.append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(s,n[r+"Style"])}function i(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=i.append("path").attr("d","M 0 5 L 10 5").style("stroke-width",1).style("stroke-dasharray","1,0");a.applyStyle(s,n[r+"Style"])}var a=t("./util");e.exports={"default":n,normal:n,vee:r,undirected:i}},{"./util":30}],6:[function(t,e){function n(t,e){var n=e.nodes().filter(function(t){return r.isSubgraph(e,t)}),a=t.selectAll("g.cluster").data(n,function(t){return t});return a.selectAll("*").remove(),a.enter().append("g").attr("class","cluster").attr("id",function(t){var n=e.node(t);return n.id}).style("opacity",0),r.applyTransition(a,e).style("opacity",1),a.each(function(t){var n=e.node(t),r=d3.select(this);d3.select(this).append("rect");var a=r.append("g").attr("class","label");i(a,n,n.clusterLabelPos)}),a.selectAll("rect").each(function(t){var n=e.node(t),i=d3.select(this);r.applyStyle(i,n.style)}),r.applyTransition(a.exit(),e).style("opacity",0).remove(),a}var r=t("./util"),i=t("./label/add-label");e.exports=n},{"./label/add-label":21,"./util":30}],7:[function(t,e){"use strict";function n(t,e){var n=t.selectAll("g.edgeLabel").data(e.edges(),function(t){return a.edgeToId(t)}).classed("update",!0);return n.selectAll("*").remove(),n.enter().append("g").classed("edgeLabel",!0).style("opacity",0),n.each(function(t){var n=e.edge(t),a=i(s.select(this),e.edge(t),0,0).classed("label",!0),o=a.node().getBBox();n.labelId&&a.attr("id",n.labelId),r.has(n,"width")||(n.width=o.width),r.has(n,"height")||(n.height=o.height)}),a.applyTransition(n.exit(),e).style("opacity",0).remove(),n}var r=t("./lodash"),i=t("./label/add-label"),a=t("./util"),s=t("./d3");e.exports=n},{"./d3":10,"./label/add-label":21,"./lodash":24,"./util":30}],8:[function(t,e){"use strict";function n(t,e,n){var i=t.selectAll("g.edgePath").data(e.edges(),function(t){return l.edgeToId(t)}).classed("update",!0);return s(i,e),o(i,e),l.applyTransition(i,e).style("opacity",1),i.each(function(t){var n=h.select(this),r=e.edge(t);r.elem=this,r.id&&n.attr("id",r.id),l.applyClass(n,r["class"],(n.classed("update")?"update ":"")+"edgePath")}),i.selectAll("path.path").each(function(t){var n=e.edge(t);n.arrowheadId=u.uniqueId("arrowhead");var i=h.select(this).attr("marker-end",function(){return"url(#"+n.arrowheadId+")"}).style("fill","none");l.applyTransition(i,e).attr("d",function(t){return r(e,t)}),l.applyStyle(i,n.style)}),i.selectAll("defs *").remove(),i.selectAll("defs").each(function(t){var r=e.edge(t),i=n[r.arrowhead];i(h.select(this),r.arrowheadId,r,"arrowhead")}),i}function r(t,e){var n=t.edge(e),r=t.node(e.v),a=t.node(e.w),s=n.points.slice(1,n.points.length-1);return s.unshift(c(r,s[0])),s.push(c(a,s[s.length-1])),i(n,s)}function i(t,e){var n=h.svg.line().x(function(t){return t.x}).y(function(t){return t.y});return u.has(t,"lineInterpolate")&&n.interpolate(t.lineInterpolate),u.has(t,"lineTension")&&n.tension(Number(t.lineTension)),n(e)}function a(t){var e=t.getBBox(),n=t.getTransformToElement(t.ownerSVGElement).translate(e.width/2,e.height/2);return{x:n.e,y:n.f}}function s(t,e){var n=t.enter().append("g").attr("class","edgePath").style("opacity",0);n.append("path").attr("class","path").attr("d",function(t){var n=e.edge(t),r=e.node(t.v).elem,s=u.range(n.points.length).map(function(){return a(r)});return i(n,s)}),n.append("defs")}function o(t,e){var n=t.exit();l.applyTransition(n,e).style("opacity",0).remove(),l.applyTransition(n.select("path.path"),e).attr("d",function(t){var n=e.node(t.v);if(n){var r=u.range(this.pathSegList.length).map(function(){return n});return i({},r)}return h.select(this).attr("d")})}var u=t("./lodash"),c=t("./intersect/intersect-node"),l=t("./util"),h=t("./d3");e.exports=n},{"./d3":10,"./intersect/intersect-node":17,"./lodash":24,"./util":30}],9:[function(t,e){"use strict";function n(t,e,n){var o=e.nodes().filter(function(t){return!a.isSubgraph(e,t)}),u=t.selectAll("g.node").data(o,function(t){return t}).classed("update",!0);return u.selectAll("*").remove(),u.enter().append("g").attr("class","node").style("opacity",0),u.each(function(t){var o=e.node(t),u=s.select(this),c=u.append("g").attr("class","label"),l=i(c,o),h=n[o.shape],d=r.pick(l.node().getBBox(),"width","height");o.elem=this,o.id&&u.attr("id",o.id),o.labelId&&c.attr("id",o.labelId),a.applyClass(u,o["class"],(u.classed("update")?"update ":"")+"node"),r.has(o,"width")&&(d.width=o.width),r.has(o,"height")&&(d.height=o.height),d.width+=o.paddingLeft+o.paddingRight,d.height+=o.paddingTop+o.paddingBottom,c.attr("transform","translate("+(o.paddingLeft-o.paddingRight)/2+","+(o.paddingTop-o.paddingBottom)/2+")");var f=h(s.select(this),d,o);a.applyStyle(f,o.style);var p=f.node().getBBox();o.width=p.width,o.height=p.height}),a.applyTransition(u.exit(),e).style("opacity",0).remove(),u}var r=t("./lodash"),i=t("./label/add-label"),a=t("./util"),s=t("./d3");e.exports=n},{"./d3":10,"./label/add-label":21,"./lodash":24,"./util":30}],10:[function(t,e){e.exports=window.d3},{}],11:[function(t,e){var n;if(t)try{n=t("dagre")}catch(r){}n||(n=window.dagre),e.exports=n},{dagre:53}],12:[function(t,e){var n;if(t)try{n=t("graphlib")}catch(r){}n||(n=window.graphlib),e.exports=n},{graphlib:32}],13:[function(t,e){e.exports={node:t("./intersect-node"),circle:t("./intersect-circle"),ellipse:t("./intersect-ellipse"),polygon:t("./intersect-polygon"),rect:t("./intersect-rect")}},{"./intersect-circle":14,"./intersect-ellipse":15,"./intersect-node":17,"./intersect-polygon":18,"./intersect-rect":19}],14:[function(t,e){function n(t,e,n){return r(t,e,e,n)}var r=t("./intersect-ellipse");e.exports=n},{"./intersect-ellipse":15}],15:[function(t,e){function n(t,e,n,r){var i=t.x,a=t.y,s=i-r.x,o=a-r.y,u=Math.sqrt(e*e*o*o+n*n*s*s),c=Math.abs(e*n*s/u);r.xm?(m-y)/g:(m+y)/g,m=s*c-a*l,_=0>m?(m-y)/g:(m+y)/g,{x:v,y:_})}function r(t,e){return t*e>0}e.exports=n},{}],17:[function(t,e){function n(t,e){return t.intersect(e)}e.exports=n},{}],18:[function(t,e){function n(t,e,n){var i=t.x,a=t.y,s=[],o=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY;e.forEach(function(t){o=Math.min(o,t.x),u=Math.min(u,t.y)});for(var c=i-t.width/2-o,l=a-t.height/2-u,h=0;h1&&s.sort(function(t,e){var r=t.x-n.x,i=t.y-n.y,a=Math.sqrt(r*r+i*i),s=e.x-n.x,o=e.y-n.y,u=Math.sqrt(s*s+o*o);return u>a?-1:a===u?0:1}),s[0]):(console.log("NO INTERSECTION FOUND, RETURN NODE CENTER",t),t)}var r=t("./intersect-line");e.exports=n},{"./intersect-line":16}],19:[function(t,e){function n(t,e){var n,r,i=t.x,a=t.y,s=e.x-i,o=e.y-a,u=t.width/2,c=t.height/2;return Math.abs(o)*u>Math.abs(s)*c?(0>o&&(c=-c),n=0===o?0:c*s/o,r=c):(0>s&&(u=-u),n=u,r=0===s?0:u*o/s),{x:i+n,y:a+r}}e.exports=n},{}],20:[function(t,e){function n(t,e){var n=t.append("foreignObject").attr("width","100000"),i=n.append("xhtml:div"),a=e.label;switch(typeof a){case"function":i.insert(a);break;case"object":i.insert(function(){return a});break;default:i.html(a)}r.applyStyle(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap");var s,o;return i.each(function(){s=this.clientWidth,o=this.clientHeight}),n.attr("width",s).attr("height",o),n}var r=t("../util");e.exports=n},{"../util":30}],21:[function(t,e){function n(t,e,n){var s=e.label,o=t.append("g");"svg"===e.labelType?a(o,e):"string"!=typeof s||"html"===e.labelType?i(o,e):r(o,e);var u,c=o.node().getBBox();switch(n){case"top":u=-e.height/2;break;case"bottom":u=e.height/2-c.height;break;default:u=-c.height/2}return o.attr("transform","translate("+-c.width/2+","+u+")"),o}var r=t("./add-text-label"),i=t("./add-html-label"),a=t("./add-svg-label");e.exports=n},{"./add-html-label":20,"./add-svg-label":22,"./add-text-label":23}],22:[function(t,e){function n(t,e){var n=t;return n.node().appendChild(e.label),r.applyStyle(n,e.labelStyle),n}var r=t("../util");e.exports=n},{"../util":30}],23:[function(t,e){function n(t,e){for(var n=t.append("text"),a=r(e.label).split("\n"),s=0;sa)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+a);c0&&(i=u.removeMin(),s=o[i],s.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(c);return o}var i=t("../lodash"),a=t("../data/priority-queue");e.exports=n;var s=i.constant(1)},{"../data/priority-queue":46,"../lodash":50}],37:[function(t,e){function n(t){return r.filter(i(t),function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})}var r=t("../lodash"),i=t("./tarjan");e.exports=n},{"../lodash":50,"./tarjan":44}],38:[function(t,e){function n(t,e,n){return r(t,e||a,n||function(e){return t.outEdges(e)})}function r(t,e,n){var r={},i=t.nodes();return i.forEach(function(t){r[t]={},r[t][t]={distance:0},i.forEach(function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})}),n(t).forEach(function(n){var i=n.v===t?n.w:n.v,a=e(n);r[t][i]={distance:a,predecessor:t}})}),i.forEach(function(t){var e=r[t];i.forEach(function(n){var a=r[n];i.forEach(function(n){var r=a[t],i=e[n],s=a[n],o=r.distance+i.distance;oi&&(u[n]=s,c.decrease(n,i))}}var s,o=new i,u={},c=new a;if(0===t.nodeCount())return o;r.each(t.nodes(),function(t){c.add(t,Number.POSITIVE_INFINITY),o.setNode(t)}),c.decrease(t.nodes()[0],0);for(var l=!1;c.size()>0;){if(s=c.removeMin(),r.has(u,s))o.setEdge(s,u[s]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(s).forEach(n)}return o}var r=t("../lodash"),i=t("../graph"),a=t("../data/priority-queue");e.exports=n},{"../data/priority-queue":46,"../graph":47,"../lodash":50}],44:[function(t,e){function n(t){function e(o){var u=a[o]={onStack:!0,lowlink:n,index:n++};if(i.push(o),t.successors(o).forEach(function(t){r.has(a,t)?a[t].onStack&&(u.lowlink=Math.min(u.lowlink,a[t].index)):(e(t),u.lowlink=Math.min(u.lowlink,a[t].lowlink))}),u.lowlink===u.index){var c,l=[];do c=i.pop(),a[c].onStack=!1,l.push(c);while(o!==c);s.push(l)}}var n=0,i=[],a={},s=[];return t.nodes().forEach(function(t){r.has(a,t)||e(t)}),s}var r=t("../lodash");e.exports=n},{"../lodash":50}],45:[function(t,e){function n(t){function e(o){if(i.has(a,o))throw new r;i.has(n,o)||(a[o]=!0,n[o]=!0,i.each(t.predecessors(o),e),delete a[o],s.push(o))}var n={},a={},s=[];if(i.each(t.sinks(),e),i.size(n)!==t.nodeCount())throw new r;return s}function r(){}var i=t("../lodash");e.exports=n,n.CycleException=r},{"../lodash":50}],46:[function(t,e){function n(){this._arr=[],this._keyIndices={}}var r=t("../lodash");e.exports=n,n.prototype.size=function(){return this._arr.length},n.prototype.keys=function(){return this._arr.map(function(t){return t.key})},n.prototype.has=function(t){return r.has(this._keyIndices,t)},n.prototype.priority=function(t){var e=this._keyIndices[t];return void 0!==e?this._arr[e].priority:void 0},n.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},n.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,a=i.length;return n[t]=a,i.push({key:t,priority:e}),this._decrease(a),!0}return!1},n.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},n.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},n.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n>1,!(n[e].prioritya){var s=i;i=a,a=s}return i+h+a+h+(u.isUndefined(r)?c:r)}function s(t,e,n,r){var i=""+e,a=""+n;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return r&&(o.name=r),o}function o(t,e){return a(t,e.v,e.w,e.name)}var u=t("./lodash");e.exports=n;var c="\x00",l="\x00",h="";n.prototype._nodeCount=0,n.prototype._edgeCount=0,n.prototype.isDirected=function(){return this._isDirected},n.prototype.isMultigraph=function(){return this._isMultigraph},n.prototype.isCompound=function(){return this._isCompound},n.prototype.setGraph=function(t){return this._label=t,this},n.prototype.graph=function(){return this._label},n.prototype.setDefaultNodeLabel=function(t){return u.isFunction(t)||(t=u.constant(t)),this._defaultNodeLabelFn=t,this},n.prototype.nodeCount=function(){return this._nodeCount},n.prototype.nodes=function(){return u.keys(this._nodes)},n.prototype.sources=function(){return u.filter(this.nodes(),function(t){return u.isEmpty(this._in[t])},this)},n.prototype.sinks=function(){return u.filter(this.nodes(),function(t){return u.isEmpty(this._out[t])},this)},n.prototype.setNodes=function(t,e){var n=arguments;return u.each(t,function(t){n.length>1?this.setNode(t,e):this.setNode(t)},this),this},n.prototype.setNode=function(t,e){return u.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=l,this._children[t]={},this._children[l][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},n.prototype.node=function(t){return this._nodes[t]},n.prototype.hasNode=function(t){return u.has(this._nodes,t)},n.prototype.removeNode=function(t){var e=this;if(u.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],u.each(this.children(t),function(t){this.setParent(t)},this),delete this._children[t]),u.each(u.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],u.each(u.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},n.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(u.isUndefined(e))e=l;else{e+="";for(var n=e;!u.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},n.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},n.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==l)return e}},n.prototype.children=function(t){if(u.isUndefined(t)&&(t=l),this._isCompound){var e=this._children[t];if(e)return u.keys(e)}else{if(t===l)return this.nodes();if(this.hasNode(t))return[]}},n.prototype.predecessors=function(t){var e=this._preds[t];return e?u.keys(e):void 0},n.prototype.successors=function(t){var e=this._sucs[t];return e?u.keys(e):void 0},n.prototype.neighbors=function(t){var e=this.predecessors(t);return e?u.union(e,this.successors(t)):void 0},n.prototype.filterNodes=function(t){function e(t){var a=r.parent(t);return void 0===a||n.hasNode(a)?(i[t]=a,a):a in i?i[a]:e(a)}var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph()),u.each(this._nodes,function(e,r){t(r)&&n.setNode(r,e)},this),u.each(this._edgeObjs,function(t){n.hasNode(t.v)&&n.hasNode(t.w)&&n.setEdge(t,this.edge(t))},this);var r=this,i={};return this._isCompound&&u.each(n.nodes(),function(t){n.setParent(t,e(t))}),n},n.prototype.setDefaultEdgeLabel=function(t){return u.isFunction(t)||(t=u.constant(t)),this._defaultEdgeLabelFn=t,this},n.prototype.edgeCount=function(){return this._edgeCount},n.prototype.edges=function(){return u.values(this._edgeObjs)},n.prototype.setPath=function(t,e){var n=this,r=arguments;return u.reduce(t,function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i}),this},n.prototype.setEdge=function(){var t,e,n,i,o=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(t=c.v,e=c.w,n=c.name,2===arguments.length&&(i=arguments[1],o=!0)):(t=c,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,e=""+e,u.isUndefined(n)||(n=""+n);var l=a(this._isDirected,t,e,n);if(u.has(this._edgeLabels,l))return o&&(this._edgeLabels[l]=i),this;if(!u.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=o?i:this._defaultEdgeLabelFn(t,e,n);var h=s(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[l]=h,r(this._preds[e],t),r(this._sucs[t],e),this._in[e][l]=h,this._out[t][l]=h,this._edgeCount++,this},n.prototype.edge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return this._edgeLabels[r]},n.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return u.has(this._edgeLabels,r)},n.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n),s=this._edgeObjs[r];return s&&(t=s.v,e=s.w,delete this._edgeLabels[r],delete this._edgeObjs[r],i(this._preds[e],t),i(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},n.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=u.values(n);return e?u.filter(r,function(t){return t.v===e}):r}},n.prototype.outEdges=function(t,e){var n=this._out[t];if(n){ -var r=u.values(n);return e?u.filter(r,function(t){return t.w===e}):r}},n.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);return n?n.concat(this.outEdges(t,e)):void 0}},{"./lodash":50}],48:[function(t,e){e.exports={Graph:t("./graph"),version:t("./version")}},{"./graph":47,"./version":51}],49:[function(t,e){function n(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:r(t),edges:i(t)};return s.isUndefined(t.graph())||(e.value=s.clone(t.graph())),e}function r(t){return s.map(t.nodes(),function(e){var n=t.node(e),r=t.parent(e),i={v:e};return s.isUndefined(n)||(i.value=n),s.isUndefined(r)||(i.parent=r),i})}function i(t){return s.map(t.edges(),function(e){var n=t.edge(e),r={v:e.v,w:e.w};return s.isUndefined(e.name)||(r.name=e.name),s.isUndefined(n)||(r.value=n),r})}function a(t){var e=new o(t.options).setGraph(t.value);return s.each(t.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),s.each(t.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}var s=t("./lodash"),o=t("./graph");e.exports={write:n,read:a}},{"./graph":47,"./lodash":50}],50:[function(t,e){var n;if("function"==typeof t)try{n=t("lodash")}catch(r){}n||(n=window._),e.exports=n},{lodash:52}],51:[function(t,e){e.exports="1.0.7"},{}],52:[function(t,e,n){(function(t){(function(){function r(t,e){if(t!==e){var n=null===t,r=t===E,i=t===t,a=null===e,s=e===E,o=e===e;if(t>e&&!a||!i||n&&!s&&o||r&&o)return 1;if(e>t&&!n||!o||a&&!r&&i||s&&i)return-1}return 0}function i(t,e,n){for(var r=t.length,i=n?r:-1;n?i--:++i-1;);return n}function c(t,e){for(var n=t.length;n--&&e.indexOf(t.charAt(n))>-1;);return n}function l(t,e){return r(t.criteria,e.criteria)||t.index-e.index}function h(t,e,n){for(var i=-1,a=t.criteria,s=e.criteria,o=a.length,u=n.length;++i=u)return c;var l=n[i];return c*("asc"===l||l===!0?1:-1)}}return t.index-e.index}function d(t){return Wt[t]}function f(t){return Vt[t]}function p(t,e,n){return e?t=qt[t]:n&&(t=Xt[t]),"\\"+t}function g(t){return"\\"+Xt[t]}function y(t,e,n){for(var r=t.length,i=e+(n?0:-1);n?i--:++i=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function _(t,e){for(var n=-1,r=t.length,i=-1,a=[];++ne,i=n?t.length:0,a=Hn(0,i,this.__views__),s=a.start,o=a.end,u=o-s,c=r?o:s-1,l=this.__iteratees__,h=l.length,d=0,f=xs(u,this.__takeCount__);if(!n||Y>i||i==u&&f==u)return nn(r&&n?t.reverse():t,this.__actions__);var p=[];t:for(;u--&&f>d;){c+=e;for(var g=-1,y=t[c];++g=Y?gn(e):null,c=e.length;u&&(s=Kt,o=!1,e=u);t:for(;++in&&(n=-n>i?0:i+n),r=r===E||r>i?i:+r||0,0>r&&(r+=i),i=n>r?0:r>>>0,n>>>=0;i>n;)t[n++]=e;return t}function Ce(t,e){var n=[];return Ls(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function Fe(t,e,n,r){var i;return n(t,function(t,n,a){return e(t,n,a)?(i=r?n:t,!1):void 0}),i}function Te(t,e,n,r){r||(r=[]);for(var i=-1,a=t.length;++ir;)t=t[e[r++]];return r&&r==i?t:E}}function Le(t,e,n,r,i,a){return t===e?!0:null==t||null==e||!Mi(t)&&!m(e)?t!==t&&e!==e:Ne(t,e,Le,n,r,i,a)}function Ne(t,e,n,r,i,a,s){var o=To(t),u=To(e),c=H,l=H;o||(c=ns.call(t),c==V?c=J:c!=J&&(o=Gi(t))),u||(l=ns.call(e),l==V?l=J:l!=J&&(u=Gi(e)));var h=c==J,d=l==J,f=c==l;if(f&&!o&&!h)return jn(t,e,c);if(!i){var p=h&&ts.call(t,"__wrapped__"),g=d&&ts.call(e,"__wrapped__");if(p||g)return n(p?t.value():t,g?e.value():e,r,i,a,s)}if(!f)return!1;a||(a=[]),s||(s=[]);for(var y=a.length;y--;)if(a[y]==t)return s[y]==e;a.push(t),s.push(e);var m=(o?Rn:Yn)(t,e,n,r,i,a,s);return a.pop(),s.pop(),m}function Pe(t,e,n){var r=e.length,i=r,a=!n;if(null==t)return!i;for(t=hr(t);r--;){var s=e[r];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++re&&(e=-e>i?0:i+e),n=n===E||n>i?i:+n||0,0>n&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=Ya(i);++r=Y,u=o?gn():null,c=[];u?(r=Kt,s=!1):(o=!1,u=e?[]:c);t:for(;++n=i){for(;i>r;){var a=r+i>>>1,s=t[a];(n?e>=s:e>s)&&null!==s?r=a+1:i=a}return i}return an(t,e,Ca,n)}function an(t,e,n,r){e=n(e);for(var i=0,a=t?t.length:0,s=e!==e,o=null===e,u=e===E;a>i;){var c=ms((i+a)/2),l=n(t[c]),h=l!==E,d=l===l;if(s)var f=d||r;else f=o?d&&h&&(r||null!=l):u?d&&(r||h):null==l?!1:r?e>=l:e>l;f?i=c+1:a=c}return xs(a,Ts)}function sn(t,e,n){if("function"!=typeof t)return Ca;if(e===E)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,a){return t.call(e,n,r,i,a)};case 5:return function(n,r,i,a,s){return t.call(e,n,r,i,a,s)}}return function(){return t.apply(e,arguments)}}function on(t){var e=new as(t.byteLength),n=new fs(e);return n.set(new fs(t)),e}function un(t,e,n){for(var r=n.length,i=-1,a=As(t.length-r,0),s=-1,o=e.length,u=Ya(o+a);++s2?n[i-2]:E,s=i>2?n[2]:E,o=i>1?n[i-1]:E;for("function"==typeof a?(a=sn(a,o,5),i-=2):(a="function"==typeof o?o:E,i-=a?1:0),s&&Jn(n[0],n[1],s)&&(a=3>i?E:a,i=1);++r-1?n[s]:E}return Fe(n,r,t)}}function xn(t){return function(e,n,r){return e&&e.length?(n=$n(n,r,3),i(e,n,t)):-1}}function wn(t){return function(e,n,r){return n=$n(n,r,3),Fe(e,n,t,!0)}}function kn(t){return function(){for(var e,n=arguments.length,r=t?n:-1,i=0,a=Ya(n);t?r--:++r=Y)return e.plant(r).value();for(var i=0,s=n?a[i].apply(this,t):r;++iv){var k=o?te(o):E,D=As(c-v,0),T=p?w:E,S=p?E:w,B=p?A:E,M=p?E:A;e|=p?I:O,e&=~(p?O:I),g||(e&=~(C|F));var L=[t,e,n,B,T,M,S,k,u,D],N=In.apply(E,L);return er(t)&&Us(N,L),N.placeholder=x,N}}var P=d?n:this,R=f?P[t]:t;return o&&(A=ur(A,o)),h&&u=e||!_s(e))return"";var i=e-r;return n=null==n?" ":n+"",ya(n,gs(i/n.length)).slice(0,i)}function Mn(t,e,n,r){function i(){for(var e=-1,o=arguments.length,u=-1,c=r.length,l=Ya(c+o);++uu))return!1;for(;++o-1&&t%1==0&&e>t}function Jn(t,e,n){if(!Mi(n))return!1;var r=typeof e;if("number"==r?Kn(n)&&Qn(e,n.length):"string"==r&&e in n){var i=n[e];return t===t?t===i:i!==i}return!1}function tr(t,e){var n=typeof t;if("string"==n&&Et.test(t)||"number"==n)return!0;if(To(t))return!1;var r=!kt.test(t);return r||null!=e&&t in hr(e)}function er(t){var n=Un(t);if(!(n in K.prototype))return!1;var r=e[n];if(t===r)return!0;var i=Ys(r);return!!i&&t===i[0]}function nr(t){return"number"==typeof t&&t>-1&&t%1==0&&Bs>=t}function rr(t){return t===t&&!Mi(t)}function ir(t,e){var n=t[1],r=e[1],i=n|r,a=M>i,s=r==M&&n==S||r==M&&n==L&&t[7].length<=e[8]||r==(M|L)&&n==S;if(!a&&!s)return t;r&C&&(t[2]=e[2],i|=n&C?0:T);var o=e[3];if(o){var u=t[3];t[3]=u?un(u,o,e[4]):te(o),t[4]=u?_(t[3],W):te(e[4])}return o=e[5],o&&(u=t[5],t[5]=u?cn(u,o,e[6]):te(o),t[6]=u?_(t[5],W):te(e[6])),o=e[7],o&&(t[7]=te(o)),r&M&&(t[8]=null==t[8]?e[8]:xs(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}function ar(t,e){return t===E?e:So(t,e,ar)}function sr(t,e){t=hr(t);for(var n=-1,r=e.length,i={};++nr;)s[++a]=qe(t,r,r+=e);return s}function gr(t){for(var e=-1,n=t?t.length:0,r=-1,i=[];++ee?0:e)):[]}function mr(t,e,n){var r=t?t.length:0;return r?((n?Jn(t,e,n):null==e)&&(e=1),e=r-(+e||0),qe(t,0,0>e?0:e)):[]}function vr(t,e,n){return t&&t.length?en(t,$n(e,n,3),!0,!0):[]}function _r(t,e,n){return t&&t.length?en(t,$n(e,n,3),!0):[]}function br(t,e,n,r){var i=t?t.length:0;return i?(n&&"number"!=typeof n&&Jn(t,e,n)&&(n=0,r=i),De(t,e,n,r)):[]}function Ar(t){return t?t[0]:E}function xr(t,e,n){var r=t?t.length:0;return n&&Jn(t,e,n)&&(e=!1),r?Te(t,e):[]}function wr(t){var e=t?t.length:0;return e?Te(t,!0):[]}function kr(t,e,n){var r=t?t.length:0;if(!r)return-1;if("number"==typeof n)n=0>n?As(r+n,0):n;else if(n){var i=rn(t,e);return r>i&&(e===e?e===t[i]:t[i]!==t[i])?i:-1}return a(t,e,n||0)}function Er(t){return mr(t,1)}function Dr(t){var e=t?t.length:0;return e?t[e-1]:E}function Cr(t,e,n){var r=t?t.length:0;if(!r)return-1;var i=r;if("number"==typeof n)i=(0>n?As(r+n,0):xs(n||0,r-1))+1;else if(n){i=rn(t,e,!0)-1;var a=t[i];return(e===e?e===a:a!==a)?i:-1}if(e!==e)return y(t,i,!0);for(;i--;)if(t[i]===e)return i;return-1}function Fr(){var t=arguments,e=t[0];if(!e||!e.length)return e;for(var n=0,r=Gn(),i=t.length;++n-1;)ds.call(e,a,1);return e}function Tr(t,e,n){var r=[];if(!t||!t.length)return r;var i=-1,a=[],s=t.length;for(e=$n(e,n,3);++ie?0:e)):[]}function Or(t,e,n){var r=t?t.length:0;return r?((n?Jn(t,e,n):null==e)&&(e=1),e=r-(+e||0),qe(t,0>e?0:e)):[]}function Mr(t,e,n){return t&&t.length?en(t,$n(e,n,3),!1,!0):[]}function Lr(t,e,n){return t&&t.length?en(t,$n(e,n,3)):[]}function Nr(t,e,n,r){var i=t?t.length:0;if(!i)return[];null!=e&&"boolean"!=typeof e&&(r=n,n=Jn(t,e,r)?E:e,e=!1);var s=$n();return(null!=n||s!==be)&&(n=s(n,r,3)),e&&Gn()==a?b(t,n):Je(t,n)}function Pr(t){if(!t||!t.length)return[];var e=-1,n=0;t=oe(t,function(t){return Kn(t)?(n=As(t.length,n),!0):void 0});for(var r=Ya(n);++en?As(i+n,0):n||0,"string"==typeof t||!To(t)&&Ui(t)?i>=n&&t.indexOf(e,n)>-1:!!i&&Gn(t,e,n)>-1}function ti(t,e,n){var r=To(t)?ue:Re;return e=$n(e,n,3),r(t,e)}function ei(t,e){return ti(t,Oa(e))}function ni(t,e,n){var r=To(t)?oe:Ce;return e=$n(e,n,3),r(t,function(t,n,r){return!e(t,n,r)})}function ri(t,e,n){if(n?Jn(t,e,n):null==e){t=lr(t);var r=t.length;return r>0?t[He(0,r-1)]:E}var i=-1,a=zi(t),r=a.length,s=r-1;for(e=xs(0>e?0:+e||0,r);++i0&&(n=e.apply(this,arguments)),1>=t&&(e=E),n}}function fi(t,e,n){function r(){f&&ss(f),c&&ss(c),g=0,c=f=p=E}function i(e,n){n&&ss(n),c=f=p=E,e&&(g=go(),l=t.apply(d,u),f||c||(u=d=E))}function a(){var t=e-(go()-h);0>=t||t>e?i(p,c):f=hs(a,t)}function s(){i(m,f)}function o(){if(u=arguments,h=go(),d=this,p=m&&(f||!v),y===!1)var n=v&&!f;else{c||v||(g=h);var r=y-(h-g),i=0>=r||r>y;i?(c&&(c=ss(c)),g=h,l=t.apply(d,u)):c||(c=hs(s,r))}return i&&f?f=ss(f):f||e===y||(f=hs(a,e)),n&&(i=!0,l=t.apply(d,u)),!i||f||c||(u=d=E),l}var u,c,l,h,d,f,p,g=0,y=!1,m=!0;if("function"!=typeof t)throw new Xa(G);if(e=0>e?0:+e||0,n===!0){var v=!0;m=!1}else Mi(n)&&(v=!!n.leading,y="maxWait"in n&&As(+n.maxWait||0,e),m="trailing"in n?!!n.trailing:m);return o.cancel=r,o}function pi(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new Xa(G);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var s=t.apply(this,r);return n.cache=a.set(i,s),s};return n.cache=new pi.Cache,n}function gi(t){if("function"!=typeof t)throw new Xa(G);return function(){return!t.apply(this,arguments)}}function yi(t){return di(2,t)}function mi(t,e){if("function"!=typeof t)throw new Xa(G);return e=As(e===E?t.length-1:+e||0,0),function(){for(var n=arguments,r=-1,i=As(n.length-e,0),a=Ya(i);++re}function ki(t,e){return t>=e}function Ei(t){return m(t)&&Kn(t)&&ts.call(t,"callee")&&!cs.call(t,"callee")}function Di(t){return t===!0||t===!1||m(t)&&ns.call(t)==z}function Ci(t){return m(t)&&ns.call(t)==q}function Fi(t){return!!t&&1===t.nodeType&&m(t)&&!Yi(t)}function Ti(t){return null==t?!0:Kn(t)&&(To(t)||Ui(t)||Ei(t)||m(t)&&Oi(t.splice))?!t.length:!Yo(t).length}function Si(t,e,n,r){n="function"==typeof n?sn(n,r,3):E;var i=n?n(t,e):E;return i===E?Le(t,e,n):!!i}function Bi(t){return m(t)&&"string"==typeof t.message&&ns.call(t)==X}function Ii(t){return"number"==typeof t&&_s(t)}function Oi(t){return Mi(t)&&ns.call(t)==Z}function Mi(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Li(t,e,n,r){return n="function"==typeof n?sn(n,r,3):E,Pe(t,Wn(e),n)}function Ni(t){return ji(t)&&t!=+t}function Pi(t){return null==t?!1:Oi(t)?is.test(Ja.call(t)):m(t)&&Mt.test(t)}function Ri(t){return null===t}function ji(t){return"number"==typeof t||m(t)&&ns.call(t)==Q}function Yi(t){var e;if(!m(t)||ns.call(t)!=J||Ei(t)||!ts.call(t,"constructor")&&(e=t.constructor,"function"==typeof e&&!(e instanceof e)))return!1;var n;return Se(t,function(t,e){n=e}),n===E||ts.call(t,n)}function $i(t){return Mi(t)&&ns.call(t)==tt}function Ui(t){return"string"==typeof t||m(t)&&ns.call(t)==nt}function Gi(t){return m(t)&&nr(t.length)&&!!Ut[ns.call(t)]}function Wi(t){return t===E}function Vi(t,e){return e>t}function Hi(t,e){return e>=t}function zi(t){var e=t?$s(t):0;return nr(e)?e?te(t):[]:aa(t)}function qi(t){return _e(t,ta(t))}function Xi(t,e,n){var r=Ms(t);return n&&Jn(t,e,n)&&(e=E),e?me(r,e):r}function Zi(t){return Oe(t,ta(t))}function Ki(t,e,n){var r=null==t?E:Me(t,dr(e),e+"");return r===E?n:r}function Qi(t,e){if(null==t)return!1;var n=ts.call(t,e);if(!n&&!tr(e)){if(e=dr(e),t=1==e.length?t:Me(t,qe(e,0,-1)),null==t)return!1;e=Dr(e),n=ts.call(t,e)}return n||nr(t.length)&&Qn(e,t.length)&&(To(t)||Ei(t))}function Ji(t,e,n){n&&Jn(t,e,n)&&(e=E);for(var r=-1,i=Yo(t),a=i.length,s={};++r0;++rm?(m-y)/g:(m+y)/g,m=s*c-a*l,_=0>m?(m-y)/g:(m+y)/g,{x:v,y:_})}function r(t,e){return t*e>0}e.exports=n},{}],15:[function(t,e){function n(t,e){return t.intersect(e)}e.exports=n},{}],16:[function(t,e){function n(t,e,n){var i=t.x,a=t.y,s=[],o=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY;e.forEach(function(t){o=Math.min(o,t.x),u=Math.min(u,t.y)});for(var c=i-t.width/2-o,l=a-t.height/2-u,h=0;h1&&s.sort(function(t,e){var r=t.x-n.x,i=t.y-n.y,a=Math.sqrt(r*r+i*i),s=e.x-n.x,o=e.y-n.y,u=Math.sqrt(s*s+o*o);return u>a?-1:a===u?0:1}),s[0]):(console.log("NO INTERSECTION FOUND, RETURN NODE CENTER",t),t)}var r=t("./intersect-line");e.exports=n},{"./intersect-line":14}],17:[function(t,e){function n(t,e){var n,r,i=t.x,a=t.y,s=e.x-i,o=e.y-a,u=t.width/2,c=t.height/2;return Math.abs(o)*u>Math.abs(s)*c?(0>o&&(c=-c),n=0===o?0:c*s/o,r=c):(0>s&&(u=-u),n=u,r=0===s?0:u*o/s),{x:i+n,y:a+r}}e.exports=n},{}],18:[function(t,e){function n(t,e){var n=t.append("foreignObject").attr("width","100000"),i=n.append("xhtml:div"),a=e.label;switch(typeof a){case"function":i.insert(a);break;case"object":i.insert(function(){return a});break;default:i.html(a)}r.applyStyle(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap");var s,o;return i.each(function(){s=this.clientWidth,o=this.clientHeight}),n.attr("width",s).attr("height",o),n}var r=t("../util");e.exports=n},{"../util":28}],19:[function(t,e){function n(t,e,n){var s=e.label,o=t.append("g");"svg"===e.labelType?a(o,e):"string"!=typeof s||"html"===e.labelType?i(o,e):r(o,e);var u,c=o.node().getBBox();switch(n){case"top":u=-e.height/2;break;case"bottom":u=e.height/2-c.height;break;default:u=-c.height/2}return o.attr("transform","translate("+-c.width/2+","+u+")"),o}var r=t("./add-text-label"),i=t("./add-html-label"),a=t("./add-svg-label");e.exports=n},{"./add-html-label":18,"./add-svg-label":20,"./add-text-label":21}],20:[function(t,e){function n(t,e){var n=t;return n.node().appendChild(e.label),r.applyStyle(n,e.labelStyle),n}var r=t("../util");e.exports=n},{"../util":28}],21:[function(t,e){function n(t,e){for(var n=t.append("text"),a=r(e.label).split("\n"),s=0;so;++o)r(t,"borderLeft","_bl",n,s,o),r(t,"borderRight","_br",n,s,o)}}i.each(t.children(),e)}function r(t,e,n,r,i,s){var o={width:0,height:0,rank:s,borderType:e},u=i[e][s-1],c=a.addDummyNode(t,"border",o,n);i[e][s]=c,t.setParent(c,r),u&&t.setEdge(u,c,{weight:1})}var i=t("./lodash"),a=t("./util");e.exports=n},{"./lodash":39,"./util":58}],33:[function(t,e){"use strict";function n(t){var e=t.graph().rankdir.toLowerCase();("lr"===e||"rl"===e)&&i(t)}function r(t){var e=t.graph().rankdir.toLowerCase();("bt"===e||"rl"===e)&&s(t),("lr"===e||"rl"===e)&&(u(t),i(t))}function i(t){l.each(t.nodes(),function(e){a(t.node(e))}),l.each(t.edges(),function(e){a(t.edge(e))})}function a(t){var e=t.width;t.width=t.height,t.height=e}function s(t){l.each(t.nodes(),function(e){o(t.node(e))}),l.each(t.edges(),function(e){var n=t.edge(e);l.each(n.points,o),l.has(n,"y")&&o(n)})}function o(t){t.y=-t.y}function u(t){l.each(t.nodes(),function(e){c(t.node(e))}),l.each(t.edges(),function(e){var n=t.edge(e);l.each(n.points,c),l.has(n,"x")&&c(n)})}function c(t){var e=t.x;t.x=t.y,t.y=e}var l=t("./lodash");e.exports={adjust:n,undo:r}},{"./lodash":39}],34:[function(t,e){function n(){var t={};t._next=t._prev=t,this._sentinel=t}function r(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function i(t,e){return"_next"!==t&&"_prev"!==t?e:void 0}e.exports=n,n.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;return e!==t?(r(e),e):void 0},n.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&r(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},n.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,i)),n=n._prev;return"["+t.join(", ")+"]"}},{}],35:[function(t,e){function n(t){var e=i.buildLayerMatrix(t),n=new a({compound:!0,multigraph:!0}).setGraph({});return r.each(t.nodes(),function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)}),r.each(t.edges(),function(t){n.setEdge(t.v,t.w,{},t.name)}),r.each(e,function(t,e){var i="layer"+e;n.setNode(i,{rank:"same"}),r.reduce(t,function(t,e){return n.setEdge(t,e,{style:"invis"}),e})}),n}var r=t("./lodash"),i=t("./util"),a=t("./graphlib").Graph;e.exports={debugOrdering:n}},{"./graphlib":36,"./lodash":39,"./util":58}],36:[function(t,e){var n;if("function"==typeof t)try{n=t("graphlib")}catch(r){}n||(n=window.graphlib),e.exports=n},{graphlib:60}],37:[function(t,e){function n(t,e){if(t.nodeCount()<=1)return[];var n=a(t,e||l),i=r(n.graph,n.buckets,n.zeroIdx);return o.flatten(o.map(i,function(e){return t.outEdges(e.v,e.w)}),!0)}function r(t,e,n){for(var r,a=[],s=e[e.length-1],o=e[0];t.nodeCount();){for(;r=o.dequeue();)i(t,e,n,r);for(;r=s.dequeue();)i(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){a=a.concat(i(t,e,n,r,!0));break}}return a}function i(t,e,n,r,i){var a=i?[]:void 0;return o.each(t.inEdges(r.v),function(r){var o=t.edge(r),u=t.node(r.v);i&&a.push({v:r.v,w:r.w}),u.out-=o,s(e,n,u)}),o.each(t.outEdges(r.v),function(r){var i=t.edge(r),a=r.w,o=t.node(a);o["in"]-=i,s(e,n,o)}),t.removeNode(r.v),a}function a(t,e){var n=new u,r=0,i=0;o.each(t.nodes(),function(t){n.setNode(t,{v:t,"in":0,out:0})}),o.each(t.edges(),function(t){var a=n.edge(t.v,t.w)||0,s=e(t),o=a+s;n.setEdge(t.v,t.w,o),i=Math.max(i,n.node(t.v).out+=s),r=Math.max(r,n.node(t.w)["in"]+=s)});var a=o.range(i+r+3).map(function(){return new c}),l=r+1;return o.each(n.nodes(),function(t){s(a,l,n.node(t))}),{graph:n,buckets:a,zeroIdx:l}}function s(t,e,n){n.out?n["in"]?t[n.out-n["in"]+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}var o=t("./lodash"),u=t("./graphlib").Graph,c=t("./data/list");e.exports=n;var l=o.constant(1)},{"./data/list":34,"./graphlib":36,"./lodash":39}],38:[function(t,e){"use strict";function n(t,e){var n=e&&e.debugTiming?I.time:I.notime;n("layout",function(){var e=n(" buildLayoutGraph",function(){return a(t)});n(" runLayout",function(){r(e,n)}),n(" updateInputGraph",function(){i(t,e)})})}function r(t,e){e(" makeSpaceForEdgeLabels",function(){s(t)}),e(" removeSelfEdges",function(){g(t)}),e(" acyclic",function(){A.run(t)}),e(" nestingGraph.run",function(){T.run(t)}),e(" rank",function(){w(I.asNonCompoundGraph(t))}),e(" injectEdgeLabelProxies",function(){o(t)}),e(" removeEmptyRanks",function(){D(t)}),e(" nestingGraph.cleanup",function(){T.cleanup(t)}),e(" normalizeRanks",function(){k(t)}),e(" assignRankMinMax",function(){u(t)}),e(" removeEdgeLabelProxies",function(){c(t)}),e(" normalize.run",function(){x.run(t)}),e(" parentDummyChains",function(){E(t)}),e(" addBorderSegments",function(){C(t)}),e(" order",function(){S(t)}),e(" insertSelfEdges",function(){y(t)}),e(" adjustCoordinateSystem",function(){F.adjust(t)}),e(" position",function(){B(t)}),e(" positionSelfEdges",function(){m(t)}),e(" removeBorderNodes",function(){p(t)}),e(" normalize.undo",function(){x.undo(t)}),e(" fixupEdgeLabelCoords",function(){d(t)}),e(" undoCoordinateSystem",function(){F.undo(t)}),e(" translateGraph",function(){l(t)}),e(" assignNodeIntersects",function(){h(t)}),e(" reversePoints",function(){f(t)}),e(" acyclic.undo",function(){A.undo(t)})}function i(t,e){b.each(t.nodes(),function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))}),b.each(t.edges(),function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,b.has(i,"x")&&(r.x=i.x,r.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function a(t){var e=new O({multigraph:!0,compound:!0}),n=_(t.graph());return e.setGraph(b.merge({},L,v(n,M),b.pick(n,P))),b.each(t.nodes(),function(n){var r=_(t.node(n));e.setNode(n,b.defaults(v(r,N),R)),e.setParent(n,t.parent(n))}),b.each(t.edges(),function(n){var r=_(t.edge(n));e.setEdge(n,b.merge({},Y,v(r,j),b.pick(r,$)))}),e}function s(t){var e=t.graph();e.ranksep/=2,b.each(t.edges(),function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function o(t){b.each(t.edges(),function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-r.rank)/2+r.rank,e:e};I.addDummyNode(t,"edge-proxy",a,"_ep")}})}function u(t){var e=0;b.each(t.nodes(),function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=b.max(e,r.maxRank))}),t.graph().maxRank=e}function c(t){b.each(t.nodes(),function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}function l(t){function e(t){var e=t.x,s=t.y,o=t.width,u=t.height;n=Math.min(n,e-o/2),r=Math.max(r,e+o/2),i=Math.min(i,s-u/2),a=Math.max(a,s+u/2)}var n=Number.POSITIVE_INFINITY,r=0,i=Number.POSITIVE_INFINITY,a=0,s=t.graph(),o=s.marginx||0,u=s.marginy||0;b.each(t.nodes(),function(n){e(t.node(n))}),b.each(t.edges(),function(n){var r=t.edge(n);b.has(r,"x")&&e(r)}),n-=o,i-=u,b.each(t.nodes(),function(e){var r=t.node(e);r.x-=n,r.y-=i}),b.each(t.edges(),function(e){var r=t.edge(e);b.each(r.points,function(t){t.x-=n,t.y-=i}),b.has(r,"x")&&(r.x-=n),b.has(r,"y")&&(r.y-=i)}),s.width=r-n+o,s.height=a-i+u}function h(t){b.each(t.edges(),function(e){var n,r,i=t.edge(e),a=t.node(e.v),s=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=s,r=a),i.points.unshift(I.intersectRect(a,n)),i.points.push(I.intersectRect(s,r))})}function d(t){b.each(t.edges(),function(e){var n=t.edge(e);if(b.has(n,"x"))switch(("l"===n.labelpos||"r"===n.labelpos)&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}function f(t){b.each(t.edges(),function(e){var n=t.edge(e);n.reversed&&n.points.reverse()})}function p(t){b.each(t.nodes(),function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),a=t.node(b.last(n.borderLeft)),s=t.node(b.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),b.each(t.nodes(),function(e){"border"===t.node(e).dummy&&t.removeNode(e)})}function g(t){b.each(t.edges(),function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}function y(t){var e=I.buildLayerMatrix(t);b.each(e,function(e){var n=0;b.each(e,function(e,r){var i=t.node(e);i.order=r+n,b.each(i.selfEdges,function(e){I.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")}),delete i.selfEdges})})}function m(t){b.each(t.nodes(),function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,a=r.y,s=n.x-i,o=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],n.label.x=n.x,n.label.y=n.y}})}function v(t,e){return b.mapValues(b.pick(t,e),Number)}function _(t){var e={};return b.each(t,function(t,n){e[n.toLowerCase()]=t}),e}var b=t("./lodash"),A=t("./acyclic"),x=t("./normalize"),w=t("./rank"),k=t("./util").normalizeRanks,E=t("./parent-dummy-chains"),D=t("./util").removeEmptyRanks,T=t("./nesting-graph"),C=t("./add-border-segments"),F=t("./coordinate-system"),S=t("./order"),B=t("./position"),I=t("./util"),O=t("./graphlib").Graph;e.exports=n;var M=["nodesep","edgesep","ranksep","marginx","marginy"],L={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},P=["acyclicer","ranker","rankdir","align"],N=["width","height"],R={width:0,height:0},j=["minlen","weight","width","height","labeloffset"],Y={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},$=["labelpos"]},{"./acyclic":31,"./add-border-segments":32,"./coordinate-system":33,"./graphlib":36,"./lodash":39,"./nesting-graph":40,"./normalize":41,"./order":46,"./parent-dummy-chains":51,"./position":53,"./rank":55,"./util":58}],39:[function(t,e){var n;if("function"==typeof t)try{n=t("lodash")}catch(r){}n||(n=window._),e.exports=n},{lodash:80}],40:[function(t,e){function n(t){var e=u.addDummyNode(t,"root",{},"_root"),n=i(t),s=o.max(n)-1,c=2*s+1;t.graph().nestingRoot=e,o.each(t.edges(),function(e){t.edge(e).minlen*=c});var l=a(t)+1;o.each(t.children(),function(i){r(t,e,c,l,s,n,i)}),t.graph().nodeRankFactor=c}function r(t,e,n,i,a,s,c){var l=t.children(c);if(!l.length)return void(c!==e&&t.setEdge(e,c,{weight:0,minlen:n}));var h=u.addBorderNode(t,"_bt"),d=u.addBorderNode(t,"_bb"),f=t.node(c);t.setParent(h,c),f.borderTop=h,t.setParent(d,c),f.borderBottom=d,o.each(l,function(o){r(t,e,n,i,a,s,o);var u=t.node(o),l=u.borderTop?u.borderTop:o,f=u.borderBottom?u.borderBottom:o,p=u.borderTop?i:2*i,g=l!==f?1:a-s[c]+1;t.setEdge(h,l,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(f,d,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(c)||t.setEdge(e,h,{weight:0,minlen:a+s[c]})}function i(t){function e(r,i){var a=t.children(r);a&&a.length&&o.each(a,function(t){e(t,i+1)}),n[r]=i}var n={};return o.each(t.children(),function(t){e(t,1)}),n}function a(t){return o.reduce(t.edges(),function(e,n){return e+t.edge(n).weight},0)}function s(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,o.each(t.edges(),function(e){var n=t.edge(e);n.nestingEdge&&t.removeEdge(e)})}var o=t("./lodash"),u=t("./util");e.exports={run:n,cleanup:s}},{"./lodash":39,"./util":58}],41:[function(t,e){"use strict";function n(t){t.graph().dummyChains=[],a.each(t.edges(),function(e){r(t,e)})}function r(t,e){var n=e.v,r=t.node(n).rank,i=e.w,a=t.node(i).rank,o=e.name,u=t.edge(e),c=u.labelRank;if(a!==r+1){t.removeEdge(e);var l,h,d;for(d=0,++r;a>r;++d,++r)u.points=[],h={width:0,height:0,edgeLabel:u,edgeObj:e,rank:r},l=s.addDummyNode(t,"edge",h,"_d"),r===c&&(h.width=u.width,h.height=u.height,h.dummy="edge-label",h.labelpos=u.labelpos),t.setEdge(n,l,{weight:u.weight},o),0===d&&t.graph().dummyChains.push(l),n=l;t.setEdge(n,i,{weight:u.weight},o)}}function i(t){a.each(t.graph().dummyChains,function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)})}var a=t("./lodash"),s=t("./util");e.exports={run:n,undo:i}},{"./lodash":39,"./util":58}],42:[function(t,e){function n(t,e,n){var i,a={};r.each(n,function(n){for(var r,s,o=t.parent(n);o;){if(r=t.parent(o),r?(s=a[r],a[r]=o):(s=i,i=o),s&&s!==o)return void e.setEdge(s,o);o=r}})}var r=t("../lodash");e.exports=n},{"../lodash":39}],43:[function(t,e){function n(t,e){return r.map(e,function(e){var n=t.inEdges(e);if(n.length){var i=r.reduce(n,function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}},{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}})}var r=t("../lodash");e.exports=n},{"../lodash":39}],44:[function(t,e){function n(t,e,n){var s=r(t),o=new a({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(e){return t.node(e)});return i.each(t.nodes(),function(r){var a=t.node(r),u=t.parent(r);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(o.setNode(r),o.setParent(r,u||s),i.each(t[n](r),function(e){var n=e.v===r?e.w:e.v,a=o.edge(n,r),s=i.isUndefined(a)?0:a.weight;o.setEdge(n,r,{weight:t.edge(e).weight+s})}),i.has(a,"minRank")&&o.setNode(r,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),o}function r(t){for(var e;t.hasNode(e=i.uniqueId("_root")););return e}var i=t("../lodash"),a=t("../graphlib").Graph;e.exports=n},{"../graphlib":36,"../lodash":39}],45:[function(t,e){"use strict";function n(t,e){for(var n=0,i=1;i0;)e%2&&(n+=u[e+1]),e=e-1>>1,u[e]+=t.weight;c+=t.weight*n})),c}var i=t("../lodash");e.exports=n},{"../lodash":39}],46:[function(t,e){"use strict";function n(t){var e=f.maxRank(t),n=r(t,s.range(1,e+1),"inEdges"),c=r(t,s.range(e-1,-1,-1),"outEdges"),l=o(t);a(t,l);for(var h,d=Number.POSITIVE_INFINITY,p=0,g=0;4>g;++p,++g){i(p%2?n:c,p%4>=2),l=f.buildLayerMatrix(t);var y=u(t,l);d>y&&(g=0,h=s.cloneDeep(l),d=y)}a(t,h)}function r(t,e,n){return s.map(e,function(e){return l(t,e,n)})}function i(t,e){var n=new d;s.each(t,function(t){var r=t.graph().root,i=c(t,r,n,e); -for(var o in t)s&&Qn(o,e)||"constructor"==o&&(i||!ts.call(t,o))||a.push(o);return a}function ea(t){t=hr(t);for(var e=-1,n=Yo(t),r=n.length,i=Ya(r);++e=xs(e,n)&&tn?0:+n||0,r),n-=e.length,n>=0&&t.indexOf(e,n)==n}function da(t){return t=o(t),t&&bt.test(t)?t.replace(vt,f):t}function fa(t){return t=o(t),t&&Ft.test(t)?t.replace(Ct,p):t||"(?:)"}function pa(t,e,n){t=o(t),e=+e;var r=t.length;if(r>=e||!_s(e))return t;var i=(e-r)/2,a=ms(i),s=gs(i);return n=On("",s,n),n.slice(0,a)+t+n}function ga(t,e,n){return(n?Jn(t,e,n):null==e)?e=0:e&&(e=+e),t=_a(t),ks(t,e||(Ot.test(t)?16:10))}function ya(t,e){var n="";if(t=o(t),e=+e,1>e||!t||!_s(e))return n;do e%2&&(n+=t),e=ms(e/2),t+=t;while(e);return n}function ma(t,e,n){return t=o(t),n=null==n?0:xs(0>n?0:+n||0,t.length),t.lastIndexOf(e,n)==n}function va(t,n,r){var i=e.templateSettings;r&&Jn(t,n,r)&&(n=r=E),t=o(t),n=ye(me({},r||n),i,ge);var a,s,u=ye(me({},n.imports),i.imports,ge),c=Yo(u),l=tn(u,c),h=0,d=n.interpolate||Pt,f="__p += '",p=za((n.escape||Pt).source+"|"+d.source+"|"+(d===wt?Bt:Pt).source+"|"+(n.evaluate||Pt).source+"|$","g"),y="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++$t+"]")+"\n";t.replace(p,function(e,n,r,i,o,u){return r||(r=i),f+=t.slice(h,u).replace(Rt,g),n&&(a=!0,f+="' +\n__e("+n+") +\n'"),o&&(s=!0,f+="';\n"+o+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),h=u+e.length,e}),f+="';\n";var m=n.variable;m||(f="with (obj) {\n"+f+"\n}\n"),f=(s?f.replace(pt,""):f).replace(gt,"$1").replace(yt,"$1;"),f="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var v=Ko(function(){return Ga(c,y+"return "+f).apply(E,l)});if(v.source=f,Bi(v))throw v;return v}function _a(t,e,n){var r=t;return(t=o(t))?(n?Jn(r,e,n):null==e)?t.slice(A(t),x(t)+1):(e+="",t.slice(u(t,e),c(t,e)+1)):t}function ba(t,e,n){var r=t;return t=o(t),t?t.slice((n?Jn(r,e,n):null==e)?A(t):u(t,e+"")):t}function Aa(t,e,n){var r=t;return t=o(t),t?(n?Jn(r,e,n):null==e)?t.slice(0,x(t)+1):t.slice(0,c(t,e+"")+1):t}function xa(t,e,n){n&&Jn(t,e,n)&&(e=E);var r=N,i=P;if(null!=e)if(Mi(e)){var a="separator"in e?e.separator:a;r="length"in e?+e.length||0:r,i="omission"in e?o(e.omission):i}else r=+e||0;if(t=o(t),r>=t.length)return t;var s=r-i.length;if(1>s)return i;var u=t.slice(0,s);if(null==a)return u+i;if($i(a)){if(t.slice(s).search(a)){var c,l,h=t.slice(0,s);for(a.global||(a=za(a.source,(It.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(h);)l=c.index;u=u.slice(0,null==l?s:l)}}else if(t.indexOf(a,s)!=s){var d=u.lastIndexOf(a);d>-1&&(u=u.slice(0,d))}return u+i}function wa(t){return t=o(t),t&&_t.test(t)?t.replace(mt,w):t}function ka(t,e,n){return n&&Jn(t,e,n)&&(e=E),t=o(t),t.match(e||jt)||[]}function Ea(t,e,n){return n&&Jn(t,e,n)&&(e=E),m(t)?Fa(t):be(t,e)}function Da(t){return function(){return t}}function Ca(t){return t}function Fa(t){return je(Ae(t,!0))}function Ta(t,e){return Ye(t,Ae(e,!0))}function Sa(t,e,n){if(null==n){var r=Mi(e),i=r?Yo(e):E,a=i&&i.length?Oe(e,i):E;(a?a.length:r)||(a=!1,n=e,e=t,t=this)}a||(a=Oe(e,Yo(e)));var s=!0,o=-1,u=Oi(t),c=a.length;n===!1?s=!1:Mi(n)&&"chain"in n&&(s=n.chain);for(;++ot||!_s(t))return[];var r=-1,i=Ya(xs(t,Fs));for(e=sn(e,n,1);++rr?i[r]=e(r):e(r);return i}function Pa(t){var e=++es;return o(t)+e}function Ra(t,e){return(+t||0)+(+e||0)}function ja(t,e,n){return n&&Jn(t,e,n)&&(e=E),e=$n(e,n,3),1==e.length?fe(To(t)?t:lr(t),e):Qe(t,e)}t=t?re.defaults(ne.Object(),t,re.pick(ne,Yt)):ne;{var Ya=t.Array,$a=t.Date,Ua=t.Error,Ga=t.Function,Wa=t.Math,Va=t.Number,Ha=t.Object,za=t.RegExp,qa=t.String,Xa=t.TypeError,Za=Ya.prototype,Ka=Ha.prototype,Qa=qa.prototype,Ja=Ga.prototype.toString,ts=Ka.hasOwnProperty,es=0,ns=Ka.toString,rs=ne._,is=za("^"+Ja.call(ts).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),as=t.ArrayBuffer,ss=t.clearTimeout,os=t.parseFloat,us=Wa.pow,cs=Ka.propertyIsEnumerable,ls=Vn(t,"Set"),hs=t.setTimeout,ds=Za.splice,fs=t.Uint8Array,ps=Vn(t,"WeakMap"),gs=Wa.ceil,ys=Vn(Ha,"create"),ms=Wa.floor,vs=Vn(Ya,"isArray"),_s=t.isFinite,bs=Vn(Ha,"keys"),As=Wa.max,xs=Wa.min,ws=Vn($a,"now"),ks=t.parseInt,Es=Wa.random,Ds=Va.NEGATIVE_INFINITY,Cs=Va.POSITIVE_INFINITY,Fs=4294967295,Ts=Fs-1,Ss=Fs>>>1,Bs=9007199254740991,Is=ps&&new ps,Os={};e.support={}}e.templateSettings={escape:At,evaluate:xt,interpolate:wt,variable:"",imports:{_:e}};var Ms=function(){function t(){}return function(e){if(Mi(e)){t.prototype=e;var n=new t;t.prototype=E}return n||{}}}(),Ls=dn(Be),Ns=dn(Ie,!0),Ps=fn(),Rs=fn(!0),js=Is?function(t,e){return Is.set(t,e),t}:Ca,Ys=Is?function(t){return Is.get(t)}:Ia,$s=Ge("length"),Us=function(){var t=0,e=0;return function(n,r){var i=go(),a=j-(i-e);if(e=i,a>0){if(++t>=R)return n}else t=0;return js(n,r)}}(),Gs=mi(function(t,e){return m(t)&&Kn(t)?we(t,Te(e,!1,!0)):[]}),Ws=xn(),Vs=xn(!0),Hs=mi(function(t){for(var e=t.length,n=e,r=Ya(h),i=Gn(),s=i==a,o=[];n--;){var u=t[n]=Kn(u=t[n])?u:[];r[n]=s&&u.length>=120?gn(n&&u):null}var c=t[0],l=-1,h=c?c.length:0,d=r[0];t:for(;++l2?t[e-2]:E,r=e>1?t[e-1]:E;return e>2&&"function"==typeof n?e-=2:(n=e>1&&"function"==typeof r?(--e,r):E,r=E),t.length=e,Rr(t,n,r)}),to=mi(function(t){return t=Te(t),this.thru(function(e){return Jt(To(e)?e:[hr(e)],t)})}),eo=mi(function(t,e){return ve(t,Te(e))}),no=ln(function(t,e,n){ts.call(t,n)?++t[n]:t[n]=1}),ro=An(Ls),io=An(Ns,!0),ao=En(ee,Ls),so=En(ie,Ns),oo=ln(function(t,e,n){ts.call(t,n)?t[n].push(e):t[n]=[e]}),uo=ln(function(t,e,n){t[n]=e}),co=mi(function(t,e,n){var r=-1,i="function"==typeof e,a=tr(e),s=Kn(t)?Ya(t.length):[];return Ls(t,function(t){var o=i?e:a&&null!=t?t[e]:E;s[++r]=o?o.apply(t,n):Zn(t,e,n)}),s}),lo=ln(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),ho=Bn(le,Ls),fo=Bn(he,Ns),po=mi(function(t,e){if(null==t)return[];var n=e[2];return n&&Jn(e[0],e[1],n)&&(e.length=1),Ke(t,Te(e),[])}),go=ws||function(){return(new $a).getTime()},yo=mi(function(t,e,n){var r=C;if(n.length){var i=_(n,yo.placeholder);r|=I}return Pn(t,r,e,n,i)}),mo=mi(function(t,e){e=e.length?Te(e):Zi(t);for(var n=-1,r=e.length;++n0||0>e)?new K(n):(0>t?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==E&&(e=+e||0,n=0>e?n.dropRight(-e):n.take(e-t)),n)},K.prototype.takeRightWhile=function(t,e){return this.reverse().takeWhile(t,e).reverse()},K.prototype.toArray=function(){return this.take(Cs)},Be(K.prototype,function(t,n){var r=/^(?:filter|map|reject)|While$/.test(n),i=/^(?:first|last)$/.test(n),a=e[i?"take"+("last"==n?"Right":""):n];a&&(e.prototype[n]=function(){var e=i?[1]:arguments,n=this.__chain__,s=this.__wrapped__,o=!!this.__actions__.length,u=s instanceof K,c=e[0],l=u||To(s);l&&r&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=function(t){return i&&n?a(t,1)[0]:a.apply(E,ce([t],e))},d={func:Gr,args:[h],thisArg:E},f=u&&!o;if(i&&!n)return f?(s=s.clone(),s.__actions__.push(d),t.call(s)):a.call(E,this.value())[0];if(!i&&l){s=f?s:new K(this);var p=t.apply(s,e);return p.__actions__.push(d),new v(p,n)}return this.thru(h)})}),ee(["join","pop","push","replace","shift","sort","splice","split","unshift"],function(t){var n=(/^(?:replace|split)$/.test(t)?Qa:Za)[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:join|pop|replace|shift)$/.test(t);e.prototype[t]=function(){var t=arguments;return i&&!this.__chain__?n.apply(this.value(),t):this[r](function(e){return n.apply(e,t)})}}),Be(K.prototype,function(t,n){var r=e[n];if(r){var i=r.name,a=Os[i]||(Os[i]=[]);a.push({name:n,func:r})}}),Os[In(E,F).name]=[{name:"wrapper",func:E}],K.prototype.clone=et,K.prototype.reverse=rt,K.prototype.value=Wt,e.prototype.chain=Wr,e.prototype.commit=Vr,e.prototype.concat=to,e.prototype.plant=Hr,e.prototype.reverse=zr,e.prototype.toString=qr,e.prototype.run=e.prototype.toJSON=e.prototype.valueOf=e.prototype.value=Xr,e.prototype.collect=e.prototype.map,e.prototype.head=e.prototype.first,e.prototype.select=e.prototype.filter,e.prototype.tail=e.prototype.rest,e}var E,D="3.10.1",C=1,F=2,T=4,S=8,B=16,I=32,O=64,M=128,L=256,N=30,P="...",R=150,j=16,Y=200,$=1,U=2,G="Expected a function",W="__lodash_placeholder__",V="[object Arguments]",H="[object Array]",z="[object Boolean]",q="[object Date]",X="[object Error]",Z="[object Function]",K="[object Map]",Q="[object Number]",J="[object Object]",tt="[object RegExp]",et="[object Set]",nt="[object String]",rt="[object WeakMap]",it="[object ArrayBuffer]",at="[object Float32Array]",st="[object Float64Array]",ot="[object Int8Array]",ut="[object Int16Array]",ct="[object Int32Array]",lt="[object Uint8Array]",ht="[object Uint8ClampedArray]",dt="[object Uint16Array]",ft="[object Uint32Array]",pt=/\b__p \+= '';/g,gt=/\b(__p \+=) '' \+/g,yt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mt=/&(?:amp|lt|gt|quot|#39|#96);/g,vt=/[&<>"'`]/g,_t=RegExp(mt.source),bt=RegExp(vt.source),At=/<%-([\s\S]+?)%>/g,xt=/<%([\s\S]+?)%>/g,wt=/<%=([\s\S]+?)%>/g,kt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,Et=/^\w*$/,Dt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,Ct=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,Ft=RegExp(Ct.source),Tt=/[\u0300-\u036f\ufe20-\ufe23]/g,St=/\\(\\)?/g,Bt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,It=/\w*$/,Ot=/^0[xX]/,Mt=/^\[object .+?Constructor\]$/,Lt=/^\d+$/,Nt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Pt=/($^)/,Rt=/['\n\r\u2028\u2029\\]/g,jt=function(){var t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",e="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(t+"+(?="+t+e+")|"+t+"?"+e+"|"+t+"+|[0-9]+","g")}(),Yt=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],$t=-1,Ut={};Ut[at]=Ut[st]=Ut[ot]=Ut[ut]=Ut[ct]=Ut[lt]=Ut[ht]=Ut[dt]=Ut[ft]=!0,Ut[V]=Ut[H]=Ut[it]=Ut[z]=Ut[q]=Ut[X]=Ut[Z]=Ut[K]=Ut[Q]=Ut[J]=Ut[tt]=Ut[et]=Ut[nt]=Ut[rt]=!1;var Gt={};Gt[V]=Gt[H]=Gt[it]=Gt[z]=Gt[q]=Gt[at]=Gt[st]=Gt[ot]=Gt[ut]=Gt[ct]=Gt[Q]=Gt[J]=Gt[tt]=Gt[nt]=Gt[lt]=Gt[ht]=Gt[dt]=Gt[ft]=!0,Gt[X]=Gt[Z]=Gt[K]=Gt[et]=Gt[rt]=!1;var Wt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},Vt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ht={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},zt={"function":!0,object:!0},qt={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Xt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Zt=zt[typeof n]&&n&&!n.nodeType&&n,Kt=zt[typeof e]&&e&&!e.nodeType&&e,Qt=Zt&&Kt&&"object"==typeof t&&t&&t.Object&&t,Jt=zt[typeof self]&&self&&self.Object&&self,te=zt[typeof window]&&window&&window.Object&&window,ee=Kt&&Kt.exports===Zt&&Zt,ne=Qt||te!==(this&&this.window)&&te||Jt||this,re=k();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(ne._=re,define(function(){return re})):Zt&&Kt?ee?(Kt.exports=re)._=re:Zt._=re:ne._=re}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],53:[function(t,e){e.exports={graphlib:t("./lib/graphlib"),layout:t("./lib/layout"),debug:t("./lib/debug"),util:{time:t("./lib/util").time,notime:t("./lib/util").notime},version:t("./lib/version")}},{"./lib/debug":58,"./lib/graphlib":59,"./lib/layout":61,"./lib/util":81,"./lib/version":82}],54:[function(t,e){"use strict";function n(t){function e(t){return function(e){return t.edge(e).weight}}var n="greedy"===t.graph().acyclicer?s(t,e(t)):r(t);a.each(n,function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,a.uniqueId("rev"))})}function r(t){function e(s){a.has(i,s)||(i[s]=!0,r[s]=!0,a.each(t.outEdges(s),function(t){a.has(r,t.w)?n.push(t):e(t.w)}),delete r[s])}var n=[],r={},i={};return a.each(t.nodes(),e),n}function i(t){a.each(t.edges(),function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}})}var a=t("./lodash"),s=t("./greedy-fas");e.exports={run:n,undo:i}},{"./greedy-fas":60,"./lodash":62}],55:[function(t,e){function n(t){function e(n){var a=t.children(n),s=t.node(n);if(a.length&&i.each(a,e),i.has(s,"minRank")){s.borderLeft=[],s.borderRight=[];for(var o=s.minRank,u=s.maxRank+1;u>o;++o)r(t,"borderLeft","_bl",n,s,o),r(t,"borderRight","_br",n,s,o)}}i.each(t.children(),e)}function r(t,e,n,r,i,s){var o={width:0,height:0,rank:s,borderType:e},u=i[e][s-1],c=a.addDummyNode(t,"border",o,n);i[e][s]=c,t.setParent(c,r),u&&t.setEdge(u,c,{weight:1})}var i=t("./lodash"),a=t("./util");e.exports=n},{"./lodash":62,"./util":81}],56:[function(t,e){"use strict";function n(t){var e=t.graph().rankdir.toLowerCase();("lr"===e||"rl"===e)&&i(t)}function r(t){var e=t.graph().rankdir.toLowerCase();("bt"===e||"rl"===e)&&s(t),("lr"===e||"rl"===e)&&(u(t),i(t))}function i(t){l.each(t.nodes(),function(e){a(t.node(e))}),l.each(t.edges(),function(e){a(t.edge(e))})}function a(t){var e=t.width;t.width=t.height,t.height=e}function s(t){l.each(t.nodes(),function(e){o(t.node(e))}),l.each(t.edges(),function(e){var n=t.edge(e);l.each(n.points,o),l.has(n,"y")&&o(n)})}function o(t){t.y=-t.y}function u(t){l.each(t.nodes(),function(e){c(t.node(e))}),l.each(t.edges(),function(e){var n=t.edge(e);l.each(n.points,c),l.has(n,"x")&&c(n)})}function c(t){var e=t.x;t.x=t.y,t.y=e}var l=t("./lodash");e.exports={adjust:n,undo:r}},{"./lodash":62}],57:[function(t,e){function n(){var t={};t._next=t._prev=t,this._sentinel=t}function r(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function i(t,e){return"_next"!==t&&"_prev"!==t?e:void 0}e.exports=n,n.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;return e!==t?(r(e),e):void 0},n.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&r(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},n.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,i)),n=n._prev;return"["+t.join(", ")+"]"}},{}],58:[function(t,e){function n(t){var e=i.buildLayerMatrix(t),n=new a({compound:!0,multigraph:!0}).setGraph({});return r.each(t.nodes(),function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)}),r.each(t.edges(),function(t){n.setEdge(t.v,t.w,{},t.name)}),r.each(e,function(t,e){var i="layer"+e;n.setNode(i,{rank:"same"}),r.reduce(t,function(t,e){return n.setEdge(t,e,{style:"invis"}),e})}),n}var r=t("./lodash"),i=t("./util"),a=t("./graphlib").Graph;e.exports={debugOrdering:n}},{"./graphlib":59,"./lodash":62,"./util":81}],59:[function(t,e){var n;if("function"==typeof t)try{n=t("graphlib")}catch(r){}n||(n=window.graphlib),e.exports=n},{graphlib:83}],60:[function(t,e){function n(t,e){if(t.nodeCount()<=1)return[];var n=a(t,e||l),i=r(n.graph,n.buckets,n.zeroIdx);return o.flatten(o.map(i,function(e){return t.outEdges(e.v,e.w)}),!0)}function r(t,e,n){for(var r,a=[],s=e[e.length-1],o=e[0];t.nodeCount();){for(;r=o.dequeue();)i(t,e,n,r);for(;r=s.dequeue();)i(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){a=a.concat(i(t,e,n,r,!0));break}}return a}function i(t,e,n,r,i){var a=i?[]:void 0;return o.each(t.inEdges(r.v),function(r){var o=t.edge(r),u=t.node(r.v);i&&a.push({v:r.v,w:r.w}),u.out-=o,s(e,n,u)}),o.each(t.outEdges(r.v),function(r){var i=t.edge(r),a=r.w,o=t.node(a);o["in"]-=i,s(e,n,o)}),t.removeNode(r.v),a}function a(t,e){var n=new u,r=0,i=0;o.each(t.nodes(),function(t){n.setNode(t,{v:t,"in":0,out:0})}),o.each(t.edges(),function(t){var a=n.edge(t.v,t.w)||0,s=e(t),o=a+s;n.setEdge(t.v,t.w,o),i=Math.max(i,n.node(t.v).out+=s),r=Math.max(r,n.node(t.w)["in"]+=s)});var a=o.range(i+r+3).map(function(){return new c}),l=r+1;return o.each(n.nodes(),function(t){s(a,l,n.node(t))}),{graph:n,buckets:a,zeroIdx:l}}function s(t,e,n){n.out?n["in"]?t[n.out-n["in"]+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}var o=t("./lodash"),u=t("./graphlib").Graph,c=t("./data/list");e.exports=n;var l=o.constant(1)},{"./data/list":57,"./graphlib":59,"./lodash":62}],61:[function(t,e){"use strict";function n(t,e){var n=e&&e.debugTiming?I.time:I.notime;n("layout",function(){var e=n(" buildLayoutGraph",function(){return a(t)});n(" runLayout",function(){r(e,n)}),n(" updateInputGraph",function(){i(t,e)})})}function r(t,e){e(" makeSpaceForEdgeLabels",function(){s(t)}),e(" removeSelfEdges",function(){g(t)}),e(" acyclic",function(){A.run(t)}),e(" nestingGraph.run",function(){C.run(t)}),e(" rank",function(){w(I.asNonCompoundGraph(t))}),e(" injectEdgeLabelProxies",function(){o(t)}),e(" removeEmptyRanks",function(){D(t)}),e(" nestingGraph.cleanup",function(){C.cleanup(t)}),e(" normalizeRanks",function(){k(t)}),e(" assignRankMinMax",function(){u(t)}),e(" removeEdgeLabelProxies",function(){c(t)}),e(" normalize.run",function(){x.run(t)}),e(" parentDummyChains",function(){E(t)}),e(" addBorderSegments",function(){F(t)}),e(" order",function(){S(t)}),e(" insertSelfEdges",function(){y(t)}),e(" adjustCoordinateSystem",function(){T.adjust(t)}),e(" position",function(){B(t)}),e(" positionSelfEdges",function(){m(t)}),e(" removeBorderNodes",function(){p(t)}),e(" normalize.undo",function(){x.undo(t)}),e(" fixupEdgeLabelCoords",function(){d(t)}),e(" undoCoordinateSystem",function(){T.undo(t)}),e(" translateGraph",function(){l(t)}),e(" assignNodeIntersects",function(){h(t)}),e(" reversePoints",function(){f(t)}),e(" acyclic.undo",function(){A.undo(t)})}function i(t,e){b.each(t.nodes(),function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))}),b.each(t.edges(),function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,b.has(i,"x")&&(r.x=i.x,r.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function a(t){var e=new O({multigraph:!0,compound:!0}),n=_(t.graph());return e.setGraph(b.merge({},L,v(n,M),b.pick(n,N))),b.each(t.nodes(),function(n){var r=_(t.node(n));e.setNode(n,b.defaults(v(r,P),R)),e.setParent(n,t.parent(n))}),b.each(t.edges(),function(n){var r=_(t.edge(n));e.setEdge(n,b.merge({},Y,v(r,j),b.pick(r,$)))}),e}function s(t){var e=t.graph();e.ranksep/=2,b.each(t.edges(),function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function o(t){b.each(t.edges(),function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-r.rank)/2+r.rank,e:e};I.addDummyNode(t,"edge-proxy",a,"_ep")}})}function u(t){var e=0;b.each(t.nodes(),function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=b.max(e,r.maxRank))}),t.graph().maxRank=e}function c(t){b.each(t.nodes(),function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}function l(t){function e(t){var e=t.x,s=t.y,o=t.width,u=t.height;n=Math.min(n,e-o/2),r=Math.max(r,e+o/2),i=Math.min(i,s-u/2),a=Math.max(a,s+u/2)}var n=Number.POSITIVE_INFINITY,r=0,i=Number.POSITIVE_INFINITY,a=0,s=t.graph(),o=s.marginx||0,u=s.marginy||0;b.each(t.nodes(),function(n){e(t.node(n))}),b.each(t.edges(),function(n){var r=t.edge(n);b.has(r,"x")&&e(r)}),n-=o,i-=u,b.each(t.nodes(),function(e){var r=t.node(e);r.x-=n,r.y-=i}),b.each(t.edges(),function(e){var r=t.edge(e);b.each(r.points,function(t){t.x-=n,t.y-=i}),b.has(r,"x")&&(r.x-=n),b.has(r,"y")&&(r.y-=i)}),s.width=r-n+o,s.height=a-i+u}function h(t){b.each(t.edges(),function(e){var n,r,i=t.edge(e),a=t.node(e.v),s=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=s,r=a),i.points.unshift(I.intersectRect(a,n)),i.points.push(I.intersectRect(s,r))})}function d(t){b.each(t.edges(),function(e){var n=t.edge(e);if(b.has(n,"x"))switch(("l"===n.labelpos||"r"===n.labelpos)&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}function f(t){b.each(t.edges(),function(e){var n=t.edge(e);n.reversed&&n.points.reverse()})}function p(t){b.each(t.nodes(),function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),a=t.node(b.last(n.borderLeft)),s=t.node(b.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),b.each(t.nodes(),function(e){"border"===t.node(e).dummy&&t.removeNode(e)})}function g(t){b.each(t.edges(),function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}function y(t){var e=I.buildLayerMatrix(t);b.each(e,function(e){var n=0;b.each(e,function(e,r){var i=t.node(e);i.order=r+n,b.each(i.selfEdges,function(e){I.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")}),delete i.selfEdges})})}function m(t){b.each(t.nodes(),function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,a=r.y,s=n.x-i,o=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],n.label.x=n.x,n.label.y=n.y}})}function v(t,e){return b.mapValues(b.pick(t,e),Number)}function _(t){var e={};return b.each(t,function(t,n){e[n.toLowerCase()]=t}),e}var b=t("./lodash"),A=t("./acyclic"),x=t("./normalize"),w=t("./rank"),k=t("./util").normalizeRanks,E=t("./parent-dummy-chains"),D=t("./util").removeEmptyRanks,C=t("./nesting-graph"),F=t("./add-border-segments"),T=t("./coordinate-system"),S=t("./order"),B=t("./position"),I=t("./util"),O=t("./graphlib").Graph;e.exports=n;var M=["nodesep","edgesep","ranksep","marginx","marginy"],L={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},N=["acyclicer","ranker","rankdir","align"],P=["width","height"],R={width:0,height:0},j=["minlen","weight","width","height","labeloffset"],Y={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},$=["labelpos"]},{"./acyclic":54,"./add-border-segments":55,"./coordinate-system":56,"./graphlib":59,"./lodash":62,"./nesting-graph":63,"./normalize":64,"./order":69,"./parent-dummy-chains":74,"./position":76,"./rank":78,"./util":81}],62:[function(t,e){e.exports=t(50)},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\lodash.js":50,lodash:103}],63:[function(t,e){function n(t){var e=u.addDummyNode(t,"root",{},"_root"),n=i(t),s=o.max(n)-1,c=2*s+1;t.graph().nestingRoot=e,o.each(t.edges(),function(e){t.edge(e).minlen*=c});var l=a(t)+1;o.each(t.children(),function(i){r(t,e,c,l,s,n,i)}),t.graph().nodeRankFactor=c}function r(t,e,n,i,a,s,c){var l=t.children(c);if(!l.length)return void(c!==e&&t.setEdge(e,c,{ -weight:0,minlen:n}));var h=u.addBorderNode(t,"_bt"),d=u.addBorderNode(t,"_bb"),f=t.node(c);t.setParent(h,c),f.borderTop=h,t.setParent(d,c),f.borderBottom=d,o.each(l,function(o){r(t,e,n,i,a,s,o);var u=t.node(o),l=u.borderTop?u.borderTop:o,f=u.borderBottom?u.borderBottom:o,p=u.borderTop?i:2*i,g=l!==f?1:a-s[c]+1;t.setEdge(h,l,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(f,d,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(c)||t.setEdge(e,h,{weight:0,minlen:a+s[c]})}function i(t){function e(r,i){var a=t.children(r);a&&a.length&&o.each(a,function(t){e(t,i+1)}),n[r]=i}var n={};return o.each(t.children(),function(t){e(t,1)}),n}function a(t){return o.reduce(t.edges(),function(e,n){return e+t.edge(n).weight},0)}function s(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,o.each(t.edges(),function(e){var n=t.edge(e);n.nestingEdge&&t.removeEdge(e)})}var o=t("./lodash"),u=t("./util");e.exports={run:n,cleanup:s}},{"./lodash":62,"./util":81}],64:[function(t,e){"use strict";function n(t){t.graph().dummyChains=[],a.each(t.edges(),function(e){r(t,e)})}function r(t,e){var n=e.v,r=t.node(n).rank,i=e.w,a=t.node(i).rank,o=e.name,u=t.edge(e),c=u.labelRank;if(a!==r+1){t.removeEdge(e);var l,h,d;for(d=0,++r;a>r;++d,++r)u.points=[],h={width:0,height:0,edgeLabel:u,edgeObj:e,rank:r},l=s.addDummyNode(t,"edge",h,"_d"),r===c&&(h.width=u.width,h.height=u.height,h.dummy="edge-label",h.labelpos=u.labelpos),t.setEdge(n,l,{weight:u.weight},o),0===d&&t.graph().dummyChains.push(l),n=l;t.setEdge(n,i,{weight:u.weight},o)}}function i(t){a.each(t.graph().dummyChains,function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)})}var a=t("./lodash"),s=t("./util");e.exports={run:n,undo:i}},{"./lodash":62,"./util":81}],65:[function(t,e){function n(t,e,n){var i,a={};r.each(n,function(n){for(var r,s,o=t.parent(n);o;){if(r=t.parent(o),r?(s=a[r],a[r]=o):(s=i,i=o),s&&s!==o)return void e.setEdge(s,o);o=r}})}var r=t("../lodash");e.exports=n},{"../lodash":62}],66:[function(t,e){function n(t,e){return r.map(e,function(e){var n=t.inEdges(e);if(n.length){var i=r.reduce(n,function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}},{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}})}var r=t("../lodash");e.exports=n},{"../lodash":62}],67:[function(t,e){function n(t,e,n){var s=r(t),o=new a({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(e){return t.node(e)});return i.each(t.nodes(),function(r){var a=t.node(r),u=t.parent(r);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(o.setNode(r),o.setParent(r,u||s),i.each(t[n](r),function(e){var n=e.v===r?e.w:e.v,a=o.edge(n,r),s=i.isUndefined(a)?0:a.weight;o.setEdge(n,r,{weight:t.edge(e).weight+s})}),i.has(a,"minRank")&&o.setNode(r,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),o}function r(t){for(var e;t.hasNode(e=i.uniqueId("_root")););return e}var i=t("../lodash"),a=t("../graphlib").Graph;e.exports=n},{"../graphlib":59,"../lodash":62}],68:[function(t,e){"use strict";function n(t,e){for(var n=0,i=1;i0;)e%2&&(n+=u[e+1]),e=e-1>>1,u[e]+=t.weight;c+=t.weight*n})),c}var i=t("../lodash");e.exports=n},{"../lodash":62}],69:[function(t,e){"use strict";function n(t){var e=f.maxRank(t),n=r(t,s.range(1,e+1),"inEdges"),c=r(t,s.range(e-1,-1,-1),"outEdges"),l=o(t);a(t,l);for(var h,d=Number.POSITIVE_INFINITY,p=0,g=0;4>g;++p,++g){i(p%2?n:c,p%4>=2),l=f.buildLayerMatrix(t);var y=u(t,l);d>y&&(g=0,h=s.cloneDeep(l),d=y)}a(t,h)}function r(t,e,n){return s.map(e,function(e){return l(t,e,n)})}function i(t,e){var n=new d;s.each(t,function(t){var r=t.graph().root,i=c(t,r,n,e);s.each(i.vs,function(e,n){t.node(e).order=n}),h(t,n,i.vs)})}function a(t,e){s.each(e,function(e){s.each(e,function(e,n){t.node(e).order=n})})}var s=t("../lodash"),o=t("./init-order"),u=t("./cross-count"),c=t("./sort-subgraph"),l=t("./build-layer-graph"),h=t("./add-subgraph-constraints"),d=t("../graphlib").Graph,f=t("../util");e.exports=n},{"../graphlib":59,"../lodash":62,"../util":81,"./add-subgraph-constraints":65,"./build-layer-graph":67,"./cross-count":68,"./init-order":70,"./sort-subgraph":72}],70:[function(t,e){"use strict";function n(t){function e(i){if(!r.has(n,i)){n[i]=!0;var a=t.node(i);s[a.rank].push(i),r.each(t.successors(i),e)}}var n={},i=r.filter(t.nodes(),function(e){return!t.children(e).length}),a=r.max(r.map(i,function(e){return t.node(e).rank})),s=r.map(r.range(a+1),function(){return[]}),o=r.sortBy(i,function(e){return t.node(e).rank});return r.each(o,e),s}var r=t("../lodash");e.exports=n},{"../lodash":62}],71:[function(t,e){"use strict";function n(t,e){var n={};a.each(t,function(t,e){var r=n[t.v]={indegree:0,"in":[],out:[],vs:[t.v],i:e};a.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)}),a.each(e.edges(),function(t){var e=n[t.v],r=n[t.w];a.isUndefined(e)||a.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))});var i=a.filter(n,function(t){return!t.indegree});return r(i)}function r(t){function e(t){return function(e){e.merged||(a.isUndefined(e.barycenter)||a.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&i(t,e)}}function n(e){return function(n){n["in"].push(e),0===--n.indegree&&t.push(n)}}for(var r=[];t.length;){var s=t.pop();r.push(s),a.each(s["in"].reverse(),e(s)),a.each(s.out,n(s))}return a.chain(r).filter(function(t){return!t.merged}).map(function(t){return a.pick(t,["vs","i","barycenter","weight"])}).value()}function i(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}var a=t("../lodash");e.exports=n},{"../lodash":62}],72:[function(t,e){function n(t,e,c,l){var h=t.children(e),d=t.node(e),f=d?d.borderLeft:void 0,p=d?d.borderRight:void 0,g={};f&&(h=a.filter(h,function(t){return t!==f&&t!==p}));var y=s(t,h);a.each(y,function(e){if(t.children(e.v).length){var r=n(t,e.v,c,l);g[e.v]=r,a.has(r,"barycenter")&&i(e,r)}});var m=o(y,c);r(m,g);var v=u(m,l);if(f&&(v.vs=a.flatten([f,v.vs,p],!0),t.predecessors(f).length)){var _=t.node(t.predecessors(f)[0]),b=t.node(t.predecessors(p)[0]);a.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+_.order+b.order)/(v.weight+2),v.weight+=2}return v}function r(t,e){a.each(t,function(t){t.vs=a.flatten(t.vs.map(function(t){return e[t]?e[t].vs:t}),!0)})}function i(t,e){a.isUndefined(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}var a=t("../lodash"),s=t("./barycenter"),o=t("./resolve-conflicts"),u=t("./sort");e.exports=n},{"../lodash":62,"./barycenter":66,"./resolve-conflicts":71,"./sort":73}],73:[function(t,e){function n(t,e){var n=s.partition(t,function(t){return a.has(t,"barycenter")}),o=n.lhs,u=a.sortBy(n.rhs,function(t){return-t.i}),c=[],l=0,h=0,d=0;o.sort(i(!!e)),d=r(c,u,d),a.each(o,function(t){d+=t.vs.length,c.push(t.vs),l+=t.barycenter*t.weight,h+=t.weight,d=r(c,u,d)});var f={vs:a.flatten(c,!0)};return h&&(f.barycenter=l/h,f.weight=h),f}function r(t,e,n){for(var r;e.length&&(r=a.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}function i(t){return function(e,n){return e.barycentern.barycenter?1:t?n.i-e.i:e.i-n.i}}var a=t("../lodash"),s=t("../util");e.exports=n},{"../lodash":62,"../util":81}],74:[function(t,e){function n(t){var e=i(t);a.each(t.graph().dummyChains,function(n){for(var i=t.node(n),a=i.edgeObj,s=r(t,e,a.v,a.w),o=s.path,u=s.lca,c=0,l=o[c],h=!0;n!==a.w;){if(i=t.node(n),h){for(;(l=o[c])!==u&&t.node(l).maxRanku||c>e[i].lim));for(a=i,i=r;(i=t.parent(i))!==a;)o.push(i);return{path:s.concat(o.reverse()),lca:a}}function i(t){function e(i){var s=r;a.each(t.children(i),e),n[i]={low:s,lim:r++}}var n={},r=0;return a.each(t.children(),e),n}var a=t("./lodash");e.exports=n},{"./lodash":62}],75:[function(t,e){"use strict";function n(t,e){function n(e,n){var s=0,o=0,u=e.length,c=y.last(n);return y.each(n,function(e,l){var h=i(t,e),d=h?t.node(h).order:u;(h||e===c)&&(y.each(n.slice(o,l+1),function(e){y.each(t.predecessors(e),function(n){var i=t.node(n),o=i.order;!(s>o||o>d)||i.dummy&&t.node(e).dummy||a(r,n,e)})}),o=l+1,s=d)}),n}var r={};return y.reduce(e,n),r}function r(t,e){function n(e,n,r,s,o){var u;y.each(y.range(n,r),function(n){u=e[n],t.node(u).dummy&&y.each(t.predecessors(u),function(e){var n=t.node(e);n.dummy&&(n.ordero)&&a(i,e,u)})})}function r(e,r){var i,a=-1,s=0;return y.each(r,function(o,u){if("border"===t.node(o).dummy){var c=t.predecessors(o);c.length&&(i=t.node(c[0]).order,n(r,s,u,a,i),s=u,a=i)}n(r,s,r.length,i,e.length)}),r}var i={};return y.reduce(e,r),i}function i(t,e){return t.node(e).dummy?y.find(t.predecessors(e),function(e){return t.node(e).dummy}):void 0}function a(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function s(t,e,n){if(e>n){var r=e;e=n,n=r}return y.has(t[e],n)}function o(t,e,n,r){var i={},a={},o={};return y.each(e,function(t){y.each(t,function(t,e){i[t]=t,a[t]=t,o[t]=e})}),y.each(e,function(t){var e=-1;y.each(t,function(t){var u=r(t);if(u.length){u=y.sortBy(u,function(t){return o[t]});for(var c=(u.length-1)/2,l=Math.floor(c),h=Math.ceil(c);h>=l;++l){var d=u[l];a[t]===t&&es.lim&&(o=s,u=!0);var c=p.filter(e.edges(),function(e){return u===f(t,t.node(e.v),o)&&u!==f(t,t.node(e.w),o)});return p.min(c,function(t){return y(e,t)})}function l(t,e,n,i){var a=n.v,o=n.w;t.removeEdge(a,o),t.setEdge(i.v,i.w,{}),s(t),r(t,e),h(t,e)}function h(t,e){var n=p.find(t.nodes(),function(t){return!e.node(t).parent}),r=v(t,n);r=r.slice(1),p.each(r,function(n){var r=t.node(n).parent,i=e.edge(n,r),a=!1;i||(i=e.edge(r,n),a=!0),e.node(n).rank=e.node(r).rank+(a?i.minlen:-i.minlen)})}function d(t,e,n){return t.hasEdge(e,n)}function f(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}var p=t("../lodash"),g=t("./feasible-tree"),y=t("./util").slack,m=t("./util").longestPath,v=t("../graphlib").alg.preorder,_=t("../graphlib").alg.postorder,b=t("../util").simplify;e.exports=n,n.initLowLimValues=s,n.initCutValues=r,n.calcCutValue=a,n.leaveEdge=u,n.enterEdge=c,n.exchangeEdges=l},{"../graphlib":59,"../lodash":62,"../util":81,"./feasible-tree":77,"./util":80}],80:[function(t,e){"use strict";function n(t){function e(r){var a=t.node(r);if(i.has(n,r))return a.rank;n[r]=!0;var s=i.min(i.map(t.outEdges(r),function(n){return e(n.w)-t.edge(n).minlen}));return s===Number.POSITIVE_INFINITY&&(s=0),a.rank=s}var n={};i.each(t.sources(),e)}function r(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var i=t("../lodash");e.exports={longestPath:n,slack:r}},{"../lodash":62}],81:[function(t,e){"use strict";function n(t,e,n,r){var i;do i=y.uniqueId(r);while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function r(t){var e=(new m).setGraph(t.graph());return y.each(t.nodes(),function(n){e.setNode(n,t.node(n))}),y.each(t.edges(),function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),e}function i(t){var e=new m({multigraph:t.isMultigraph()}).setGraph(t.graph());return y.each(t.nodes(),function(n){t.children(n).length||e.setNode(n,t.node(n))}),y.each(t.edges(),function(n){e.setEdge(n,t.edge(n))}),e}function a(t){var e=y.map(t.nodes(),function(e){var n={};return y.each(t.outEdges(e),function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight}),n});return y.zipObject(t.nodes(),e)}function s(t){var e=y.map(t.nodes(),function(e){var n={};return y.each(t.inEdges(e),function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight}),n});return y.zipObject(t.nodes(),e)}function o(t,e){var n=t.x,r=t.y,i=e.x-n,a=e.y-r,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var u,c;return Math.abs(a)*s>Math.abs(i)*o?(0>a&&(o=-o),u=o*i/a,c=o):(0>i&&(s=-s),u=s,c=s*a/i),{x:n+u,y:r+c}}function u(t){var e=y.map(y.range(d(t)+1),function(){return[]});return y.each(t.nodes(),function(n){var r=t.node(n),i=r.rank;y.isUndefined(i)||(e[i][r.order]=n)}),e}function c(t){var e=y.min(y.map(t.nodes(),function(e){return t.node(e).rank}));y.each(t.nodes(),function(n){var r=t.node(n);y.has(r,"rank")&&(r.rank-=e)})}function l(t){var e=y.min(y.map(t.nodes(),function(e){return t.node(e).rank})),n=[];y.each(t.nodes(),function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=t.graph().nodeRankFactor;y.each(n,function(e,n){y.isUndefined(e)&&n%i!==0?--r:r&&y.each(e,function(e){t.node(e).rank+=r})})}function h(t,e,r,i){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=i),n(t,"border",a,e)}function d(t){return y.max(y.map(t.nodes(),function(e){var n=t.node(e).rank;return y.isUndefined(n)?void 0:n}))}function f(t,e){var n={lhs:[],rhs:[]};return y.each(t,function(t){e(t)?n.lhs.push(t):n.rhs.push(t)}),n}function p(t,e){var n=y.now();try{return e()}finally{console.log(t+" time: "+(y.now()-n)+"ms")}}function g(t,e){return e()}var y=t("./lodash"),m=t("./graphlib").Graph;e.exports={addDummyNode:n,simplify:r,asNonCompoundGraph:i,successorWeights:a,predecessorWeights:s,intersectRect:o,buildLayerMatrix:u,normalizeRanks:c,removeEmptyRanks:l,addBorderNode:h,maxRank:d,partition:f,time:p,notime:g}},{"./graphlib":59,"./lodash":62}],82:[function(t,e){e.exports="0.7.4"},{}],83:[function(t,e){e.exports=t(32)},{"./lib":99,"./lib/alg":90,"./lib/json":100,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\index.js":32}],84:[function(t,e){e.exports=t(33)},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\components.js":33}],85:[function(t,e){e.exports=t(34)},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dfs.js":34}],86:[function(t,e){e.exports=t(35)},{"../lodash":101,"./dijkstra":87,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dijkstra-all.js":35}],87:[function(t,e){e.exports=t(36)},{"../data/priority-queue":97,"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\dijkstra.js":36}],88:[function(t,e){e.exports=t(37)},{"../lodash":101,"./tarjan":95,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\find-cycles.js":37}],89:[function(t,e){e.exports=t(38)},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\floyd-warshall.js":38}],90:[function(t,e){e.exports=t(39)},{"./components":84,"./dijkstra":87,"./dijkstra-all":86,"./find-cycles":88,"./floyd-warshall":89,"./is-acyclic":91,"./postorder":92,"./preorder":93,"./prim":94,"./tarjan":95,"./topsort":96,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\index.js":39}],91:[function(t,e){e.exports=t(40)},{"./topsort":96,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\is-acyclic.js":40}],92:[function(t,e){e.exports=t(41)},{"./dfs":85,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\postorder.js":41}],93:[function(t,e){e.exports=t(42)},{"./dfs":85,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\preorder.js":42}],94:[function(t,e){e.exports=t(43)},{"../data/priority-queue":97,"../graph":98,"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\prim.js":43}],95:[function(t,e){e.exports=t(44)},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\tarjan.js":44}],96:[function(t,e){e.exports=t(45)},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\alg\\topsort.js":45}],97:[function(t,e){e.exports=t(46)},{"../lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\data\\priority-queue.js":46}],98:[function(t,e){e.exports=t(47)},{"./lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\graph.js":47}],99:[function(t,e){e.exports=t(48)},{"./graph":98,"./version":102,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\index.js":48}],100:[function(t,e){e.exports=t(49)},{"./graph":98,"./lodash":101,"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\json.js":49}],101:[function(t,e){e.exports=t(50)},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\lodash.js":50,lodash:103}],102:[function(t,e){e.exports=t(51)},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\graphlib\\lib\\version.js":51}],103:[function(t,e){e.exports=t(52)},{"C:\\Users\\knut\\source\\mermaid\\node_modules\\dagre-d3\\node_modules\\lodash\\index.js":52}],104:[function(t,e,n){!function(t,r){"object"==typeof n&&"undefined"!=typeof e?e.exports=r():"function"==typeof define&&define.amd?define(r):t.moment=r()}(this,function(){"use strict";function n(){return Nn.apply(null,arguments)}function r(t){Nn=t}function i(t){return"[object Array]"===Object.prototype.toString.call(t)}function a(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function s(t,e){var n,r=[];for(n=0;n0)for(n in Rn)r=Rn[n],i=e[r],"undefined"!=typeof i&&(t[r]=i);return t}function g(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():0/0),jn===!1&&(jn=!0,n.updateOffset(this),jn=!1)}function y(t){return t instanceof g||null!=t&&null!=t._isAMomentObject}function m(t){return 0>t?Math.ceil(t):Math.floor(t)}function v(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=m(e)),n}function _(t,e,n){var r,i=Math.min(t.length,e.length),a=Math.abs(t.length-e.length),s=0;for(r=0;i>r;r++)(n&&t[r]!==e[r]||!n&&v(t[r])!==v(e[r]))&&s++;return s+a}function b(){}function A(t){return t?t.toLowerCase().replace("_","-"):t}function x(t){for(var e,n,r,i,a=0;a0;){if(r=w(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&_(i,n,!0)>=e-1)break;e--}a++}return null}function w(n){var r=null;if(!Yn[n]&&"undefined"!=typeof e&&e&&e.exports)try{r=Pn._abbr,t("./locale/"+n),k(r)}catch(i){}return Yn[n]}function k(t,e){var n;return t&&(n="undefined"==typeof e?D(t):E(t,e),n&&(Pn=n)),Pn._abbr}function E(t,e){return null!==e?(e.abbr=t,Yn[t]=Yn[t]||new b,Yn[t].set(e),k(t),Yn[t]):(delete Yn[t],null)}function D(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Pn;if(!i(t)){if(e=w(t))return e;t=[t]}return x(t)}function C(t,e){var n=t.toLowerCase();$n[n]=$n[n+"s"]=$n[e]=t}function F(t){return"string"==typeof t?$n[t]||$n[t.toLowerCase()]:void 0}function T(t){var e,n,r={};for(n in t)o(t,n)&&(e=F(n),e&&(r[e]=t[n]));return r}function S(t,e){return function(r){return null!=r?(I(this,t,r),n.updateOffset(this,e),this):B(this,t)}}function B(t,e){return t._d["get"+(t._isUTC?"UTC":"")+e]()}function I(t,e,n){return t._d["set"+(t._isUTC?"UTC":"")+e](n)}function O(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if(t=F(t),"function"==typeof this[t])return this[t](e);return this}function M(t,e,n){var r=""+Math.abs(t),i=e-r.length,a=t>=0;return(a?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}function L(t,e,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),t&&(Vn[t]=i),e&&(Vn[e[0]]=function(){return M(i.apply(this,arguments),e[1],e[2])}),n&&(Vn[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function N(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function P(t){var e,n,r=t.match(Un);for(e=0,n=r.length;n>e;e++)r[e]=Vn[r[e]]?Vn[r[e]]:N(r[e]);return function(i){var a="";for(e=0;n>e;e++)a+=r[e]instanceof Function?r[e].call(i,t):r[e];return a}}function R(t,e){return t.isValid()?(e=j(e,t.localeData()),Wn[e]=Wn[e]||P(e),Wn[e](t)):t.localeData().invalidDate()}function j(t,e){function n(t){return e.longDateFormat(t)||t}var r=5;for(Gn.lastIndex=0;r>=0&&Gn.test(t);)t=t.replace(Gn,n),Gn.lastIndex=0,r-=1;return t}function Y(t){return"function"==typeof t&&"[object Function]"===Object.prototype.toString.call(t)}function $(t,e,n){sr[t]=Y(e)?e:function(t){return t&&n?n:e}}function U(t,e){return o(sr,t)?sr[t](e._strict,e._locale):new RegExp(G(t))}function G(t){return t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,r,i){return e||n||r||i}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function W(t,e){var n,r=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(r=function(t,n){n[e]=v(t)}),n=0;nr;r++){if(i=c([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[r].test(t))return r;if(n&&"MMM"===e&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function K(t,e){var n;return"string"==typeof e&&(e=t.localeData().monthsParse(e),"number"!=typeof e)?t:(n=Math.min(t.date(),z(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t)}function Q(t){return null!=t?(K(this,t),n.updateOffset(this,!0),this):B(this,"Month")}function J(){return z(this.year(),this.month())}function tt(t){var e,n=t._a;return n&&-2===h(t).overflow&&(e=n[cr]<0||n[cr]>11?cr:n[lr]<1||n[lr]>z(n[ur],n[cr])?lr:n[hr]<0||n[hr]>24||24===n[hr]&&(0!==n[dr]||0!==n[fr]||0!==n[pr])?hr:n[dr]<0||n[dr]>59?dr:n[fr]<0||n[fr]>59?fr:n[pr]<0||n[pr]>999?pr:-1,h(t)._overflowDayOfYear&&(ur>e||e>lr)&&(e=lr),h(t).overflow=e),t}function et(t){n.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function nt(t,e){var n=!0;return u(function(){return n&&(et(t+"\n"+(new Error).stack),n=!1),e.apply(this,arguments)},e)}function rt(t,e){mr[t]||(et(e),mr[t]=!0)}function it(t){var e,n,r=t._i,i=vr.exec(r);if(i){for(h(t).iso=!0,e=0,n=_r.length;n>e;e++)if(_r[e][1].exec(r)){t._f=_r[e][0];break}for(e=0,n=br.length;n>e;e++)if(br[e][1].exec(r)){t._f+=(i[6]||" ")+br[e][0];break}r.match(rr)&&(t._f+="Z"),wt(t)}else t._isValid=!1}function at(t){var e=Ar.exec(t._i);return null!==e?void(t._d=new Date(+e[1])):(it(t),void(t._isValid===!1&&(delete t._isValid,n.createFromInputFallback(t))))}function st(t,e,n,r,i,a,s){var o=new Date(t,e,n,r,i,a,s);return 1970>t&&o.setFullYear(t),o}function ot(t){var e=new Date(Date.UTC.apply(null,arguments));return 1970>t&&e.setUTCFullYear(t),e}function ut(t){return ct(t)?366:365}function ct(t){return t%4===0&&t%100!==0||t%400===0}function lt(){return ct(this.year())}function ht(t,e,n){var r,i=n-e,a=n-t.day();return a>i&&(a-=7),i-7>a&&(a+=7),r=Bt(t).add(a,"d"),{week:Math.ceil(r.dayOfYear()/7),year:r.year()}}function dt(t){return ht(t,this._week.dow,this._week.doy).week}function ft(){return this._week.dow}function pt(){return this._week.doy}function gt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function yt(t){var e=ht(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function mt(t,e,n,r,i){var a,s=6+i-r,o=ot(t,0,1+s),u=o.getUTCDay();return i>u&&(u+=7),n=null!=n?1*n:i,a=1+s+7*(e-1)-u+n,{year:a>0?t:t-1,dayOfYear:a>0?a:ut(t-1)+a}}function vt(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function _t(t,e,n){return null!=t?t:null!=e?e:n}function bt(t){var e=new Date;return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function At(t){var e,n,r,i,a=[];if(!t._d){for(r=bt(t),t._w&&null==t._a[lr]&&null==t._a[cr]&&xt(t),t._dayOfYear&&(i=_t(t._a[ur],r[ur]),t._dayOfYear>ut(i)&&(h(t)._overflowDayOfYear=!0),n=ot(i,0,t._dayOfYear),t._a[cr]=n.getUTCMonth(),t._a[lr]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=a[e]=r[e];for(;7>e;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[hr]&&0===t._a[dr]&&0===t._a[fr]&&0===t._a[pr]&&(t._nextDay=!0,t._a[hr]=0), -t._d=(t._useUTC?ot:st).apply(null,a),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[hr]=24)}}function xt(t){var e,n,r,i,a,s,o;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(a=1,s=4,n=_t(e.GG,t._a[ur],ht(Bt(),1,4).year),r=_t(e.W,1),i=_t(e.E,1)):(a=t._locale._week.dow,s=t._locale._week.doy,n=_t(e.gg,t._a[ur],ht(Bt(),a,s).year),r=_t(e.w,1),null!=e.d?(i=e.d,a>i&&++r):i=null!=e.e?e.e+a:a),o=mt(n,r,i,s,a),t._a[ur]=o.year,t._dayOfYear=o.dayOfYear}function wt(t){if(t._f===n.ISO_8601)return void it(t);t._a=[],h(t).empty=!0;var e,r,i,a,s,o=""+t._i,u=o.length,c=0;for(i=j(t._f,t._locale).match(Un)||[],e=0;e0&&h(t).unusedInput.push(s),o=o.slice(o.indexOf(r)+r.length),c+=r.length),Vn[a]?(r?h(t).empty=!1:h(t).unusedTokens.push(a),H(a,r,t)):t._strict&&!r&&h(t).unusedTokens.push(a);h(t).charsLeftOver=u-c,o.length>0&&h(t).unusedInput.push(o),h(t).bigHour===!0&&t._a[hr]<=12&&t._a[hr]>0&&(h(t).bigHour=void 0),t._a[hr]=kt(t._locale,t._a[hr],t._meridiem),At(t),tt(t)}function kt(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(r=t.isPM(n),r&&12>e&&(e+=12),r||12!==e||(e=0),e):e}function Et(t){var e,n,r,i,a;if(0===t._f.length)return h(t).invalidFormat=!0,void(t._d=new Date(0/0));for(i=0;ia)&&(r=a,n=e));u(t,n||e)}function Dt(t){if(!t._d){var e=T(t._i);t._a=[e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],At(t)}}function Ct(t){var e=new g(tt(Ft(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Ft(t){var e=t._i,n=t._f;return t._locale=t._locale||D(t._l),null===e||void 0===n&&""===e?f({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),y(e)?new g(tt(e)):(i(n)?Et(t):n?wt(t):a(e)?t._d=e:Tt(t),t))}function Tt(t){var e=t._i;void 0===e?t._d=new Date:a(e)?t._d=new Date(+e):"string"==typeof e?at(t):i(e)?(t._a=s(e.slice(0),function(t){return parseInt(t,10)}),At(t)):"object"==typeof e?Dt(t):"number"==typeof e?t._d=new Date(e):n.createFromInputFallback(t)}function St(t,e,n,r,i){var a={};return"boolean"==typeof n&&(r=n,n=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=t,a._f=e,a._strict=r,Ct(a)}function Bt(t,e,n,r){return St(t,e,n,r,!1)}function It(t,e){var n,r;if(1===e.length&&i(e[0])&&(e=e[0]),!e.length)return Bt();for(n=e[0],r=1;rt&&(t=-t,n="-"),n+M(~~(t/60),2)+e+M(~~t%60,2)})}function Rt(t){var e=(t||"").match(rr)||[],n=e[e.length-1]||[],r=(n+"").match(Dr)||["-",0,0],i=+(60*r[1])+v(r[2]);return"+"===r[0]?i:-i}function jt(t,e){var r,i;return e._isUTC?(r=e.clone(),i=(y(t)||a(t)?+t:+Bt(t))-+r,r._d.setTime(+r._d+i),n.updateOffset(r,!1),r):Bt(t).local()}function Yt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function $t(t,e){var r,i=this._offset||0;return null!=t?("string"==typeof t&&(t=Rt(t)),Math.abs(t)<16&&(t=60*t),!this._isUTC&&e&&(r=Yt(this)),this._offset=t,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==t&&(!e||this._changeInProgress?re(this,Qt(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:Yt(this)}function Ut(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Gt(t){return this.utcOffset(0,t)}function Wt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Yt(this),"m")),this}function Vt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Rt(this._i)),this}function Ht(t){return t=t?Bt(t).utcOffset():0,(this.utcOffset()-t)%60===0}function zt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function qt(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var t={};if(p(t,this),t=Ft(t),t._a){var e=t._isUTC?c(t._a):Bt(t._a);this._isDSTShifted=this.isValid()&&_(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Xt(){return!this._isUTC}function Zt(){return this._isUTC}function Kt(){return this._isUTC&&0===this._offset}function Qt(t,e){var n,r,i,a=t,s=null;return Nt(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(a={},e?a[e]=t:a.milliseconds=t):(s=Cr.exec(t))?(n="-"===s[1]?-1:1,a={y:0,d:v(s[lr])*n,h:v(s[hr])*n,m:v(s[dr])*n,s:v(s[fr])*n,ms:v(s[pr])*n}):(s=Fr.exec(t))?(n="-"===s[1]?-1:1,a={y:Jt(s[2],n),M:Jt(s[3],n),d:Jt(s[4],n),h:Jt(s[5],n),m:Jt(s[6],n),s:Jt(s[7],n),w:Jt(s[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(i=ee(Bt(a.from),Bt(a.to)),a={},a.ms=i.milliseconds,a.M=i.months),r=new Lt(a),Nt(t)&&o(t,"_locale")&&(r._locale=t._locale),r}function Jt(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function te(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function ee(t,e){var n;return e=jt(e,t),t.isBefore(e)?n=te(t,e):(n=te(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n}function ne(t,e){return function(n,r){var i,a;return null===r||isNaN(+r)||(rt(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),a=n,n=r,r=a),n="string"==typeof n?+n:n,i=Qt(n,r),re(this,i,t),this}}function re(t,e,r,i){var a=e._milliseconds,s=e._days,o=e._months;i=null==i?!0:i,a&&t._d.setTime(+t._d+a*r),s&&I(t,"Date",B(t,"Date")+s*r),o&&K(t,B(t,"Month")+o*r),i&&n.updateOffset(t,s||o)}function ie(t,e){var n=t||Bt(),r=jt(n,this).startOf("day"),i=this.diff(r,"days",!0),a=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse";return this.format(e&&e[a]||this.localeData().calendar(a,this,Bt(n)))}function ae(){return new g(this)}function se(t,e){var n;return e=F("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=y(t)?t:Bt(t),+this>+t):(n=y(t)?+t:+Bt(t),n<+this.clone().startOf(e))}function oe(t,e){var n;return e=F("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=y(t)?t:Bt(t),+t>+this):(n=y(t)?+t:+Bt(t),+this.clone().endOf(e)e-a?(n=t.clone().add(i-1,"months"),r=(e-a)/(a-n)):(n=t.clone().add(i+1,"months"),r=(e-a)/(n-a)),-(i+r)}function de(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function fe(){var t=this.clone().utc();return 0e;e++)if(this._weekdaysParse[e]||(n=Bt([2e3,1]).day(e),r="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[e]=new RegExp(r.replace(".",""),"i")),this._weekdaysParse[e].test(t))return e}function Ge(t){var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Re(t,this.localeData()),this.add(t-e,"d")):e}function We(t){var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Ve(t){return null==t?this.day()||7:this.day(this.day()%7?t:t-7)}function He(t,e){L(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function ze(t,e){return e._meridiemParse}function qe(t){return"p"===(t+"").toLowerCase().charAt(0)}function Xe(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function Ze(t,e){e[pr]=v(1e3*("0."+t))}function Ke(){return this._isUTC?"UTC":""}function Qe(){return this._isUTC?"Coordinated Universal Time":""}function Je(t){return Bt(1e3*t)}function tn(){return Bt.apply(null,arguments).parseZone()}function en(t,e,n){var r=this._calendar[t];return"function"==typeof r?r.call(e,n):r}function nn(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function rn(){return this._invalidDate}function an(t){return this._ordinal.replace("%d",t)}function sn(t){return t}function on(t,e,n,r){var i=this._relativeTime[n];return"function"==typeof i?i(t,e,n,r):i.replace(/%d/i,t)}function un(t,e){var n=this._relativeTime[t>0?"future":"past"];return"function"==typeof n?n(e):n.replace(/%s/i,e)}function cn(t){var e,n;for(n in t)e=t[n],"function"==typeof e?this[n]=e:this["_"+n]=e;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function ln(t,e,n,r){var i=D(),a=c().set(r,e);return i[n](a,t)}function hn(t,e,n,r,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return ln(t,e,n,i);var a,s=[];for(a=0;r>a;a++)s[a]=ln(t,a,n,i);return s}function dn(t,e){return hn(t,e,"months",12,"month")}function fn(t,e){return hn(t,e,"monthsShort",12,"month")}function pn(t,e){return hn(t,e,"weekdays",7,"day")}function gn(t,e){return hn(t,e,"weekdaysShort",7,"day")}function yn(t,e){return hn(t,e,"weekdaysMin",7,"day")}function mn(){var t=this._data;return this._milliseconds=Kr(this._milliseconds),this._days=Kr(this._days),this._months=Kr(this._months),t.milliseconds=Kr(t.milliseconds),t.seconds=Kr(t.seconds),t.minutes=Kr(t.minutes),t.hours=Kr(t.hours),t.months=Kr(t.months),t.years=Kr(t.years),this}function vn(t,e,n,r){var i=Qt(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function _n(t,e){return vn(this,t,e,1)}function bn(t,e){return vn(this,t,e,-1)}function An(t){return 0>t?Math.floor(t):Math.ceil(t)}function xn(){var t,e,n,r,i,a=this._milliseconds,s=this._days,o=this._months,u=this._data;return a>=0&&s>=0&&o>=0||0>=a&&0>=s&&0>=o||(a+=864e5*An(kn(o)+s),s=0,o=0),u.milliseconds=a%1e3,t=m(a/1e3),u.seconds=t%60,e=m(t/60),u.minutes=e%60,n=m(e/60),u.hours=n%24,s+=m(n/24),i=m(wn(s)),o+=i,s-=An(kn(i)),r=m(o/12),o%=12,u.days=s,u.months=o,u.years=r,this}function wn(t){return 4800*t/146097}function kn(t){return 146097*t/4800}function En(t){var e,n,r=this._milliseconds;if(t=F(t),"month"===t||"year"===t)return e=this._days+r/864e5,n=this._months+wn(e),"month"===t?n:n/12;switch(e=this._days+Math.round(kn(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}}function Dn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*v(this._months/12)}function Cn(t){return function(){return this.as(t)}}function Fn(t){return t=F(t),this[t+"s"]()}function Tn(t){return function(){return this._data[t]}}function Sn(){return m(this.days()/7)}function Bn(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function In(t,e,n){var r=Qt(t).abs(),i=fi(r.as("s")),a=fi(r.as("m")),s=fi(r.as("h")),o=fi(r.as("d")),u=fi(r.as("M")),c=fi(r.as("y")),l=i0,l[4]=n,Bn.apply(null,l)}function On(t,e){return void 0===pi[t]?!1:void 0===e?pi[t]:(pi[t]=e,!0)}function Mn(t){var e=this.localeData(),n=In(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function Ln(){var t,e,n,r=gi(this._milliseconds)/1e3,i=gi(this._days),a=gi(this._months);t=m(r/60),e=m(t/60),r%=60,t%=60,n=m(a/12),a%=12;var s=n,o=a,u=i,c=e,l=t,h=r,d=this.asSeconds();return d?(0>d?"-":"")+"P"+(s?s+"Y":"")+(o?o+"M":"")+(u?u+"D":"")+(c||l||h?"T":"")+(c?c+"H":"")+(l?l+"M":"")+(h?h+"S":""):"P0D"}var Nn,Pn,Rn=n.momentProperties=[],jn=!1,Yn={},$n={},Un=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Gn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Wn={},Vn={},Hn=/\d/,zn=/\d\d/,qn=/\d{3}/,Xn=/\d{4}/,Zn=/[+-]?\d{6}/,Kn=/\d\d?/,Qn=/\d{1,3}/,Jn=/\d{1,4}/,tr=/[+-]?\d{1,6}/,er=/\d+/,nr=/[+-]?\d+/,rr=/Z|[+-]\d\d:?\d\d/gi,ir=/[+-]?\d+(\.\d{1,3})?/,ar=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,sr={},or={},ur=0,cr=1,lr=2,hr=3,dr=4,fr=5,pr=6;L("M",["MM",2],"Mo",function(){return this.month()+1}),L("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),L("MMMM",0,0,function(t){return this.localeData().months(this,t)}),C("month","M"),$("M",Kn),$("MM",Kn,zn),$("MMM",ar),$("MMMM",ar),W(["M","MM"],function(t,e){e[cr]=v(t)-1}),W(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);null!=i?e[cr]=i:h(n).invalidMonth=t});var gr="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),yr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),mr={};n.suppressDeprecationWarnings=!1;var vr=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_r=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],br=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Ar=/^\/?Date\((\-?\d+)/i;n.createFromInputFallback=nt("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),L(0,["YY",2],0,function(){return this.year()%100}),L(0,["YYYY",4],0,"year"),L(0,["YYYYY",5],0,"year"),L(0,["YYYYYY",6,!0],0,"year"),C("year","y"),$("Y",nr),$("YY",Kn,zn),$("YYYY",Jn,Xn),$("YYYYY",tr,Zn),$("YYYYYY",tr,Zn),W(["YYYYY","YYYYYY"],ur),W("YYYY",function(t,e){e[ur]=2===t.length?n.parseTwoDigitYear(t):v(t)}),W("YY",function(t,e){e[ur]=n.parseTwoDigitYear(t)}),n.parseTwoDigitYear=function(t){return v(t)+(v(t)>68?1900:2e3)};var xr=S("FullYear",!1);L("w",["ww",2],"wo","week"),L("W",["WW",2],"Wo","isoWeek"),C("week","w"),C("isoWeek","W"),$("w",Kn),$("ww",Kn,zn),$("W",Kn),$("WW",Kn,zn),V(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=v(t)});var wr={dow:0,doy:6};L("DDD",["DDDD",3],"DDDo","dayOfYear"),C("dayOfYear","DDD"),$("DDD",Qn),$("DDDD",qn),W(["DDD","DDDD"],function(t,e,n){n._dayOfYear=v(t)}),n.ISO_8601=function(){};var kr=nt("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Bt.apply(null,arguments);return this>t?this:t}),Er=nt("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Bt.apply(null,arguments);return t>this?this:t});Pt("Z",":"),Pt("ZZ",""),$("Z",rr),$("ZZ",rr),W(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Rt(t)});var Dr=/([\+\-]|\d\d)/gi;n.updateOffset=function(){};var Cr=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Fr=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Qt.fn=Lt.prototype;var Tr=ne(1,"add"),Sr=ne(-1,"subtract");n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Br=nt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});L(0,["gg",2],0,function(){return this.weekYear()%100}),L(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Be("gggg","weekYear"),Be("ggggg","weekYear"),Be("GGGG","isoWeekYear"),Be("GGGGG","isoWeekYear"),C("weekYear","gg"),C("isoWeekYear","GG"),$("G",nr),$("g",nr),$("GG",Kn,zn),$("gg",Kn,zn),$("GGGG",Jn,Xn),$("gggg",Jn,Xn),$("GGGGG",tr,Zn),$("ggggg",tr,Zn),V(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=v(t)}),V(["gg","GG"],function(t,e,r,i){e[i]=n.parseTwoDigitYear(t)}),L("Q",0,0,"quarter"),C("quarter","Q"),$("Q",Hn),W("Q",function(t,e){e[cr]=3*(v(t)-1)}),L("D",["DD",2],"Do","date"),C("date","D"),$("D",Kn),$("DD",Kn,zn),$("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),W(["D","DD"],lr),W("Do",function(t,e){e[lr]=v(t.match(Kn)[0],10)});var Ir=S("Date",!0);L("d",0,"do","day"),L("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),L("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),L("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),L("e",0,0,"weekday"),L("E",0,0,"isoWeekday"),C("day","d"),C("weekday","e"),C("isoWeekday","E"),$("d",Kn),$("e",Kn),$("E",Kn),$("dd",ar),$("ddd",ar),$("dddd",ar),V(["dd","ddd","dddd"],function(t,e,n){var r=n._locale.weekdaysParse(t);null!=r?e.d=r:h(n).invalidWeekday=t}),V(["d","e","E"],function(t,e,n,r){e[r]=v(t)});var Or="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Mr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Lr="Su_Mo_Tu_We_Th_Fr_Sa".split("_");L("H",["HH",2],0,"hour"),L("h",["hh",2],0,function(){return this.hours()%12||12}),He("a",!0),He("A",!1),C("hour","h"),$("a",ze),$("A",ze),$("H",Kn),$("h",Kn),$("HH",Kn,zn),$("hh",Kn,zn),W(["H","HH"],hr),W(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),W(["h","hh"],function(t,e,n){e[hr]=v(t),h(n).bigHour=!0});var Nr=/[ap]\.?m?\.?/i,Pr=S("Hours",!0);L("m",["mm",2],0,"minute"),C("minute","m"),$("m",Kn),$("mm",Kn,zn),W(["m","mm"],dr);var Rr=S("Minutes",!1);L("s",["ss",2],0,"second"),C("second","s"),$("s",Kn),$("ss",Kn,zn),W(["s","ss"],fr);var jr=S("Seconds",!1);L("S",0,0,function(){return~~(this.millisecond()/100)}),L(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),L(0,["SSS",3],0,"millisecond"),L(0,["SSSS",4],0,function(){return 10*this.millisecond()}),L(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),L(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),L(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),L(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),L(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),C("millisecond","ms"),$("S",Qn,Hn),$("SS",Qn,zn),$("SSS",Qn,qn);var Yr;for(Yr="SSSS";Yr.length<=9;Yr+="S")$(Yr,er);for(Yr="S";Yr.length<=9;Yr+="S")W(Yr,Ze);var $r=S("Milliseconds",!1);L("z",0,0,"zoneAbbr"),L("zz",0,0,"zoneName");var Ur=g.prototype;Ur.add=Tr,Ur.calendar=ie,Ur.clone=ae,Ur.diff=le,Ur.endOf=xe,Ur.format=pe,Ur.from=ge,Ur.fromNow=ye,Ur.to=me,Ur.toNow=ve,Ur.get=O,Ur.invalidAt=Se,Ur.isAfter=se,Ur.isBefore=oe,Ur.isBetween=ue,Ur.isSame=ce,Ur.isValid=Fe,Ur.lang=Br,Ur.locale=_e,Ur.localeData=be,Ur.max=Er,Ur.min=kr,Ur.parsingFlags=Te,Ur.set=O,Ur.startOf=Ae,Ur.subtract=Sr,Ur.toArray=De,Ur.toObject=Ce,Ur.toDate=Ee,Ur.toISOString=fe,Ur.toJSON=fe,Ur.toString=de,Ur.unix=ke,Ur.valueOf=we,Ur.year=xr,Ur.isLeapYear=lt,Ur.weekYear=Oe,Ur.isoWeekYear=Me,Ur.quarter=Ur.quarters=Pe,Ur.month=Q,Ur.daysInMonth=J,Ur.week=Ur.weeks=gt,Ur.isoWeek=Ur.isoWeeks=yt,Ur.weeksInYear=Ne,Ur.isoWeeksInYear=Le,Ur.date=Ir,Ur.day=Ur.days=Ge,Ur.weekday=We,Ur.isoWeekday=Ve,Ur.dayOfYear=vt,Ur.hour=Ur.hours=Pr,Ur.minute=Ur.minutes=Rr,Ur.second=Ur.seconds=jr,Ur.millisecond=Ur.milliseconds=$r,Ur.utcOffset=$t,Ur.utc=Gt,Ur.local=Wt,Ur.parseZone=Vt,Ur.hasAlignedHourOffset=Ht,Ur.isDST=zt,Ur.isDSTShifted=qt,Ur.isLocal=Xt,Ur.isUtcOffset=Zt,Ur.isUtc=Kt,Ur.isUTC=Kt,Ur.zoneAbbr=Ke,Ur.zoneName=Qe,Ur.dates=nt("dates accessor is deprecated. Use date instead.",Ir),Ur.months=nt("months accessor is deprecated. Use month instead",Q),Ur.years=nt("years accessor is deprecated. Use year instead",xr),Ur.zone=nt("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Ut);var Gr=Ur,Wr={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Vr={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Hr="Invalid date",zr="%d",qr=/\d{1,2}/,Xr={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Zr=b.prototype;Zr._calendar=Wr,Zr.calendar=en,Zr._longDateFormat=Vr,Zr.longDateFormat=nn,Zr._invalidDate=Hr,Zr.invalidDate=rn,Zr._ordinal=zr,Zr.ordinal=an,Zr._ordinalParse=qr,Zr.preparse=sn,Zr.postformat=sn,Zr._relativeTime=Xr,Zr.relativeTime=on,Zr.pastFuture=un,Zr.set=cn,Zr.months=q,Zr._months=gr,Zr.monthsShort=X,Zr._monthsShort=yr,Zr.monthsParse=Z,Zr.week=dt,Zr._week=wr,Zr.firstDayOfYear=pt,Zr.firstDayOfWeek=ft,Zr.weekdays=je,Zr._weekdays=Or,Zr.weekdaysMin=$e,Zr._weekdaysMin=Lr,Zr.weekdaysShort=Ye,Zr._weekdaysShort=Mr,Zr.weekdaysParse=Ue,Zr.isPM=qe,Zr._meridiemParse=Nr,Zr.meridiem=Xe,k("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===v(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),n.lang=nt("moment.lang is deprecated. Use moment.locale instead.",k),n.langData=nt("moment.langData is deprecated. Use moment.localeData instead.",D);var Kr=Math.abs,Qr=Cn("ms"),Jr=Cn("s"),ti=Cn("m"),ei=Cn("h"),ni=Cn("d"),ri=Cn("w"),ii=Cn("M"),ai=Cn("y"),si=Tn("milliseconds"),oi=Tn("seconds"),ui=Tn("minutes"),ci=Tn("hours"),li=Tn("days"),hi=Tn("months"),di=Tn("years"),fi=Math.round,pi={s:45,m:45,h:22,d:26,M:11},gi=Math.abs,yi=Lt.prototype;yi.abs=mn,yi.add=_n,yi.subtract=bn,yi.as=En,yi.asMilliseconds=Qr,yi.asSeconds=Jr,yi.asMinutes=ti,yi.asHours=ei,yi.asDays=ni,yi.asWeeks=ri,yi.asMonths=ii,yi.asYears=ai,yi.valueOf=Dn,yi._bubble=xn,yi.get=Fn,yi.milliseconds=si,yi.seconds=oi,yi.minutes=ui,yi.hours=ci,yi.days=li,yi.weeks=Sn,yi.months=hi,yi.years=di,yi.humanize=Mn,yi.toISOString=Ln,yi.toString=Ln,yi.toJSON=Ln,yi.locale=_e,yi.localeData=be,yi.toIsoString=nt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ln),yi.lang=Br,L("X",0,0,"unix"),L("x",0,0,"valueOf"),$("x",nr),$("X",ir),W("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),W("x",function(t,e,n){n._d=new Date(v(t))}),n.version="2.10.6",r(Bt),n.fn=Gr,n.min=Ot,n.max=Mt,n.utc=c,n.unix=Je,n.months=dn,n.isDate=a,n.locale=k,n.invalid=f,n.duration=Qt,n.isMoment=y,n.weekdays=pn,n.parseZone=tn,n.localeData=D,n.isDuration=Nt,n.monthsShort=fn,n.weekdaysMin=yn,n.defineLocale=E,n.weekdaysShort=gn,n.normalizeUnits=F,n.relativeTimeThreshold=On;var mi=n;return mi})},{}],105:[function(t,e){e.exports={name:"mermaid",version:"0.5.8",description:"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams and gantt charts.",main:"src/mermaid.js",keywords:["diagram","markdown","flowchart","sequence diagram","gantt"],bin:{mermaid:"./bin/mermaid.js"},scripts:{live:"live-server ./test/examples",lint:"node node_modules/eslint/bin/eslint.js src",jison:"gulp jison_legacy",karma:"node node_modules/karma/bin/karma start karma.conf.js --single-run",watch:"source ./scripts/watch.sh",doc:"rm -r build;rm -r dist/www;gulp vartree;cp dist/www/all.html ../mermaid-pages/index.html;cp dist/mermaid.js ../mermaid-pages/javascripts/lib;cp dist/mermaid.forest.css ../mermaid-pages/stylesheets",tape:"node node_modules/tape/bin/tape test/cli_test-*.js",jasmine:"npm run jison &&node node_modules/jasmine-es6/bin/jasmine.js",pretest:"npm run jison",test:"npm run dist && npm run karma && npm run tape","dist-slim-mermaid":"node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.slim.js -x d3 && cat dist/mermaid.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.slim.min.js","dist-slim-mermaidAPI":"node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.slim.js -x d3 && cat dist/mermaidAPI.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.slim.min.js","dist-mermaid":"node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.js && cat dist/mermaid.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.min.js","dist-mermaidAPI":"node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.js && cat dist/mermaidAPI.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.min.js",dist:"npm run dist-slim-mermaid && npm run dist-slim-mermaidAPI && npm run dist-mermaid && npm run dist-mermaidAPI"},repository:{type:"git",url:"https://github.com/knsv/mermaid"},author:"Knut Sveidqvist",license:"MIT",dependencies:{chalk:"^0.5.1",d3:"3.5.6",dagre:"^0.7.4","dagre-d3":"0.4.10",he:"^0.5.0",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.9.0",semver:"^4.1.1",which:"^1.0.8"},devDependencies:{async:"^0.9.0","babel-eslint":"^4.1.3",babelify:"^6.4.0",browserify:"~6.2.0",clone:"^0.2.0","codeclimate-test-reporter":"0.0.4",dateformat:"^1.0.11",dox:"^0.8.0",eslint:"^1.6.0","eslint-watch":"^2.1.2","event-stream":"^3.2.0",foundation:"^4.2.1-1","front-matter":"^0.2.0",gulp:"~3.9.0","gulp-bower":"0.0.10","gulp-browserify":"^0.5.0","gulp-bump":"^0.1.11","gulp-concat":"~2.4.1","gulp-data":"^1.1.1","gulp-dox":"^0.1.6","gulp-ext-replace":"^0.2.0","gulp-filelog":"^0.4.1","gulp-front-matter":"^1.2.3","gulp-hogan":"^1.1.0","gulp-if":"^1.2.5","gulp-insert":"^0.4.0","gulp-istanbul":"^0.4.0","gulp-jasmine":"~2.1.0","gulp-jasmine-browser":"^0.2.3","gulp-jison":"~1.2.0","gulp-jshint":"^1.9.0","gulp-less":"^3.0.1","gulp-livereload":"^3.8.0","gulp-marked":"^1.0.0","gulp-mdvars":"^2.0.0","gulp-qunit":"~1.2.1","gulp-rename":"~1.2.0","gulp-shell":"^0.2.10","gulp-tag-version":"^1.2.1","gulp-uglify":"~1.0.1","gulp-util":"^3.0.7","gulp-vartree":"^2.0.1","hogan.js":"^3.0.2",jasmine:"2.3.2","jasmine-es6":"0.0.18",jison:"zaach/jison",jsdom:"^7.0.2","jshint-stylish":"^2.0.1",karma:"^0.13.15","karma-babel-preprocessor":"^6.0.1","karma-browserify":"^4.4.0","karma-jasmine":"^0.3.6","karma-phantomjs-launcher":"^0.2.1","live-server":"^0.9.0","map-stream":"0.0.6",marked:"^0.3.2","mock-browser":"^0.91.34",path:"^0.4.9",phantomjs:"^1.9.18",proxyquire:"^1.7.3","proxyquire-universal":"^1.0.8",proxyquireify:"^3.0.0","require-dir":"^0.3.0",rewire:"^2.1.3",rimraf:"^2.2.8",tape:"^3.0.3",testdom:"^2.0.0",uglifyjs:"^2.4.10","vinyl-source-stream":"^1.1.0",watchify:"^3.6.1"}}},{}],106:[function(t,e){"use strict";var n;if(t)try{n=t("d3")}catch(r){}n||(n=window.d3),e.exports=n,function(){var t=!1;if(t="tspans",n.selection.prototype.textwrap)return!1;if("undefined"==typeof t)var t=!1;n.selection.prototype.textwrap=n.selection.enter.prototype.textwrap=function(e,r){var i,r=parseInt(r)||0,a=this,s=function(t){var e=t[0][0],r=e.tagName.toString();if("rect"!==r)return!1;var i={};return i.x=n.select(e).attr("x")||0,i.y=n.select(e).attr("y")||0,i.width=n.select(e).attr("width")||0,i.height=n.select(e).attr("height")||0,i.attr=t.attr,i},o=function(t){if(t.attr||(t.attr=function(t){return this[t]?this[t]:void 0}),"object"==typeof t&&"undefined"!=typeof t.x&&"undefined"!=typeof t.y&&"undefined"!=typeof t.width&&"undefined"!=typeof t.height)return t;if("function"==typeof Array.isArray&&Array.isArray(t)||"[object Array]"===Object.prototype.toString.call(t)){var e=s(t);return e}return!1},u=function(t,e){var n=t;return 0!==e&&(n.x=parseInt(n.x)+e,n.y=parseInt(n.y)+e,n.width-=2*e,n.height-=2*e),n},c=o(e);if(r&&(c=u(c,r)),0!=a.length&&n&&e&&c){e=c;var l,h=function(t){var r=n.select(t[0].parentNode),a=r.select("text"),s=a.style("line-height"),o=a.text();a.remove();var u=r.append("foreignObject");u.attr("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility").attr("x",e.x).attr("y",e.y).attr("width",e.width).attr("height",e.height);var c=u.append("xhtml:div").attr("class","wrapped");c.style("height",e.height).style("width",e.width).html(o),s&&c.style("line-height",s),i=r.select("foreignObject")},d=function(t){var a,s=t[0],o=s.parentNode,u=n.select(s),c=s.getBBox().height,l=s.getBBox().width,h=c,d=u.style("line-height");if(a=d&&parseInt(d)?parseInt(d.replace("px","")):h,l>e.width){var f=u.text();if(u.text(""),f){var p,g;if(-1!==f.indexOf(" ")){var p=" ";g=f.split(" ")}else{p="";var y=f.length,m=Math.ceil(l/e.width),v=Math.floor(y/m);v*m>=y||m++;for(var _,b,g=[],A=0;m>A;A++)b=A*v,_=f.substr(b,v),g.push(_)}for(var x=[],w=0,k={},A=0;Ae.width&&C&&""!==C&&(w+=F,k={string:C,width:F,offset:w},x.push(k),u.text(""),u.text(D),A==g.length-1&&(E=D,u.text(E),T=s.getComputedTextLength())),A==g.length-1){u.text("");var S=E;S&&""!==S&&(T-w>0&&(T-=w),k={string:S,width:T,offset:w},x.push(k))}}var B;u.text("");for(var A=0;A0){x[A-1]}A*a0?a:void 0}),B.attr("x",function(){var t=e.x;return r&&(t+=r),t}))}}}u.attr("y",function(){var t=e.y;return a&&(t+=a),r&&(t+=r),t}),u.attr("x",function(){var t=e.x;return r&&(t+=r),t}),i=n.select(o).selectAll("text")};t&&("foreignobjects"==t?l=h:"tspans"==t&&(l=d)),t||(l="undefined"!=typeof SVGForeignObjectElement?h:d);for(var f=0;f "+t.w+": "+JSON.stringify(s.edge(t))),p(i,s.edge(t),s.edge(t).relation)}),i.attr("height","100%"),i.attr("width","100%")}},{"../../d3":106,"../../logger":125,"./classDb":107,"./parser/classDiagram":109,dagre:53}],109:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,11],r=[1,12],i=[1,13],a=[1,15],s=[1,16],o=[1,17],u=[6,8],c=[1,26],l=[1,27],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[6,8,13,17,23,26,27,28,29,30,31],y=[6,8,13,17,23,26,27,28,29,30,31,45,46,47],m=[23,45,46,47],v=[23,30,31,45,46,47],_=[23,26,27,28,29,45,46,47],b=[6,8,13],A=[1,46],x={trace:function(){},yy:{},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},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"},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]],performAction:function(t,e,n,r,i,a){var s=a.length-1;switch(i){case 5:this.$=a[s-1]+a[s];break;case 6:this.$=a[s];break;case 7:r.addRelation(a[s]);break;case 8:a[s-1].title=r.cleanupLabel(a[s]),r.addRelation(a[s-1]);break;case 12:r.addMembers(a[s-3],a[s-1]);break;case 13:this.$=[a[s]];break;case 14:a[s].push(a[s-1]),this.$=a[s];break;case 15:break;case 16:r.addMembers(a[s-1],r.cleanupLabel(a[s]));break;case 17:console.warn("Member",a[s]);break;case 18:break;case 19:this.$={id1:a[s-2],id2:a[s],relation:a[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 20:this.$={id1:a[s-3],id2:a[s],relation:a[s-1],relationTitle1:a[s-2],relationTitle2:"none"};break;case 21:this.$={id1:a[s-3],id2:a[s],relation:a[s-2],relationTitle1:"none",relationTitle2:a[s-1]};break;case 22:this.$={id1:a[s-4],id2:a[s],relation:a[s-2],relationTitle1:a[s-3],relationTitle2:a[s-1]};break;case 23:this.$={type1:a[s-2],type2:a[s],lineType:a[s-1]};break;case 24:this.$={type1:"none",type2:a[s],lineType:a[s-1]};break;case 25:this.$={type1:a[s-1],type2:"none",lineType:a[s]};break;case 26:this.$={type1:"none",type2:"none",lineType:a[s]};break;case 27:this.$=r.relationType.AGGREGATION;break;case 28:this.$=r.relationType.EXTENSION;break;case 29:this.$=r.relationType.COMPOSITION;break;case 30:this.$=r.relationType.DEPENDENCY;break;case 31:this.$=r.lineType.LINE;break;case 32:this.$=r.lineType.DOTTED_LINE}},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:n,20:r,21:i,45:a,46:s,47:o},{8:[1,18]},{6:[1,19],8:[2,3]},e(u,[2,7],{13:[1,20]}),e(u,[2,9]),e(u,[2,10]),e(u,[2,15],{22:21,24:24,25:25,13:[1,23],23:[1,22],26:c,27:l,28:h,29:d,30:f,31:p}),{10:32,11:14,45:a,46:s,47:o},e(u,[2,17]),e(u,[2,18]),e(g,[2,6],{11:14,10:33,45:a,46:s,47:o}),e(y,[2,46]),e(y,[2,47]),e(y,[2,48]),{1:[2,2]},{7:34,9:6,10:10,11:14,12:7,14:8,15:9,16:n,20:r,21:i,45:a,46:s,47:o},e(u,[2,8]),{10:35,11:14,23:[1,36],45:a,46:s,47:o},{22:37,24:24,25:25,26:c,27:l,28:h,29:d,30:f,31:p},e(u,[2,16]),{25:38,30:f,31:p},e(m,[2,26],{24:39,26:c,27:l,28:h,29:d}),e(v,[2,27]),e(v,[2,28]),e(v,[2,29]),e(v,[2,30]),e(_,[2,31]),e(_,[2,32]),e(u,[2,11],{17:[1,40]}),e(g,[2,5]),{8:[2,4]},e(b,[2,19]),{10:41,11:14,45:a,46:s,47:o},{10:42,11:14,23:[1,43],45:a,46:s,47:o},e(m,[2,25],{24:44,26:c,27:l,28:h,29:d}),e(m,[2,24]),{18:45,20:A},e(b,[2,21]),e(b,[2,20]),{10:47,11:14,45:a,46:s,47:o},e(m,[2,23]),{19:[1,48]},{18:49,19:[2,13],20:A},e(b,[2,22]),e(u,[2,12]),{19:[2,14]}],defaultActions:{2:[2,1],18:[2,2],34:[2,4],49:[2,14]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,A,x,w,k,E,D,C=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},F={};;){if(b=n[n.length-1],this.defaultActions[b]?A=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=C()),A=a[b]&&a[b][v]),"undefined"==typeof A||!A.length||!A[0]){var T="";D=[];for(w in a[b])this.terminals_[w]&&w>l&&D.push("'"+this.terminals_[w]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(A[0]){case 1:n.push(v),r.push(f.yytext),i.push(f.yylloc),n.push(A[1]),v=null,_?(v=_,_=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[A[1]][1],F.$=r[r.length-k],F._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),x=this.performAction.apply(F,[s,u,o,p.yy,A[1],r,i].concat(d)),"undefined"!=typeof x)return x;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[A[1]][0]),r.push(F.$),i.push(F._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},w=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:break;case 1:return 6;case 2:break;case 3:return 5;case 4:return this.begin("struct"),17;case 5:return this.popState(),19;case 6:break;case 7:return"MEMBER";case 8:return 16;case 9:this.begin("string");break;case 10:this.popState();break;case 11:return"STR";case 12:return 27;case 13:return 27;case 14:return 29;case 15:return 29;case 16:return 28;case 17:return 26;case 18:return 30;case 19:return 31;case 20:return 13;case 21:return 43;case 22:return"DOT";case 23:return"PLUS";case 24:return 40;case 25:return"EQUALS";case 26:return"EQUALS";case 27:return 47;case 28:return"PUNCTUATION";case 29:return 46;case 30:return 45;case 31:return 42;case 32:return 8}},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)/,/^(?:$)/],conditions:{string:{rules:[10,11],inclusive:!1},struct:{rules:[5,6,7],inclusive:!1},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:!0}}};return t}();return x.lexer=w,t.prototype=x,x.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],110:[function(t,e,n){(function(e){"use strict";var r=t("../../logger"),i=new r.Log,a="",s=!1;n.setMessage=function(t){i.debug("Setting message to: "+t),a=t},n.getMessage=function(){return a},n.setInfo=function(t){s=t},n.getInfo=function(){return s},n.parseError=function(t,n){e.mermaidAPI.parseError(t,n)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../logger":125}],111:[function(t,e,n){"use strict";var r=t("./exampleDb"),i=t("./parser/example.js"),a=t("../../d3"),s=t("../../logger"),o=new s.Log;n.draw=function(t,e,n){var s;s=i.parser,s.yy=r,o.debug("Renering example diagram"),s.parse(t);var u=a.select("#"+e),c=u.append("g");c.append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("mermaid "+n),u.attr("height",100),u.attr("width",400)}},{"../../d3":106,"../../logger":125,"./exampleDb":110,"./parser/example.js":112}],112:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[6,9,10,12],r={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,message:11,say:12,TXT:13,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo",12:"say",13:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1],[8,1],[11,2]],performAction:function(t,e,n,r,i,a){var s=a.length-1;switch(i){case 1:return r;case 4:break;case 6:r.setInfo(!0);break;case 7:r.setMessage(a[s]);break;case 8:this.$=a[s-1].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},e(n,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8],11:9,12:[1,10]},{1:[2,1]},e(n,[2,3]),e(n,[2,4]),e(n,[2,5]),e(n,[2,6]),e(n,[2,7]),{13:[1,11]},e(n,[2,8])],defaultActions:{4:[2,1]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,A,x,w,k,E,D,C=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},F={};;){if(b=n[n.length-1],this.defaultActions[b]?A=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=C()),A=a[b]&&a[b][v]),"undefined"==typeof A||!A.length||!A[0]){var T="";D=[];for(w in a[b])this.terminals_[w]&&w>l&&D.push("'"+this.terminals_[w]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(A[0]){case 1:n.push(v),r.push(f.yytext),i.push(f.yylloc),n.push(A[1]),v=null,_?(v=_,_=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[A[1]][1],F.$=r[r.length-k],F._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),x=this.performAction.apply(F,[s,u,o,p.yy,A[1],r,i].concat(d)),"undefined"!=typeof x)return x;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[A[1]][0]),r.push(F.$),i.push(F._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},i=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng, -offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 9;case 1:return 10;case 2:return 4;case 3:return 12;case 4:return 13;case 5:return 6;case 6:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:showInfo\b)/i,/^(?:info\b)/i,/^(?:say\b)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return t}();return r.lexer=i,t.prototype=r,r.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],113:[function(t,e){"use strict";var n,r=t("../../logger"),i=new r.Log;if(t)try{n=t("dagre-d3")}catch(a){i.debug("Could not load dagre-d3")}n||(n=window.dagreD3),e.exports=n},{"../../logger":125,"dagre-d3":4}],114:[function(t,e,n){"use strict";var r=t("./graphDb"),i=t("./parser/flow"),a=t("./parser/dot"),s=t("../../d3"),o=t("./dagre-d3"),u=t("../../logger"),c=new u.Log,l={};e.exports.setConf=function(t){var e,n=Object.keys(t);for(e=0;e0&&(s=a.classes.join(" "));var o="";o=r(o,a.styles),i="undefined"==typeof a.text?a.id:a.text;var u="";if(l.htmlLabels)u="html",i=i.replace(/fa:fa[\w\-]+/g,function(t){return''});else{var c=document.createElementNS("http://www.w3.org/2000/svg","text"),h=i.split(/
/),d=0;for(d=0;d/g,"\n");"undefined"==typeof t.style?l.htmlLabels?e.setEdge(t.start,t.end,{labelType:"html",style:a,labelpos:"c",label:''+t.text+"",arrowheadStyle:"fill: #333",arrowhead:n},i):e.setEdge(t.start,t.end,{labelType:"text",style:"stroke: #333; stroke-width: 1.5px;fill:none",labelpos:"c",label:s,arrowheadStyle:"fill: #333",arrowhead:n},i):e.setEdge(t.start,t.end,{labelType:"text",style:a,arrowheadStyle:"fill: #333",label:s,arrowhead:n},i)}})},n.getClasses=function(t,e){var n;r.clear(),n=e?a.parser:i.parser,n.yy=r,n.parse(t);var s=r.getClasses();return"undefined"==typeof s["default"]&&(s["default"]={id:"default"},s["default"].styles=[],s["default"].clusterStyles=["rx:4px","fill: rgb(255, 255, 222)","rx: 4px","stroke: rgb(170, 170, 51)","stroke-width: 1px"],s["default"].nodeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"],s["default"].edgeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"]),s},n.draw=function(t,e,u){c.debug("Drawing flowchart");var h;r.clear(),h=u?a.parser:i.parser,h.yy=r;try{h.parse(t)}catch(d){c.debug("Parsing failed")}var f;f=r.getDirection(),"undefined"==typeof f&&(f="TD");var p,g=new o.graphlib.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:f,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),y=r.getSubGraphs(),m=0;for(m=y.length-1;m>=0;m--)p=y[m],r.addVertex(p.id,p.title,"group",void 0);var v=r.getVertices(),_=r.getEdges();m=0;var b;for(m=y.length-1;m>=0;m--)for(p=y[m],s.selectAll("cluster").append("text"),b=0;b0?t.split(",").forEach(function(t){"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)}):"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)};var setTooltip=function(t,e){"undefined"!=typeof e&&(tooltips[t]=e)},setClickFun=function setClickFun(id,functionName){"undefined"!=typeof functionName&&"undefined"!=typeof vertices[id]&&funs.push(function(element){var elem=d3.select(element).select("#"+id);null!==elem&&elem.on("click",function(){eval(functionName+"('"+id+"')")})})},setLink=function(t,e){"undefined"!=typeof e&&"undefined"!=typeof vertices[t]&&funs.push(function(n){var r=d3.select(n).select("#"+t);null!==r&&r.on("click",function(){window.open(e,"newTab")})})};exports.getTooltip=function(t){return tooltips[t]},exports.setClickEvent=function(t,e,n,r){t.indexOf(",")>0?t.split(",").forEach(function(t){setTooltip(t,r),setClickFun(t,e),setLink(t,n)}):(setTooltip(t,r),setClickFun(t,e),setLink(t,n))},exports.bindFunctions=function(t){funs.forEach(function(e){e(t)})},exports.getDirection=function(){return direction},exports.getVertices=function(){return vertices},exports.getEdges=function(){return edges},exports.getClasses=function(){return classes};var setupToolTips=function(t){var e=d3.select(".mermaidTooltip");null===e[0][0]&&(e=d3.select("body").append("div").attr("class","mermaidTooltip").style("opacity",0));var n=d3.select(t).select("svg"),r=n.selectAll("g.node");r.on("mouseover",function(){var t=d3.select(this),n=t.attr("title");if(null!==n){var r=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.html(t.attr("title")).style("left",r.left+(r.right-r.left)/2+"px").style("top",r.top-14+document.body.scrollTop+"px"),t.classed("hover",!0)}}).on("mouseout",function(){e.transition().duration(500).style("opacity",0);var t=d3.select(this);t.classed("hover",!1)})};funs.push(setupToolTips),exports.clear=function(){vertices={},classes={},edges=[],funs=[],funs.push(setupToolTips),subGraphs=[],subCount=0,tooltips=[]},exports.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},exports.addSubGraph=function(t,e){function n(t){var e={"boolean":{},number:{},string:{}},n=[];return t.filter(function(t){var r=typeof t;return" "===t?!1:r in e?e[r].hasOwnProperty(t)?!1:e[r][t]=!0:n.indexOf(t)>=0?!1:n.push(t)})}var r=[];r=n(r.concat.apply(r,t));var i={id:"subGraph"+subCount,nodes:r,title:e};return subGraphs.push(i),subCount+=1,i.id};var getPosForId=function(t){var e;for(e=0;e2e3)){if(posCrossRef[secCount]=n,subGraphs[n].id===e)return{result:!0,count:0};for(var i=0,a=1;i=0){var o=t(e,s);if(o.result)return{result:!0,count:a+o.count};a+=o.count}i+=1}return{result:!1,count:a}}};exports.getDepthFirstPos=function(t){return posCrossRef[t]},exports.indexNodes=function(){secCount=-1,subGraphs.length>0&&indexNodes("none",subGraphs.length-1,0)},exports.getSubGraphs=function(){return subGraphs},exports.parseError=function(t,e){global.mermaidAPI.parseError(t,e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../d3":106,"../../logger":125}],116:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,5],r=[1,6],i=[1,12],a=[1,13],s=[1,14],o=[1,15],u=[1,16],c=[1,17],l=[1,18],h=[1,19],d=[1,20],f=[1,21],p=[1,22],g=[8,16,17,18,19,20,21,22,23,24,25,26],y=[1,37],m=[1,33],v=[1,34],_=[1,35],b=[1,36],A=[8,10,16,17,18,19,20,21,22,23,24,25,26,28,32,37,39,40,45,57,58],x=[10,28],w=[10,28,37,57,58],k=[2,49],E=[1,45],D=[1,48],C=[1,49],F=[1,52],T=[2,65],S=[1,65],B=[1,66],I=[1,67],O=[1,68],M=[1,69],L=[1,70],N=[1,71],P=[1,72],R=[1,73],j=[8,16,17,18,19,20,21,22,23,24,25,26,47],Y=[10,28,37],$={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graph:4,EOF:5,graphStatement:6,idStatement:7,"{":8,stmt_list:9,"}":10,strict:11,GRAPH:12,DIGRAPH:13,textNoTags:14,textNoTagsToken:15,ALPHA:16,NUM:17,COLON:18,PLUS:19,EQUALS:20,MULT:21,DOT:22,BRKT:23,SPACE:24,MINUS:25,keywords:26,stmt:27,";":28,node_stmt:29,edge_stmt:30,attr_stmt:31,"=":32,subgraph:33,attr_list:34,NODE:35,EDGE:36,"[":37,a_list:38,"]":39,",":40,edgeRHS:41,node_id:42,edgeop:43,port:44,":":45,compass_pt:46,SUBGRAPH:47,n:48,ne:49,e:50,se:51,s:52,sw:53,w:54,nw:55,c:56,ARROW_POINT:57,ARROW_OPEN:58,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"{",10:"}",11:"strict",12:"GRAPH",13:"DIGRAPH",16:"ALPHA",17:"NUM",18:"COLON",19:"PLUS",20:"EQUALS",21:"MULT",22:"DOT",23:"BRKT",24:"SPACE",25:"MINUS",26:"keywords",28:";",32:"=",35:"NODE",36:"EDGE",37:"[",39:"]",40:",",45:":",47:"SUBGRAPH",48:"n",49:"ne",50:"e",51:"se",52:"s",53:"sw",54:"w",55:"nw",56:"c",57:"ARROW_POINT",58:"ARROW_OPEN"},productions_:[0,[3,2],[4,5],[4,6],[4,4],[6,1],[6,1],[7,1],[14,1],[14,2],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[9,1],[9,3],[27,1],[27,1],[27,1],[27,3],[27,1],[31,2],[31,2],[31,2],[34,4],[34,3],[34,3],[34,2],[38,5],[38,5],[38,3],[30,3],[30,3],[30,2],[30,2],[41,3],[41,3],[41,2],[41,2],[29,2],[29,1],[42,2],[42,1],[44,4],[44,2],[44,2],[33,5],[33,4],[33,3],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,0],[43,1],[43,1]],performAction:function(t,e,n,r,i,a){var s=a.length-1;switch(i){case 1:this.$=a[s-1];break;case 2:this.$=a[s-4];break;case 3:this.$=a[s-5];break;case 4:this.$=a[s-3];break;case 8:case 10:case 11:this.$=a[s];break;case 9:this.$=a[s-1]+""+a[s];break;case 12:case 13:case 14:case 15:case 16:case 18:case 19:case 20:this.$=a[s];break;case 17:this.$="
";break;case 39:this.$="oy";break;case 40:r.addLink(a[s-1],a[s].id,a[s].op),this.$="oy";break;case 42:r.addLink(a[s-1],a[s].id,a[s].op),this.$={op:a[s-2],id:a[s-1]};break;case 44:this.$={op:a[s-1],id:a[s]};break;case 48:r.addVertex(a[s-1]),this.$=a[s-1];break;case 49:r.addVertex(a[s]),this.$=a[s];break;case 66:this.$="arrow";break;case 67:this.$="arrow_open"}},table:[{3:1,4:2,6:3,11:[1,4],12:n,13:r},{1:[3]},{5:[1,7]},{7:8,8:[1,9],14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},{6:23,12:n,13:r},e(g,[2,5]),e(g,[2,6]),{1:[2,1]},{8:[1,24]},{7:30,8:y,9:25,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},e([8,10,28,32,37,39,40,45,57,58],[2,7],{15:38,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p}),e(A,[2,8]),e(A,[2,10]),e(A,[2,11]),e(A,[2,12]),e(A,[2,13]),e(A,[2,14]),e(A,[2,15]),e(A,[2,16]),e(A,[2,17]),e(A,[2,18]),e(A,[2,19]),e(A,[2,20]),{7:39,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},{7:30,8:y,9:40,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{10:[1,41]},{10:[2,21],28:[1,42]},e(x,[2,23]),e(x,[2,24]),e(x,[2,25]),e(w,k,{44:44,32:[1,43],45:E}),e(x,[2,27],{41:46,43:47,57:D,58:C}),e(x,[2,47],{43:47,34:50,41:51,37:F,57:D,58:C}),{34:53,37:F},{34:54,37:F},{34:55,37:F},{7:56,8:[1,57],14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},{7:30,8:y,9:58,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},e(A,[2,9]),{8:[1,59]},{10:[1,60]},{5:[2,4]},{7:30,8:y,9:61,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{7:62,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},e(w,[2,48]),e(w,T,{14:10,15:11,7:63,46:64,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,48:S,49:B,50:I,51:O,52:M,53:L,54:N,55:P,56:R}),e(x,[2,41],{34:74,37:F}),{7:77,8:y,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,33:76,42:75,47:b},e(j,[2,66]),e(j,[2,67]),e(x,[2,46]),e(x,[2,40],{34:78,37:F}),{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,38:79,39:[1,80]},e(x,[2,28]),e(x,[2,29]),e(x,[2,30]),{8:[1,82]},{7:30,8:y,9:83,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{10:[1,84]},{7:30,8:y,9:85,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{5:[2,2]},{10:[2,22]},e(x,[2,26]),e(w,[2,51],{45:[1,86]}),e(w,[2,52]),e(w,[2,56]),e(w,[2,57]),e(w,[2,58]),e(w,[2,59]),e(w,[2,60]),e(w,[2,61]),e(w,[2,62]),e(w,[2,63]),e(w,[2,64]),e(x,[2,38]),e(Y,[2,44],{43:47,41:87,57:D,58:C}),e(Y,[2,45],{43:47,41:88,57:D,58:C}),e(w,k,{44:44,45:E}),e(x,[2,39]),{39:[1,89]},e(x,[2,34],{34:90,37:F}),{32:[1,91]},{7:30,8:y,9:92,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{10:[1,93]},e(w,[2,55]),{10:[1,94]},e(w,T,{46:95,48:S,49:B,50:I,51:O,52:M,53:L,54:N,55:P,56:R}),e(Y,[2,42]),e(Y,[2,43]),e(x,[2,33],{34:96,37:F}),e(x,[2,32]),{7:97,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},{10:[1,98]},e(w,[2,54]),{5:[2,3]},e(w,[2,50]),e(x,[2,31]),{28:[1,99],39:[2,37],40:[1,100]},e(w,[2,53]),{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,38:101},{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,38:102},{39:[2,35]},{39:[2,36]}],defaultActions:{7:[2,1],41:[2,4],60:[2,2],61:[2,22],94:[2,3],101:[2,35],102:[2,36]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,A,x,w,k,E,D,C=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},F={};;){if(b=n[n.length-1],this.defaultActions[b]?A=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=C()),A=a[b]&&a[b][v]),"undefined"==typeof A||!A.length||!A[0]){var T="";D=[];for(w in a[b])this.terminals_[w]&&w>l&&D.push("'"+this.terminals_[w]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(A[0]){case 1:n.push(v),r.push(f.yytext),i.push(f.yylloc),n.push(A[1]),v=null,_?(v=_,_=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[A[1]][1],F.$=r[r.length-k],F._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),x=this.performAction.apply(F,[s,u,o,p.yy,A[1],r,i].concat(d)),"undefined"!=typeof x)return x;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[A[1]][0]),r.push(F.$),i.push(F._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},U=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:return"STYLE";case 1:return"LINKSTYLE";case 2:return"CLASSDEF";case 3:return"CLASS";case 4:return"CLICK";case 5:return 12;case 6:return 13;case 7:return 47;case 8:return 35;case 9:return 36;case 10:return"DIR";case 11:return"DIR";case 12:return"DIR";case 13:return"DIR";case 14:return"DIR";case 15:return"DIR";case 16:return 17;case 17:return 23;case 18:return 18;case 19:return 28;case 20:return 40;case 21:return 32;case 22:return 21;case 23:return 22;case 24:return"ARROW_CROSS";case 25:return 57;case 26:return"ARROW_CIRCLE";case 27:return 58;case 28:return 25;case 29:return 19;case 30:return 20;case 31:return 16;case 32:return"PIPE";case 33:return"PS";case 34:return"PE";case 35:return 37;case 36:return 39;case 37:return 8;case 38:return 10;case 39:return"QUOTE";case 40:return 24;case 41:return"NEWLINE";case 42:return 5}},rules:[/^(?:style\b)/,/^(?:linkStyle\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:digraph\b)/,/^(?:subgraph\b)/,/^(?:node\b)/,/^(?:edge\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:--[x])/,/^(?:->)/,/^(?:--[o])/,/^(?:--)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u0061-\u007A\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)/,/^(?:\n)/,/^(?:$)/], -conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],inclusive:!0}}};return t}();return $.lexer=U,t.prototype=$,$.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],117:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,4],r=[1,3],i=[1,5],a=[1,8,9,10,11,13,18,30,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],s=[2,2],o=[1,12],u=[1,13],c=[1,14],l=[1,15],h=[1,31],d=[1,33],f=[1,22],p=[1,34],g=[1,24],y=[1,25],m=[1,26],v=[1,27],_=[1,28],b=[1,38],A=[1,40],x=[1,35],w=[1,39],k=[1,45],E=[1,44],D=[1,36],C=[1,37],F=[1,41],T=[1,42],S=[1,43],B=[1,8,9,10,11,13,18,30,32,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],I=[1,53],O=[1,52],M=[1,54],L=[1,72],N=[1,80],P=[1,81],R=[1,66],j=[1,65],Y=[1,85],$=[1,84],U=[1,82],G=[1,83],W=[1,73],V=[1,68],H=[1,67],z=[1,63],q=[1,75],X=[1,76],Z=[1,77],K=[1,78],Q=[1,79],J=[1,70],tt=[1,69],et=[8,9,11],nt=[8,9,11,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64],rt=[1,115],it=[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,85,87,88,90,91,93,94,95,96,97],at=[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,83,85,87,88,90,91,93,94,95,96,97],st=[1,117],ot=[1,118],ut=[8,9,10,11,13,18,30,32,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],ct=[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,83,85,87,88,90,91,93,94,95,96,97],lt=[13,18,46,81,85,87,88,90,91,93,94,95,96,97],ht=[13,18,46,49,65,81,85,87,88,90,91,93,94,95,96,97],dt=[1,191],ft=[1,188],pt=[1,195],gt=[1,192],yt=[1,189],mt=[1,196],vt=[1,186],_t=[1,187],bt=[1,190],At=[1,193],xt=[1,194],wt=[1,211],kt=[8,9,11,85],Et=[8,9,10,11,46,71,80,81,83,85,87,88,89,90,91],Dt={trace:function(){},yy:{},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,commentStatement:82,PCT:83,style:84,COMMA:85,styleComponent:86,ALPHA:87,COLON:88,UNIT:89,BRKT:90,DOT:91,graphCodeTokens:92,PUNCTUATION:93,UNICODE_TEXT:94,PLUS:95,EQUALS:96,MULT:97,TAG_START:98,TAG_END:99,QUOTE:100,$accept:0,$end:1},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",83:"PCT",85:"COMMA",87:"ALPHA",88:"COLON",89:"UNIT",90:"BRKT",91:"DOT",93:"PUNCTUATION",94:"UNICODE_TEXT",95:"PLUS",96:"EQUALS",97:"MULT",98:"TAG_START",99:"TAG_END",100:"QUOTE"},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],[82,3],[79,1],[79,3],[84,1],[84,2],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,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],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1]],performAction:function(t,e,n,r,i,a){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:a[s]!==[]&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 57:case 59:case 60:case 92:case 94:case 95:case 108:this.$=a[s];break;case 11:r.setDirection(a[s-1]),this.$=a[s-1];break;case 12:r.setDirection("LR"),this.$=a[s-1];break;case 13:r.setDirection("RL"),this.$=a[s-1];break;case 14:r.setDirection("BT"),this.$=a[s-1];break;case 15:r.setDirection("TB"),this.$=a[s-1];break;case 30:this.$=a[s-1];break;case 31:case 32:case 33:case 34:case 35:this.$=[];break;case 36:this.$=r.addSubGraph(a[s-1],a[s-3]);break;case 37:this.$=r.addSubGraph(a[s-1],void 0);break;case 41:r.addLink(a[s-2],a[s],a[s-1]),this.$=[a[s-2],a[s]];break;case 42:this.$=[a[s]];break;case 43:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"square");break;case 44:this.$=a[s-4],r.addVertex(a[s-4],a[s-2],"square");break;case 45:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],"circle");break;case 46:this.$=a[s-6],r.addVertex(a[s-6],a[s-3],"circle");break;case 47:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"ellipse");break;case 48:this.$=a[s-4],r.addVertex(a[s-4],a[s-2],"ellipse");break;case 49:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"round");break;case 50:this.$=a[s-4],r.addVertex(a[s-4],a[s-2],"round");break;case 51:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"diamond");break;case 52:this.$=a[s-4],r.addVertex(a[s-4],a[s-2],"diamond");break;case 53:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"odd");break;case 54:this.$=a[s-4],r.addVertex(a[s-4],a[s-2],"odd");break;case 55:this.$=a[s],r.addVertex(a[s]);break;case 56:this.$=a[s-1],r.addVertex(a[s-1]);break;case 58:case 93:case 96:case 109:this.$=a[s-1]+""+a[s];break;case 61:this.$="v";break;case 62:this.$="-";break;case 63:a[s-1].text=a[s],this.$=a[s-1];break;case 64:case 65:a[s-2].text=a[s-1],this.$=a[s-2];break;case 66:this.$=a[s];break;case 67:this.$={type:"arrow",stroke:"normal",text:a[s-1]};break;case 68:this.$={type:"arrow_circle",stroke:"normal",text:a[s-1]};break;case 69:this.$={type:"arrow_cross",stroke:"normal",text:a[s-1]};break;case 70:this.$={type:"arrow_open",stroke:"normal",text:a[s-1]};break;case 71:this.$={type:"arrow",stroke:"dotted",text:a[s-1]};break;case 72:this.$={type:"arrow_circle",stroke:"dotted",text:a[s-1]};break;case 73:this.$={type:"arrow_cross",stroke:"dotted",text:a[s-1]};break;case 74:this.$={type:"arrow_open",stroke:"dotted",text:a[s-1]};break;case 75:this.$={type:"arrow",stroke:"thick",text:a[s-1]};break;case 76:this.$={type:"arrow_circle",stroke:"thick",text:a[s-1]};break;case 77:this.$={type:"arrow_cross",stroke:"thick",text:a[s-1]};break;case 78:this.$={type:"arrow_open",stroke:"thick",text:a[s-1]};break;case 79:this.$={type:"arrow",stroke:"normal"};break;case 80:this.$={type:"arrow_circle",stroke:"normal"};break;case 81:this.$={type:"arrow_cross",stroke:"normal"};break;case 82:this.$={type:"arrow_open",stroke:"normal"};break;case 83:this.$={type:"arrow",stroke:"dotted"};break;case 84:this.$={type:"arrow_circle",stroke:"dotted"};break;case 85:this.$={type:"arrow_cross",stroke:"dotted"};break;case 86:this.$={type:"arrow_open",stroke:"dotted"};break;case 87:this.$={type:"arrow",stroke:"thick"};break;case 88:this.$={type:"arrow_circle",stroke:"thick"};break;case 89:this.$={type:"arrow_cross",stroke:"thick"};break;case 90:this.$={type:"arrow_open",stroke:"thick"};break;case 91:this.$=a[s-1];break;case 110:case 111:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 112:this.$=a[s-4],r.setClass(a[s-2],a[s]);break;case 113:this.$=a[s-4],r.setClickEvent(a[s-2],a[s],void 0,void 0);break;case 114:this.$=a[s-6],r.setClickEvent(a[s-4],a[s-2],void 0,a[s]);break;case 115:this.$=a[s-4],r.setClickEvent(a[s-2],void 0,a[s],void 0);break;case 116:this.$=a[s-6],r.setClickEvent(a[s-4],void 0,a[s-2],a[s]);break;case 117:this.$=a[s-4],r.addVertex(a[s-2],void 0,void 0,a[s]);break;case 118:case 119:case 120:this.$=a[s-4],r.updateLink(a[s-2],a[s]);break;case 122:this.$=[a[s]];break;case 123:a[s-2].push(a[s]),this.$=a[s-2];break;case 125:this.$=a[s-1]+a[s]}},table:[{3:1,4:2,9:n,10:r,12:i},{1:[3]},e(a,s,{5:6}),{4:7,9:n,10:r,12:i},{4:8,9:n,10:r,12:i},{10:[1,9]},{1:[2,1],6:10,7:11,8:o,9:u,10:c,11:l,13:h,18:d,23:16,25:17,26:18,27:19,28:20,29:21,30:f,33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:_,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},e(a,[2,9]),e(a,[2,10]),{13:[1,46],15:[1,47],16:[1,48],17:[1,49],18:[1,50]},e(B,[2,3]),e(B,[2,4]),e(B,[2,5]),e(B,[2,6]),e(B,[2,7]),e(B,[2,8]),{8:I,9:O,11:M,24:51},{8:I,9:O,11:M,24:55},{8:I,9:O,11:M,24:56},{8:I,9:O,11:M,24:57},{8:I,9:O,11:M,24:58},{8:I,9:O,11:M,24:59},{8:I,9:O,10:L,11:M,12:N,13:P,15:R,16:j,17:Y,18:$,24:61,30:U,31:60,32:G,45:71,46:W,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},e(et,[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]},e(nt,[2,55],{45:32,21:113,44:114,10:rt,13:h,15:[1,112],18:d,36:[1,108],38:[1,109],40:[1,110],42:[1,111],46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S}),e(it,[2,57]),e(it,[2,59]),e(it,[2,60]),e(it,[2,61]),e(it,[2,62]),e(at,[2,150]),e(at,[2,151]),e(at,[2,152]),e(at,[2,153]),e(at,[2,154]),e(at,[2,155]),e(at,[2,156]),e(at,[2,157]),e(at,[2,158]),e(at,[2,159]),e(at,[2,160]),{8:st,9:ot,10:rt,14:116,21:119},{8:st,9:ot,10:rt,14:120,21:119},{8:st,9:ot,10:rt,14:121,21:119},{8:st,9:ot,10:rt,14:122,21:119},{8:st,9:ot,10:rt,14:123,21:119},e(B,[2,30]),e(B,[2,38]),e(B,[2,39]),e(B,[2,40]),e(B,[2,31]),e(B,[2,32]),e(B,[2,33]),e(B,[2,34]),e(B,[2,35]),{8:I,9:O,10:L,11:M,12:N,13:P,15:R,16:j,17:Y,18:$,24:124,30:U,32:G,45:71,46:W,50:V,60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},e(ut,s,{5:126}),e(ct,[2,92]),e(ct,[2,94]),e(ct,[2,139]),e(ct,[2,140]),e(ct,[2,141]),e(ct,[2,142]),e(ct,[2,143]),e(ct,[2,144]),e(ct,[2,145]),e(ct,[2,146]),e(ct,[2,147]),e(ct,[2,148]),e(ct,[2,149]),e(ct,[2,97]),e(ct,[2,98]),e(ct,[2,99]),e(ct,[2,100]),e(ct,[2,101]),e(ct,[2,102]),e(ct,[2,103]),e(ct,[2,104]),e(ct,[2,105]),e(ct,[2,106]),e(ct,[2,107]),{13:h,18:d,33:127,35:29,44:30,45:32,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},e(lt,[2,66],{48:128,49:[1,129],65:[1,130]}),{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,31:131,32:G,45:71,46:W,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,31:132,32:G,45:71,46:W,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,31:133,32:G,45:71,46:W,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},e(ht,[2,79]),e(ht,[2,80]),e(ht,[2,81]),e(ht,[2,82]),e(ht,[2,83]),e(ht,[2,84]),e(ht,[2,85]),e(ht,[2,86]),e(ht,[2,87]),e(ht,[2,88]),e(ht,[2,89]),e(ht,[2,90]),{13:h,18:d,35:134,44:30,45:32,46:p,80:[1,135],81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{78:[1,136],81:[1,137]},{13:h,18:d,35:139,44:30,45:32,46:p,78:[1,138],81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{13:h,18:d,35:140,44:30,45:32,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{13:h,18:d,35:141,44:30,45:32,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,31:142,32:G,45:71,46:W,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,31:144,32:G,38:[1,143],45:71,46:W,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,31:145,32:G,45:71,46:W,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,31:146,32:G,45:71,46:W,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,31:147,32:G,45:71,46:W,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},e(nt,[2,56]),e(it,[2,58]),e(nt,[2,29],{21:148,10:rt}),e(a,[2,11]),e(a,[2,21]),e(a,[2,22]),{9:[1,149]},e(a,[2,12]),e(a,[2,13]),e(a,[2,14]),e(a,[2,15]),e(ut,s,{5:150}),e(ct,[2,93]),{6:10,7:11,8:o,9:u,10:c,11:l,13:h,18:d,23:16,25:17,26:18,27:19,28:20,29:21,30:f,32:[1,151],33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:_,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},e(et,[2,41]),e(lt,[2,63],{10:[1,152]}),{10:[1,153]},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,31:154,32:G,45:71,46:W,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,32:G,45:71,46:W,50:V,51:[1,155],52:[1,156],53:[1,157],54:[1,158],60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,32:G,45:71,46:W,50:V,56:[1,159],57:[1,160],58:[1,161],59:[1,162],60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,32:G,45:71,46:W,50:V,60:H,61:[1,163],62:[1,164],63:[1,165],64:[1,166],66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:[1,167],13:h,18:d,44:114,45:32,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:[1,168]},{10:[1,169]},{10:[1,170]},{10:[1,171]},{10:[1,172],13:h,18:d,44:114,45:32,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:[1,173],13:h,18:d,44:114,45:32,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:[1,174],13:h,18:d,44:114,45:32,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,32:G,37:[1,175],45:71,46:W,50:V,60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,31:176,32:G,45:71,46:W,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,32:G,39:[1,177],45:71,46:W,50:V,60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,32:G,41:[1,178],45:71,46:W,50:V,60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,32:G,43:[1,179],45:71,46:W,50:V,60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,32:G,37:[1,180],45:71,46:W,50:V,60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},e(nt,[2,28]),e(a,[2,23]),{6:10,7:11,8:o,9:u,10:c,11:l,13:h,18:d,23:16,25:17,26:18,27:19,28:20,29:21,30:f,32:[1,181],33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:_,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},e(B,[2,37]),e(lt,[2,65]),e(lt,[2,64]),{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,32:G,45:71,46:W,50:V,60:H,65:[1,182],66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},e(lt,[2,67]),e(lt,[2,68]),e(lt,[2,69]),e(lt,[2,70]),e(lt,[2,71]),e(lt,[2,72]),e(lt,[2,73]),e(lt,[2,74]),e(lt,[2,75]),e(lt,[2,76]),e(lt,[2,77]),e(lt,[2,78]),{10:dt,46:ft,71:pt,79:183,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:At,91:xt},{10:dt,46:ft,71:pt,79:197,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:At,91:xt},{10:dt,46:ft,71:pt,79:198,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:At,91:xt},{10:dt,46:ft,71:pt,79:199,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:At,91:xt},{10:dt,46:ft,71:pt,79:200,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:At,91:xt},{10:dt,46:ft,71:pt,79:201,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:At,91:xt},{13:h,18:d,35:202,44:30,45:32,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},{13:h,18:d,35:203,44:30,45:32,46:p,67:[1,204],81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},e(nt,[2,43],{21:205,10:rt}),{10:L,12:N,13:P,15:R,16:j,17:Y,18:$,30:U,32:G,39:[1,206],45:71,46:W,50:V,60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S},e(nt,[2,49],{21:207,10:rt}),e(nt,[2,47],{21:208,10:rt}),e(nt,[2,51],{21:209,10:rt}),e(nt,[2,53],{21:210,10:rt}),e(B,[2,36]),e([10,13,18,46,81,85,87,88,90,91,93,94,95,96,97],[2,91]),e(et,[2,117],{85:wt}),e(kt,[2,122],{86:212,10:dt,46:ft,71:pt,80:gt,81:yt,83:mt,87:vt,88:_t,89:bt,90:At,91:xt}),e(Et,[2,124]),e(Et,[2,126]),e(Et,[2,127]),e(Et,[2,128]),e(Et,[2,129]),e(Et,[2,130]),e(Et,[2,131]),e(Et,[2,132]),e(Et,[2,133]),e(Et,[2,134]),e(Et,[2,135]),e(Et,[2,136]),e(et,[2,118],{85:wt}),e(et,[2,119],{85:wt}),e(et,[2,120],{85:wt}),e(et,[2,110],{85:wt}),e(et,[2,111],{85:wt}),e(et,[2,112],{45:32,44:114,13:h,18:d,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S}),e(et,[2,113],{45:32,44:114,10:[1,213],13:h,18:d,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:C,95:F,96:T,97:S}),e(et,[2,115],{10:[1,214]}),e(nt,[2,44]),{39:[1,215]},e(nt,[2,50]),e(nt,[2,48]),e(nt,[2,52]),e(nt,[2,54]),{10:dt,46:ft,71:pt,80:gt,81:yt,83:mt,84:216,86:185,87:vt,88:_t,89:bt,90:At,91:xt},e(Et,[2,125]),{67:[1,217]},{67:[1,218]},e(nt,[2,45],{21:219,10:rt}),e(kt,[2,123],{86:212,10:dt,46:ft,71:pt,80:gt,81:yt,83:mt,87:vt,88:_t,89:bt,90:At,91:xt}),e(et,[2,114]),e(et,[2,116]),e(nt,[2,46])],defaultActions:{},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,A,x,w,k,E,D,C=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},F={};;){if(b=n[n.length-1],this.defaultActions[b]?A=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=C()),A=a[b]&&a[b][v]),"undefined"==typeof A||!A.length||!A[0]){var T="";D=[];for(w in a[b])this.terminals_[w]&&w>l&&D.push("'"+this.terminals_[w]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(A[0]){case 1:n.push(v),r.push(f.yytext),i.push(f.yylloc),n.push(A[1]),v=null,_?(v=_,_=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[A[1]][1],F.$=r[r.length-k],F._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),x=this.performAction.apply(F,[s,u,o,p.yy,A[1],r,i].concat(d)),"undefined"!=typeof x)return x;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[A[1]][0]),r.push(F.$),i.push(F._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},Ct=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:break;case 1:this.begin("string");break;case 2:this.popState();break;case 3:return"STR";case 4:return 71;case 5:return 78;case 6:return 72;case 7:return 73;case 8:return 74;case 9:return 75;case 10:return 12;case 11:return 30;case 12:return 32;case 13:return 13;case 14:return 13;case 15:return 13;case 16:return 13;case 17:return 13;case 18:return 13;case 19:return 81;case 20:return 90;case 21:return 88;case 22:return 8;case 23:return 85;case 24:return 97;case 25:return 16;case 26:return 15;case 27:return 17;case 28:return 18;case 29:return 53;case 30:return 51;case 31:return 52;case 32:return 54;case 33:return 58;case 34:return 56;case 35:return 57;case 36:return 59;case 37:return 58;case 38:return 56;case 39:return 57;case 40:return 59;case 41:return 63;case 42:return 61;case 43:return 62;case 44:return 64;case 45:return 50;case 46:return 55;case 47:return 60;case 48:return 40;case 49:return 41;case 50:return 46;case 51:return 91;case 52:return 95;case 53:return 83;case 54:return 96;case 55:return 96;case 56:return 87;case 57:return 93;case 58:return 94;case 59:return 65;case 60:return 38;case 61:return 39;case 62:return 36;case 63:return 37;case 64:return 42;case 65:return 43;case 66:return 100;case 67:return 9;case 68:return 10;case 69:return 11}},rules:[/^(?:%%[^\n]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\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)/,/^(?:$)/], -conditions:{string:{rules:[2,3],inclusive:!1},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],inclusive:!0}}};return t}();return Dt.lexer=Ct,t.prototype=Dt,Dt.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],118:[function(t,e,n){(function(e){"use strict";var r=t("moment"),i=t("../../logger"),a=new i.Log,s="",o="",u=[],c=[],l="";n.clear=function(){u=[],c=[],l="",o="",g=0,h=void 0,d=void 0,_=[]},n.setDateFormat=function(t){s=t},n.getDateFormat=function(){return s},n.setTitle=function(t){o=t},n.getTitle=function(){return o},n.addSection=function(t){l=t,u.push(t)},n.getTasks=function(){for(var t=A(),e=10,n=0;!t&&e>n;)t=A(),n++;return c=_};var h,d,f=function(t,e,i){i=i.trim();var s=/^after\s+([\d\w\-]+)/,o=s.exec(i.trim());if(null!==o){var u=n.findTaskById(o[1]);if("undefined"==typeof u){var c=new Date;return c.setHours(0,0,0,0),c}return u.endTime}return r(i,e.trim(),!0).isValid()?r(i,e.trim(),!0).toDate():(a.debug("Invalid date:"+i),a.debug("With date format:"+e.trim()),new Date)},p=function(t,e,n){if(n=n.trim(),r(n,e.trim(),!0).isValid())return r(n,e.trim()).toDate();var i=r(t),a=/^([\d]+)([wdhms])/,s=a.exec(n.trim());if(null!==s){switch(s[2]){case"s":i.add(s[1],"seconds");break;case"m":i.add(s[1],"minutes");break;case"h":i.add(s[1],"hours");break;case"d":i.add(s[1],"days");break;case"w":i.add(s[1],"weeks")}return i.toDate()}return i.toDate()},g=0,y=function(t){return"undefined"==typeof t?(g+=1,"task"+g):t},m=function(t,e){var r;r=":"===e.substr(0,1)?e.substr(1,e.length):e;for(var i=r.split(","),a={},s=n.getDateFormat(),o=!0;o;)o=!1,i[0].match(/^\s*active\s*$/)&&(a.active=!0,i.shift(1),o=!0),i[0].match(/^\s*done\s*$/)&&(a.done=!0,i.shift(1),o=!0),i[0].match(/^\s*crit\s*$/)&&(a.crit=!0,i.shift(1),o=!0);var u;for(u=0;un-e?n+i+1.5*s.sidePadding>o?e+r-5:n+r+5:(n-e)/2+e+r}).attr("y",function(t,r){return r*e+s.barHeight/2+(s.fontSize/2-2)+n}).attr("text-height",i).attr("class",function(t){for(var e=x(t.startTime),n=x(t.endTime),r=this.getBBox().width,i=0,a=0;an-e?n+r+1.5*s.sidePadding>o?"taskTextOutsideLeft taskTextOutside"+i+" "+u:"taskTextOutsideRight taskTextOutside"+i+" "+u:"taskText taskText"+i+" "+u})}function l(t,e,n,a){var o,u=[[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["h1 %I:%M",function(t){return t.getMinutes()}]],c=[["%Y",function(){return!0}]],l=[["%I:%M",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}]];"undefined"!=typeof s.axisFormatter&&(l=[],s.axisFormatter.forEach(function(t){var e=[];e[0]=t[0],e[1]=t[1],l.push(e)})),o=u.concat(l).concat(c);var h=i.svg.axis().scale(x).orient("bottom").tickSize(-a+e+s.gridLineStartPadding,0,0).tickFormat(i.time.format.multi(o));r>7&&230>r&&(h=h.ticks(i.time.monday.range)),_.append("g").attr("class","grid").attr("transform","translate("+t+", "+(a-50)+")").call(h).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em")}function h(t,e){for(var n=[],r=0,i=0;i0))return i[1]*t/2+e;for(var s=0;a>s;s++)return r+=n[a-1][1],i[1]*t/2+r*t+e}).attr("class",function(t){for(var e=0;er;++r)e.hasOwnProperty(t[r])||(e[t[r]]=!0,n.push(t[r]));return n}function p(t){for(var e=t.length,n={};e;)n[t[--e]]=(n[t[e]]||0)+1;return n}function g(t,e){return p(e)[t]||0}n.yy.clear(),n.parse(t);var y=document.getElementById(e);o=y.parentElement.offsetWidth,"undefined"==typeof o&&(o=1200),"undefined"!=typeof s.useWidth&&(o=s.useWidth);var m=n.yy.getTasks(),v=m.length*(s.barHeight+s.barGap)+2*s.topPadding;y.setAttribute("height","100%"),y.setAttribute("viewBox","0 0 "+o+" "+v);var _=i.select("#"+e),b=i.min(m,function(t){return t.startTime}),A=i.max(m,function(t){return t.endTime}),x=i.time.scale().domain([i.min(m,function(t){return t.startTime}),i.max(m,function(t){return t.endTime})]).rangeRound([0,o-150]),w=[];r=a.duration(A-b).asDays();for(var k=0;kl&&D.push("'"+this.terminals_[w]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(A[0]){case 1:n.push(v),r.push(f.yytext),i.push(f.yylloc),n.push(A[1]),v=null,_?(v=_,_=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[A[1]][1],F.$=r[r.length-k],F._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),x=this.performAction.apply(F,[s,u,o,p.yy,A[1],r,i].concat(d)),"undefined"!=typeof x)return x;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[A[1]][0]),r.push(F.$),i.push(F._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},u=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 10;case 1:break;case 2:break;case 3:break;case 4:return 4;case 5:return 11;case 6:return"date";case 7:return 12;case 8:return 13;case 9:return 14;case 10:return 15;case 11:return":";case 12:return 6;case 13:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\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],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return t}();return o.lexer=u,t.prototype=o,o.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],121:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[2,2],r=[1,5],i=[1,7],a=[1,8],s=[1,11],o=[1,12],u=[1,13],c=[1,14],l=[1,16],h=[1,17],d=[1,7,9,10,16,18,19,20,21,22,23,33],f=[7,9,10,16,18,19,20,21,23,33],p=[1,53],g={trace:function(){},yy:{},symbols_:{error:2,start:3,SD:4,document:5,line:6,SPACE:7,statement:8,NL:9,participant:10,actor:11,AS:12,restOfLine:13,signal:14,note_statement:15,title:16,text:17,loop:18,end:19,opt:20,alt:21,"else":22,note:23,placement:24,text2:25,over:26,actor_pair:27,spaceList:28,",":29,left_of:30,right_of:31,signaltype:32,ACTOR:33,SOLID_OPEN_ARROW:34,DOTTED_OPEN_ARROW:35,SOLID_ARROW:36,DOTTED_ARROW:37,SOLID_CROSS:38,DOTTED_CROSS:39,TXT:40,$accept:0,$end:1},terminals_:{2:"error",4:"SD",7:"SPACE",9:"NL",10:"participant",12:"AS",13:"restOfLine",16:"title",17:"text",18:"loop",19:"end",20:"opt",21:"alt",22:"else",23:"note",26:"over",29:",",30:"left_of",31:"right_of",33:"ACTOR",34:"SOLID_OPEN_ARROW",35:"DOTTED_OPEN_ARROW",36:"SOLID_ARROW",37:"DOTTED_ARROW",38:"SOLID_CROSS",39:"DOTTED_CROSS",40:"TXT"},productions_:[0,[3,2],[5,0],[5,2],[6,2],[6,1],[6,1],[8,5],[8,3],[8,2],[8,2],[8,4],[8,4],[8,4],[8,7],[15,4],[15,4],[28,2],[28,1],[27,3],[27,1],[24,1],[24,1],[14,4],[11,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[25,1]],performAction:function(t,e,n,r,i,a){var s=a.length-1;switch(i){case 1:return r.apply(a[s]),a[s];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:this.$=[];break;case 7:a[s-3].description=a[s-1],this.$=a[s-3];break;case 8:this.$=a[s-1];break;case 12:a[s-1].unshift({type:"loopStart",loopText:a[s-2],signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:"loopEnd",loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 13:a[s-1].unshift({type:"optStart",optText:a[s-2],signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:"optEnd",optText:a[s-2],signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 14:a[s-4].unshift({type:"altStart",altText:a[s-5],signalType:r.LINETYPE.ALT_START}),a[s-4].push({type:"else",altText:a[s-2],signalType:r.LINETYPE.ALT_ELSE}),a[s-4]=a[s-4].concat(a[s-1]),a[s-4].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=a[s-4];break;case 15:this.$=[a[s-1],{type:"addNote",placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 16:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 19:this.$=[a[s-2],a[s]];break;case 20:this.$=a[s];break;case 21:this.$=r.PLACEMENT.LEFTOF;break;case 22:this.$=r.PLACEMENT.RIGHTOF;break;case 23:this.$=[a[s-3],a[s-1],{type:"addMessage",from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 24:this.$={type:"addActor",actor:a[s]};break;case 25:this.$=r.LINETYPE.SOLID_OPEN;break;case 26:this.$=r.LINETYPE.DOTTED_OPEN;break;case 27:this.$=r.LINETYPE.SOLID;break;case 28:this.$=r.LINETYPE.DOTTED;break;case 29:this.$=r.LINETYPE.SOLID_CROSS;break;case 30:this.$=r.LINETYPE.DOTTED_CROSS;break;case 31:this.$=a[s].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},e([1,7,9,10,16,18,20,21,23,33],n,{5:3}),{1:[2,1],6:4,7:r,8:6,9:i,10:a,11:15,14:9,15:10,16:s,18:o,20:u,21:c,23:l,33:h},e(d,[2,3]),{8:18,10:a,11:15,14:9,15:10,16:s,18:o,20:u,21:c,23:l,33:h},e(d,[2,5]),e(d,[2,6]),{11:19,33:h},{9:[1,20]},{9:[1,21]},{7:[1,22]},{13:[1,23]},{13:[1,24]},{13:[1,25]},{32:26,34:[1,27],35:[1,28],36:[1,29],37:[1,30],38:[1,31],39:[1,32]},{24:33,26:[1,34],30:[1,35],31:[1,36]},e([9,12,29,34,35,36,37,38,39,40],[2,24]),e(d,[2,4]),{9:[1,38],12:[1,37]},e(d,[2,9]),e(d,[2,10]),{17:[1,39]},e(f,n,{5:40}),e(f,n,{5:41}),e([7,9,10,16,18,20,21,22,23,33],n,{5:42}),{11:43,33:h},{33:[2,25]},{33:[2,26]},{33:[2,27]},{33:[2,28]},{33:[2,29]},{33:[2,30]},{11:44,33:h},{11:46,27:45,33:h},{33:[2,21]},{33:[2,22]},{13:[1,47]},e(d,[2,8]),{9:[1,48]},{6:4,7:r,8:6,9:i,10:a,11:15,14:9,15:10,16:s,18:o,19:[1,49],20:u,21:c,23:l,33:h},{6:4,7:r,8:6,9:i,10:a,11:15,14:9,15:10,16:s,18:o,19:[1,50],20:u,21:c,23:l,33:h},{6:4,7:r,8:6,9:i,10:a,11:15,14:9,15:10,16:s,18:o,20:u,21:c,22:[1,51],23:l,33:h},{25:52,40:p},{25:54,40:p},{25:55,40:p},{29:[1,56],40:[2,20]},{9:[1,57]},e(d,[2,11]),e(d,[2,12]),e(d,[2,13]),{13:[1,58]},{9:[2,23]},{9:[2,31]},{9:[2,15]},{9:[2,16]},{11:59,33:h},e(d,[2,7]),e(f,n,{5:60}),{40:[2,19]},{6:4,7:r,8:6,9:i,10:a,11:15,14:9,15:10,16:s,18:o,19:[1,61],20:u,21:c,23:l,33:h},e(d,[2,14])],defaultActions:{27:[2,25],28:[2,26],29:[2,27],30:[2,28],31:[2,29],32:[2,30],35:[2,21],36:[2,22],52:[2,23],53:[2,31],54:[2,15],55:[2,16],59:[2,19]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,A,x,w,k,E,D,C=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},F={};;){if(b=n[n.length-1],this.defaultActions[b]?A=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=C()),A=a[b]&&a[b][v]),"undefined"==typeof A||!A.length||!A[0]){var T="";D=[];for(w in a[b])this.terminals_[w]&&w>l&&D.push("'"+this.terminals_[w]+"'");T=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(A[0]){case 1:n.push(v),r.push(f.yytext),i.push(f.yylloc),n.push(A[1]),v=null,_?(v=_,_=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[A[1]][1],F.$=r[r.length-k],F._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(F._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),x=this.performAction.apply(F,[s,u,o,p.yy,A[1],r,i].concat(d)),"undefined"!=typeof x)return x;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[A[1]][0]),r.push(F.$),i.push(F._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},y=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 9;case 1:break;case 2:break;case 3:break;case 4:break;case 5:return this.begin("ID"),10;case 6:return this.begin("ALIAS"),33;case 7:return this.popState(),this.popState(),this.begin("LINE"),12;case 8:return this.popState(),this.popState(),9;case 9:return this.begin("LINE"),18;case 10:return this.begin("LINE"),20;case 11:return this.begin("LINE"),21;case 12:return this.begin("LINE"),22;case 13:return this.popState(),13;case 14:return 19;case 15:return 30;case 16:return 31;case 17:return 26;case 18:return 23;case 19:return 16;case 20:return 4;case 21:return 29;case 22:return 9;case 23:return 33;case 24:return 36;case 25:return 37;case 26:return 34;case 27:return 35;case 28:return 38;case 29:return 39;case 30:return 40;case 31:return 9;case 32:return"INVALID"}},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,/^(?:[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\->:\n,;]+)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i], -conditions:{LINE:{rules:[2,3,13],inclusive:!1},ALIAS:{rules:[2,3,7,8],inclusive:!1},ID:{rules:[2,3,6],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],inclusive:!0}}};return t}();return g.lexer=y,t.prototype=g,g.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:1,path:2}],122:[function(t,e,n){(function(e){"use strict";var r={},i=[],a=[],s=t("../../logger"),o=new s.Log;n.addActor=function(t,e,n){var i=r[t];i&&e===i.name&&null==n||(null==n&&(n=e),r[t]={name:e,description:n})},n.addMessage=function(t,e,n,r){i.push({from:t,to:e,message:n,answer:r})},n.addSignal=function(t,e,n,r){o.debug("Adding message from="+t+" to="+e+" message="+n+" type="+r),i.push({from:t,to:e,message:n,type:r})},n.getMessages=function(){return i},n.getActors=function(){return r},n.getActor=function(t){return r[t]},n.getActorKeys=function(){return Object.keys(r)},n.clear=function(){r={},i=[]},n.LINETYPE={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16},n.ARROWTYPE={FILLED:0,OPEN:1},n.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2},n.addNote=function(t,e,r){var s={actor:t,placement:e,message:r},o=[].concat(t,t);a.push(s),i.push({from:o[0],to:o[1],message:r,type:n.LINETYPE.NOTE,placement:e})},n.parseError=function(t,n){e.mermaidAPI.parseError(t,n)},n.apply=function(t){if(t instanceof Array)t.forEach(function(t){n.apply(t)});else switch(t.type){case"addActor":n.addActor(t.actor,t.actor,t.description);break;case"addNote":n.addNote(t.actor,t.placement,t.text);break;case"addMessage":n.addSignal(t.from,t.to,t.msg,t.signalType);break;case"loopStart":n.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":n.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":n.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":n.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":n.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":n.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":n.addSignal(void 0,void 0,void 0,t.signalType)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../logger":125}],123:[function(t,e,n){"use strict";var r=t("./parser/sequenceDiagram").parser;r.yy=t("./sequenceDb");var i=t("./svgDraw"),a=t("../../d3"),s=t("../../logger"),o=new s.Log,u={diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!1,bottomMarginAdj:1};n.bounds={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,list:[],init:function(){this.list=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,n,r){t[e]="undefined"==typeof t[e]?n:r(n,t[e])},updateLoops:function(t,e,r,i){var a=this,s=0;this.list.forEach(function(o){s++;var c=a.list.length-s+1;a.updateVal(o,"startx",t-c*u.boxMargin,Math.min),a.updateVal(o,"starty",e-c*u.boxMargin,Math.min),a.updateVal(o,"stopx",r+c*u.boxMargin,Math.max),a.updateVal(o,"stopy",i+c*u.boxMargin,Math.max),a.updateVal(n.bounds.data,"startx",t-c*u.boxMargin,Math.min),a.updateVal(n.bounds.data,"starty",e-c*u.boxMargin,Math.min),a.updateVal(n.bounds.data,"stopx",r+c*u.boxMargin,Math.max),a.updateVal(n.bounds.data,"stopy",i+c*u.boxMargin,Math.max)})},insert:function(t,e,r,i){var a,s,o,u;a=Math.min(t,r),o=Math.max(t,r),s=Math.min(e,i),u=Math.max(e,i),this.updateVal(n.bounds.data,"startx",a,Math.min),this.updateVal(n.bounds.data,"starty",s,Math.min),this.updateVal(n.bounds.data,"stopx",o,Math.max),this.updateVal(n.bounds.data,"stopy",u,Math.max),this.updateLoops(a,s,o,u)},newLoop:function(t){this.list.push({startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t})},endLoop:function(){var t=this.list.pop();return t},addElseToLoop:function(t){var e=this.list.pop();e.elsey=n.bounds.getVerticalPos(),e.elseText=t,this.list.push(e)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}};var c=function(t,e,r,a,s){var o=i.getNoteRect();o.x=e,o.y=r,o.width=s||u.width,o["class"]="note";var c=t.append("g"),l=i.drawRect(c,o),h=i.getTextObj();h.x=e-4,h.y=r-13,h.textMargin=u.noteMargin,h.dy="1em",h.text=a.message,h["class"]="noteText";var d=i.drawText(c,h,o.width-u.noteMargin),f=d[0][0].getBBox().height;!s&&f>u.width?(d.remove(),c=t.append("g"),d=i.drawText(c,h,2*o.width-u.noteMargin),f=d[0][0].getBBox().height,l.attr("width",2*o.width),n.bounds.insert(e,r,e+2*o.width,r+2*u.noteMargin+f)):n.bounds.insert(e,r,e+o.width,r+2*u.noteMargin+f),l.attr("height",f+2*u.noteMargin),n.bounds.bumpVerticalPos(f+2*u.noteMargin)},l=function(t,e,i,a,s){var o,c=t.append("g"),l=e+(i-e)/2,h=c.append("text").attr("x",l).attr("y",a-7).style("text-anchor","middle").attr("class","messageText").text(s.message);o="undefined"!=typeof h[0][0].getBBox?h[0][0].getBBox().width:h[0][0].getBoundingClientRect();var d;if(e===i){d=c.append("path").attr("d","M "+e+","+a+" C "+(e+60)+","+(a-10)+" "+(e+60)+","+(a+30)+" "+e+","+(a+20)),n.bounds.bumpVerticalPos(30);var f=Math.max(o/2,100);n.bounds.insert(e-f,n.bounds.getVerticalPos()-10,i+f,n.bounds.getVerticalPos())}else d=c.append("line"),d.attr("x1",e),d.attr("y1",a),d.attr("x2",i),d.attr("y2",a),n.bounds.insert(e,n.bounds.getVerticalPos()-10,i,n.bounds.getVerticalPos());s.type===r.yy.LINETYPE.DOTTED||s.type===r.yy.LINETYPE.DOTTED_CROSS||s.type===r.yy.LINETYPE.DOTTED_OPEN?(d.style("stroke-dasharray","3, 3"),d.attr("class","messageLine1")):d.attr("class","messageLine0");var p="";u.arrowMarkerAbsolute&&(p=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,p=p.replace(/\(/g,"\\("),p=p.replace(/\)/g,"\\)")),d.attr("stroke-width",2),d.attr("stroke","black"),d.style("fill","none"),(s.type===r.yy.LINETYPE.SOLID||s.type===r.yy.LINETYPE.DOTTED)&&d.attr("marker-end","url("+p+"#arrowhead)"),(s.type===r.yy.LINETYPE.SOLID_CROSS||s.type===r.yy.LINETYPE.DOTTED_CROSS)&&d.attr("marker-end","url("+p+"#crosshead)")};e.exports.drawActors=function(t,e,r,a){var s;for(s=0;s/gi," "),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.attr("fill",e.fill),"undefined"!=typeof e["class"]&&i.attr("class",e["class"]);var a=i.append("tspan");return a.attr("x",e.x+2*e.textMargin),a.text(r),"undefined"!=typeof i.textwrap&&i.textwrap({x:e.x,y:e.y,width:n,height:1800},e.textMargin),i},n.drawLabel=function(t,e){var r=n.getNoteRect();r.x=e.x,r.y=e.y,r.width=50,r.height=20,r.fill="#526e52",r.stroke="none",r["class"]="labelBox",n.drawRect(t,r),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,e.fill="white",n.drawText(t,e)};var r=-1;n.drawActor=function(t,e,i,a,s){var o=e+s.width/2,u=t.append("g");0===i&&(r++,u.append("line").attr("id","actor"+r).attr("x1",o).attr("y1",5).attr("x2",o).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"));var c=n.getNoteRect();c.x=e,c.y=i,c.fill="#eaeaea",c.width=s.width,c.height=s.height,c["class"]="actor",c.rx=3,c.ry=3,n.drawRect(u,c),u.append("text").attr("x",o).attr("y",i+s.height/2+5).attr("class","actor").style("text-anchor","middle").text(a)},n.drawLoop=function(t,e,r,i){var a=t.append("g"),s=function(t,e,n,r){a.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",r).attr("stroke-width",2).attr("stroke","#526e52").attr("class","loopLine")};s(e.startx,e.starty,e.stopx,e.starty),s(e.stopx,e.starty,e.stopx,e.stopy),s(e.startx,e.stopy,e.stopx,e.stopy),s(e.startx,e.starty,e.startx,e.stopy),"undefined"!=typeof e.elsey&&s(e.startx,e.elsey,e.stopx,e.elsey);var o=n.getTextObj();o.text=r,o.x=e.startx,o.y=e.starty,o.labelMargin=15,o["class"]="labelText",o.fill="white",n.drawLabel(a,o),o=n.getTextObj(),o.text="[ "+e.title+" ]",o.x=e.startx+(e.stopx-e.startx)/2,o.y=e.starty+1.5*i.boxMargin,o.anchor="middle",o["class"]="loopText",n.drawText(a,o),"undefined"!=typeof e.elseText&&(o.text="[ "+e.elseText+" ]",o.y=e.elsey+1.5*i.boxMargin,n.drawText(a,o))},n.insertArrowHead=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},n.insertArrowCrossHead=function(t){var e=t.append("defs"),n=e.append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.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"),n.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")},n.getTextObj=function(){var t={x:0,y:0,fill:"black","text-anchor":"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0};return t},n.getNoteRect=function(){var t={x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0};return t}},{}],125:[function(t,e,n){"use strict";function r(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getSeconds(),i=t.getMilliseconds();10>e&&(e="0"+e),10>n&&(n="0"+n),10>r&&(r="0"+r),100>i&&(i="0"+i),10>i&&(i="00"+i);var a=e+":"+n+":"+r+" ("+i+")";return a}function i(t){this.level=t,this.log=function(t,e){var n=this.level;return"undefined"==typeof n&&(n=s),e>=n&&"undefined"!=typeof console&&"undefined"!=typeof console.log?console.log("["+r(new Date)+"] "+t):void 0},this.trace=function(t){this.log(t,a.trace)},this.debug=function(t){this.log(t,a.debug)},this.info=function(t){this.log(t,a.info)},this.warn=function(t){this.log(t,a.warn)},this.error=function(t){this.log(t,a.error)}}var a={debug:1,info:2,warn:3,error:4,fatal:5,"default":5},s=a.error;n.setLogLevel=function(t){s=t},n.Log=i},{}],126:[function(t,e,n){(function(e){"use strict";var r=t("./logger"),i=new r.Log,a=t("./diagrams/flowchart/graphDb"),s=t("./utils"),o=t("./diagrams/flowchart/flowRenderer"),u=t("./diagrams/sequenceDiagram/sequenceRenderer"),c=t("./diagrams/example/exampleRenderer"),l=t("./diagrams/example/parser/example"),h=t("./diagrams/flowchart/parser/flow"),d=t("./diagrams/flowchart/parser/dot"),f=t("./diagrams/sequenceDiagram/parser/sequenceDiagram"),p=t("./diagrams/sequenceDiagram/sequenceDb"),g=t("./diagrams/example/exampleDb"),y=t("./diagrams/gantt/ganttRenderer"),m=t("./diagrams/gantt/parser/gantt"),v=t("./diagrams/gantt/ganttDb"),_=t("./diagrams/classDiagram/parser/classDiagram"),b=t("./diagrams/classDiagram/classRenderer"),A=t("./diagrams/classDiagram/classDb"),x=t("./d3");SVGElement.prototype.getTransformToElement=SVGElement.prototype.getTransformToElement||function(t){return t.getScreenCTM().inverse().multiply(this.getScreenCTM())};var w={logLevel:5,cloneCssStyles:!0,startOnLoad:!0,arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequenceDiagram:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,sidePadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:3,axisFormatter:[["%I:%M",function(t){return t.getHours()}],["w. %U",function(t){return 1==t.getDay()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%m-%y",function(t){return t.getMonth()}]]},classDiagram:{},info:{}};r.setLogLevel(w.logLevel);var k=function(t){var e,n=s.detectType(t);switch(n){case"graph":e=h,e.parser.yy=a;break;case"dotGraph":e=d,e.parser.yy=a;break;case"sequenceDiagram":e=f,e.parser.yy=p;break;case"info":e=l,e.parser.yy=g;break;case"gantt":e=m,e.parser.yy=v;break;case"classDiagram":e=_,e.parser.yy=A}try{return e.parse(t),!0}catch(r){return!1}};n.parse=k,n.version=function(){return t("../package.json").version},n.encodeEntities=function(t){var e=t;return e=e.replace(/style.*:\S*#.*;/g,function(t){var e=t.substring(0,t.length-1);return e}),e=e.replace(/classDef.*:\S*#.*;/g,function(t){var e=t.substring(0,t.length-1);return e}),e=e.replace(/#\w+\;/g,function(t){var e=t.substring(1,t.length-1),n=/^\+?\d+$/.test(e);return n?"fl°°"+e+"¶ß":"fl°"+e+"¶ß"})},n.decodeEntities=function(t){var e=t;return e=e.replace(/\fl\°\°/g,function(){return"&#"}),e=e.replace(/\fl\°/g,function(){return"&"}),e=e.replace(/¶ß/g,function(){return";"})};var E=function(t,e,r,l){"undefined"!=typeof l?x.select(l).append("div").attr("id","d"+t).append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg").append("g"):x.select("body").append("div").attr("id","d"+t).append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg").append("g"),window.txt=e,e=n.encodeEntities(e);var h=x.select("#d"+t).node(),d=s.detectType(e),f={};switch(d){case"graph":w.flowchart.arrowMarkerAbsolute=w.arrowMarkerAbsolute,o.setConf(w.flowchart),o.draw(e,t,!1),w.cloneCssStyles&&(f=o.getClasses(e,!1),s.cloneCssStyles(h.firstChild,f));break;case"dotGraph":w.flowchart.arrowMarkerAbsolute=w.arrowMarkerAbsolute,o.setConf(w.flowchart),o.draw(e,t,!0),w.cloneCssStyles&&(f=o.getClasses(e,!0),s.cloneCssStyles(h.firstChild,f));break;case"sequenceDiagram":w.sequenceDiagram.arrowMarkerAbsolute=w.arrowMarkerAbsolute,u.setConf(w.sequenceDiagram),u.draw(e,t),w.cloneCssStyles&&s.cloneCssStyles(h.firstChild,[]);break;case"gantt":w.gantt.arrowMarkerAbsolute=w.arrowMarkerAbsolute,y.setConf(w.gantt),y.draw(e,t),w.cloneCssStyles&&s.cloneCssStyles(h.firstChild,[]);break;case"classDiagram":w.classDiagram.arrowMarkerAbsolute=w.arrowMarkerAbsolute,b.setConf(w.classDiagram),b.draw(e,t),w.cloneCssStyles&&s.cloneCssStyles(h.firstChild,[]);break;case"info":w.info.arrowMarkerAbsolute=w.arrowMarkerAbsolute,c.draw(e,t,n.version()),w.cloneCssStyles&&s.cloneCssStyles(h.firstChild,[])}x.select("#d"+t).selectAll("foreignobject div").attr("xmlns","http://www.w3.org/1999/xhtml");var p="";w.arrowMarkerAbsolute&&(p=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,p=p.replace(/\(/g,"\\("),p=p.replace(/\)/g,"\\)"));var g=x.select("#d"+t).node().innerHTML.replace(/url\(#arrowhead/g,"url("+p+"#arrowhead","g");g=n.decodeEntities(g),"undefined"!=typeof r?r(g,a.bindFunctions):i.warn("CB = undefined!");var m=x.select("#d"+t).node();return null!==m&&"function"==typeof m.remove&&x.select("#d"+t).node().remove(),g};n.render=function(t,e,n,r){try{if(1===arguments.length&&(e=t,t="mermaidId0"),"undefined"!=typeof document)return E(t,e,n,r)}catch(a){i.warn(a)}};var D=function(t){var e,n=Object.keys(t);for(e=0;e0&&(r+=n.selectorText+" { "+n.style.cssText+"}\n")}}catch(l){"undefined"!=typeof n&&i.warn('Invalid CSS selector "'+n.selectorText+'"',l)}var h="",d="";for(var f in e)e.hasOwnProperty(f)&&"undefined"!=typeof f&&("default"===f?(e["default"].styles instanceof Array&&(h+="#"+t.id.trim()+" .node>rect { "+e[f].styles.join("; ")+"; }\n"),e["default"].nodeLabelStyles instanceof Array&&(h+="#"+t.id.trim()+" .node text { "+e[f].nodeLabelStyles.join("; ")+"; }\n"),e["default"].edgeLabelStyles instanceof Array&&(h+="#"+t.id.trim()+" .edgeLabel text { "+e[f].edgeLabelStyles.join("; ")+"; }\n"),e["default"].clusterStyles instanceof Array&&(h+="#"+t.id.trim()+" .cluster rect { "+e[f].clusterStyles.join("; ")+"; }\n")):e[f].styles instanceof Array&&(d+="#"+t.id.trim()+" ."+f+">rect, ."+f+">polygon, ."+f+">ellipse { "+e[f].styles.join("; ")+"; }\n"));if(""!==r||""!==h||""!==d){var p=document.createElement("style");p.setAttribute("type","text/css"),p.setAttribute("title","mermaid-svg-internal-css"),p.innerHTML="/* */\n",t.insertBefore(p,t.firstChild)}};n.cloneCssStyles=s},{"./logger":125}]},{},[126])(126)}); \ No newline at end of file +s.each(i.vs,function(e,n){t.node(e).order=n}),h(t,n,i.vs)})}function a(t,e){s.each(e,function(e){s.each(e,function(e,n){t.node(e).order=n})})}var s=t("../lodash"),o=t("./init-order"),u=t("./cross-count"),c=t("./sort-subgraph"),l=t("./build-layer-graph"),h=t("./add-subgraph-constraints"),d=t("../graphlib").Graph,f=t("../util");e.exports=n},{"../graphlib":36,"../lodash":39,"../util":58,"./add-subgraph-constraints":42,"./build-layer-graph":44,"./cross-count":45,"./init-order":47,"./sort-subgraph":49}],47:[function(t,e){"use strict";function n(t){function e(i){if(!r.has(n,i)){n[i]=!0;var a=t.node(i);s[a.rank].push(i),r.each(t.successors(i),e)}}var n={},i=r.filter(t.nodes(),function(e){return!t.children(e).length}),a=r.max(r.map(i,function(e){return t.node(e).rank})),s=r.map(r.range(a+1),function(){return[]}),o=r.sortBy(i,function(e){return t.node(e).rank});return r.each(o,e),s}var r=t("../lodash");e.exports=n},{"../lodash":39}],48:[function(t,e){"use strict";function n(t,e){var n={};a.each(t,function(t,e){var r=n[t.v]={indegree:0,"in":[],out:[],vs:[t.v],i:e};a.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)}),a.each(e.edges(),function(t){var e=n[t.v],r=n[t.w];a.isUndefined(e)||a.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))});var i=a.filter(n,function(t){return!t.indegree});return r(i)}function r(t){function e(t){return function(e){e.merged||(a.isUndefined(e.barycenter)||a.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&i(t,e)}}function n(e){return function(n){n["in"].push(e),0===--n.indegree&&t.push(n)}}for(var r=[];t.length;){var s=t.pop();r.push(s),a.each(s["in"].reverse(),e(s)),a.each(s.out,n(s))}return a.chain(r).filter(function(t){return!t.merged}).map(function(t){return a.pick(t,["vs","i","barycenter","weight"])}).value()}function i(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}var a=t("../lodash");e.exports=n},{"../lodash":39}],49:[function(t,e){function n(t,e,c,l){var h=t.children(e),d=t.node(e),f=d?d.borderLeft:void 0,p=d?d.borderRight:void 0,g={};f&&(h=a.filter(h,function(t){return t!==f&&t!==p}));var y=s(t,h);a.each(y,function(e){if(t.children(e.v).length){var r=n(t,e.v,c,l);g[e.v]=r,a.has(r,"barycenter")&&i(e,r)}});var m=o(y,c);r(m,g);var v=u(m,l);if(f&&(v.vs=a.flatten([f,v.vs,p],!0),t.predecessors(f).length)){var _=t.node(t.predecessors(f)[0]),b=t.node(t.predecessors(p)[0]);a.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+_.order+b.order)/(v.weight+2),v.weight+=2}return v}function r(t,e){a.each(t,function(t){t.vs=a.flatten(t.vs.map(function(t){return e[t]?e[t].vs:t}),!0)})}function i(t,e){a.isUndefined(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}var a=t("../lodash"),s=t("./barycenter"),o=t("./resolve-conflicts"),u=t("./sort");e.exports=n},{"../lodash":39,"./barycenter":43,"./resolve-conflicts":48,"./sort":50}],50:[function(t,e){function n(t,e){var n=s.partition(t,function(t){return a.has(t,"barycenter")}),o=n.lhs,u=a.sortBy(n.rhs,function(t){return-t.i}),c=[],l=0,h=0,d=0;o.sort(i(!!e)),d=r(c,u,d),a.each(o,function(t){d+=t.vs.length,c.push(t.vs),l+=t.barycenter*t.weight,h+=t.weight,d=r(c,u,d)});var f={vs:a.flatten(c,!0)};return h&&(f.barycenter=l/h,f.weight=h),f}function r(t,e,n){for(var r;e.length&&(r=a.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}function i(t){return function(e,n){return e.barycentern.barycenter?1:t?n.i-e.i:e.i-n.i}}var a=t("../lodash"),s=t("../util");e.exports=n},{"../lodash":39,"../util":58}],51:[function(t,e){function n(t){var e=i(t);a.each(t.graph().dummyChains,function(n){for(var i=t.node(n),a=i.edgeObj,s=r(t,e,a.v,a.w),o=s.path,u=s.lca,c=0,l=o[c],h=!0;n!==a.w;){if(i=t.node(n),h){for(;(l=o[c])!==u&&t.node(l).maxRanku||c>e[i].lim));for(a=i,i=r;(i=t.parent(i))!==a;)o.push(i);return{path:s.concat(o.reverse()),lca:a}}function i(t){function e(i){var s=r;a.each(t.children(i),e),n[i]={low:s,lim:r++}}var n={},r=0;return a.each(t.children(),e),n}var a=t("./lodash");e.exports=n},{"./lodash":39}],52:[function(t,e){"use strict";function n(t,e){function n(e,n){var s=0,o=0,u=e.length,c=y.last(n);return y.each(n,function(e,l){var h=i(t,e),d=h?t.node(h).order:u;(h||e===c)&&(y.each(n.slice(o,l+1),function(e){y.each(t.predecessors(e),function(n){var i=t.node(n),o=i.order;!(s>o||o>d)||i.dummy&&t.node(e).dummy||a(r,n,e)})}),o=l+1,s=d)}),n}var r={};return y.reduce(e,n),r}function r(t,e){function n(e,n,r,s,o){var u;y.each(y.range(n,r),function(n){u=e[n],t.node(u).dummy&&y.each(t.predecessors(u),function(e){var n=t.node(e);n.dummy&&(n.ordero)&&a(i,e,u)})})}function r(e,r){var i,a=-1,s=0;return y.each(r,function(o,u){if("border"===t.node(o).dummy){var c=t.predecessors(o);c.length&&(i=t.node(c[0]).order,n(r,s,u,a,i),s=u,a=i)}n(r,s,r.length,i,e.length)}),r}var i={};return y.reduce(e,r),i}function i(t,e){return t.node(e).dummy?y.find(t.predecessors(e),function(e){return t.node(e).dummy}):void 0}function a(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function s(t,e,n){if(e>n){var r=e;e=n,n=r}return y.has(t[e],n)}function o(t,e,n,r){var i={},a={},o={};return y.each(e,function(t){y.each(t,function(t,e){i[t]=t,a[t]=t,o[t]=e})}),y.each(e,function(t){var e=-1;y.each(t,function(t){var u=r(t);if(u.length){u=y.sortBy(u,function(t){return o[t]});for(var c=(u.length-1)/2,l=Math.floor(c),h=Math.ceil(c);h>=l;++l){var d=u[l];a[t]===t&&es.lim&&(o=s,u=!0);var c=p.filter(e.edges(),function(e){return u===f(t,t.node(e.v),o)&&u!==f(t,t.node(e.w),o)});return p.min(c,function(t){return y(e,t)})}function l(t,e,n,i){var a=n.v,o=n.w;t.removeEdge(a,o),t.setEdge(i.v,i.w,{}),s(t),r(t,e),h(t,e)}function h(t,e){var n=p.find(t.nodes(),function(t){return!e.node(t).parent}),r=v(t,n);r=r.slice(1),p.each(r,function(n){var r=t.node(n).parent,i=e.edge(n,r),a=!1;i||(i=e.edge(r,n),a=!0),e.node(n).rank=e.node(r).rank+(a?i.minlen:-i.minlen)})}function d(t,e,n){return t.hasEdge(e,n)}function f(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}var p=t("../lodash"),g=t("./feasible-tree"),y=t("./util").slack,m=t("./util").longestPath,v=t("../graphlib").alg.preorder,_=t("../graphlib").alg.postorder,b=t("../util").simplify;e.exports=n,n.initLowLimValues=s,n.initCutValues=r,n.calcCutValue=a,n.leaveEdge=u,n.enterEdge=c,n.exchangeEdges=l},{"../graphlib":36,"../lodash":39,"../util":58,"./feasible-tree":54,"./util":57}],57:[function(t,e){"use strict";function n(t){function e(r){var a=t.node(r);if(i.has(n,r))return a.rank;n[r]=!0;var s=i.min(i.map(t.outEdges(r),function(n){return e(n.w)-t.edge(n).minlen}));return s===Number.POSITIVE_INFINITY&&(s=0),a.rank=s}var n={};i.each(t.sources(),e)}function r(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var i=t("../lodash");e.exports={longestPath:n,slack:r}},{"../lodash":39}],58:[function(t,e){"use strict";function n(t,e,n,r){var i;do i=y.uniqueId(r);while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function r(t){var e=(new m).setGraph(t.graph());return y.each(t.nodes(),function(n){e.setNode(n,t.node(n))}),y.each(t.edges(),function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),e}function i(t){var e=new m({multigraph:t.isMultigraph()}).setGraph(t.graph());return y.each(t.nodes(),function(n){t.children(n).length||e.setNode(n,t.node(n))}),y.each(t.edges(),function(n){e.setEdge(n,t.edge(n))}),e}function a(t){var e=y.map(t.nodes(),function(e){var n={};return y.each(t.outEdges(e),function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight}),n});return y.zipObject(t.nodes(),e)}function s(t){var e=y.map(t.nodes(),function(e){var n={};return y.each(t.inEdges(e),function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight}),n});return y.zipObject(t.nodes(),e)}function o(t,e){var n=t.x,r=t.y,i=e.x-n,a=e.y-r,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var u,c;return Math.abs(a)*s>Math.abs(i)*o?(0>a&&(o=-o),u=o*i/a,c=o):(0>i&&(s=-s),u=s,c=s*a/i),{x:n+u,y:r+c}}function u(t){var e=y.map(y.range(d(t)+1),function(){return[]});return y.each(t.nodes(),function(n){var r=t.node(n),i=r.rank;y.isUndefined(i)||(e[i][r.order]=n)}),e}function c(t){var e=y.min(y.map(t.nodes(),function(e){return t.node(e).rank}));y.each(t.nodes(),function(n){var r=t.node(n);y.has(r,"rank")&&(r.rank-=e)})}function l(t){var e=y.min(y.map(t.nodes(),function(e){return t.node(e).rank})),n=[];y.each(t.nodes(),function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=t.graph().nodeRankFactor;y.each(n,function(e,n){y.isUndefined(e)&&n%i!==0?--r:r&&y.each(e,function(e){t.node(e).rank+=r})})}function h(t,e,r,i){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=i),n(t,"border",a,e)}function d(t){return y.max(y.map(t.nodes(),function(e){var n=t.node(e).rank;return y.isUndefined(n)?void 0:n}))}function f(t,e){var n={lhs:[],rhs:[]};return y.each(t,function(t){e(t)?n.lhs.push(t):n.rhs.push(t)}),n}function p(t,e){var n=y.now();try{return e()}finally{console.log(t+" time: "+(y.now()-n)+"ms")}}function g(t,e){return e()}var y=t("./lodash"),m=t("./graphlib").Graph;e.exports={addDummyNode:n,simplify:r,asNonCompoundGraph:i,successorWeights:a,predecessorWeights:s,intersectRect:o,buildLayerMatrix:u,normalizeRanks:c,removeEmptyRanks:l,addBorderNode:h,maxRank:d,partition:f,time:p,notime:g}},{"./graphlib":36,"./lodash":39}],59:[function(t,e){e.exports="0.7.4"},{}],60:[function(t,e){var n=t("./lib");e.exports={Graph:n.Graph,json:t("./lib/json"),alg:t("./lib/alg"),version:n.version}},{"./lib":76,"./lib/alg":67,"./lib/json":77}],61:[function(t,e){function n(t){function e(a){r.has(i,a)||(i[a]=!0,n.push(a),r.each(t.successors(a),e),r.each(t.predecessors(a),e))}var n,i={},a=[];return r.each(t.nodes(),function(t){n=[],e(t),n.length&&a.push(n)}),a}var r=t("../lodash");e.exports=n},{"../lodash":78}],62:[function(t,e){function n(t,e,n){i.isArray(e)||(e=[e]);var a=[],s={};return i.each(e,function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);r(t,e,"post"===n,s,a)}),a}function r(t,e,n,a,s){i.has(a,e)||(a[e]=!0,n||s.push(e),i.each(t.neighbors(e),function(e){r(t,e,n,a,s)}),n&&s.push(e))}var i=t("../lodash");e.exports=n},{"../lodash":78}],63:[function(t,e){function n(t,e,n){return i.transform(t.nodes(),function(i,a){i[a]=r(t,a,e,n)},{})}var r=t("./dijkstra"),i=t("../lodash");e.exports=n},{"../lodash":78,"./dijkstra":64}],64:[function(t,e){function n(t,e,n,i){return r(t,String(e),n||s,i||function(e){return t.outEdges(e)})}function r(t,e,n,r){var i,s,o={},u=new a,c=function(t){var e=t.v!==i?t.v:t.w,r=o[e],a=n(t),c=s.distance+a;if(0>a)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+a);c0&&(i=u.removeMin(),s=o[i],s.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(c);return o}var i=t("../lodash"),a=t("../data/priority-queue");e.exports=n;var s=i.constant(1)},{"../data/priority-queue":74,"../lodash":78}],65:[function(t,e){function n(t){return r.filter(i(t),function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})}var r=t("../lodash"),i=t("./tarjan");e.exports=n},{"../lodash":78,"./tarjan":72}],66:[function(t,e){function n(t,e,n){return r(t,e||a,n||function(e){return t.outEdges(e)})}function r(t,e,n){var r={},i=t.nodes();return i.forEach(function(t){r[t]={},r[t][t]={distance:0},i.forEach(function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})}),n(t).forEach(function(n){var i=n.v===t?n.w:n.v,a=e(n);r[t][i]={distance:a,predecessor:t}})}),i.forEach(function(t){var e=r[t];i.forEach(function(n){var a=r[n];i.forEach(function(n){var r=a[t],i=e[n],s=a[n],o=r.distance+i.distance;oi&&(u[n]=s,c.decrease(n,i))}}var s,o=new i,u={},c=new a;if(0===t.nodeCount())return o;r.each(t.nodes(),function(t){c.add(t,Number.POSITIVE_INFINITY),o.setNode(t)}),c.decrease(t.nodes()[0],0);for(var l=!1;c.size()>0;){if(s=c.removeMin(),r.has(u,s))o.setEdge(s,u[s]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(s).forEach(n)}return o}var r=t("../lodash"),i=t("../graph"),a=t("../data/priority-queue");e.exports=n},{"../data/priority-queue":74,"../graph":75,"../lodash":78}],72:[function(t,e){function n(t){function e(o){var u=a[o]={onStack:!0,lowlink:n,index:n++};if(i.push(o),t.successors(o).forEach(function(t){r.has(a,t)?a[t].onStack&&(u.lowlink=Math.min(u.lowlink,a[t].index)):(e(t),u.lowlink=Math.min(u.lowlink,a[t].lowlink))}),u.lowlink===u.index){var c,l=[];do c=i.pop(),a[c].onStack=!1,l.push(c);while(o!==c);s.push(l)}}var n=0,i=[],a={},s=[];return t.nodes().forEach(function(t){r.has(a,t)||e(t)}),s}var r=t("../lodash");e.exports=n},{"../lodash":78}],73:[function(t,e){function n(t){function e(o){if(i.has(a,o))throw new r;i.has(n,o)||(a[o]=!0,n[o]=!0,i.each(t.predecessors(o),e),delete a[o],s.push(o))}var n={},a={},s=[];if(i.each(t.sinks(),e),i.size(n)!==t.nodeCount())throw new r;return s}function r(){}var i=t("../lodash");e.exports=n,n.CycleException=r},{"../lodash":78}],74:[function(t,e){function n(){this._arr=[],this._keyIndices={}}var r=t("../lodash");e.exports=n,n.prototype.size=function(){return this._arr.length},n.prototype.keys=function(){return this._arr.map(function(t){return t.key})},n.prototype.has=function(t){return r.has(this._keyIndices,t)},n.prototype.priority=function(t){var e=this._keyIndices[t];return void 0!==e?this._arr[e].priority:void 0},n.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},n.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,a=i.length;return n[t]=a,i.push({key:t,priority:e}),this._decrease(a),!0}return!1},n.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},n.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},n.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n>1,!(n[e].prioritya){var s=i;i=a,a=s}return i+h+a+h+(u.isUndefined(r)?c:r)}function s(t,e,n,r){var i=""+e,a=""+n;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return r&&(o.name=r),o}function o(t,e){return a(t,e.v,e.w,e.name)}var u=t("./lodash");e.exports=n;var c="\x00",l="\x00",h="";n.prototype._nodeCount=0,n.prototype._edgeCount=0,n.prototype.isDirected=function(){return this._isDirected},n.prototype.isMultigraph=function(){return this._isMultigraph},n.prototype.isCompound=function(){return this._isCompound},n.prototype.setGraph=function(t){return this._label=t,this},n.prototype.graph=function(){return this._label},n.prototype.setDefaultNodeLabel=function(t){return u.isFunction(t)||(t=u.constant(t)),this._defaultNodeLabelFn=t,this},n.prototype.nodeCount=function(){return this._nodeCount},n.prototype.nodes=function(){return u.keys(this._nodes)},n.prototype.sources=function(){return u.filter(this.nodes(),function(t){return u.isEmpty(this._in[t])},this)},n.prototype.sinks=function(){return u.filter(this.nodes(),function(t){return u.isEmpty(this._out[t])},this)},n.prototype.setNodes=function(t,e){var n=arguments;return u.each(t,function(t){n.length>1?this.setNode(t,e):this.setNode(t)},this),this},n.prototype.setNode=function(t,e){return u.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=l,this._children[t]={},this._children[l][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},n.prototype.node=function(t){return this._nodes[t]},n.prototype.hasNode=function(t){return u.has(this._nodes,t)},n.prototype.removeNode=function(t){var e=this;if(u.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],u.each(this.children(t),function(t){this.setParent(t)},this),delete this._children[t]),u.each(u.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],u.each(u.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},n.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(u.isUndefined(e))e=l;else{e+="";for(var n=e;!u.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},n.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},n.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==l)return e}},n.prototype.children=function(t){if(u.isUndefined(t)&&(t=l),this._isCompound){var e=this._children[t];if(e)return u.keys(e)}else{if(t===l)return this.nodes();if(this.hasNode(t))return[]}},n.prototype.predecessors=function(t){var e=this._preds[t];return e?u.keys(e):void 0},n.prototype.successors=function(t){var e=this._sucs[t];return e?u.keys(e):void 0},n.prototype.neighbors=function(t){var e=this.predecessors(t);return e?u.union(e,this.successors(t)):void 0},n.prototype.filterNodes=function(t){function e(t){var a=r.parent(t);return void 0===a||n.hasNode(a)?(i[t]=a,a):a in i?i[a]:e(a)}var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph()),u.each(this._nodes,function(e,r){t(r)&&n.setNode(r,e)},this),u.each(this._edgeObjs,function(t){n.hasNode(t.v)&&n.hasNode(t.w)&&n.setEdge(t,this.edge(t))},this);var r=this,i={};return this._isCompound&&u.each(n.nodes(),function(t){n.setParent(t,e(t))}),n},n.prototype.setDefaultEdgeLabel=function(t){return u.isFunction(t)||(t=u.constant(t)),this._defaultEdgeLabelFn=t,this},n.prototype.edgeCount=function(){return this._edgeCount},n.prototype.edges=function(){return u.values(this._edgeObjs)},n.prototype.setPath=function(t,e){var n=this,r=arguments;return u.reduce(t,function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i}),this},n.prototype.setEdge=function(){var t,e,n,i,o=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(t=c.v,e=c.w,n=c.name,2===arguments.length&&(i=arguments[1],o=!0)):(t=c,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,e=""+e,u.isUndefined(n)||(n=""+n);var l=a(this._isDirected,t,e,n);if(u.has(this._edgeLabels,l))return o&&(this._edgeLabels[l]=i),this;if(!u.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=o?i:this._defaultEdgeLabelFn(t,e,n);var h=s(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[l]=h,r(this._preds[e],t),r(this._sucs[t],e),this._in[e][l]=h,this._out[t][l]=h,this._edgeCount++,this},n.prototype.edge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return this._edgeLabels[r]},n.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return u.has(this._edgeLabels,r)},n.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,t,e,n),s=this._edgeObjs[r];return s&&(t=s.v,e=s.w,delete this._edgeLabels[r],delete this._edgeObjs[r],i(this._preds[e],t),i(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},n.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=u.values(n);return e?u.filter(r,function(t){return t.v===e}):r}},n.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=u.values(n);return e?u.filter(r,function(t){return t.w===e}):r}},n.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);return n?n.concat(this.outEdges(t,e)):void 0}},{"./lodash":78}],76:[function(t,e){e.exports={Graph:t("./graph"),version:t("./version")}},{"./graph":75,"./version":79}],77:[function(t,e){function n(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:r(t),edges:i(t)};return s.isUndefined(t.graph())||(e.value=s.clone(t.graph())),e}function r(t){return s.map(t.nodes(),function(e){var n=t.node(e),r=t.parent(e),i={v:e};return s.isUndefined(n)||(i.value=n),s.isUndefined(r)||(i.parent=r),i})}function i(t){return s.map(t.edges(),function(e){var n=t.edge(e),r={v:e.v,w:e.w};return s.isUndefined(e.name)||(r.name=e.name),s.isUndefined(n)||(r.value=n),r})}function a(t){var e=new o(t.options).setGraph(t.value);return s.each(t.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),s.each(t.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}var s=t("./lodash"),o=t("./graph");e.exports={write:n,read:a}},{"./graph":75,"./lodash":78}],78:[function(t,e){e.exports=t(39)},{"/Users/knut/source/mermaid/node_modules/dagre/lib/lodash.js":39,lodash:80}],79:[function(t,e){e.exports="1.0.7"},{}],80:[function(t,e,n){(function(t){(function(){function r(t,e){if(t!==e){var n=null===t,r=t===E,i=t===t,a=null===e,s=e===E,o=e===e;if(t>e&&!a||!i||n&&!s&&o||r&&o)return 1;if(e>t&&!n||!o||a&&!r&&i||s&&i)return-1}return 0}function i(t,e,n){for(var r=t.length,i=n?r:-1;n?i--:++i-1;);return n}function c(t,e){for(var n=t.length;n--&&e.indexOf(t.charAt(n))>-1;);return n}function l(t,e){return r(t.criteria,e.criteria)||t.index-e.index}function h(t,e,n){for(var i=-1,a=t.criteria,s=e.criteria,o=a.length,u=n.length;++i=u)return c;var l=n[i];return c*("asc"===l||l===!0?1:-1)}}return t.index-e.index}function d(t){return Gt[t]}function f(t){return Vt[t]}function p(t,e,n){return e?t=qt[t]:n&&(t=Xt[t]),"\\"+t}function g(t){return"\\"+Xt[t]}function y(t,e,n){for(var r=t.length,i=e+(n?0:-1);n?i--:++i=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function _(t,e){for(var n=-1,r=t.length,i=-1,a=[];++ne,i=n?t.length:0,a=Hn(0,i,this.__views__),s=a.start,o=a.end,u=o-s,c=r?o:s-1,l=this.__iteratees__,h=l.length,d=0,f=xs(u,this.__takeCount__);if(!n||Y>i||i==u&&f==u)return nn(r&&n?t.reverse():t,this.__actions__);var p=[];t:for(;u--&&f>d;){c+=e;for(var g=-1,y=t[c];++g=Y?gn(e):null,c=e.length;u&&(s=Kt,o=!1,e=u);t:for(;++in&&(n=-n>i?0:i+n),r=r===E||r>i?i:+r||0,0>r&&(r+=i),i=n>r?0:r>>>0,n>>>=0;i>n;)t[n++]=e;return t}function Te(t,e){var n=[];return Ls(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function Ce(t,e,n,r){var i;return n(t,function(t,n,a){return e(t,n,a)?(i=r?n:t,!1):void 0}),i}function Fe(t,e,n,r){r||(r=[]);for(var i=-1,a=t.length;++ir;)t=t[e[r++]];return r&&r==i?t:E}}function Le(t,e,n,r,i,a){return t===e?!0:null==t||null==e||!Mi(t)&&!m(e)?t!==t&&e!==e:Pe(t,e,Le,n,r,i,a)}function Pe(t,e,n,r,i,a,s){var o=Fo(t),u=Fo(e),c=H,l=H;o||(c=ns.call(t),c==V?c=J:c!=J&&(o=Wi(t))),u||(l=ns.call(e),l==V?l=J:l!=J&&(u=Wi(e)));var h=c==J,d=l==J,f=c==l;if(f&&!o&&!h)return jn(t,e,c);if(!i){var p=h&&ts.call(t,"__wrapped__"),g=d&&ts.call(e,"__wrapped__");if(p||g)return n(p?t.value():t,g?e.value():e,r,i,a,s)}if(!f)return!1;a||(a=[]),s||(s=[]);for(var y=a.length;y--;)if(a[y]==t)return s[y]==e;a.push(t),s.push(e);var m=(o?Rn:Yn)(t,e,n,r,i,a,s);return a.pop(),s.pop(),m}function Ne(t,e,n){var r=e.length,i=r,a=!n;if(null==t)return!i;for(t=hr(t);r--;){var s=e[r];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++re&&(e=-e>i?0:i+e),n=n===E||n>i?i:+n||0,0>n&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=Ya(i);++r=Y,u=o?gn():null,c=[];u?(r=Kt,s=!1):(o=!1,u=e?[]:c);t:for(;++n=i){for(;i>r;){var a=r+i>>>1,s=t[a];(n?e>=s:e>s)&&null!==s?r=a+1:i=a}return i}return an(t,e,Ta,n)}function an(t,e,n,r){e=n(e);for(var i=0,a=t?t.length:0,s=e!==e,o=null===e,u=e===E;a>i;){var c=ms((i+a)/2),l=n(t[c]),h=l!==E,d=l===l;if(s)var f=d||r;else f=o?d&&h&&(r||null!=l):u?d&&(r||h):null==l?!1:r?e>=l:e>l;f?i=c+1:a=c}return xs(a,Fs)}function sn(t,e,n){if("function"!=typeof t)return Ta;if(e===E)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,a){return t.call(e,n,r,i,a)};case 5:return function(n,r,i,a,s){return t.call(e,n,r,i,a,s)}}return function(){return t.apply(e,arguments)}}function on(t){var e=new as(t.byteLength),n=new fs(e);return n.set(new fs(t)),e}function un(t,e,n){for(var r=n.length,i=-1,a=As(t.length-r,0),s=-1,o=e.length,u=Ya(o+a);++s2?n[i-2]:E,s=i>2?n[2]:E,o=i>1?n[i-1]:E;for("function"==typeof a?(a=sn(a,o,5),i-=2):(a="function"==typeof o?o:E,i-=a?1:0),s&&Jn(n[0],n[1],s)&&(a=3>i?E:a,i=1);++r-1?n[s]:E}return Ce(n,r,t)}}function xn(t){return function(e,n,r){return e&&e.length?(n=$n(n,r,3),i(e,n,t)):-1}}function wn(t){return function(e,n,r){return n=$n(n,r,3),Ce(e,n,t,!0)}}function kn(t){return function(){for(var e,n=arguments.length,r=t?n:-1,i=0,a=Ya(n);t?r--:++r=Y)return e.plant(r).value();for(var i=0,s=n?a[i].apply(this,t):r;++iv){var k=o?te(o):E,D=As(c-v,0),F=p?w:E,S=p?E:w,B=p?A:E,M=p?E:A;e|=p?I:O,e&=~(p?O:I),g||(e&=~(T|C));var L=[t,e,n,B,F,M,S,k,u,D],P=In.apply(E,L);return er(t)&&Us(P,L),P.placeholder=x,P}}var N=d?n:this,R=f?N[t]:t;return o&&(A=ur(A,o)),h&&u=e||!_s(e))return"";var i=e-r;return n=null==n?" ":n+"",ya(n,gs(i/n.length)).slice(0,i)}function Mn(t,e,n,r){function i(){for(var e=-1,o=arguments.length,u=-1,c=r.length,l=Ya(c+o);++uu))return!1;for(;++o-1&&t%1==0&&e>t}function Jn(t,e,n){if(!Mi(n))return!1;var r=typeof e;if("number"==r?Kn(n)&&Qn(e,n.length):"string"==r&&e in n){var i=n[e];return t===t?t===i:i!==i}return!1}function tr(t,e){var n=typeof t;if("string"==n&&Et.test(t)||"number"==n)return!0;if(Fo(t))return!1;var r=!kt.test(t);return r||null!=e&&t in hr(e)}function er(t){var n=Un(t);if(!(n in K.prototype))return!1;var r=e[n];if(t===r)return!0;var i=Ys(r);return!!i&&t===i[0]}function nr(t){return"number"==typeof t&&t>-1&&t%1==0&&Bs>=t}function rr(t){return t===t&&!Mi(t)}function ir(t,e){var n=t[1],r=e[1],i=n|r,a=M>i,s=r==M&&n==S||r==M&&n==L&&t[7].length<=e[8]||r==(M|L)&&n==S;if(!a&&!s)return t;r&T&&(t[2]=e[2],i|=n&T?0:F);var o=e[3];if(o){var u=t[3];t[3]=u?un(u,o,e[4]):te(o),t[4]=u?_(t[3],G):te(e[4])}return o=e[5],o&&(u=t[5],t[5]=u?cn(u,o,e[6]):te(o),t[6]=u?_(t[5],G):te(e[6])),o=e[7],o&&(t[7]=te(o)),r&M&&(t[8]=null==t[8]?e[8]:xs(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}function ar(t,e){return t===E?e:So(t,e,ar)}function sr(t,e){t=hr(t);for(var n=-1,r=e.length,i={};++nr;)s[++a]=qe(t,r,r+=e);return s}function gr(t){for(var e=-1,n=t?t.length:0,r=-1,i=[];++ee?0:e)):[]}function mr(t,e,n){var r=t?t.length:0;return r?((n?Jn(t,e,n):null==e)&&(e=1),e=r-(+e||0),qe(t,0,0>e?0:e)):[]}function vr(t,e,n){return t&&t.length?en(t,$n(e,n,3),!0,!0):[]}function _r(t,e,n){return t&&t.length?en(t,$n(e,n,3),!0):[]}function br(t,e,n,r){var i=t?t.length:0;return i?(n&&"number"!=typeof n&&Jn(t,e,n)&&(n=0,r=i),De(t,e,n,r)):[]}function Ar(t){return t?t[0]:E}function xr(t,e,n){var r=t?t.length:0;return n&&Jn(t,e,n)&&(e=!1),r?Fe(t,e):[]}function wr(t){var e=t?t.length:0;return e?Fe(t,!0):[]}function kr(t,e,n){var r=t?t.length:0;if(!r)return-1;if("number"==typeof n)n=0>n?As(r+n,0):n;else if(n){var i=rn(t,e);return r>i&&(e===e?e===t[i]:t[i]!==t[i])?i:-1}return a(t,e,n||0)}function Er(t){return mr(t,1)}function Dr(t){var e=t?t.length:0;return e?t[e-1]:E}function Tr(t,e,n){var r=t?t.length:0;if(!r)return-1;var i=r;if("number"==typeof n)i=(0>n?As(r+n,0):xs(n||0,r-1))+1;else if(n){i=rn(t,e,!0)-1;var a=t[i];return(e===e?e===a:a!==a)?i:-1}if(e!==e)return y(t,i,!0);for(;i--;)if(t[i]===e)return i;return-1}function Cr(){var t=arguments,e=t[0];if(!e||!e.length)return e;for(var n=0,r=Wn(),i=t.length;++n-1;)ds.call(e,a,1);return e}function Fr(t,e,n){var r=[];if(!t||!t.length)return r;var i=-1,a=[],s=t.length;for(e=$n(e,n,3);++ie?0:e)):[]}function Or(t,e,n){var r=t?t.length:0;return r?((n?Jn(t,e,n):null==e)&&(e=1),e=r-(+e||0),qe(t,0>e?0:e)):[]}function Mr(t,e,n){return t&&t.length?en(t,$n(e,n,3),!1,!0):[]}function Lr(t,e,n){return t&&t.length?en(t,$n(e,n,3)):[]}function Pr(t,e,n,r){var i=t?t.length:0;if(!i)return[];null!=e&&"boolean"!=typeof e&&(r=n,n=Jn(t,e,r)?E:e,e=!1);var s=$n();return(null!=n||s!==be)&&(n=s(n,r,3)),e&&Wn()==a?b(t,n):Je(t,n)}function Nr(t){if(!t||!t.length)return[];var e=-1,n=0;t=oe(t,function(t){return Kn(t)?(n=As(t.length,n),!0):void 0});for(var r=Ya(n);++en?As(i+n,0):n||0,"string"==typeof t||!Fo(t)&&Ui(t)?i>=n&&t.indexOf(e,n)>-1:!!i&&Wn(t,e,n)>-1}function ti(t,e,n){var r=Fo(t)?ue:Re;return e=$n(e,n,3),r(t,e)}function ei(t,e){return ti(t,Oa(e))}function ni(t,e,n){var r=Fo(t)?oe:Te;return e=$n(e,n,3),r(t,function(t,n,r){return!e(t,n,r)})}function ri(t,e,n){if(n?Jn(t,e,n):null==e){t=lr(t);var r=t.length;return r>0?t[He(0,r-1)]:E}var i=-1,a=zi(t),r=a.length,s=r-1;for(e=xs(0>e?0:+e||0,r);++i0&&(n=e.apply(this,arguments)),1>=t&&(e=E),n}}function fi(t,e,n){function r(){f&&ss(f),c&&ss(c),g=0,c=f=p=E}function i(e,n){n&&ss(n),c=f=p=E,e&&(g=go(),l=t.apply(d,u),f||c||(u=d=E))}function a(){var t=e-(go()-h);0>=t||t>e?i(p,c):f=hs(a,t)}function s(){i(m,f)}function o(){if(u=arguments,h=go(),d=this,p=m&&(f||!v),y===!1)var n=v&&!f;else{c||v||(g=h);var r=y-(h-g),i=0>=r||r>y;i?(c&&(c=ss(c)),g=h,l=t.apply(d,u)):c||(c=hs(s,r))}return i&&f?f=ss(f):f||e===y||(f=hs(a,e)),n&&(i=!0,l=t.apply(d,u)),!i||f||c||(u=d=E),l}var u,c,l,h,d,f,p,g=0,y=!1,m=!0;if("function"!=typeof t)throw new Xa(W);if(e=0>e?0:+e||0,n===!0){var v=!0;m=!1}else Mi(n)&&(v=!!n.leading,y="maxWait"in n&&As(+n.maxWait||0,e),m="trailing"in n?!!n.trailing:m);return o.cancel=r,o}function pi(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new Xa(W);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var s=t.apply(this,r);return n.cache=a.set(i,s),s};return n.cache=new pi.Cache,n}function gi(t){if("function"!=typeof t)throw new Xa(W);return function(){return!t.apply(this,arguments)}}function yi(t){return di(2,t)}function mi(t,e){if("function"!=typeof t)throw new Xa(W);return e=As(e===E?t.length-1:+e||0,0),function(){for(var n=arguments,r=-1,i=As(n.length-e,0),a=Ya(i);++re}function ki(t,e){return t>=e}function Ei(t){return m(t)&&Kn(t)&&ts.call(t,"callee")&&!cs.call(t,"callee")}function Di(t){return t===!0||t===!1||m(t)&&ns.call(t)==z}function Ti(t){return m(t)&&ns.call(t)==q}function Ci(t){return!!t&&1===t.nodeType&&m(t)&&!Yi(t)}function Fi(t){return null==t?!0:Kn(t)&&(Fo(t)||Ui(t)||Ei(t)||m(t)&&Oi(t.splice))?!t.length:!Yo(t).length}function Si(t,e,n,r){n="function"==typeof n?sn(n,r,3):E;var i=n?n(t,e):E;return i===E?Le(t,e,n):!!i}function Bi(t){return m(t)&&"string"==typeof t.message&&ns.call(t)==X}function Ii(t){return"number"==typeof t&&_s(t)}function Oi(t){return Mi(t)&&ns.call(t)==Z}function Mi(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Li(t,e,n,r){return n="function"==typeof n?sn(n,r,3):E,Ne(t,Gn(e),n)}function Pi(t){return ji(t)&&t!=+t}function Ni(t){return null==t?!1:Oi(t)?is.test(Ja.call(t)):m(t)&&Mt.test(t)}function Ri(t){return null===t}function ji(t){return"number"==typeof t||m(t)&&ns.call(t)==Q}function Yi(t){var e;if(!m(t)||ns.call(t)!=J||Ei(t)||!ts.call(t,"constructor")&&(e=t.constructor,"function"==typeof e&&!(e instanceof e)))return!1;var n;return Se(t,function(t,e){n=e}),n===E||ts.call(t,n)}function $i(t){return Mi(t)&&ns.call(t)==tt}function Ui(t){return"string"==typeof t||m(t)&&ns.call(t)==nt}function Wi(t){return m(t)&&nr(t.length)&&!!Ut[ns.call(t)]}function Gi(t){return t===E}function Vi(t,e){return e>t}function Hi(t,e){return e>=t}function zi(t){var e=t?$s(t):0;return nr(e)?e?te(t):[]:aa(t)}function qi(t){return _e(t,ta(t))}function Xi(t,e,n){var r=Ms(t);return n&&Jn(t,e,n)&&(e=E),e?me(r,e):r}function Zi(t){return Oe(t,ta(t))}function Ki(t,e,n){var r=null==t?E:Me(t,dr(e),e+"");return r===E?n:r}function Qi(t,e){if(null==t)return!1;var n=ts.call(t,e);if(!n&&!tr(e)){if(e=dr(e),t=1==e.length?t:Me(t,qe(e,0,-1)),null==t)return!1;e=Dr(e),n=ts.call(t,e)}return n||nr(t.length)&&Qn(e,t.length)&&(Fo(t)||Ei(t))}function Ji(t,e,n){n&&Jn(t,e,n)&&(e=E);for(var r=-1,i=Yo(t),a=i.length,s={};++r0;++r=xs(e,n)&&tn?0:+n||0,r),n-=e.length,n>=0&&t.indexOf(e,n)==n}function da(t){return t=o(t),t&&bt.test(t)?t.replace(vt,f):t}function fa(t){return t=o(t),t&&Ct.test(t)?t.replace(Tt,p):t||"(?:)"}function pa(t,e,n){t=o(t),e=+e;var r=t.length;if(r>=e||!_s(e))return t;var i=(e-r)/2,a=ms(i),s=gs(i);return n=On("",s,n),n.slice(0,a)+t+n}function ga(t,e,n){return(n?Jn(t,e,n):null==e)?e=0:e&&(e=+e),t=_a(t),ks(t,e||(Ot.test(t)?16:10))}function ya(t,e){var n="";if(t=o(t),e=+e,1>e||!t||!_s(e))return n;do e%2&&(n+=t),e=ms(e/2),t+=t;while(e);return n}function ma(t,e,n){return t=o(t),n=null==n?0:xs(0>n?0:+n||0,t.length),t.lastIndexOf(e,n)==n}function va(t,n,r){var i=e.templateSettings;r&&Jn(t,n,r)&&(n=r=E),t=o(t),n=ye(me({},r||n),i,ge);var a,s,u=ye(me({},n.imports),i.imports,ge),c=Yo(u),l=tn(u,c),h=0,d=n.interpolate||Nt,f="__p += '",p=za((n.escape||Nt).source+"|"+d.source+"|"+(d===wt?Bt:Nt).source+"|"+(n.evaluate||Nt).source+"|$","g"),y="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++$t+"]")+"\n";t.replace(p,function(e,n,r,i,o,u){return r||(r=i),f+=t.slice(h,u).replace(Rt,g),n&&(a=!0,f+="' +\n__e("+n+") +\n'"),o&&(s=!0,f+="';\n"+o+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),h=u+e.length,e}),f+="';\n";var m=n.variable;m||(f="with (obj) {\n"+f+"\n}\n"),f=(s?f.replace(pt,""):f).replace(gt,"$1").replace(yt,"$1;"),f="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var v=Ko(function(){return Wa(c,y+"return "+f).apply(E,l)});if(v.source=f,Bi(v))throw v;return v}function _a(t,e,n){var r=t;return(t=o(t))?(n?Jn(r,e,n):null==e)?t.slice(A(t),x(t)+1):(e+="",t.slice(u(t,e),c(t,e)+1)):t}function ba(t,e,n){var r=t;return t=o(t),t?t.slice((n?Jn(r,e,n):null==e)?A(t):u(t,e+"")):t}function Aa(t,e,n){var r=t;return t=o(t),t?(n?Jn(r,e,n):null==e)?t.slice(0,x(t)+1):t.slice(0,c(t,e+"")+1):t}function xa(t,e,n){n&&Jn(t,e,n)&&(e=E);var r=P,i=N;if(null!=e)if(Mi(e)){var a="separator"in e?e.separator:a;r="length"in e?+e.length||0:r,i="omission"in e?o(e.omission):i}else r=+e||0;if(t=o(t),r>=t.length)return t;var s=r-i.length;if(1>s)return i;var u=t.slice(0,s);if(null==a)return u+i;if($i(a)){if(t.slice(s).search(a)){var c,l,h=t.slice(0,s);for(a.global||(a=za(a.source,(It.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(h);)l=c.index;u=u.slice(0,null==l?s:l)}}else if(t.indexOf(a,s)!=s){var d=u.lastIndexOf(a);d>-1&&(u=u.slice(0,d))}return u+i}function wa(t){return t=o(t),t&&_t.test(t)?t.replace(mt,w):t}function ka(t,e,n){return n&&Jn(t,e,n)&&(e=E),t=o(t),t.match(e||jt)||[]}function Ea(t,e,n){return n&&Jn(t,e,n)&&(e=E),m(t)?Ca(t):be(t,e)}function Da(t){return function(){return t}}function Ta(t){return t}function Ca(t){return je(Ae(t,!0))}function Fa(t,e){return Ye(t,Ae(e,!0))}function Sa(t,e,n){if(null==n){var r=Mi(e),i=r?Yo(e):E,a=i&&i.length?Oe(e,i):E; + +(a?a.length:r)||(a=!1,n=e,e=t,t=this)}a||(a=Oe(e,Yo(e)));var s=!0,o=-1,u=Oi(t),c=a.length;n===!1?s=!1:Mi(n)&&"chain"in n&&(s=n.chain);for(;++ot||!_s(t))return[];var r=-1,i=Ya(xs(t,Cs));for(e=sn(e,n,1);++rr?i[r]=e(r):e(r);return i}function Na(t){var e=++es;return o(t)+e}function Ra(t,e){return(+t||0)+(+e||0)}function ja(t,e,n){return n&&Jn(t,e,n)&&(e=E),e=$n(e,n,3),1==e.length?fe(Fo(t)?t:lr(t),e):Qe(t,e)}t=t?re.defaults(ne.Object(),t,re.pick(ne,Yt)):ne;{var Ya=t.Array,$a=t.Date,Ua=t.Error,Wa=t.Function,Ga=t.Math,Va=t.Number,Ha=t.Object,za=t.RegExp,qa=t.String,Xa=t.TypeError,Za=Ya.prototype,Ka=Ha.prototype,Qa=qa.prototype,Ja=Wa.prototype.toString,ts=Ka.hasOwnProperty,es=0,ns=Ka.toString,rs=ne._,is=za("^"+Ja.call(ts).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),as=t.ArrayBuffer,ss=t.clearTimeout,os=t.parseFloat,us=Ga.pow,cs=Ka.propertyIsEnumerable,ls=Vn(t,"Set"),hs=t.setTimeout,ds=Za.splice,fs=t.Uint8Array,ps=Vn(t,"WeakMap"),gs=Ga.ceil,ys=Vn(Ha,"create"),ms=Ga.floor,vs=Vn(Ya,"isArray"),_s=t.isFinite,bs=Vn(Ha,"keys"),As=Ga.max,xs=Ga.min,ws=Vn($a,"now"),ks=t.parseInt,Es=Ga.random,Ds=Va.NEGATIVE_INFINITY,Ts=Va.POSITIVE_INFINITY,Cs=4294967295,Fs=Cs-1,Ss=Cs>>>1,Bs=9007199254740991,Is=ps&&new ps,Os={};e.support={}}e.templateSettings={escape:At,evaluate:xt,interpolate:wt,variable:"",imports:{_:e}};var Ms=function(){function t(){}return function(e){if(Mi(e)){t.prototype=e;var n=new t;t.prototype=E}return n||{}}}(),Ls=dn(Be),Ps=dn(Ie,!0),Ns=fn(),Rs=fn(!0),js=Is?function(t,e){return Is.set(t,e),t}:Ta,Ys=Is?function(t){return Is.get(t)}:Ia,$s=We("length"),Us=function(){var t=0,e=0;return function(n,r){var i=go(),a=j-(i-e);if(e=i,a>0){if(++t>=R)return n}else t=0;return js(n,r)}}(),Ws=mi(function(t,e){return m(t)&&Kn(t)?we(t,Fe(e,!1,!0)):[]}),Gs=xn(),Vs=xn(!0),Hs=mi(function(t){for(var e=t.length,n=e,r=Ya(h),i=Wn(),s=i==a,o=[];n--;){var u=t[n]=Kn(u=t[n])?u:[];r[n]=s&&u.length>=120?gn(n&&u):null}var c=t[0],l=-1,h=c?c.length:0,d=r[0];t:for(;++l2?t[e-2]:E,r=e>1?t[e-1]:E;return e>2&&"function"==typeof n?e-=2:(n=e>1&&"function"==typeof r?(--e,r):E,r=E),t.length=e,Rr(t,n,r)}),to=mi(function(t){return t=Fe(t),this.thru(function(e){return Jt(Fo(e)?e:[hr(e)],t)})}),eo=mi(function(t,e){return ve(t,Fe(e))}),no=ln(function(t,e,n){ts.call(t,n)?++t[n]:t[n]=1}),ro=An(Ls),io=An(Ps,!0),ao=En(ee,Ls),so=En(ie,Ps),oo=ln(function(t,e,n){ts.call(t,n)?t[n].push(e):t[n]=[e]}),uo=ln(function(t,e,n){t[n]=e}),co=mi(function(t,e,n){var r=-1,i="function"==typeof e,a=tr(e),s=Kn(t)?Ya(t.length):[];return Ls(t,function(t){var o=i?e:a&&null!=t?t[e]:E;s[++r]=o?o.apply(t,n):Zn(t,e,n)}),s}),lo=ln(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),ho=Bn(le,Ls),fo=Bn(he,Ps),po=mi(function(t,e){if(null==t)return[];var n=e[2];return n&&Jn(e[0],e[1],n)&&(e.length=1),Ke(t,Fe(e),[])}),go=ws||function(){return(new $a).getTime()},yo=mi(function(t,e,n){var r=T;if(n.length){var i=_(n,yo.placeholder);r|=I}return Nn(t,r,e,n,i)}),mo=mi(function(t,e){e=e.length?Fe(e):Zi(t);for(var n=-1,r=e.length;++n0||0>e)?new K(n):(0>t?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==E&&(e=+e||0,n=0>e?n.dropRight(-e):n.take(e-t)),n)},K.prototype.takeRightWhile=function(t,e){return this.reverse().takeWhile(t,e).reverse()},K.prototype.toArray=function(){return this.take(Ts)},Be(K.prototype,function(t,n){var r=/^(?:filter|map|reject)|While$/.test(n),i=/^(?:first|last)$/.test(n),a=e[i?"take"+("last"==n?"Right":""):n];a&&(e.prototype[n]=function(){var e=i?[1]:arguments,n=this.__chain__,s=this.__wrapped__,o=!!this.__actions__.length,u=s instanceof K,c=e[0],l=u||Fo(s);l&&r&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=function(t){return i&&n?a(t,1)[0]:a.apply(E,ce([t],e))},d={func:Wr,args:[h],thisArg:E},f=u&&!o;if(i&&!n)return f?(s=s.clone(),s.__actions__.push(d),t.call(s)):a.call(E,this.value())[0];if(!i&&l){s=f?s:new K(this);var p=t.apply(s,e);return p.__actions__.push(d),new v(p,n)}return this.thru(h)})}),ee(["join","pop","push","replace","shift","sort","splice","split","unshift"],function(t){var n=(/^(?:replace|split)$/.test(t)?Qa:Za)[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:join|pop|replace|shift)$/.test(t);e.prototype[t]=function(){var t=arguments;return i&&!this.__chain__?n.apply(this.value(),t):this[r](function(e){return n.apply(e,t)})}}),Be(K.prototype,function(t,n){var r=e[n];if(r){var i=r.name,a=Os[i]||(Os[i]=[]);a.push({name:n,func:r})}}),Os[In(E,C).name]=[{name:"wrapper",func:E}],K.prototype.clone=et,K.prototype.reverse=rt,K.prototype.value=Gt,e.prototype.chain=Gr,e.prototype.commit=Vr,e.prototype.concat=to,e.prototype.plant=Hr,e.prototype.reverse=zr,e.prototype.toString=qr,e.prototype.run=e.prototype.toJSON=e.prototype.valueOf=e.prototype.value=Xr,e.prototype.collect=e.prototype.map,e.prototype.head=e.prototype.first,e.prototype.select=e.prototype.filter,e.prototype.tail=e.prototype.rest,e}var E,D="3.10.1",T=1,C=2,F=4,S=8,B=16,I=32,O=64,M=128,L=256,P=30,N="...",R=150,j=16,Y=200,$=1,U=2,W="Expected a function",G="__lodash_placeholder__",V="[object Arguments]",H="[object Array]",z="[object Boolean]",q="[object Date]",X="[object Error]",Z="[object Function]",K="[object Map]",Q="[object Number]",J="[object Object]",tt="[object RegExp]",et="[object Set]",nt="[object String]",rt="[object WeakMap]",it="[object ArrayBuffer]",at="[object Float32Array]",st="[object Float64Array]",ot="[object Int8Array]",ut="[object Int16Array]",ct="[object Int32Array]",lt="[object Uint8Array]",ht="[object Uint8ClampedArray]",dt="[object Uint16Array]",ft="[object Uint32Array]",pt=/\b__p \+= '';/g,gt=/\b(__p \+=) '' \+/g,yt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mt=/&(?:amp|lt|gt|quot|#39|#96);/g,vt=/[&<>"'`]/g,_t=RegExp(mt.source),bt=RegExp(vt.source),At=/<%-([\s\S]+?)%>/g,xt=/<%([\s\S]+?)%>/g,wt=/<%=([\s\S]+?)%>/g,kt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,Et=/^\w*$/,Dt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,Tt=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,Ct=RegExp(Tt.source),Ft=/[\u0300-\u036f\ufe20-\ufe23]/g,St=/\\(\\)?/g,Bt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,It=/\w*$/,Ot=/^0[xX]/,Mt=/^\[object .+?Constructor\]$/,Lt=/^\d+$/,Pt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Nt=/($^)/,Rt=/['\n\r\u2028\u2029\\]/g,jt=function(){var t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",e="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(t+"+(?="+t+e+")|"+t+"?"+e+"|"+t+"+|[0-9]+","g")}(),Yt=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],$t=-1,Ut={};Ut[at]=Ut[st]=Ut[ot]=Ut[ut]=Ut[ct]=Ut[lt]=Ut[ht]=Ut[dt]=Ut[ft]=!0,Ut[V]=Ut[H]=Ut[it]=Ut[z]=Ut[q]=Ut[X]=Ut[Z]=Ut[K]=Ut[Q]=Ut[J]=Ut[tt]=Ut[et]=Ut[nt]=Ut[rt]=!1;var Wt={};Wt[V]=Wt[H]=Wt[it]=Wt[z]=Wt[q]=Wt[at]=Wt[st]=Wt[ot]=Wt[ut]=Wt[ct]=Wt[Q]=Wt[J]=Wt[tt]=Wt[nt]=Wt[lt]=Wt[ht]=Wt[dt]=Wt[ft]=!0,Wt[X]=Wt[Z]=Wt[K]=Wt[et]=Wt[rt]=!1;var Gt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},Vt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ht={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},zt={"function":!0,object:!0},qt={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Xt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Zt=zt[typeof n]&&n&&!n.nodeType&&n,Kt=zt[typeof e]&&e&&!e.nodeType&&e,Qt=Zt&&Kt&&"object"==typeof t&&t&&t.Object&&t,Jt=zt[typeof self]&&self&&self.Object&&self,te=zt[typeof window]&&window&&window.Object&&window,ee=Kt&&Kt.exports===Zt&&Zt,ne=Qt||te!==(this&&this.window)&&te||Jt||this,re=k();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(ne._=re,define(function(){return re})):Zt&&Kt?ee?(Kt.exports=re)._=re:Zt._=re:ne._=re}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],81:[function(t,e,n){!function(t,r){"object"==typeof n&&"undefined"!=typeof e?e.exports=r():"function"==typeof define&&define.amd?define(r):t.moment=r()}(this,function(){"use strict";function n(){return tr.apply(null,arguments)}function r(t){tr=t}function i(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function a(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function s(t,e){var n,r=[];for(n=0;n0)for(n in er)r=er[n],i=e[r],p(i)||(t[r]=i);return t}function y(t){g(this,t),this._d=new Date(null!=t._d?t._d.getTime():0/0),nr===!1&&(nr=!0,n.updateOffset(this),nr=!1)}function m(t){return t instanceof y||null!=t&&null!=t._isAMomentObject}function v(t){return 0>t?Math.ceil(t):Math.floor(t)}function _(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=v(e)),n}function b(t,e,n){var r,i=Math.min(t.length,e.length),a=Math.abs(t.length-e.length),s=0;for(r=0;i>r;r++)(n&&t[r]!==e[r]||!n&&_(t[r])!==_(e[r]))&&s++;return s+a}function A(t){n.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function x(t,e){var n=!0;return u(function(){return n&&(A(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),n=!1),e.apply(this,arguments)},e)}function w(t,e){rr[t]||(A(e),rr[t]=!0)}function k(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function E(t){return"[object Object]"===Object.prototype.toString.call(t)}function D(t){var e,n;for(n in t)e=t[n],k(e)?this[n]=e:this["_"+n]=e;this._config=t,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function T(t,e){var n,r=u({},t);for(n in e)o(e,n)&&(E(t[n])&&E(e[n])?(r[n]={},u(r[n],t[n]),u(r[n],e[n])):null!=e[n]?r[n]=e[n]:delete r[n]);return r}function C(t){null!=t&&this.set(t)}function F(t){return t?t.toLowerCase().replace("_","-"):t}function S(t){for(var e,n,r,i,a=0;a0;){if(r=B(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&b(i,n,!0)>=e-1)break;e--}a++}return null}function B(n){var r=null;if(!ar[n]&&"undefined"!=typeof e&&e&&e.exports)try{r=ir._abbr,t("./locale/"+n),I(r)}catch(i){}return ar[n]}function I(t,e){var n;return t&&(n=p(e)?L(t):O(t,e),n&&(ir=n)),ir._abbr}function O(t,e){return null!==e?(e.abbr=t,null!=ar[t]?(w("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),e=T(ar[t]._config,e)):null!=e.parentLocale&&(null!=ar[e.parentLocale]?e=T(ar[e.parentLocale]._config,e):w("parentLocaleUndefined","specified parentLocale is not defined yet")),ar[t]=new C(e),I(t),ar[t]):(delete ar[t],null)}function M(t,e){if(null!=e){var n;null!=ar[t]&&(e=T(ar[t]._config,e)),n=new C(e),n.parentLocale=ar[t],ar[t]=n,I(t)}else null!=ar[t]&&(null!=ar[t].parentLocale?ar[t]=ar[t].parentLocale:null!=ar[t]&&delete ar[t]);return ar[t]}function L(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return ir;if(!i(t)){if(e=B(t))return e;t=[t]}return S(t)}function P(){return Object.keys(ar)}function N(t,e){var n=t.toLowerCase();sr[n]=sr[n+"s"]=sr[e]=t}function R(t){return"string"==typeof t?sr[t]||sr[t.toLowerCase()]:void 0}function j(t){var e,n,r={};for(n in t)o(t,n)&&(e=R(n),e&&(r[e]=t[n]));return r}function Y(t,e){return function(r){return null!=r?(U(this,t,r),n.updateOffset(this,e),this):$(this,t)}}function $(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():0/0}function U(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function W(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if(t=R(t),k(this[t]))return this[t](e);return this}function G(t,e,n){var r=""+Math.abs(t),i=e-r.length,a=t>=0;return(a?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}function V(t,e,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),t&&(lr[t]=i),e&&(lr[e[0]]=function(){return G(i.apply(this,arguments),e[1],e[2])}),n&&(lr[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function H(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function z(t){var e,n,r=t.match(or);for(e=0,n=r.length;n>e;e++)r[e]=lr[r[e]]?lr[r[e]]:H(r[e]);return function(i){var a="";for(e=0;n>e;e++)a+=r[e]instanceof Function?r[e].call(i,t):r[e];return a}}function q(t,e){return t.isValid()?(e=X(e,t.localeData()),cr[e]=cr[e]||z(e),cr[e](t)):t.localeData().invalidDate()}function X(t,e){function n(t){return e.longDateFormat(t)||t}var r=5;for(ur.lastIndex=0;r>=0&&ur.test(t);)t=t.replace(ur,n),ur.lastIndex=0,r-=1;return t}function Z(t,e,n){Cr[t]=k(e)?e:function(t){return t&&n?n:e}}function K(t,e){return o(Cr,t)?Cr[t](e._strict,e._locale):new RegExp(Q(t))}function Q(t){return J(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,r,i){return e||n||r||i}))}function J(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function tt(t,e){var n,r=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(r=function(t,n){n[e]=_(t)}),n=0;nr;r++){if(i=c([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[r].test(t))return r;if(n&&"MMM"===e&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function ot(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=_(e);else if(e=t.localeData().monthsParse(e),"number"!=typeof e)return t;return n=Math.min(t.date(),rt(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function ut(t){return null!=t?(ot(this,t),n.updateOffset(this,!0),this):$(this,"Month")}function ct(){return rt(this.year(),this.month())}function lt(t){return this._monthsParseExact?(o(this,"_monthsRegex")||dt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex}function ht(t){return this._monthsParseExact?(o(this,"_monthsRegex")||dt.call(this),t?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex}function dt(){function t(t,e){return e.length-t.length}var e,n,r=[],i=[],a=[];for(e=0;12>e;e++)n=c([2e3,e]),r.push(this.monthsShort(n,"")),i.push(this.months(n,"")),a.push(this.months(n,"")),a.push(this.monthsShort(n,""));for(r.sort(t),i.sort(t),a.sort(t),e=0;12>e;e++)r[e]=J(r[e]),i[e]=J(i[e]),a[e]=J(a[e]);this._monthsRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")$","i")}function ft(t){var e,n=t._a;return n&&-2===h(t).overflow&&(e=n[Br]<0||n[Br]>11?Br:n[Ir]<1||n[Ir]>rt(n[Sr],n[Br])?Ir:n[Or]<0||n[Or]>24||24===n[Or]&&(0!==n[Mr]||0!==n[Lr]||0!==n[Pr])?Or:n[Mr]<0||n[Mr]>59?Mr:n[Lr]<0||n[Lr]>59?Lr:n[Pr]<0||n[Pr]>999?Pr:-1,h(t)._overflowDayOfYear&&(Sr>e||e>Ir)&&(e=Ir),h(t)._overflowWeeks&&-1===e&&(e=Nr),h(t)._overflowWeekday&&-1===e&&(e=Rr),h(t).overflow=e),t}function pt(t){var e,n,r,i,a,s,o=t._i,u=Gr.exec(o)||Vr.exec(o);if(u){for(h(t).iso=!0,e=0,n=zr.length;n>e;e++)if(zr[e][1].exec(u[1])){i=zr[e][0],r=zr[e][2]!==!1;break}if(null==i)return void(t._isValid=!1);if(u[3]){for(e=0,n=qr.length;n>e;e++)if(qr[e][1].exec(u[3])){a=(u[2]||" ")+qr[e][0];break}if(null==a)return void(t._isValid=!1)}if(!r&&null!=a)return void(t._isValid=!1);if(u[4]){if(!Hr.exec(u[4]))return void(t._isValid=!1);s="Z"}t._f=i+(a||"")+(s||""),Ft(t)}else t._isValid=!1}function gt(t){var e=Xr.exec(t._i);return null!==e?void(t._d=new Date(+e[1])):(pt(t),void(t._isValid===!1&&(delete t._isValid,n.createFromInputFallback(t))))}function yt(t,e,n,r,i,a,s){var o=new Date(t,e,n,r,i,a,s);return 100>t&&t>=0&&isFinite(o.getFullYear())&&o.setFullYear(t),o}function mt(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function vt(t){return _t(t)?366:365}function _t(t){return t%4===0&&t%100!==0||t%400===0}function bt(){return _t(this.year())}function At(t,e,n){var r=7+e-n,i=(7+mt(t,0,r).getUTCDay()-e)%7;return-i+r-1}function xt(t,e,n,r,i){var a,s,o=(7+n-r)%7,u=At(t,r,i),c=1+7*(e-1)+o+u;return 0>=c?(a=t-1,s=vt(a)+c):c>vt(t)?(a=t+1,s=c-vt(t)):(a=t,s=c),{year:a,dayOfYear:s}}function wt(t,e,n){var r,i,a=At(t.year(),e,n),s=Math.floor((t.dayOfYear()-a-1)/7)+1;return 1>s?(i=t.year()-1,r=s+kt(i,e,n)):s>kt(t.year(),e,n)?(r=s-kt(t.year(),e,n),i=t.year()+1):(i=t.year(),r=s),{week:r,year:i}}function kt(t,e,n){var r=At(t,e,n),i=At(t+1,e,n);return(vt(t)-r+i)/7}function Et(t,e,n){return null!=t?t:null!=e?e:n}function Dt(t){var e=new Date(n.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Tt(t){var e,n,r,i,a=[];if(!t._d){for(r=Dt(t),t._w&&null==t._a[Ir]&&null==t._a[Br]&&Ct(t),t._dayOfYear&&(i=Et(t._a[Sr],r[Sr]),t._dayOfYear>vt(i)&&(h(t)._overflowDayOfYear=!0),n=mt(i,0,t._dayOfYear),t._a[Br]=n.getUTCMonth(),t._a[Ir]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=a[e]=r[e];for(;7>e;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Or]&&0===t._a[Mr]&&0===t._a[Lr]&&0===t._a[Pr]&&(t._nextDay=!0,t._a[Or]=0),t._d=(t._useUTC?mt:yt).apply(null,a),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Or]=24)}}function Ct(t){var e,n,r,i,a,s,o,u;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(a=1,s=4,n=Et(e.GG,t._a[Sr],wt(Nt(),1,4).year),r=Et(e.W,1),i=Et(e.E,1),(1>i||i>7)&&(u=!0)):(a=t._locale._week.dow,s=t._locale._week.doy,n=Et(e.gg,t._a[Sr],wt(Nt(),a,s).year),r=Et(e.w,1),null!=e.d?(i=e.d,(0>i||i>6)&&(u=!0)):null!=e.e?(i=e.e+a,(e.e<0||e.e>6)&&(u=!0)):i=a),1>r||r>kt(n,a,s)?h(t)._overflowWeeks=!0:null!=u?h(t)._overflowWeekday=!0:(o=xt(n,r,i,a,s),t._a[Sr]=o.year,t._dayOfYear=o.dayOfYear)}function Ft(t){if(t._f===n.ISO_8601)return void pt(t);t._a=[],h(t).empty=!0;var e,r,i,a,s,o=""+t._i,u=o.length,c=0;for(i=X(t._f,t._locale).match(or)||[],e=0;e0&&h(t).unusedInput.push(s),o=o.slice(o.indexOf(r)+r.length),c+=r.length),lr[a]?(r?h(t).empty=!1:h(t).unusedTokens.push(a),nt(a,r,t)):t._strict&&!r&&h(t).unusedTokens.push(a);h(t).charsLeftOver=u-c,o.length>0&&h(t).unusedInput.push(o),h(t).bigHour===!0&&t._a[Or]<=12&&t._a[Or]>0&&(h(t).bigHour=void 0),t._a[Or]=St(t._locale,t._a[Or],t._meridiem),Tt(t),ft(t)}function St(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(r=t.isPM(n),r&&12>e&&(e+=12),r||12!==e||(e=0),e):e}function Bt(t){var e,n,r,i,a;if(0===t._f.length)return h(t).invalidFormat=!0,void(t._d=new Date(0/0));for(i=0;ia)&&(r=a,n=e));u(t,n||e)}function It(t){if(!t._d){var e=j(t._i);t._a=s([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),Tt(t)}}function Ot(t){var e=new y(ft(Mt(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Mt(t){var e=t._i,n=t._f;return t._locale=t._locale||L(t._l),null===e||void 0===n&&""===e?f({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),m(e)?new y(ft(e)):(i(n)?Bt(t):n?Ft(t):a(e)?t._d=e:Lt(t),d(t)||(t._d=null),t))}function Lt(t){var e=t._i;void 0===e?t._d=new Date(n.now()):a(e)?t._d=new Date(+e):"string"==typeof e?gt(t):i(e)?(t._a=s(e.slice(0),function(t){return parseInt(t,10)}),Tt(t)):"object"==typeof e?It(t):"number"==typeof e?t._d=new Date(e):n.createFromInputFallback(t)}function Pt(t,e,n,r,i){var a={};return"boolean"==typeof n&&(r=n,n=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=t,a._f=e,a._strict=r,Ot(a)}function Nt(t,e,n,r){return Pt(t,e,n,r,!1)}function Rt(t,e){var n,r;if(1===e.length&&i(e[0])&&(e=e[0]),!e.length)return Nt();for(n=e[0],r=1;rt&&(t=-t,n="-"),n+G(~~(t/60),2)+e+G(~~t%60,2)})}function Gt(t,e){var n=(e||"").match(t)||[],r=n[n.length-1]||[],i=(r+"").match(ti)||["-",0,0],a=+(60*i[1])+_(i[2]);return"+"===i[0]?a:-a}function Vt(t,e){var r,i;return e._isUTC?(r=e.clone(),i=(m(t)||a(t)?+t:+Nt(t))-+r,r._d.setTime(+r._d+i),n.updateOffset(r,!1),r):Nt(t).local()}function Ht(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function zt(t,e){var r,i=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=Gt(Er,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&e&&(r=Ht(this)),this._offset=t,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==t&&(!e||this._changeInProgress?le(this,ie(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:Ht(this):null!=t?this:0/0}function qt(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Xt(t){return this.utcOffset(0,t)}function Zt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ht(this),"m")),this}function Kt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Gt(kr,this._i)),this; + +}function Qt(t){return this.isValid()?(t=t?Nt(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function Jt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function te(){if(!p(this._isDSTShifted))return this._isDSTShifted;var t={};if(g(t,this),t=Mt(t),t._a){var e=t._isUTC?c(t._a):Nt(t._a);this._isDSTShifted=this.isValid()&&b(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function ee(){return this.isValid()?!this._isUTC:!1}function ne(){return this.isValid()?this._isUTC:!1}function re(){return this.isValid()?this._isUTC&&0===this._offset:!1}function ie(t,e){var n,r,i,a=t,s=null;return Ut(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(a={},e?a[e]=t:a.milliseconds=t):(s=ei.exec(t))?(n="-"===s[1]?-1:1,a={y:0,d:_(s[Ir])*n,h:_(s[Or])*n,m:_(s[Mr])*n,s:_(s[Lr])*n,ms:_(s[Pr])*n}):(s=ni.exec(t))?(n="-"===s[1]?-1:1,a={y:ae(s[2],n),M:ae(s[3],n),w:ae(s[4],n),d:ae(s[5],n),h:ae(s[6],n),m:ae(s[7],n),s:ae(s[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(i=oe(Nt(a.from),Nt(a.to)),a={},a.ms=i.milliseconds,a.M=i.months),r=new $t(a),Ut(t)&&o(t,"_locale")&&(r._locale=t._locale),r}function ae(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function se(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function oe(t,e){var n;return t.isValid()&&e.isValid()?(e=Vt(e,t),t.isBefore(e)?n=se(t,e):(n=se(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ue(t){return 0>t?-1*Math.round(-1*t):Math.round(t)}function ce(t,e){return function(n,r){var i,a;return null===r||isNaN(+r)||(w(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),a=n,n=r,r=a),n="string"==typeof n?+n:n,i=ie(n,r),le(this,i,t),this}}function le(t,e,r,i){var a=e._milliseconds,s=ue(e._days),o=ue(e._months);t.isValid()&&(i=null==i?!0:i,a&&t._d.setTime(+t._d+a*r),s&&U(t,"Date",$(t,"Date")+s*r),o&&ot(t,$(t,"Month")+o*r),i&&n.updateOffset(t,s||o))}function he(t,e){var n=t||Nt(),r=Vt(n,this).startOf("day"),i=this.diff(r,"days",!0),a=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse",s=e&&(k(e[a])?e[a]():e[a]);return this.format(s||this.localeData().calendar(a,this,Nt(n)))}function de(){return new y(this)}function fe(t,e){var n=m(t)?t:Nt(t);return this.isValid()&&n.isValid()?(e=R(p(e)?"millisecond":e),"millisecond"===e?+this>+n:+n<+this.clone().startOf(e)):!1}function pe(t,e){var n=m(t)?t:Nt(t);return this.isValid()&&n.isValid()?(e=R(p(e)?"millisecond":e),"millisecond"===e?+n>+this:+this.clone().endOf(e)<+n):!1}function ge(t,e,n){return this.isAfter(t,n)&&this.isBefore(e,n)}function ye(t,e){var n,r=m(t)?t:Nt(t);return this.isValid()&&r.isValid()?(e=R(e||"millisecond"),"millisecond"===e?+this===+r:(n=+r,+this.clone().startOf(e)<=n&&n<=+this.clone().endOf(e))):!1}function me(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function ve(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function _e(t,e,n){var r,i,a,s;return this.isValid()?(r=Vt(t,this),r.isValid()?(i=6e4*(r.utcOffset()-this.utcOffset()),e=R(e),"year"===e||"month"===e||"quarter"===e?(s=be(this,r),"quarter"===e?s/=3:"year"===e&&(s/=12)):(a=this-r,s="second"===e?a/1e3:"minute"===e?a/6e4:"hour"===e?a/36e5:"day"===e?(a-i)/864e5:"week"===e?(a-i)/6048e5:a),n?s:v(s)):0/0):0/0}function be(t,e){var n,r,i=12*(e.year()-t.year())+(e.month()-t.month()),a=t.clone().add(i,"months");return 0>e-a?(n=t.clone().add(i-1,"months"),r=(e-a)/(a-n)):(n=t.clone().add(i+1,"months"),r=(e-a)/(n-a)),-(i+r)}function Ae(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function xe(){var t=this.clone().utc();return 0a&&(e=a),qe.call(this,t,e,n,r,i))}function qe(t,e,n,r,i){var a=xt(t,e,n,r,i),s=mt(a.year,0,a.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}function Xe(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Ze(t){return wt(t,this._week.dow,this._week.doy).week}function Ke(){return this._week.dow}function Qe(){return this._week.doy}function Je(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function tn(t){var e=wt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function en(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function nn(t,e){return i(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]}function rn(t){return this._weekdaysShort[t.day()]}function an(t){return this._weekdaysMin[t.day()]}function sn(t,e,n){var r,i,a;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;7>r;r++){if(i=Nt([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[r].test(t))return r;if(n&&"ddd"===e&&this._shortWeekdaysParse[r].test(t))return r;if(n&&"dd"===e&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function on(t){if(!this.isValid())return null!=t?this:0/0;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=en(t,this.localeData()),this.add(t-e,"d")):e}function un(t){if(!this.isValid())return null!=t?this:0/0;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function cn(t){return this.isValid()?null==t?this.day()||7:this.day(this.day()%7?t:t-7):null!=t?this:0/0}function ln(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function hn(){return this.hours()%12||12}function dn(t,e){V(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function fn(t,e){return e._meridiemParse}function pn(t){return"p"===(t+"").toLowerCase().charAt(0)}function gn(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function yn(t,e){e[Pr]=_(1e3*("0."+t))}function mn(){return this._isUTC?"UTC":""}function vn(){return this._isUTC?"Coordinated Universal Time":""}function _n(t){return Nt(1e3*t)}function bn(){return Nt.apply(null,arguments).parseZone()}function An(t,e,n){var r=this._calendar[t];return k(r)?r.call(e,n):r}function xn(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function wn(){return this._invalidDate}function kn(t){return this._ordinal.replace("%d",t)}function En(t){return t}function Dn(t,e,n,r){var i=this._relativeTime[n];return k(i)?i(t,e,n,r):i.replace(/%d/i,t)}function Tn(t,e){var n=this._relativeTime[t>0?"future":"past"];return k(n)?n(e):n.replace(/%s/i,e)}function Cn(t,e,n,r){var i=L(),a=c().set(r,e);return i[n](a,t)}function Fn(t,e,n,r,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return Cn(t,e,n,i);var a,s=[];for(a=0;r>a;a++)s[a]=Cn(t,a,n,i);return s}function Sn(t,e){return Fn(t,e,"months",12,"month")}function Bn(t,e){return Fn(t,e,"monthsShort",12,"month")}function In(t,e){return Fn(t,e,"weekdays",7,"day")}function On(t,e){return Fn(t,e,"weekdaysShort",7,"day")}function Mn(t,e){return Fn(t,e,"weekdaysMin",7,"day")}function Ln(){var t=this._data;return this._milliseconds=Di(this._milliseconds),this._days=Di(this._days),this._months=Di(this._months),t.milliseconds=Di(t.milliseconds),t.seconds=Di(t.seconds),t.minutes=Di(t.minutes),t.hours=Di(t.hours),t.months=Di(t.months),t.years=Di(t.years),this}function Pn(t,e,n,r){var i=ie(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function Nn(t,e){return Pn(this,t,e,1)}function Rn(t,e){return Pn(this,t,e,-1)}function jn(t){return 0>t?Math.floor(t):Math.ceil(t)}function Yn(){var t,e,n,r,i,a=this._milliseconds,s=this._days,o=this._months,u=this._data;return a>=0&&s>=0&&o>=0||0>=a&&0>=s&&0>=o||(a+=864e5*jn(Un(o)+s),s=0,o=0),u.milliseconds=a%1e3,t=v(a/1e3),u.seconds=t%60,e=v(t/60),u.minutes=e%60,n=v(e/60),u.hours=n%24,s+=v(n/24),i=v($n(s)),o+=i,s-=jn(Un(i)),r=v(o/12),o%=12,u.days=s,u.months=o,u.years=r,this}function $n(t){return 4800*t/146097}function Un(t){return 146097*t/4800}function Wn(t){var e,n,r=this._milliseconds;if(t=R(t),"month"===t||"year"===t)return e=this._days+r/864e5,n=this._months+$n(e),"month"===t?n:n/12;switch(e=this._days+Math.round(Un(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}}function Gn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*_(this._months/12)}function Vn(t){return function(){return this.as(t)}}function Hn(t){return t=R(t),this[t+"s"]()}function zn(t){return function(){return this._data[t]}}function qn(){return v(this.days()/7)}function Xn(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function Zn(t,e,n){var r=ie(t).abs(),i=Ui(r.as("s")),a=Ui(r.as("m")),s=Ui(r.as("h")),o=Ui(r.as("d")),u=Ui(r.as("M")),c=Ui(r.as("y")),l=i=a&&["m"]||a=s&&["h"]||s=o&&["d"]||o=u&&["M"]||u=c&&["y"]||["yy",c];return l[2]=e,l[3]=+t>0,l[4]=n,Xn.apply(null,l)}function Kn(t,e){return void 0===Wi[t]?!1:void 0===e?Wi[t]:(Wi[t]=e,!0)}function Qn(t){var e=this.localeData(),n=Zn(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function Jn(){var t,e,n,r=Gi(this._milliseconds)/1e3,i=Gi(this._days),a=Gi(this._months);t=v(r/60),e=v(t/60),r%=60,t%=60,n=v(a/12),a%=12;var s=n,o=a,u=i,c=e,l=t,h=r,d=this.asSeconds();return d?(0>d?"-":"")+"P"+(s?s+"Y":"")+(o?o+"M":"")+(u?u+"D":"")+(c||l||h?"T":"")+(c?c+"H":"")+(l?l+"M":"")+(h?h+"S":""):"P0D"}var tr,er=n.momentProperties=[],nr=!1,rr={};n.suppressDeprecationWarnings=!1;var ir,ar={},sr={},or=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ur=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,cr={},lr={},hr=/\d/,dr=/\d\d/,fr=/\d{3}/,pr=/\d{4}/,gr=/[+-]?\d{6}/,yr=/\d\d?/,mr=/\d\d\d\d?/,vr=/\d\d\d\d\d\d?/,_r=/\d{1,3}/,br=/\d{1,4}/,Ar=/[+-]?\d{1,6}/,xr=/\d+/,wr=/[+-]?\d+/,kr=/Z|[+-]\d\d:?\d\d/gi,Er=/Z|[+-]\d\d(?::?\d\d)?/gi,Dr=/[+-]?\d+(\.\d{1,3})?/,Tr=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Cr={},Fr={},Sr=0,Br=1,Ir=2,Or=3,Mr=4,Lr=5,Pr=6,Nr=7,Rr=8;V("M",["MM",2],"Mo",function(){return this.month()+1}),V("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),V("MMMM",0,0,function(t){return this.localeData().months(this,t)}),N("month","M"),Z("M",yr),Z("MM",yr,dr),Z("MMM",function(t,e){return e.monthsShortRegex(t)}),Z("MMMM",function(t,e){return e.monthsRegex(t)}),tt(["M","MM"],function(t,e){e[Br]=_(t)-1}),tt(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);null!=i?e[Br]=i:h(n).invalidMonth=t});var jr=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Yr="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),$r="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ur=Tr,Wr=Tr,Gr=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Vr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Hr=/Z|[+-]\d\d(?::?\d\d)?/,zr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],qr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Xr=/^\/?Date\((\-?\d+)/i;n.createFromInputFallback=x("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),V("Y",0,0,function(){var t=this.year();return 9999>=t?""+t:"+"+t}),V(0,["YY",2],0,function(){return this.year()%100}),V(0,["YYYY",4],0,"year"),V(0,["YYYYY",5],0,"year"),V(0,["YYYYYY",6,!0],0,"year"),N("year","y"),Z("Y",wr),Z("YY",yr,dr),Z("YYYY",br,pr),Z("YYYYY",Ar,gr),Z("YYYYYY",Ar,gr),tt(["YYYYY","YYYYYY"],Sr),tt("YYYY",function(t,e){e[Sr]=2===t.length?n.parseTwoDigitYear(t):_(t)}),tt("YY",function(t,e){e[Sr]=n.parseTwoDigitYear(t)}),tt("Y",function(t,e){e[Sr]=parseInt(t,10)}),n.parseTwoDigitYear=function(t){return _(t)+(_(t)>68?1900:2e3)};var Zr=Y("FullYear",!1);n.ISO_8601=function(){};var Kr=x("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Nt.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:f()}),Qr=x("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Nt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:f()}),Jr=function(){return Date.now?Date.now():+new Date};Wt("Z",":"),Wt("ZZ",""),Z("Z",Er),Z("ZZ",Er),tt(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Gt(Er,t)});var ti=/([\+\-]|\d\d)/gi;n.updateOffset=function(){};var ei=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,ni=/^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/;ie.fn=$t.prototype;var ri=ce(1,"add"),ii=ce(-1,"subtract");n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var ai=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});V(0,["gg",2],0,function(){return this.weekYear()%100}),V(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ue("gggg","weekYear"),Ue("ggggg","weekYear"),Ue("GGGG","isoWeekYear"),Ue("GGGGG","isoWeekYear"),N("weekYear","gg"),N("isoWeekYear","GG"),Z("G",wr),Z("g",wr),Z("GG",yr,dr),Z("gg",yr,dr),Z("GGGG",br,pr),Z("gggg",br,pr),Z("GGGGG",Ar,gr),Z("ggggg",Ar,gr),et(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=_(t)}),et(["gg","GG"],function(t,e,r,i){e[i]=n.parseTwoDigitYear(t)}),V("Q",0,"Qo","quarter"),N("quarter","Q"),Z("Q",hr),tt("Q",function(t,e){e[Br]=3*(_(t)-1)}),V("w",["ww",2],"wo","week"),V("W",["WW",2],"Wo","isoWeek"),N("week","w"),N("isoWeek","W"),Z("w",yr),Z("ww",yr,dr),Z("W",yr),Z("WW",yr,dr),et(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=_(t)});var si={dow:0,doy:6};V("D",["DD",2],"Do","date"),N("date","D"),Z("D",yr),Z("DD",yr,dr),Z("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),tt(["D","DD"],Ir),tt("Do",function(t,e){e[Ir]=_(t.match(yr)[0],10)});var oi=Y("Date",!0);V("d",0,"do","day"),V("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),V("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),V("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),V("e",0,0,"weekday"),V("E",0,0,"isoWeekday"),N("day","d"),N("weekday","e"),N("isoWeekday","E"),Z("d",yr),Z("e",yr),Z("E",yr),Z("dd",Tr),Z("ddd",Tr),Z("dddd",Tr),et(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);null!=i?e.d=i:h(n).invalidWeekday=t}),et(["d","e","E"],function(t,e,n,r){e[r]=_(t)});var ui="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ci="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),li="Su_Mo_Tu_We_Th_Fr_Sa".split("_");V("DDD",["DDDD",3],"DDDo","dayOfYear"),N("dayOfYear","DDD"),Z("DDD",_r),Z("DDDD",fr),tt(["DDD","DDDD"],function(t,e,n){n._dayOfYear=_(t)}),V("H",["HH",2],0,"hour"),V("h",["hh",2],0,hn),V("hmm",0,0,function(){return""+hn.apply(this)+G(this.minutes(),2)}),V("hmmss",0,0,function(){return""+hn.apply(this)+G(this.minutes(),2)+G(this.seconds(),2)}),V("Hmm",0,0,function(){return""+this.hours()+G(this.minutes(),2)}),V("Hmmss",0,0,function(){return""+this.hours()+G(this.minutes(),2)+G(this.seconds(),2)}),dn("a",!0),dn("A",!1),N("hour","h"),Z("a",fn),Z("A",fn),Z("H",yr),Z("h",yr),Z("HH",yr,dr),Z("hh",yr,dr),Z("hmm",mr),Z("hmmss",vr),Z("Hmm",mr),Z("Hmmss",vr),tt(["H","HH"],Or),tt(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),tt(["h","hh"],function(t,e,n){e[Or]=_(t),h(n).bigHour=!0}),tt("hmm",function(t,e,n){var r=t.length-2;e[Or]=_(t.substr(0,r)),e[Mr]=_(t.substr(r)),h(n).bigHour=!0}),tt("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[Or]=_(t.substr(0,r)),e[Mr]=_(t.substr(r,2)),e[Lr]=_(t.substr(i)),h(n).bigHour=!0}),tt("Hmm",function(t,e){var n=t.length-2;e[Or]=_(t.substr(0,n)),e[Mr]=_(t.substr(n))}),tt("Hmmss",function(t,e){var n=t.length-4,r=t.length-2;e[Or]=_(t.substr(0,n)),e[Mr]=_(t.substr(n,2)),e[Lr]=_(t.substr(r))});var hi=/[ap]\.?m?\.?/i,di=Y("Hours",!0);V("m",["mm",2],0,"minute"),N("minute","m"),Z("m",yr),Z("mm",yr,dr),tt(["m","mm"],Mr);var fi=Y("Minutes",!1);V("s",["ss",2],0,"second"),N("second","s"),Z("s",yr),Z("ss",yr,dr),tt(["s","ss"],Lr);var pi=Y("Seconds",!1);V("S",0,0,function(){return~~(this.millisecond()/100)}),V(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),V(0,["SSS",3],0,"millisecond"),V(0,["SSSS",4],0,function(){return 10*this.millisecond()}),V(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),V(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),V(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),V(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),V(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),N("millisecond","ms"),Z("S",_r,hr),Z("SS",_r,dr),Z("SSS",_r,fr);var gi;for(gi="SSSS";gi.length<=9;gi+="S")Z(gi,xr);for(gi="S";gi.length<=9;gi+="S")tt(gi,yn);var yi=Y("Milliseconds",!1);V("z",0,0,"zoneAbbr"),V("zz",0,0,"zoneName");var mi=y.prototype;mi.add=ri,mi.calendar=he,mi.clone=de,mi.diff=_e,mi.endOf=Be,mi.format=we,mi.from=ke,mi.fromNow=Ee,mi.to=De,mi.toNow=Te,mi.get=W,mi.invalidAt=Ye,mi.isAfter=fe,mi.isBefore=pe,mi.isBetween=ge,mi.isSame=ye,mi.isSameOrAfter=me,mi.isSameOrBefore=ve,mi.isValid=Re,mi.lang=ai,mi.locale=Ce,mi.localeData=Fe,mi.max=Qr,mi.min=Kr,mi.parsingFlags=je,mi.set=W,mi.startOf=Se,mi.subtract=ii,mi.toArray=Le,mi.toObject=Pe,mi.toDate=Me,mi.toISOString=xe,mi.toJSON=Ne,mi.toString=Ae,mi.unix=Oe,mi.valueOf=Ie,mi.creationData=$e,mi.year=Zr,mi.isLeapYear=bt,mi.weekYear=We,mi.isoWeekYear=Ge,mi.quarter=mi.quarters=Xe,mi.month=ut,mi.daysInMonth=ct,mi.week=mi.weeks=Je,mi.isoWeek=mi.isoWeeks=tn,mi.weeksInYear=He,mi.isoWeeksInYear=Ve,mi.date=oi,mi.day=mi.days=on,mi.weekday=un,mi.isoWeekday=cn,mi.dayOfYear=ln,mi.hour=mi.hours=di,mi.minute=mi.minutes=fi,mi.second=mi.seconds=pi,mi.millisecond=mi.milliseconds=yi,mi.utcOffset=zt,mi.utc=Xt,mi.local=Zt,mi.parseZone=Kt,mi.hasAlignedHourOffset=Qt,mi.isDST=Jt,mi.isDSTShifted=te,mi.isLocal=ee,mi.isUtcOffset=ne,mi.isUtc=re,mi.isUTC=re,mi.zoneAbbr=mn,mi.zoneName=vn,mi.dates=x("dates accessor is deprecated. Use date instead.",oi),mi.months=x("months accessor is deprecated. Use month instead",ut),mi.years=x("years accessor is deprecated. Use year instead",Zr),mi.zone=x("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",qt);var vi=mi,_i={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},bi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Ai="Invalid date",xi="%d",wi=/\d{1,2}/,ki={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Ei=C.prototype;Ei._calendar=_i,Ei.calendar=An,Ei._longDateFormat=bi,Ei.longDateFormat=xn,Ei._invalidDate=Ai,Ei.invalidDate=wn,Ei._ordinal=xi,Ei.ordinal=kn,Ei._ordinalParse=wi,Ei.preparse=En,Ei.postformat=En,Ei._relativeTime=ki,Ei.relativeTime=Dn,Ei.pastFuture=Tn,Ei.set=D,Ei.months=it,Ei._months=Yr,Ei.monthsShort=at,Ei._monthsShort=$r,Ei.monthsParse=st,Ei._monthsRegex=Wr,Ei.monthsRegex=ht,Ei._monthsShortRegex=Ur,Ei.monthsShortRegex=lt,Ei.week=Ze,Ei._week=si,Ei.firstDayOfYear=Qe,Ei.firstDayOfWeek=Ke,Ei.weekdays=nn,Ei._weekdays=ui,Ei.weekdaysMin=an,Ei._weekdaysMin=li,Ei.weekdaysShort=rn,Ei._weekdaysShort=ci,Ei.weekdaysParse=sn,Ei.isPM=pn,Ei._meridiemParse=hi,Ei.meridiem=gn,I("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===_(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),n.lang=x("moment.lang is deprecated. Use moment.locale instead.",I),n.langData=x("moment.langData is deprecated. Use moment.localeData instead.",L);var Di=Math.abs,Ti=Vn("ms"),Ci=Vn("s"),Fi=Vn("m"),Si=Vn("h"),Bi=Vn("d"),Ii=Vn("w"),Oi=Vn("M"),Mi=Vn("y"),Li=zn("milliseconds"),Pi=zn("seconds"),Ni=zn("minutes"),Ri=zn("hours"),ji=zn("days"),Yi=zn("months"),$i=zn("years"),Ui=Math.round,Wi={s:45,m:45,h:22,d:26,M:11},Gi=Math.abs,Vi=$t.prototype;Vi.abs=Ln,Vi.add=Nn,Vi.subtract=Rn,Vi.as=Wn,Vi.asMilliseconds=Ti,Vi.asSeconds=Ci,Vi.asMinutes=Fi,Vi.asHours=Si,Vi.asDays=Bi,Vi.asWeeks=Ii,Vi.asMonths=Oi,Vi.asYears=Mi,Vi.valueOf=Gn,Vi._bubble=Yn,Vi.get=Hn,Vi.milliseconds=Li,Vi.seconds=Pi,Vi.minutes=Ni,Vi.hours=Ri,Vi.days=ji,Vi.weeks=qn,Vi.months=Yi,Vi.years=$i,Vi.humanize=Qn,Vi.toISOString=Jn,Vi.toString=Jn,Vi.toJSON=Jn,Vi.locale=Ce,Vi.localeData=Fe,Vi.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Jn),Vi.lang=ai,V("X",0,0,"unix"),V("x",0,0,"valueOf"),Z("x",wr),Z("X",Dr),tt("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),tt("x",function(t,e,n){n._d=new Date(_(t))}),n.version="2.12.0",r(Nt),n.fn=vi,n.min=jt,n.max=Yt,n.now=Jr,n.utc=c,n.unix=_n,n.months=Sn,n.isDate=a,n.locale=I,n.invalid=f,n.duration=ie,n.isMoment=m,n.weekdays=In,n.parseZone=bn,n.localeData=L,n.isDuration=Ut,n.monthsShort=Bn,n.weekdaysMin=Mn,n.defineLocale=O,n.updateLocale=M,n.locales=P,n.weekdaysShort=On,n.normalizeUnits=R,n.relativeTimeThreshold=Kn,n.prototype=vi;var Hi=n;return Hi})},{}],82:[function(t,e,n){(function(t){function e(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!i;a--){var s=a>=0?arguments[a]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(n=s+"/"+n,i="/"===s.charAt(0))}return n=e(r(n.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(t){var i=n.isAbsolute(t),a="/"===s(t,-1);return t=e(r(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(r(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function r(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),a=r(e.split("/")),s=Math.min(i.length,a.length),o=s,u=0;s>u;u++)if(i[u]!==a[u]){o=u;break}for(var c=[],u=o;ue&&(e=t.length+e),t.substr(e,n)}}).call(this,t("_process"))},{_process:83}],83:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.MutationObserver,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};var r=[];if(e){var i=document.createElement("div"),a=new MutationObserver(function(){var t=r.slice();r.length=0,t.forEach(function(t){t()})});return a.observe(i,{attributes:!0}),function(t){r.length||i.setAttribute("yes","no"),r.push(t)}}return n?(window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),r.length>0)){var n=r.shift();n()}},!0),function(t){r.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],84:[function(t,e){e.exports={name:"mermaid",version:"0.5.8",description:"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams and gantt charts.",main:"src/mermaid.js",keywords:["diagram","markdown","flowchart","sequence diagram","gantt"],bin:{mermaid:"./bin/mermaid.js"},scripts:{live:"live-server ./test/examples",lint:"node node_modules/eslint/bin/eslint.js src",jison:"gulp jison_legacy",karma:"node node_modules/karma/bin/karma start karma.conf.js --single-run",watch:"source ./scripts/watch.sh",doc:"rm -r build;rm -r dist/www;gulp vartree;cp dist/www/all.html ../mermaid-pages/index.html;cp dist/mermaid.js ../mermaid-pages/javascripts/lib;cp dist/mermaid.forest.css ../mermaid-pages/stylesheets",tape:"node node_modules/tape/bin/tape test/cli_test-*.js",jasmine:"npm run jison &&node node_modules/jasmine-es6/bin/jasmine.js",pretest:"npm run jison",test:"npm run dist && npm run karma && npm run tape","dist-slim-mermaid":"node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.slim.js -x d3 && cat dist/mermaid.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.slim.min.js","dist-slim-mermaidAPI":"node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.slim.js -x d3 && cat dist/mermaidAPI.slim.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.slim.min.js","dist-mermaid":"node node_modules/browserify/bin/cmd.js src/mermaid.js -t babelify -s mermaid -o dist/mermaid.js && cat dist/mermaid.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaid.min.js","dist-mermaidAPI":"node node_modules/browserify/bin/cmd.js src/mermaidAPI.js -t babelify -s mermaidAPI -o dist/mermaidAPI.js && cat dist/mermaidAPI.js | node node_modules/uglifyjs/bin/uglifyjs -mc > dist/mermaidAPI.min.js",dist:"npm run dist-slim-mermaid && npm run dist-slim-mermaidAPI && npm run dist-mermaid && npm run dist-mermaidAPI"},repository:{type:"git",url:"https://github.com/knsv/mermaid"},author:"Knut Sveidqvist",license:"MIT",dependencies:{chalk:"^0.5.1",d3:"3.5.6",dagre:"^0.7.4","dagre-d3":"0.4.10",he:"^0.5.0",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.9.0",semver:"^4.1.1",which:"^1.0.8"},devDependencies:{async:"^0.9.0","babel-eslint":"^4.1.3",babelify:"^6.4.0",browserify:"~6.2.0",clone:"^0.2.0","codeclimate-test-reporter":"0.0.4",dateformat:"^1.0.11",dox:"^0.8.0",eslint:"^1.6.0","eslint-watch":"^2.1.2","event-stream":"^3.2.0",foundation:"^4.2.1-1","front-matter":"^0.2.0",gulp:"~3.9.0","gulp-bower":"0.0.10","gulp-browserify":"^0.5.0","gulp-bump":"^0.1.11","gulp-concat":"~2.4.1","gulp-data":"^1.1.1","gulp-dox":"^0.1.6","gulp-ext-replace":"^0.2.0","gulp-filelog":"^0.4.1","gulp-front-matter":"^1.2.3","gulp-hogan":"^1.1.0","gulp-if":"^1.2.5","gulp-insert":"^0.4.0","gulp-istanbul":"^0.4.0","gulp-jasmine":"~2.1.0","gulp-jasmine-browser":"^0.2.3","gulp-jison":"~1.2.0","gulp-jshint":"^1.9.0","gulp-less":"^3.0.1","gulp-livereload":"^3.8.0","gulp-marked":"^1.0.0","gulp-mdvars":"^2.0.0","gulp-qunit":"~1.2.1","gulp-rename":"~1.2.0","gulp-shell":"^0.2.10","gulp-tag-version":"^1.2.1","gulp-uglify":"~1.0.1", +"gulp-util":"^3.0.7","gulp-vartree":"^2.0.1","hogan.js":"^3.0.2",jasmine:"2.3.2","jasmine-es6":"0.0.18",jison:"zaach/jison",jsdom:"^7.0.2","jshint-stylish":"^2.0.1",karma:"^0.13.15","karma-babel-preprocessor":"^6.0.1","karma-browserify":"^4.4.0","karma-jasmine":"^0.3.6","karma-phantomjs-launcher":"^0.2.1","live-server":"^0.9.0","map-stream":"0.0.6",marked:"^0.3.2","mock-browser":"^0.91.34",path:"^0.4.9",phantomjs:"^2.1.3",proxyquire:"^1.7.3","proxyquire-universal":"^1.0.8",proxyquireify:"^3.0.0","require-dir":"^0.3.0",rewire:"^2.1.3",rimraf:"^2.2.8",tape:"^3.0.3",testdom:"^2.0.0",uglifyjs:"^2.4.10","vinyl-source-stream":"^1.1.0",watchify:"^3.6.1"}}},{}],85:[function(t,e){"use strict";var n;if(t)try{n=t("d3")}catch(r){}n||(n=window.d3),e.exports=n,function(){var t=!1;if(t="tspans",n.selection.prototype.textwrap)return!1;if("undefined"==typeof t)var t=!1;n.selection.prototype.textwrap=n.selection.enter.prototype.textwrap=function(e,r){var i,r=parseInt(r)||0,a=this,s=function(t){var e=t[0][0],r=e.tagName.toString();if("rect"!==r)return!1;var i={};return i.x=n.select(e).attr("x")||0,i.y=n.select(e).attr("y")||0,i.width=n.select(e).attr("width")||0,i.height=n.select(e).attr("height")||0,i.attr=t.attr,i},o=function(t){if(t.attr||(t.attr=function(t){return this[t]?this[t]:void 0}),"object"==typeof t&&"undefined"!=typeof t.x&&"undefined"!=typeof t.y&&"undefined"!=typeof t.width&&"undefined"!=typeof t.height)return t;if("function"==typeof Array.isArray&&Array.isArray(t)||"[object Array]"===Object.prototype.toString.call(t)){var e=s(t);return e}return!1},u=function(t,e){var n=t;return 0!==e&&(n.x=parseInt(n.x)+e,n.y=parseInt(n.y)+e,n.width-=2*e,n.height-=2*e),n},c=o(e);if(r&&(c=u(c,r)),0!=a.length&&n&&e&&c){e=c;var l,h=function(t){var r=n.select(t[0].parentNode),a=r.select("text"),s=a.style("line-height"),o=a.text();a.remove();var u=r.append("foreignObject");u.attr("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility").attr("x",e.x).attr("y",e.y).attr("width",e.width).attr("height",e.height);var c=u.append("xhtml:div").attr("class","wrapped");c.style("height",e.height).style("width",e.width).html(o),s&&c.style("line-height",s),i=r.select("foreignObject")},d=function(t){var a,s=t[0],o=s.parentNode,u=n.select(s),c=s.getBBox().height,l=s.getBBox().width,h=c,d=u.style("line-height");if(a=d&&parseInt(d)?parseInt(d.replace("px","")):h,l>e.width){var f=u.text();if(u.text(""),f){var p,g;if(-1!==f.indexOf(" ")){var p=" ";g=f.split(" ")}else{p="";var y=f.length,m=Math.ceil(l/e.width),v=Math.floor(y/m);v*m>=y||m++;for(var _,b,g=[],A=0;m>A;A++)b=A*v,_=f.substr(b,v),g.push(_)}for(var x=[],w=0,k={},A=0;Ae.width&&T&&""!==T&&(w+=C,k={string:T,width:C,offset:w},x.push(k),u.text(""),u.text(D),A==g.length-1&&(E=D,u.text(E),F=s.getComputedTextLength())),A==g.length-1){u.text("");var S=E;S&&""!==S&&(F-w>0&&(F-=w),k={string:S,width:F,offset:w},x.push(k))}}var B;u.text("");for(var A=0;A0){x[A-1]}A*a0?a:void 0}),B.attr("x",function(){var t=e.x;return r&&(t+=r),t}))}}}u.attr("y",function(){var t=e.y;return a&&(t+=a),r&&(t+=r),t}),u.attr("x",function(){var t=e.x;return r&&(t+=r),t}),i=n.select(o).selectAll("text")};t&&("foreignobjects"==t?l=h:"tspans"==t&&(l=d)),t||(l="undefined"!=typeof SVGForeignObjectElement?h:d);for(var f=0;f "+t.w+": "+JSON.stringify(s.edge(t))),p(i,s.edge(t),s.edge(t).relation)}),i.attr("height","100%"),i.attr("width","100%")}},{"../../d3":85,"../../logger":104,"./classDb":86,"./parser/classDiagram":88,dagre:30}],88:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,11],r=[1,12],i=[1,13],a=[1,15],s=[1,16],o=[1,17],u=[6,8],c=[1,26],l=[1,27],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[6,8,13,17,23,26,27,28,29,30,31],y=[6,8,13,17,23,26,27,28,29,30,31,45,46,47],m=[23,45,46,47],v=[23,30,31,45,46,47],_=[23,26,27,28,29,45,46,47],b=[6,8,13],A=[1,46],x={trace:function(){},yy:{},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},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"},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]],performAction:function(t,e,n,r,i,a){var s=a.length-1;switch(i){case 5:this.$=a[s-1]+a[s];break;case 6:this.$=a[s];break;case 7:r.addRelation(a[s]);break;case 8:a[s-1].title=r.cleanupLabel(a[s]),r.addRelation(a[s-1]);break;case 12:r.addMembers(a[s-3],a[s-1]);break;case 13:this.$=[a[s]];break;case 14:a[s].push(a[s-1]),this.$=a[s];break;case 15:break;case 16:r.addMembers(a[s-1],r.cleanupLabel(a[s]));break;case 17:console.warn("Member",a[s]);break;case 18:break;case 19:this.$={id1:a[s-2],id2:a[s],relation:a[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 20:this.$={id1:a[s-3],id2:a[s],relation:a[s-1],relationTitle1:a[s-2],relationTitle2:"none"};break;case 21:this.$={id1:a[s-3],id2:a[s],relation:a[s-2],relationTitle1:"none",relationTitle2:a[s-1]};break;case 22:this.$={id1:a[s-4],id2:a[s],relation:a[s-2],relationTitle1:a[s-3],relationTitle2:a[s-1]};break;case 23:this.$={type1:a[s-2],type2:a[s],lineType:a[s-1]};break;case 24:this.$={type1:"none",type2:a[s],lineType:a[s-1]};break;case 25:this.$={type1:a[s-1],type2:"none",lineType:a[s]};break;case 26:this.$={type1:"none",type2:"none",lineType:a[s]};break;case 27:this.$=r.relationType.AGGREGATION;break;case 28:this.$=r.relationType.EXTENSION;break;case 29:this.$=r.relationType.COMPOSITION;break;case 30:this.$=r.relationType.DEPENDENCY;break;case 31:this.$=r.lineType.LINE;break;case 32:this.$=r.lineType.DOTTED_LINE}},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:n,20:r,21:i,45:a,46:s,47:o},{8:[1,18]},{6:[1,19],8:[2,3]},e(u,[2,7],{13:[1,20]}),e(u,[2,9]),e(u,[2,10]),e(u,[2,15],{22:21,24:24,25:25,13:[1,23],23:[1,22],26:c,27:l,28:h,29:d,30:f,31:p}),{10:32,11:14,45:a,46:s,47:o},e(u,[2,17]),e(u,[2,18]),e(g,[2,6],{11:14,10:33,45:a,46:s,47:o}),e(y,[2,46]),e(y,[2,47]),e(y,[2,48]),{1:[2,2]},{7:34,9:6,10:10,11:14,12:7,14:8,15:9,16:n,20:r,21:i,45:a,46:s,47:o},e(u,[2,8]),{10:35,11:14,23:[1,36],45:a,46:s,47:o},{22:37,24:24,25:25,26:c,27:l,28:h,29:d,30:f,31:p},e(u,[2,16]),{25:38,30:f,31:p},e(m,[2,26],{24:39,26:c,27:l,28:h,29:d}),e(v,[2,27]),e(v,[2,28]),e(v,[2,29]),e(v,[2,30]),e(_,[2,31]),e(_,[2,32]),e(u,[2,11],{17:[1,40]}),e(g,[2,5]),{8:[2,4]},e(b,[2,19]),{10:41,11:14,45:a,46:s,47:o},{10:42,11:14,23:[1,43],45:a,46:s,47:o},e(m,[2,25],{24:44,26:c,27:l,28:h,29:d}),e(m,[2,24]),{18:45,20:A},e(b,[2,21]),e(b,[2,20]),{10:47,11:14,45:a,46:s,47:o},e(m,[2,23]),{19:[1,48]},{18:49,19:[2,13],20:A},e(b,[2,22]),e(u,[2,12]),{19:[2,14]}],defaultActions:{2:[2,1],18:[2,2],34:[2,4],49:[2,14]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,A,x,w,k,E,D,T=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},C={};;){if(b=n[n.length-1],this.defaultActions[b]?A=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=T()),A=a[b]&&a[b][v]),"undefined"==typeof A||!A.length||!A[0]){var F="";D=[];for(w in a[b])this.terminals_[w]&&w>l&&D.push("'"+this.terminals_[w]+"'");F=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(F,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(A[0]){case 1:n.push(v),r.push(f.yytext),i.push(f.yylloc),n.push(A[1]),v=null,_?(v=_,_=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[A[1]][1],C.$=r[r.length-k],C._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(C._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),x=this.performAction.apply(C,[s,u,o,p.yy,A[1],r,i].concat(d)),"undefined"!=typeof x)return x;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[A[1]][0]),r.push(C.$),i.push(C._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},w=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:break;case 1:return 6;case 2:break;case 3:return 5;case 4:return this.begin("struct"),17;case 5:return this.popState(),19;case 6:break;case 7:return"MEMBER";case 8:return 16;case 9:this.begin("string");break;case 10:this.popState();break;case 11:return"STR";case 12:return 27;case 13:return 27;case 14:return 29;case 15:return 29;case 16:return 28;case 17:return 26;case 18:return 30;case 19:return 31;case 20:return 13;case 21:return 43;case 22:return"DOT";case 23:return"PLUS";case 24:return 40;case 25:return"EQUALS";case 26:return"EQUALS";case 27:return 47;case 28:return"PUNCTUATION";case 29:return 46;case 30:return 45;case 31:return 42;case 32:return 8}},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)/,/^(?:$)/],conditions:{string:{rules:[10,11],inclusive:!1},struct:{rules:[5,6,7],inclusive:!1},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:!0}}};return t}();return x.lexer=w,t.prototype=x,x.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:83,fs:1,path:82}],89:[function(t,e,n){(function(e){"use strict";var r=t("../../logger"),i=new r.Log,a="",s=!1;n.setMessage=function(t){i.debug("Setting message to: "+t),a=t},n.getMessage=function(){return a},n.setInfo=function(t){s=t},n.getInfo=function(){return s},n.parseError=function(t,n){e.mermaidAPI.parseError(t,n)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../logger":104}],90:[function(t,e,n){"use strict";var r=t("./exampleDb"),i=t("./parser/example.js"),a=t("../../d3"),s=t("../../logger"),o=new s.Log;n.draw=function(t,e,n){var s;s=i.parser,s.yy=r,o.debug("Renering example diagram"),s.parse(t);var u=a.select("#"+e),c=u.append("g");c.append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("mermaid "+n),u.attr("height",100),u.attr("width",400)}},{"../../d3":85,"../../logger":104,"./exampleDb":89,"./parser/example.js":91}],91:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[6,9,10,12],r={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,message:11,say:12,TXT:13,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo",12:"say",13:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1],[8,1],[11,2]],performAction:function(t,e,n,r,i,a){var s=a.length-1;switch(i){case 1:return r;case 4:break;case 6:r.setInfo(!0);break;case 7:r.setMessage(a[s]);break;case 8:this.$=a[s-1].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},e(n,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8],11:9,12:[1,10]},{1:[2,1]},e(n,[2,3]),e(n,[2,4]),e(n,[2,5]),e(n,[2,6]),e(n,[2,7]),{13:[1,11]},e(n,[2,8])],defaultActions:{4:[2,1]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,A,x,w,k,E,D,T=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},C={};;){if(b=n[n.length-1],this.defaultActions[b]?A=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=T()),A=a[b]&&a[b][v]),"undefined"==typeof A||!A.length||!A[0]){var F="";D=[];for(w in a[b])this.terminals_[w]&&w>l&&D.push("'"+this.terminals_[w]+"'");F=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(F,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(A[0]){case 1:n.push(v),r.push(f.yytext),i.push(f.yylloc),n.push(A[1]),v=null,_?(v=_,_=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[A[1]][1],C.$=r[r.length-k],C._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(C._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),x=this.performAction.apply(C,[s,u,o,p.yy,A[1],r,i].concat(d)),"undefined"!=typeof x)return x;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[A[1]][0]),r.push(C.$),i.push(C._$),E=a[n[n.length-2]][n[n.length-1]], +n.push(E);break;case 3:return!0}}return!0}},i=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 9;case 1:return 10;case 2:return 4;case 3:return 12;case 4:return 13;case 5:return 6;case 6:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:showInfo\b)/i,/^(?:info\b)/i,/^(?:say\b)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return t}();return r.lexer=i,t.prototype=r,r.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:83,fs:1,path:82}],92:[function(t,e){"use strict";var n,r=t("../../logger"),i=new r.Log;if(t)try{n=t("dagre-d3")}catch(a){i.debug("Could not load dagre-d3")}n||(n=window.dagreD3),e.exports=n},{"../../logger":104,"dagre-d3":2}],93:[function(t,e,n){"use strict";var r=t("./graphDb"),i=t("./parser/flow"),a=t("./parser/dot"),s=t("../../d3"),o=t("./dagre-d3"),u=t("../../logger"),c=new u.Log,l={};e.exports.setConf=function(t){var e,n=Object.keys(t);for(e=0;e0&&(s=a.classes.join(" "));var o="";o=r(o,a.styles),i="undefined"==typeof a.text?a.id:a.text;var u="";if(l.htmlLabels)u="html",i=i.replace(/fa:fa[\w\-]+/g,function(t){return''});else{var c=document.createElementNS("http://www.w3.org/2000/svg","text"),h=i.split(/
/),d=0;for(d=0;d/g,"\n");"undefined"==typeof t.style?l.htmlLabels?e.setEdge(t.start,t.end,{labelType:"html",style:a,labelpos:"c",label:''+t.text+"",arrowheadStyle:"fill: #333",arrowhead:n},i):e.setEdge(t.start,t.end,{labelType:"text",style:"stroke: #333; stroke-width: 1.5px;fill:none",labelpos:"c",label:s,arrowheadStyle:"fill: #333",arrowhead:n},i):e.setEdge(t.start,t.end,{labelType:"text",style:a,arrowheadStyle:"fill: #333",label:s,arrowhead:n},i)}})},n.getClasses=function(t,e){var n;r.clear(),n=e?a.parser:i.parser,n.yy=r,n.parse(t);var s=r.getClasses();return"undefined"==typeof s["default"]&&(s["default"]={id:"default"},s["default"].styles=[],s["default"].clusterStyles=["rx:4px","fill: rgb(255, 255, 222)","rx: 4px","stroke: rgb(170, 170, 51)","stroke-width: 1px"],s["default"].nodeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"],s["default"].edgeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"]),s},n.draw=function(t,e,u){c.debug("Drawing flowchart");var h;r.clear(),h=u?a.parser:i.parser,h.yy=r;try{h.parse(t)}catch(d){c.debug("Parsing failed")}var f;f=r.getDirection(),"undefined"==typeof f&&(f="TD");var p,g=new o.graphlib.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:f,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),y=r.getSubGraphs(),m=0;for(m=y.length-1;m>=0;m--)p=y[m],r.addVertex(p.id,p.title,"group",void 0);var v=r.getVertices(),_=r.getEdges();m=0;var b;for(m=y.length-1;m>=0;m--)for(p=y[m],s.selectAll("cluster").append("text"),b=0;b0?t.split(",").forEach(function(t){"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)}):"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)};var setTooltip=function(t,e){"undefined"!=typeof e&&(tooltips[t]=e)},setClickFun=function setClickFun(id,functionName){"undefined"!=typeof functionName&&"undefined"!=typeof vertices[id]&&funs.push(function(element){var elem=d3.select(element).select("#"+id);null!==elem&&elem.on("click",function(){eval(functionName+"('"+id+"')")})})},setLink=function(t,e){"undefined"!=typeof e&&"undefined"!=typeof vertices[t]&&funs.push(function(n){var r=d3.select(n).select("#"+t);null!==r&&r.on("click",function(){window.open(e,"newTab")})})};exports.getTooltip=function(t){return tooltips[t]},exports.setClickEvent=function(t,e,n,r){t.indexOf(",")>0?t.split(",").forEach(function(t){setTooltip(t,r),setClickFun(t,e),setLink(t,n)}):(setTooltip(t,r),setClickFun(t,e),setLink(t,n))},exports.bindFunctions=function(t){funs.forEach(function(e){e(t)})},exports.getDirection=function(){return direction},exports.getVertices=function(){return vertices},exports.getEdges=function(){return edges},exports.getClasses=function(){return classes};var setupToolTips=function(t){var e=d3.select(".mermaidTooltip");null===e[0][0]&&(e=d3.select("body").append("div").attr("class","mermaidTooltip").style("opacity",0));var n=d3.select(t).select("svg"),r=n.selectAll("g.node");r.on("mouseover",function(){var t=d3.select(this),n=t.attr("title");if(null!==n){var r=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.html(t.attr("title")).style("left",r.left+(r.right-r.left)/2+"px").style("top",r.top-14+document.body.scrollTop+"px"),t.classed("hover",!0)}}).on("mouseout",function(){e.transition().duration(500).style("opacity",0);var t=d3.select(this);t.classed("hover",!1)})};funs.push(setupToolTips),exports.clear=function(){vertices={},classes={},edges=[],funs=[],funs.push(setupToolTips),subGraphs=[],subCount=0,tooltips=[]},exports.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},exports.addSubGraph=function(t,e){function n(t){var e={"boolean":{},number:{},string:{}},n=[];return t.filter(function(t){var r=typeof t;return" "===t?!1:r in e?e[r].hasOwnProperty(t)?!1:e[r][t]=!0:n.indexOf(t)>=0?!1:n.push(t)})}var r=[];r=n(r.concat.apply(r,t));var i={id:"subGraph"+subCount,nodes:r,title:e};return subGraphs.push(i),subCount+=1,i.id};var getPosForId=function(t){var e;for(e=0;e2e3)){if(posCrossRef[secCount]=n,subGraphs[n].id===e)return{result:!0,count:0};for(var i=0,a=1;i=0){var o=t(e,s);if(o.result)return{result:!0,count:a+o.count};a+=o.count}i+=1}return{result:!1,count:a}}};exports.getDepthFirstPos=function(t){return posCrossRef[t]},exports.indexNodes=function(){secCount=-1,subGraphs.length>0&&indexNodes("none",subGraphs.length-1,0)},exports.getSubGraphs=function(){return subGraphs},exports.parseError=function(t,e){global.mermaidAPI.parseError(t,e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../d3":85,"../../logger":104}],95:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,5],r=[1,6],i=[1,12],a=[1,13],s=[1,14],o=[1,15],u=[1,16],c=[1,17],l=[1,18],h=[1,19],d=[1,20],f=[1,21],p=[1,22],g=[8,16,17,18,19,20,21,22,23,24,25,26],y=[1,37],m=[1,33],v=[1,34],_=[1,35],b=[1,36],A=[8,10,16,17,18,19,20,21,22,23,24,25,26,28,32,37,39,40,45,57,58],x=[10,28],w=[10,28,37,57,58],k=[2,49],E=[1,45],D=[1,48],T=[1,49],C=[1,52],F=[2,65],S=[1,65],B=[1,66],I=[1,67],O=[1,68],M=[1,69],L=[1,70],P=[1,71],N=[1,72],R=[1,73],j=[8,16,17,18,19,20,21,22,23,24,25,26,47],Y=[10,28,37],$={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graph:4,EOF:5,graphStatement:6,idStatement:7,"{":8,stmt_list:9,"}":10,strict:11,GRAPH:12,DIGRAPH:13,textNoTags:14,textNoTagsToken:15,ALPHA:16,NUM:17,COLON:18,PLUS:19,EQUALS:20,MULT:21,DOT:22,BRKT:23,SPACE:24,MINUS:25,keywords:26,stmt:27,";":28,node_stmt:29,edge_stmt:30,attr_stmt:31,"=":32,subgraph:33,attr_list:34,NODE:35,EDGE:36,"[":37,a_list:38,"]":39,",":40,edgeRHS:41,node_id:42,edgeop:43,port:44,":":45,compass_pt:46,SUBGRAPH:47,n:48,ne:49,e:50,se:51,s:52,sw:53,w:54,nw:55,c:56,ARROW_POINT:57,ARROW_OPEN:58,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"{",10:"}",11:"strict",12:"GRAPH",13:"DIGRAPH",16:"ALPHA",17:"NUM",18:"COLON",19:"PLUS",20:"EQUALS",21:"MULT",22:"DOT",23:"BRKT",24:"SPACE",25:"MINUS",26:"keywords",28:";",32:"=",35:"NODE",36:"EDGE",37:"[",39:"]",40:",",45:":",47:"SUBGRAPH",48:"n",49:"ne",50:"e",51:"se",52:"s",53:"sw",54:"w",55:"nw",56:"c",57:"ARROW_POINT",58:"ARROW_OPEN"},productions_:[0,[3,2],[4,5],[4,6],[4,4],[6,1],[6,1],[7,1],[14,1],[14,2],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[9,1],[9,3],[27,1],[27,1],[27,1],[27,3],[27,1],[31,2],[31,2],[31,2],[34,4],[34,3],[34,3],[34,2],[38,5],[38,5],[38,3],[30,3],[30,3],[30,2],[30,2],[41,3],[41,3],[41,2],[41,2],[29,2],[29,1],[42,2],[42,1],[44,4],[44,2],[44,2],[33,5],[33,4],[33,3],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,0],[43,1],[43,1]],performAction:function(t,e,n,r,i,a){var s=a.length-1;switch(i){case 1:this.$=a[s-1];break;case 2:this.$=a[s-4];break;case 3:this.$=a[s-5];break;case 4:this.$=a[s-3];break;case 8:case 10:case 11:this.$=a[s];break;case 9:this.$=a[s-1]+""+a[s];break;case 12:case 13:case 14:case 15:case 16:case 18:case 19:case 20:this.$=a[s];break;case 17:this.$="
";break;case 39:this.$="oy";break;case 40:r.addLink(a[s-1],a[s].id,a[s].op),this.$="oy";break;case 42:r.addLink(a[s-1],a[s].id,a[s].op),this.$={op:a[s-2],id:a[s-1]};break;case 44:this.$={op:a[s-1],id:a[s]};break;case 48:r.addVertex(a[s-1]),this.$=a[s-1];break;case 49:r.addVertex(a[s]),this.$=a[s];break;case 66:this.$="arrow";break;case 67:this.$="arrow_open"}},table:[{3:1,4:2,6:3,11:[1,4],12:n,13:r},{1:[3]},{5:[1,7]},{7:8,8:[1,9],14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},{6:23,12:n,13:r},e(g,[2,5]),e(g,[2,6]),{1:[2,1]},{8:[1,24]},{7:30,8:y,9:25,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},e([8,10,28,32,37,39,40,45,57,58],[2,7],{15:38,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p}),e(A,[2,8]),e(A,[2,10]),e(A,[2,11]),e(A,[2,12]),e(A,[2,13]),e(A,[2,14]),e(A,[2,15]),e(A,[2,16]),e(A,[2,17]),e(A,[2,18]),e(A,[2,19]),e(A,[2,20]),{7:39,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},{7:30,8:y,9:40,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{10:[1,41]},{10:[2,21],28:[1,42]},e(x,[2,23]),e(x,[2,24]),e(x,[2,25]),e(w,k,{44:44,32:[1,43],45:E}),e(x,[2,27],{41:46,43:47,57:D,58:T}),e(x,[2,47],{43:47,34:50,41:51,37:C,57:D,58:T}),{34:53,37:C},{34:54,37:C},{34:55,37:C},{7:56,8:[1,57],14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},{7:30,8:y,9:58,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},e(A,[2,9]),{8:[1,59]},{10:[1,60]},{5:[2,4]},{7:30,8:y,9:61,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{7:62,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},e(w,[2,48]),e(w,F,{14:10,15:11,7:63,46:64,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,48:S,49:B,50:I,51:O,52:M,53:L,54:P,55:N,56:R}),e(x,[2,41],{34:74,37:C}),{7:77,8:y,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,33:76,42:75,47:b},e(j,[2,66]),e(j,[2,67]),e(x,[2,46]),e(x,[2,40],{34:78,37:C}),{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,38:79,39:[1,80]},e(x,[2,28]),e(x,[2,29]),e(x,[2,30]),{8:[1,82]},{7:30,8:y,9:83,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{10:[1,84]},{7:30,8:y,9:85,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{5:[2,2]},{10:[2,22]},e(x,[2,26]),e(w,[2,51],{45:[1,86]}),e(w,[2,52]),e(w,[2,56]),e(w,[2,57]),e(w,[2,58]),e(w,[2,59]),e(w,[2,60]),e(w,[2,61]),e(w,[2,62]),e(w,[2,63]),e(w,[2,64]),e(x,[2,38]),e(Y,[2,44],{43:47,41:87,57:D,58:T}),e(Y,[2,45],{43:47,41:88,57:D,58:T}),e(w,k,{44:44,45:E}),e(x,[2,39]),{39:[1,89]},e(x,[2,34],{34:90,37:C}),{32:[1,91]},{7:30,8:y,9:92,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,27:26,29:27,30:28,31:29,33:31,35:v,36:_,42:32,47:b},{10:[1,93]},e(w,[2,55]),{10:[1,94]},e(w,F,{46:95,48:S,49:B,50:I,51:O,52:M,53:L,54:P,55:N,56:R}),e(Y,[2,42]),e(Y,[2,43]),e(x,[2,33],{34:96,37:C}),e(x,[2,32]),{7:97,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p},{10:[1,98]},e(w,[2,54]),{5:[2,3]},e(w,[2,50]),e(x,[2,31]),{28:[1,99],39:[2,37],40:[1,100]},e(w,[2,53]),{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,38:101},{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:f,26:p,38:102},{39:[2,35]},{39:[2,36]}],defaultActions:{7:[2,1],41:[2,4],60:[2,2],61:[2,22],94:[2,3],101:[2,35],102:[2,36]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,A,x,w,k,E,D,T=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},C={};;){if(b=n[n.length-1],this.defaultActions[b]?A=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=T()),A=a[b]&&a[b][v]),"undefined"==typeof A||!A.length||!A[0]){var F="";D=[];for(w in a[b])this.terminals_[w]&&w>l&&D.push("'"+this.terminals_[w]+"'");F=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(F,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(A[0]){case 1:n.push(v),r.push(f.yytext),i.push(f.yylloc),n.push(A[1]),v=null,_?(v=_,_=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[A[1]][1],C.$=r[r.length-k],C._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(C._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),x=this.performAction.apply(C,[s,u,o,p.yy,A[1],r,i].concat(d)),"undefined"!=typeof x)return x;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[A[1]][0]),r.push(C.$),i.push(C._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},U=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:return"STYLE";case 1:return"LINKSTYLE";case 2:return"CLASSDEF";case 3:return"CLASS";case 4:return"CLICK";case 5:return 12;case 6:return 13;case 7:return 47;case 8:return 35;case 9:return 36;case 10:return"DIR";case 11:return"DIR";case 12:return"DIR";case 13:return"DIR";case 14:return"DIR";case 15:return"DIR";case 16:return 17;case 17:return 23;case 18:return 18;case 19:return 28;case 20:return 40;case 21:return 32;case 22:return 21;case 23:return 22;case 24:return"ARROW_CROSS";case 25:return 57;case 26:return"ARROW_CIRCLE";case 27:return 58;case 28:return 25;case 29:return 19;case 30:return 20;case 31:return 16;case 32:return"PIPE";case 33:return"PS";case 34:return"PE";case 35:return 37;case 36:return 39;case 37:return 8;case 38:return 10;case 39:return"QUOTE";case 40:return 24;case 41:return"NEWLINE";case 42:return 5}},rules:[/^(?:style\b)/,/^(?:linkStyle\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:digraph\b)/,/^(?:subgraph\b)/,/^(?:node\b)/,/^(?:edge\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:--[x])/,/^(?:->)/,/^(?:--[o])/,/^(?:--)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u0061-\u007A\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)/,/^(?:\n)/,/^(?:$)/], +conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],inclusive:!0}}};return t}();return $.lexer=U,t.prototype=$,$.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:83,fs:1,path:82}],96:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,4],r=[1,3],i=[1,5],a=[1,8,9,10,11,13,18,30,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],s=[2,2],o=[1,12],u=[1,13],c=[1,14],l=[1,15],h=[1,31],d=[1,33],f=[1,22],p=[1,34],g=[1,24],y=[1,25],m=[1,26],v=[1,27],_=[1,28],b=[1,38],A=[1,40],x=[1,35],w=[1,39],k=[1,45],E=[1,44],D=[1,36],T=[1,37],C=[1,41],F=[1,42],S=[1,43],B=[1,8,9,10,11,13,18,30,32,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],I=[1,53],O=[1,52],M=[1,54],L=[1,72],P=[1,80],N=[1,81],R=[1,66],j=[1,65],Y=[1,85],$=[1,84],U=[1,82],W=[1,83],G=[1,73],V=[1,68],H=[1,67],z=[1,63],q=[1,75],X=[1,76],Z=[1,77],K=[1,78],Q=[1,79],J=[1,70],tt=[1,69],et=[8,9,11],nt=[8,9,11,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64],rt=[1,115],it=[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,85,87,88,90,91,93,94,95,96,97],at=[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,83,85,87,88,90,91,93,94,95,96,97],st=[1,117],ot=[1,118],ut=[8,9,10,11,13,18,30,32,46,71,72,73,74,75,81,85,87,88,90,91,93,94,95,96,97],ct=[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,83,85,87,88,90,91,93,94,95,96,97],lt=[13,18,46,81,85,87,88,90,91,93,94,95,96,97],ht=[13,18,46,49,65,81,85,87,88,90,91,93,94,95,96,97],dt=[1,191],ft=[1,188],pt=[1,195],gt=[1,192],yt=[1,189],mt=[1,196],vt=[1,186],_t=[1,187],bt=[1,190],At=[1,193],xt=[1,194],wt=[1,211],kt=[8,9,11,85],Et=[8,9,10,11,46,71,80,81,83,85,87,88,89,90,91],Dt={trace:function(){},yy:{},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,commentStatement:82,PCT:83,style:84,COMMA:85,styleComponent:86,ALPHA:87,COLON:88,UNIT:89,BRKT:90,DOT:91,graphCodeTokens:92,PUNCTUATION:93,UNICODE_TEXT:94,PLUS:95,EQUALS:96,MULT:97,TAG_START:98,TAG_END:99,QUOTE:100,$accept:0,$end:1},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",83:"PCT",85:"COMMA",87:"ALPHA",88:"COLON",89:"UNIT",90:"BRKT",91:"DOT",93:"PUNCTUATION",94:"UNICODE_TEXT",95:"PLUS",96:"EQUALS",97:"MULT",98:"TAG_START",99:"TAG_END",100:"QUOTE"},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],[82,3],[79,1],[79,3],[84,1],[84,2],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,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],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1]],performAction:function(t,e,n,r,i,a){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:a[s]!==[]&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 57:case 59:case 60:case 92:case 94:case 95:case 108:this.$=a[s];break;case 11:r.setDirection(a[s-1]),this.$=a[s-1];break;case 12:r.setDirection("LR"),this.$=a[s-1];break;case 13:r.setDirection("RL"),this.$=a[s-1];break;case 14:r.setDirection("BT"),this.$=a[s-1];break;case 15:r.setDirection("TB"),this.$=a[s-1];break;case 30:this.$=a[s-1];break;case 31:case 32:case 33:case 34:case 35:this.$=[];break;case 36:this.$=r.addSubGraph(a[s-1],a[s-3]);break;case 37:this.$=r.addSubGraph(a[s-1],void 0);break;case 41:r.addLink(a[s-2],a[s],a[s-1]),this.$=[a[s-2],a[s]];break;case 42:this.$=[a[s]];break;case 43:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"square");break;case 44:this.$=a[s-4],r.addVertex(a[s-4],a[s-2],"square");break;case 45:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],"circle");break;case 46:this.$=a[s-6],r.addVertex(a[s-6],a[s-3],"circle");break;case 47:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"ellipse");break;case 48:this.$=a[s-4],r.addVertex(a[s-4],a[s-2],"ellipse");break;case 49:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"round");break;case 50:this.$=a[s-4],r.addVertex(a[s-4],a[s-2],"round");break;case 51:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"diamond");break;case 52:this.$=a[s-4],r.addVertex(a[s-4],a[s-2],"diamond");break;case 53:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"odd");break;case 54:this.$=a[s-4],r.addVertex(a[s-4],a[s-2],"odd");break;case 55:this.$=a[s],r.addVertex(a[s]);break;case 56:this.$=a[s-1],r.addVertex(a[s-1]);break;case 58:case 93:case 96:case 109:this.$=a[s-1]+""+a[s];break;case 61:this.$="v";break;case 62:this.$="-";break;case 63:a[s-1].text=a[s],this.$=a[s-1];break;case 64:case 65:a[s-2].text=a[s-1],this.$=a[s-2];break;case 66:this.$=a[s];break;case 67:this.$={type:"arrow",stroke:"normal",text:a[s-1]};break;case 68:this.$={type:"arrow_circle",stroke:"normal",text:a[s-1]};break;case 69:this.$={type:"arrow_cross",stroke:"normal",text:a[s-1]};break;case 70:this.$={type:"arrow_open",stroke:"normal",text:a[s-1]};break;case 71:this.$={type:"arrow",stroke:"dotted",text:a[s-1]};break;case 72:this.$={type:"arrow_circle",stroke:"dotted",text:a[s-1]};break;case 73:this.$={type:"arrow_cross",stroke:"dotted",text:a[s-1]};break;case 74:this.$={type:"arrow_open",stroke:"dotted",text:a[s-1]};break;case 75:this.$={type:"arrow",stroke:"thick",text:a[s-1]};break;case 76:this.$={type:"arrow_circle",stroke:"thick",text:a[s-1]};break;case 77:this.$={type:"arrow_cross",stroke:"thick",text:a[s-1]};break;case 78:this.$={type:"arrow_open",stroke:"thick",text:a[s-1]};break;case 79:this.$={type:"arrow",stroke:"normal"};break;case 80:this.$={type:"arrow_circle",stroke:"normal"};break;case 81:this.$={type:"arrow_cross",stroke:"normal"};break;case 82:this.$={type:"arrow_open",stroke:"normal"};break;case 83:this.$={type:"arrow",stroke:"dotted"};break;case 84:this.$={type:"arrow_circle",stroke:"dotted"};break;case 85:this.$={type:"arrow_cross",stroke:"dotted"};break;case 86:this.$={type:"arrow_open",stroke:"dotted"};break;case 87:this.$={type:"arrow",stroke:"thick"};break;case 88:this.$={type:"arrow_circle",stroke:"thick"};break;case 89:this.$={type:"arrow_cross",stroke:"thick"};break;case 90:this.$={type:"arrow_open",stroke:"thick"};break;case 91:this.$=a[s-1];break;case 110:case 111:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 112:this.$=a[s-4],r.setClass(a[s-2],a[s]);break;case 113:this.$=a[s-4],r.setClickEvent(a[s-2],a[s],void 0,void 0);break;case 114:this.$=a[s-6],r.setClickEvent(a[s-4],a[s-2],void 0,a[s]);break;case 115:this.$=a[s-4],r.setClickEvent(a[s-2],void 0,a[s],void 0);break;case 116:this.$=a[s-6],r.setClickEvent(a[s-4],void 0,a[s-2],a[s]);break;case 117:this.$=a[s-4],r.addVertex(a[s-2],void 0,void 0,a[s]);break;case 118:case 119:case 120:this.$=a[s-4],r.updateLink(a[s-2],a[s]);break;case 122:this.$=[a[s]];break;case 123:a[s-2].push(a[s]),this.$=a[s-2];break;case 125:this.$=a[s-1]+a[s]}},table:[{3:1,4:2,9:n,10:r,12:i},{1:[3]},e(a,s,{5:6}),{4:7,9:n,10:r,12:i},{4:8,9:n,10:r,12:i},{10:[1,9]},{1:[2,1],6:10,7:11,8:o,9:u,10:c,11:l,13:h,18:d,23:16,25:17,26:18,27:19,28:20,29:21,30:f,33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:_,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},e(a,[2,9]),e(a,[2,10]),{13:[1,46],15:[1,47],16:[1,48],17:[1,49],18:[1,50]},e(B,[2,3]),e(B,[2,4]),e(B,[2,5]),e(B,[2,6]),e(B,[2,7]),e(B,[2,8]),{8:I,9:O,11:M,24:51},{8:I,9:O,11:M,24:55},{8:I,9:O,11:M,24:56},{8:I,9:O,11:M,24:57},{8:I,9:O,11:M,24:58},{8:I,9:O,11:M,24:59},{8:I,9:O,10:L,11:M,12:P,13:N,15:R,16:j,17:Y,18:$,24:61,30:U,31:60,32:W,45:71,46:G,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},e(et,[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]},e(nt,[2,55],{45:32,21:113,44:114,10:rt,13:h,15:[1,112],18:d,36:[1,108],38:[1,109],40:[1,110],42:[1,111],46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S}),e(it,[2,57]),e(it,[2,59]),e(it,[2,60]),e(it,[2,61]),e(it,[2,62]),e(at,[2,150]),e(at,[2,151]),e(at,[2,152]),e(at,[2,153]),e(at,[2,154]),e(at,[2,155]),e(at,[2,156]),e(at,[2,157]),e(at,[2,158]),e(at,[2,159]),e(at,[2,160]),{8:st,9:ot,10:rt,14:116,21:119},{8:st,9:ot,10:rt,14:120,21:119},{8:st,9:ot,10:rt,14:121,21:119},{8:st,9:ot,10:rt,14:122,21:119},{8:st,9:ot,10:rt,14:123,21:119},e(B,[2,30]),e(B,[2,38]),e(B,[2,39]),e(B,[2,40]),e(B,[2,31]),e(B,[2,32]),e(B,[2,33]),e(B,[2,34]),e(B,[2,35]),{8:I,9:O,10:L,11:M,12:P,13:N,15:R,16:j,17:Y,18:$,24:124,30:U,32:W,45:71,46:G,50:V,60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},e(ut,s,{5:126}),e(ct,[2,92]),e(ct,[2,94]),e(ct,[2,139]),e(ct,[2,140]),e(ct,[2,141]),e(ct,[2,142]),e(ct,[2,143]),e(ct,[2,144]),e(ct,[2,145]),e(ct,[2,146]),e(ct,[2,147]),e(ct,[2,148]),e(ct,[2,149]),e(ct,[2,97]),e(ct,[2,98]),e(ct,[2,99]),e(ct,[2,100]),e(ct,[2,101]),e(ct,[2,102]),e(ct,[2,103]),e(ct,[2,104]),e(ct,[2,105]),e(ct,[2,106]),e(ct,[2,107]),{13:h,18:d,33:127,35:29,44:30,45:32,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},e(lt,[2,66],{48:128,49:[1,129],65:[1,130]}),{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,31:131,32:W,45:71,46:G,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,31:132,32:W,45:71,46:G,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,31:133,32:W,45:71,46:G,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},e(ht,[2,79]),e(ht,[2,80]),e(ht,[2,81]),e(ht,[2,82]),e(ht,[2,83]),e(ht,[2,84]),e(ht,[2,85]),e(ht,[2,86]),e(ht,[2,87]),e(ht,[2,88]),e(ht,[2,89]),e(ht,[2,90]),{13:h,18:d,35:134,44:30,45:32,46:p,80:[1,135],81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{78:[1,136],81:[1,137]},{13:h,18:d,35:139,44:30,45:32,46:p,78:[1,138],81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{13:h,18:d,35:140,44:30,45:32,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{13:h,18:d,35:141,44:30,45:32,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,31:142,32:W,45:71,46:G,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,31:144,32:W,38:[1,143],45:71,46:G,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,31:145,32:W,45:71,46:G,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,31:146,32:W,45:71,46:G,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,31:147,32:W,45:71,46:G,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},e(nt,[2,56]),e(it,[2,58]),e(nt,[2,29],{21:148,10:rt}),e(a,[2,11]),e(a,[2,21]),e(a,[2,22]),{9:[1,149]},e(a,[2,12]),e(a,[2,13]),e(a,[2,14]),e(a,[2,15]),e(ut,s,{5:150}),e(ct,[2,93]),{6:10,7:11,8:o,9:u,10:c,11:l,13:h,18:d,23:16,25:17,26:18,27:19,28:20,29:21,30:f,32:[1,151],33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:_,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},e(et,[2,41]),e(lt,[2,63],{10:[1,152]}),{10:[1,153]},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,31:154,32:W,45:71,46:G,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,32:W,45:71,46:G,50:V,51:[1,155],52:[1,156],53:[1,157],54:[1,158],60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,32:W,45:71,46:G,50:V,56:[1,159],57:[1,160],58:[1,161],59:[1,162],60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,32:W,45:71,46:G,50:V,60:H,61:[1,163],62:[1,164],63:[1,165],64:[1,166],66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:[1,167],13:h,18:d,44:114,45:32,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:[1,168]},{10:[1,169]},{10:[1,170]},{10:[1,171]},{10:[1,172],13:h,18:d,44:114,45:32,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:[1,173],13:h,18:d,44:114,45:32,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:[1,174],13:h,18:d,44:114,45:32,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,32:W,37:[1,175],45:71,46:G,50:V,60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,31:176,32:W,45:71,46:G,50:V,60:H,66:62,67:z,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,32:W,39:[1,177],45:71,46:G,50:V,60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,32:W,41:[1,178],45:71,46:G,50:V,60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,32:W,43:[1,179],45:71,46:G,50:V,60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,32:W,37:[1,180],45:71,46:G,50:V,60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},e(nt,[2,28]),e(a,[2,23]),{6:10,7:11,8:o,9:u,10:c,11:l,13:h,18:d,23:16,25:17,26:18,27:19,28:20,29:21,30:f,32:[1,181],33:23,35:29,44:30,45:32,46:p,71:g,72:y,73:m,74:v,75:_,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},e(B,[2,37]),e(lt,[2,65]),e(lt,[2,64]),{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,32:W,45:71,46:G,50:V,60:H,65:[1,182],66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},e(lt,[2,67]),e(lt,[2,68]),e(lt,[2,69]),e(lt,[2,70]),e(lt,[2,71]),e(lt,[2,72]),e(lt,[2,73]),e(lt,[2,74]),e(lt,[2,75]),e(lt,[2,76]),e(lt,[2,77]),e(lt,[2,78]),{10:dt,46:ft,71:pt,79:183,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:At,91:xt},{10:dt,46:ft,71:pt,79:197,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:At,91:xt},{10:dt,46:ft,71:pt,79:198,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:At,91:xt},{10:dt,46:ft,71:pt,79:199,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:At,91:xt},{10:dt,46:ft,71:pt,79:200,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:At,91:xt},{10:dt,46:ft,71:pt,79:201,80:gt,81:yt,83:mt,84:184,86:185,87:vt,88:_t,89:bt,90:At,91:xt},{13:h,18:d,35:202,44:30,45:32,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},{13:h,18:d,35:203,44:30,45:32,46:p,67:[1,204],81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},e(nt,[2,43],{21:205,10:rt}),{10:L,12:P,13:N,15:R,16:j,17:Y,18:$,30:U,32:W,39:[1,206],45:71,46:G,50:V,60:H,66:125,70:74,71:q,72:X,73:Z,74:K,75:Q,77:64,78:J,81:b,83:tt,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S},e(nt,[2,49],{21:207,10:rt}),e(nt,[2,47],{21:208,10:rt}),e(nt,[2,51],{21:209,10:rt}),e(nt,[2,53],{21:210,10:rt}),e(B,[2,36]),e([10,13,18,46,81,85,87,88,90,91,93,94,95,96,97],[2,91]),e(et,[2,117],{85:wt}),e(kt,[2,122],{86:212,10:dt,46:ft,71:pt,80:gt,81:yt,83:mt,87:vt,88:_t,89:bt,90:At,91:xt}),e(Et,[2,124]),e(Et,[2,126]),e(Et,[2,127]),e(Et,[2,128]),e(Et,[2,129]),e(Et,[2,130]),e(Et,[2,131]),e(Et,[2,132]),e(Et,[2,133]),e(Et,[2,134]),e(Et,[2,135]),e(Et,[2,136]),e(et,[2,118],{85:wt}),e(et,[2,119],{85:wt}),e(et,[2,120],{85:wt}),e(et,[2,110],{85:wt}),e(et,[2,111],{85:wt}),e(et,[2,112],{45:32,44:114,13:h,18:d,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S}),e(et,[2,113],{45:32,44:114,10:[1,213],13:h,18:d,46:p,81:b,85:A,87:x,88:w,90:k,91:E,93:D,94:T,95:C,96:F,97:S}),e(et,[2,115],{10:[1,214]}),e(nt,[2,44]),{39:[1,215]},e(nt,[2,50]),e(nt,[2,48]),e(nt,[2,52]),e(nt,[2,54]),{10:dt,46:ft,71:pt,80:gt,81:yt,83:mt,84:216,86:185,87:vt,88:_t,89:bt,90:At,91:xt},e(Et,[2,125]),{67:[1,217]},{67:[1,218]},e(nt,[2,45],{21:219,10:rt}),e(kt,[2,123],{86:212,10:dt,46:ft,71:pt,80:gt,81:yt,83:mt,87:vt,88:_t,89:bt,90:At,91:xt}),e(et,[2,114]),e(et,[2,116]),e(nt,[2,46])],defaultActions:{},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=new Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,A,x,w,k,E,D,T=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},C={};;){if(b=n[n.length-1],this.defaultActions[b]?A=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=T()),A=a[b]&&a[b][v]),"undefined"==typeof A||!A.length||!A[0]){var F="";D=[];for(w in a[b])this.terminals_[w]&&w>l&&D.push("'"+this.terminals_[w]+"'");F=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(F,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(A[0]){case 1:n.push(v),r.push(f.yytext),i.push(f.yylloc),n.push(A[1]),v=null,_?(v=_,_=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[A[1]][1],C.$=r[r.length-k],C._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(C._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),x=this.performAction.apply(C,[s,u,o,p.yy,A[1],r,i].concat(d)),"undefined"!=typeof x)return x;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[A[1]][0]),r.push(C.$),i.push(C._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},Tt=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:break;case 1:this.begin("string");break;case 2:this.popState();break;case 3:return"STR";case 4:return 71;case 5:return 78;case 6:return 72;case 7:return 73;case 8:return 74;case 9:return 75;case 10:return 12;case 11:return 30;case 12:return 32;case 13:return 13;case 14:return 13;case 15:return 13;case 16:return 13;case 17:return 13;case 18:return 13;case 19:return 81;case 20:return 90;case 21:return 88;case 22:return 8;case 23:return 85;case 24:return 97;case 25:return 16;case 26:return 15;case 27:return 17;case 28:return 18;case 29:return 53;case 30:return 51;case 31:return 52;case 32:return 54;case 33:return 58;case 34:return 56;case 35:return 57;case 36:return 59;case 37:return 58;case 38:return 56;case 39:return 57;case 40:return 59;case 41:return 63;case 42:return 61;case 43:return 62;case 44:return 64;case 45:return 50;case 46:return 55;case 47:return 60;case 48:return 40;case 49:return 41;case 50:return 46;case 51:return 91;case 52:return 95;case 53:return 83;case 54:return 96;case 55:return 96;case 56:return 87;case 57:return 93;case 58:return 94;case 59:return 65;case 60:return 38;case 61:return 39;case 62:return 36;case 63:return 37;case 64:return 42;case 65:return 43;case 66:return 100;case 67:return 9;case 68:return 10;case 69:return 11}},rules:[/^(?:%%[^\n]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\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)/,/^(?:$)/], +conditions:{string:{rules:[2,3],inclusive:!1},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],inclusive:!0}}};return t}();return Dt.lexer=Tt,t.prototype=Dt,Dt.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:83,fs:1,path:82}],97:[function(t,e,n){(function(e){"use strict";var r=t("moment"),i=t("../../logger"),a=new i.Log,s="",o="",u=[],c=[],l="";n.clear=function(){u=[],c=[],l="",o="",g=0,h=void 0,d=void 0,_=[]},n.setDateFormat=function(t){s=t},n.getDateFormat=function(){return s},n.setTitle=function(t){o=t},n.getTitle=function(){return o},n.addSection=function(t){l=t,u.push(t)},n.getTasks=function(){for(var t=A(),e=10,n=0;!t&&e>n;)t=A(),n++;return c=_};var h,d,f=function(t,e,i){i=i.trim();var s=/^after\s+([\d\w\-]+)/,o=s.exec(i.trim());if(null!==o){var u=n.findTaskById(o[1]);if("undefined"==typeof u){var c=new Date;return c.setHours(0,0,0,0),c}return u.endTime}return r(i,e.trim(),!0).isValid()?r(i,e.trim(),!0).toDate():(a.debug("Invalid date:"+i),a.debug("With date format:"+e.trim()),new Date)},p=function(t,e,n){if(n=n.trim(),r(n,e.trim(),!0).isValid())return r(n,e.trim()).toDate();var i=r(t),a=/^([\d]+)([wdhms])/,s=a.exec(n.trim());if(null!==s){switch(s[2]){case"s":i.add(s[1],"seconds");break;case"m":i.add(s[1],"minutes");break;case"h":i.add(s[1],"hours");break;case"d":i.add(s[1],"days");break;case"w":i.add(s[1],"weeks")}return i.toDate()}return i.toDate()},g=0,y=function(t){return"undefined"==typeof t?(g+=1,"task"+g):t},m=function(t,e){var r;r=":"===e.substr(0,1)?e.substr(1,e.length):e;for(var i=r.split(","),a={},s=n.getDateFormat(),o=!0;o;)o=!1,i[0].match(/^\s*active\s*$/)&&(a.active=!0,i.shift(1),o=!0),i[0].match(/^\s*done\s*$/)&&(a.done=!0,i.shift(1),o=!0),i[0].match(/^\s*crit\s*$/)&&(a.crit=!0,i.shift(1),o=!0);var u;for(u=0;un-e?n+i+1.5*s.sidePadding>o?e+r-5:n+r+5:(n-e)/2+e+r}).attr("y",function(t,r){return r*e+s.barHeight/2+(s.fontSize/2-2)+n}).attr("text-height",i).attr("class",function(t){for(var e=x(t.startTime),n=x(t.endTime),r=this.getBBox().width,i=0,a=0;an-e?n+r+1.5*s.sidePadding>o?"taskTextOutsideLeft taskTextOutside"+i+" "+u:"taskTextOutsideRight taskTextOutside"+i+" "+u:"taskText taskText"+i+" "+u})}function l(t,e,n,a){var o,u=[[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["h1 %I:%M",function(t){return t.getMinutes()}]],c=[["%Y",function(){return!0}]],l=[["%I:%M",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}]];"undefined"!=typeof s.axisFormatter&&(l=[],s.axisFormatter.forEach(function(t){var e=[];e[0]=t[0],e[1]=t[1],l.push(e)})),o=u.concat(l).concat(c);var h=i.svg.axis().scale(x).orient("bottom").tickSize(-a+e+s.gridLineStartPadding,0,0).tickFormat(i.time.format.multi(o));r>7&&230>r&&(h=h.ticks(i.time.monday.range)),_.append("g").attr("class","grid").attr("transform","translate("+t+", "+(a-50)+")").call(h).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em")}function h(t,e){for(var n=[],r=0,i=0;i0))return i[1]*t/2+e;for(var s=0;a>s;s++)return r+=n[a-1][1],i[1]*t/2+r*t+e}).attr("class",function(t){for(var e=0;er;++r)e.hasOwnProperty(t[r])||(e[t[r]]=!0,n.push(t[r]));return n}function p(t){for(var e=t.length,n={};e;)n[t[--e]]=(n[t[e]]||0)+1;return n}function g(t,e){return p(e)[t]||0}n.yy.clear(),n.parse(t);var y=document.getElementById(e);o=y.parentElement.offsetWidth,"undefined"==typeof o&&(o=1200),"undefined"!=typeof s.useWidth&&(o=s.useWidth);var m=n.yy.getTasks(),v=m.length*(s.barHeight+s.barGap)+2*s.topPadding;y.setAttribute("height","100%"),y.setAttribute("viewBox","0 0 "+o+" "+v);var _=i.select("#"+e),b=i.min(m,function(t){return t.startTime}),A=i.max(m,function(t){return t.endTime}),x=i.time.scale().domain([i.min(m,function(t){return t.startTime}),i.max(m,function(t){return t.endTime})]).rangeRound([0,o-150]),w=[];r=a.duration(A-b).asDays();for(var k=0;kl&&D.push("'"+this.terminals_[w]+"'");F=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(F,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(A[0]){case 1:n.push(v),r.push(f.yytext),i.push(f.yylloc),n.push(A[1]),v=null,_?(v=_,_=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[A[1]][1],C.$=r[r.length-k],C._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(C._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),x=this.performAction.apply(C,[s,u,o,p.yy,A[1],r,i].concat(d)),"undefined"!=typeof x)return x;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[A[1]][0]),r.push(C.$),i.push(C._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},u=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 10;case 1:break;case 2:break;case 3:break;case 4:return 4;case 5:return 11;case 6:return"date";case 7:return 12;case 8:return 13;case 9:return 14;case 10:return 15;case 11:return":";case 12:return 6;case 13:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\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],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return t}();return o.lexer=u,t.prototype=o,o.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:83,fs:1,path:82}],100:[function(t,e,n){(function(r){"use strict";var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,2],r=[1,3],i=[1,4],a=[2,4],s=[1,9],o=[1,11],u=[1,12],c=[1,14],l=[1,15],h=[1,17],d=[1,18],f=[1,19],p=[1,20],g=[1,22],y=[1,23],m=[1,4,5,10,15,16,18,20,21,22,23,24,25,37],v=[4,5,10,15,16,18,20,21,22,23,25,37],_=[35,36,37],b=[1,67],A={trace:function(){},yy:{},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,text:19,loop:20,end:21,opt:22,alt:23,"else":24,note:25,placement:26,text2:27,over:28,actor_pair:29,spaceList:30,",":31,left_of:32,right_of:33,signaltype:34,"+":35,"-":36,ACTOR:37,SOLID_OPEN_ARROW:38,DOTTED_OPEN_ARROW:39,SOLID_ARROW:40,DOTTED_ARROW:41,SOLID_CROSS:42,DOTTED_CROSS:43,TXT:44,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",10:"participant",12:"AS",13:"restOfLine",15:"activate",16:"deactivate",18:"title",19:"text",20:"loop",21:"end",22:"opt",23:"alt",24:"else",25:"note",28:"over",31:",",32:"left_of",33:"right_of",35:"+",36:"-",37:"ACTOR",38:"SOLID_OPEN_ARROW",39:"DOTTED_OPEN_ARROW",40:"SOLID_ARROW",41:"DOTTED_ARROW",42:"SOLID_CROSS",43:"DOTTED_CROSS",44:"TXT"},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,4],[9,4],[9,4],[9,7],[17,4],[17,4],[30,2],[30,1],[29,3],[29,1],[26,1],[26,1],[14,5],[14,5],[14,4],[11,1],[34,1],[34,1],[34,1],[34,1],[34,1],[34,1],[27,1]],performAction:function(t,e,n,r,i,a){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:this.$=[];break;case 5:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:this.$=a[s];break;case 8:this.$=[];break;case 9:a[s-3].description=a[s-1],this.$=a[s-3];break;case 10:this.$=a[s-1];break;case 12:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1]};break;case 13:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1]};break;case 16:a[s-1].unshift({type:"loopStart",loopText:a[s-2],signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:"loopEnd",loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 17:a[s-1].unshift({type:"optStart",optText:a[s-2],signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:"optEnd",optText:a[s-2],signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 18:a[s-4].unshift({type:"altStart",altText:a[s-5],signalType:r.LINETYPE.ALT_START}),a[s-4].push({type:"else",altText:a[s-2],signalType:r.LINETYPE.ALT_ELSE}),a[s-4]=a[s-4].concat(a[s-1]),a[s-4].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=a[s-4];break;case 19:this.$=[a[s-1],{type:"addNote",placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 20:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 23:this.$=[a[s-2],a[s]];break;case 24:this.$=a[s];break;case 25:this.$=r.PLACEMENT.LEFTOF;break;case 26:this.$=r.PLACEMENT.RIGHTOF;break;case 27:this.$=[a[s-4],a[s-1],{type:"addMessage",from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1]}];break;case 28:this.$=[a[s-4],a[s-1],{type:"addMessage",from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4]}];break;case 29:this.$=[a[s-3],a[s-1],{type:"addMessage",from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 30:this.$={type:"addActor",actor:a[s]};break;case 31:this.$=r.LINETYPE.SOLID_OPEN;break;case 32:this.$=r.LINETYPE.DOTTED_OPEN;break;case 33:this.$=r.LINETYPE.SOLID;break;case 34:this.$=r.LINETYPE.DOTTED;break;case 35:this.$=r.LINETYPE.SOLID_CROSS;break;case 36:this.$=r.LINETYPE.DOTTED_CROSS;break;case 37:this.$=a[s].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},e([1,4,5,10,15,16,18,20,22,23,25,37],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:s,5:o,8:8,9:10,10:u,11:21,14:13,15:c,16:l,17:16,18:h,20:d,22:f,23:p,25:g,37:y},e(m,[2,5]),{9:24,10:u,11:21,14:13,15:c,16:l,17:16,18:h,20:d,22:f,23:p,25:g,37:y},e(m,[2,7]),e(m,[2,8]),{11:25,37:y},{5:[1,26]},{11:27,37:y},{11:28,37:y},{5:[1,29]},{4:[1,30]},{13:[1,31]},{13:[1,32]},{13:[1,33]},{34:34,38:[1,35],39:[1,36],40:[1,37],41:[1,38],42:[1,39],43:[1,40]},{26:41,28:[1,42],32:[1,43],33:[1,44]},e([5,12,31,38,39,40,41,42,43,44],[2,30]),e(m,[2,6]),{5:[1,46],12:[1,45]},e(m,[2,11]),{5:[1,47]},{5:[1,48]},e(m,[2,14]),{19:[1,49]},e(v,a,{7:50}),e(v,a,{7:51}),e([4,5,10,15,16,18,20,22,23,24,25,37],a,{7:52}),{11:55,35:[1,53],36:[1,54],37:y},e(_,[2,31]),e(_,[2,32]),e(_,[2,33]),e(_,[2,34]),e(_,[2,35]),e(_,[2,36]),{11:56,37:y},{11:58,29:57,37:y},{37:[2,25]},{37:[2,26]},{13:[1,59]},e(m,[2,10]),e(m,[2,12]),e(m,[2,13]),{5:[1,60]},{4:s,5:o,8:8,9:10,10:u,11:21,14:13,15:c,16:l,17:16,18:h,20:d,21:[1,61],22:f,23:p,25:g,37:y},{4:s,5:o,8:8,9:10,10:u,11:21,14:13,15:c,16:l,17:16,18:h,20:d,21:[1,62],22:f,23:p,25:g,37:y},{4:s,5:o,8:8,9:10,10:u,11:21,14:13,15:c,16:l,17:16,18:h,20:d,22:f,23:p,24:[1,63],25:g,37:y},{11:64,37:y},{11:65,37:y},{27:66,44:b},{27:68,44:b},{27:69,44:b},{31:[1,70],44:[2,24]},{5:[1,71]},e(m,[2,15]),e(m,[2,16]),e(m,[2,17]),{13:[1,72]},{27:73,44:b},{27:74,44:b},{5:[2,29]},{5:[2,37]},{5:[2,19]},{5:[2,20]},{11:75,37:y},e(m,[2,9]),e(v,a,{7:76}),{5:[2,27]},{5:[2,28]},{44:[2,23]},{4:s,5:o,8:8,9:10,10:u,11:21,14:13,15:c,16:l,17:16,18:h,20:d,21:[1,77],22:f,23:p,25:g,37:y},e(m,[2,18])],defaultActions:{5:[2,1],6:[2,2],43:[2,25],44:[2,26],66:[2,29],67:[2,37],68:[2,19],69:[2,20],73:[2,27],74:[2,28],75:[2,23]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],a=this.table,s="",o=0,u=0,c=0,l=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;i.push(y);var m=f.options&&f.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,_,b,A,x,w,k,E,D,T=function(){var t;return t=f.lex()||h,"number"!=typeof t&&(t=e.symbols_[t]||t),t},C={};;){if(b=n[n.length-1],this.defaultActions[b]?A=this.defaultActions[b]:((null===v||"undefined"==typeof v)&&(v=T()),A=a[b]&&a[b][v]),"undefined"==typeof A||!A.length||!A[0]){var F="";D=[];for(w in a[b])this.terminals_[w]&&w>l&&D.push("'"+this.terminals_[w]+"'");F=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(F,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:y,expected:D})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v);switch(A[0]){case 1:n.push(v),r.push(f.yytext),i.push(f.yylloc),n.push(A[1]),v=null,_?(v=_,_=null):(u=f.yyleng,s=f.yytext,o=f.yylineno,y=f.yylloc,c>0&&c--);break;case 2:if(k=this.productions_[A[1]][1],C.$=r[r.length-k],C._$={first_line:i[i.length-(k||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(k||1)].first_column,last_column:i[i.length-1].last_column},m&&(C._$.range=[i[i.length-(k||1)].range[0],i[i.length-1].range[1]]),x=this.performAction.apply(C,[s,u,o,p.yy,A[1],r,i].concat(d)),"undefined"!=typeof x)return x;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),i=i.slice(0,-1*k)),n.push(this.productions_[A[1]][0]),r.push(C.$),i.push(C._$),E=a[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},x=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:return this.begin("ID"),10;case 6:return this.begin("ALIAS"),37;case 7:return this.popState(),this.popState(),this.begin("LINE"),12;case 8:return this.popState(),this.popState(), +5;case 9:return this.begin("LINE"),20;case 10:return this.begin("LINE"),22;case 11:return this.begin("LINE"),23;case 12:return this.begin("LINE"),24;case 13:return this.popState(),13;case 14:return 21;case 15:return 32;case 16:return 33;case 17:return 28;case 18:return 25;case 19:return this.begin("ID"),15;case 20:return this.begin("ID"),16;case 21:return 18;case 22:return 6;case 23:return 31;case 24:return 5;case 25:return e.yytext=e.yytext.trim(),37;case 26:return 40;case 27:return 41;case 28:return 38;case 29:return 39;case 30:return 42;case 31:return 43;case 32:return 44;case 33:return 35;case 34:return 36;case 35:return 5;case 36:return"INVALID"}},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,/^(?:[^#\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],conditions:{LINE:{rules:[2,3,13],inclusive:!1},ALIAS:{rules:[2,3,7,8],inclusive:!1},ID:{rules:[2,3,6],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],inclusive:!0}}};return t}();return A.lexer=x,t.prototype=A,A.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("_process"))},{_process:83,fs:1,path:82}],101:[function(t,e,n){(function(e){"use strict";var r={},i=[],a=[],s=t("../../logger"),o=new s.Log;n.addActor=function(t,e,n){var i=r[t];i&&e===i.name&&null==n||(null==n&&(n=e),r[t]={name:e,description:n})},n.addMessage=function(t,e,n,r){i.push({from:t,to:e,message:n,answer:r})},n.addSignal=function(t,e,n,r){o.debug("Adding message from="+t+" to="+e+" message="+n+" type="+r),i.push({from:t,to:e,message:n,type:r})},n.getMessages=function(){return i},n.getActors=function(){return r},n.getActor=function(t){return r[t]},n.getActorKeys=function(){return Object.keys(r)},n.clear=function(){r={},i=[]},n.LINETYPE={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18},n.ARROWTYPE={FILLED:0,OPEN:1},n.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2},n.addNote=function(t,e,r){var s={actor:t,placement:e,message:r},o=[].concat(t,t);a.push(s),i.push({from:o[0],to:o[1],message:r,type:n.LINETYPE.NOTE,placement:e})},n.parseError=function(t,n){e.mermaidAPI.parseError(t,n)},n.apply=function(t){if(t instanceof Array)t.forEach(function(t){n.apply(t)});else switch(t.type){case"addActor":n.addActor(t.actor,t.actor,t.description);break;case"activeStart":n.addSignal(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":n.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":n.addNote(t.actor,t.placement,t.text);break;case"addMessage":n.addSignal(t.from,t.to,t.msg,t.signalType);break;case"loopStart":n.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":n.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":n.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":n.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":n.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":n.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":n.addSignal(void 0,void 0,void 0,t.signalType)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../logger":104}],102:[function(t,e,n){"use strict";var r=t("./parser/sequenceDiagram").parser;r.yy=t("./sequenceDb");var i=t("./svgDraw"),a=t("../../d3"),s=t("../../logger"),o=new s.Log,u={diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!1,bottomMarginAdj:1,activationWidth:10};n.bounds={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],init:function(){this.sequenceItems=[],this.activations=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,n,r){t[e]="undefined"==typeof t[e]?n:r(n,t[e])},updateBounds:function(t,e,r,i){function a(a){return function(c){o++;var l=s.sequenceItems.length-o+1;s.updateVal(c,"starty",e-l*u.boxMargin,Math.min),s.updateVal(c,"stopy",i+l*u.boxMargin,Math.max),s.updateVal(n.bounds.data,"startx",t-l*u.boxMargin,Math.min),s.updateVal(n.bounds.data,"stopx",r+l*u.boxMargin,Math.max),"activation"!=a&&(s.updateVal(c,"startx",t-l*u.boxMargin,Math.min),s.updateVal(c,"stopx",r+l*u.boxMargin,Math.max),s.updateVal(n.bounds.data,"starty",e-l*u.boxMargin,Math.min),s.updateVal(n.bounds.data,"stopy",i+l*u.boxMargin,Math.max))}}var s=this,o=0;this.sequenceItems.forEach(a()),this.activations.forEach(a("activation"))},insert:function(t,e,r,i){var a,s,o,u;a=Math.min(t,r),o=Math.max(t,r),s=Math.min(e,i),u=Math.max(e,i),this.updateVal(n.bounds.data,"startx",a,Math.min),this.updateVal(n.bounds.data,"starty",s,Math.min),this.updateVal(n.bounds.data,"stopx",o,Math.max),this.updateVal(n.bounds.data,"stopy",u,Math.max),this.updateBounds(a,s,o,u)},newActivation:function(t,e){var n=r.yy.getActors()[t.from.actor],a=h(t.from.actor).length,s=n.x+u.width/2+(a-1)*u.activationWidth/2;this.activations.push({startx:s,starty:this.verticalPos+2,stopx:s+u.activationWidth,stopy:void 0,actor:t.from.actor,anchored:i.anchorElement(e)})},endActivation:function(t){var e=this.activations.map(function(t){return t.actor}).lastIndexOf(t.from.actor),n=this.activations.splice(e,1)[0];return n},newLoop:function(t){this.sequenceItems.push({startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t})},endLoop:function(){var t=this.sequenceItems.pop();return t},addElseToLoop:function(t){var e=this.sequenceItems.pop();e.elsey=n.bounds.getVerticalPos(),e.elseText=t,this.sequenceItems.push(e)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}};var c=function(t,e,r,a,s){var o=i.getNoteRect();o.x=e,o.y=r,o.width=s||u.width,o["class"]="note";var c=t.append("g"),l=i.drawRect(c,o),h=i.getTextObj();h.x=e-4,h.y=r-13,h.textMargin=u.noteMargin,h.dy="1em",h.text=a.message,h["class"]="noteText";var d=i.drawText(c,h,o.width-u.noteMargin),f=d[0][0].getBBox().height;!s&&f>u.width?(d.remove(),c=t.append("g"),d=i.drawText(c,h,2*o.width-u.noteMargin),f=d[0][0].getBBox().height,l.attr("width",2*o.width),n.bounds.insert(e,r,e+2*o.width,r+2*u.noteMargin+f)):n.bounds.insert(e,r,e+o.width,r+2*u.noteMargin+f),l.attr("height",f+2*u.noteMargin),n.bounds.bumpVerticalPos(f+2*u.noteMargin)},l=function(t,e,i,a,s){var o,c=t.append("g"),l=e+(i-e)/2,h=c.append("text").attr("x",l).attr("y",a-7).style("text-anchor","middle").attr("class","messageText").text(s.message);o="undefined"!=typeof h[0][0].getBBox?h[0][0].getBBox().width:h[0][0].getBoundingClientRect();var d;if(e===i){d=c.append("path").attr("d","M "+e+","+a+" C "+(e+60)+","+(a-10)+" "+(e+60)+","+(a+30)+" "+e+","+(a+20)),n.bounds.bumpVerticalPos(30);var f=Math.max(o/2,100);n.bounds.insert(e-f,n.bounds.getVerticalPos()-10,i+f,n.bounds.getVerticalPos())}else d=c.append("line"),d.attr("x1",e),d.attr("y1",a),d.attr("x2",i),d.attr("y2",a),n.bounds.insert(e,n.bounds.getVerticalPos()-10,i,n.bounds.getVerticalPos());s.type===r.yy.LINETYPE.DOTTED||s.type===r.yy.LINETYPE.DOTTED_CROSS||s.type===r.yy.LINETYPE.DOTTED_OPEN?(d.style("stroke-dasharray","3, 3"),d.attr("class","messageLine1")):d.attr("class","messageLine0");var p="";u.arrowMarkerAbsolute&&(p=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,p=p.replace(/\(/g,"\\("),p=p.replace(/\)/g,"\\)")),d.attr("stroke-width",2),d.attr("stroke","black"),d.style("fill","none"),(s.type===r.yy.LINETYPE.SOLID||s.type===r.yy.LINETYPE.DOTTED)&&d.attr("marker-end","url("+p+"#arrowhead)"),(s.type===r.yy.LINETYPE.SOLID_CROSS||s.type===r.yy.LINETYPE.DOTTED_CROSS)&&d.attr("marker-end","url("+p+"#crosshead)")};e.exports.drawActors=function(t,e,r,a){var s;for(s=0;se&&(r.starty=e-6,e+=12),i.drawActivation(y,r,e,u),n.bounds.insert(r.startx,e-10,r.stopx,e)}r.yy.clear(),r.parse(t+"\n"),n.bounds.init();var f,p,g,y=a.select("#"+s),m=r.yy.getActors(),v=r.yy.getActorKeys(),_=r.yy.getMessages();e.exports.drawActors(y,m,v,0),i.insertArrowHead(y),i.insertArrowCrossHead(y);var b;_.forEach(function(t){var e;switch(t.type){case r.yy.LINETYPE.NOTE:n.bounds.bumpVerticalPos(u.boxMargin),f=m[t.from].x,p=m[t.to].x,t.placement===r.yy.PLACEMENT.RIGHTOF?c(y,f+(u.width+u.actorMargin)/2,n.bounds.getVerticalPos(),t):t.placement===r.yy.PLACEMENT.LEFTOF?c(y,f-(u.width+u.actorMargin)/2,n.bounds.getVerticalPos(),t):t.to===t.from?c(y,f,n.bounds.getVerticalPos(),t):(g=Math.abs(f-p)+u.actorMargin,c(y,(f+p+u.width-g)/2,n.bounds.getVerticalPos(),t,g));break;case r.yy.LINETYPE.ACTIVE_START:n.bounds.newActivation(t,y);break;case r.yy.LINETYPE.ACTIVE_END:h(t,n.bounds.getVerticalPos());break;case r.yy.LINETYPE.LOOP_START:n.bounds.bumpVerticalPos(u.boxMargin),n.bounds.newLoop(t.message),n.bounds.bumpVerticalPos(u.boxMargin+u.boxTextMargin);break;case r.yy.LINETYPE.LOOP_END:e=n.bounds.endLoop(),i.drawLoop(y,e,"loop",u),n.bounds.bumpVerticalPos(u.boxMargin);break;case r.yy.LINETYPE.OPT_START:n.bounds.bumpVerticalPos(u.boxMargin),n.bounds.newLoop(t.message),n.bounds.bumpVerticalPos(u.boxMargin+u.boxTextMargin);break;case r.yy.LINETYPE.OPT_END:e=n.bounds.endLoop(),i.drawLoop(y,e,"opt",u),n.bounds.bumpVerticalPos(u.boxMargin);break;case r.yy.LINETYPE.ALT_START:n.bounds.bumpVerticalPos(u.boxMargin),n.bounds.newLoop(t.message),n.bounds.bumpVerticalPos(u.boxMargin+u.boxTextMargin);break;case r.yy.LINETYPE.ALT_ELSE:n.bounds.bumpVerticalPos(u.boxMargin),e=n.bounds.addElseToLoop(t.message),n.bounds.bumpVerticalPos(u.boxMargin);break;case r.yy.LINETYPE.ALT_END:e=n.bounds.endLoop(),i.drawLoop(y,e,"alt",u),n.bounds.bumpVerticalPos(u.boxMargin);break;default:try{b=t,n.bounds.bumpVerticalPos(u.messageMargin);var a=d(t.from),s=d(t.to),o=a[0]<=s[0]?1:0,v=a[0]/gi," "),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.attr("fill",e.fill),"undefined"!=typeof e["class"]&&i.attr("class",e["class"]);var a=i.append("tspan");return a.attr("x",e.x+2*e.textMargin),a.text(r),"undefined"!=typeof i.textwrap&&i.textwrap({x:e.x,y:e.y,width:n,height:1800},e.textMargin),i},n.drawLabel=function(t,e){var r=n.getNoteRect();r.x=e.x,r.y=e.y,r.width=50,r.height=20,r.fill="#526e52",r.stroke="none",r["class"]="labelBox",n.drawRect(t,r),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,e.fill="white",n.drawText(t,e)};var r=-1;n.drawActor=function(t,e,i,a,s){var o=e+s.width/2,u=t.append("g");0===i&&(r++,u.append("line").attr("id","actor"+r).attr("x1",o).attr("y1",5).attr("x2",o).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"));var c=n.getNoteRect();c.x=e,c.y=i,c.fill="#eaeaea",c.width=s.width,c.height=s.height,c["class"]="actor",c.rx=3,c.ry=3,n.drawRect(u,c),u.append("text").attr("x",o).attr("y",i+s.height/2+5).attr("class","actor").style("text-anchor","middle").text(a)},n.anchorElement=function(t){return t.append("g")},n.drawActivation=function(t,e,r){var i=n.getNoteRect(),a=e.anchored;i.x=e.startx,i.y=e.starty,i.fill="#f4f4f4",i.width=e.stopx-e.startx,i.height=r-e.starty,n.drawRect(a,i)},n.drawLoop=function(t,e,r,i){var a=t.append("g"),s=function(t,e,n,r){a.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",r).attr("stroke-width",2).attr("stroke","#526e52").attr("class","loopLine")};s(e.startx,e.starty,e.stopx,e.starty),s(e.stopx,e.starty,e.stopx,e.stopy),s(e.startx,e.stopy,e.stopx,e.stopy),s(e.startx,e.starty,e.startx,e.stopy),"undefined"!=typeof e.elsey&&s(e.startx,e.elsey,e.stopx,e.elsey);var o=n.getTextObj();o.text=r,o.x=e.startx,o.y=e.starty,o.labelMargin=15,o["class"]="labelText",o.fill="white",n.drawLabel(a,o),o=n.getTextObj(),o.text="[ "+e.title+" ]",o.x=e.startx+(e.stopx-e.startx)/2,o.y=e.starty+1.5*i.boxMargin,o.anchor="middle",o["class"]="loopText",n.drawText(a,o),"undefined"!=typeof e.elseText&&(o.text="[ "+e.elseText+" ]",o.y=e.elsey+1.5*i.boxMargin,n.drawText(a,o))},n.insertArrowHead=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},n.insertArrowCrossHead=function(t){var e=t.append("defs"),n=e.append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.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"),n.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")},n.getTextObj=function(){var t={x:0,y:0,fill:"black","text-anchor":"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0};return t},n.getNoteRect=function(){var t={x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0};return t}},{}],104:[function(t,e,n){"use strict";function r(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getSeconds(),i=t.getMilliseconds();10>e&&(e="0"+e),10>n&&(n="0"+n),10>r&&(r="0"+r),100>i&&(i="0"+i),10>i&&(i="00"+i);var a=e+":"+n+":"+r+" ("+i+")";return a}function i(t){this.level=t,this.log=function(t,e){var n=this.level;return"undefined"==typeof n&&(n=s),e>=n&&"undefined"!=typeof console&&"undefined"!=typeof console.log?console.log("["+r(new Date)+"] "+t):void 0},this.trace=function(t){this.log(t,a.trace)},this.debug=function(t){this.log(t,a.debug)},this.info=function(t){this.log(t,a.info)},this.warn=function(t){this.log(t,a.warn)},this.error=function(t){this.log(t,a.error)}}var a={debug:1,info:2,warn:3,error:4,fatal:5,"default":5},s=a.error;n.setLogLevel=function(t){s=t},n.Log=i},{}],105:[function(t,e,n){(function(e){"use strict";var r=t("./logger"),i=new r.Log,a=t("./diagrams/flowchart/graphDb"),s=t("./utils"),o=t("./diagrams/flowchart/flowRenderer"),u=t("./diagrams/sequenceDiagram/sequenceRenderer"),c=t("./diagrams/example/exampleRenderer"),l=t("./diagrams/example/parser/example"),h=t("./diagrams/flowchart/parser/flow"),d=t("./diagrams/flowchart/parser/dot"),f=t("./diagrams/sequenceDiagram/parser/sequenceDiagram"),p=t("./diagrams/sequenceDiagram/sequenceDb"),g=t("./diagrams/example/exampleDb"),y=t("./diagrams/gantt/ganttRenderer"),m=t("./diagrams/gantt/parser/gantt"),v=t("./diagrams/gantt/ganttDb"),_=t("./diagrams/classDiagram/parser/classDiagram"),b=t("./diagrams/classDiagram/classRenderer"),A=t("./diagrams/classDiagram/classDb"),x=t("./d3");SVGElement.prototype.getTransformToElement=SVGElement.prototype.getTransformToElement||function(t){return t.getScreenCTM().inverse().multiply(this.getScreenCTM())};var w={logLevel:5,cloneCssStyles:!0,startOnLoad:!0,arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequenceDiagram:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,sidePadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:3,axisFormatter:[["%I:%M",function(t){return t.getHours()}],["w. %U",function(t){return 1==t.getDay()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%m-%y",function(t){return t.getMonth()}]]},classDiagram:{},info:{}};r.setLogLevel(w.logLevel);var k=function(t){var e,n=s.detectType(t);switch(n){case"graph":e=h,e.parser.yy=a;break;case"dotGraph":e=d,e.parser.yy=a;break;case"sequenceDiagram":e=f,e.parser.yy=p;break;case"info":e=l,e.parser.yy=g;break;case"gantt":e=m,e.parser.yy=v;break;case"classDiagram":e=_,e.parser.yy=A}try{return e.parse(t),!0}catch(r){return!1}};n.parse=k,n.version=function(){return t("../package.json").version},n.encodeEntities=function(t){var e=t;return e=e.replace(/style.*:\S*#.*;/g,function(t){var e=t.substring(0,t.length-1);return e}),e=e.replace(/classDef.*:\S*#.*;/g,function(t){var e=t.substring(0,t.length-1);return e}),e=e.replace(/#\w+\;/g,function(t){var e=t.substring(1,t.length-1),n=/^\+?\d+$/.test(e);return n?"fl°°"+e+"¶ß":"fl°"+e+"¶ß"})},n.decodeEntities=function(t){var e=t;return e=e.replace(/\fl\°\°/g,function(){return"&#"}),e=e.replace(/\fl\°/g,function(){return"&"}),e=e.replace(/¶ß/g,function(){return";"})};var E=function(t,e,r,l){"undefined"!=typeof l?x.select(l).append("div").attr("id","d"+t).append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg").append("g"):x.select("body").append("div").attr("id","d"+t).append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg").append("g"),window.txt=e,e=n.encodeEntities(e);var h=x.select("#d"+t).node(),d=s.detectType(e),f={};switch(d){case"graph":w.flowchart.arrowMarkerAbsolute=w.arrowMarkerAbsolute,o.setConf(w.flowchart),o.draw(e,t,!1),w.cloneCssStyles&&(f=o.getClasses(e,!1),s.cloneCssStyles(h.firstChild,f));break;case"dotGraph":w.flowchart.arrowMarkerAbsolute=w.arrowMarkerAbsolute,o.setConf(w.flowchart),o.draw(e,t,!0),w.cloneCssStyles&&(f=o.getClasses(e,!0),s.cloneCssStyles(h.firstChild,f));break;case"sequenceDiagram":w.sequenceDiagram.arrowMarkerAbsolute=w.arrowMarkerAbsolute,u.setConf(w.sequenceDiagram),u.draw(e,t),w.cloneCssStyles&&s.cloneCssStyles(h.firstChild,[]);break;case"gantt":w.gantt.arrowMarkerAbsolute=w.arrowMarkerAbsolute,y.setConf(w.gantt),y.draw(e,t),w.cloneCssStyles&&s.cloneCssStyles(h.firstChild,[]);break;case"classDiagram":w.classDiagram.arrowMarkerAbsolute=w.arrowMarkerAbsolute,b.setConf(w.classDiagram),b.draw(e,t),w.cloneCssStyles&&s.cloneCssStyles(h.firstChild,[]);break;case"info":w.info.arrowMarkerAbsolute=w.arrowMarkerAbsolute,c.draw(e,t,n.version()),w.cloneCssStyles&&s.cloneCssStyles(h.firstChild,[])}x.select("#d"+t).selectAll("foreignobject div").attr("xmlns","http://www.w3.org/1999/xhtml");var p="";w.arrowMarkerAbsolute&&(p=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,p=p.replace(/\(/g,"\\("),p=p.replace(/\)/g,"\\)"));var g=x.select("#d"+t).node().innerHTML.replace(/url\(#arrowhead/g,"url("+p+"#arrowhead","g");g=n.decodeEntities(g),"undefined"!=typeof r?r(g,a.bindFunctions):i.warn("CB = undefined!");var m=x.select("#d"+t).node();return null!==m&&"function"==typeof m.remove&&x.select("#d"+t).node().remove(),g};n.render=function(t,e,n,r){try{if(1===arguments.length&&(e=t,t="mermaidId0"),"undefined"!=typeof document)return E(t,e,n,r)}catch(a){i.warn(a)}};var D=function(t){var e,n=Object.keys(t);for(e=0;e0&&(r+=n.selectorText+" { "+n.style.cssText+"}\n")}}catch(l){"undefined"!=typeof n&&i.warn('Invalid CSS selector "'+n.selectorText+'"',l)}var h="",d="";for(var f in e)e.hasOwnProperty(f)&&"undefined"!=typeof f&&("default"===f?(e["default"].styles instanceof Array&&(h+="#"+t.id.trim()+" .node>rect { "+e[f].styles.join("; ")+"; }\n"),e["default"].nodeLabelStyles instanceof Array&&(h+="#"+t.id.trim()+" .node text { "+e[f].nodeLabelStyles.join("; ")+"; }\n"),e["default"].edgeLabelStyles instanceof Array&&(h+="#"+t.id.trim()+" .edgeLabel text { "+e[f].edgeLabelStyles.join("; ")+"; }\n"),e["default"].clusterStyles instanceof Array&&(h+="#"+t.id.trim()+" .cluster rect { "+e[f].clusterStyles.join("; ")+"; }\n")):e[f].styles instanceof Array&&(d+="#"+t.id.trim()+" ."+f+">rect, ."+f+">polygon, ."+f+">ellipse { "+e[f].styles.join("; ")+"; }\n"));if(""!==r||""!==h||""!==d){var p=document.createElement("style");p.setAttribute("type","text/css"),p.setAttribute("title","mermaid-svg-internal-css"),p.innerHTML="/* */\n",t.insertBefore(p,t.firstChild)}};n.cloneCssStyles=s},{"./logger":104}]},{},[105])(105)}); \ No newline at end of file diff --git a/lib/cli.js b/lib/cli.js index 8d9e7b75c..ed037a589 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -6,7 +6,7 @@ var fs = require('fs') , semver = require('semver') , path = require('path') -var PHANTOM_VERSION = "^1.9.0" +var PHANTOM_VERSION = "^2.1.0" var info = chalk.blue.bold , note = chalk.green.bold diff --git a/lib/index.js b/lib/index.js index 8e3a31073..a7dd65e70 100644 --- a/lib/index.js +++ b/lib/index.js @@ -25,13 +25,10 @@ function processMermaid(files, _options, _next) { , options.width ]; - files.forEach(function(file) { phantomArgs.push(file) }) - console.log('phantomArgs'); - console.log(JSON.stringify(phantomArgs)); - // + mkdirp(outputDir, function(err) { if (err) { throw err diff --git a/lib/phantomscript.js b/lib/phantomscript.js index e279149ee..b2a75f706 100644 --- a/lib/phantomscript.js +++ b/lib/phantomscript.js @@ -29,32 +29,27 @@ var system = require('system') , webpage = require('webpage') -console.log('phantom.args'); -console.log(phantom.args.length); -console.log(JSON.stringify(phantom.args)); - var page = webpage.create() - , files = phantom.args.slice(8, phantom.args.length) - , width = phantom.args[7] + , files = system.args.slice(9, system.args.length) + , width = system.args[8] -if(typeof width === 'undefined'){ +if(typeof width === 'undefined' || width==='undefined'){ width = 1200; } - var options = { - outputDir: phantom.args[0] - , png: phantom.args[1] === 'true' ? true : false - , svg: phantom.args[2] === 'true' ? true : false - , css: phantom.args[3] !== '' ? phantom.args[3] : '* { margin: 0; padding: 0; }' - , sequenceConfig: phantom.args[4] - , ganttConfig: phantom.args[5] - , verbose: phantom.args[6] === 'true' ? true : false + outputDir: system.args[1] + , png: system.args[2] === 'true' ? true : false + , svg: system.args[3] === 'true' ? true : false + , css: system.args[4] !== '' ? system.args[4] : '* { margin: 0; padding: 0; }' + , sequenceConfig: system.args[5] + , ganttConfig: system.args[6] + , verbose: system.args[7] === 'true' ? true : false , width: width } , log = logger(options.verbose) // If no css is suuplied make sure a fixed witdth is given to the gant renderer - if(phantom.args[3] !== ''){ + if(system.args[3] !== ''){ if(typeof options.ganttConfig === 'undefined'){ options.ganttConfig = {}; } @@ -73,9 +68,6 @@ page.content = [ , '' ].join('\n') -//console.log('page.content'); -//console.log(JSON.stringify(page.content)); -//console.log(phantom.args[3]); page.injectJs('../dist/mermaid.js') page.onConsoleMessage = function(msg, lineNum, sourceId) { @@ -92,7 +84,7 @@ files.forEach(function(file) { , svgContent , allElements; - console.log('ready to execute png: ' + filename + '.png') + console.log('ready to execute png: ' + filename + '.png ') // this JS is executed in this statement is sandboxed, even though it doesn't // look like it. we need to serialize then unserialize the svgContent that's @@ -103,6 +95,7 @@ files.forEach(function(file) { sequenceConfig : options.sequenceConfig, confWidth : options.width }) + oDOM = oParser.parseFromString(svgContent, "text/xml") resolveSVGElement(oDOM.firstChild) @@ -123,7 +116,7 @@ files.forEach(function(file) { page.render(options.outputDir + fs.separator + filename + '.png') console.log('saved png: ' + filename + '.png') } - console.log('After png save: ' + filename + '.png') + if (options.svg) { var serialize = new XMLSerializer(); fs.write( @@ -247,6 +240,7 @@ function executeInPage(data) { el.className = 'mermaid' elContent = document.createTextNode(contents) el.appendChild(elContent) + //el.innerText = 'hello\uD800' //contents; document.body.appendChild(el) @@ -254,6 +248,7 @@ function executeInPage(data) { sequenceDiagram:{useMaxWidth:false}, flowchart:{useMaxWidth:false} }); + //console.log('after initialize',sequenceConfig); if(typeof sequenceConfig !== undefined && sequenceConfig !== 'undefined'){ //sc = document.createElement("script") @@ -266,6 +261,7 @@ function executeInPage(data) { }); } + //console.log('after initialize 2'); if(typeof ganttConfig !== undefined && ganttConfig !== 'undefined'){ sc = document.createElement("script") scContent = document.createTextNode('mermaid.ganttConfig = JSON.parse(' + JSON.stringify(ganttConfig) + ');') @@ -280,9 +276,6 @@ function executeInPage(data) { document.body.appendChild(sc) } - console.log('Generated head'); - console.log(document.head.innerHTML); - //console.log(document.body.innerHTML); mermaid.init(); svg = document.querySelector('svg') @@ -291,6 +284,7 @@ function executeInPage(data) { width = boundingBox.width * 1.5; // adding the scale factor for consistency with output in chrome browser height = boundingBox.height * 1.5; // adding the scale factor for consistency with output in chrome browser + var scalefactor = confWidth/(width-8); // resizing the body to fit the svg diff --git a/node_modules/jison/node_modules/ebnf-parser/transform-parser.js b/node_modules/jison/node_modules/ebnf-parser/transform-parser.js deleted file mode 100644 index 4ef719575..000000000 --- a/node_modules/jison/node_modules/ebnf-parser/transform-parser.js +++ /dev/null @@ -1,629 +0,0 @@ -/* parser generated by jison 0.4.11 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ -var ebnf = (function(){ -var parser = {trace: function trace() { }, -yy: {}, -symbols_: {"error":2,"production":3,"handle":4,"EOF":5,"handle_list":6,"|":7,"expression_suffix":8,"expression":9,"suffix":10,"ALIAS":11,"symbol":12,"(":13,")":14,"*":15,"?":16,"+":17,"$accept":0,"$end":1}, -terminals_: {2:"error",5:"EOF",7:"|",11:"ALIAS",12:"symbol",13:"(",14:")",15:"*",16:"?",17:"+"}, -productions_: [0,[3,2],[6,1],[6,3],[4,0],[4,2],[8,3],[8,2],[9,1],[9,3],[10,0],[10,1],[10,1],[10,1]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 1: return $$[$0-1]; -break; -case 2: this.$ = [$$[$0]]; -break; -case 3: $$[$0-2].push($$[$0]); -break; -case 4: this.$ = []; -break; -case 5: $$[$0-1].push($$[$0]); -break; -case 6: this.$ = ['xalias', $$[$0-1], $$[$0-2], $$[$0]]; -break; -case 7: if ($$[$0]) this.$ = [$$[$0], $$[$0-1]]; else this.$ = $$[$0-1]; -break; -case 8: this.$ = ['symbol', $$[$0]]; -break; -case 9: this.$ = ['()', $$[$0-1]]; -break; -} -}, -table: [{3:1,4:2,5:[2,4],12:[2,4],13:[2,4]},{1:[3]},{5:[1,3],8:4,9:5,12:[1,6],13:[1,7]},{1:[2,1]},{5:[2,5],7:[2,5],12:[2,5],13:[2,5],14:[2,5]},{5:[2,10],7:[2,10],10:8,11:[2,10],12:[2,10],13:[2,10],14:[2,10],15:[1,9],16:[1,10],17:[1,11]},{5:[2,8],7:[2,8],11:[2,8],12:[2,8],13:[2,8],14:[2,8],15:[2,8],16:[2,8],17:[2,8]},{4:13,6:12,7:[2,4],12:[2,4],13:[2,4],14:[2,4]},{5:[2,7],7:[2,7],11:[1,14],12:[2,7],13:[2,7],14:[2,7]},{5:[2,11],7:[2,11],11:[2,11],12:[2,11],13:[2,11],14:[2,11]},{5:[2,12],7:[2,12],11:[2,12],12:[2,12],13:[2,12],14:[2,12]},{5:[2,13],7:[2,13],11:[2,13],12:[2,13],13:[2,13],14:[2,13]},{7:[1,16],14:[1,15]},{7:[2,2],8:4,9:5,12:[1,6],13:[1,7],14:[2,2]},{5:[2,6],7:[2,6],12:[2,6],13:[2,6],14:[2,6]},{5:[2,9],7:[2,9],11:[2,9],12:[2,9],13:[2,9],14:[2,9],15:[2,9],16:[2,9],17:[2,9]},{4:17,7:[2,4],12:[2,4],13:[2,4],14:[2,4]},{7:[2,3],8:4,9:5,12:[1,6],13:[1,7],14:[2,3]}], -defaultActions: {3:[2,1]}, -parseError: function parseError(str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - throw new Error(str); - } -}, -parse: function parse(input) { - var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - this.lexer.setInput(input); - this.lexer.yy = this.yy; - this.yy.lexer = this.lexer; - this.yy.parser = this; - if (typeof this.lexer.yylloc == 'undefined') { - this.lexer.yylloc = {}; - } - var yyloc = this.lexer.yylloc; - lstack.push(yyloc); - var ranges = this.lexer.options && this.lexer.options.ranges; - if (typeof this.yy.parseError === 'function') { - this.parseError = this.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - function lex() { - var token; - token = self.lexer.lex() || EOF; - if (typeof token !== 'number') { - token = self.symbols_[token] || token; - } - return token; - } - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (this.lexer.showPosition) { - errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + this.lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - this.parseError(errStr, { - text: this.lexer.match, - token: this.terminals_[symbol] || symbol, - line: this.lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(this.lexer.yytext); - lstack.push(this.lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = this.lexer.yyleng; - yytext = this.lexer.yytext; - yylineno = this.lexer.yylineno; - yyloc = this.lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - this.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; -/* generated by jison-lex 0.2.1 */ -var lexer = (function(){ -var lexer = { - -EOF:1, - -parseError:function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - -// resets the lexer, sets new input -setInput:function (input) { - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ''; - this.conditionStack = ['INITIAL']; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0,0]; - } - this.offset = 0; - return this; - }, - -// consumes and returns one char from the input -input:function () { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - - this._input = this._input.slice(1); - return ch; - }, - -// unshifts one char (or a string) into the input -unput:function (ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len - 1); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? - (lines.length === oldLines.length ? this.yylloc.first_column : 0) - + oldLines[oldLines.length - lines.length].length - lines[0].length : - this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - -// When called from action, caches matched text and appends it on next action -more:function () { - this._more = true; - return this; - }, - -// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. -reject:function () { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - - } - return this; - }, - -// retain first n characters of the match -less:function (n) { - this.unput(this.match.slice(n)); - }, - -// displays already matched input, i.e. for error messages -pastInput:function () { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); - }, - -// displays upcoming input, i.e. for error messages -upcomingInput:function () { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20-next.length); - } - return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); - }, - -// displays the character position where the lexing error occurred, i.e. for error messages -showPosition:function () { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - -// test the lexed token: return FALSE when not a match, otherwise return token -test_match:function (match, indexed_rule) { - var token, - lines, - backup; - - if (this.options.backtrack_lexer) { - // save context - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? - lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : - this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token) { - return token; - } else if (this._backtrack) { - // recover context - for (var k in backup) { - this[k] = backup[k]; - } - return false; // rule action called reject() implying the next rule should be tested instead. - } - return false; - }, - -// return next match in input -next:function () { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - - var token, - match, - tempMatch, - index; - if (!this._more) { - this.yytext = ''; - this.match = ''; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (this.options.backtrack_lexer) { - token = this.test_match(tempMatch, rules[i]); - if (token !== false) { - return token; - } else if (this._backtrack) { - match = false; - continue; // rule action called reject() implying a rule MISmatch. - } else { - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token = this.test_match(match, rules[index]); - if (token !== false) { - return token; - } - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - -// return next match that has a token -lex:function lex() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -begin:function begin(condition) { - this.conditionStack.push(condition); - }, - -// pop the previously active lexer condition state off the condition stack -popState:function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - -// produce the lexer rule set which is active for the currently active lexer condition state -_currentRules:function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - -// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available -topState:function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - -// alias for begin(condition) -pushState:function pushState(condition) { - this.begin(condition); - }, - -// return the number of states currently on the stack -stateStackSize:function stateStackSize() { - return this.conditionStack.length; - }, -options: {}, -performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { - -var YYSTATE=YY_START; -switch($avoiding_name_collisions) { -case 0:/* skip whitespace */ -break; -case 1:return 12; -break; -case 2:yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 11; -break; -case 3:return 12; -break; -case 4:return 12; -break; -case 5:return 'bar'; -break; -case 6:return 13; -break; -case 7:return 14; -break; -case 8:return 15; -break; -case 9:return 16; -break; -case 10:return 7; -break; -case 11:return 17; -break; -case 12:return 5; -break; -} -}, -rules: [/^(?:\s+)/,/^(?:([a-zA-Z][a-zA-Z0-9_-]*))/,/^(?:\[([a-zA-Z][a-zA-Z0-9_-]*)\])/,/^(?:'[^']*')/,/^(?:\.)/,/^(?:bar\b)/,/^(?:\()/,/^(?:\))/,/^(?:\*)/,/^(?:\?)/,/^(?:\|)/,/^(?:\+)/,/^(?:$)/], -conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12],"inclusive":true}} -}; -return lexer; -})(); -parser.lexer = lexer; -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; -return new Parser; -})(); - - -if (typeof require !== 'undefined' && typeof exports !== 'undefined') { -exports.parser = ebnf; -exports.Parser = ebnf.Parser; -exports.parse = function () { return ebnf.parse.apply(ebnf, arguments); }; -exports.main = function commonjsMain(args) { - if (!args[1]) { - console.log('Usage: '+args[0]+' FILE'); - process.exit(1); - } - var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if (typeof module !== 'undefined' && require.main === module) { - exports.main(process.argv.slice(1)); -} -} \ No newline at end of file diff --git a/package.json b/package.json index 95901fb47..fe51b83a9 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "marked": "^0.3.2", "mock-browser": "^0.91.34", "path": "^0.4.9", - "phantomjs": "^1.9.18", + "phantomjs": "^2.1.3", "proxyquire": "^1.7.3", "proxyquire-universal": "^1.0.8", "proxyquireify": "^3.0.0", diff --git a/src/utils.spec.js b/src/utils.spec.js index b9fd4cce3..8110e7fd8 100644 --- a/src/utils.spec.js +++ b/src/utils.spec.js @@ -152,7 +152,7 @@ describe('when cloning CSS ', function () { var svg = generateSVG(); addStyleToDocument(); utils.cloneCssStyles(svg, {}); - expect(stylesToArray(svg)).toEqual(['.node { stroke: #eeeeee; }', '.node-square { stroke: #bbbbbb; }']); + expect(stylesToArray(svg)).toEqual(['.node { stroke: #eeeeee;}', '.node-square { stroke: #bbbbbb;}']); }); it('should handle multiple stylesheets in document with classes in SVG', function () { @@ -160,7 +160,7 @@ describe('when cloning CSS ', function () { addStyleToDocument(); addSecondStyleToDocument(); utils.cloneCssStyles(svg, {}); - expect(stylesToArray(svg)).toEqual(['.node { stroke: #eeeeee; }', '.node-square { stroke: #bbbbbb; }', '.node-square { stroke: #bbeebb; }']); + expect(stylesToArray(svg)).toEqual(['.node { stroke: #eeeeee;}', '.node-square { stroke: #bbbbbb;}', '.node-square { stroke: #bbeebb;}']); }); it('should handle multiple stylesheets + ignore styles in other mermaid SVG', function () { @@ -169,14 +169,14 @@ describe('when cloning CSS ', function () { addSecondStyleToDocument(); addMermaidSVGwithStyleToDocument(); utils.cloneCssStyles(svg, {}); - expect(stylesToArray(svg)).toEqual(['.node { stroke: #eeeeee; }', '.node-square { stroke: #bbbbbb; }', '.node-square { stroke: #bbeebb; }']); + expect(stylesToArray(svg)).toEqual(['.node { stroke: #eeeeee;}', '.node-square { stroke: #bbbbbb;}', '.node-square { stroke: #bbeebb;}']); }); it('should handle a default class together with stylesheet in document with classes in SVG', function () { var svg = generateSVG(); addStyleToDocument(); utils.cloneCssStyles(svg, {'default': {'styles': ['stroke:#ffffff', 'stroke-width:1.5px']}}); - expect(stylesToArray(svg)).toEqual(['#mermaid-01 .node>rect { stroke:#ffffff; stroke-width:1.5px; }', '.node { stroke: #eeeeee; }', '.node-square { stroke: #bbbbbb; }']); + expect(stylesToArray(svg)).toEqual(['#mermaid-01 .node>rect { stroke:#ffffff; stroke-width:1.5px; }', '.node { stroke: #eeeeee;}', '.node-square { stroke: #bbbbbb;}']); }); it('should handle a default class together with stylesheet in document and classDefs', function () { @@ -188,8 +188,8 @@ describe('when cloning CSS ', function () { 'node-circle': {'styles': ['fill:#444444', 'stroke:#111111']} }); expect(stylesToArray(svg)).toEqual(['#mermaid-01 .node>rect { stroke:#ffffff; stroke-width:1.5px; }', - '.node { stroke: #eeeeee; }', - '.node-square { stroke: #bbbbbb; }', + '.node { stroke: #eeeeee;}', + '.node-square { stroke: #bbbbbb;}', '#mermaid-01 .node-square>rect, .node-square>polygon, .node-square>ellipse { fill:#eeeeee; stroke:#aaaaaa; }', '#mermaid-01 .node-circle>rect, .node-circle>polygon, .node-circle>ellipse { fill:#444444; stroke:#111111; }' ]); diff --git a/test/examples/issue_210.html b/test/examples/issue_210.html index 3492380b6..0e6804495 100644 --- a/test/examples/issue_210.html +++ b/test/examples/issue_210.html @@ -6,7 +6,7 @@