>)/i, /^(?:.*\\[\\[fork\\]\\])/i, /^(?:.*\\[\\[join\\]\\])/i, /^(?:[\"])/i, /^(?:\\s*as\\s+)/i, /^(?:[^\\n\\{]*)/i, /^(?:[\"])/i, /^(?:[^\"]*)/i, /^(?:[^\\n\\s\\{]+)/i, /^(?:\\n)/i, /^(?:\\{)/i, /^(?:\\})/i, /^(?:[\\n])/i, /^(?:note\\s+)/i, /^(?:left of\\b)/i, /^(?:right of\\b)/i, /^(?:\")/i, /^(?:\\s*as\\s*)/i, /^(?:[\"])/i, /^(?:[^\"]*)/i, /^(?:[^\\n]*)/i, /^(?:\\s*[^:\\n\\s\\-]+)/i, /^(?:\\s*:[^:\\n;]+)/i, /^(?:\\s*[^:;]+end note\\b)/i, /^(?:stateDiagram\\s+)/i, /^(?:stateDiagram-v2\\s+)/i, /^(?:hide empty description\\b)/i, /^(?:\\[\\*\\])/i, /^(?:[^:\\n\\s\\-\\{]+)/i, /^(?:\\s*:[^:\\n;]+)/i, /^(?:-->)/i, /^(?:--)/i, /^(?:$)/i, /^(?:.)/i],\n conditions: {\n \"LINE\": {\n \"rules\": [9, 10],\n \"inclusive\": false\n },\n \"close_directive\": {\n \"rules\": [9, 10],\n \"inclusive\": false\n },\n \"arg_directive\": {\n \"rules\": [3, 4, 9, 10],\n \"inclusive\": false\n },\n \"type_directive\": {\n \"rules\": [2, 3, 9, 10],\n \"inclusive\": false\n },\n \"open_directive\": {\n \"rules\": [1, 9, 10],\n \"inclusive\": false\n },\n \"struct\": {\n \"rules\": [9, 10, 15, 28, 29, 30, 44, 45, 46, 47, 48],\n \"inclusive\": false\n },\n \"FLOATING_NOTE_ID\": {\n \"rules\": [37],\n \"inclusive\": false\n },\n \"FLOATING_NOTE\": {\n \"rules\": [34, 35, 36],\n \"inclusive\": false\n },\n \"NOTE_TEXT\": {\n \"rules\": [39, 40],\n \"inclusive\": false\n },\n \"NOTE_ID\": {\n \"rules\": [38],\n \"inclusive\": false\n },\n \"NOTE\": {\n \"rules\": [31, 32, 33],\n \"inclusive\": false\n },\n \"SCALE\": {\n \"rules\": [13, 14],\n \"inclusive\": false\n },\n \"ALIAS\": {\n \"rules\": [],\n \"inclusive\": false\n },\n \"STATE_ID\": {\n \"rules\": [22],\n \"inclusive\": false\n },\n \"STATE_STRING\": {\n \"rules\": [23, 24],\n \"inclusive\": false\n },\n \"FORK_STATE\": {\n \"rules\": [],\n \"inclusive\": false\n },\n \"STATE\": {\n \"rules\": [9, 10, 16, 17, 18, 19, 20, 21, 25, 26, 27],\n \"inclusive\": false\n },\n \"ID\": {\n \"rules\": [9, 10],\n \"inclusive\": false\n },\n \"INITIAL\": {\n \"rules\": [0, 5, 6, 7, 8, 10, 11, 12, 15, 27, 30, 41, 42, 43, 44, 45, 46, 47, 49, 50],\n \"inclusive\": true\n }\n }\n };\n return lexer;\n }();\n\n parser.lexer = lexer;\n\n function Parser() {\n this.yy = {};\n }\n\n Parser.prototype = parser;\n parser.Parser = Parser;\n return new Parser();\n }();\n\n if (true) {\n exports.parser = parser;\n exports.Parser = parser.Parser;\n\n exports.parse = function () {\n return parser.parse.apply(parser, arguments);\n };\n\n exports.main = function commonjsMain(args) {\n if (!args[1]) {\n console.log('Usage: ' + args[0] + ' FILE');\n process.exit(1);\n }\n\n var source = __webpack_require__(\n /*! fs */\n \"./node_modules/node-libs-browser/mock/empty.js\").readFileSync(__webpack_require__(\n /*! path */\n \"./node_modules/path-browserify/index.js\").normalize(args[1]), \"utf8\");\n\n return exports.parser.parse(source);\n };\n\n if (true && __webpack_require__.c[__webpack_require__.s] === module) {\n exports.main(process.argv.slice(1));\n }\n }\n /* WEBPACK VAR INJECTION */\n\n }).call(this, __webpack_require__(\n /*! ./../../../../node_modules/process/browser.js */\n \"./node_modules/process/browser.js\"), __webpack_require__(\n /*! ./../../../../node_modules/webpack/buildin/module.js */\n \"./node_modules/webpack/buildin/module.js\")(module));\n /***/\n },\n\n /***/\n \"./src/diagrams/state/shapes.js\":\n /*!**************************************!*\\\n !*** ./src/diagrams/state/shapes.js ***!\n \\**************************************/\n\n /*! exports provided: drawStartState, drawDivider, drawSimpleState, drawDescrState, addTitleAndBox, drawText, drawNote, drawState, drawEdge */\n\n /***/\n function srcDiagramsStateShapesJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawStartState\", function () {\n return drawStartState;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawDivider\", function () {\n return drawDivider;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawSimpleState\", function () {\n return drawSimpleState;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawDescrState\", function () {\n return drawDescrState;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"addTitleAndBox\", function () {\n return addTitleAndBox;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawText\", function () {\n return drawText;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawNote\", function () {\n return drawNote;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawState\", function () {\n return drawState;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawEdge\", function () {\n return drawEdge;\n });\n /* harmony import */\n\n\n var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! d3 */\n \"d3\");\n /* harmony import */\n\n\n var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);\n /* harmony import */\n\n\n var _id_cache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! ./id-cache.js */\n \"./src/diagrams/state/id-cache.js\");\n /* harmony import */\n\n\n var _stateDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\n /*! ./stateDb */\n \"./src/diagrams/state/stateDb.js\");\n /* harmony import */\n\n\n var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\n /*! ../../utils */\n \"./src/utils.js\");\n /* harmony import */\n\n\n var _common_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(\n /*! ../common/common */\n \"./src/diagrams/common/common.js\");\n /* harmony import */\n\n\n var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(\n /*! ../../config */\n \"./src/config.js\");\n /* harmony import */\n\n\n var _logger__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(\n /*! ../../logger */\n \"./src/logger.js\"); // let conf;\n\n /**\n * Draws a start state as a black circle\n */\n\n\n var drawStartState = function drawStartState(g) {\n return g.append('circle') // .style('stroke', 'black')\n // .style('fill', 'black')\n .attr('class', 'start-state').attr('r', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.sizeUnit).attr('cx', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.sizeUnit).attr('cy', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.sizeUnit);\n };\n /**\n * Draws a start state as a black circle\n */\n\n\n var drawDivider = function drawDivider(g) {\n return g.append('line').style('stroke', 'grey').style('stroke-dasharray', '3').attr('x1', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.textHeight).attr('class', 'divider').attr('x2', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.textHeight * 2).attr('y1', 0).attr('y2', 0);\n };\n /**\n * Draws a an end state as a black circle\n */\n\n\n var drawSimpleState = function drawSimpleState(g, stateDef) {\n var state = g.append('text').attr('x', 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.textHeight + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('font-size', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.fontSize).attr('class', 'state-title').text(stateDef.id);\n var classBox = state.node().getBBox();\n g.insert('rect', ':first-child').attr('x', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('width', classBox.width + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('height', classBox.height + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('rx', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.radius);\n return state;\n };\n /**\n * Draws a state with descriptions\n * @param {*} g\n * @param {*} stateDef\n */\n\n\n var drawDescrState = function drawDescrState(g, stateDef) {\n var addTspan = function addTspan(textEl, txt, isFirst) {\n var tSpan = textEl.append('tspan').attr('x', 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).text(txt);\n\n if (!isFirst) {\n tSpan.attr('dy', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.textHeight);\n }\n };\n\n var title = g.append('text').attr('x', 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.textHeight + 1.3 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('font-size', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.fontSize).attr('class', 'state-title').text(stateDef.descriptions[0]);\n var titleBox = title.node().getBBox();\n var titleHeight = titleBox.height;\n var description = g.append('text') // text label for the x axis\n .attr('x', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('y', titleHeight + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding * 0.4 + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.dividerMargin + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.textHeight).attr('class', 'state-description');\n var isFirst = true;\n var isSecond = true;\n stateDef.descriptions.forEach(function (descr) {\n if (!isFirst) {\n addTspan(description, descr, isSecond);\n isSecond = false;\n }\n\n isFirst = false;\n });\n var descrLine = g.append('line') // text label for the x axis\n .attr('x1', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('y1', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding + titleHeight + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.dividerMargin / 2).attr('y2', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding + titleHeight + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.dividerMargin / 2).attr('class', 'descr-divider');\n var descrBox = description.node().getBBox();\n var width = Math.max(descrBox.width, titleBox.width);\n descrLine.attr('x2', width + 3 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding); // const classBox = title.node().getBBox();\n\n g.insert('rect', ':first-child').attr('x', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('width', width + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('height', descrBox.height + titleHeight + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('rx', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.radius);\n return g;\n };\n /**\n * Adds the creates a box around the existing content and adds a\n * panel for the id on top of the content.\n */\n\n /**\n * Function that creates an title row and a frame around a substate for a composit state diagram.\n * The function returns a new d3 svg object with updated width and height properties;\n * @param {*} g The d3 svg object for the substate to framed\n * @param {*} stateDef The info about the\n */\n\n\n var addTitleAndBox = function addTitleAndBox(g, stateDef, altBkg) {\n var pad = Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding;\n var dblPad = 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding;\n var orgBox = g.node().getBBox();\n var orgWidth = orgBox.width;\n var orgX = orgBox.x;\n var title = g.append('text').attr('x', 0).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.titleShift).attr('font-size', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.fontSize).attr('class', 'state-title').text(stateDef.id);\n var titleBox = title.node().getBBox();\n var titleWidth = titleBox.width + dblPad;\n var width = Math.max(titleWidth, orgWidth); // + dblPad;\n\n if (width === orgWidth) {\n width = width + dblPad;\n }\n\n var startX; // const lineY = 1 - getConfig().state.textHeight;\n // const descrLine = g\n // .append('line') // text label for the x axis\n // .attr('x1', 0)\n // .attr('y1', lineY)\n // .attr('y2', lineY)\n // .attr('class', 'descr-divider');\n\n var graphBox = g.node().getBBox(); // console.warn(width / 2, titleWidth / 2, getConfig().state.padding, orgBox);\n // descrLine.attr('x2', graphBox.width + getConfig().state.padding);\n\n if (stateDef.doc) {// cnsole.warn(\n // stateDef.id,\n // 'orgX: ',\n // orgX,\n // 'width: ',\n // width,\n // 'titleWidth: ',\n // titleWidth,\n // 'orgWidth: ',\n // orgWidth,\n // 'width',\n // width\n // );\n }\n\n startX = orgX - pad;\n\n if (titleWidth > orgWidth) {\n startX = (orgWidth - width) / 2 + pad;\n }\n\n if (Math.abs(orgX - graphBox.x) < pad) {\n if (titleWidth > orgWidth) {\n startX = orgX - (titleWidth - orgWidth) / 2;\n }\n }\n\n var lineY = 1 - Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.textHeight; // White color\n\n g.insert('rect', ':first-child').attr('x', startX).attr('y', lineY).attr('class', altBkg ? 'alt-composit' : 'composit').attr('width', width).attr('height', graphBox.height + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.textHeight + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.titleShift + 1).attr('rx', '0');\n title.attr('x', startX + pad);\n if (titleWidth <= orgWidth) title.attr('x', orgX + (width - dblPad) / 2 - titleWidth / 2 + pad); // Title background\n\n g.insert('rect', ':first-child').attr('x', startX).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.titleShift - Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.textHeight - Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('width', width) // Just needs to be higher then the descr line, will be clipped by the white color box\n .attr('height', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.textHeight * 3).attr('rx', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.radius); // Full background\n\n g.insert('rect', ':first-child').attr('x', startX).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.titleShift - Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.textHeight - Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('width', width).attr('height', graphBox.height + 3 + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.textHeight).attr('rx', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.radius);\n return g;\n };\n\n var drawEndState = function drawEndState(g) {\n g.append('circle') // .style('stroke', 'black')\n // .style('fill', 'white')\n .attr('class', 'end-state-outer').attr('r', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.sizeUnit + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.miniPadding).attr('cx', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.sizeUnit + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.miniPadding).attr('cy', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.sizeUnit + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.miniPadding);\n return g.append('circle') // .style('stroke', 'black')\n // .style('fill', 'black')\n .attr('class', 'end-state-inner').attr('r', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.sizeUnit).attr('cx', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.sizeUnit + 2).attr('cy', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.sizeUnit + 2);\n };\n\n var drawForkJoinState = function drawForkJoinState(g, stateDef) {\n var width = Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.forkWidth;\n var height = Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.forkHeight;\n\n if (stateDef.parentId) {\n var tmp = width;\n width = height;\n height = tmp;\n }\n\n return g.append('rect').style('stroke', 'black').style('fill', 'black').attr('width', width).attr('height', height).attr('x', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding);\n };\n\n var drawText = function drawText(elem, textData) {\n // Remove and ignore br:s\n var nText = textData.text.replace(_common_common__WEBPACK_IMPORTED_MODULE_4__[\"default\"].lineBreakRegex, ' ');\n var textElem = elem.append('text');\n textElem.attr('x', textData.x);\n textElem.attr('y', textData.y);\n textElem.style('text-anchor', textData.anchor);\n textElem.attr('fill', textData.fill);\n\n if (typeof textData.class !== 'undefined') {\n textElem.attr('class', textData.class);\n }\n\n var span = textElem.append('tspan');\n span.attr('x', textData.x + textData.textMargin * 2);\n span.attr('fill', textData.fill);\n span.text(nText);\n return textElem;\n };\n\n var _drawLongText = function _drawLongText(_text, x, y, g) {\n var textHeight = 0;\n var textElem = g.append('text');\n textElem.style('text-anchor', 'start');\n textElem.attr('class', 'noteText');\n\n var text = _text.replace(/\\r\\n/g, '
');\n\n text = text.replace(/\\n/g, '
');\n var lines = text.split(_common_common__WEBPACK_IMPORTED_MODULE_4__[\"default\"].lineBreakRegex);\n var tHeight = 1.25 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.noteMargin;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = lines[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _line = _step.value;\n\n var txt = _line.trim();\n\n if (txt.length > 0) {\n var span = textElem.append('tspan');\n span.text(txt);\n\n if (tHeight === 0) {\n var textBounds = span.node().getBBox();\n tHeight += textBounds.height;\n } // console.warn('textBounds', textBounds);\n\n\n textHeight += tHeight;\n span.attr('x', x + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.noteMargin);\n span.attr('y', y + textHeight + 1.25 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.noteMargin);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return {\n textWidth: textElem.node().getBBox().width,\n textHeight: textHeight\n };\n };\n /**\n * Draws a note to the diagram\n * @param text - The text of the given note.\n * @param g - The element the note is attached to.\n */\n\n\n var drawNote = function drawNote(text, g) {\n g.attr('class', 'state-note');\n var note = g.append('rect').attr('x', 0).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding);\n var rectElem = g.append('g');\n\n var _drawLongText2 = _drawLongText(text, 0, 0, rectElem),\n textWidth = _drawLongText2.textWidth,\n textHeight = _drawLongText2.textHeight;\n\n note.attr('height', textHeight + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.noteMargin);\n note.attr('width', textWidth + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.noteMargin * 2);\n return note;\n };\n /**\n * Starting point for drawing a state. The function finds out the specifics\n * about the state and renders with approprtiate function.\n * @param {*} elem\n * @param {*} stateDef\n */\n\n\n var drawState = function drawState(elem, stateDef) {\n var id = stateDef.id;\n var stateInfo = {\n id: id,\n label: stateDef.id,\n width: 0,\n height: 0\n };\n var g = elem.append('g').attr('id', id).attr('class', 'stateGroup');\n if (stateDef.type === 'start') drawStartState(g);\n if (stateDef.type === 'end') drawEndState(g);\n if (stateDef.type === 'fork' || stateDef.type === 'join') drawForkJoinState(g, stateDef);\n if (stateDef.type === 'note') drawNote(stateDef.note.text, g);\n if (stateDef.type === 'divider') drawDivider(g);\n if (stateDef.type === 'default' && stateDef.descriptions.length === 0) drawSimpleState(g, stateDef);\n if (stateDef.type === 'default' && stateDef.descriptions.length > 0) drawDescrState(g, stateDef);\n var stateBox = g.node().getBBox();\n stateInfo.width = stateBox.width + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding;\n stateInfo.height = stateBox.height + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding;\n\n _id_cache_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].set(id, stateInfo); // stateCnt++;\n\n\n return stateInfo;\n };\n\n var edgeCount = 0;\n\n var drawEdge = function drawEdge(elem, path, relation) {\n var getRelationType = function getRelationType(type) {\n switch (type) {\n case _stateDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"].relationType.AGGREGATION:\n return 'aggregation';\n\n case _stateDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"].relationType.EXTENSION:\n return 'extension';\n\n case _stateDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"].relationType.COMPOSITION:\n return 'composition';\n\n case _stateDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"].relationType.DEPENDENCY:\n return 'dependency';\n }\n };\n\n path.points = path.points.filter(function (p) {\n return !Number.isNaN(p.y);\n }); // The data for our line\n\n var lineData = path.points; // This is the accessor function we talked about above\n\n var lineFunction = Object(d3__WEBPACK_IMPORTED_MODULE_0__[\"line\"])().x(function (d) {\n return d.x;\n }).y(function (d) {\n return d.y;\n }).curve(d3__WEBPACK_IMPORTED_MODULE_0__[\"curveBasis\"]);\n var svgPath = elem.append('path').attr('d', lineFunction(lineData)).attr('id', 'edge' + edgeCount).attr('class', 'transition');\n var url = '';\n\n if (Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.arrowMarkerAbsolute) {\n url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;\n url = url.replace(/\\(/g, '\\\\(');\n url = url.replace(/\\)/g, '\\\\)');\n }\n\n svgPath.attr('marker-end', 'url(' + url + '#' + getRelationType(_stateDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"].relationType.DEPENDENCY) + 'End' + ')');\n\n if (typeof relation.title !== 'undefined') {\n var label = elem.append('g').attr('class', 'stateLabel');\n\n var _utils$calcLabelPosit = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].calcLabelPosition(path.points),\n x = _utils$calcLabelPosit.x,\n y = _utils$calcLabelPosit.y;\n\n var rows = _common_common__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getRows(relation.title); // console.warn(rows);\n\n\n var titleHeight = 0;\n var titleRows = [];\n var maxWidth = 0;\n var minX = 0;\n\n for (var i = 0; i <= rows.length; i++) {\n var title = label.append('text').attr('text-anchor', 'middle').text(rows[i]).attr('x', x).attr('y', y + titleHeight);\n var boundstmp = title.node().getBBox();\n maxWidth = Math.max(maxWidth, boundstmp.width);\n minX = Math.min(minX, boundstmp.x);\n\n _logger__WEBPACK_IMPORTED_MODULE_6__[\"logger\"].info(boundstmp.x, x, y + titleHeight);\n\n if (titleHeight === 0) {\n var titleBox = title.node().getBBox();\n titleHeight = titleBox.height;\n\n _logger__WEBPACK_IMPORTED_MODULE_6__[\"logger\"].info('Title height', titleHeight, y);\n }\n\n titleRows.push(title);\n }\n\n var boxHeight = titleHeight * rows.length;\n\n if (rows.length > 1) {\n var heightAdj = (rows.length - 1) * titleHeight * 0.5;\n titleRows.forEach(function (title, i) {\n return title.attr('y', y + i * titleHeight - heightAdj);\n });\n boxHeight = titleHeight * rows.length;\n }\n\n var bounds = label.node().getBBox();\n label.insert('rect', ':first-child').attr('class', 'box').attr('x', x - maxWidth / 2 - Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding / 2).attr('y', y - boxHeight / 2 - Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding / 2 - 3.5).attr('width', maxWidth + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding).attr('height', boxHeight + Object(_config__WEBPACK_IMPORTED_MODULE_5__[\"getConfig\"])().state.padding);\n\n _logger__WEBPACK_IMPORTED_MODULE_6__[\"logger\"].info(bounds); //label.attr('transform', '0 -' + (bounds.y / 2));\n // Debug points\n // path.points.forEach(point => {\n // g.append('circle')\n // .style('stroke', 'red')\n // .style('fill', 'red')\n // .attr('r', 1)\n // .attr('cx', point.x)\n // .attr('cy', point.y);\n // });\n // g.append('circle')\n // .style('stroke', 'blue')\n // .style('fill', 'blue')\n // .attr('r', 1)\n // .attr('cx', x)\n // .attr('cy', y);\n\n }\n\n edgeCount++;\n };\n /***/\n\n },\n\n /***/\n \"./src/diagrams/state/stateDb.js\":\n /*!***************************************!*\\\n !*** ./src/diagrams/state/stateDb.js ***!\n \\***************************************/\n\n /*! exports provided: parseDirective, addState, clear, getState, getStates, logDocuments, getRelations, addRelation, cleanupLabel, lineType, relationType, default */\n\n /***/\n function srcDiagramsStateStateDbJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"parseDirective\", function () {\n return parseDirective;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"addState\", function () {\n return addState;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"clear\", function () {\n return clear;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getState\", function () {\n return getState;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getStates\", function () {\n return getStates;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"logDocuments\", function () {\n return logDocuments;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getRelations\", function () {\n return getRelations;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"addRelation\", function () {\n return addRelation;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"cleanupLabel\", function () {\n return cleanupLabel;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"lineType\", function () {\n return lineType;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"relationType\", function () {\n return relationType;\n });\n /* harmony import */\n\n\n var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! ../../logger */\n \"./src/logger.js\");\n /* harmony import */\n\n\n var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! ../../utils */\n \"./src/utils.js\");\n /* harmony import */\n\n\n var _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\n /*! ../../mermaidAPI */\n \"./src/mermaidAPI.js\");\n /* harmony import */\n\n\n var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\n /*! ../../config */\n \"./src/config.js\");\n\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n var clone = function clone(o) {\n return JSON.parse(JSON.stringify(o));\n };\n\n var rootDoc = [];\n\n var parseDirective = function parseDirective(statement, context, type) {\n _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__[\"default\"].parseDirective(this, statement, context, type);\n };\n\n var setRootDoc = function setRootDoc(o) {\n _logger__WEBPACK_IMPORTED_MODULE_0__[\"logger\"].info('Setting root doc', o); // rootDoc = { id: 'root', doc: o };\n\n\n rootDoc = o;\n };\n\n var getRootDoc = function getRootDoc() {\n return rootDoc;\n };\n\n var docTranslator = function docTranslator(parent, node, first) {\n if (node.stmt === 'relation') {\n docTranslator(parent, node.state1, true);\n docTranslator(parent, node.state2, false);\n } else {\n if (node.stmt === 'state') {\n if (node.id === '[*]') {\n node.id = first ? parent.id + '_start' : parent.id + '_end';\n node.start = first;\n }\n }\n\n if (node.doc) {\n var doc = []; // Check for concurrency\n\n var i = 0;\n var currentDoc = [];\n\n for (i = 0; i < node.doc.length; i++) {\n if (node.doc[i].type === 'divider') {\n // debugger;\n var newNode = clone(node.doc[i]);\n newNode.doc = clone(currentDoc);\n doc.push(newNode);\n currentDoc = [];\n } else {\n currentDoc.push(node.doc[i]);\n }\n } // If any divider was encountered\n\n\n if (doc.length > 0 && currentDoc.length > 0) {\n var _newNode = {\n stmt: 'state',\n id: Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"generateId\"])(),\n type: 'divider',\n doc: clone(currentDoc)\n };\n doc.push(clone(_newNode));\n node.doc = doc;\n }\n\n node.doc.forEach(function (docNode) {\n return docTranslator(node, docNode, true);\n });\n }\n }\n };\n\n var getRootDocV2 = function getRootDocV2() {\n docTranslator({\n id: 'root'\n }, {\n id: 'root',\n doc: rootDoc\n }, true);\n return {\n id: 'root',\n doc: rootDoc\n };\n };\n\n var extract = function extract(_doc) {\n // const res = { states: [], relations: [] };\n var doc;\n\n if (_doc.doc) {\n doc = _doc.doc;\n } else {\n doc = _doc;\n } // let doc = root.doc;\n // if (!doc) {\n // doc = root;\n // }\n\n\n _logger__WEBPACK_IMPORTED_MODULE_0__[\"logger\"].info(doc);\n\n clear();\n\n _logger__WEBPACK_IMPORTED_MODULE_0__[\"logger\"].info('Extract', doc);\n\n doc.forEach(function (item) {\n if (item.stmt === 'state') {\n addState(item.id, item.type, item.doc, item.description, item.note);\n }\n\n if (item.stmt === 'relation') {\n addRelation(item.state1.id, item.state2.id, item.description);\n }\n });\n };\n\n var newDoc = function newDoc() {\n return {\n relations: [],\n states: {},\n documents: {}\n };\n };\n\n var documents = {\n root: newDoc()\n };\n var currentDocument = documents.root;\n var startCnt = 0;\n var endCnt = 0; // eslint-disable-line\n // let stateCnt = 0;\n\n /**\n * Function called by parser when a node definition has been found.\n * @param id\n * @param text\n * @param type\n * @param style\n */\n\n var addState = function addState(id, type, doc, descr, note) {\n if (typeof currentDocument.states[id] === 'undefined') {\n currentDocument.states[id] = {\n id: id,\n descriptions: [],\n type: type,\n doc: doc,\n note: note\n };\n } else {\n if (!currentDocument.states[id].doc) {\n currentDocument.states[id].doc = doc;\n }\n\n if (!currentDocument.states[id].type) {\n currentDocument.states[id].type = type;\n }\n }\n\n if (descr) {\n _logger__WEBPACK_IMPORTED_MODULE_0__[\"logger\"].info('Adding state ', id, descr);\n\n if (typeof descr === 'string') addDescription(id, descr.trim());\n\n if (_typeof(descr) === 'object') {\n descr.forEach(function (des) {\n return addDescription(id, des.trim());\n });\n }\n }\n\n if (note) currentDocument.states[id].note = note;\n };\n\n var clear = function clear() {\n documents = {\n root: newDoc()\n };\n currentDocument = documents.root;\n currentDocument = documents.root;\n startCnt = 0;\n endCnt = 0; // eslint-disable-line\n\n classes = [];\n };\n\n var getState = function getState(id) {\n return currentDocument.states[id];\n };\n\n var getStates = function getStates() {\n return currentDocument.states;\n };\n\n var logDocuments = function logDocuments() {\n _logger__WEBPACK_IMPORTED_MODULE_0__[\"logger\"].info('Documents = ', documents);\n };\n\n var getRelations = function getRelations() {\n return currentDocument.relations;\n };\n\n var addRelation = function addRelation(_id1, _id2, title) {\n var id1 = _id1;\n var id2 = _id2;\n var type1 = 'default';\n var type2 = 'default';\n\n if (_id1 === '[*]') {\n startCnt++;\n id1 = 'start' + startCnt;\n type1 = 'start';\n }\n\n if (_id2 === '[*]') {\n endCnt++;\n id2 = 'end' + startCnt;\n type2 = 'end';\n }\n\n addState(id1, type1);\n addState(id2, type2);\n currentDocument.relations.push({\n id1: id1,\n id2: id2,\n title: title\n });\n };\n\n var addDescription = function addDescription(id, _descr) {\n var theState = currentDocument.states[id];\n var descr = _descr;\n\n if (descr[0] === ':') {\n descr = descr.substr(1).trim();\n }\n\n theState.descriptions.push(descr);\n };\n\n var cleanupLabel = function cleanupLabel(label) {\n if (label.substring(0, 1) === ':') {\n return label.substr(2).trim();\n } else {\n return label.trim();\n }\n };\n\n var lineType = {\n LINE: 0,\n DOTTED_LINE: 1\n };\n var dividerCnt = 0;\n\n var getDividerId = function getDividerId() {\n dividerCnt++;\n return 'divider-id-' + dividerCnt;\n };\n\n var classes = [];\n\n var getClasses = function getClasses() {\n return classes;\n };\n\n var getDirection = function getDirection() {\n return 'TB';\n };\n\n var relationType = {\n AGGREGATION: 0,\n EXTENSION: 1,\n COMPOSITION: 2,\n DEPENDENCY: 3\n };\n\n var trimColon = function trimColon(str) {\n return str && str[0] === ':' ? str.substr(1).trim() : str.trim();\n };\n /* harmony default export */\n\n\n __webpack_exports__[\"default\"] = {\n parseDirective: parseDirective,\n getConfig: function getConfig() {\n return _config__WEBPACK_IMPORTED_MODULE_3__[\"getConfig\"]().state;\n },\n addState: addState,\n clear: clear,\n getState: getState,\n getStates: getStates,\n getRelations: getRelations,\n getClasses: getClasses,\n getDirection: getDirection,\n addRelation: addRelation,\n getDividerId: getDividerId,\n // addDescription,\n cleanupLabel: cleanupLabel,\n lineType: lineType,\n relationType: relationType,\n logDocuments: logDocuments,\n getRootDoc: getRootDoc,\n setRootDoc: setRootDoc,\n getRootDocV2: getRootDocV2,\n extract: extract,\n trimColon: trimColon\n };\n /***/\n },\n\n /***/\n \"./src/diagrams/state/stateRenderer-v2.js\":\n /*!************************************************!*\\\n !*** ./src/diagrams/state/stateRenderer-v2.js ***!\n \\************************************************/\n\n /*! exports provided: setConf, getClasses, draw, default */\n\n /***/\n function srcDiagramsStateStateRendererV2Js(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"setConf\", function () {\n return setConf;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getClasses\", function () {\n return getClasses;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"draw\", function () {\n return draw;\n });\n /* harmony import */\n\n\n var graphlib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! graphlib */\n \"graphlib\");\n /* harmony import */\n\n\n var graphlib__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_0__);\n /* harmony import */\n\n\n var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! d3 */\n \"d3\");\n /* harmony import */\n\n\n var d3__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_1__);\n /* harmony import */\n\n\n var _stateDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\n /*! ./stateDb */\n \"./src/diagrams/state/stateDb.js\");\n /* harmony import */\n\n\n var _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\n /*! ./parser/stateDiagram */\n \"./src/diagrams/state/parser/stateDiagram.jison\");\n /* harmony import */\n\n\n var _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_3__);\n /* harmony import */\n\n\n var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(\n /*! ../../config */\n \"./src/config.js\");\n /* harmony import */\n\n\n var _dagre_wrapper_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(\n /*! ../../dagre-wrapper/index.js */\n \"./src/dagre-wrapper/index.js\");\n /* harmony import */\n\n\n var _logger__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(\n /*! ../../logger */\n \"./src/logger.js\");\n\n var conf = {};\n\n var setConf = function setConf(cnf) {\n var keys = Object.keys(cnf);\n\n for (var i = 0; i < keys.length; i++) {\n conf[keys[i]] = cnf[keys[i]];\n }\n };\n\n var nodeDb = {};\n /**\n * Returns the all the styles from classDef statements in the graph definition.\n * @returns {object} classDef styles\n */\n\n var getClasses = function getClasses(text) {\n _logger__WEBPACK_IMPORTED_MODULE_6__[\"logger\"].trace('Extracting classes');\n\n _stateDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"].clear();\n\n var parser = _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_3___default.a.parser;\n parser.yy = _stateDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; // Parse the graph definition\n\n parser.parse(text);\n return _stateDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getClasses();\n };\n\n var setupNode = function setupNode(g, parent, node, altFlag) {\n // Add the node\n if (node.id !== 'root') {\n var shape = 'rect';\n\n if (node.start === true) {\n shape = 'start';\n }\n\n if (node.start === false) {\n shape = 'end';\n }\n\n if (node.type !== 'default') {\n shape = node.type;\n }\n\n if (!nodeDb[node.id]) {\n nodeDb[node.id] = {\n id: node.id,\n shape: shape,\n description: node.id,\n classes: 'statediagram-state'\n };\n } // Build of the array of description strings accordinging\n\n\n if (node.description) {\n if (Array.isArray(nodeDb[node.id].description)) {\n // There already is an array of strings,add to it\n nodeDb[node.id].shape = 'rectWithTitle';\n nodeDb[node.id].description.push(node.description);\n } else {\n if (nodeDb[node.id].description.length > 0) {\n // if there is a description already transformit to an array\n nodeDb[node.id].shape = 'rectWithTitle';\n\n if (nodeDb[node.id].description === node.id) {\n // If the previous description was the is, remove it\n nodeDb[node.id].description = [node.description];\n } else {\n nodeDb[node.id].description = [nodeDb[node.id].description, node.description];\n }\n } else {\n nodeDb[node.id].shape = 'rect';\n nodeDb[node.id].description = node.description;\n }\n }\n } // Save data for description and group so that for instance a statement without description overwrites\n // one with description\n // group\n\n\n if (!nodeDb[node.id].type && node.doc) {\n _logger__WEBPACK_IMPORTED_MODULE_6__[\"logger\"].info('Setting cluser for ', node.id);\n\n nodeDb[node.id].type = 'group';\n nodeDb[node.id].shape = node.type === 'divider' ? 'divider' : 'roundedWithTitle';\n nodeDb[node.id].classes = nodeDb[node.id].classes + ' ' + (altFlag ? 'statediagram-cluster statediagram-cluster-alt' : 'statediagram-cluster');\n }\n\n var nodeData = {\n labelStyle: '',\n shape: nodeDb[node.id].shape,\n labelText: nodeDb[node.id].description,\n classes: nodeDb[node.id].classes,\n //classStr,\n style: '',\n //styles.style,\n id: node.id,\n type: nodeDb[node.id].type,\n padding: 15 //getConfig().flowchart.padding\n\n };\n\n if (node.note) {\n // Todo: set random id\n var noteData = {\n labelStyle: '',\n shape: 'note',\n labelText: node.note.text,\n classes: 'statediagram-note',\n //classStr,\n style: '',\n //styles.style,\n id: node.id + '----note',\n type: nodeDb[node.id].type,\n padding: 15 //getConfig().flowchart.padding\n\n };\n var groupData = {\n labelStyle: '',\n shape: 'noteGroup',\n labelText: node.note.text,\n classes: nodeDb[node.id].classes,\n //classStr,\n style: '',\n //styles.style,\n id: node.id + '----parent',\n type: 'group',\n padding: 0 //getConfig().flowchart.padding\n\n };\n g.setNode(node.id + '----parent', groupData);\n g.setNode(noteData.id, noteData);\n g.setNode(node.id, nodeData);\n g.setParent(node.id, node.id + '----parent');\n g.setParent(noteData.id, node.id + '----parent');\n var from = node.id;\n var to = noteData.id;\n\n if (node.note.position === 'left of') {\n from = noteData.id;\n to = node.id;\n }\n\n g.setEdge(from, to, {\n arrowhead: 'none',\n arrowType: '',\n style: 'fill:none',\n labelStyle: '',\n classes: 'transition note-edge',\n arrowheadStyle: 'fill: #333',\n labelpos: 'c',\n labelType: 'text',\n thickness: 'normal'\n });\n } else {\n g.setNode(node.id, nodeData);\n }\n }\n\n if (parent) {\n if (parent.id !== 'root') {\n _logger__WEBPACK_IMPORTED_MODULE_6__[\"logger\"].info('Setting node ', node.id, ' to be child of its parent ', parent.id);\n\n g.setParent(node.id, parent.id);\n }\n }\n\n if (node.doc) {\n _logger__WEBPACK_IMPORTED_MODULE_6__[\"logger\"].info('Adding nodes children ');\n\n setupDoc(g, node, node.doc, !altFlag);\n }\n };\n\n var cnt = 0;\n\n var setupDoc = function setupDoc(g, parent, doc, altFlag) {\n _logger__WEBPACK_IMPORTED_MODULE_6__[\"logger\"].trace('items', doc);\n\n doc.forEach(function (item) {\n if (item.stmt === 'state' || item.stmt === 'default') {\n setupNode(g, parent, item, altFlag);\n } else if (item.stmt === 'relation') {\n setupNode(g, parent, item.state1, altFlag);\n setupNode(g, parent, item.state2, altFlag);\n var edgeData = {\n id: 'edge' + cnt,\n arrowhead: 'normal',\n arrowTypeEnd: 'arrow_barb',\n style: 'fill:none',\n labelStyle: '',\n label: item.description,\n arrowheadStyle: 'fill: #333',\n labelpos: 'c',\n labelType: 'text',\n thickness: 'normal',\n classes: 'transition'\n };\n var startId = item.state1.id;\n var endId = item.state2.id;\n g.setEdge(startId, endId, edgeData, cnt);\n cnt++;\n }\n });\n };\n /**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n * @param text\n * @param id\n */\n\n\n var draw = function draw(text, id) {\n _logger__WEBPACK_IMPORTED_MODULE_6__[\"logger\"].info('Drawing state diagram (v2)', id);\n\n _stateDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"].clear();\n\n nodeDb = {};\n var parser = _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_3___default.a.parser;\n parser.yy = _stateDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; // Parse the graph definition\n // try {\n\n parser.parse(text); // } catch (err) {\n // logger.error('Parsing failed', err);\n // }\n // Fetch the default direction, use TD if none was found\n\n var dir = _stateDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getDirection();\n\n if (typeof dir === 'undefined') {\n dir = 'LR';\n }\n\n var conf = Object(_config__WEBPACK_IMPORTED_MODULE_4__[\"getConfig\"])().state;\n var nodeSpacing = conf.nodeSpacing || 50;\n var rankSpacing = conf.rankSpacing || 50; // Create the input mermaid.graph\n\n var g = new graphlib__WEBPACK_IMPORTED_MODULE_0___default.a.Graph({\n multigraph: true,\n compound: true\n }).setGraph({\n rankdir: 'TB',\n nodesep: nodeSpacing,\n ranksep: rankSpacing,\n marginx: 8,\n marginy: 8\n }).setDefaultEdgeLabel(function () {\n return {};\n });\n\n _logger__WEBPACK_IMPORTED_MODULE_6__[\"logger\"].info(_stateDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getRootDocV2());\n\n _stateDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extract(_stateDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getRootDocV2());\n\n _logger__WEBPACK_IMPORTED_MODULE_6__[\"logger\"].info(_stateDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getRootDocV2());\n\n setupNode(g, undefined, _stateDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getRootDocV2(), true); // Set up an SVG group so that we can translate the final graph.\n\n var svg = Object(d3__WEBPACK_IMPORTED_MODULE_1__[\"select\"])(\"[id=\\\"\".concat(id, \"\\\"]\")); // Run the renderer. This is what draws the final graph.\n\n var element = Object(d3__WEBPACK_IMPORTED_MODULE_1__[\"select\"])('#' + id + ' g');\n Object(_dagre_wrapper_index_js__WEBPACK_IMPORTED_MODULE_5__[\"render\"])(element, g, ['barb'], 'statediagram', id);\n var padding = 8; // const svgBounds = svg.node().getBBox();\n // const width = svgBounds.width + padding * 2;\n // const height = svgBounds.height + padding * 2;\n // logger.debug(\n // `new ViewBox 0 0 ${width} ${height}`,\n // `translate(${padding + g._label.marginx}, ${padding + g._label.marginy})`\n // );\n // if (conf.useMaxWidth) {\n // svg.attr('width', '100%');\n // svg.attr('style', `max-width: ${width}px;`);\n // } else {\n // svg.attr('height', height);\n // svg.attr('width', width);\n // }\n // svg.attr('viewBox', `0 0 ${width} ${height}`);\n // svg\n // .select('g')\n // .attr('transform', `translate(${padding - g._label.marginx}, ${padding - svgBounds.y})`);\n\n var bounds = svg.node().getBBox();\n var width = bounds.width + padding * 2;\n var height = bounds.height + padding * 2; // diagram.attr('height', '100%');\n // diagram.attr('style', `width: ${bounds.width * 3 + conf.padding * 2};`);\n // diagram.attr('height', height);\n // Zoom in a bit\n\n svg.attr('width', width * 1.75);\n svg.attr('class', 'statediagram'); // diagram.attr('height', bounds.height * 3 + conf.padding * 2);\n // svg.attr(\n // 'viewBox',\n // `${bounds.x - conf.padding} ${bounds.y - conf.padding} ` + width + ' ' + height\n // );\n\n var svgBounds = svg.node().getBBox();\n\n if (conf.useMaxWidth) {\n svg.attr('width', '100%');\n svg.attr('style', \"max-width: \".concat(width, \"px;\"));\n } else {\n svg.attr('height', height);\n svg.attr('width', width);\n } // Ensure the viewBox includes the whole svgBounds area with extra space for padding\n\n\n var vBox = \"\".concat(svgBounds.x - padding, \" \").concat(svgBounds.y - padding, \" \").concat(width, \" \").concat(height);\n\n _logger__WEBPACK_IMPORTED_MODULE_6__[\"logger\"].debug(\"viewBox \".concat(vBox));\n\n svg.attr('viewBox', vBox); // Add label rects for non html labels\n\n if (!conf.htmlLabels) {\n var labels = document.querySelectorAll('[id=\"' + id + '\"] .edgeLabel .label');\n\n for (var k = 0; k < labels.length; k++) {\n var label = labels[k]; // Get dimensions of label\n\n var dim = label.getBBox();\n var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');\n rect.setAttribute('rx', 0);\n rect.setAttribute('ry', 0);\n rect.setAttribute('width', dim.width);\n rect.setAttribute('height', dim.height);\n label.insertBefore(rect, label.firstChild);\n }\n }\n };\n /* harmony default export */\n\n\n __webpack_exports__[\"default\"] = {\n setConf: setConf,\n getClasses: getClasses,\n draw: draw\n };\n /***/\n },\n\n /***/\n \"./src/diagrams/state/stateRenderer.js\":\n /*!*********************************************!*\\\n !*** ./src/diagrams/state/stateRenderer.js ***!\n \\*********************************************/\n\n /*! exports provided: setConf, draw, default */\n\n /***/\n function srcDiagramsStateStateRendererJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"setConf\", function () {\n return setConf;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"draw\", function () {\n return draw;\n });\n /* harmony import */\n\n\n var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! d3 */\n \"d3\");\n /* harmony import */\n\n\n var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);\n /* harmony import */\n\n\n var dagre__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! dagre */\n \"dagre\");\n /* harmony import */\n\n\n var dagre__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_1__);\n /* harmony import */\n\n\n var graphlib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\n /*! graphlib */\n \"graphlib\");\n /* harmony import */\n\n\n var graphlib__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_2__);\n /* harmony import */\n\n\n var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\n /*! ../../logger */\n \"./src/logger.js\");\n /* harmony import */\n\n\n var _stateDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(\n /*! ./stateDb */\n \"./src/diagrams/state/stateDb.js\");\n /* harmony import */\n\n\n var _common_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(\n /*! ../common/common */\n \"./src/diagrams/common/common.js\");\n /* harmony import */\n\n\n var _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(\n /*! ./parser/stateDiagram */\n \"./src/diagrams/state/parser/stateDiagram.jison\");\n /* harmony import */\n\n\n var _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_6__);\n /* harmony import */\n\n\n var _shapes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(\n /*! ./shapes */\n \"./src/diagrams/state/shapes.js\");\n /* harmony import */\n\n\n var _config__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(\n /*! ../../config */\n \"./src/config.js\"); // import idCache from './id-cache';\n\n\n _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_6__[\"parser\"].yy = _stateDb__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; // TODO Move conf object to main conf in mermaidAPI\n\n var conf;\n var transformationLog = {};\n\n var setConf = function setConf() {}; // Todo optimize\n\n /**\n * Setup arrow head and define the marker. The result is appended to the svg.\n */\n\n\n var insertMarkers = function insertMarkers(elem) {\n elem.append('defs').append('marker').attr('id', 'dependencyEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 19,7 L9,13 L14,7 L9,1 Z');\n };\n /**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n * @param text\n * @param id\n */\n\n\n var draw = function draw(text, id) {\n conf = Object(_config__WEBPACK_IMPORTED_MODULE_8__[\"getConfig\"])().state;\n\n _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_6__[\"parser\"].yy.clear();\n\n _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_6__[\"parser\"].parse(text);\n\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].debug('Rendering diagram ' + text); // Fetch the default direction, use TD if none was found\n\n\n var diagram = Object(d3__WEBPACK_IMPORTED_MODULE_0__[\"select\"])(\"[id='\".concat(id, \"']\"));\n insertMarkers(diagram); // Layout graph, Create a new directed graph\n\n var graph = new graphlib__WEBPACK_IMPORTED_MODULE_2___default.a.Graph({\n multigraph: true,\n compound: true,\n // acyclicer: 'greedy',\n rankdir: 'RL' // ranksep: '20'\n\n }); // Default to assigning a new object as a label for each new edge.\n\n graph.setDefaultEdgeLabel(function () {\n return {};\n });\n\n var rootDoc = _stateDb__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getRootDoc();\n\n renderDoc(rootDoc, diagram, undefined, false);\n var padding = conf.padding;\n var bounds = diagram.node().getBBox();\n var width = bounds.width + padding * 2;\n var height = bounds.height + padding * 2;\n\n if (conf.useMaxWidth) {\n diagram.attr('width', '100%');\n diagram.attr('style', \"max-width: \".concat(width * 1.75, \"px;\"));\n } else {\n // Zoom in a bit\n diagram.attr('width', width * 1.75);\n } // diagram.attr('height', bounds.height * 3 + conf.padding * 2);\n\n\n diagram.attr('viewBox', \"\".concat(bounds.x - conf.padding, \" \").concat(bounds.y - conf.padding, \" \") + width + ' ' + height);\n };\n\n var getLabelWidth = function getLabelWidth(text) {\n return text ? text.length * conf.fontSizeFactor : 1;\n };\n\n var renderDoc = function renderDoc(doc, diagram, parentId, altBkg) {\n // // Layout graph, Create a new directed graph\n var graph = new graphlib__WEBPACK_IMPORTED_MODULE_2___default.a.Graph({\n compound: true,\n multigraph: true\n });\n var i;\n var edgeFreeDoc = true;\n\n for (i = 0; i < doc.length; i++) {\n if (doc[i].stmt === 'relation') {\n edgeFreeDoc = false;\n break;\n }\n } // Set an object for the graph label\n\n\n if (parentId) graph.setGraph({\n rankdir: 'LR',\n multigraph: true,\n compound: true,\n // acyclicer: 'greedy',\n ranker: 'tight-tree',\n ranksep: edgeFreeDoc ? 1 : conf.edgeLengthFactor,\n nodeSep: edgeFreeDoc ? 1 : 50,\n isMultiGraph: true // ranksep: 5,\n // nodesep: 1\n\n });else {\n graph.setGraph({\n rankdir: 'TB',\n multigraph: true,\n compound: true,\n // isCompound: true,\n // acyclicer: 'greedy',\n // ranker: 'longest-path'\n ranksep: edgeFreeDoc ? 1 : conf.edgeLengthFactor,\n nodeSep: edgeFreeDoc ? 1 : 50,\n ranker: 'tight-tree',\n // ranker: 'network-simplex'\n isMultiGraph: true\n });\n } // Default to assigning a new object as a label for each new edge.\n\n graph.setDefaultEdgeLabel(function () {\n return {};\n });\n\n _stateDb__WEBPACK_IMPORTED_MODULE_4__[\"default\"].extract(doc);\n\n var states = _stateDb__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getStates();\n\n var relations = _stateDb__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getRelations();\n\n var keys = Object.keys(states);\n var first = true;\n\n for (var _i = 0; _i < keys.length; _i++) {\n var stateDef = states[keys[_i]];\n\n if (parentId) {\n stateDef.parentId = parentId;\n }\n\n var node = void 0;\n\n if (stateDef.doc) {\n var sub = diagram.append('g').attr('id', stateDef.id).attr('class', 'stateGroup');\n node = renderDoc(stateDef.doc, sub, stateDef.id, !altBkg);\n\n if (first) {\n // first = false;\n sub = Object(_shapes__WEBPACK_IMPORTED_MODULE_7__[\"addTitleAndBox\"])(sub, stateDef, altBkg);\n var boxBounds = sub.node().getBBox();\n node.width = boxBounds.width;\n node.height = boxBounds.height + conf.padding / 2;\n transformationLog[stateDef.id] = {\n y: conf.compositTitleSize\n };\n } else {\n // sub = addIdAndBox(sub, stateDef);\n var _boxBounds = sub.node().getBBox();\n\n node.width = _boxBounds.width;\n node.height = _boxBounds.height; // transformationLog[stateDef.id] = { y: conf.compositTitleSize };\n }\n } else {\n node = Object(_shapes__WEBPACK_IMPORTED_MODULE_7__[\"drawState\"])(diagram, stateDef, graph);\n }\n\n if (stateDef.note) {\n // Draw note note\n var noteDef = {\n descriptions: [],\n id: stateDef.id + '-note',\n note: stateDef.note,\n type: 'note'\n };\n var note = Object(_shapes__WEBPACK_IMPORTED_MODULE_7__[\"drawState\"])(diagram, noteDef, graph); // graph.setNode(node.id, node);\n\n if (stateDef.note.position === 'left of') {\n graph.setNode(node.id + '-note', note);\n graph.setNode(node.id, node);\n } else {\n graph.setNode(node.id, node);\n graph.setNode(node.id + '-note', note);\n } // graph.setNode(node.id);\n\n\n graph.setParent(node.id, node.id + '-group');\n graph.setParent(node.id + '-note', node.id + '-group');\n } else {\n // Add nodes to the graph. The first argument is the node id. The second is\n // metadata about the node. In this case we're going to add labels to each of\n // our nodes.\n graph.setNode(node.id, node);\n }\n }\n\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].debug('Count=', graph.nodeCount(), graph);\n\n var cnt = 0;\n relations.forEach(function (relation) {\n cnt++;\n\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].debug('Setting edge', relation);\n\n graph.setEdge(relation.id1, relation.id2, {\n relation: relation,\n width: getLabelWidth(relation.title),\n height: conf.labelHeight * _common_common__WEBPACK_IMPORTED_MODULE_5__[\"default\"].getRows(relation.title).length,\n labelpos: 'c'\n }, 'id' + cnt);\n });\n dagre__WEBPACK_IMPORTED_MODULE_1___default.a.layout(graph);\n\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].debug('Graph after layout', graph.nodes());\n\n var svgElem = diagram.node();\n graph.nodes().forEach(function (v) {\n if (typeof v !== 'undefined' && typeof graph.node(v) !== 'undefined') {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].warn('Node ' + v + ': ' + JSON.stringify(graph.node(v)));\n\n Object(d3__WEBPACK_IMPORTED_MODULE_0__[\"select\"])('#' + svgElem.id + ' #' + v).attr('transform', 'translate(' + (graph.node(v).x - graph.node(v).width / 2) + ',' + (graph.node(v).y + (transformationLog[v] ? transformationLog[v].y : 0) - graph.node(v).height / 2) + ' )');\n Object(d3__WEBPACK_IMPORTED_MODULE_0__[\"select\"])('#' + svgElem.id + ' #' + v).attr('data-x-shift', graph.node(v).x - graph.node(v).width / 2);\n var dividers = document.querySelectorAll('#' + svgElem.id + ' #' + v + ' .divider');\n dividers.forEach(function (divider) {\n var parent = divider.parentElement;\n var pWidth = 0;\n var pShift = 0;\n\n if (parent) {\n if (parent.parentElement) pWidth = parent.parentElement.getBBox().width;\n pShift = parseInt(parent.getAttribute('data-x-shift'), 10);\n\n if (Number.isNaN(pShift)) {\n pShift = 0;\n }\n }\n\n divider.setAttribute('x1', 0 - pShift + 8);\n divider.setAttribute('x2', pWidth - pShift - 8);\n });\n } else {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].debug('No Node ' + v + ': ' + JSON.stringify(graph.node(v)));\n }\n });\n var stateBox = svgElem.getBBox();\n graph.edges().forEach(function (e) {\n if (typeof e !== 'undefined' && typeof graph.edge(e) !== 'undefined') {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(graph.edge(e)));\n\n Object(_shapes__WEBPACK_IMPORTED_MODULE_7__[\"drawEdge\"])(diagram, graph.edge(e), graph.edge(e).relation);\n }\n });\n stateBox = svgElem.getBBox();\n var stateInfo = {\n id: parentId ? parentId : 'root',\n label: parentId ? parentId : 'root',\n width: 0,\n height: 0\n };\n stateInfo.width = stateBox.width + 2 * conf.padding;\n stateInfo.height = stateBox.height + 2 * conf.padding;\n\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].debug('Doc rendered', stateInfo, graph);\n\n return stateInfo;\n };\n /* harmony default export */\n\n\n __webpack_exports__[\"default\"] = {\n setConf: setConf,\n draw: draw\n };\n /***/\n },\n\n /***/\n \"./src/diagrams/state/styles.js\":\n /*!**************************************!*\\\n !*** ./src/diagrams/state/styles.js ***!\n \\**************************************/\n\n /*! exports provided: default */\n\n /***/\n function srcDiagramsStateStylesJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n\n var getStyles = function getStyles(options) {\n return \"g.stateGroup text {\\n fill: \".concat(options.nodeBorder, \";\\n stroke: none;\\n font-size: 10px;\\n}\\ng.stateGroup text {\\n fill: \").concat(options.textColor, \";\\n stroke: none;\\n font-size: 10px;\\n\\n}\\ng.stateGroup .state-title {\\n font-weight: bolder;\\n fill: \").concat(options.labelColor, \";\\n}\\n\\ng.stateGroup rect {\\n fill: \").concat(options.mainBkg, \";\\n stroke: \").concat(options.nodeBorder, \";\\n}\\n\\ng.stateGroup line {\\n stroke: \").concat(options.lineColor, \";\\n stroke-width: 1;\\n}\\n\\n.transition {\\n stroke: \").concat(options.lineColor, \";\\n stroke-width: 1;\\n fill: none;\\n}\\n\\n.stateGroup .composit {\\n fill: \").concat(options.background, \";\\n border-bottom: 1px\\n}\\n\\n.stateGroup .alt-composit {\\n fill: #e0e0e0;\\n border-bottom: 1px\\n}\\n\\n.state-note {\\n stroke: \").concat(options.noteBorderColor, \";\\n fill: \").concat(options.noteBkgColor, \";\\n\\n text {\\n fill: black;\\n stroke: none;\\n font-size: 10px;\\n }\\n}\\n\\n.stateLabel .box {\\n stroke: none;\\n stroke-width: 0;\\n fill: \").concat(options.mainBkg, \";\\n opacity: 0.5;\\n}\\n\\n.edgeLabel .label rect {\\n fill: \").concat(options.tertiaryColor, \";\\n opacity: 0.5;\\n}\\n.edgeLabel .label text {\\n fill: \").concat(options.tertiaryTextColor, \";\\n}\\n.label div .edgeLabel {\\n color: \").concat(options.tertiaryTextColor, \";\\n}\\n\\n.stateLabel text {\\n fill: \").concat(options.labelColor, \";\\n font-size: 10px;\\n font-weight: bold;\\n}\\n\\n.node circle.state-start {\\n fill: \").concat(options.lineColor, \";\\n stroke: black;\\n}\\n.node circle.state-end {\\n fill: \").concat(options.primaryBorderColor, \";\\n stroke: \").concat(options.background, \";\\n stroke-width: 1.5\\n}\\n.end-state-inner {\\n fill: \").concat(options.background, \";\\n // stroke: \").concat(options.background, \";\\n stroke-width: 1.5\\n}\\n\\n.node rect {\\n fill: \").concat(options.mainBkg, \";\\n stroke: \").concat(options.nodeBorder, \";\\n stroke-width: 1px;\\n}\\n#statediagram-barbEnd {\\n fill: \").concat(options.lineColor, \";\\n}\\n\\n.statediagram-cluster rect {\\n fill: \").concat(options.mainBkg, \";\\n stroke: \").concat(options.nodeBorder, \";\\n stroke-width: 1px;\\n}\\n\\n.cluster-label, .nodeLabel {\\n color: \").concat(options.textColor, \";\\n}\\n\\n.statediagram-cluster rect.outer {\\n rx: 5px;\\n ry: 5px;\\n}\\n.statediagram-state .divider {\\n stroke: \").concat(options.nodeBorder, \";\\n}\\n\\n.statediagram-state .title-state {\\n rx: 5px;\\n ry: 5px;\\n}\\n.statediagram-cluster.statediagram-cluster .inner {\\n fill: \").concat(options.background, \";\\n}\\n.statediagram-cluster.statediagram-cluster-alt .inner {\\n fill: #e0e0e0;\\n}\\n\\n.statediagram-cluster .inner {\\n rx:0;\\n ry:0;\\n}\\n\\n.statediagram-state rect.basic {\\n rx: 5px;\\n ry: 5px;\\n}\\n.statediagram-state rect.divider {\\n stroke-dasharray: 10,10;\\n fill: \").concat(options.altBackground ? options.altBackground : '#efefef', \";\\n}\\n\\n.note-edge {\\n stroke-dasharray: 5;\\n}\\n\\n.statediagram-note rect {\\n fill: \").concat(options.noteBkgColor, \";\\n stroke: \").concat(options.noteBorderColor, \";\\n stroke-width: 1px;\\n rx: 0;\\n ry: 0;\\n}\\n.statediagram-note rect {\\n fill: \").concat(options.noteBkgColor, \";\\n stroke: \").concat(options.noteBorderColor, \";\\n stroke-width: 1px;\\n rx: 0;\\n ry: 0;\\n}\\n\\n.statediagram-note text {\\n fill: \").concat(options.noteTextColor, \";\\n}\\n\\n.statediagram-note .nodeLabel {\\n color: \").concat(options.noteTextColor, \";\\n}\\n\\n#dependencyStart, #dependencyEnd {\\n fill: \").concat(options.lineColor, \";\\n stroke: \").concat(options.lineColor, \";\\n stroke-width: 1;\\n}\\n\");\n };\n /* harmony default export */\n\n\n __webpack_exports__[\"default\"] = getStyles;\n /***/\n },\n\n /***/\n \"./src/diagrams/user-journey/journeyDb.js\":\n /*!************************************************!*\\\n !*** ./src/diagrams/user-journey/journeyDb.js ***!\n \\************************************************/\n\n /*! exports provided: parseDirective, clear, setTitle, getTitle, addSection, getSections, getTasks, addTask, addTaskOrg, default */\n\n /***/\n function srcDiagramsUserJourneyJourneyDbJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"parseDirective\", function () {\n return parseDirective;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"clear\", function () {\n return clear;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"setTitle\", function () {\n return setTitle;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getTitle\", function () {\n return getTitle;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"addSection\", function () {\n return addSection;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getSections\", function () {\n return getSections;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getTasks\", function () {\n return getTasks;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"addTask\", function () {\n return addTask;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"addTaskOrg\", function () {\n return addTaskOrg;\n });\n /* harmony import */\n\n\n var _mermaidAPI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! ../../mermaidAPI */\n \"./src/mermaidAPI.js\");\n /* harmony import */\n\n\n var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! ../../config */\n \"./src/config.js\");\n\n function _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n }\n\n function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n }\n\n function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n }\n\n function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n }\n\n var title = '';\n var currentSection = '';\n var sections = [];\n var tasks = [];\n var rawTasks = [];\n\n var parseDirective = function parseDirective(statement, context, type) {\n _mermaidAPI__WEBPACK_IMPORTED_MODULE_0__[\"default\"].parseDirective(this, statement, context, type);\n };\n\n var clear = function clear() {\n sections.length = 0;\n tasks.length = 0;\n currentSection = '';\n title = '';\n rawTasks.length = 0;\n };\n\n var setTitle = function setTitle(txt) {\n title = txt;\n };\n\n var getTitle = function getTitle() {\n return title;\n };\n\n var addSection = function addSection(txt) {\n currentSection = txt;\n sections.push(txt);\n };\n\n var getSections = function getSections() {\n return sections;\n };\n\n var getTasks = function getTasks() {\n var allItemsProcessed = compileTasks();\n var maxDepth = 100;\n var iterationCount = 0;\n\n while (!allItemsProcessed && iterationCount < maxDepth) {\n allItemsProcessed = compileTasks();\n iterationCount++;\n }\n\n tasks.push.apply(tasks, rawTasks);\n return tasks;\n };\n\n var updateActors = function updateActors() {\n var tempActors = [];\n tasks.forEach(function (task) {\n if (task.people) {\n tempActors.push.apply(tempActors, _toConsumableArray(task.people));\n }\n });\n var unique = new Set(tempActors);\n return _toConsumableArray(unique).sort();\n };\n\n var addTask = function addTask(descr, taskData) {\n var pieces = taskData.substr(1).split(':');\n var score = 0;\n var peeps = [];\n\n if (pieces.length === 1) {\n score = Number(pieces[0]);\n peeps = [];\n } else {\n score = Number(pieces[0]);\n peeps = pieces[1].split(',');\n }\n\n var peopleList = peeps.map(function (s) {\n return s.trim();\n });\n var rawTask = {\n section: currentSection,\n type: currentSection,\n people: peopleList,\n task: descr,\n score: score\n };\n rawTasks.push(rawTask);\n };\n\n var addTaskOrg = function addTaskOrg(descr) {\n var newTask = {\n section: currentSection,\n type: currentSection,\n description: descr,\n task: descr,\n classes: []\n };\n tasks.push(newTask);\n };\n\n var compileTasks = function compileTasks() {\n var compileTask = function compileTask(pos) {\n return rawTasks[pos].processed;\n };\n\n var allProcessed = true;\n\n for (var i = 0; i < rawTasks.length; i++) {\n compileTask(i);\n allProcessed = allProcessed && rawTasks[i].processed;\n }\n\n return allProcessed;\n };\n\n var getActors = function getActors() {\n return updateActors();\n };\n /* harmony default export */\n\n\n __webpack_exports__[\"default\"] = {\n parseDirective: parseDirective,\n getConfig: function getConfig() {\n return _config__WEBPACK_IMPORTED_MODULE_1__[\"getConfig\"]().journey;\n },\n clear: clear,\n setTitle: setTitle,\n getTitle: getTitle,\n addSection: addSection,\n getSections: getSections,\n getTasks: getTasks,\n addTask: addTask,\n addTaskOrg: addTaskOrg,\n getActors: getActors\n };\n /***/\n },\n\n /***/\n \"./src/diagrams/user-journey/journeyRenderer.js\":\n /*!******************************************************!*\\\n !*** ./src/diagrams/user-journey/journeyRenderer.js ***!\n \\******************************************************/\n\n /*! exports provided: setConf, draw, bounds, drawTasks, default */\n\n /***/\n function srcDiagramsUserJourneyJourneyRendererJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"setConf\", function () {\n return setConf;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"draw\", function () {\n return draw;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"bounds\", function () {\n return bounds;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawTasks\", function () {\n return drawTasks;\n });\n /* harmony import */\n\n\n var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! d3 */\n \"d3\");\n /* harmony import */\n\n\n var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);\n /* harmony import */\n\n\n var _parser_journey__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! ./parser/journey */\n \"./src/diagrams/user-journey/parser/journey.jison\");\n /* harmony import */\n\n\n var _parser_journey__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_parser_journey__WEBPACK_IMPORTED_MODULE_1__);\n /* harmony import */\n\n\n var _journeyDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\n /*! ./journeyDb */\n \"./src/diagrams/user-journey/journeyDb.js\");\n /* harmony import */\n\n\n var _svgDraw__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\n /*! ./svgDraw */\n \"./src/diagrams/user-journey/svgDraw.js\");\n\n _parser_journey__WEBPACK_IMPORTED_MODULE_1__[\"parser\"].yy = _journeyDb__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\n var conf = {\n leftMargin: 150,\n diagramMarginX: 50,\n diagramMarginY: 20,\n // Margin between tasks\n taskMargin: 50,\n // Width of task boxes\n width: 150,\n // Height of task boxes\n height: 50,\n taskFontSize: 14,\n taskFontFamily: '\"Open-Sans\", \"sans-serif\"',\n // Margin around loop boxes\n boxMargin: 10,\n boxTextMargin: 5,\n noteMargin: 10,\n // Space between messages\n messageMargin: 35,\n // Multiline message alignment\n messageAlign: 'center',\n // Depending on css styling this might need adjustment\n // Projects the edge of the diagram downwards\n bottomMarginAdj: 1,\n // width of activation box\n activationWidth: 10,\n // text placement as: tspan | fo | old only text as before\n textPlacement: 'fo',\n actorColours: ['#8FBC8F', '#7CFC00', '#00FFFF', '#20B2AA', '#B0E0E6', '#FFFFE0'],\n sectionFills: ['#191970', '#8B008B', '#4B0082', '#2F4F4F', '#800000', '#8B4513', '#00008B'],\n sectionColours: ['#fff']\n };\n\n var setConf = function setConf(cnf) {\n var keys = Object.keys(cnf);\n keys.forEach(function (key) {\n conf[key] = cnf[key];\n });\n };\n\n var actors = {};\n\n function drawActorLegend(diagram) {\n // Draw the actors\n var yPos = 60;\n Object.keys(actors).forEach(function (person) {\n var colour = actors[person];\n var circleData = {\n cx: 20,\n cy: yPos,\n r: 7,\n fill: colour,\n stroke: '#000'\n };\n\n _svgDraw__WEBPACK_IMPORTED_MODULE_3__[\"default\"].drawCircle(diagram, circleData);\n\n var labelData = {\n x: 40,\n y: yPos + 7,\n fill: '#666',\n text: person,\n textMargin: conf.boxTextMargin | 5\n };\n\n _svgDraw__WEBPACK_IMPORTED_MODULE_3__[\"default\"].drawText(diagram, labelData);\n\n yPos += 20;\n });\n }\n\n var LEFT_MARGIN = conf.leftMargin;\n\n var draw = function draw(text, id) {\n _parser_journey__WEBPACK_IMPORTED_MODULE_1__[\"parser\"].yy.clear();\n\n _parser_journey__WEBPACK_IMPORTED_MODULE_1__[\"parser\"].parse(text + '\\n');\n\n bounds.init();\n var diagram = Object(d3__WEBPACK_IMPORTED_MODULE_0__[\"select\"])('#' + id);\n diagram.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n\n _svgDraw__WEBPACK_IMPORTED_MODULE_3__[\"default\"].initGraphics(diagram);\n\n var tasks = _parser_journey__WEBPACK_IMPORTED_MODULE_1__[\"parser\"].yy.getTasks();\n\n var title = _parser_journey__WEBPACK_IMPORTED_MODULE_1__[\"parser\"].yy.getTitle();\n\n var actorNames = _parser_journey__WEBPACK_IMPORTED_MODULE_1__[\"parser\"].yy.getActors();\n\n for (var member in actors) {\n delete actors[member];\n }\n\n var actorPos = 0;\n actorNames.forEach(function (actorName) {\n actors[actorName] = conf.actorColours[actorPos % conf.actorColours.length];\n actorPos++;\n });\n drawActorLegend(diagram);\n bounds.insert(0, 0, LEFT_MARGIN, Object.keys(actors).length * 50);\n drawTasks(diagram, tasks, 0);\n var box = bounds.getBounds();\n\n if (title) {\n diagram.append('text').text(title).attr('x', LEFT_MARGIN).attr('font-size', '4ex').attr('font-weight', 'bold').attr('y', 25);\n }\n\n var height = box.stopy - box.starty + 2 * conf.diagramMarginY;\n var width = LEFT_MARGIN + box.stopx + 2 * conf.diagramMarginX;\n\n if (conf.useMaxWidth) {\n diagram.attr('height', '100%');\n diagram.attr('width', '100%');\n diagram.attr('style', 'max-width:' + width + 'px;');\n } else {\n diagram.attr('height', height);\n diagram.attr('width', width);\n } // Draw activity line\n\n\n diagram.append('line').attr('x1', LEFT_MARGIN).attr('y1', conf.height * 4) // One section head + one task + margins\n .attr('x2', width - LEFT_MARGIN - 4) // Subtract stroke width so arrow point is retained\n .attr('y2', conf.height * 4).attr('stroke-width', 4).attr('stroke', 'black').attr('marker-end', 'url(#arrowhead)');\n var extraVertForTitle = title ? 70 : 0;\n diagram.attr('viewBox', \"\".concat(box.startx, \" -25 \").concat(width, \" \").concat(height + extraVertForTitle));\n diagram.attr('preserveAspectRatio', 'xMinYMin meet');\n };\n\n var bounds = {\n data: {\n startx: undefined,\n stopx: undefined,\n starty: undefined,\n stopy: undefined\n },\n verticalPos: 0,\n sequenceItems: [],\n init: function init() {\n this.sequenceItems = [];\n this.data = {\n startx: undefined,\n stopx: undefined,\n starty: undefined,\n stopy: undefined\n };\n this.verticalPos = 0;\n },\n updateVal: function updateVal(obj, key, val, fun) {\n if (typeof obj[key] === 'undefined') {\n obj[key] = val;\n } else {\n obj[key] = fun(val, obj[key]);\n }\n },\n updateBounds: function updateBounds(startx, starty, stopx, stopy) {\n var _self = this;\n\n var cnt = 0;\n\n function updateFn(type) {\n return function updateItemBounds(item) {\n cnt++; // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems\n\n var n = _self.sequenceItems.length - cnt + 1;\n\n _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min);\n\n _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max);\n\n _self.updateVal(bounds.data, 'startx', startx - n * conf.boxMargin, Math.min);\n\n _self.updateVal(bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max);\n\n if (!(type === 'activation')) {\n _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min);\n\n _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max);\n\n _self.updateVal(bounds.data, 'starty', starty - n * conf.boxMargin, Math.min);\n\n _self.updateVal(bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max);\n }\n };\n }\n\n this.sequenceItems.forEach(updateFn());\n },\n insert: function insert(startx, starty, stopx, stopy) {\n var _startx = Math.min(startx, stopx);\n\n var _stopx = Math.max(startx, stopx);\n\n var _starty = Math.min(starty, stopy);\n\n var _stopy = Math.max(starty, stopy);\n\n this.updateVal(bounds.data, 'startx', _startx, Math.min);\n this.updateVal(bounds.data, 'starty', _starty, Math.min);\n this.updateVal(bounds.data, 'stopx', _stopx, Math.max);\n this.updateVal(bounds.data, 'stopy', _stopy, Math.max);\n this.updateBounds(_startx, _starty, _stopx, _stopy);\n },\n bumpVerticalPos: function bumpVerticalPos(bump) {\n this.verticalPos = this.verticalPos + bump;\n this.data.stopy = this.verticalPos;\n },\n getVerticalPos: function getVerticalPos() {\n return this.verticalPos;\n },\n getBounds: function getBounds() {\n return this.data;\n }\n };\n var fills = conf.sectionFills;\n var textColours = conf.sectionColours;\n\n var drawTasks = function drawTasks(diagram, tasks, verticalPos) {\n var lastSection = '';\n var sectionVHeight = conf.height * 2 + conf.diagramMarginY;\n var taskPos = verticalPos + sectionVHeight;\n var sectionNumber = 0;\n var fill = '#CCC';\n var colour = 'black';\n var num = 0; // Draw the tasks\n\n for (var i = 0; i < tasks.length; i++) {\n var task = tasks[i];\n\n if (lastSection !== task.section) {\n fill = fills[sectionNumber % fills.length];\n num = sectionNumber % fills.length;\n colour = textColours[sectionNumber % textColours.length];\n var section = {\n x: i * conf.taskMargin + i * conf.width + LEFT_MARGIN,\n y: 50,\n text: task.section,\n fill: fill,\n num: num,\n colour: colour\n };\n\n _svgDraw__WEBPACK_IMPORTED_MODULE_3__[\"default\"].drawSection(diagram, section, conf);\n\n lastSection = task.section;\n sectionNumber++;\n } // Collect the actors involved in the task\n\n\n var taskActors = task.people.reduce(function (acc, actorName) {\n if (actors[actorName]) {\n acc[actorName] = actors[actorName];\n }\n\n return acc;\n }, {}); // Add some rendering data to the object\n\n task.x = i * conf.taskMargin + i * conf.width + LEFT_MARGIN;\n task.y = taskPos;\n task.width = conf.diagramMarginX;\n task.height = conf.diagramMarginY;\n task.colour = colour;\n task.fill = fill;\n task.num = num;\n task.actors = taskActors; // Draw the box with the attached line\n\n _svgDraw__WEBPACK_IMPORTED_MODULE_3__[\"default\"].drawTask(diagram, task, conf);\n\n bounds.insert(task.x, task.y, task.x + task.width + conf.taskMargin, 300 + 5 * 30); // stopy is the length of the descenders.\n }\n };\n /* harmony default export */\n\n\n __webpack_exports__[\"default\"] = {\n setConf: setConf,\n draw: draw\n };\n /***/\n },\n\n /***/\n \"./src/diagrams/user-journey/parser/journey.jison\":\n /*!********************************************************!*\\\n !*** ./src/diagrams/user-journey/parser/journey.jison ***!\n \\********************************************************/\n\n /*! no static exports found */\n\n /***/\n function srcDiagramsUserJourneyParserJourneyJison(module, exports, __webpack_require__) {\n /* WEBPACK VAR INJECTION */\n (function (process, module) {\n /* parser generated by jison 0.4.18 */\n\n /*\n Returns a Parser object of the following structure:\n \n Parser: {\n yy: {}\n }\n \n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n \n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n \n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n 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)\n },\n \n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n \n \n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n \n \n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n */\n var parser = function () {\n var o = function o(k, v, _o10, l) {\n for (_o10 = _o10 || {}, l = k.length; l--; _o10[k[l]] = v) {\n ;\n }\n\n return _o10;\n },\n $V0 = [1, 2],\n $V1 = [1, 5],\n $V2 = [6, 9, 11, 17, 18, 19, 21],\n $V3 = [1, 15],\n $V4 = [1, 16],\n $V5 = [1, 17],\n $V6 = [1, 21],\n $V7 = [4, 6, 9, 11, 17, 18, 19, 21];\n\n var parser = {\n trace: function trace() {},\n yy: {},\n symbols_: {\n \"error\": 2,\n \"start\": 3,\n \"journey\": 4,\n \"document\": 5,\n \"EOF\": 6,\n \"directive\": 7,\n \"line\": 8,\n \"SPACE\": 9,\n \"statement\": 10,\n \"NEWLINE\": 11,\n \"openDirective\": 12,\n \"typeDirective\": 13,\n \"closeDirective\": 14,\n \":\": 15,\n \"argDirective\": 16,\n \"title\": 17,\n \"section\": 18,\n \"taskName\": 19,\n \"taskData\": 20,\n \"open_directive\": 21,\n \"type_directive\": 22,\n \"arg_directive\": 23,\n \"close_directive\": 24,\n \"$accept\": 0,\n \"$end\": 1\n },\n terminals_: {\n 2: \"error\",\n 4: \"journey\",\n 6: \"EOF\",\n 9: \"SPACE\",\n 11: \"NEWLINE\",\n 15: \":\",\n 17: \"title\",\n 18: \"section\",\n 19: \"taskName\",\n 20: \"taskData\",\n 21: \"open_directive\",\n 22: \"type_directive\",\n 23: \"arg_directive\",\n 24: \"close_directive\"\n },\n productions_: [0, [3, 3], [3, 2], [5, 0], [5, 2], [8, 2], [8, 1], [8, 1], [8, 1], [7, 4], [7, 6], [10, 1], [10, 1], [10, 2], [10, 1], [12, 1], [13, 1], [16, 1], [14, 1]],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate\n /* action[1] */\n , $$\n /* vstack */\n , _$\n /* lstack */\n ) {\n /* this == yyval */\n var $0 = $$.length - 1;\n\n switch (yystate) {\n case 1:\n return $$[$0 - 1];\n break;\n\n case 3:\n this.$ = [];\n break;\n\n case 4:\n $$[$0 - 1].push($$[$0]);\n this.$ = $$[$0 - 1];\n break;\n\n case 5:\n case 6:\n this.$ = $$[$0];\n break;\n\n case 7:\n case 8:\n this.$ = [];\n break;\n\n case 11:\n yy.setTitle($$[$0].substr(6));\n this.$ = $$[$0].substr(6);\n break;\n\n case 12:\n yy.addSection($$[$0].substr(8));\n this.$ = $$[$0].substr(8);\n break;\n\n case 13:\n yy.addTask($$[$0 - 1], $$[$0]);\n this.$ = 'task';\n break;\n\n case 15:\n yy.parseDirective('%%{', 'open_directive');\n break;\n\n case 16:\n yy.parseDirective($$[$0], 'type_directive');\n break;\n\n case 17:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"');\n yy.parseDirective($$[$0], 'arg_directive');\n break;\n\n case 18:\n yy.parseDirective('}%%', 'close_directive', 'journey');\n break;\n }\n },\n table: [{\n 3: 1,\n 4: $V0,\n 7: 3,\n 12: 4,\n 21: $V1\n }, {\n 1: [3]\n }, o($V2, [2, 3], {\n 5: 6\n }), {\n 3: 7,\n 4: $V0,\n 7: 3,\n 12: 4,\n 21: $V1\n }, {\n 13: 8,\n 22: [1, 9]\n }, {\n 22: [2, 15]\n }, {\n 6: [1, 10],\n 7: 18,\n 8: 11,\n 9: [1, 12],\n 10: 13,\n 11: [1, 14],\n 12: 4,\n 17: $V3,\n 18: $V4,\n 19: $V5,\n 21: $V1\n }, {\n 1: [2, 2]\n }, {\n 14: 19,\n 15: [1, 20],\n 24: $V6\n }, o([15, 24], [2, 16]), o($V2, [2, 8], {\n 1: [2, 1]\n }), o($V2, [2, 4]), {\n 7: 18,\n 10: 22,\n 12: 4,\n 17: $V3,\n 18: $V4,\n 19: $V5,\n 21: $V1\n }, o($V2, [2, 6]), o($V2, [2, 7]), o($V2, [2, 11]), o($V2, [2, 12]), {\n 20: [1, 23]\n }, o($V2, [2, 14]), {\n 11: [1, 24]\n }, {\n 16: 25,\n 23: [1, 26]\n }, {\n 11: [2, 18]\n }, o($V2, [2, 5]), o($V2, [2, 13]), o($V7, [2, 9]), {\n 14: 27,\n 24: $V6\n }, {\n 24: [2, 17]\n }, {\n 11: [1, 28]\n }, o($V7, [2, 10])],\n defaultActions: {\n 5: [2, 15],\n 7: [2, 2],\n 21: [2, 18],\n 26: [2, 17]\n },\n parseError: function parseError(str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n },\n parse: function parse(input) {\n var self = this,\n stack = [0],\n tstack = [],\n vstack = [null],\n lstack = [],\n table = this.table,\n yytext = '',\n yylineno = 0,\n yyleng = 0,\n recovering = 0,\n TERROR = 2,\n EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = {\n yy: {}\n };\n\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n\n token = self.symbols_[token] || token;\n }\n\n return token;\n }\n\n var symbol,\n preErrorSymbol,\n state,\n action,\n a,\n r,\n yyval = {},\n p,\n len,\n newState,\n expected;\n\n while (true) {\n state = stack[stack.length - 1];\n\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n\n action = table[state] && table[state][symbol];\n }\n\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n\n break;\n\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n\n if (ranges) {\n yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];\n }\n\n r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));\n\n if (typeof r !== 'undefined') {\n return r;\n }\n\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n\n case 3:\n return true;\n }\n }\n\n return true;\n }\n };\n /* generated by jison-lex 0.3.4 */\n\n var lexer = function () {\n var lexer = {\n EOF: 1,\n parseError: function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n // resets the lexer, sets new input\n setInput: function setInput(input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [0, 0];\n }\n\n this.offset = 0;\n return this;\n },\n // consumes and returns one char from the input\n input: function input() {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n // unshifts one char (or a string) into the input\n unput: function unput(ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len); //this.yyleng -= len;\n\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n\n var r = this.yylloc.range;\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n 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\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n\n this.yyleng = this.yytext.length;\n return this;\n },\n // When called from action, caches matched text and appends it on next action\n more: function more() {\n this._more = true;\n return this;\n },\n // 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.\n reject: function reject() {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n 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(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n\n return this;\n },\n // retain first n characters of the match\n less: function less(n) {\n this.unput(this.match.slice(n));\n },\n // displays already matched input, i.e. for error messages\n pastInput: function pastInput() {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\\n/g, \"\");\n },\n // displays upcoming input, i.e. for error messages\n upcomingInput: function upcomingInput() {\n var next = this.match;\n\n if (next.length < 20) {\n next += this._input.substr(0, 20 - next.length);\n }\n\n return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n // displays the character position where the lexing error occurred, i.e. for error messages\n showPosition: function showPosition() {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n // test the lexed token: return FALSE when not a match, otherwise return token\n test_match: function test_match(match, indexed_rule) {\n var token, lines, backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n\n if (lines) {\n this.yylineno += lines.length;\n }\n\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length : this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n\n if (this.done && this._input) {\n this.done = false;\n }\n\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n\n return false;\n },\n // return next match in input\n next: function next() {\n if (this.done) {\n return this.EOF;\n }\n\n if (!this._input) {\n this.done = true;\n }\n\n var token, match, tempMatch, index;\n\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n\n var rules = this._currentRules();\n\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n\n if (match) {\n token = this.test_match(match, rules[index]);\n\n if (token !== false) {\n return token;\n } // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n\n\n return false;\n }\n\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n // return next match that has a token\n lex: function lex() {\n var r = this.next();\n\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\n begin: function begin(condition) {\n this.conditionStack.push(condition);\n },\n // pop the previously active lexer condition state off the condition stack\n popState: function popState() {\n var n = this.conditionStack.length - 1;\n\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n // produce the lexer rule set which is active for the currently active lexer condition state\n _currentRules: function _currentRules() {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\n topState: function topState(n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n // alias for begin(condition)\n pushState: function pushState(condition) {\n this.begin(condition);\n },\n // return the number of states currently on the stack\n stateStackSize: function stateStackSize() {\n return this.conditionStack.length;\n },\n options: {\n \"case-insensitive\": true\n },\n performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {\n var YYSTATE = YY_START;\n\n switch ($avoiding_name_collisions) {\n case 0:\n this.begin('open_directive');\n return 21;\n break;\n\n case 1:\n this.begin('type_directive');\n return 22;\n break;\n\n case 2:\n this.popState();\n this.begin('arg_directive');\n return 15;\n break;\n\n case 3:\n this.popState();\n this.popState();\n return 24;\n break;\n\n case 4:\n return 23;\n break;\n\n case 5:\n /* skip comments */\n break;\n\n case 6:\n /* skip comments */\n break;\n\n case 7:\n return 11;\n break;\n\n case 8:\n /* skip whitespace */\n break;\n\n case 9:\n /* skip comments */\n break;\n\n case 10:\n return 4;\n break;\n\n case 11:\n return 17;\n break;\n\n case 12:\n return 18;\n break;\n\n case 13:\n return 19;\n break;\n\n case 14:\n return 20;\n break;\n\n case 15:\n return 15;\n break;\n\n case 16:\n return 6;\n break;\n\n case 17:\n return 'INVALID';\n break;\n }\n },\n rules: [/^(?:%%\\{)/i, /^(?:((?:(?!\\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\\}%%)/i, /^(?:((?:(?!\\}%%).|\\n)*))/i, /^(?:%(?!\\{)[^\\n]*)/i, /^(?:[^\\}]%%[^\\n]*)/i, /^(?:[\\n]+)/i, /^(?:\\s+)/i, /^(?:#[^\\n]*)/i, /^(?:journey\\b)/i, /^(?:title\\s[^#\\n;]+)/i, /^(?:section\\s[^#:\\n;]+)/i, /^(?:[^#:\\n;]+)/i, /^(?::[^#\\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i],\n conditions: {\n \"open_directive\": {\n \"rules\": [1],\n \"inclusive\": false\n },\n \"type_directive\": {\n \"rules\": [2, 3],\n \"inclusive\": false\n },\n \"arg_directive\": {\n \"rules\": [3, 4],\n \"inclusive\": false\n },\n \"INITIAL\": {\n \"rules\": [0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17],\n \"inclusive\": true\n }\n }\n };\n return lexer;\n }();\n\n parser.lexer = lexer;\n\n function Parser() {\n this.yy = {};\n }\n\n Parser.prototype = parser;\n parser.Parser = Parser;\n return new Parser();\n }();\n\n if (true) {\n exports.parser = parser;\n exports.Parser = parser.Parser;\n\n exports.parse = function () {\n return parser.parse.apply(parser, arguments);\n };\n\n exports.main = function commonjsMain(args) {\n if (!args[1]) {\n console.log('Usage: ' + args[0] + ' FILE');\n process.exit(1);\n }\n\n var source = __webpack_require__(\n /*! fs */\n \"./node_modules/node-libs-browser/mock/empty.js\").readFileSync(__webpack_require__(\n /*! path */\n \"./node_modules/path-browserify/index.js\").normalize(args[1]), \"utf8\");\n\n return exports.parser.parse(source);\n };\n\n if (true && __webpack_require__.c[__webpack_require__.s] === module) {\n exports.main(process.argv.slice(1));\n }\n }\n /* WEBPACK VAR INJECTION */\n\n }).call(this, __webpack_require__(\n /*! ./../../../../node_modules/process/browser.js */\n \"./node_modules/process/browser.js\"), __webpack_require__(\n /*! ./../../../../node_modules/webpack/buildin/module.js */\n \"./node_modules/webpack/buildin/module.js\")(module));\n /***/\n },\n\n /***/\n \"./src/diagrams/user-journey/styles.js\":\n /*!*********************************************!*\\\n !*** ./src/diagrams/user-journey/styles.js ***!\n \\*********************************************/\n\n /*! exports provided: default */\n\n /***/\n function srcDiagramsUserJourneyStylesJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n\n var getStyles = function getStyles(options) {\n return \".label {\\n font-family: 'trebuchet ms', verdana, arial;\\n font-family: var(--mermaid-font-family);\\n color: \".concat(options.textColor, \";\\n }\\n .mouth {\\n stroke: #666;\\n }\\n\\n line {\\n stroke: \").concat(options.textColor, \"\\n }\\n\\n .legend {\\n fill: \").concat(options.textColor, \";\\n }\\n\\n .label text {\\n fill: #333;\\n }\\n .label {\\n color: \").concat(options.textColor, \"\\n }\\n\\n .face {\\n fill: #FFF8DC;\\n stroke: #999;\\n }\\n\\n .node rect,\\n .node circle,\\n .node ellipse,\\n .node polygon,\\n .node path {\\n fill: \").concat(options.mainBkg, \";\\n stroke: \").concat(options.nodeBorder, \";\\n stroke-width: 1px;\\n }\\n\\n .node .label {\\n text-align: center;\\n }\\n .node.clickable {\\n cursor: pointer;\\n }\\n\\n .arrowheadPath {\\n fill: \").concat(options.arrowheadColor, \";\\n }\\n\\n .edgePath .path {\\n stroke: \").concat(options.lineColor, \";\\n stroke-width: 1.5px;\\n }\\n\\n .flowchart-link {\\n stroke: \").concat(options.lineColor, \";\\n fill: none;\\n }\\n\\n .edgeLabel {\\n background-color: \").concat(options.edgeLabelBackground, \";\\n rect {\\n opacity: 0.5;\\n }\\n text-align: center;\\n }\\n\\n .cluster rect {\\n }\\n\\n .cluster text {\\n fill: \").concat(options.titleColor, \";\\n }\\n\\n div.mermaidTooltip {\\n position: absolute;\\n text-align: center;\\n max-width: 200px;\\n padding: 2px;\\n font-family: 'trebuchet ms', verdana, arial;\\n font-family: var(--mermaid-font-family);\\n font-size: 12px;\\n background: \").concat(options.tertiaryColor, \";\\n border: 1px solid \").concat(options.border2, \";\\n border-radius: 2px;\\n pointer-events: none;\\n z-index: 100;\\n }\\n\\n .task-type-0, .section-type-0 {\\n \").concat(options.fillType0 ? \"fill: \".concat(options.fillType0) : '', \";\\n }\\n .task-type-1, .section-type-1 {\\n \").concat(options.fillType0 ? \"fill: \".concat(options.fillType1) : '', \";\\n }\\n .task-type-2, .section-type-2 {\\n \").concat(options.fillType0 ? \"fill: \".concat(options.fillType2) : '', \";\\n }\\n .task-type-3, .section-type-3 {\\n \").concat(options.fillType0 ? \"fill: \".concat(options.fillType3) : '', \";\\n }\\n .task-type-4, .section-type-4 {\\n \").concat(options.fillType0 ? \"fill: \".concat(options.fillType4) : '', \";\\n }\\n .task-type-5, .section-type-5 {\\n \").concat(options.fillType0 ? \"fill: \".concat(options.fillType5) : '', \";\\n }\\n .task-type-6, .section-type-6 {\\n \").concat(options.fillType0 ? \"fill: \".concat(options.fillType6) : '', \";\\n }\\n .task-type-7, .section-type-7 {\\n \").concat(options.fillType0 ? \"fill: \".concat(options.fillType7) : '', \";\\n }\\n\");\n };\n /* harmony default export */\n\n\n __webpack_exports__[\"default\"] = getStyles;\n /***/\n },\n\n /***/\n \"./src/diagrams/user-journey/svgDraw.js\":\n /*!**********************************************!*\\\n !*** ./src/diagrams/user-journey/svgDraw.js ***!\n \\**********************************************/\n\n /*! exports provided: drawRect, drawFace, drawCircle, drawText, drawLabel, drawSection, drawTask, drawBackgroundRect, getTextObj, getNoteRect, default */\n\n /***/\n function srcDiagramsUserJourneySvgDrawJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawRect\", function () {\n return drawRect;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawFace\", function () {\n return drawFace;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawCircle\", function () {\n return drawCircle;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawText\", function () {\n return drawText;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawLabel\", function () {\n return drawLabel;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawSection\", function () {\n return drawSection;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawTask\", function () {\n return drawTask;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawBackgroundRect\", function () {\n return drawBackgroundRect;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getTextObj\", function () {\n return getTextObj;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getNoteRect\", function () {\n return getNoteRect;\n });\n /* harmony import */\n\n\n var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! d3 */\n \"d3\");\n /* harmony import */\n\n\n var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);\n\n var drawRect = function drawRect(elem, rectData) {\n var rectElem = elem.append('rect');\n rectElem.attr('x', rectData.x);\n rectElem.attr('y', rectData.y);\n rectElem.attr('fill', rectData.fill);\n rectElem.attr('stroke', rectData.stroke);\n rectElem.attr('width', rectData.width);\n rectElem.attr('height', rectData.height);\n rectElem.attr('rx', rectData.rx);\n rectElem.attr('ry', rectData.ry);\n\n if (typeof rectData.class !== 'undefined') {\n rectElem.attr('class', rectData.class);\n }\n\n return rectElem;\n };\n\n var drawFace = function drawFace(element, faceData) {\n var radius = 15;\n var circleElement = element.append('circle').attr('cx', faceData.cx).attr('cy', faceData.cy).attr('class', 'face').attr('r', radius).attr('stroke-width', 2).attr('overflow', 'visible');\n var face = element.append('g'); //left eye\n\n face.append('circle').attr('cx', faceData.cx - radius / 3).attr('cy', faceData.cy - radius / 3).attr('r', 1.5).attr('stroke-width', 2).attr('fill', '#666').attr('stroke', '#666'); //right eye\n\n face.append('circle').attr('cx', faceData.cx + radius / 3).attr('cy', faceData.cy - radius / 3).attr('r', 1.5).attr('stroke-width', 2).attr('fill', '#666').attr('stroke', '#666');\n\n function smile(face) {\n var arc = Object(d3__WEBPACK_IMPORTED_MODULE_0__[\"arc\"])().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2); //mouth\n\n face.append('path').attr('class', 'mouth').attr('d', arc).attr('transform', 'translate(' + faceData.cx + ',' + (faceData.cy + 2) + ')');\n }\n\n function sad(face) {\n var arc = Object(d3__WEBPACK_IMPORTED_MODULE_0__[\"arc\"])().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2); //mouth\n\n face.append('path').attr('class', 'mouth').attr('d', arc).attr('transform', 'translate(' + faceData.cx + ',' + (faceData.cy + 7) + ')');\n }\n\n function ambivalent(face) {\n face.append('line').attr('class', 'mouth').attr('stroke', 2).attr('x1', faceData.cx - 5).attr('y1', faceData.cy + 7).attr('x2', faceData.cx + 5).attr('y2', faceData.cy + 7).attr('class', 'mouth').attr('stroke-width', '1px').attr('stroke', '#666');\n }\n\n if (faceData.score > 3) {\n smile(face);\n } else if (faceData.score < 3) {\n sad(face);\n } else {\n ambivalent(face);\n }\n\n return circleElement;\n };\n\n var drawCircle = function drawCircle(element, circleData) {\n var circleElement = element.append('circle');\n circleElement.attr('cx', circleData.cx);\n circleElement.attr('cy', circleData.cy);\n circleElement.attr('fill', circleData.fill);\n circleElement.attr('stroke', circleData.stroke);\n circleElement.attr('r', circleData.r);\n\n if (typeof circleElement.class !== 'undefined') {\n circleElement.attr('class', circleElement.class);\n }\n\n if (typeof circleData.title !== 'undefined') {\n circleElement.append('title').text(circleData.title);\n }\n\n return circleElement;\n };\n\n var drawText = function drawText(elem, textData) {\n // Remove and ignore br:s\n var nText = textData.text.replace(/
/gi, ' ');\n var textElem = elem.append('text');\n textElem.attr('x', textData.x);\n textElem.attr('y', textData.y);\n textElem.attr('class', 'legend');\n textElem.style('text-anchor', textData.anchor);\n\n if (typeof textData.class !== 'undefined') {\n textElem.attr('class', textData.class);\n }\n\n var span = textElem.append('tspan');\n span.attr('x', textData.x + textData.textMargin * 2);\n span.text(nText);\n return textElem;\n };\n\n var drawLabel = function drawLabel(elem, txtObject) {\n function genPoints(x, y, width, height, cut) {\n return x + ',' + y + ' ' + (x + width) + ',' + y + ' ' + (x + width) + ',' + (y + height - cut) + ' ' + (x + width - cut * 1.2) + ',' + (y + height) + ' ' + x + ',' + (y + height);\n }\n\n var polygon = elem.append('polygon');\n polygon.attr('points', genPoints(txtObject.x, txtObject.y, 50, 20, 7));\n polygon.attr('class', 'labelBox');\n txtObject.y = txtObject.y + txtObject.labelMargin;\n txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;\n drawText(elem, txtObject);\n };\n\n var drawSection = function drawSection(elem, section, conf) {\n var g = elem.append('g');\n var rect = getNoteRect();\n rect.x = section.x;\n rect.y = section.y;\n rect.fill = section.fill;\n rect.width = conf.width;\n rect.height = conf.height;\n rect.class = 'journey-section section-type-' + section.num;\n rect.rx = 3;\n rect.ry = 3;\n drawRect(g, rect);\n\n _drawTextCandidateFunc(conf)(section.text, g, rect.x, rect.y, rect.width, rect.height, {\n class: 'journey-section section-type-' + section.num\n }, conf, section.colour);\n };\n\n var taskCount = -1;\n /**\n * Draws an actor in the diagram with the attaced line\n * @param elem The HTML element\n * @param task The task to render\n * @param conf The global configuration\n */\n\n var drawTask = function drawTask(elem, task, conf) {\n var center = task.x + conf.width / 2;\n var g = elem.append('g');\n taskCount++;\n var maxHeight = 300 + 5 * 30;\n g.append('line').attr('id', 'task' + taskCount).attr('x1', center).attr('y1', task.y).attr('x2', center).attr('y2', maxHeight).attr('class', 'task-line').attr('stroke-width', '1px').attr('stroke-dasharray', '4 2').attr('stroke', '#666');\n drawFace(g, {\n cx: center,\n cy: 300 + (5 - task.score) * 30,\n score: task.score\n });\n var rect = getNoteRect();\n rect.x = task.x;\n rect.y = task.y;\n rect.fill = task.fill;\n rect.width = conf.width;\n rect.height = conf.height;\n rect.class = 'task task-type-' + task.num;\n rect.rx = 3;\n rect.ry = 3;\n drawRect(g, rect);\n var xPos = task.x + 14;\n task.people.forEach(function (person) {\n var colour = task.actors[person];\n var circle = {\n cx: xPos,\n cy: task.y,\n r: 7,\n fill: colour,\n stroke: '#000',\n title: person\n };\n drawCircle(g, circle);\n xPos += 10;\n });\n\n _drawTextCandidateFunc(conf)(task.task, g, rect.x, rect.y, rect.width, rect.height, {\n class: 'task'\n }, conf, task.colour);\n };\n /**\n * Draws a background rectangle\n * @param elem The html element\n * @param bounds The bounds of the drawing\n */\n\n\n var drawBackgroundRect = function drawBackgroundRect(elem, bounds) {\n var rectElem = drawRect(elem, {\n x: bounds.startx,\n y: bounds.starty,\n width: bounds.stopx - bounds.startx,\n height: bounds.stopy - bounds.starty,\n fill: bounds.fill,\n class: 'rect'\n });\n rectElem.lower();\n };\n\n var getTextObj = function getTextObj() {\n return {\n x: 0,\n y: 0,\n fill: undefined,\n 'text-anchor': 'start',\n width: 100,\n height: 100,\n textMargin: 0,\n rx: 0,\n ry: 0\n };\n };\n\n var getNoteRect = function getNoteRect() {\n return {\n x: 0,\n y: 0,\n width: 100,\n anchor: 'start',\n height: 100,\n rx: 0,\n ry: 0\n };\n };\n\n var _drawTextCandidateFunc = function () {\n function byText(content, g, x, y, width, height, textAttrs, colour) {\n var text = g.append('text').attr('x', x + width / 2).attr('y', y + height / 2 + 5).style('font-color', colour).style('text-anchor', 'middle').text(content);\n\n _setTextAttrs(text, textAttrs);\n }\n\n function byTspan(content, g, x, y, width, height, textAttrs, conf, colour) {\n var taskFontSize = conf.taskFontSize,\n taskFontFamily = conf.taskFontFamily;\n var lines = content.split(/
/gi);\n\n for (var i = 0; i < lines.length; i++) {\n var dy = i * taskFontSize - taskFontSize * (lines.length - 1) / 2;\n var text = g.append('text').attr('x', x + width / 2).attr('y', y).attr('fill', colour).style('text-anchor', 'middle').style('font-size', taskFontSize).style('font-family', taskFontFamily);\n text.append('tspan').attr('x', x + width / 2).attr('dy', dy).text(lines[i]);\n text.attr('y', y + height / 2.0).attr('dominant-baseline', 'central').attr('alignment-baseline', 'central');\n\n _setTextAttrs(text, textAttrs);\n }\n }\n\n function byFo(content, g, x, y, width, height, textAttrs, conf) {\n var body = g.append('switch');\n var f = body.append('foreignObject').attr('x', x).attr('y', y).attr('width', width).attr('height', height).attr('position', 'fixed');\n var text = f.append('div').style('display', 'table').style('height', '100%').style('width', '100%');\n text.append('div').attr('class', 'label').style('display', 'table-cell').style('text-align', 'center').style('vertical-align', 'middle') // .style('color', colour)\n .text(content);\n byTspan(content, body, x, y, width, height, textAttrs, conf);\n\n _setTextAttrs(text, textAttrs);\n }\n\n function _setTextAttrs(toText, fromTextAttrsDict) {\n for (var key in fromTextAttrsDict) {\n if (key in fromTextAttrsDict) {\n // eslint-disable-line\n // noinspection JSUnfilteredForInLoop\n toText.attr(key, fromTextAttrsDict[key]);\n }\n }\n }\n\n return function (conf) {\n return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan;\n };\n }();\n\n var initGraphics = function initGraphics(graphics) {\n graphics.append('defs').append('marker').attr('id', 'arrowhead').attr('refX', 5).attr('refY', 2).attr('markerWidth', 6).attr('markerHeight', 4).attr('orient', 'auto').append('path').attr('d', 'M 0,0 V 4 L6,2 Z'); // this is actual shape for arrowhead\n };\n /* harmony default export */\n\n\n __webpack_exports__[\"default\"] = {\n drawRect: drawRect,\n drawCircle: drawCircle,\n drawSection: drawSection,\n drawText: drawText,\n drawLabel: drawLabel,\n drawTask: drawTask,\n drawBackgroundRect: drawBackgroundRect,\n getTextObj: getTextObj,\n getNoteRect: getNoteRect,\n initGraphics: initGraphics\n };\n /***/\n },\n\n /***/\n \"./src/errorRenderer.js\":\n /*!******************************!*\\\n !*** ./src/errorRenderer.js ***!\n \\******************************/\n\n /*! exports provided: setConf, draw, default */\n\n /***/\n function srcErrorRendererJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"setConf\", function () {\n return setConf;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"draw\", function () {\n return draw;\n });\n /* harmony import */\n\n\n var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! d3 */\n \"d3\");\n /* harmony import */\n\n\n var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);\n /* harmony import */\n\n\n var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! ./logger */\n \"./src/logger.js\");\n /**\n * Created by knut on 14-12-11.\n */\n\n\n var conf = {};\n\n var setConf = function setConf(cnf) {\n var keys = Object.keys(cnf);\n keys.forEach(function (key) {\n conf[key] = cnf[key];\n });\n };\n /**\n * Draws a an info picture in the tag with id: id based on the graph definition in text.\n * @param text\n * @param id\n */\n\n\n var draw = function draw(id, ver) {\n try {\n _logger__WEBPACK_IMPORTED_MODULE_1__[\"logger\"].debug('Renering svg for syntax error\\n');\n\n var svg = Object(d3__WEBPACK_IMPORTED_MODULE_0__[\"select\"])('#' + id);\n var g = svg.append('g');\n g.append('path').attr('class', 'error-icon').attr('d', 'm411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z');\n g.append('path').attr('class', 'error-icon').attr('d', 'm459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z');\n g.append('path').attr('class', 'error-icon').attr('d', 'm340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z');\n g.append('path').attr('class', 'error-icon').attr('d', 'm400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z');\n g.append('path').attr('class', 'error-icon').attr('d', 'm496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z');\n g.append('path').attr('class', 'error-icon').attr('d', 'm436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z');\n g.append('text') // text label for the x axis\n .attr('class', 'error-text').attr('x', 1240).attr('y', 250).attr('font-size', '150px').style('text-anchor', 'middle').text('Syntax error in graph');\n g.append('text') // text label for the x axis\n .attr('class', 'error-text').attr('x', 1050).attr('y', 400).attr('font-size', '100px').style('text-anchor', 'middle').text('mermaid version ' + ver);\n svg.attr('height', 100);\n svg.attr('width', 400);\n svg.attr('viewBox', '768 0 512 512');\n } catch (e) {\n _logger__WEBPACK_IMPORTED_MODULE_1__[\"logger\"].error('Error while rendering info diagram');\n\n _logger__WEBPACK_IMPORTED_MODULE_1__[\"logger\"].error(e.message);\n }\n };\n /* harmony default export */\n\n\n __webpack_exports__[\"default\"] = {\n setConf: setConf,\n draw: draw\n };\n /***/\n },\n\n /***/\n \"./src/logger.js\":\n /*!***********************!*\\\n !*** ./src/logger.js ***!\n \\***********************/\n\n /*! exports provided: LEVELS, logger, setLogLevel */\n\n /***/\n function srcLoggerJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"LEVELS\", function () {\n return LEVELS;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"logger\", function () {\n return logger;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"setLogLevel\", function () {\n return setLogLevel;\n });\n /* harmony import */\n\n\n var moment_mini__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! moment-mini */\n \"moment-mini\");\n /* harmony import */\n\n\n var moment_mini__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment_mini__WEBPACK_IMPORTED_MODULE_0__); //\n\n\n var LEVELS = {\n debug: 1,\n info: 2,\n warn: 3,\n error: 4,\n fatal: 5\n };\n var logger = {\n debug: function debug() {},\n info: function info() {},\n warn: function warn() {},\n error: function error() {},\n fatal: function fatal() {}\n };\n\n var setLogLevel = function setLogLevel() {\n var level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'fatal';\n\n if (isNaN(level)) {\n level = level.toLowerCase();\n\n if (LEVELS[level] !== undefined) {\n level = LEVELS[level];\n }\n }\n\n logger.trace = function () {};\n\n logger.debug = function () {};\n\n logger.info = function () {};\n\n logger.warn = function () {};\n\n logger.error = function () {};\n\n logger.fatal = function () {};\n\n if (level <= LEVELS.fatal) {\n logger.fatal = console.error ? console.error.bind(console, format('FATAL'), 'color: orange') : console.log.bind(console, '\\x1b[35m', format('FATAL'));\n }\n\n if (level <= LEVELS.error) {\n logger.error = console.error ? console.error.bind(console, format('ERROR'), 'color: orange') : console.log.bind(console, '\\x1b[31m', format('ERROR'));\n }\n\n if (level <= LEVELS.warn) {\n logger.warn = console.warn ? console.warn.bind(console, format('WARN'), 'color: orange') : console.log.bind(console, \"\\x1B[33m\", format('WARN'));\n }\n\n if (level <= LEVELS.info) {\n logger.info = console.info ? // ? console.info.bind(console, '\\x1b[34m', format('INFO'), 'color: blue')\n console.info.bind(console, format('INFO'), 'color: lightblue') : console.log.bind(console, '\\x1b[34m', format('INFO'));\n }\n\n if (level <= LEVELS.debug) {\n logger.debug = console.debug ? console.debug.bind(console, format('DEBUG'), 'color: lightgreen') : console.log.bind(console, '\\x1b[32m', format('DEBUG'));\n }\n };\n\n var format = function format(level) {\n var time = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()().format('ss.SSS');\n return \"%c\".concat(time, \" : \").concat(level, \" : \");\n };\n /***/\n\n },\n\n /***/\n \"./src/mermaid.js\":\n /*!************************!*\\\n !*** ./src/mermaid.js ***!\n \\************************/\n\n /*! exports provided: default */\n\n /***/\n function srcMermaidJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony import */\n\n\n var entity_decode_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! entity-decode/browser */\n \"entity-decode/browser\");\n /* harmony import */\n\n\n var entity_decode_browser__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(entity_decode_browser__WEBPACK_IMPORTED_MODULE_0__);\n /* harmony import */\n\n\n var _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! ./mermaidAPI */\n \"./src/mermaidAPI.js\");\n /* harmony import */\n\n\n var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\n /*! ./logger */\n \"./src/logger.js\");\n /* harmony import */\n\n\n var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\n /*! ./utils */\n \"./src/utils.js\");\n /**\n * Web page integration module for the mermaid framework. It uses the mermaidAPI for mermaid functionality and to render\n * the diagrams to svg code.\n */\n // import { decode } from 'he';\n\n /**\n * ## init\n * Function that goes through the document to find the chart definitions in there and render them.\n *\n * The function tags the processed attributes with the attribute data-processed and ignores found elements with the\n * attribute already set. This way the init function can be triggered several times.\n *\n * Optionally, `init` can accept in the second argument one of the following:\n * - a DOM Node\n * - an array of DOM nodes (as would come from a jQuery selector)\n * - a W3C selector, a la `.mermaid`\n *\n * ```mermaid\n * graph LR;\n * a(Find elements)-->b{Processed}\n * b-->|Yes|c(Leave element)\n * b-->|No |d(Transform)\n * ```\n * Renders the mermaid diagrams\n * @param nodes a css selector or an array of nodes\n */\n\n\n var init = function init() {\n var _this = this;\n\n var conf = _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getConfig(); // console.log('Starting rendering diagrams (init) - mermaid.init', conf);\n\n\n var nodes;\n\n if (arguments.length >= 2) {\n /*! sequence config was passed as #1 */\n if (typeof arguments[0] !== 'undefined') {\n mermaid.sequenceConfig = arguments[0];\n }\n\n nodes = arguments[1];\n } else {\n nodes = arguments[0];\n } // if last argument is a function this is the callback function\n\n\n var callback;\n\n if (typeof arguments[arguments.length - 1] === 'function') {\n callback = arguments[arguments.length - 1];\n\n _logger__WEBPACK_IMPORTED_MODULE_2__[\"logger\"].debug('Callback function found');\n } else {\n if (typeof conf.mermaid !== 'undefined') {\n if (typeof conf.mermaid.callback === 'function') {\n callback = conf.mermaid.callback;\n\n _logger__WEBPACK_IMPORTED_MODULE_2__[\"logger\"].debug('Callback function found');\n } else {\n _logger__WEBPACK_IMPORTED_MODULE_2__[\"logger\"].debug('No Callback function found');\n }\n }\n }\n\n nodes = nodes === undefined ? document.querySelectorAll('.mermaid') : typeof nodes === 'string' ? document.querySelectorAll(nodes) : nodes instanceof window.Node ? [nodes] : nodes; // Last case - sequence config was passed pick next\n\n _logger__WEBPACK_IMPORTED_MODULE_2__[\"logger\"].debug('Start On Load before: ' + mermaid.startOnLoad);\n\n if (typeof mermaid.startOnLoad !== 'undefined') {\n _logger__WEBPACK_IMPORTED_MODULE_2__[\"logger\"].debug('Start On Load inner: ' + mermaid.startOnLoad);\n\n _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__[\"default\"].updateSiteConfig({\n startOnLoad: mermaid.startOnLoad\n });\n }\n\n if (typeof mermaid.ganttConfig !== 'undefined') {\n _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__[\"default\"].updateSiteConfig({\n gantt: mermaid.ganttConfig\n });\n }\n\n var txt;\n\n var _loop = function _loop(i) {\n var element = nodes[i];\n /*! Check if previously processed */\n\n if (!element.getAttribute('data-processed')) {\n element.setAttribute('data-processed', true);\n } else {\n return \"continue\";\n }\n\n var id = \"mermaid-\".concat(Date.now()); // Fetch the graph definition including tags\n\n txt = element.innerHTML; // transforms the html to pure text\n\n txt = entity_decode_browser__WEBPACK_IMPORTED_MODULE_0___default()(txt).trim().replace(/
/gi, '
');\n\n var init = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].detectInit(txt);\n\n if (init) {\n _logger__WEBPACK_IMPORTED_MODULE_2__[\"logger\"].debug('Detected early reinit: ', init);\n }\n\n try {\n _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__[\"default\"].render(id, txt, function (svgCode, bindFunctions) {\n element.innerHTML = svgCode;\n\n if (typeof callback !== 'undefined') {\n callback(id);\n }\n\n if (bindFunctions) bindFunctions(element);\n }, element);\n } catch (e) {\n _logger__WEBPACK_IMPORTED_MODULE_2__[\"logger\"].warn('Syntax Error rendering');\n\n _logger__WEBPACK_IMPORTED_MODULE_2__[\"logger\"].warn(e);\n\n if (_this.parseError) {\n _this.parseError(e);\n }\n }\n };\n\n for (var i = 0; i < nodes.length; i++) {\n var _ret = _loop(i);\n\n if (_ret === \"continue\") continue;\n }\n };\n\n var initialize = function initialize(config) {\n // mermaidAPI.reset();\n if (typeof config.mermaid !== 'undefined') {\n if (typeof config.mermaid.startOnLoad !== 'undefined') {\n mermaid.startOnLoad = config.mermaid.startOnLoad;\n }\n\n if (typeof config.mermaid.htmlLabels !== 'undefined') {\n mermaid.htmlLabels = config.mermaid.htmlLabels;\n }\n }\n\n _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__[\"default\"].initialize(config); // mermaidAPI.reset();\n\n };\n /**\n * ##contentLoaded\n * Callback function that is called when page is loaded. This functions fetches configuration for mermaid rendering and\n * calls init for rendering the mermaid diagrams on the page.\n */\n\n\n var contentLoaded = function contentLoaded() {\n var config;\n\n if (mermaid.startOnLoad) {\n // No config found, do check API config\n config = _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getConfig();\n\n if (config.startOnLoad) {\n mermaid.init();\n }\n } else {\n if (typeof mermaid.startOnLoad === 'undefined') {\n _logger__WEBPACK_IMPORTED_MODULE_2__[\"logger\"].debug('In start, no config');\n\n config = _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getConfig();\n\n if (config.startOnLoad) {\n mermaid.init();\n }\n }\n }\n };\n\n if (typeof document !== 'undefined') {\n /*!\n * Wait for document loaded before starting the execution\n */\n window.addEventListener('load', function () {\n contentLoaded();\n }, false);\n }\n\n var mermaid = {\n startOnLoad: true,\n htmlLabels: true,\n mermaidAPI: _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n parse: _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__[\"default\"].parse,\n render: _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__[\"default\"].render,\n init: init,\n initialize: initialize,\n contentLoaded: contentLoaded\n };\n /* harmony default export */\n\n __webpack_exports__[\"default\"] = mermaid;\n /***/\n },\n\n /***/\n \"./src/mermaidAPI.js\":\n /*!***************************!*\\\n !*** ./src/mermaidAPI.js ***!\n \\***************************/\n\n /*! exports provided: encodeEntities, decodeEntities, default */\n\n /***/\n function srcMermaidAPIJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"encodeEntities\", function () {\n return encodeEntities;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"decodeEntities\", function () {\n return decodeEntities;\n });\n /* harmony import */\n\n\n var stylis__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! stylis */\n \"stylis\");\n /* harmony import */\n\n\n var stylis__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(stylis__WEBPACK_IMPORTED_MODULE_0__);\n /* harmony import */\n\n\n var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! d3 */\n \"d3\");\n /* harmony import */\n\n\n var d3__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_1__);\n /* harmony import */\n\n\n var _package_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\n /*! ../package.json */\n \"./package.json\");\n\n var _package_json__WEBPACK_IMPORTED_MODULE_2___namespace = /*#__PURE__*/__webpack_require__.t(\n /*! ../package.json */\n \"./package.json\", 1);\n /* harmony import */\n\n\n var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\n /*! ./logger */\n \"./src/logger.js\");\n /* harmony import */\n\n\n var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(\n /*! ./utils */\n \"./src/utils.js\");\n /* harmony import */\n\n\n var _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(\n /*! ./diagrams/flowchart/flowRenderer */\n \"./src/diagrams/flowchart/flowRenderer.js\");\n /* harmony import */\n\n\n var _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(\n /*! ./diagrams/flowchart/flowRenderer-v2 */\n \"./src/diagrams/flowchart/flowRenderer-v2.js\");\n /* harmony import */\n\n\n var _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(\n /*! ./diagrams/flowchart/parser/flow */\n \"./src/diagrams/flowchart/parser/flow.jison\");\n /* harmony import */\n\n\n var _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7__);\n /* harmony import */\n\n\n var _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(\n /*! ./diagrams/flowchart/flowDb */\n \"./src/diagrams/flowchart/flowDb.js\");\n /* harmony import */\n\n\n var _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(\n /*! ./diagrams/sequence/sequenceRenderer */\n \"./src/diagrams/sequence/sequenceRenderer.js\");\n /* harmony import */\n\n\n var _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(\n /*! ./diagrams/sequence/parser/sequenceDiagram */\n \"./src/diagrams/sequence/parser/sequenceDiagram.jison\");\n /* harmony import */\n\n\n var _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10__);\n /* harmony import */\n\n\n var _diagrams_sequence_sequenceDb__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(\n /*! ./diagrams/sequence/sequenceDb */\n \"./src/diagrams/sequence/sequenceDb.js\");\n /* harmony import */\n\n\n var _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(\n /*! ./diagrams/gantt/ganttRenderer */\n \"./src/diagrams/gantt/ganttRenderer.js\");\n /* harmony import */\n\n\n var _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(\n /*! ./diagrams/gantt/parser/gantt */\n \"./src/diagrams/gantt/parser/gantt.jison\");\n /* harmony import */\n\n\n var _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13__);\n /* harmony import */\n\n\n var _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(\n /*! ./diagrams/gantt/ganttDb */\n \"./src/diagrams/gantt/ganttDb.js\");\n /* harmony import */\n\n\n var _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(\n /*! ./diagrams/class/classRenderer */\n \"./src/diagrams/class/classRenderer.js\");\n /* harmony import */\n\n\n var _diagrams_class_classRenderer_v2__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(\n /*! ./diagrams/class/classRenderer-v2 */\n \"./src/diagrams/class/classRenderer-v2.js\");\n /* harmony import */\n\n\n var _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(\n /*! ./diagrams/class/parser/classDiagram */\n \"./src/diagrams/class/parser/classDiagram.jison\");\n /* harmony import */\n\n\n var _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_17__);\n /* harmony import */\n\n\n var _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(\n /*! ./diagrams/class/classDb */\n \"./src/diagrams/class/classDb.js\");\n /* harmony import */\n\n\n var _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(\n /*! ./diagrams/state/stateRenderer */\n \"./src/diagrams/state/stateRenderer.js\");\n /* harmony import */\n\n\n var _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(\n /*! ./diagrams/state/stateRenderer-v2 */\n \"./src/diagrams/state/stateRenderer-v2.js\");\n /* harmony import */\n\n\n var _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(\n /*! ./diagrams/state/parser/stateDiagram */\n \"./src/diagrams/state/parser/stateDiagram.jison\");\n /* harmony import */\n\n\n var _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_21__);\n /* harmony import */\n\n\n var _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(\n /*! ./diagrams/state/stateDb */\n \"./src/diagrams/state/stateDb.js\");\n /* harmony import */\n\n\n var _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(\n /*! ./diagrams/git/gitGraphRenderer */\n \"./src/diagrams/git/gitGraphRenderer.js\");\n /* harmony import */\n\n\n var _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(\n /*! ./diagrams/git/parser/gitGraph */\n \"./src/diagrams/git/parser/gitGraph.jison\");\n /* harmony import */\n\n\n var _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_24__);\n /* harmony import */\n\n\n var _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(\n /*! ./diagrams/git/gitGraphAst */\n \"./src/diagrams/git/gitGraphAst.js\");\n /* harmony import */\n\n\n var _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(\n /*! ./diagrams/info/infoRenderer */\n \"./src/diagrams/info/infoRenderer.js\");\n /* harmony import */\n\n\n var _errorRenderer__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(\n /*! ./errorRenderer */\n \"./src/errorRenderer.js\");\n /* harmony import */\n\n\n var _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(\n /*! ./diagrams/info/parser/info */\n \"./src/diagrams/info/parser/info.jison\");\n /* harmony import */\n\n\n var _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(_diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_28__);\n /* harmony import */\n\n\n var _diagrams_info_infoDb__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(\n /*! ./diagrams/info/infoDb */\n \"./src/diagrams/info/infoDb.js\");\n /* harmony import */\n\n\n var _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(\n /*! ./diagrams/pie/pieRenderer */\n \"./src/diagrams/pie/pieRenderer.js\");\n /* harmony import */\n\n\n var _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(\n /*! ./diagrams/pie/parser/pie */\n \"./src/diagrams/pie/parser/pie.jison\");\n /* harmony import */\n\n\n var _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_31___default = /*#__PURE__*/__webpack_require__.n(_diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_31__);\n /* harmony import */\n\n\n var _diagrams_pie_pieDb__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(\n /*! ./diagrams/pie/pieDb */\n \"./src/diagrams/pie/pieDb.js\");\n /* harmony import */\n\n\n var _diagrams_er_erDb__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(\n /*! ./diagrams/er/erDb */\n \"./src/diagrams/er/erDb.js\");\n /* harmony import */\n\n\n var _diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(\n /*! ./diagrams/er/parser/erDiagram */\n \"./src/diagrams/er/parser/erDiagram.jison\");\n /* harmony import */\n\n\n var _diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_34___default = /*#__PURE__*/__webpack_require__.n(_diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_34__);\n /* harmony import */\n\n\n var _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(\n /*! ./diagrams/er/erRenderer */\n \"./src/diagrams/er/erRenderer.js\");\n /* harmony import */\n\n\n var _diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(\n /*! ./diagrams/user-journey/parser/journey */\n \"./src/diagrams/user-journey/parser/journey.jison\");\n /* harmony import */\n\n\n var _diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_36___default = /*#__PURE__*/__webpack_require__.n(_diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_36__);\n /* harmony import */\n\n\n var _diagrams_user_journey_journeyDb__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(\n /*! ./diagrams/user-journey/journeyDb */\n \"./src/diagrams/user-journey/journeyDb.js\");\n /* harmony import */\n\n\n var _diagrams_user_journey_journeyRenderer__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(\n /*! ./diagrams/user-journey/journeyRenderer */\n \"./src/diagrams/user-journey/journeyRenderer.js\");\n /* harmony import */\n\n\n var _config__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(\n /*! ./config */\n \"./src/config.js\");\n /* harmony import */\n\n\n var _styles__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(\n /*! ./styles */\n \"./src/styles.js\");\n /* harmony import */\n\n\n var _themes__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(\n /*! ./themes */\n \"./src/themes/index.js\");\n\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n /**\n * This is the api to be used when optionally handling the integration with the web page, instead of using the default integration provided by mermaid.js.\n *\n * The core of this api is the [**render**](Setup.md?id=render) function which, given a graph\n * definition as text, renders the graph/diagram and returns an svg element for the graph.\n *\n * It is is then up to the user of the API to make use of the svg, either insert it somewhere in the page or do something completely different.\n *\n * In addition to the render function, a number of behavioral configuration options are available.\n *\n * @name mermaidAPI\n */\n // import * as configApi from './config';\n // // , {\n // // setConfig,\n // // configApi.getConfig,\n // // configApi.updateSiteConfig,\n // // configApi.setSiteConfig,\n // // configApi.getSiteConfig,\n // // configApi.defaultConfig\n // // }\n\n\n function parse(text) {\n var graphInit = _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].detectInit(text);\n\n if (graphInit) {\n reinitialize(graphInit);\n\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].debug('reinit ', graphInit);\n }\n\n var graphType = _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].detectType(text);\n\n var parser;\n\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].debug('Type ' + graphType);\n\n switch (graphType) {\n case 'git':\n parser = _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_24___default.a;\n parser.parser.yy = _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_25__[\"default\"];\n break;\n\n case 'flowchart':\n _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__[\"default\"].clear();\n\n parser = _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7___default.a;\n parser.parser.yy = _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\n break;\n\n case 'flowchart-v2':\n _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__[\"default\"].clear();\n\n parser = _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7___default.a;\n parser.parser.yy = _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\n break;\n\n case 'sequence':\n parser = _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10___default.a;\n parser.parser.yy = _diagrams_sequence_sequenceDb__WEBPACK_IMPORTED_MODULE_11__[\"default\"];\n break;\n\n case 'gantt':\n parser = _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13___default.a;\n parser.parser.yy = _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__[\"default\"];\n break;\n\n case 'class':\n parser = _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_17___default.a;\n parser.parser.yy = _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_18__[\"default\"];\n break;\n\n case 'classDiagram':\n parser = _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_17___default.a;\n parser.parser.yy = _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_18__[\"default\"];\n break;\n\n case 'state':\n parser = _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_21___default.a;\n parser.parser.yy = _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_22__[\"default\"];\n break;\n\n case 'stateDiagram':\n parser = _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_21___default.a;\n parser.parser.yy = _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_22__[\"default\"];\n break;\n\n case 'info':\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].debug('info info info');\n\n parser = _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_28___default.a;\n parser.parser.yy = _diagrams_info_infoDb__WEBPACK_IMPORTED_MODULE_29__[\"default\"];\n break;\n\n case 'pie':\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].debug('pie');\n\n parser = _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_31___default.a;\n parser.parser.yy = _diagrams_pie_pieDb__WEBPACK_IMPORTED_MODULE_32__[\"default\"];\n break;\n\n case 'er':\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].debug('er');\n\n parser = _diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_34___default.a;\n parser.parser.yy = _diagrams_er_erDb__WEBPACK_IMPORTED_MODULE_33__[\"default\"];\n break;\n\n case 'journey':\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].debug('Journey');\n\n parser = _diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_36___default.a;\n parser.parser.yy = _diagrams_user_journey_journeyDb__WEBPACK_IMPORTED_MODULE_37__[\"default\"];\n break;\n }\n\n parser.parser.yy.graphType = graphType;\n\n parser.parser.yy.parseError = function (str, hash) {\n var error = {\n str: str,\n hash: hash\n };\n throw error;\n };\n\n parser.parse(text);\n return parser;\n }\n\n var encodeEntities = function encodeEntities(text) {\n var txt = text;\n txt = txt.replace(/style.*:\\S*#.*;/g, function (s) {\n var innerTxt = s.substring(0, s.length - 1);\n return innerTxt;\n });\n txt = txt.replace(/classDef.*:\\S*#.*;/g, function (s) {\n var innerTxt = s.substring(0, s.length - 1);\n return innerTxt;\n });\n txt = txt.replace(/#\\w+;/g, function (s) {\n var innerTxt = s.substring(1, s.length - 1);\n var isInt = /^\\+?\\d+$/.test(innerTxt);\n\n if (isInt) {\n return 'fl°°' + innerTxt + '¶ß';\n } else {\n return 'fl°' + innerTxt + '¶ß';\n }\n });\n return txt;\n };\n\n var decodeEntities = function decodeEntities(text) {\n var txt = text;\n txt = txt.replace(/fl°°/g, function () {\n return '';\n });\n txt = txt.replace(/fl°/g, function () {\n return '&';\n });\n txt = txt.replace(/¶ß/g, function () {\n return ';';\n });\n return txt;\n };\n /**\n * Function that renders an svg with a graph from a chart definition. Usage example below.\n *\n * ```js\n * mermaidAPI.initialize({\n * startOnLoad:true\n * });\n * $(function(){\n * const graphDefinition = 'graph TB\\na-->b';\n * const cb = function(svgGraph){\n * console.log(svgGraph);\n * };\n * mermaidAPI.render('id1',graphDefinition,cb);\n * });\n *```\n * @param id the id of the element to be rendered\n * @param _txt the graph definition\n * @param cb callback which is called after rendering is finished with the svg code as inparam.\n * @param container selector to element in which a div with the graph temporarily will be inserted. In one is\n * provided a hidden div will be inserted in the body of the page instead. The element will be removed when rendering is\n * completed.\n */\n\n\n var render = function render(id, _txt, cb, container) {\n _config__WEBPACK_IMPORTED_MODULE_39__[\"reset\"]();\n\n var txt = _txt;\n\n var graphInit = _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].detectInit(txt);\n\n if (graphInit) {\n _config__WEBPACK_IMPORTED_MODULE_39__[\"addDirective\"](graphInit);\n } // else {\n // configApi.reset();\n // const siteConfig = configApi.getSiteConfig();\n // configApi.addDirective(siteConfig);\n // }\n // console.warn('Render fetching config');\n\n\n var cnf = _config__WEBPACK_IMPORTED_MODULE_39__[\"getConfig\"]();\n\n console.warn('Render with config after adding new directives', cnf.sequence); // console.warn(\n // 'Render with config after adding new directives',\n // cnf.fontFamily,\n // cnf.themeVariables.fontFamily\n // );\n // Check the maximum allowed text size\n\n if (_txt.length > cnf.maxTextSize) {\n txt = 'graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa';\n }\n\n if (typeof container !== 'undefined') {\n container.innerHTML = '';\n Object(d3__WEBPACK_IMPORTED_MODULE_1__[\"select\"])(container).append('div').attr('id', 'd' + id).attr('style', 'font-family: ' + cnf.fontFamily).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g');\n } else {\n var existingSvg = document.getElementById(id);\n\n if (existingSvg) {\n existingSvg.remove();\n }\n\n var _element = document.querySelector('#' + 'd' + id);\n\n if (_element) {\n _element.remove();\n }\n\n Object(d3__WEBPACK_IMPORTED_MODULE_1__[\"select\"])('body').append('div').attr('id', 'd' + id).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g');\n }\n\n window.txt = txt;\n txt = encodeEntities(txt);\n var element = Object(d3__WEBPACK_IMPORTED_MODULE_1__[\"select\"])('#d' + id).node();\n\n var graphType = _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].detectType(txt); // insert inline style into svg\n\n\n var svg = element.firstChild;\n var firstChild = svg.firstChild;\n var userStyles = ''; // user provided theme CSS\n\n if (cnf.themeCSS !== undefined) {\n userStyles += \"\\n\".concat(cnf.themeCSS);\n } // user provided theme CSS\n\n\n if (cnf.fontFamily !== undefined) {\n userStyles += \"\\n:root { --mermaid-font-family: \".concat(cnf.fontFamily, \"}\");\n } // user provided theme CSS\n\n\n if (cnf.altFontFamily !== undefined) {\n userStyles += \"\\n:root { --mermaid-alt-font-family: \".concat(cnf.altFontFamily, \"}\");\n } // classDef\n\n\n if (graphType === 'flowchart' || graphType === 'flowchart-v2' || graphType === 'graph') {\n var classes = _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_5__[\"default\"].getClasses(txt);\n\n for (var className in classes) {\n userStyles += \"\\n.\".concat(className, \" > * { \").concat(classes[className].styles.join(' !important; '), \" !important; }\");\n\n if (classes[className].textStyles) {\n userStyles += \"\\n.\".concat(className, \" tspan { \").concat(classes[className].textStyles.join(' !important; '), \" !important; }\");\n }\n }\n } // logger.warn(cnf.themeVariables);\n\n\n var stylis = new stylis__WEBPACK_IMPORTED_MODULE_0___default.a();\n var rules = stylis(\"#\".concat(id), Object(_styles__WEBPACK_IMPORTED_MODULE_40__[\"default\"])(graphType, userStyles, cnf.themeVariables));\n var style1 = document.createElement('style');\n style1.innerHTML = rules;\n svg.insertBefore(style1, firstChild); // Verify that the generated svgs are ok before removing this\n // const style2 = document.createElement('style');\n // const cs = window.getComputedStyle(svg);\n // style2.innerHTML = `#d${id} * {\n // color: ${cs.color};\n // // font: ${cs.font};\n // // font-family: Arial;\n // // font-size: 24px;\n // }`;\n // svg.insertBefore(style2, firstChild);\n\n try {\n switch (graphType) {\n case 'git':\n cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n\n _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_23__[\"default\"].setConf(cnf.git);\n\n _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_23__[\"default\"].draw(txt, id, false);\n\n break;\n\n case 'flowchart':\n cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n\n _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_5__[\"default\"].setConf(cnf.flowchart);\n\n _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_5__[\"default\"].draw(txt, id, false);\n\n break;\n\n case 'flowchart-v2':\n cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n\n _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_6__[\"default\"].setConf(cnf.flowchart);\n\n _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_6__[\"default\"].draw(txt, id, false);\n\n break;\n\n case 'sequence':\n cnf.sequence.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n\n if (cnf.sequenceDiagram) {\n // backwards compatibility\n _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__[\"default\"].setConf(Object.assign(cnf.sequence, cnf.sequenceDiagram));\n\n console.error('`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.');\n } else {\n _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__[\"default\"].setConf(cnf.sequence);\n }\n\n _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__[\"default\"].draw(txt, id);\n\n break;\n\n case 'gantt':\n cnf.gantt.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n\n _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__[\"default\"].setConf(cnf.gantt);\n\n _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__[\"default\"].draw(txt, id);\n\n break;\n\n case 'class':\n cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n\n _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__[\"default\"].setConf(cnf.class);\n\n _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__[\"default\"].draw(txt, id);\n\n break;\n\n case 'classDiagram':\n cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n\n _diagrams_class_classRenderer_v2__WEBPACK_IMPORTED_MODULE_16__[\"default\"].setConf(cnf.class);\n\n _diagrams_class_classRenderer_v2__WEBPACK_IMPORTED_MODULE_16__[\"default\"].draw(txt, id);\n\n break;\n\n case 'state':\n cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n\n _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_19__[\"default\"].setConf(cnf.state);\n\n _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_19__[\"default\"].draw(txt, id);\n\n break;\n\n case 'stateDiagram':\n cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n\n _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_20__[\"default\"].setConf(cnf.state);\n\n _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_20__[\"default\"].draw(txt, id);\n\n break;\n\n case 'info':\n cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n\n _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_26__[\"default\"].setConf(cnf.class);\n\n _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_26__[\"default\"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version);\n\n break;\n\n case 'pie':\n cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n\n _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_30__[\"default\"].setConf(cnf.class);\n\n _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_30__[\"default\"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version);\n\n break;\n\n case 'er':\n _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_35__[\"default\"].setConf(cnf.er);\n\n _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_35__[\"default\"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version);\n\n break;\n\n case 'journey':\n _diagrams_user_journey_journeyRenderer__WEBPACK_IMPORTED_MODULE_38__[\"default\"].setConf(cnf.journey);\n\n _diagrams_user_journey_journeyRenderer__WEBPACK_IMPORTED_MODULE_38__[\"default\"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version);\n\n break;\n }\n } catch (e) {\n // errorRenderer.setConf(cnf.class);\n _errorRenderer__WEBPACK_IMPORTED_MODULE_27__[\"default\"].draw(id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version);\n\n throw e;\n }\n\n Object(d3__WEBPACK_IMPORTED_MODULE_1__[\"select\"])(\"[id=\\\"\".concat(id, \"\\\"]\")).selectAll('foreignobject > *').attr('xmlns', 'http://www.w3.org/1999/xhtml'); // if (cnf.arrowMarkerAbsolute) {\n // url =\n // window.location.protocol +\n // '//' +\n // window.location.host +\n // window.location.pathname +\n // window.location.search;\n // url = url.replace(/\\(/g, '\\\\(');\n // url = url.replace(/\\)/g, '\\\\)');\n // }\n // Fix for when the base tag is used\n\n var svgCode = Object(d3__WEBPACK_IMPORTED_MODULE_1__[\"select\"])('#d' + id).node().innerHTML;\n\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].debug('cnf.arrowMarkerAbsolute', cnf.arrowMarkerAbsolute);\n\n if (!cnf.arrowMarkerAbsolute || cnf.arrowMarkerAbsolute === 'false') {\n svgCode = svgCode.replace(/marker-end=\"url\\(.*?#/g, 'marker-end=\"url(#', 'g');\n }\n\n svgCode = decodeEntities(svgCode);\n\n if (typeof cb !== 'undefined') {\n switch (graphType) {\n case 'flowchart':\n case 'flowchart-v2':\n cb(svgCode, _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__[\"default\"].bindFunctions);\n break;\n\n case 'gantt':\n cb(svgCode, _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__[\"default\"].bindFunctions);\n break;\n\n case 'class':\n cb(svgCode, _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_18__[\"default\"].bindFunctions);\n break;\n\n default:\n cb(svgCode);\n }\n } else {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].debug('CB = undefined!');\n }\n\n var node = Object(d3__WEBPACK_IMPORTED_MODULE_1__[\"select\"])('#d' + id).node();\n\n if (node !== null && typeof node.remove === 'function') {\n Object(d3__WEBPACK_IMPORTED_MODULE_1__[\"select\"])('#d' + id).node().remove();\n }\n\n return svgCode;\n };\n\n var currentDirective = {};\n\n var parseDirective = function parseDirective(p, statement, context, type) {\n try {\n if (statement !== undefined) {\n statement = statement.trim();\n\n switch (context) {\n case 'open_directive':\n currentDirective = {};\n break;\n\n case 'type_directive':\n currentDirective.type = statement.toLowerCase();\n break;\n\n case 'arg_directive':\n currentDirective.args = JSON.parse(statement);\n break;\n\n case 'close_directive':\n handleDirective(p, currentDirective, type);\n currentDirective = null;\n break;\n }\n }\n } catch (error) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].error(\"Error while rendering sequenceDiagram directive: \".concat(statement, \" jison context: \").concat(context));\n\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].error(error.message);\n }\n };\n\n var handleDirective = function handleDirective(p, directive, type) {\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].debug(\"Directive type=\".concat(directive.type, \" with args:\"), directive.args);\n\n switch (directive.type) {\n case 'init':\n case 'initialize':\n {\n ['config'].forEach(function (prop) {\n if (typeof directive.args[prop] !== 'undefined') {\n if (type === 'flowchart-v2') {\n type = 'flowchart';\n }\n\n directive.args[type] = directive.args[prop];\n delete directive.args[prop];\n }\n });\n reinitialize(directive.args);\n\n _config__WEBPACK_IMPORTED_MODULE_39__[\"addDirective\"](directive.args);\n\n break;\n }\n\n case 'wrap':\n case 'nowrap':\n if (p && p['setWrap']) {\n p.setWrap(directive.type === 'wrap');\n }\n\n break;\n\n default:\n _logger__WEBPACK_IMPORTED_MODULE_3__[\"logger\"].warn(\"Unhandled directive: source: '%%{\".concat(directive.type, \": \").concat(JSON.stringify(directive.args ? directive.args : {}), \"}%%\"), directive);\n\n break;\n }\n };\n\n function updateRendererConfigs(conf) {\n _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_23__[\"default\"].setConf(conf.git);\n\n _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_5__[\"default\"].setConf(conf.flowchart);\n\n _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_6__[\"default\"].setConf(conf.flowchart);\n\n if (typeof conf['sequenceDiagram'] !== 'undefined') {\n _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__[\"default\"].setConf(Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"assignWithDepth\"])(conf.sequence, conf['sequenceDiagram']));\n }\n\n _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__[\"default\"].setConf(conf.sequence);\n\n _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__[\"default\"].setConf(conf.gantt);\n\n _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__[\"default\"].setConf(conf.class);\n\n _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_19__[\"default\"].setConf(conf.state);\n\n _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_20__[\"default\"].setConf(conf.state);\n\n _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_26__[\"default\"].setConf(conf.class);\n\n _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_30__[\"default\"].setConf(conf.class);\n\n _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_35__[\"default\"].setConf(conf.er);\n\n _diagrams_user_journey_journeyRenderer__WEBPACK_IMPORTED_MODULE_38__[\"default\"].setConf(conf.journey);\n\n _errorRenderer__WEBPACK_IMPORTED_MODULE_27__[\"default\"].setConf(conf.class);\n }\n\n function reinitialize() {// `mermaidAPI.reinitialize: v${pkg.version}`,\n // JSON.stringify(options),\n // options.themeVariables.primaryColor;\n // // if (options.theme && theme[options.theme]) {\n // // options.themeVariables = theme[options.theme].getThemeVariables(options.themeVariables);\n // // }\n // // Set default options\n // const config =\n // typeof options === 'object' ? configApi.setConfig(options) : configApi.getSiteConfig();\n // updateRendererConfigs(config);\n // setLogLevel(config.logLevel);\n // logger.debug('mermaidAPI.reinitialize: ', config);\n }\n\n function initialize(options) {\n // console.warn(`mermaidAPI.initialize: v${pkg.version} `, options);\n // Handle legacy location of font-family configuration\n if (options && options.fontFamily) {\n if (!options.themeVariables) {\n options.themeVariables = {\n fontFamily: options.fontFamily\n };\n } else {\n if (!options.themeVariables.fontFamily) {\n options.themeVariables = {\n fontFamily: options.fontFamily\n };\n }\n }\n } // Set default options\n\n\n _config__WEBPACK_IMPORTED_MODULE_39__[\"setSiteConfigDelta\"](options);\n\n if (options && options.theme && _themes__WEBPACK_IMPORTED_MODULE_41__[\"default\"][options.theme]) {\n // Todo merge with user options\n options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_41__[\"default\"][options.theme].getThemeVariables(options.themeVariables);\n } else {\n if (options) options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_41__[\"default\"].default.getThemeVariables(options.themeVariables);\n }\n\n var config = _typeof(options) === 'object' ? _config__WEBPACK_IMPORTED_MODULE_39__[\"setSiteConfig\"](options) : _config__WEBPACK_IMPORTED_MODULE_39__[\"getSiteConfig\"]();\n updateRendererConfigs(config);\n Object(_logger__WEBPACK_IMPORTED_MODULE_3__[\"setLogLevel\"])(config.logLevel); // logger.debug('mermaidAPI.initialize: ', config);\n }\n\n var mermaidAPI = Object.freeze({\n render: render,\n parse: parse,\n parseDirective: parseDirective,\n initialize: initialize,\n reinitialize: reinitialize,\n getConfig: _config__WEBPACK_IMPORTED_MODULE_39__[\"getConfig\"],\n setConfig: _config__WEBPACK_IMPORTED_MODULE_39__[\"setConfig\"],\n getSiteConfig: _config__WEBPACK_IMPORTED_MODULE_39__[\"getSiteConfig\"],\n updateSiteConfig: _config__WEBPACK_IMPORTED_MODULE_39__[\"updateSiteConfig\"],\n reset: function reset() {\n // console.warn('reset');\n _config__WEBPACK_IMPORTED_MODULE_39__[\"reset\"](); // const siteConfig = configApi.getSiteConfig();\n // updateRendererConfigs(siteConfig);\n\n },\n globalReset: function globalReset() {\n _config__WEBPACK_IMPORTED_MODULE_39__[\"reset\"](_config__WEBPACK_IMPORTED_MODULE_39__[\"defaultConfig\"]);\n\n updateRendererConfigs(_config__WEBPACK_IMPORTED_MODULE_39__[\"getConfig\"]());\n },\n defaultConfig: _config__WEBPACK_IMPORTED_MODULE_39__[\"defaultConfig\"]\n });\n Object(_logger__WEBPACK_IMPORTED_MODULE_3__[\"setLogLevel\"])(_config__WEBPACK_IMPORTED_MODULE_39__[\"getConfig\"]().logLevel);\n\n _config__WEBPACK_IMPORTED_MODULE_39__[\"reset\"](_config__WEBPACK_IMPORTED_MODULE_39__[\"getConfig\"]());\n /* harmony default export */\n\n\n __webpack_exports__[\"default\"] = mermaidAPI;\n /**\n * ## mermaidAPI configuration defaults\n * \n *\n * <script>\n * var config = {\n * theme:'default',\n * logLevel:'fatal',\n * securityLevel:'strict',\n * startOnLoad:true,\n * arrowMarkerAbsolute:false,\n *\n * er:{\n * diagramPadding:20,\n * layoutDirection:'TB',\n * minEntityWidth:100,\n * minEntityHeight:75,\n * entityPadding:15,\n * stroke:'gray',\n * fill:'honeydew',\n * fontSize:12,\n * useMaxWidth:true,\n * },\n * flowchart:{\n * diagramPadding:8,\n * htmlLabels:true,\n * curve:'linear',\n * },\n * sequence:{\n * diagramMarginX:50,\n * diagramMarginY:10,\n * actorMargin:50,\n * width:150,\n * height:65,\n * boxMargin:10,\n * boxTextMargin:5,\n * noteMargin:10,\n * messageMargin:35,\n * messageAlign:'center',\n * mirrorActors:true,\n * bottomMarginAdj:1,\n * useMaxWidth:true,\n * rightAngles:false,\n * showSequenceNumbers:false,\n * },\n * gantt:{\n * titleTopMargin:25,\n * barHeight:20,\n * barGap:4,\n * topPadding:50,\n * leftPadding:75,\n * gridLineStartPadding:35,\n * fontSize:11,\n * fontFamily:'\"Open-Sans\", \"sans-serif\"',\n * numberSectionStyles:4,\n * axisFormat:'%Y-%m-%d',\n * }\n * };\n * mermaid.initialize(config);\n * </script>\n *
\n */\n\n /***/\n },\n\n /***/\n \"./src/styles.js\":\n /*!***********************!*\\\n !*** ./src/styles.js ***!\n \\***********************/\n\n /*! exports provided: calcThemeVariables, default */\n\n /***/\n function srcStylesJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"calcThemeVariables\", function () {\n return calcThemeVariables;\n });\n /* harmony import */\n\n\n var _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! ./diagrams/class/styles */\n \"./src/diagrams/class/styles.js\");\n /* harmony import */\n\n\n var _diagrams_er_styles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! ./diagrams/er/styles */\n \"./src/diagrams/er/styles.js\");\n /* harmony import */\n\n\n var _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\n /*! ./diagrams/flowchart/styles */\n \"./src/diagrams/flowchart/styles.js\");\n /* harmony import */\n\n\n var _diagrams_gantt_styles__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\n /*! ./diagrams/gantt/styles */\n \"./src/diagrams/gantt/styles.js\");\n /* harmony import */\n\n\n var _diagrams_git_styles__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(\n /*! ./diagrams/git/styles */\n \"./src/diagrams/git/styles.js\");\n /* harmony import */\n\n\n var _diagrams_info_styles__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(\n /*! ./diagrams/info/styles */\n \"./src/diagrams/info/styles.js\");\n /* harmony import */\n\n\n var _diagrams_pie_styles__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(\n /*! ./diagrams/pie/styles */\n \"./src/diagrams/pie/styles.js\");\n /* harmony import */\n\n\n var _diagrams_sequence_styles__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(\n /*! ./diagrams/sequence/styles */\n \"./src/diagrams/sequence/styles.js\");\n /* harmony import */\n\n\n var _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(\n /*! ./diagrams/state/styles */\n \"./src/diagrams/state/styles.js\");\n /* harmony import */\n\n\n var _diagrams_user_journey_styles__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(\n /*! ./diagrams/user-journey/styles */\n \"./src/diagrams/user-journey/styles.js\");\n\n var themes = {\n flowchart: _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n 'flowchart-v2': _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n sequence: _diagrams_sequence_styles__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n gantt: _diagrams_gantt_styles__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n classDiagram: _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n 'classDiagram-v2': _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n class: _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n stateDiagram: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n state: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n git: _diagrams_git_styles__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n info: _diagrams_info_styles__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n pie: _diagrams_pie_styles__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n er: _diagrams_er_styles__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n journey: _diagrams_user_journey_styles__WEBPACK_IMPORTED_MODULE_9__[\"default\"]\n };\n\n var calcThemeVariables = function calcThemeVariables(theme, userOverRides) {\n return theme.calcColors(userOverRides);\n };\n\n var getStyles = function getStyles(type, userStyles, options) {\n //console.warn('options in styles: ', options);\n return \" {\\n font-family: \".concat(options.fontFamily, \";\\n font-size: \").concat(options.fontSize, \";\\n fill: \").concat(options.textColor, \"\\n }\\n\\n /* Classes common for multiple diagrams */\\n\\n .error-icon {\\n fill: \").concat(options.errorBkgColor, \";\\n }\\n .error-text {\\n fill: \").concat(options.errorTextColor, \";\\n stroke: \").concat(options.errorTextColor, \";\\n }\\n\\n .edge-thickness-normal {\\n stroke-width: 2px;\\n }\\n .edge-thickness-thick {\\n stroke-width: 3.5px\\n }\\n .edge-pattern-solid {\\n stroke-dasharray: 0;\\n }\\n\\n .edge-pattern-dashed{\\n stroke-dasharray: 3;\\n }\\n .edge-pattern-dotted {\\n stroke-dasharray: 2;\\n }\\n\\n .marker {\\n fill: \").concat(options.lineColor, \";\\n }\\n .marker.cross {\\n stroke: \").concat(options.lineColor, \";\\n }\\n\\n svg {\\n font-family: \").concat(options.fontFamily, \";\\n font-size: \").concat(options.fontSize, \";\\n }\\n\\n \").concat(themes[type](options), \"\\n\\n \").concat(userStyles, \"\\n\\n \").concat(type, \" { fill: apa;}\\n\");\n };\n /* harmony default export */\n\n\n __webpack_exports__[\"default\"] = getStyles;\n /***/\n },\n\n /***/\n \"./src/themes/index.js\":\n /*!*****************************!*\\\n !*** ./src/themes/index.js ***!\n \\*****************************/\n\n /*! exports provided: default */\n\n /***/\n function srcThemesIndexJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony import */\n\n\n var _theme_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! ./theme-base */\n \"./src/themes/theme-base.js\");\n /* harmony import */\n\n\n var _theme_dark__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! ./theme-dark */\n \"./src/themes/theme-dark.js\");\n /* harmony import */\n\n\n var _theme_default__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\n /*! ./theme-default */\n \"./src/themes/theme-default.js\");\n /* harmony import */\n\n\n var _theme_forest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\n /*! ./theme-forest */\n \"./src/themes/theme-forest.js\");\n /* harmony import */\n\n\n var _theme_neutral__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(\n /*! ./theme-neutral */\n \"./src/themes/theme-neutral.js\");\n /* harmony default export */\n\n\n __webpack_exports__[\"default\"] = {\n base: {\n getThemeVariables: _theme_base__WEBPACK_IMPORTED_MODULE_0__[\"getThemeVariables\"]\n },\n dark: {\n getThemeVariables: _theme_dark__WEBPACK_IMPORTED_MODULE_1__[\"getThemeVariables\"]\n },\n default: {\n getThemeVariables: _theme_default__WEBPACK_IMPORTED_MODULE_2__[\"getThemeVariables\"]\n },\n forest: {\n getThemeVariables: _theme_forest__WEBPACK_IMPORTED_MODULE_3__[\"getThemeVariables\"]\n },\n neutral: {\n getThemeVariables: _theme_neutral__WEBPACK_IMPORTED_MODULE_4__[\"getThemeVariables\"]\n }\n };\n /***/\n },\n\n /***/\n \"./src/themes/theme-base.js\":\n /*!**********************************!*\\\n !*** ./src/themes/theme-base.js ***!\n \\**********************************/\n\n /*! exports provided: getThemeVariables */\n\n /***/\n function srcThemesThemeBaseJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getThemeVariables\", function () {\n return getThemeVariables;\n });\n /* harmony import */\n\n\n var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! khroma */\n \"khroma\");\n /* harmony import */\n\n\n var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__);\n /* harmony import */\n\n\n var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! ./theme-helpers */\n \"./src/themes/theme-helpers.js\");\n\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n var Theme = /*#__PURE__*/function () {\n function Theme() {\n _classCallCheck(this, Theme);\n /** # Base variables */\n\n /** * background - used to know what the background color is of the diagram. This is used for deducing colors for istance line color. Defaulr value is #f4f4f4. */\n\n\n this.background = '#f4f4f4';\n this.darkMode = false; // this.background = '#0c0c0c';\n // this.darkMode = true;\n\n this.primaryColor = '#fff4dd'; // this.background = '#0c0c0c';\n // this.primaryColor = '#1f1f00';\n\n this.noteBkgColor = '#fff5ad';\n this.noteTextColor = '#333'; // dark\n // this.primaryColor = '#034694';\n // this.primaryColor = '#f2ee7e';\n // this.primaryColor = '#9f33be';\n // this.primaryColor = '#f0fff0';\n // this.primaryColor = '#fa255e';\n // this.primaryColor = '#ECECFF';\n // this.secondaryColor = '#c39ea0';\n // this.tertiaryColor = '#f8e5e5';\n // this.secondaryColor = '#dfdfde';\n // this.tertiaryColor = '#CCCCFF';\n\n this.fontFamily = '\"trebuchet ms\", verdana, arial';\n this.fontSize = '16px'; // this.updateColors();\n }\n\n _createClass(Theme, [{\n key: \"updateColors\",\n value: function updateColors() {\n // The || is to make sure that if the variable has been defiend by a user override that value is to be used\n\n /* Main */\n this.primaryTextColor = this.primaryTextColor || (this.darkMode ? '#ddd' : '#333'); // invert(this.primaryColor);\n\n this.secondaryColor = this.secondaryColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: -120\n });\n this.tertiaryColor = this.tertiaryColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: 180,\n l: 5\n });\n this.primaryBorderColor = this.primaryBorderColor || Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__[\"mkBorder\"])(this.primaryColor, this.darkMode);\n this.secondaryBorderColor = this.secondaryBorderColor || Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__[\"mkBorder\"])(this.secondaryColor, this.darkMode);\n this.tertiaryBorderColor = this.tertiaryBorderColor || Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__[\"mkBorder\"])(this.tertiaryColor, this.darkMode);\n this.noteBorderColor = this.noteBorderColor || Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__[\"mkBorder\"])(this.noteBkgColor, this.darkMode);\n this.secondaryTextColor = this.secondaryTextColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.secondaryColor);\n this.tertiaryTextColor = this.tertiaryTextColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.tertiaryColor);\n this.lineColor = this.lineColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.background);\n this.textColor = this.textColor || this.primaryTextColor;\n /* Flowchart variables */\n\n this.nodeBkg = this.nodeBkg || this.primaryColor;\n this.mainBkg = this.mainBkg || this.primaryColor;\n this.nodeBorder = this.nodeBorder || this.primaryBorderColor;\n this.clusterBkg = this.clusterBkg || this.tertiaryColor;\n this.clusterBorder = this.clusterBorder || this.tertiaryBorderColor;\n this.defaultLinkColor = this.defaultLinkColor || this.lineColor;\n this.titleColor = this.titleColor || this.tertiaryTextColor;\n this.edgeLabelBackground = this.edgeLabelBackground || this.darkMode ? Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"darken\"])(this.secondaryColor, 30) : this.secondaryColor;\n this.nodeTextColor = this.nodeTextColor || this.primaryTextColor;\n /* Sequence Diagram variables */\n // this.actorBorder = lighten(this.border1, 0.5);\n\n this.actorBorder = this.actorBorder || this.primaryBorderColor;\n this.actorBkg = this.actorBkg || this.mainBkg;\n this.actorTextColor = this.actorTextColor || this.primaryTextColor;\n this.actorLineColor = this.actorLineColor || 'grey';\n this.labelBoxBkgColor = this.labelBoxBkgColor || this.actorBkg;\n this.signalColor = this.signalColor || this.textColor;\n this.signalTextColor = this.signalTextColor || this.textColor;\n this.labelBoxBorderColor = this.labelBoxBorderColor || this.actorBorder;\n this.labelTextColor = this.labelTextColor || this.actorTextColor;\n this.loopTextColor = this.loopTextColor || this.actorTextColor;\n this.activationBorderColor = this.activationBorderColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"darken\"])(this.secondaryColor, 10);\n this.activationBkgColor = this.activationBkgColor || this.secondaryColor;\n this.sequenceNumberColor = this.sequenceNumberColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.lineColor);\n /* Gantt chart variables */\n\n this.sectionBkgColor = this.sectionBkgColor || this.tertiaryColor;\n this.altSectionBkgColor = this.altSectionBkgColor || 'white';\n this.sectionBkgColor = this.sectionBkgColor || this.secondaryColor;\n this.sectionBkgColor2 = this.sectionBkgColor2 || this.primaryColor;\n this.taskBorderColor = this.taskBorderColor || this.primaryBorderColor;\n this.taskBkgColor = this.taskBkgColor || this.primaryColor;\n this.activeTaskBorderColor = this.activeTaskBorderColor || this.primaryColor;\n this.activeTaskBkgColor = this.activeTaskBkgColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"lighten\"])(this.primaryColor, 23);\n this.gridColor = this.gridColor || 'lightgrey';\n this.doneTaskBkgColor = this.doneTaskBkgColor || 'lightgrey';\n this.doneTaskBorderColor = this.doneTaskBorderColor || 'grey';\n this.critBorderColor = this.critBorderColor || '#ff8888';\n this.critBkgColor = this.critBkgColor || 'red';\n this.todayLineColor = this.todayLineColor || 'red';\n this.taskTextColor = this.taskTextColor || this.textColor;\n this.taskTextOutsideColor = this.taskTextOutsideColor || this.textColor;\n this.taskTextLightColor = this.taskTextLightColor || this.textColor;\n this.taskTextColor = this.taskTextColor || this.primaryTextColor;\n this.taskTextDarkColor = this.taskTextDarkColor || this.textColor;\n this.taskTextClickableColor = this.taskTextClickableColor || '#003163';\n /* state colors */\n\n this.labelColor = this.labelColor || this.primaryTextColor;\n this.altBackground = this.altBackground || this.tertiaryColor;\n this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;\n this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;\n /* class */\n\n this.classText = this.classText || this.textColor;\n /* user-journey */\n\n this.fillType0 = this.fillType0 || this.primaryColor;\n this.fillType1 = this.fillType1 || this.secondaryColor;\n this.fillType2 = this.fillType2 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: 64\n });\n this.fillType3 = this.fillType3 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.secondaryColor, {\n h: 64\n });\n this.fillType4 = this.fillType4 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: -64\n });\n this.fillType5 = this.fillType5 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.secondaryColor, {\n h: -64\n });\n this.fillType6 = this.fillType6 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: 128\n });\n this.fillType7 = this.fillType7 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.secondaryColor, {\n h: 128\n });\n }\n }, {\n key: \"calculate\",\n value: function calculate(overrides) {\n var _this = this;\n\n if (_typeof(overrides) !== 'object') {\n // Calculate colors form base colors\n this.updateColors();\n return;\n }\n\n var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors\n\n keys.forEach(function (k) {\n _this[k] = overrides[k];\n }); // Calculate colors form base colors\n\n this.updateColors(); // Copy values from overrides again in case of an override of derived value\n\n keys.forEach(function (k) {\n _this[k] = overrides[k];\n });\n }\n }]);\n\n return Theme;\n }();\n\n var getThemeVariables = function getThemeVariables(userOverrides) {\n var theme = new Theme();\n theme.calculate(userOverrides);\n return theme;\n };\n /***/\n\n },\n\n /***/\n \"./src/themes/theme-dark.js\":\n /*!**********************************!*\\\n !*** ./src/themes/theme-dark.js ***!\n \\**********************************/\n\n /*! exports provided: getThemeVariables */\n\n /***/\n function srcThemesThemeDarkJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getThemeVariables\", function () {\n return getThemeVariables;\n });\n /* harmony import */\n\n\n var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! khroma */\n \"khroma\");\n /* harmony import */\n\n\n var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__);\n /* harmony import */\n\n\n var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! ./theme-helpers */\n \"./src/themes/theme-helpers.js\");\n\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n var Theme = /*#__PURE__*/function () {\n function Theme() {\n _classCallCheck(this, Theme);\n\n this.background = '#333';\n this.primaryColor = '#1f2020';\n this.secondaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"lighten\"])(this.primaryColor, 16);\n this.tertiaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: -160\n });\n this.primaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__[\"mkBorder\"])(this.primaryColor, this.darkMode);\n this.secondaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__[\"mkBorder\"])(this.secondaryColor, this.darkMode);\n this.tertiaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__[\"mkBorder\"])(this.tertiaryColor, this.darkMode);\n this.primaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.primaryColor);\n this.secondaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.secondaryColor);\n this.tertiaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.tertiaryColor);\n this.lineColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.background);\n this.textColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.background);\n this.mainBkg = '#1f2020';\n this.secondBkg = 'calculated';\n this.mainContrastColor = 'lightgrey';\n this.darkTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"lighten\"])(Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])('#323D47'), 10);\n this.lineColor = 'calculated';\n this.border1 = '#81B1DB';\n this.border2 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"rgba\"])(255, 255, 255, 0.25);\n this.arrowheadColor = 'calculated';\n this.fontFamily = '\"trebuchet ms\", verdana, arial';\n this.fontSize = '16px';\n this.labelBackground = '#181818';\n this.textColor = '#ccc';\n /* Flowchart variables */\n\n this.nodeBkg = 'calculated';\n this.nodeBorder = 'calculated';\n this.clusterBkg = 'calculated';\n this.clusterBorder = 'calculated';\n this.defaultLinkColor = 'calculated';\n this.titleColor = '#F9FFFE';\n this.edgeLabelBackground = 'calculated';\n /* Sequence Diagram variables */\n\n this.actorBorder = 'calculated';\n this.actorBkg = 'calculated';\n this.actorTextColor = 'calculated';\n this.actorLineColor = 'calculated';\n this.signalColor = 'calculated';\n this.signalTextColor = 'calculated';\n this.labelBoxBkgColor = 'calculated';\n this.labelBoxBorderColor = 'calculated';\n this.labelTextColor = 'calculated';\n this.loopTextColor = 'calculated';\n this.noteBorderColor = 'calculated';\n this.noteBkgColor = '#fff5ad';\n this.noteTextColor = 'calculated';\n this.activationBorderColor = 'calculated';\n this.activationBkgColor = 'calculated';\n this.sequenceNumberColor = 'black';\n /* Gantt chart variables */\n\n this.sectionBkgColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"darken\"])('#EAE8D9', 30);\n this.altSectionBkgColor = 'calculated';\n this.sectionBkgColor2 = '#EAE8D9';\n this.taskBorderColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"rgba\"])(255, 255, 255, 70);\n this.taskBkgColor = 'calculated';\n this.taskTextColor = 'calculated';\n this.taskTextLightColor = 'calculated';\n this.taskTextOutsideColor = 'calculated';\n this.taskTextClickableColor = '#003163';\n this.activeTaskBorderColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"rgba\"])(255, 255, 255, 50);\n this.activeTaskBkgColor = '#81B1DB';\n this.gridColor = 'calculated';\n this.doneTaskBkgColor = 'calculated';\n this.doneTaskBorderColor = 'grey';\n this.critBorderColor = '#E83737';\n this.critBkgColor = '#E83737';\n this.taskTextDarkColor = 'calculated';\n this.todayLineColor = '#DB5757';\n /* state colors */\n\n this.labelColor = 'calculated';\n this.errorBkgColor = '#a44141';\n this.errorTextColor = '#ddd';\n }\n\n _createClass(Theme, [{\n key: \"updateColors\",\n value: function updateColors() {\n this.secondBkg = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"lighten\"])(this.mainBkg, 16);\n this.lineColor = this.mainContrastColor;\n this.arrowheadColor = this.mainContrastColor;\n /* Flowchart variables */\n\n this.nodeBkg = this.mainBkg;\n this.nodeBorder = this.border1;\n this.clusterBkg = this.secondBkg;\n this.clusterBorder = this.border2;\n this.defaultLinkColor = this.lineColor;\n this.edgeLabelBackground = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"lighten\"])(this.labelBackground, 25);\n /* Sequence Diagram variables */\n\n this.actorBorder = this.border1;\n this.actorBkg = this.mainBkg;\n this.actorTextColor = this.mainContrastColor;\n this.actorLineColor = this.mainContrastColor;\n this.signalColor = this.mainContrastColor;\n this.signalTextColor = this.mainContrastColor;\n this.labelBoxBkgColor = this.actorBkg;\n this.labelBoxBorderColor = this.actorBorder;\n this.labelTextColor = this.mainContrastColor;\n this.loopTextColor = this.mainContrastColor;\n this.noteBorderColor = this.border2;\n this.noteTextColor = this.mainBkg;\n this.activationBorderColor = this.border1;\n this.activationBkgColor = this.secondBkg;\n /* Gantt chart variables */\n\n this.altSectionBkgColor = this.background;\n this.taskBkgColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"lighten\"])(this.mainBkg, 23);\n this.taskTextColor = this.darkTextColor;\n this.taskTextLightColor = this.mainContrastColor;\n this.taskTextOutsideColor = this.taskTextLightColor;\n this.gridColor = this.mainContrastColor;\n this.doneTaskBkgColor = this.mainContrastColor;\n this.taskTextDarkColor = this.darkTextColor;\n /* state colors */\n\n this.labelColor = this.textColor;\n this.altBackground = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"lighten\"])(this.background, 20);\n this.fillType0 = this.primaryColor;\n this.fillType1 = this.secondaryColor;\n this.fillType2 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: 64\n });\n this.fillType3 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.secondaryColor, {\n h: 64\n });\n this.fillType4 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: -64\n });\n this.fillType5 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.secondaryColor, {\n h: -64\n });\n this.fillType6 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: 128\n });\n this.fillType7 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.secondaryColor, {\n h: 128\n });\n /* class */\n\n this.classText = this.primaryTextColor;\n }\n }, {\n key: \"calculate\",\n value: function calculate(overrides) {\n var _this = this;\n\n if (_typeof(overrides) !== 'object') {\n // Calculate colors form base colors\n this.updateColors();\n return;\n }\n\n var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors\n\n keys.forEach(function (k) {\n _this[k] = overrides[k];\n }); // Calculate colors form base colors\n\n this.updateColors(); // Copy values from overrides again in case of an override of derived value\n\n keys.forEach(function (k) {\n _this[k] = overrides[k];\n });\n }\n }]);\n\n return Theme;\n }();\n\n var getThemeVariables = function getThemeVariables(userOverrides) {\n var theme = new Theme();\n theme.calculate(userOverrides);\n console.info('Theme(dark)', {\n userOverrides: userOverrides,\n theme: theme\n });\n return theme;\n };\n /***/\n\n },\n\n /***/\n \"./src/themes/theme-default.js\":\n /*!*************************************!*\\\n !*** ./src/themes/theme-default.js ***!\n \\*************************************/\n\n /*! exports provided: getThemeVariables */\n\n /***/\n function srcThemesThemeDefaultJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getThemeVariables\", function () {\n return getThemeVariables;\n });\n /* harmony import */\n\n\n var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! khroma */\n \"khroma\");\n /* harmony import */\n\n\n var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__);\n /* harmony import */\n\n\n var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! ./theme-helpers */\n \"./src/themes/theme-helpers.js\");\n\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n var Theme = /*#__PURE__*/function () {\n function Theme() {\n _classCallCheck(this, Theme);\n /* Base variables */\n\n\n this.background = '#f4f4f4';\n this.primaryColor = '#ECECFF';\n this.secondaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: 120\n });\n this.secondaryColor = '#ffffde';\n this.tertiaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: -160\n });\n this.primaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__[\"mkBorder\"])(this.primaryColor, this.darkMode);\n this.secondaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__[\"mkBorder\"])(this.secondaryColor, this.darkMode);\n this.tertiaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__[\"mkBorder\"])(this.tertiaryColor, this.darkMode); // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode);\n\n this.primaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.primaryColor);\n this.secondaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.secondaryColor);\n this.tertiaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.tertiaryColor);\n this.lineColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.background);\n this.textColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.background);\n this.background = 'white';\n this.mainBkg = '#ECECFF';\n this.secondBkg = '#ffffde';\n this.lineColor = '#333333';\n this.border1 = '#9370DB';\n this.border2 = '#aaaa33';\n this.arrowheadColor = '#333333';\n this.fontFamily = '\"trebuchet ms\", verdana, arial';\n this.fontSize = '16px';\n this.labelBackground = '#e8e8e8';\n this.textColor = '#333';\n /* Flowchart variables */\n\n this.nodeBkg = 'calculated';\n this.nodeBorder = 'calculated';\n this.clusterBkg = 'calculated';\n this.clusterBorder = 'calculated';\n this.defaultLinkColor = 'calculated';\n this.titleColor = 'calculated';\n this.edgeLabelBackground = 'calculated';\n /* Sequence Diagram variables */\n\n this.actorBorder = 'calculated';\n this.actorBkg = 'calculated';\n this.actorTextColor = 'black';\n this.actorLineColor = 'grey';\n this.signalColor = 'calculated';\n this.signalTextColor = 'calculated';\n this.labelBoxBkgColor = 'calculated';\n this.labelBoxBorderColor = 'calculated';\n this.labelTextColor = 'calculated';\n this.loopTextColor = 'calculated';\n this.noteBorderColor = 'calculated';\n this.noteBkgColor = '#fff5ad';\n this.noteTextColor = 'calculated';\n this.activationBorderColor = '#666';\n this.activationBkgColor = '#f4f4f4';\n this.sequenceNumberColor = 'white';\n /* Gantt chart variables */\n\n this.sectionBkgColor = 'calculated';\n this.altSectionBkgColor = 'calculated';\n this.sectionBkgColor2 = 'calculated';\n this.taskBorderColor = 'calculated';\n this.taskBkgColor = 'calculated';\n this.taskTextLightColor = 'calculated';\n this.taskTextColor = this.taskTextLightColor;\n this.taskTextDarkColor = 'calculated';\n this.taskTextOutsideColor = this.taskTextDarkColor;\n this.taskTextClickableColor = 'calculated';\n this.activeTaskBorderColor = 'calculated';\n this.activeTaskBkgColor = 'calculated';\n this.gridColor = 'calculated';\n this.doneTaskBkgColor = 'calculated';\n this.doneTaskBorderColor = 'calculated';\n this.critBorderColor = 'calculated';\n this.critBkgColor = 'calculated';\n this.todayLineColor = 'calculated';\n this.sectionBkgColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"rgba\"])(102, 102, 255, 0.49);\n this.altSectionBkgColor = 'white';\n this.sectionBkgColor2 = '#fff400';\n this.taskBorderColor = '#534fbc';\n this.taskBkgColor = '#8a90dd';\n this.taskTextLightColor = 'white';\n this.taskTextColor = 'calculated';\n this.taskTextDarkColor = 'black';\n this.taskTextOutsideColor = 'calculated';\n this.taskTextClickableColor = '#003163';\n this.activeTaskBorderColor = '#534fbc';\n this.activeTaskBkgColor = '#bfc7ff';\n this.gridColor = 'lightgrey';\n this.doneTaskBkgColor = 'lightgrey';\n this.doneTaskBorderColor = 'grey';\n this.critBorderColor = '#ff8888';\n this.critBkgColor = 'red';\n this.todayLineColor = 'red';\n /* state colors */\n\n this.labelColor = 'black';\n this.errorBkgColor = '#552222';\n this.errorTextColor = '#552222';\n this.updateColors();\n }\n\n _createClass(Theme, [{\n key: \"updateColors\",\n value: function updateColors() {\n /* Flowchart variables */\n this.nodeBkg = this.mainBkg;\n this.nodeBorder = this.border1; // border 1\n\n this.clusterBkg = this.secondBkg;\n this.clusterBorder = this.border2;\n this.defaultLinkColor = this.lineColor;\n this.titleColor = this.textColor;\n this.edgeLabelBackground = this.labelBackground;\n /* Sequence Diagram variables */\n // this.actorBorder = lighten(this.border1, 0.5);\n\n this.actorBorder = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"lighten\"])(this.border1, 23);\n this.actorBkg = this.mainBkg;\n this.labelBoxBkgColor = this.actorBkg;\n this.signalColor = this.textColor;\n this.signalTextColor = this.textColor;\n this.labelBoxBorderColor = this.actorBorder;\n this.labelTextColor = this.actorTextColor;\n this.loopTextColor = this.actorTextColor;\n this.noteBorderColor = this.border2;\n this.noteTextColor = this.actorTextColor;\n /* Gantt chart variables */\n\n this.taskTextColor = this.taskTextLightColor;\n this.taskTextOutsideColor = this.taskTextDarkColor;\n /* state colors */\n\n /* class */\n\n this.classText = this.primaryTextColor;\n /* journey */\n\n this.fillType0 = this.primaryColor;\n this.fillType1 = this.secondaryColor;\n this.fillType2 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: 64\n });\n this.fillType3 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.secondaryColor, {\n h: 64\n });\n this.fillType4 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: -64\n });\n this.fillType5 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.secondaryColor, {\n h: -64\n });\n this.fillType6 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: 128\n });\n this.fillType7 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.secondaryColor, {\n h: 128\n });\n }\n }, {\n key: \"calculate\",\n value: function calculate(overrides) {\n var _this = this;\n\n if (_typeof(overrides) !== 'object') {\n // Calculate colors form base colors\n this.updateColors();\n return;\n }\n\n var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors\n\n keys.forEach(function (k) {\n _this[k] = overrides[k];\n }); // Calculate colors form base colors\n\n this.updateColors(); // Copy values from overrides again in case of an override of derived value\n\n keys.forEach(function (k) {\n _this[k] = overrides[k];\n });\n }\n }]);\n\n return Theme;\n }();\n\n var getThemeVariables = function getThemeVariables(userOverrides) {\n var theme = new Theme();\n theme.calculate(userOverrides); // console.info('Theme(default)', { userOverrides, theme });\n\n return theme;\n };\n /***/\n\n },\n\n /***/\n \"./src/themes/theme-forest.js\":\n /*!************************************!*\\\n !*** ./src/themes/theme-forest.js ***!\n \\************************************/\n\n /*! exports provided: getThemeVariables */\n\n /***/\n function srcThemesThemeForestJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getThemeVariables\", function () {\n return getThemeVariables;\n });\n /* harmony import */\n\n\n var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! khroma */\n \"khroma\");\n /* harmony import */\n\n\n var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__);\n /* harmony import */\n\n\n var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! ./theme-helpers */\n \"./src/themes/theme-helpers.js\");\n\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n var Theme = /*#__PURE__*/function () {\n function Theme() {\n _classCallCheck(this, Theme);\n /* Base vales */\n\n\n this.background = '#f4f4f4';\n this.primaryColor = '#cde498';\n this.secondaryColor = '#cdffb2';\n this.background = 'white';\n this.mainBkg = '#cde498';\n this.secondBkg = '#cdffb2';\n this.lineColor = 'green';\n this.border1 = '#13540c';\n this.border2 = '#6eaa49';\n this.arrowheadColor = 'green';\n this.fontFamily = '\"trebuchet ms\", verdana, arial';\n this.fontSize = '16px';\n this.tertiaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"lighten\"])('#cde498', 10);\n this.primaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__[\"mkBorder\"])(this.primaryColor, this.darkMode);\n this.secondaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__[\"mkBorder\"])(this.secondaryColor, this.darkMode);\n this.tertiaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__[\"mkBorder\"])(this.tertiaryColor, this.darkMode);\n this.primaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.primaryColor);\n this.secondaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.secondaryColor);\n this.tertiaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.primaryColor);\n this.lineColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.background);\n this.textColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.background);\n /* Flowchart variables */\n\n this.nodeBkg = 'calculated';\n this.nodeBorder = 'calculated';\n this.clusterBkg = 'calculated';\n this.clusterBorder = 'calculated';\n this.defaultLinkColor = 'calculated';\n this.titleColor = '#333';\n this.edgeLabelBackground = '#e8e8e8';\n /* Sequence Diagram variables */\n\n this.actorBorder = 'calculated';\n this.actorBkg = 'calculated';\n this.actorTextColor = 'black';\n this.actorLineColor = 'grey';\n this.signalColor = '#333';\n this.signalTextColor = '#333';\n this.labelBoxBkgColor = 'calculated';\n this.labelBoxBorderColor = '#326932';\n this.labelTextColor = 'calculated';\n this.loopTextColor = 'calculated';\n this.noteBorderColor = 'calculated';\n this.noteBkgColor = '#fff5ad';\n this.noteTextColor = 'calculated';\n this.activationBorderColor = '#666';\n this.activationBkgColor = '#f4f4f4';\n this.sequenceNumberColor = 'white';\n /* Gantt chart variables */\n\n this.sectionBkgColor = '#6eaa49';\n this.altSectionBkgColor = 'white';\n this.sectionBkgColor2 = '#6eaa49';\n this.taskBorderColor = 'calculated';\n this.taskBkgColor = '#487e3a';\n this.taskTextLightColor = 'white';\n this.taskTextColor = 'calculated';\n this.taskTextDarkColor = 'black';\n this.taskTextOutsideColor = 'calculated';\n this.taskTextClickableColor = '#003163';\n this.activeTaskBorderColor = 'calculated';\n this.activeTaskBkgColor = 'calculated';\n this.gridColor = 'lightgrey';\n this.doneTaskBkgColor = 'lightgrey';\n this.doneTaskBorderColor = 'grey';\n this.critBorderColor = '#ff8888';\n this.critBkgColor = 'red';\n this.todayLineColor = 'red';\n /* state colors */\n\n this.labelColor = 'black';\n this.errorBkgColor = '#552222';\n this.errorTextColor = '#552222';\n }\n\n _createClass(Theme, [{\n key: \"updateColors\",\n value: function updateColors() {\n /* Flowchart variables */\n this.nodeBkg = this.mainBkg;\n this.nodeBorder = this.border1;\n this.clusterBkg = this.secondBkg;\n this.clusterBorder = this.border2;\n this.defaultLinkColor = this.lineColor;\n /* Sequence Diagram variables */\n\n this.actorBorder = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"darken\"])(this.mainBkg, 20);\n this.actorBkg = this.mainBkg;\n this.labelBoxBkgColor = this.actorBkg;\n this.labelTextColor = this.actorTextColor;\n this.loopTextColor = this.actorTextColor;\n this.noteBorderColor = this.border2;\n this.noteTextColor = this.actorTextColor;\n /* Gantt chart variables */\n\n this.taskBorderColor = this.border1;\n this.taskTextColor = this.taskTextLightColor;\n this.taskTextOutsideColor = this.taskTextDarkColor;\n this.activeTaskBorderColor = this.taskBorderColor;\n this.activeTaskBkgColor = this.mainBkg;\n /* state colors */\n\n /* class */\n\n this.classText = this.primaryTextColor;\n /* journey */\n\n this.fillType0 = this.primaryColor;\n this.fillType1 = this.secondaryColor;\n this.fillType2 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: 64\n });\n this.fillType3 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.secondaryColor, {\n h: 64\n });\n this.fillType4 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: -64\n });\n this.fillType5 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.secondaryColor, {\n h: -64\n });\n this.fillType6 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: 128\n });\n this.fillType7 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.secondaryColor, {\n h: 128\n });\n }\n }, {\n key: \"calculate\",\n value: function calculate(overrides) {\n var _this = this;\n\n if (_typeof(overrides) !== 'object') {\n // Calculate colors form base colors\n this.updateColors();\n return;\n }\n\n var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors\n\n keys.forEach(function (k) {\n _this[k] = overrides[k];\n }); // Calculate colors form base colors\n\n this.updateColors(); // Copy values from overrides again in case of an override of derived value\n\n keys.forEach(function (k) {\n _this[k] = overrides[k];\n });\n }\n }]);\n\n return Theme;\n }();\n\n var getThemeVariables = function getThemeVariables(userOverrides) {\n var theme = new Theme();\n theme.calculate(userOverrides);\n console.info('Theme(forest)', {\n userOverrides: userOverrides,\n theme: theme\n });\n return theme;\n };\n /***/\n\n },\n\n /***/\n \"./src/themes/theme-helpers.js\":\n /*!*************************************!*\\\n !*** ./src/themes/theme-helpers.js ***!\n \\*************************************/\n\n /*! exports provided: mkBorder */\n\n /***/\n function srcThemesThemeHelpersJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"mkBorder\", function () {\n return mkBorder;\n });\n /* harmony import */\n\n\n var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! khroma */\n \"khroma\");\n /* harmony import */\n\n\n var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__);\n\n var mkBorder = function mkBorder(col, darkMode) {\n return darkMode ? Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(col, {\n s: -40,\n l: 10\n }) : Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(col, {\n s: -40,\n l: -10\n });\n };\n /***/\n\n },\n\n /***/\n \"./src/themes/theme-neutral.js\":\n /*!*************************************!*\\\n !*** ./src/themes/theme-neutral.js ***!\n \\*************************************/\n\n /*! exports provided: getThemeVariables */\n\n /***/\n function srcThemesThemeNeutralJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getThemeVariables\", function () {\n return getThemeVariables;\n });\n /* harmony import */\n\n\n var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! khroma */\n \"khroma\");\n /* harmony import */\n\n\n var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__);\n /* harmony import */\n\n\n var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! ./theme-helpers */\n \"./src/themes/theme-helpers.js\");\n\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n } // const Color = require ( 'khroma/dist/color' ).default\n // Color.format.hex.stringify(Color.parse('hsl(210, 66.6666666667%, 95%)')); // => \"#EAF2FB\"\n\n\n var Theme = /*#__PURE__*/function () {\n function Theme() {\n _classCallCheck(this, Theme);\n\n this.primaryColor = '#eee';\n this.contrast = '#26a';\n this.secondaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"lighten\"])(this.contrast, 55);\n this.background = '#ffffff'; // this.secondaryColor = adjust(this.primaryColor, { h: 120 });\n\n this.tertiaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: -160\n }); // console.log('primary color', this.primaryColor, 'tertiary - color', this.tertiaryColor);\n\n this.primaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__[\"mkBorder\"])(this.primaryColor, this.darkMode);\n this.secondaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__[\"mkBorder\"])(this.secondaryColor, this.darkMode);\n this.tertiaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__[\"mkBorder\"])(this.tertiaryColor, this.darkMode); // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode);\n\n this.primaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.primaryColor);\n this.secondaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.secondaryColor);\n this.tertiaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.tertiaryColor);\n this.lineColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.background);\n this.textColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"invert\"])(this.background);\n this.altBackground = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"lighten\"])(this.contrast, 55);\n this.mainBkg = '#eee';\n this.secondBkg = 'calculated';\n this.lineColor = '#666';\n this.border1 = '#999';\n this.border2 = 'calculated';\n this.note = '#ffa';\n this.text = '#333';\n this.critical = '#d42';\n this.done = '#bbb';\n this.arrowheadColor = '#333333';\n this.fontFamily = '\"trebuchet ms\", verdana, arial';\n this.fontSize = '16px';\n /* Flowchart variables */\n\n this.nodeBkg = 'calculated';\n this.nodeBorder = 'calculated';\n this.clusterBkg = 'calculated';\n this.clusterBorder = 'calculated';\n this.defaultLinkColor = 'calculated';\n this.titleColor = 'calculated';\n this.edgeLabelBackground = 'white';\n /* Sequence Diagram variables */\n\n this.actorBorder = 'calculated';\n this.actorBkg = 'calculated';\n this.actorTextColor = 'calculated';\n this.actorLineColor = 'calculated';\n this.signalColor = 'calculated';\n this.signalTextColor = 'calculated';\n this.labelBoxBkgColor = 'calculated';\n this.labelBoxBorderColor = 'calculated';\n this.labelTextColor = 'calculated';\n this.loopTextColor = 'calculated';\n this.noteBorderColor = 'calculated';\n this.noteBkgColor = 'calculated';\n this.noteTextColor = 'calculated';\n this.activationBorderColor = '#666';\n this.activationBkgColor = '#f4f4f4';\n this.sequenceNumberColor = 'white';\n /* Gantt chart variables */\n\n this.sectionBkgColor = 'calculated';\n this.altSectionBkgColor = 'white';\n this.sectionBkgColor2 = 'calculated';\n this.taskBorderColor = 'calculated';\n this.taskBkgColor = 'calculated';\n this.taskTextLightColor = 'white';\n this.taskTextColor = 'calculated';\n this.taskTextDarkColor = 'calculated';\n this.taskTextOutsideColor = 'calculated';\n this.taskTextClickableColor = '#003163';\n this.activeTaskBorderColor = 'calculated';\n this.activeTaskBkgColor = 'calculated';\n this.gridColor = 'calculated';\n this.doneTaskBkgColor = 'calculated';\n this.doneTaskBorderColor = 'calculated';\n this.critBkgColor = 'calculated';\n this.critBorderColor = 'calculated';\n this.todayLineColor = 'calculated';\n /* state colors */\n\n this.labelColor = 'black';\n this.errorBkgColor = '#552222';\n this.errorTextColor = '#552222';\n }\n\n _createClass(Theme, [{\n key: \"updateColors\",\n value: function updateColors() {\n this.secondBkg = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"lighten\"])(this.contrast, 55);\n this.border2 = this.contrast;\n /* Flowchart variables */\n\n this.nodeBkg = this.mainBkg;\n this.nodeBorder = this.border1;\n this.clusterBkg = this.secondBkg;\n this.clusterBorder = this.border2;\n this.defaultLinkColor = this.lineColor;\n this.titleColor = this.text;\n /* Sequence Diagram variables */\n\n this.actorBorder = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"lighten\"])(this.border1, 23);\n this.actorBkg = this.mainBkg;\n this.actorTextColor = this.text;\n this.actorLineColor = this.lineColor;\n this.signalColor = this.text;\n this.signalTextColor = this.text;\n this.labelBoxBkgColor = this.actorBkg;\n this.labelBoxBorderColor = this.actorBorder;\n this.labelTextColor = this.text;\n this.loopTextColor = this.text;\n this.noteBorderColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"darken\"])(this.note, 60);\n this.noteBkgColor = this.note;\n this.noteTextColor = this.actorTextColor;\n /* Gantt chart variables */\n\n this.sectionBkgColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"lighten\"])(this.contrast, 30);\n this.sectionBkgColor2 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"lighten\"])(this.contrast, 30);\n this.taskBorderColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"darken\"])(this.contrast, 10);\n this.taskBkgColor = this.contrast;\n this.taskTextColor = this.taskTextLightColor;\n this.taskTextDarkColor = this.text;\n this.taskTextOutsideColor = this.taskTextDarkColor;\n this.activeTaskBorderColor = this.taskBorderColor;\n this.activeTaskBkgColor = this.mainBkg;\n this.gridColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"lighten\"])(this.border1, 30);\n this.doneTaskBkgColor = this.done;\n this.doneTaskBorderColor = this.lineColor;\n this.critBkgColor = this.critical;\n this.critBorderColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"darken\"])(this.critBkgColor, 10);\n this.todayLineColor = this.critBkgColor;\n /* state colors */\n\n /* class */\n\n this.classText = this.primaryTextColor;\n /* journey */\n\n this.fillType0 = this.primaryColor;\n this.fillType1 = this.secondaryColor;\n this.fillType2 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: 64\n });\n this.fillType3 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.secondaryColor, {\n h: 64\n });\n this.fillType4 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: -64\n });\n this.fillType5 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.secondaryColor, {\n h: -64\n });\n this.fillType6 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.primaryColor, {\n h: 128\n });\n this.fillType7 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__[\"adjust\"])(this.secondaryColor, {\n h: 128\n });\n }\n }, {\n key: \"calculate\",\n value: function calculate(overrides) {\n var _this = this;\n\n if (_typeof(overrides) !== 'object') {\n // Calculate colors form base colors\n this.updateColors();\n return;\n }\n\n var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors\n\n keys.forEach(function (k) {\n _this[k] = overrides[k];\n }); // Calculate colors form base colors\n\n this.updateColors(); // Copy values from overrides again in case of an override of derived value\n\n keys.forEach(function (k) {\n _this[k] = overrides[k];\n });\n }\n }]);\n\n return Theme;\n }();\n\n var getThemeVariables = function getThemeVariables(userOverrides) {\n var theme = new Theme();\n theme.calculate(userOverrides);\n console.info('Theme(neutral)', {\n userOverrides: userOverrides,\n theme: theme\n });\n return theme;\n };\n /***/\n\n },\n\n /***/\n \"./src/utils.js\":\n /*!**********************!*\\\n !*** ./src/utils.js ***!\n \\**********************/\n\n /*! exports provided: detectInit, detectDirective, detectType, isSubstringInArray, interpolateToCurve, formatUrl, runFunc, getStylesFromArray, generateId, random, assignWithDepth, getTextObj, drawSimpleText, wrapLabel, calculateTextHeight, calculateTextWidth, calculateTextDimensions, default */\n\n /***/\n function srcUtilsJs(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"detectInit\", function () {\n return detectInit;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"detectDirective\", function () {\n return detectDirective;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"detectType\", function () {\n return detectType;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"isSubstringInArray\", function () {\n return isSubstringInArray;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"interpolateToCurve\", function () {\n return interpolateToCurve;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"formatUrl\", function () {\n return formatUrl;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"runFunc\", function () {\n return runFunc;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getStylesFromArray\", function () {\n return getStylesFromArray;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"generateId\", function () {\n return generateId;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"random\", function () {\n return random;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"assignWithDepth\", function () {\n return assignWithDepth;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getTextObj\", function () {\n return getTextObj;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"drawSimpleText\", function () {\n return drawSimpleText;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"wrapLabel\", function () {\n return wrapLabel;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"calculateTextHeight\", function () {\n return calculateTextHeight;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"calculateTextWidth\", function () {\n return calculateTextWidth;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"calculateTextDimensions\", function () {\n return calculateTextDimensions;\n });\n /* harmony import */\n\n\n var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\n /*! d3 */\n \"d3\");\n /* harmony import */\n\n\n var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);\n /* harmony import */\n\n\n var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\n /*! ./logger */\n \"./src/logger.js\");\n /* harmony import */\n\n\n var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(\n /*! @braintree/sanitize-url */\n \"@braintree/sanitize-url\");\n /* harmony import */\n\n\n var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_2__);\n /* harmony import */\n\n\n var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(\n /*! ./diagrams/common/common */\n \"./src/diagrams/common/common.js\");\n\n var _this = undefined;\n\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n function _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n }\n\n function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n }\n\n function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n }\n\n function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n } // import cryptoRandomString from 'crypto-random-string';\n // Effectively an enum of the supported curve types, accessible by name\n\n\n var d3CurveTypes = {\n curveBasis: d3__WEBPACK_IMPORTED_MODULE_0__[\"curveBasis\"],\n curveBasisClosed: d3__WEBPACK_IMPORTED_MODULE_0__[\"curveBasisClosed\"],\n curveBasisOpen: d3__WEBPACK_IMPORTED_MODULE_0__[\"curveBasisOpen\"],\n curveLinear: d3__WEBPACK_IMPORTED_MODULE_0__[\"curveLinear\"],\n curveLinearClosed: d3__WEBPACK_IMPORTED_MODULE_0__[\"curveLinearClosed\"],\n curveMonotoneX: d3__WEBPACK_IMPORTED_MODULE_0__[\"curveMonotoneX\"],\n curveMonotoneY: d3__WEBPACK_IMPORTED_MODULE_0__[\"curveMonotoneY\"],\n curveNatural: d3__WEBPACK_IMPORTED_MODULE_0__[\"curveNatural\"],\n curveStep: d3__WEBPACK_IMPORTED_MODULE_0__[\"curveStep\"],\n curveStepAfter: d3__WEBPACK_IMPORTED_MODULE_0__[\"curveStepAfter\"],\n curveStepBefore: d3__WEBPACK_IMPORTED_MODULE_0__[\"curveStepBefore\"]\n };\n var directive = /[%]{2}[{]\\s*(?:(?:(\\w+)\\s*:|(\\w+))\\s*(?:(?:(\\w+))|((?:(?![}][%]{2}).|\\r?\\n)*))?\\s*)(?:[}][%]{2})?/gi;\n var directiveWithoutOpen = /\\s*(?:(?:(\\w+)(?=:):|(\\w+))\\s*(?:(?:(\\w+))|((?:(?![}][%]{2}).|\\r?\\n)*))?\\s*)(?:[}][%]{2})?/gi;\n var anyComment = /\\s*%%.*\\n/gm;\n /**\n * @function detectInit\n * Detects the init config object from the text\n * ```mermaid\n * %%{init: {\"theme\": \"debug\", \"logLevel\": 1 }}%%\n * graph LR\n * a-->b\n * b-->c\n * c-->d\n * d-->e\n * e-->f\n * f-->g\n * g-->h\n * ```\n * or\n * ```mermaid\n * %%{initialize: {\"theme\": \"dark\", logLevel: \"debug\" }}%%\n * graph LR\n * a-->b\n * b-->c\n * c-->d\n * d-->e\n * e-->f\n * f-->g\n * g-->h\n * ```\n *\n * @param {string} text The text defining the graph\n * @returns {object} the json object representing the init passed to mermaid.initialize()\n */\n\n var detectInit = function detectInit(text) {\n var inits = detectDirective(text, /(?:init\\b)|(?:initialize\\b)/);\n var results = {};\n\n if (Array.isArray(inits)) {\n var args = inits.map(function (init) {\n return init.args;\n });\n results = assignWithDepth(results, _toConsumableArray(args));\n } else {\n results = inits.args;\n }\n\n if (results) {\n var type = detectType(text);\n ['config'].forEach(function (prop) {\n if (typeof results[prop] !== 'undefined') {\n if (type === 'flowchart-v2') {\n type = 'flowchart';\n }\n\n results[type] = results[prop];\n delete results[prop];\n }\n });\n }\n\n return results;\n };\n /**\n * @function detectDirective\n * Detects the directive from the text. Text can be single line or multiline. If type is null or omitted\n * the first directive encountered in text will be returned\n * ```mermaid\n * graph LR\n * %%{somedirective}%%\n * a-->b\n * b-->c\n * c-->d\n * d-->e\n * e-->f\n * f-->g\n * g-->h\n * ```\n *\n * @param {string} text The text defining the graph\n * @param {string|RegExp} type The directive to return (default: null)\n * @returns {object | Array} An object or Array representing the directive(s): { type: string, args: object|null } matched by the input type\n * if a single directive was found, that directive object will be returned.\n */\n\n\n var detectDirective = function detectDirective(text) {\n var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n try {\n var commentWithoutDirectives = new RegExp(\"[%]{2}(?![{]\".concat(directiveWithoutOpen.source, \")(?=[}][%]{2}).*\\n\"), 'ig');\n text = text.trim().replace(commentWithoutDirectives, '').replace(/'/gm, '\"');\n\n _logger__WEBPACK_IMPORTED_MODULE_1__[\"logger\"].debug(\"Detecting diagram directive\".concat(type !== null ? ' type:' + type : '', \" based on the text:\").concat(text));\n\n var match,\n result = [];\n\n while ((match = directive.exec(text)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (match.index === directive.lastIndex) {\n directive.lastIndex++;\n }\n\n if (match && !type || type && match[1] && match[1].match(type) || type && match[2] && match[2].match(type)) {\n var _type = match[1] ? match[1] : match[2];\n\n var args = match[3] ? match[3].trim() : match[4] ? JSON.parse(match[4].trim()) : null;\n result.push({\n type: _type,\n args: args\n });\n }\n }\n\n if (result.length === 0) {\n result.push({\n type: text,\n args: null\n });\n }\n\n return result.length === 1 ? result[0] : result;\n } catch (error) {\n _logger__WEBPACK_IMPORTED_MODULE_1__[\"logger\"].error(\"ERROR: \".concat(error.message, \" - Unable to parse directive\").concat(type !== null ? ' type:' + type : '', \" based on the text:\").concat(text));\n\n return {\n type: null,\n args: null\n };\n }\n };\n /**\n * @function detectType\n * Detects the type of the graph text. Takes into consideration the possible existence of an %%init\n * directive\n * ```mermaid\n * %%{initialize: {\"startOnLoad\": true, logLevel: \"fatal\" }}%%\n * graph LR\n * a-->b\n * b-->c\n * c-->d\n * d-->e\n * e-->f\n * f-->g\n * g-->h\n * ```\n *\n * @param {string} text The text defining the graph\n * @returns {string} A graph definition key\n */\n\n\n var detectType = function detectType(text) {\n text = text.replace(directive, '').replace(anyComment, '\\n');\n\n _logger__WEBPACK_IMPORTED_MODULE_1__[\"logger\"].debug('Detecting diagram type based on the text ' + text);\n\n if (text.match(/^\\s*sequenceDiagram/)) {\n return 'sequence';\n }\n\n if (text.match(/^\\s*gantt/)) {\n return 'gantt';\n }\n\n if (text.match(/^\\s*classDiagram-v2/)) {\n return 'classDiagram';\n }\n\n if (text.match(/^\\s*classDiagram/)) {\n return 'class';\n }\n\n if (text.match(/^\\s*stateDiagram-v2/)) {\n return 'stateDiagram';\n }\n\n if (text.match(/^\\s*stateDiagram/)) {\n return 'state';\n }\n\n if (text.match(/^\\s*gitGraph/)) {\n return 'git';\n }\n\n if (text.match(/^\\s*flowchart/)) {\n return 'flowchart-v2';\n }\n\n if (text.match(/^\\s*info/)) {\n return 'info';\n }\n\n if (text.match(/^\\s*pie/)) {\n return 'pie';\n }\n\n if (text.match(/^\\s*erDiagram/)) {\n return 'er';\n }\n\n if (text.match(/^\\s*journey/)) {\n return 'journey';\n }\n\n return 'flowchart';\n };\n\n var memoize = function memoize(fn, resolver) {\n var cache = {};\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var n = resolver ? resolver.apply(_this, args) : args[0];\n\n if (n in cache) {\n return cache[n];\n } else {\n var result = fn.apply(void 0, args);\n cache[n] = result;\n return result;\n }\n };\n };\n /**\n * @function isSubstringInArray\n * Detects whether a substring in present in a given array\n * @param {string} str The substring to detect\n * @param {array} arr The array to search\n * @returns {number} the array index containing the substring or -1 if not present\n **/\n\n\n var isSubstringInArray = function isSubstringInArray(str, arr) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i].match(str)) return i;\n }\n\n return -1;\n };\n\n var interpolateToCurve = function interpolateToCurve(interpolate, defaultCurve) {\n if (!interpolate) {\n return defaultCurve;\n }\n\n var curveName = \"curve\".concat(interpolate.charAt(0).toUpperCase() + interpolate.slice(1));\n return d3CurveTypes[curveName] || defaultCurve;\n };\n\n var formatUrl = function formatUrl(linkStr, config) {\n var url = linkStr.trim();\n\n if (url) {\n if (config.securityLevel !== 'loose') {\n return Object(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_2__[\"sanitizeUrl\"])(url);\n }\n\n return url;\n }\n };\n\n var runFunc = function runFunc(functionName) {\n var _obj;\n\n var arrPaths = functionName.split('.');\n var len = arrPaths.length - 1;\n var fnName = arrPaths[len];\n var obj = window;\n\n for (var i = 0; i < len; i++) {\n obj = obj[arrPaths[i]];\n if (!obj) return;\n }\n\n for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n params[_key2 - 1] = arguments[_key2];\n }\n\n (_obj = obj)[fnName].apply(_obj, params);\n };\n\n var distance = function distance(p1, p2) {\n return p1 && p2 ? Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) : 0;\n };\n\n var traverseEdge = function traverseEdge(points) {\n var prevPoint;\n var totalDistance = 0;\n points.forEach(function (point) {\n totalDistance += distance(point, prevPoint);\n prevPoint = point;\n }); // Traverse half of total distance along points\n\n var remainingDistance = totalDistance / 2;\n var center = undefined;\n prevPoint = undefined;\n points.forEach(function (point) {\n if (prevPoint && !center) {\n var vectorDistance = distance(point, prevPoint);\n\n if (vectorDistance < remainingDistance) {\n remainingDistance -= vectorDistance;\n } else {\n // The point is remainingDistance from prevPoint in the vector between prevPoint and point\n // Calculate the coordinates\n var distanceRatio = remainingDistance / vectorDistance;\n if (distanceRatio <= 0) center = prevPoint;\n if (distanceRatio >= 1) center = {\n x: point.x,\n y: point.y\n };\n\n if (distanceRatio > 0 && distanceRatio < 1) {\n center = {\n x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x,\n y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y\n };\n }\n }\n }\n\n prevPoint = point;\n });\n return center;\n };\n\n var calcLabelPosition = function calcLabelPosition(points) {\n return traverseEdge(points);\n };\n\n var calcCardinalityPosition = function calcCardinalityPosition(isRelationTypePresent, points, initialPosition) {\n var prevPoint;\n var totalDistance = 0; // eslint-disable-line\n\n if (points[0] !== initialPosition) {\n points = points.reverse();\n }\n\n points.forEach(function (point) {\n totalDistance += distance(point, prevPoint);\n prevPoint = point;\n }); // Traverse only 25 total distance along points to find cardinality point\n\n var distanceToCardinalityPoint = 25;\n var remainingDistance = distanceToCardinalityPoint;\n var center;\n prevPoint = undefined;\n points.forEach(function (point) {\n if (prevPoint && !center) {\n var vectorDistance = distance(point, prevPoint);\n\n if (vectorDistance < remainingDistance) {\n remainingDistance -= vectorDistance;\n } else {\n // The point is remainingDistance from prevPoint in the vector between prevPoint and point\n // Calculate the coordinates\n var distanceRatio = remainingDistance / vectorDistance;\n if (distanceRatio <= 0) center = prevPoint;\n if (distanceRatio >= 1) center = {\n x: point.x,\n y: point.y\n };\n\n if (distanceRatio > 0 && distanceRatio < 1) {\n center = {\n x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x,\n y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y\n };\n }\n }\n }\n\n prevPoint = point;\n }); // if relation is present (Arrows will be added), change cardinality point off-set distance (d)\n\n var d = isRelationTypePresent ? 10 : 5; //Calculate Angle for x and y axis\n\n var angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);\n var cardinalityPosition = {\n x: 0,\n y: 0\n }; //Calculation cardinality position using angle, center point on the line/curve but pendicular and with offset-distance\n\n cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;\n cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;\n return cardinalityPosition;\n };\n\n var getStylesFromArray = function getStylesFromArray(arr) {\n var style = '';\n var labelStyle = '';\n\n for (var i = 0; i < arr.length; i++) {\n if (typeof arr[i] !== 'undefined') {\n // add text properties to label style definition\n if (arr[i].startsWith('color:') || arr[i].startsWith('text-align:')) {\n labelStyle = labelStyle + arr[i] + ';';\n } else {\n style = style + arr[i] + ';';\n }\n }\n }\n\n return {\n style: style,\n labelStyle: labelStyle\n };\n };\n\n var cnt = 0;\n\n var generateId = function generateId() {\n cnt++;\n return 'id-' + Math.random().toString(36).substr(2, 12) + '-' + cnt;\n };\n\n function makeid(length) {\n var result = '';\n var characters = '0123456789abcdef';\n var charactersLength = characters.length;\n\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n\n return result;\n }\n\n var random = function random(options) {\n return makeid(options.length);\n };\n /**\n * @function assignWithDepth\n * Extends the functionality of {@link ObjectConstructor.assign} with the ability to merge arbitrary-depth objects\n * For each key in src with path `k` (recursively) performs an Object.assign(dst[`k`], src[`k`]) with\n * a slight change from the typical handling of undefined for dst[`k`]: instead of raising an error,\n * dst[`k`] is auto-initialized to {} and effectively merged with src[`k`]\n * \n * Additionally, dissimilar types will not clobber unless the config.clobber parameter === true. Example:\n * ```\n * let config_0 = { foo: { bar: 'bar' }, bar: 'foo' };\n * let config_1 = { foo: 'foo', bar: 'bar' };\n * let result = assignWithDepth(config_0, config_1);\n * console.log(result);\n * //-> result: { foo: { bar: 'bar' }, bar: 'bar' }\n * ```\n *
\n * Traditional Object.assign would have clobbered foo in config_0 with foo in config_1.\n *
\n * If src is a destructured array of objects and dst is not an array, assignWithDepth will apply each element of src to dst\n * in order.\n * @param dst:any - the destination of the merge\n * @param src:any - the source object(s) to merge into destination\n * @param config:{ depth: number, clobber: boolean } - depth: depth to traverse within src and dst for merging -\n * clobber: should dissimilar types clobber (default: { depth: 2, clobber: false })\n * @returns {*}\n */\n\n\n var assignWithDepth = function assignWithDepth(dst, src, config) {\n var _Object$assign = Object.assign({\n depth: 2,\n clobber: false\n }, config),\n depth = _Object$assign.depth,\n clobber = _Object$assign.clobber;\n\n if (Array.isArray(src) && !Array.isArray(dst)) {\n src.forEach(function (s) {\n return assignWithDepth(dst, s, config);\n });\n return dst;\n } else if (Array.isArray(src) && Array.isArray(dst)) {\n src.forEach(function (s) {\n if (dst.indexOf(s) === -1) {\n dst.push(s);\n }\n });\n return dst;\n }\n\n if (typeof dst === 'undefined' || depth <= 0) {\n if (dst !== undefined && dst !== null && _typeof(dst) === 'object' && _typeof(src) === 'object') {\n return Object.assign(dst, src);\n } else {\n return src;\n }\n }\n\n if (typeof src !== 'undefined' && _typeof(dst) === 'object' && _typeof(src) === 'object') {\n Object.keys(src).forEach(function (key) {\n if (_typeof(src[key]) === 'object' && (dst[key] === undefined || _typeof(dst[key]) === 'object')) {\n if (dst[key] === undefined) {\n dst[key] = Array.isArray(src[key]) ? [] : {};\n }\n\n dst[key] = assignWithDepth(dst[key], src[key], {\n depth: depth - 1,\n clobber: clobber\n });\n } else if (clobber || _typeof(dst[key]) !== 'object' && _typeof(src[key]) !== 'object') {\n dst[key] = src[key];\n }\n });\n }\n\n return dst;\n };\n\n var getTextObj = function getTextObj() {\n return {\n x: 0,\n y: 0,\n fill: undefined,\n anchor: 'start',\n style: '#666',\n width: 100,\n height: 100,\n textMargin: 0,\n rx: 0,\n ry: 0,\n valign: undefined\n };\n };\n\n var drawSimpleText = function drawSimpleText(elem, textData) {\n // Remove and ignore br:s\n var nText = textData.text.replace(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__[\"default\"].lineBreakRegex, ' ');\n var textElem = elem.append('text');\n textElem.attr('x', textData.x);\n textElem.attr('y', textData.y);\n textElem.style('text-anchor', textData.anchor);\n textElem.style('font-family', textData.fontFamily);\n textElem.style('font-size', textData.fontSize);\n textElem.style('font-weight', textData.fontWeight);\n textElem.attr('fill', textData.fill);\n\n if (typeof textData.class !== 'undefined') {\n textElem.attr('class', textData.class);\n }\n\n var span = textElem.append('tspan');\n span.attr('x', textData.x + textData.textMargin * 2);\n span.attr('fill', textData.fill);\n span.text(nText);\n return textElem;\n };\n\n var wrapLabel = memoize(function (label, maxWidth, config) {\n if (!label) {\n return label;\n }\n\n config = Object.assign({\n fontSize: 12,\n fontWeight: 400,\n fontFamily: 'Arial',\n joinWith: '
'\n }, config);\n\n if (_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__[\"default\"].lineBreakRegex.test(label)) {\n return label;\n }\n\n var words = label.split(' ');\n var completedLines = [];\n var nextLine = '';\n words.forEach(function (word, index) {\n var wordLength = calculateTextWidth(\"\".concat(word, \" \"), config);\n var nextLineLength = calculateTextWidth(nextLine, config);\n\n if (wordLength > maxWidth) {\n var _breakString = breakString(word, maxWidth, '-', config),\n hyphenatedStrings = _breakString.hyphenatedStrings,\n remainingWord = _breakString.remainingWord;\n\n completedLines.push.apply(completedLines, [nextLine].concat(_toConsumableArray(hyphenatedStrings)));\n nextLine = remainingWord;\n } else if (nextLineLength + wordLength >= maxWidth) {\n completedLines.push(nextLine);\n nextLine = word;\n } else {\n nextLine = [nextLine, word].filter(Boolean).join(' ');\n }\n\n var currentWord = index + 1;\n var isLastWord = currentWord === words.length;\n\n if (isLastWord) {\n completedLines.push(nextLine);\n }\n });\n return completedLines.filter(function (line) {\n return line !== '';\n }).join(config.joinWith);\n }, function (label, maxWidth, config) {\n return \"\".concat(label, \"-\").concat(maxWidth, \"-\").concat(config.fontSize, \"-\").concat(config.fontWeight, \"-\").concat(config.fontFamily, \"-\").concat(config.joinWith);\n });\n var breakString = memoize(function (word, maxWidth) {\n var hyphenCharacter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '-';\n var config = arguments.length > 3 ? arguments[3] : undefined;\n config = Object.assign({\n fontSize: 12,\n fontWeight: 400,\n fontFamily: 'Arial',\n margin: 0\n }, config);\n var characters = word.split('');\n var lines = [];\n var currentLine = '';\n characters.forEach(function (character, index) {\n var nextLine = \"\".concat(currentLine).concat(character);\n var lineWidth = calculateTextWidth(nextLine, config);\n\n if (lineWidth >= maxWidth) {\n var currentCharacter = index + 1;\n var isLastLine = characters.length === currentCharacter;\n var hyphenatedNextLine = \"\".concat(nextLine).concat(hyphenCharacter);\n lines.push(isLastLine ? nextLine : hyphenatedNextLine);\n currentLine = '';\n } else {\n currentLine = nextLine;\n }\n });\n return {\n hyphenatedStrings: lines,\n remainingWord: currentLine\n };\n }, function (word, maxWidth) {\n var hyphenCharacter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '-';\n var config = arguments.length > 3 ? arguments[3] : undefined;\n return \"\".concat(word, \"-\").concat(maxWidth, \"-\").concat(hyphenCharacter, \"-\").concat(config.fontSize, \"-\").concat(config.fontWeight, \"-\").concat(config.fontFamily);\n });\n /**\n * This calculates the text's height, taking into account the wrap breaks and\n * both the statically configured height, width, and the length of the text (in pixels).\n *\n * If the wrapped text text has greater height, we extend the height, so it's\n * value won't overflow.\n *\n * @return - The height for the given text\n * @param text the text to measure\n * @param config - the config for fontSize, fontFamily, and fontWeight all impacting the resulting size\n */\n\n var calculateTextHeight = function calculateTextHeight(text, config) {\n config = Object.assign({\n fontSize: 12,\n fontWeight: 400,\n fontFamily: 'Arial',\n margin: 15\n }, config);\n return calculateTextDimensions(text, config).height;\n };\n /**\n * This calculates the width of the given text, font size and family.\n *\n * @return - The width for the given text\n * @param text - The text to calculate the width of\n * @param config - the config for fontSize, fontFamily, and fontWeight all impacting the resulting size\n */\n\n\n var calculateTextWidth = function calculateTextWidth(text, config) {\n config = Object.assign({\n fontSize: 12,\n fontWeight: 400,\n fontFamily: 'Arial'\n }, config);\n return calculateTextDimensions(text, config).width;\n };\n /**\n * This calculates the dimensions of the given text, font size, font family, font weight, and margins.\n *\n * @return - The width for the given text\n * @param text - The text to calculate the width of\n * @param config - the config for fontSize, fontFamily, fontWeight, and margin all impacting the resulting size\n */\n\n\n var calculateTextDimensions = memoize(function (text, config) {\n config = Object.assign({\n fontSize: 12,\n fontWeight: 400,\n fontFamily: 'Arial'\n }, config);\n var _config = config,\n fontSize = _config.fontSize,\n fontFamily = _config.fontFamily,\n fontWeight = _config.fontWeight;\n\n if (!text) {\n return {\n width: 0,\n height: 0\n };\n } // We can't really know if the user supplied font family will render on the user agent;\n // thus, we'll take the max width between the user supplied font family, and a default\n // of sans-serif.\n\n\n var fontFamilies = ['sans-serif', fontFamily];\n var lines = text.split(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__[\"default\"].lineBreakRegex);\n var dims = [];\n var body = Object(d3__WEBPACK_IMPORTED_MODULE_0__[\"select\"])('body'); // We don't want to leak DOM elements - if a removal operation isn't available\n // for any reason, do not continue.\n\n if (!body.remove) {\n return {\n width: 0,\n height: 0,\n lineHeight: 0\n };\n }\n\n var g = body.append('svg');\n\n for (var _i = 0, _fontFamilies = fontFamilies; _i < _fontFamilies.length; _i++) {\n var _fontFamily = _fontFamilies[_i];\n var cheight = 0;\n var dim = {\n width: 0,\n height: 0,\n lineHeight: 0\n };\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = lines[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var line = _step.value;\n var textObj = getTextObj();\n textObj.text = line;\n var textElem = drawSimpleText(g, textObj).style('font-size', fontSize).style('font-weight', fontWeight).style('font-family', _fontFamily);\n var bBox = (textElem._groups || textElem)[0][0].getBBox();\n dim.width = Math.round(Math.max(dim.width, bBox.width));\n cheight = Math.round(bBox.height);\n dim.height += cheight;\n dim.lineHeight = Math.round(Math.max(dim.lineHeight, cheight));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n dims.push(dim);\n }\n\n g.remove();\n var index = isNaN(dims[1].height) || isNaN(dims[1].width) || isNaN(dims[1].lineHeight) || dims[0].height > dims[1].height && dims[0].width > dims[1].width && dims[0].lineHeight > dims[1].lineHeight ? 0 : 1;\n return dims[index];\n }, function (text, config) {\n return \"\".concat(text, \"-\").concat(config.fontSize, \"-\").concat(config.fontWeight, \"-\").concat(config.fontFamily);\n });\n /* harmony default export */\n\n __webpack_exports__[\"default\"] = {\n assignWithDepth: assignWithDepth,\n wrapLabel: wrapLabel,\n calculateTextHeight: calculateTextHeight,\n calculateTextWidth: calculateTextWidth,\n calculateTextDimensions: calculateTextDimensions,\n detectInit: detectInit,\n detectDirective: detectDirective,\n detectType: detectType,\n isSubstringInArray: isSubstringInArray,\n interpolateToCurve: interpolateToCurve,\n calcLabelPosition: calcLabelPosition,\n calcCardinalityPosition: calcCardinalityPosition,\n formatUrl: formatUrl,\n getStylesFromArray: getStylesFromArray,\n generateId: generateId,\n random: random,\n memoize: memoize,\n runFunc: runFunc\n };\n /***/\n },\n\n /***/\n \"@braintree/sanitize-url\":\n /*!******************************************!*\\\n !*** external \"@braintree/sanitize-url\" ***!\n \\******************************************/\n\n /*! no static exports found */\n\n /***/\n function braintreeSanitizeUrl(module, exports) {\n module.exports = require(\"@braintree/sanitize-url\");\n /***/\n },\n\n /***/\n \"d3\":\n /*!*********************!*\\\n !*** external \"d3\" ***!\n \\*********************/\n\n /*! no static exports found */\n\n /***/\n function d3(module, exports) {\n module.exports = require(\"d3\");\n /***/\n },\n\n /***/\n \"dagre\":\n /*!************************!*\\\n !*** external \"dagre\" ***!\n \\************************/\n\n /*! no static exports found */\n\n /***/\n function dagre(module, exports) {\n module.exports = require(\"dagre\");\n /***/\n },\n\n /***/\n \"dagre-d3\":\n /*!***************************!*\\\n !*** external \"dagre-d3\" ***!\n \\***************************/\n\n /*! no static exports found */\n\n /***/\n function dagreD3(module, exports) {\n module.exports = require(\"dagre-d3\");\n /***/\n },\n\n /***/\n \"dagre-d3/lib/label/add-html-label.js\":\n /*!*******************************************************!*\\\n !*** external \"dagre-d3/lib/label/add-html-label.js\" ***!\n \\*******************************************************/\n\n /*! no static exports found */\n\n /***/\n function dagreD3LibLabelAddHtmlLabelJs(module, exports) {\n module.exports = require(\"dagre-d3/lib/label/add-html-label.js\");\n /***/\n },\n\n /***/\n \"entity-decode/browser\":\n /*!****************************************!*\\\n !*** external \"entity-decode/browser\" ***!\n \\****************************************/\n\n /*! no static exports found */\n\n /***/\n function entityDecodeBrowser(module, exports) {\n module.exports = require(\"entity-decode/browser\");\n /***/\n },\n\n /***/\n \"graphlib\":\n /*!***************************!*\\\n !*** external \"graphlib\" ***!\n \\***************************/\n\n /*! no static exports found */\n\n /***/\n function graphlib(module, exports) {\n module.exports = require(\"graphlib\");\n /***/\n },\n\n /***/\n \"khroma\":\n /*!*************************!*\\\n !*** external \"khroma\" ***!\n \\*************************/\n\n /*! no static exports found */\n\n /***/\n function khroma(module, exports) {\n module.exports = require(\"khroma\");\n /***/\n },\n\n /***/\n \"moment-mini\":\n /*!******************************!*\\\n !*** external \"moment-mini\" ***!\n \\******************************/\n\n /*! no static exports found */\n\n /***/\n function momentMini(module, exports) {\n module.exports = require(\"moment-mini\");\n /***/\n },\n\n /***/\n \"stylis\":\n /*!*************************!*\\\n !*** external \"stylis\" ***!\n \\*************************/\n\n /*! no static exports found */\n\n /***/\n function stylis(module, exports) {\n module.exports = require(\"stylis\");\n /***/\n }\n /******/\n\n })[\"default\"]\n );\n});","/*!\n\tautosize 4.0.2\n\tlicense: MIT\n\thttp://www.jacklmoore.com/autosize\n*/\n(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['module', 'exports'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(module, exports);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod, mod.exports);\n global.autosize = mod.exports;\n }\n})(this, function (module, exports) {\n 'use strict';\n\n var map = typeof Map === \"function\" ? new Map() : function () {\n var keys = [];\n var values = [];\n return {\n has: function has(key) {\n return keys.indexOf(key) > -1;\n },\n get: function get(key) {\n return values[keys.indexOf(key)];\n },\n set: function set(key, value) {\n if (keys.indexOf(key) === -1) {\n keys.push(key);\n values.push(value);\n }\n },\n delete: function _delete(key) {\n var index = keys.indexOf(key);\n\n if (index > -1) {\n keys.splice(index, 1);\n values.splice(index, 1);\n }\n }\n };\n }();\n\n var createEvent = function createEvent(name) {\n return new Event(name, {\n bubbles: true\n });\n };\n\n try {\n new Event('test');\n } catch (e) {\n // IE does not support `new Event()`\n createEvent = function createEvent(name) {\n var evt = document.createEvent('Event');\n evt.initEvent(name, true, false);\n return evt;\n };\n }\n\n function assign(ta) {\n if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;\n var heightOffset = null;\n var clientWidth = null;\n var cachedHeight = null;\n\n function init() {\n var style = window.getComputedStyle(ta, null);\n\n if (style.resize === 'vertical') {\n ta.style.resize = 'none';\n } else if (style.resize === 'both') {\n ta.style.resize = 'horizontal';\n }\n\n if (style.boxSizing === 'content-box') {\n heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));\n } else {\n heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);\n } // Fix when a textarea is not on document body and heightOffset is Not a Number\n\n\n if (isNaN(heightOffset)) {\n heightOffset = 0;\n }\n\n update();\n }\n\n function changeOverflow(value) {\n {\n // Chrome/Safari-specific fix:\n // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space\n // made available by removing the scrollbar. The following forces the necessary text reflow.\n var width = ta.style.width;\n ta.style.width = '0px'; // Force reflow:\n\n /* jshint ignore:start */\n\n ta.offsetWidth;\n /* jshint ignore:end */\n\n ta.style.width = width;\n }\n ta.style.overflowY = value;\n }\n\n function getParentOverflows(el) {\n var arr = [];\n\n while (el && el.parentNode && el.parentNode instanceof Element) {\n if (el.parentNode.scrollTop) {\n arr.push({\n node: el.parentNode,\n scrollTop: el.parentNode.scrollTop\n });\n }\n\n el = el.parentNode;\n }\n\n return arr;\n }\n\n function resize() {\n if (ta.scrollHeight === 0) {\n // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.\n return;\n }\n\n var overflows = getParentOverflows(ta);\n var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)\n\n ta.style.height = '';\n ta.style.height = ta.scrollHeight + heightOffset + 'px'; // used to check if an update is actually necessary on window.resize\n\n clientWidth = ta.clientWidth; // prevents scroll-position jumping\n\n overflows.forEach(function (el) {\n el.node.scrollTop = el.scrollTop;\n });\n\n if (docTop) {\n document.documentElement.scrollTop = docTop;\n }\n }\n\n function update() {\n resize();\n var styleHeight = Math.round(parseFloat(ta.style.height));\n var computed = window.getComputedStyle(ta, null); // Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box\n\n var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight; // The actual height not matching the style height (set via the resize method) indicates that \n // the max-height has been exceeded, in which case the overflow should be allowed.\n\n if (actualHeight < styleHeight) {\n if (computed.overflowY === 'hidden') {\n changeOverflow('scroll');\n resize();\n actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;\n }\n } else {\n // Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.\n if (computed.overflowY !== 'hidden') {\n changeOverflow('hidden');\n resize();\n actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;\n }\n }\n\n if (cachedHeight !== actualHeight) {\n cachedHeight = actualHeight;\n var evt = createEvent('autosize:resized');\n\n try {\n ta.dispatchEvent(evt);\n } catch (err) {// Firefox will throw an error on dispatchEvent for a detached element\n // https://bugzilla.mozilla.org/show_bug.cgi?id=889376\n }\n }\n }\n\n var pageResize = function pageResize() {\n if (ta.clientWidth !== clientWidth) {\n update();\n }\n };\n\n var destroy = function (style) {\n window.removeEventListener('resize', pageResize, false);\n ta.removeEventListener('input', update, false);\n ta.removeEventListener('keyup', update, false);\n ta.removeEventListener('autosize:destroy', destroy, false);\n ta.removeEventListener('autosize:update', update, false);\n Object.keys(style).forEach(function (key) {\n ta.style[key] = style[key];\n });\n map.delete(ta);\n }.bind(ta, {\n height: ta.style.height,\n resize: ta.style.resize,\n overflowY: ta.style.overflowY,\n overflowX: ta.style.overflowX,\n wordWrap: ta.style.wordWrap\n });\n\n ta.addEventListener('autosize:destroy', destroy, false); // IE9 does not fire onpropertychange or oninput for deletions,\n // so binding to onkeyup to catch most of those events.\n // There is no way that I know of to detect something like 'cut' in IE9.\n\n if ('onpropertychange' in ta && 'oninput' in ta) {\n ta.addEventListener('keyup', update, false);\n }\n\n window.addEventListener('resize', pageResize, false);\n ta.addEventListener('input', update, false);\n ta.addEventListener('autosize:update', update, false);\n ta.style.overflowX = 'hidden';\n ta.style.wordWrap = 'break-word';\n map.set(ta, {\n destroy: destroy,\n update: update\n });\n init();\n }\n\n function destroy(ta) {\n var methods = map.get(ta);\n\n if (methods) {\n methods.destroy();\n }\n }\n\n function update(ta) {\n var methods = map.get(ta);\n\n if (methods) {\n methods.update();\n }\n }\n\n var autosize = null; // Do nothing in Node.js environment and IE8 (or lower)\n\n if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {\n autosize = function autosize(el) {\n return el;\n };\n\n autosize.destroy = function (el) {\n return el;\n };\n\n autosize.update = function (el) {\n return el;\n };\n } else {\n autosize = function autosize(el, options) {\n if (el) {\n Array.prototype.forEach.call(el.length ? el : [el], function (x) {\n return assign(x, options);\n });\n }\n\n return el;\n };\n\n autosize.destroy = function (el) {\n if (el) {\n Array.prototype.forEach.call(el.length ? el : [el], destroy);\n }\n\n return el;\n };\n\n autosize.update = function (el) {\n if (el) {\n Array.prototype.forEach.call(el.length ? el : [el], update);\n }\n\n return el;\n };\n }\n\n exports.default = autosize;\n module.exports = exports['default'];\n});","/*!\n * jQuery UI Sortable 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n//>>label: Sortable\n//>>group: Interactions\n//>>description: Enables items in a list to be sorted using the mouse.\n//>>docs: http://api.jqueryui.com/sortable/\n//>>demos: http://jqueryui.com/sortable/\n//>>css.structure: ../../themes/base/sortable.css\n(function (factory) {\n if (typeof define === \"function\" && define.amd) {\n // AMD. Register as an anonymous module.\n define([\"jquery\", \"./mouse\", \"../data\", \"../ie\", \"../scroll-parent\", \"../version\", \"../widget\"], factory);\n } else {\n // Browser globals\n factory(jQuery);\n }\n})(function ($) {\n return $.widget(\"ui.sortable\", $.ui.mouse, {\n version: \"1.12.1\",\n widgetEventPrefix: \"sort\",\n ready: false,\n options: {\n appendTo: \"parent\",\n axis: false,\n connectWith: false,\n containment: false,\n cursor: \"auto\",\n cursorAt: false,\n dropOnEmpty: true,\n forcePlaceholderSize: false,\n forceHelperSize: false,\n grid: false,\n handle: false,\n helper: \"original\",\n items: \"> *\",\n opacity: false,\n placeholder: false,\n revert: false,\n scroll: true,\n scrollSensitivity: 20,\n scrollSpeed: 20,\n scope: \"default\",\n tolerance: \"intersect\",\n zIndex: 1000,\n // Callbacks\n activate: null,\n beforeStop: null,\n change: null,\n deactivate: null,\n out: null,\n over: null,\n receive: null,\n remove: null,\n sort: null,\n start: null,\n stop: null,\n update: null\n },\n _isOverAxis: function _isOverAxis(x, reference, size) {\n return x >= reference && x < reference + size;\n },\n _isFloating: function _isFloating(item) {\n return /left|right/.test(item.css(\"float\")) || /inline|table-cell/.test(item.css(\"display\"));\n },\n _create: function _create() {\n this.containerCache = {};\n\n this._addClass(\"ui-sortable\"); //Get the items\n\n\n this.refresh(); //Let's determine the parent's offset\n\n this.offset = this.element.offset(); //Initialize mouse events for interaction\n\n this._mouseInit();\n\n this._setHandleClassName(); //We're ready to go\n\n\n this.ready = true;\n },\n _setOption: function _setOption(key, value) {\n this._super(key, value);\n\n if (key === \"handle\") {\n this._setHandleClassName();\n }\n },\n _setHandleClassName: function _setHandleClassName() {\n var that = this;\n\n this._removeClass(this.element.find(\".ui-sortable-handle\"), \"ui-sortable-handle\");\n\n $.each(this.items, function () {\n that._addClass(this.instance.options.handle ? this.item.find(this.instance.options.handle) : this.item, \"ui-sortable-handle\");\n });\n },\n _destroy: function _destroy() {\n this._mouseDestroy();\n\n for (var i = this.items.length - 1; i >= 0; i--) {\n this.items[i].item.removeData(this.widgetName + \"-item\");\n }\n\n return this;\n },\n _mouseCapture: function _mouseCapture(event, overrideHandle) {\n var currentItem = null,\n validHandle = false,\n that = this;\n\n if (this.reverting) {\n return false;\n }\n\n if (this.options.disabled || this.options.type === \"static\") {\n return false;\n } //We have to refresh the items data once first\n\n\n this._refreshItems(event); //Find out if the clicked node (or one of its parents) is a actual item in this.items\n\n\n $(event.target).parents().each(function () {\n if ($.data(this, that.widgetName + \"-item\") === that) {\n currentItem = $(this);\n return false;\n }\n });\n\n if ($.data(event.target, that.widgetName + \"-item\") === that) {\n currentItem = $(event.target);\n }\n\n if (!currentItem) {\n return false;\n }\n\n if (this.options.handle && !overrideHandle) {\n $(this.options.handle, currentItem).find(\"*\").addBack().each(function () {\n if (this === event.target) {\n validHandle = true;\n }\n });\n\n if (!validHandle) {\n return false;\n }\n }\n\n this.currentItem = currentItem;\n\n this._removeCurrentsFromItems();\n\n return true;\n },\n _mouseStart: function _mouseStart(event, overrideHandle, noActivation) {\n var i,\n body,\n o = this.options;\n this.currentContainer = this; //We only need to call refreshPositions, because the refreshItems call has been moved to\n // mouseCapture\n\n this.refreshPositions(); //Create and append the visible helper\n\n this.helper = this._createHelper(event); //Cache the helper size\n\n this._cacheHelperProportions();\n /*\n * - Position generation -\n * This block generates everything position related - it's the core of draggables.\n */\n //Cache the margins of the original element\n\n\n this._cacheMargins(); //Get the next scrolling parent\n\n\n this.scrollParent = this.helper.scrollParent(); //The element's absolute position on the page minus margins\n\n this.offset = this.currentItem.offset();\n this.offset = {\n top: this.offset.top - this.margins.top,\n left: this.offset.left - this.margins.left\n };\n $.extend(this.offset, {\n click: {\n //Where the click happened, relative to the element\n left: event.pageX - this.offset.left,\n top: event.pageY - this.offset.top\n },\n parent: this._getParentOffset(),\n // This is a relative to absolute position minus the actual position calculation -\n // only used for relative positioned helper\n relative: this._getRelativeOffset()\n }); // Only after we got the offset, we can change the helper's position to absolute\n // TODO: Still need to figure out a way to make relative sorting possible\n\n this.helper.css(\"position\", \"absolute\");\n this.cssPosition = this.helper.css(\"position\"); //Generate the original position\n\n this.originalPosition = this._generatePosition(event);\n this.originalPageX = event.pageX;\n this.originalPageY = event.pageY; //Adjust the mouse offset relative to the helper if \"cursorAt\" is supplied\n\n o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt); //Cache the former DOM position\n\n this.domPosition = {\n prev: this.currentItem.prev()[0],\n parent: this.currentItem.parent()[0]\n }; // If the helper is not the original, hide the original so it's not playing any role during\n // the drag, won't cause anything bad this way\n\n if (this.helper[0] !== this.currentItem[0]) {\n this.currentItem.hide();\n } //Create the placeholder\n\n\n this._createPlaceholder(); //Set a containment if given in the options\n\n\n if (o.containment) {\n this._setContainment();\n }\n\n if (o.cursor && o.cursor !== \"auto\") {\n // cursor option\n body = this.document.find(\"body\"); // Support: IE\n\n this.storedCursor = body.css(\"cursor\");\n body.css(\"cursor\", o.cursor);\n this.storedStylesheet = $(\"\").appendTo(body);\n }\n\n if (o.opacity) {\n // opacity option\n if (this.helper.css(\"opacity\")) {\n this._storedOpacity = this.helper.css(\"opacity\");\n }\n\n this.helper.css(\"opacity\", o.opacity);\n }\n\n if (o.zIndex) {\n // zIndex option\n if (this.helper.css(\"zIndex\")) {\n this._storedZIndex = this.helper.css(\"zIndex\");\n }\n\n this.helper.css(\"zIndex\", o.zIndex);\n } //Prepare scrolling\n\n\n if (this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== \"HTML\") {\n this.overflowOffset = this.scrollParent.offset();\n } //Call callbacks\n\n\n this._trigger(\"start\", event, this._uiHash()); //Recache the helper size\n\n\n if (!this._preserveHelperProportions) {\n this._cacheHelperProportions();\n } //Post \"activate\" events to possible containers\n\n\n if (!noActivation) {\n for (i = this.containers.length - 1; i >= 0; i--) {\n this.containers[i]._trigger(\"activate\", event, this._uiHash(this));\n }\n } //Prepare possible droppables\n\n\n if ($.ui.ddmanager) {\n $.ui.ddmanager.current = this;\n }\n\n if ($.ui.ddmanager && !o.dropBehaviour) {\n $.ui.ddmanager.prepareOffsets(this, event);\n }\n\n this.dragging = true;\n\n this._addClass(this.helper, \"ui-sortable-helper\"); // Execute the drag once - this causes the helper not to be visiblebefore getting its\n // correct position\n\n\n this._mouseDrag(event);\n\n return true;\n },\n _mouseDrag: function _mouseDrag(event) {\n var i,\n item,\n itemElement,\n intersection,\n o = this.options,\n scrolled = false; //Compute the helpers position\n\n this.position = this._generatePosition(event);\n this.positionAbs = this._convertPositionTo(\"absolute\");\n\n if (!this.lastPositionAbs) {\n this.lastPositionAbs = this.positionAbs;\n } //Do scrolling\n\n\n if (this.options.scroll) {\n if (this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== \"HTML\") {\n if (this.overflowOffset.top + this.scrollParent[0].offsetHeight - event.pageY < o.scrollSensitivity) {\n this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;\n } else if (event.pageY - this.overflowOffset.top < o.scrollSensitivity) {\n this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;\n }\n\n if (this.overflowOffset.left + this.scrollParent[0].offsetWidth - event.pageX < o.scrollSensitivity) {\n this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;\n } else if (event.pageX - this.overflowOffset.left < o.scrollSensitivity) {\n this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;\n }\n } else {\n if (event.pageY - this.document.scrollTop() < o.scrollSensitivity) {\n scrolled = this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed);\n } else if (this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity) {\n scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed);\n }\n\n if (event.pageX - this.document.scrollLeft() < o.scrollSensitivity) {\n scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed);\n } else if (this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) {\n scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed);\n }\n }\n\n if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {\n $.ui.ddmanager.prepareOffsets(this, event);\n }\n } //Regenerate the absolute position used for position checks\n\n\n this.positionAbs = this._convertPositionTo(\"absolute\"); //Set the helper position\n\n if (!this.options.axis || this.options.axis !== \"y\") {\n this.helper[0].style.left = this.position.left + \"px\";\n }\n\n if (!this.options.axis || this.options.axis !== \"x\") {\n this.helper[0].style.top = this.position.top + \"px\";\n } //Rearrange\n\n\n for (i = this.items.length - 1; i >= 0; i--) {\n //Cache variables and intersection, continue if no intersection\n item = this.items[i];\n itemElement = item.item[0];\n intersection = this._intersectsWithPointer(item);\n\n if (!intersection) {\n continue;\n } // Only put the placeholder inside the current Container, skip all\n // items from other containers. This works because when moving\n // an item from one container to another the\n // currentContainer is switched before the placeholder is moved.\n //\n // Without this, moving items in \"sub-sortables\" can cause\n // the placeholder to jitter between the outer and inner container.\n\n\n if (item.instance !== this.currentContainer) {\n continue;\n } // Cannot intersect with itself\n // no useless actions that have been done before\n // no action if the item moved is the parent of the item checked\n\n\n if (itemElement !== this.currentItem[0] && this.placeholder[intersection === 1 ? \"next\" : \"prev\"]()[0] !== itemElement && !$.contains(this.placeholder[0], itemElement) && (this.options.type === \"semi-dynamic\" ? !$.contains(this.element[0], itemElement) : true)) {\n this.direction = intersection === 1 ? \"down\" : \"up\";\n\n if (this.options.tolerance === \"pointer\" || this._intersectsWithSides(item)) {\n this._rearrange(event, item);\n } else {\n break;\n }\n\n this._trigger(\"change\", event, this._uiHash());\n\n break;\n }\n } //Post events to containers\n\n\n this._contactContainers(event); //Interconnect with droppables\n\n\n if ($.ui.ddmanager) {\n $.ui.ddmanager.drag(this, event);\n } //Call callbacks\n\n\n this._trigger(\"sort\", event, this._uiHash());\n\n this.lastPositionAbs = this.positionAbs;\n return false;\n },\n _mouseStop: function _mouseStop(event, noPropagation) {\n if (!event) {\n return;\n } //If we are using droppables, inform the manager about the drop\n\n\n if ($.ui.ddmanager && !this.options.dropBehaviour) {\n $.ui.ddmanager.drop(this, event);\n }\n\n if (this.options.revert) {\n var that = this,\n cur = this.placeholder.offset(),\n axis = this.options.axis,\n animation = {};\n\n if (!axis || axis === \"x\") {\n animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft);\n }\n\n if (!axis || axis === \"y\") {\n animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop);\n }\n\n this.reverting = true;\n $(this.helper).animate(animation, parseInt(this.options.revert, 10) || 500, function () {\n that._clear(event);\n });\n } else {\n this._clear(event, noPropagation);\n }\n\n return false;\n },\n cancel: function cancel() {\n if (this.dragging) {\n this._mouseUp(new $.Event(\"mouseup\", {\n target: null\n }));\n\n if (this.options.helper === \"original\") {\n this.currentItem.css(this._storedCSS);\n\n this._removeClass(this.currentItem, \"ui-sortable-helper\");\n } else {\n this.currentItem.show();\n } //Post deactivating events to containers\n\n\n for (var i = this.containers.length - 1; i >= 0; i--) {\n this.containers[i]._trigger(\"deactivate\", null, this._uiHash(this));\n\n if (this.containers[i].containerCache.over) {\n this.containers[i]._trigger(\"out\", null, this._uiHash(this));\n\n this.containers[i].containerCache.over = 0;\n }\n }\n }\n\n if (this.placeholder) {\n //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,\n // it unbinds ALL events from the original node!\n if (this.placeholder[0].parentNode) {\n this.placeholder[0].parentNode.removeChild(this.placeholder[0]);\n }\n\n if (this.options.helper !== \"original\" && this.helper && this.helper[0].parentNode) {\n this.helper.remove();\n }\n\n $.extend(this, {\n helper: null,\n dragging: false,\n reverting: false,\n _noFinalSort: null\n });\n\n if (this.domPosition.prev) {\n $(this.domPosition.prev).after(this.currentItem);\n } else {\n $(this.domPosition.parent).prepend(this.currentItem);\n }\n }\n\n return this;\n },\n serialize: function serialize(o) {\n var items = this._getItemsAsjQuery(o && o.connected),\n str = [];\n\n o = o || {};\n $(items).each(function () {\n var res = ($(o.item || this).attr(o.attribute || \"id\") || \"\").match(o.expression || /(.+)[\\-=_](.+)/);\n\n if (res) {\n str.push((o.key || res[1] + \"[]\") + \"=\" + (o.key && o.expression ? res[1] : res[2]));\n }\n });\n\n if (!str.length && o.key) {\n str.push(o.key + \"=\");\n }\n\n return str.join(\"&\");\n },\n toArray: function toArray(o) {\n var items = this._getItemsAsjQuery(o && o.connected),\n ret = [];\n\n o = o || {};\n items.each(function () {\n ret.push($(o.item || this).attr(o.attribute || \"id\") || \"\");\n });\n return ret;\n },\n\n /* Be careful with the following core functions */\n _intersectsWith: function _intersectsWith(item) {\n var x1 = this.positionAbs.left,\n x2 = x1 + this.helperProportions.width,\n y1 = this.positionAbs.top,\n y2 = y1 + this.helperProportions.height,\n l = item.left,\n r = l + item.width,\n t = item.top,\n b = t + item.height,\n dyClick = this.offset.click.top,\n dxClick = this.offset.click.left,\n isOverElementHeight = this.options.axis === \"x\" || y1 + dyClick > t && y1 + dyClick < b,\n isOverElementWidth = this.options.axis === \"y\" || x1 + dxClick > l && x1 + dxClick < r,\n isOverElement = isOverElementHeight && isOverElementWidth;\n\n if (this.options.tolerance === \"pointer\" || this.options.forcePointerForContainers || this.options.tolerance !== \"pointer\" && this.helperProportions[this.floating ? \"width\" : \"height\"] > item[this.floating ? \"width\" : \"height\"]) {\n return isOverElement;\n } else {\n return l < x1 + this.helperProportions.width / 2 && // Right Half\n x2 - this.helperProportions.width / 2 < r && // Left Half\n t < y1 + this.helperProportions.height / 2 && // Bottom Half\n y2 - this.helperProportions.height / 2 < b; // Top Half\n }\n },\n _intersectsWithPointer: function _intersectsWithPointer(item) {\n var verticalDirection,\n horizontalDirection,\n isOverElementHeight = this.options.axis === \"x\" || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),\n isOverElementWidth = this.options.axis === \"y\" || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),\n isOverElement = isOverElementHeight && isOverElementWidth;\n\n if (!isOverElement) {\n return false;\n }\n\n verticalDirection = this._getDragVerticalDirection();\n horizontalDirection = this._getDragHorizontalDirection();\n return this.floating ? horizontalDirection === \"right\" || verticalDirection === \"down\" ? 2 : 1 : verticalDirection && (verticalDirection === \"down\" ? 2 : 1);\n },\n _intersectsWithSides: function _intersectsWithSides(item) {\n var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + item.height / 2, item.height),\n isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + item.width / 2, item.width),\n verticalDirection = this._getDragVerticalDirection(),\n horizontalDirection = this._getDragHorizontalDirection();\n\n if (this.floating && horizontalDirection) {\n return horizontalDirection === \"right\" && isOverRightHalf || horizontalDirection === \"left\" && !isOverRightHalf;\n } else {\n return verticalDirection && (verticalDirection === \"down\" && isOverBottomHalf || verticalDirection === \"up\" && !isOverBottomHalf);\n }\n },\n _getDragVerticalDirection: function _getDragVerticalDirection() {\n var delta = this.positionAbs.top - this.lastPositionAbs.top;\n return delta !== 0 && (delta > 0 ? \"down\" : \"up\");\n },\n _getDragHorizontalDirection: function _getDragHorizontalDirection() {\n var delta = this.positionAbs.left - this.lastPositionAbs.left;\n return delta !== 0 && (delta > 0 ? \"right\" : \"left\");\n },\n refresh: function refresh(event) {\n this._refreshItems(event);\n\n this._setHandleClassName();\n\n this.refreshPositions();\n return this;\n },\n _connectWith: function _connectWith() {\n var options = this.options;\n return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;\n },\n _getItemsAsjQuery: function _getItemsAsjQuery(connected) {\n var i,\n j,\n cur,\n inst,\n items = [],\n queries = [],\n connectWith = this._connectWith();\n\n if (connectWith && connected) {\n for (i = connectWith.length - 1; i >= 0; i--) {\n cur = $(connectWith[i], this.document[0]);\n\n for (j = cur.length - 1; j >= 0; j--) {\n inst = $.data(cur[j], this.widgetFullName);\n\n if (inst && inst !== this && !inst.options.disabled) {\n queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(\".ui-sortable-helper\").not(\".ui-sortable-placeholder\"), inst]);\n }\n }\n }\n }\n\n queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, {\n options: this.options,\n item: this.currentItem\n }) : $(this.options.items, this.element).not(\".ui-sortable-helper\").not(\".ui-sortable-placeholder\"), this]);\n\n function addItems() {\n items.push(this);\n }\n\n for (i = queries.length - 1; i >= 0; i--) {\n queries[i][0].each(addItems);\n }\n\n return $(items);\n },\n _removeCurrentsFromItems: function _removeCurrentsFromItems() {\n var list = this.currentItem.find(\":data(\" + this.widgetName + \"-item)\");\n this.items = $.grep(this.items, function (item) {\n for (var j = 0; j < list.length; j++) {\n if (list[j] === item.item[0]) {\n return false;\n }\n }\n\n return true;\n });\n },\n _refreshItems: function _refreshItems(event) {\n this.items = [];\n this.containers = [this];\n\n var i,\n j,\n cur,\n inst,\n targetData,\n _queries,\n item,\n queriesLength,\n items = this.items,\n queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, {\n item: this.currentItem\n }) : $(this.options.items, this.element), this]],\n connectWith = this._connectWith(); //Shouldn't be run the first time through due to massive slow-down\n\n\n if (connectWith && this.ready) {\n for (i = connectWith.length - 1; i >= 0; i--) {\n cur = $(connectWith[i], this.document[0]);\n\n for (j = cur.length - 1; j >= 0; j--) {\n inst = $.data(cur[j], this.widgetFullName);\n\n if (inst && inst !== this && !inst.options.disabled) {\n queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, {\n item: this.currentItem\n }) : $(inst.options.items, inst.element), inst]);\n this.containers.push(inst);\n }\n }\n }\n }\n\n for (i = queries.length - 1; i >= 0; i--) {\n targetData = queries[i][1];\n _queries = queries[i][0];\n\n for (j = 0, queriesLength = _queries.length; j < queriesLength; j++) {\n item = $(_queries[j]); // Data for target checking (mouse manager)\n\n item.data(this.widgetName + \"-item\", targetData);\n items.push({\n item: item,\n instance: targetData,\n width: 0,\n height: 0,\n left: 0,\n top: 0\n });\n }\n }\n },\n refreshPositions: function refreshPositions(fast) {\n // Determine whether items are being displayed horizontally\n this.floating = this.items.length ? this.options.axis === \"x\" || this._isFloating(this.items[0].item) : false; //This has to be redone because due to the item being moved out/into the offsetParent,\n // the offsetParent's position will change\n\n if (this.offsetParent && this.helper) {\n this.offset.parent = this._getParentOffset();\n }\n\n var i, item, t, p;\n\n for (i = this.items.length - 1; i >= 0; i--) {\n item = this.items[i]; //We ignore calculating positions of all connected containers when we're not over them\n\n if (item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {\n continue;\n }\n\n t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;\n\n if (!fast) {\n item.width = t.outerWidth();\n item.height = t.outerHeight();\n }\n\n p = t.offset();\n item.left = p.left;\n item.top = p.top;\n }\n\n if (this.options.custom && this.options.custom.refreshContainers) {\n this.options.custom.refreshContainers.call(this);\n } else {\n for (i = this.containers.length - 1; i >= 0; i--) {\n p = this.containers[i].element.offset();\n this.containers[i].containerCache.left = p.left;\n this.containers[i].containerCache.top = p.top;\n this.containers[i].containerCache.width = this.containers[i].element.outerWidth();\n this.containers[i].containerCache.height = this.containers[i].element.outerHeight();\n }\n }\n\n return this;\n },\n _createPlaceholder: function _createPlaceholder(that) {\n that = that || this;\n var className,\n o = that.options;\n\n if (!o.placeholder || o.placeholder.constructor === String) {\n className = o.placeholder;\n o.placeholder = {\n element: function element() {\n var nodeName = that.currentItem[0].nodeName.toLowerCase(),\n element = $(\"<\" + nodeName + \">\", that.document[0]);\n\n that._addClass(element, \"ui-sortable-placeholder\", className || that.currentItem[0].className)._removeClass(element, \"ui-sortable-helper\");\n\n if (nodeName === \"tbody\") {\n that._createTrPlaceholder(that.currentItem.find(\"tr\").eq(0), $(\"
\", that.document[0]).appendTo(element));\n } else if (nodeName === \"tr\") {\n that._createTrPlaceholder(that.currentItem, element);\n } else if (nodeName === \"img\") {\n element.attr(\"src\", that.currentItem.attr(\"src\"));\n }\n\n if (!className) {\n element.css(\"visibility\", \"hidden\");\n }\n\n return element;\n },\n update: function update(container, p) {\n // 1. If a className is set as 'placeholder option, we don't force sizes -\n // the class is responsible for that\n // 2. The option 'forcePlaceholderSize can be enabled to force it even if a\n // class name is specified\n if (className && !o.forcePlaceholderSize) {\n return;\n } //If the element doesn't have a actual height by itself (without styles coming\n // from a stylesheet), it receives the inline height from the dragged item\n\n\n if (!p.height()) {\n p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css(\"paddingTop\") || 0, 10) - parseInt(that.currentItem.css(\"paddingBottom\") || 0, 10));\n }\n\n if (!p.width()) {\n p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css(\"paddingLeft\") || 0, 10) - parseInt(that.currentItem.css(\"paddingRight\") || 0, 10));\n }\n }\n };\n } //Create the placeholder\n\n\n that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem)); //Append it after the actual current item\n\n that.currentItem.after(that.placeholder); //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)\n\n o.placeholder.update(that, that.placeholder);\n },\n _createTrPlaceholder: function _createTrPlaceholder(sourceTr, targetTr) {\n var that = this;\n sourceTr.children().each(function () {\n $(\" | \", that.document[0]).attr(\"colspan\", $(this).attr(\"colspan\") || 1).appendTo(targetTr);\n });\n },\n _contactContainers: function _contactContainers(event) {\n var i,\n j,\n dist,\n itemWithLeastDistance,\n posProperty,\n sizeProperty,\n cur,\n nearBottom,\n floating,\n axis,\n innermostContainer = null,\n innermostIndex = null; // Get innermost container that intersects with item\n\n for (i = this.containers.length - 1; i >= 0; i--) {\n // Never consider a container that's located within the item itself\n if ($.contains(this.currentItem[0], this.containers[i].element[0])) {\n continue;\n }\n\n if (this._intersectsWith(this.containers[i].containerCache)) {\n // If we've already found a container and it's more \"inner\" than this, then continue\n if (innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {\n continue;\n }\n\n innermostContainer = this.containers[i];\n innermostIndex = i;\n } else {\n // container doesn't intersect. trigger \"out\" event if necessary\n if (this.containers[i].containerCache.over) {\n this.containers[i]._trigger(\"out\", event, this._uiHash(this));\n\n this.containers[i].containerCache.over = 0;\n }\n }\n } // If no intersecting containers found, return\n\n\n if (!innermostContainer) {\n return;\n } // Move the item into the container if it's not there already\n\n\n if (this.containers.length === 1) {\n if (!this.containers[innermostIndex].containerCache.over) {\n this.containers[innermostIndex]._trigger(\"over\", event, this._uiHash(this));\n\n this.containers[innermostIndex].containerCache.over = 1;\n }\n } else {\n // When entering a new container, we will find the item with the least distance and\n // append our item near it\n dist = 10000;\n itemWithLeastDistance = null;\n floating = innermostContainer.floating || this._isFloating(this.currentItem);\n posProperty = floating ? \"left\" : \"top\";\n sizeProperty = floating ? \"width\" : \"height\";\n axis = floating ? \"pageX\" : \"pageY\";\n\n for (j = this.items.length - 1; j >= 0; j--) {\n if (!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {\n continue;\n }\n\n if (this.items[j].item[0] === this.currentItem[0]) {\n continue;\n }\n\n cur = this.items[j].item.offset()[posProperty];\n nearBottom = false;\n\n if (event[axis] - cur > this.items[j][sizeProperty] / 2) {\n nearBottom = true;\n }\n\n if (Math.abs(event[axis] - cur) < dist) {\n dist = Math.abs(event[axis] - cur);\n itemWithLeastDistance = this.items[j];\n this.direction = nearBottom ? \"up\" : \"down\";\n }\n } //Check if dropOnEmpty is enabled\n\n\n if (!itemWithLeastDistance && !this.options.dropOnEmpty) {\n return;\n }\n\n if (this.currentContainer === this.containers[innermostIndex]) {\n if (!this.currentContainer.containerCache.over) {\n this.containers[innermostIndex]._trigger(\"over\", event, this._uiHash());\n\n this.currentContainer.containerCache.over = 1;\n }\n\n return;\n }\n\n itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);\n\n this._trigger(\"change\", event, this._uiHash());\n\n this.containers[innermostIndex]._trigger(\"change\", event, this._uiHash(this));\n\n this.currentContainer = this.containers[innermostIndex]; //Update the placeholder\n\n this.options.placeholder.update(this.currentContainer, this.placeholder);\n\n this.containers[innermostIndex]._trigger(\"over\", event, this._uiHash(this));\n\n this.containers[innermostIndex].containerCache.over = 1;\n }\n },\n _createHelper: function _createHelper(event) {\n var o = this.options,\n helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : o.helper === \"clone\" ? this.currentItem.clone() : this.currentItem; //Add the helper to the DOM if that didn't happen already\n\n if (!helper.parents(\"body\").length) {\n $(o.appendTo !== \"parent\" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);\n }\n\n if (helper[0] === this.currentItem[0]) {\n this._storedCSS = {\n width: this.currentItem[0].style.width,\n height: this.currentItem[0].style.height,\n position: this.currentItem.css(\"position\"),\n top: this.currentItem.css(\"top\"),\n left: this.currentItem.css(\"left\")\n };\n }\n\n if (!helper[0].style.width || o.forceHelperSize) {\n helper.width(this.currentItem.width());\n }\n\n if (!helper[0].style.height || o.forceHelperSize) {\n helper.height(this.currentItem.height());\n }\n\n return helper;\n },\n _adjustOffsetFromHelper: function _adjustOffsetFromHelper(obj) {\n if (typeof obj === \"string\") {\n obj = obj.split(\" \");\n }\n\n if ($.isArray(obj)) {\n obj = {\n left: +obj[0],\n top: +obj[1] || 0\n };\n }\n\n if (\"left\" in obj) {\n this.offset.click.left = obj.left + this.margins.left;\n }\n\n if (\"right\" in obj) {\n this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;\n }\n\n if (\"top\" in obj) {\n this.offset.click.top = obj.top + this.margins.top;\n }\n\n if (\"bottom\" in obj) {\n this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;\n }\n },\n _getParentOffset: function _getParentOffset() {\n //Get the offsetParent and cache its position\n this.offsetParent = this.helper.offsetParent();\n var po = this.offsetParent.offset(); // This is a special case where we need to modify a offset calculated on start, since the\n // following happened:\n // 1. The position of the helper is absolute, so it's position is calculated based on the\n // next positioned parent\n // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't\n // the document, which means that the scroll is included in the initial calculation of the\n // offset of the parent, and never recalculated upon drag\n\n if (this.cssPosition === \"absolute\" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) {\n po.left += this.scrollParent.scrollLeft();\n po.top += this.scrollParent.scrollTop();\n } // This needs to be actually done for all browsers, since pageX/pageY includes this\n // information with an ugly IE fix\n\n\n if (this.offsetParent[0] === this.document[0].body || this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === \"html\" && $.ui.ie) {\n po = {\n top: 0,\n left: 0\n };\n }\n\n return {\n top: po.top + (parseInt(this.offsetParent.css(\"borderTopWidth\"), 10) || 0),\n left: po.left + (parseInt(this.offsetParent.css(\"borderLeftWidth\"), 10) || 0)\n };\n },\n _getRelativeOffset: function _getRelativeOffset() {\n if (this.cssPosition === \"relative\") {\n var p = this.currentItem.position();\n return {\n top: p.top - (parseInt(this.helper.css(\"top\"), 10) || 0) + this.scrollParent.scrollTop(),\n left: p.left - (parseInt(this.helper.css(\"left\"), 10) || 0) + this.scrollParent.scrollLeft()\n };\n } else {\n return {\n top: 0,\n left: 0\n };\n }\n },\n _cacheMargins: function _cacheMargins() {\n this.margins = {\n left: parseInt(this.currentItem.css(\"marginLeft\"), 10) || 0,\n top: parseInt(this.currentItem.css(\"marginTop\"), 10) || 0\n };\n },\n _cacheHelperProportions: function _cacheHelperProportions() {\n this.helperProportions = {\n width: this.helper.outerWidth(),\n height: this.helper.outerHeight()\n };\n },\n _setContainment: function _setContainment() {\n var ce,\n co,\n over,\n o = this.options;\n\n if (o.containment === \"parent\") {\n o.containment = this.helper[0].parentNode;\n }\n\n if (o.containment === \"document\" || o.containment === \"window\") {\n this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, o.containment === \"document\" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left, (o.containment === \"document\" ? this.document.height() || document.body.parentNode.scrollHeight : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];\n }\n\n if (!/^(document|window|parent)$/.test(o.containment)) {\n ce = $(o.containment)[0];\n co = $(o.containment).offset();\n over = $(ce).css(\"overflow\") !== \"hidden\";\n this.containment = [co.left + (parseInt($(ce).css(\"borderLeftWidth\"), 10) || 0) + (parseInt($(ce).css(\"paddingLeft\"), 10) || 0) - this.margins.left, co.top + (parseInt($(ce).css(\"borderTopWidth\"), 10) || 0) + (parseInt($(ce).css(\"paddingTop\"), 10) || 0) - this.margins.top, co.left + (over ? Math.max(ce.scrollWidth, ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css(\"borderLeftWidth\"), 10) || 0) - (parseInt($(ce).css(\"paddingRight\"), 10) || 0) - this.helperProportions.width - this.margins.left, co.top + (over ? Math.max(ce.scrollHeight, ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css(\"borderTopWidth\"), 10) || 0) - (parseInt($(ce).css(\"paddingBottom\"), 10) || 0) - this.helperProportions.height - this.margins.top];\n }\n },\n _convertPositionTo: function _convertPositionTo(d, pos) {\n if (!pos) {\n pos = this.position;\n }\n\n var mod = d === \"absolute\" ? 1 : -1,\n scroll = this.cssPosition === \"absolute\" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,\n scrollIsRootNode = /(html|body)/i.test(scroll[0].tagName);\n return {\n top: // The absolute mouse position\n pos.top + // Only for relative positioned nodes: Relative offset from element to offset parent\n this.offset.relative.top * mod + // The offsetParent's offset without borders (offset + border)\n this.offset.parent.top * mod - (this.cssPosition === \"fixed\" ? -this.scrollParent.scrollTop() : scrollIsRootNode ? 0 : scroll.scrollTop()) * mod,\n left: // The absolute mouse position\n pos.left + // Only for relative positioned nodes: Relative offset from element to offset parent\n this.offset.relative.left * mod + // The offsetParent's offset without borders (offset + border)\n this.offset.parent.left * mod - (this.cssPosition === \"fixed\" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft()) * mod\n };\n },\n _generatePosition: function _generatePosition(event) {\n var top,\n left,\n o = this.options,\n pageX = event.pageX,\n pageY = event.pageY,\n scroll = this.cssPosition === \"absolute\" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,\n scrollIsRootNode = /(html|body)/i.test(scroll[0].tagName); // This is another very weird special case that only happens for relative elements:\n // 1. If the css position is relative\n // 2. and the scroll parent is the document or similar to the offset parent\n // we have to refresh the relative offset during the scroll so there are no jumps\n\n if (this.cssPosition === \"relative\" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) {\n this.offset.relative = this._getRelativeOffset();\n }\n /*\n * - Position constraining -\n * Constrain the position to a mix of grid, containment.\n */\n\n\n if (this.originalPosition) {\n //If we are not dragging yet, we won't check for options\n if (this.containment) {\n if (event.pageX - this.offset.click.left < this.containment[0]) {\n pageX = this.containment[0] + this.offset.click.left;\n }\n\n if (event.pageY - this.offset.click.top < this.containment[1]) {\n pageY = this.containment[1] + this.offset.click.top;\n }\n\n if (event.pageX - this.offset.click.left > this.containment[2]) {\n pageX = this.containment[2] + this.offset.click.left;\n }\n\n if (event.pageY - this.offset.click.top > this.containment[3]) {\n pageY = this.containment[3] + this.offset.click.top;\n }\n }\n\n if (o.grid) {\n top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];\n pageY = this.containment ? top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3] ? top : top - this.offset.click.top >= this.containment[1] ? top - o.grid[1] : top + o.grid[1] : top;\n left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];\n pageX = this.containment ? left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2] ? left : left - this.offset.click.left >= this.containment[0] ? left - o.grid[0] : left + o.grid[0] : left;\n }\n }\n\n return {\n top: // The absolute mouse position\n pageY - // Click offset (relative to the element)\n this.offset.click.top - // Only for relative positioned nodes: Relative offset from element to offset parent\n this.offset.relative.top - // The offsetParent's offset without borders (offset + border)\n this.offset.parent.top + (this.cssPosition === \"fixed\" ? -this.scrollParent.scrollTop() : scrollIsRootNode ? 0 : scroll.scrollTop()),\n left: // The absolute mouse position\n pageX - // Click offset (relative to the element)\n this.offset.click.left - // Only for relative positioned nodes: Relative offset from element to offset parent\n this.offset.relative.left - // The offsetParent's offset without borders (offset + border)\n this.offset.parent.left + (this.cssPosition === \"fixed\" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft())\n };\n },\n _rearrange: function _rearrange(event, i, a, hardRefresh) {\n a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], this.direction === \"down\" ? i.item[0] : i.item[0].nextSibling); //Various things done here to improve the performance:\n // 1. we create a setTimeout, that calls refreshPositions\n // 2. on the instance, we have a counter variable, that get's higher after every append\n // 3. on the local scope, we copy the counter variable, and check in the timeout,\n // if it's still the same\n // 4. this lets only the last addition to the timeout stack through\n\n this.counter = this.counter ? ++this.counter : 1;\n var counter = this.counter;\n\n this._delay(function () {\n if (counter === this.counter) {\n //Precompute after each DOM insertion, NOT on mousemove\n this.refreshPositions(!hardRefresh);\n }\n });\n },\n _clear: function _clear(event, noPropagation) {\n this.reverting = false; // We delay all events that have to be triggered to after the point where the placeholder\n // has been removed and everything else normalized again\n\n var i,\n delayedTriggers = []; // We first have to update the dom position of the actual currentItem\n // Note: don't do it if the current item is already removed (by a user), or it gets\n // reappended (see #4088)\n\n if (!this._noFinalSort && this.currentItem.parent().length) {\n this.placeholder.before(this.currentItem);\n }\n\n this._noFinalSort = null;\n\n if (this.helper[0] === this.currentItem[0]) {\n for (i in this._storedCSS) {\n if (this._storedCSS[i] === \"auto\" || this._storedCSS[i] === \"static\") {\n this._storedCSS[i] = \"\";\n }\n }\n\n this.currentItem.css(this._storedCSS);\n\n this._removeClass(this.currentItem, \"ui-sortable-helper\");\n } else {\n this.currentItem.show();\n }\n\n if (this.fromOutside && !noPropagation) {\n delayedTriggers.push(function (event) {\n this._trigger(\"receive\", event, this._uiHash(this.fromOutside));\n });\n }\n\n if ((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(\".ui-sortable-helper\")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {\n // Trigger update callback if the DOM position has changed\n delayedTriggers.push(function (event) {\n this._trigger(\"update\", event, this._uiHash());\n });\n } // Check if the items Container has Changed and trigger appropriate\n // events.\n\n\n if (this !== this.currentContainer) {\n if (!noPropagation) {\n delayedTriggers.push(function (event) {\n this._trigger(\"remove\", event, this._uiHash());\n });\n delayedTriggers.push(function (c) {\n return function (event) {\n c._trigger(\"receive\", event, this._uiHash(this));\n };\n }.call(this, this.currentContainer));\n delayedTriggers.push(function (c) {\n return function (event) {\n c._trigger(\"update\", event, this._uiHash(this));\n };\n }.call(this, this.currentContainer));\n }\n } //Post events to containers\n\n\n function delayEvent(type, instance, container) {\n return function (event) {\n container._trigger(type, event, instance._uiHash(instance));\n };\n }\n\n for (i = this.containers.length - 1; i >= 0; i--) {\n if (!noPropagation) {\n delayedTriggers.push(delayEvent(\"deactivate\", this, this.containers[i]));\n }\n\n if (this.containers[i].containerCache.over) {\n delayedTriggers.push(delayEvent(\"out\", this, this.containers[i]));\n this.containers[i].containerCache.over = 0;\n }\n } //Do what was originally in plugins\n\n\n if (this.storedCursor) {\n this.document.find(\"body\").css(\"cursor\", this.storedCursor);\n this.storedStylesheet.remove();\n }\n\n if (this._storedOpacity) {\n this.helper.css(\"opacity\", this._storedOpacity);\n }\n\n if (this._storedZIndex) {\n this.helper.css(\"zIndex\", this._storedZIndex === \"auto\" ? \"\" : this._storedZIndex);\n }\n\n this.dragging = false;\n\n if (!noPropagation) {\n this._trigger(\"beforeStop\", event, this._uiHash());\n } //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,\n // it unbinds ALL events from the original node!\n\n\n this.placeholder[0].parentNode.removeChild(this.placeholder[0]);\n\n if (!this.cancelHelperRemoval) {\n if (this.helper[0] !== this.currentItem[0]) {\n this.helper.remove();\n }\n\n this.helper = null;\n }\n\n if (!noPropagation) {\n for (i = 0; i < delayedTriggers.length; i++) {\n // Trigger all delayed events\n delayedTriggers[i].call(this, event);\n }\n\n this._trigger(\"stop\", event, this._uiHash());\n }\n\n this.fromOutside = false;\n return !this.cancelHelperRemoval;\n },\n _trigger: function _trigger() {\n if ($.Widget.prototype._trigger.apply(this, arguments) === false) {\n this.cancel();\n }\n },\n _uiHash: function _uiHash(_inst) {\n var inst = _inst || this;\n return {\n helper: inst.helper,\n placeholder: inst.placeholder || $([]),\n position: inst.position,\n originalPosition: inst.originalPosition,\n offset: inst.positionAbs,\n item: inst.currentItem,\n sender: _inst ? _inst.element : null\n };\n }\n });\n});","/*!\n * jQuery UI Mouse 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n//>>label: Mouse\n//>>group: Widgets\n//>>description: Abstracts mouse-based interactions to assist in creating certain widgets.\n//>>docs: http://api.jqueryui.com/mouse/\n(function (factory) {\n if (typeof define === \"function\" && define.amd) {\n // AMD. Register as an anonymous module.\n define([\"jquery\", \"../ie\", \"../version\", \"../widget\"], factory);\n } else {\n // Browser globals\n factory(jQuery);\n }\n})(function ($) {\n var mouseHandled = false;\n $(document).on(\"mouseup\", function () {\n mouseHandled = false;\n });\n return $.widget(\"ui.mouse\", {\n version: \"1.12.1\",\n options: {\n cancel: \"input, textarea, button, select, option\",\n distance: 1,\n delay: 0\n },\n _mouseInit: function _mouseInit() {\n var that = this;\n this.element.on(\"mousedown.\" + this.widgetName, function (event) {\n return that._mouseDown(event);\n }).on(\"click.\" + this.widgetName, function (event) {\n if (true === $.data(event.target, that.widgetName + \".preventClickEvent\")) {\n $.removeData(event.target, that.widgetName + \".preventClickEvent\");\n event.stopImmediatePropagation();\n return false;\n }\n });\n this.started = false;\n },\n // TODO: make sure destroying one instance of mouse doesn't mess with\n // other instances of mouse\n _mouseDestroy: function _mouseDestroy() {\n this.element.off(\".\" + this.widgetName);\n\n if (this._mouseMoveDelegate) {\n this.document.off(\"mousemove.\" + this.widgetName, this._mouseMoveDelegate).off(\"mouseup.\" + this.widgetName, this._mouseUpDelegate);\n }\n },\n _mouseDown: function _mouseDown(event) {\n // don't let more than one widget handle mouseStart\n if (mouseHandled) {\n return;\n }\n\n this._mouseMoved = false; // We may have missed mouseup (out of window)\n\n this._mouseStarted && this._mouseUp(event);\n this._mouseDownEvent = event;\n var that = this,\n btnIsLeft = event.which === 1,\n // event.target.nodeName works around a bug in IE 8 with\n // disabled inputs (#7620)\n elIsCancel = typeof this.options.cancel === \"string\" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false;\n\n if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {\n return true;\n }\n\n this.mouseDelayMet = !this.options.delay;\n\n if (!this.mouseDelayMet) {\n this._mouseDelayTimer = setTimeout(function () {\n that.mouseDelayMet = true;\n }, this.options.delay);\n }\n\n if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {\n this._mouseStarted = this._mouseStart(event) !== false;\n\n if (!this._mouseStarted) {\n event.preventDefault();\n return true;\n }\n } // Click event may never have fired (Gecko & Opera)\n\n\n if (true === $.data(event.target, this.widgetName + \".preventClickEvent\")) {\n $.removeData(event.target, this.widgetName + \".preventClickEvent\");\n } // These delegates are required to keep context\n\n\n this._mouseMoveDelegate = function (event) {\n return that._mouseMove(event);\n };\n\n this._mouseUpDelegate = function (event) {\n return that._mouseUp(event);\n };\n\n this.document.on(\"mousemove.\" + this.widgetName, this._mouseMoveDelegate).on(\"mouseup.\" + this.widgetName, this._mouseUpDelegate);\n event.preventDefault();\n mouseHandled = true;\n return true;\n },\n _mouseMove: function _mouseMove(event) {\n // Only check for mouseups outside the document if you've moved inside the document\n // at least once. This prevents the firing of mouseup in the case of IE<9, which will\n // fire a mousemove event if content is placed under the cursor. See #7778\n // Support: IE <9\n if (this._mouseMoved) {\n // IE mouseup check - mouseup happened when mouse was out of window\n if ($.ui.ie && (!document.documentMode || document.documentMode < 9) && !event.button) {\n return this._mouseUp(event); // Iframe mouseup check - mouseup occurred in another document\n } else if (!event.which) {\n // Support: Safari <=8 - 9\n // Safari sets which to 0 if you press any of the following keys\n // during a drag (#14461)\n if (event.originalEvent.altKey || event.originalEvent.ctrlKey || event.originalEvent.metaKey || event.originalEvent.shiftKey) {\n this.ignoreMissingWhich = true;\n } else if (!this.ignoreMissingWhich) {\n return this._mouseUp(event);\n }\n }\n }\n\n if (event.which || event.button) {\n this._mouseMoved = true;\n }\n\n if (this._mouseStarted) {\n this._mouseDrag(event);\n\n return event.preventDefault();\n }\n\n if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {\n this._mouseStarted = this._mouseStart(this._mouseDownEvent, event) !== false;\n this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event);\n }\n\n return !this._mouseStarted;\n },\n _mouseUp: function _mouseUp(event) {\n this.document.off(\"mousemove.\" + this.widgetName, this._mouseMoveDelegate).off(\"mouseup.\" + this.widgetName, this._mouseUpDelegate);\n\n if (this._mouseStarted) {\n this._mouseStarted = false;\n\n if (event.target === this._mouseDownEvent.target) {\n $.data(event.target, this.widgetName + \".preventClickEvent\", true);\n }\n\n this._mouseStop(event);\n }\n\n if (this._mouseDelayTimer) {\n clearTimeout(this._mouseDelayTimer);\n delete this._mouseDelayTimer;\n }\n\n this.ignoreMissingWhich = false;\n mouseHandled = false;\n event.preventDefault();\n },\n _mouseDistanceMet: function _mouseDistanceMet(event) {\n return Math.max(Math.abs(this._mouseDownEvent.pageX - event.pageX), Math.abs(this._mouseDownEvent.pageY - event.pageY)) >= this.options.distance;\n },\n _mouseDelayMet: function _mouseDelayMet()\n /* event */\n {\n return this.mouseDelayMet;\n },\n // These are placeholder methods, to be overriden by extending plugin\n _mouseStart: function _mouseStart()\n /* event */\n {},\n _mouseDrag: function _mouseDrag()\n /* event */\n {},\n _mouseStop: function _mouseStop()\n /* event */\n {},\n _mouseCapture: function _mouseCapture()\n /* event */\n {\n return true;\n }\n });\n});","/*!\n * jQuery UI :data 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n//>>label: :data Selector\n//>>group: Core\n//>>description: Selects elements which have data stored under the specified key.\n//>>docs: http://api.jqueryui.com/data-selector/\n(function (factory) {\n if (typeof define === \"function\" && define.amd) {\n // AMD. Register as an anonymous module.\n define([\"jquery\", \"./version\"], factory);\n } else {\n // Browser globals\n factory(jQuery);\n }\n})(function ($) {\n return $.extend($.expr[\":\"], {\n data: $.expr.createPseudo ? $.expr.createPseudo(function (dataName) {\n return function (elem) {\n return !!$.data(elem, dataName);\n };\n }) : // Support: jQuery <1.8\n function (elem, i, match) {\n return !!$.data(elem, match[3]);\n }\n });\n});","/*!\n * jQuery UI Scroll Parent 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n//>>label: scrollParent\n//>>group: Core\n//>>description: Get the closest ancestor element that is scrollable.\n//>>docs: http://api.jqueryui.com/scrollParent/\n(function (factory) {\n if (typeof define === \"function\" && define.amd) {\n // AMD. Register as an anonymous module.\n define([\"jquery\", \"./version\"], factory);\n } else {\n // Browser globals\n factory(jQuery);\n }\n})(function ($) {\n return $.fn.scrollParent = function (includeHidden) {\n var position = this.css(\"position\"),\n excludeStaticParent = position === \"absolute\",\n overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,\n scrollParent = this.parents().filter(function () {\n var parent = $(this);\n\n if (excludeStaticParent && parent.css(\"position\") === \"static\") {\n return false;\n }\n\n return overflowRegex.test(parent.css(\"overflow\") + parent.css(\"overflow-y\") + parent.css(\"overflow-x\"));\n }).eq(0);\n return position === \"fixed\" || !scrollParent.length ? $(this[0].ownerDocument || document) : scrollParent;\n };\n});","/*!\n * jQuery UI Effects Highlight 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n//>>label: Highlight Effect\n//>>group: Effects\n//>>description: Highlights the background of an element in a defined color for a custom duration.\n//>>docs: http://api.jqueryui.com/highlight-effect/\n//>>demos: http://jqueryui.com/effect/\n(function (factory) {\n if (typeof define === \"function\" && define.amd) {\n // AMD. Register as an anonymous module.\n define([\"jquery\", \"../version\", \"../effect\"], factory);\n } else {\n // Browser globals\n factory(jQuery);\n }\n})(function ($) {\n return $.effects.define(\"highlight\", \"show\", function (options, done) {\n var element = $(this),\n animation = {\n backgroundColor: element.css(\"backgroundColor\")\n };\n\n if (options.mode === \"hide\") {\n animation.opacity = 0;\n }\n\n $.effects.saveStyle(element);\n element.css({\n backgroundImage: \"none\",\n backgroundColor: options.color || \"#ffff99\"\n }).animate(animation, {\n queue: false,\n duration: options.duration,\n easing: options.easing,\n complete: done\n });\n });\n});","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/*!\n * jQuery UI Effects 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n//>>label: Effects Core\n//>>group: Effects\n// jscs:disable maximumLineLength\n//>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects.\n// jscs:enable maximumLineLength\n//>>docs: http://api.jqueryui.com/category/effects-core/\n//>>demos: http://jqueryui.com/effect/\n(function (factory) {\n if (typeof define === \"function\" && define.amd) {\n // AMD. Register as an anonymous module.\n define([\"jquery\", \"./version\"], factory);\n } else {\n // Browser globals\n factory(jQuery);\n }\n})(function ($) {\n var dataSpace = \"ui-effects-\",\n dataSpaceStyle = \"ui-effects-style\",\n dataSpaceAnimated = \"ui-effects-animated\",\n // Create a local jQuery because jQuery Color relies on it and the\n // global may not exist with AMD and a custom build (#10199)\n jQuery = $;\n $.effects = {\n effect: {}\n };\n /*!\n * jQuery Color Animations v2.1.2\n * https://github.com/jquery/jquery-color\n *\n * Copyright 2014 jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * Date: Wed Jan 16 08:47:09 2013 -0600\n */\n\n (function (jQuery, undefined) {\n var stepHooks = \"backgroundColor borderBottomColor borderLeftColor borderRightColor \" + \"borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor\",\n // Plusequals test for += 100 -= 100\n rplusequals = /^([\\-+])=\\s*(\\d+\\.?\\d*)/,\n // A set of RE's that can match strings and generate color tuples.\n stringParsers = [{\n re: /rgba?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*(?:,\\s*(\\d?(?:\\.\\d+)?)\\s*)?\\)/,\n parse: function parse(execResult) {\n return [execResult[1], execResult[2], execResult[3], execResult[4]];\n }\n }, {\n re: /rgba?\\(\\s*(\\d+(?:\\.\\d+)?)\\%\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*(?:,\\s*(\\d?(?:\\.\\d+)?)\\s*)?\\)/,\n parse: function parse(execResult) {\n return [execResult[1] * 2.55, execResult[2] * 2.55, execResult[3] * 2.55, execResult[4]];\n }\n }, {\n // This regex ignores A-F because it's compared against an already lowercased string\n re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,\n parse: function parse(execResult) {\n return [parseInt(execResult[1], 16), parseInt(execResult[2], 16), parseInt(execResult[3], 16)];\n }\n }, {\n // This regex ignores A-F because it's compared against an already lowercased string\n re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,\n parse: function parse(execResult) {\n return [parseInt(execResult[1] + execResult[1], 16), parseInt(execResult[2] + execResult[2], 16), parseInt(execResult[3] + execResult[3], 16)];\n }\n }, {\n re: /hsla?\\(\\s*(\\d+(?:\\.\\d+)?)\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*(?:,\\s*(\\d?(?:\\.\\d+)?)\\s*)?\\)/,\n space: \"hsla\",\n parse: function parse(execResult) {\n return [execResult[1], execResult[2] / 100, execResult[3] / 100, execResult[4]];\n }\n }],\n // JQuery.Color( )\n color = jQuery.Color = function (color, green, blue, alpha) {\n return new jQuery.Color.fn.parse(color, green, blue, alpha);\n },\n spaces = {\n rgba: {\n props: {\n red: {\n idx: 0,\n type: \"byte\"\n },\n green: {\n idx: 1,\n type: \"byte\"\n },\n blue: {\n idx: 2,\n type: \"byte\"\n }\n }\n },\n hsla: {\n props: {\n hue: {\n idx: 0,\n type: \"degrees\"\n },\n saturation: {\n idx: 1,\n type: \"percent\"\n },\n lightness: {\n idx: 2,\n type: \"percent\"\n }\n }\n }\n },\n propTypes = {\n \"byte\": {\n floor: true,\n max: 255\n },\n \"percent\": {\n max: 1\n },\n \"degrees\": {\n mod: 360,\n floor: true\n }\n },\n support = color.support = {},\n // Element for support tests\n supportElem = jQuery(\"\")[0],\n // Colors = jQuery.Color.names\n colors,\n // Local aliases of functions called often\n each = jQuery.each; // Determine rgba support immediately\n\n\n supportElem.style.cssText = \"background-color:rgba(1,1,1,.5)\";\n support.rgba = supportElem.style.backgroundColor.indexOf(\"rgba\") > -1; // Define cache name and alpha properties\n // for rgba and hsla spaces\n\n each(spaces, function (spaceName, space) {\n space.cache = \"_\" + spaceName;\n space.props.alpha = {\n idx: 3,\n type: \"percent\",\n def: 1\n };\n });\n\n function clamp(value, prop, allowEmpty) {\n var type = propTypes[prop.type] || {};\n\n if (value == null) {\n return allowEmpty || !prop.def ? null : prop.def;\n } // ~~ is an short way of doing floor for positive numbers\n\n\n value = type.floor ? ~~value : parseFloat(value); // IE will pass in empty strings as value for alpha,\n // which will hit this case\n\n if (isNaN(value)) {\n return prop.def;\n }\n\n if (type.mod) {\n // We add mod before modding to make sure that negatives values\n // get converted properly: -10 -> 350\n return (value + type.mod) % type.mod;\n } // For now all property types without mod have min and max\n\n\n return 0 > value ? 0 : type.max < value ? type.max : value;\n }\n\n function stringParse(string) {\n var inst = color(),\n rgba = inst._rgba = [];\n string = string.toLowerCase();\n each(stringParsers, function (i, parser) {\n var parsed,\n match = parser.re.exec(string),\n values = match && parser.parse(match),\n spaceName = parser.space || \"rgba\";\n\n if (values) {\n parsed = inst[spaceName](values); // If this was an rgba parse the assignment might happen twice\n // oh well....\n\n inst[spaces[spaceName].cache] = parsed[spaces[spaceName].cache];\n rgba = inst._rgba = parsed._rgba; // Exit each( stringParsers ) here because we matched\n\n return false;\n }\n }); // Found a stringParser that handled it\n\n if (rgba.length) {\n // If this came from a parsed string, force \"transparent\" when alpha is 0\n // chrome, (and maybe others) return \"transparent\" as rgba(0,0,0,0)\n if (rgba.join() === \"0,0,0,0\") {\n jQuery.extend(rgba, colors.transparent);\n }\n\n return inst;\n } // Named colors\n\n\n return colors[string];\n }\n\n color.fn = jQuery.extend(color.prototype, {\n parse: function parse(red, green, blue, alpha) {\n if (red === undefined) {\n this._rgba = [null, null, null, null];\n return this;\n }\n\n if (red.jquery || red.nodeType) {\n red = jQuery(red).css(green);\n green = undefined;\n }\n\n var inst = this,\n type = jQuery.type(red),\n rgba = this._rgba = []; // More than 1 argument specified - assume ( red, green, blue, alpha )\n\n if (green !== undefined) {\n red = [red, green, blue, alpha];\n type = \"array\";\n }\n\n if (type === \"string\") {\n return this.parse(stringParse(red) || colors._default);\n }\n\n if (type === \"array\") {\n each(spaces.rgba.props, function (key, prop) {\n rgba[prop.idx] = clamp(red[prop.idx], prop);\n });\n return this;\n }\n\n if (type === \"object\") {\n if (red instanceof color) {\n each(spaces, function (spaceName, space) {\n if (red[space.cache]) {\n inst[space.cache] = red[space.cache].slice();\n }\n });\n } else {\n each(spaces, function (spaceName, space) {\n var cache = space.cache;\n each(space.props, function (key, prop) {\n // If the cache doesn't exist, and we know how to convert\n if (!inst[cache] && space.to) {\n // If the value was null, we don't need to copy it\n // if the key was alpha, we don't need to copy it either\n if (key === \"alpha\" || red[key] == null) {\n return;\n }\n\n inst[cache] = space.to(inst._rgba);\n } // This is the only case where we allow nulls for ALL properties.\n // call clamp with alwaysAllowEmpty\n\n\n inst[cache][prop.idx] = clamp(red[key], prop, true);\n }); // Everything defined but alpha?\n\n if (inst[cache] && jQuery.inArray(null, inst[cache].slice(0, 3)) < 0) {\n // Use the default of 1\n inst[cache][3] = 1;\n\n if (space.from) {\n inst._rgba = space.from(inst[cache]);\n }\n }\n });\n }\n\n return this;\n }\n },\n is: function is(compare) {\n var is = color(compare),\n same = true,\n inst = this;\n each(spaces, function (_, space) {\n var localCache,\n isCache = is[space.cache];\n\n if (isCache) {\n localCache = inst[space.cache] || space.to && space.to(inst._rgba) || [];\n each(space.props, function (_, prop) {\n if (isCache[prop.idx] != null) {\n same = isCache[prop.idx] === localCache[prop.idx];\n return same;\n }\n });\n }\n\n return same;\n });\n return same;\n },\n _space: function _space() {\n var used = [],\n inst = this;\n each(spaces, function (spaceName, space) {\n if (inst[space.cache]) {\n used.push(spaceName);\n }\n });\n return used.pop();\n },\n transition: function transition(other, distance) {\n var end = color(other),\n spaceName = end._space(),\n space = spaces[spaceName],\n startColor = this.alpha() === 0 ? color(\"transparent\") : this,\n start = startColor[space.cache] || space.to(startColor._rgba),\n result = start.slice();\n\n end = end[space.cache];\n each(space.props, function (key, prop) {\n var index = prop.idx,\n startValue = start[index],\n endValue = end[index],\n type = propTypes[prop.type] || {}; // If null, don't override start value\n\n if (endValue === null) {\n return;\n } // If null - use end\n\n\n if (startValue === null) {\n result[index] = endValue;\n } else {\n if (type.mod) {\n if (endValue - startValue > type.mod / 2) {\n startValue += type.mod;\n } else if (startValue - endValue > type.mod / 2) {\n startValue -= type.mod;\n }\n }\n\n result[index] = clamp((endValue - startValue) * distance + startValue, prop);\n }\n });\n return this[spaceName](result);\n },\n blend: function blend(opaque) {\n // If we are already opaque - return ourself\n if (this._rgba[3] === 1) {\n return this;\n }\n\n var rgb = this._rgba.slice(),\n a = rgb.pop(),\n blend = color(opaque)._rgba;\n\n return color(jQuery.map(rgb, function (v, i) {\n return (1 - a) * blend[i] + a * v;\n }));\n },\n toRgbaString: function toRgbaString() {\n var prefix = \"rgba(\",\n rgba = jQuery.map(this._rgba, function (v, i) {\n return v == null ? i > 2 ? 1 : 0 : v;\n });\n\n if (rgba[3] === 1) {\n rgba.pop();\n prefix = \"rgb(\";\n }\n\n return prefix + rgba.join() + \")\";\n },\n toHslaString: function toHslaString() {\n var prefix = \"hsla(\",\n hsla = jQuery.map(this.hsla(), function (v, i) {\n if (v == null) {\n v = i > 2 ? 1 : 0;\n } // Catch 1 and 2\n\n\n if (i && i < 3) {\n v = Math.round(v * 100) + \"%\";\n }\n\n return v;\n });\n\n if (hsla[3] === 1) {\n hsla.pop();\n prefix = \"hsl(\";\n }\n\n return prefix + hsla.join() + \")\";\n },\n toHexString: function toHexString(includeAlpha) {\n var rgba = this._rgba.slice(),\n alpha = rgba.pop();\n\n if (includeAlpha) {\n rgba.push(~~(alpha * 255));\n }\n\n return \"#\" + jQuery.map(rgba, function (v) {\n // Default to 0 when nulls exist\n v = (v || 0).toString(16);\n return v.length === 1 ? \"0\" + v : v;\n }).join(\"\");\n },\n toString: function toString() {\n return this._rgba[3] === 0 ? \"transparent\" : this.toRgbaString();\n }\n });\n color.fn.parse.prototype = color.fn; // Hsla conversions adapted from:\n // https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021\n\n function hue2rgb(p, q, h) {\n h = (h + 1) % 1;\n\n if (h * 6 < 1) {\n return p + (q - p) * h * 6;\n }\n\n if (h * 2 < 1) {\n return q;\n }\n\n if (h * 3 < 2) {\n return p + (q - p) * (2 / 3 - h) * 6;\n }\n\n return p;\n }\n\n spaces.hsla.to = function (rgba) {\n if (rgba[0] == null || rgba[1] == null || rgba[2] == null) {\n return [null, null, null, rgba[3]];\n }\n\n var r = rgba[0] / 255,\n g = rgba[1] / 255,\n b = rgba[2] / 255,\n a = rgba[3],\n max = Math.max(r, g, b),\n min = Math.min(r, g, b),\n diff = max - min,\n add = max + min,\n l = add * 0.5,\n h,\n s;\n\n if (min === max) {\n h = 0;\n } else if (r === max) {\n h = 60 * (g - b) / diff + 360;\n } else if (g === max) {\n h = 60 * (b - r) / diff + 120;\n } else {\n h = 60 * (r - g) / diff + 240;\n } // Chroma (diff) == 0 means greyscale which, by definition, saturation = 0%\n // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)\n\n\n if (diff === 0) {\n s = 0;\n } else if (l <= 0.5) {\n s = diff / add;\n } else {\n s = diff / (2 - add);\n }\n\n return [Math.round(h) % 360, s, l, a == null ? 1 : a];\n };\n\n spaces.hsla.from = function (hsla) {\n if (hsla[0] == null || hsla[1] == null || hsla[2] == null) {\n return [null, null, null, hsla[3]];\n }\n\n var h = hsla[0] / 360,\n s = hsla[1],\n l = hsla[2],\n a = hsla[3],\n q = l <= 0.5 ? l * (1 + s) : l + s - l * s,\n p = 2 * l - q;\n return [Math.round(hue2rgb(p, q, h + 1 / 3) * 255), Math.round(hue2rgb(p, q, h) * 255), Math.round(hue2rgb(p, q, h - 1 / 3) * 255), a];\n };\n\n each(spaces, function (spaceName, space) {\n var props = space.props,\n cache = space.cache,\n to = space.to,\n from = space.from; // Makes rgba() and hsla()\n\n color.fn[spaceName] = function (value) {\n // Generate a cache for this space if it doesn't exist\n if (to && !this[cache]) {\n this[cache] = to(this._rgba);\n }\n\n if (value === undefined) {\n return this[cache].slice();\n }\n\n var ret,\n type = jQuery.type(value),\n arr = type === \"array\" || type === \"object\" ? value : arguments,\n local = this[cache].slice();\n each(props, function (key, prop) {\n var val = arr[type === \"object\" ? key : prop.idx];\n\n if (val == null) {\n val = local[prop.idx];\n }\n\n local[prop.idx] = clamp(val, prop);\n });\n\n if (from) {\n ret = color(from(local));\n ret[cache] = local;\n return ret;\n } else {\n return color(local);\n }\n }; // Makes red() green() blue() alpha() hue() saturation() lightness()\n\n\n each(props, function (key, prop) {\n // Alpha is included in more than one space\n if (color.fn[key]) {\n return;\n }\n\n color.fn[key] = function (value) {\n var vtype = jQuery.type(value),\n fn = key === \"alpha\" ? this._hsla ? \"hsla\" : \"rgba\" : spaceName,\n local = this[fn](),\n cur = local[prop.idx],\n match;\n\n if (vtype === \"undefined\") {\n return cur;\n }\n\n if (vtype === \"function\") {\n value = value.call(this, cur);\n vtype = jQuery.type(value);\n }\n\n if (value == null && prop.empty) {\n return this;\n }\n\n if (vtype === \"string\") {\n match = rplusequals.exec(value);\n\n if (match) {\n value = cur + parseFloat(match[2]) * (match[1] === \"+\" ? 1 : -1);\n }\n }\n\n local[prop.idx] = value;\n return this[fn](local);\n };\n });\n }); // Add cssHook and .fx.step function for each named hook.\n // accept a space separated string of properties\n\n color.hook = function (hook) {\n var hooks = hook.split(\" \");\n each(hooks, function (i, hook) {\n jQuery.cssHooks[hook] = {\n set: function set(elem, value) {\n var parsed,\n curElem,\n backgroundColor = \"\";\n\n if (value !== \"transparent\" && (jQuery.type(value) !== \"string\" || (parsed = stringParse(value)))) {\n value = color(parsed || value);\n\n if (!support.rgba && value._rgba[3] !== 1) {\n curElem = hook === \"backgroundColor\" ? elem.parentNode : elem;\n\n while ((backgroundColor === \"\" || backgroundColor === \"transparent\") && curElem && curElem.style) {\n try {\n backgroundColor = jQuery.css(curElem, \"backgroundColor\");\n curElem = curElem.parentNode;\n } catch (e) {}\n }\n\n value = value.blend(backgroundColor && backgroundColor !== \"transparent\" ? backgroundColor : \"_default\");\n }\n\n value = value.toRgbaString();\n }\n\n try {\n elem.style[hook] = value;\n } catch (e) {// Wrapped to prevent IE from throwing errors on \"invalid\" values like\n // 'auto' or 'inherit'\n }\n }\n };\n\n jQuery.fx.step[hook] = function (fx) {\n if (!fx.colorInit) {\n fx.start = color(fx.elem, hook);\n fx.end = color(fx.end);\n fx.colorInit = true;\n }\n\n jQuery.cssHooks[hook].set(fx.elem, fx.start.transition(fx.end, fx.pos));\n };\n });\n };\n\n color.hook(stepHooks);\n jQuery.cssHooks.borderColor = {\n expand: function expand(value) {\n var expanded = {};\n each([\"Top\", \"Right\", \"Bottom\", \"Left\"], function (i, part) {\n expanded[\"border\" + part + \"Color\"] = value;\n });\n return expanded;\n }\n }; // Basic color names only.\n // Usage of any of the other color names requires adding yourself or including\n // jquery.color.svg-names.js.\n\n colors = jQuery.Color.names = {\n // 4.1. Basic color keywords\n aqua: \"#00ffff\",\n black: \"#000000\",\n blue: \"#0000ff\",\n fuchsia: \"#ff00ff\",\n gray: \"#808080\",\n green: \"#008000\",\n lime: \"#00ff00\",\n maroon: \"#800000\",\n navy: \"#000080\",\n olive: \"#808000\",\n purple: \"#800080\",\n red: \"#ff0000\",\n silver: \"#c0c0c0\",\n teal: \"#008080\",\n white: \"#ffffff\",\n yellow: \"#ffff00\",\n // 4.2.3. \"transparent\" color keyword\n transparent: [null, null, null, 0],\n _default: \"#ffffff\"\n };\n })(jQuery);\n /******************************************************************************/\n\n /****************************** CLASS ANIMATIONS ******************************/\n\n /******************************************************************************/\n\n\n (function () {\n var classAnimationActions = [\"add\", \"remove\", \"toggle\"],\n shorthandStyles = {\n border: 1,\n borderBottom: 1,\n borderColor: 1,\n borderLeft: 1,\n borderRight: 1,\n borderTop: 1,\n borderWidth: 1,\n margin: 1,\n padding: 1\n };\n $.each([\"borderLeftStyle\", \"borderRightStyle\", \"borderBottomStyle\", \"borderTopStyle\"], function (_, prop) {\n $.fx.step[prop] = function (fx) {\n if (fx.end !== \"none\" && !fx.setAttr || fx.pos === 1 && !fx.setAttr) {\n jQuery.style(fx.elem, prop, fx.end);\n fx.setAttr = true;\n }\n };\n });\n\n function getElementStyles(elem) {\n var key,\n len,\n style = elem.ownerDocument.defaultView ? elem.ownerDocument.defaultView.getComputedStyle(elem, null) : elem.currentStyle,\n styles = {};\n\n if (style && style.length && style[0] && style[style[0]]) {\n len = style.length;\n\n while (len--) {\n key = style[len];\n\n if (typeof style[key] === \"string\") {\n styles[$.camelCase(key)] = style[key];\n }\n } // Support: Opera, IE <9\n\n } else {\n for (key in style) {\n if (typeof style[key] === \"string\") {\n styles[key] = style[key];\n }\n }\n }\n\n return styles;\n }\n\n function styleDifference(oldStyle, newStyle) {\n var diff = {},\n name,\n value;\n\n for (name in newStyle) {\n value = newStyle[name];\n\n if (oldStyle[name] !== value) {\n if (!shorthandStyles[name]) {\n if ($.fx.step[name] || !isNaN(parseFloat(value))) {\n diff[name] = value;\n }\n }\n }\n }\n\n return diff;\n } // Support: jQuery <1.8\n\n\n if (!$.fn.addBack) {\n $.fn.addBack = function (selector) {\n return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));\n };\n }\n\n $.effects.animateClass = function (value, duration, easing, callback) {\n var o = $.speed(duration, easing, callback);\n return this.queue(function () {\n var animated = $(this),\n baseClass = animated.attr(\"class\") || \"\",\n applyClassChange,\n allAnimations = o.children ? animated.find(\"*\").addBack() : animated; // Map the animated objects to store the original styles.\n\n allAnimations = allAnimations.map(function () {\n var el = $(this);\n return {\n el: el,\n start: getElementStyles(this)\n };\n }); // Apply class change\n\n applyClassChange = function applyClassChange() {\n $.each(classAnimationActions, function (i, action) {\n if (value[action]) {\n animated[action + \"Class\"](value[action]);\n }\n });\n };\n\n applyClassChange(); // Map all animated objects again - calculate new styles and diff\n\n allAnimations = allAnimations.map(function () {\n this.end = getElementStyles(this.el[0]);\n this.diff = styleDifference(this.start, this.end);\n return this;\n }); // Apply original class\n\n animated.attr(\"class\", baseClass); // Map all animated objects again - this time collecting a promise\n\n allAnimations = allAnimations.map(function () {\n var styleInfo = this,\n dfd = $.Deferred(),\n opts = $.extend({}, o, {\n queue: false,\n complete: function complete() {\n dfd.resolve(styleInfo);\n }\n });\n this.el.animate(this.diff, opts);\n return dfd.promise();\n }); // Once all animations have completed:\n\n $.when.apply($, allAnimations.get()).done(function () {\n // Set the final class\n applyClassChange(); // For each animated element,\n // clear all css properties that were animated\n\n $.each(arguments, function () {\n var el = this.el;\n $.each(this.diff, function (key) {\n el.css(key, \"\");\n });\n }); // This is guarnteed to be there if you use jQuery.speed()\n // it also handles dequeuing the next anim...\n\n o.complete.call(animated[0]);\n });\n });\n };\n\n $.fn.extend({\n addClass: function (orig) {\n return function (classNames, speed, easing, callback) {\n return speed ? $.effects.animateClass.call(this, {\n add: classNames\n }, speed, easing, callback) : orig.apply(this, arguments);\n };\n }($.fn.addClass),\n removeClass: function (orig) {\n return function (classNames, speed, easing, callback) {\n return arguments.length > 1 ? $.effects.animateClass.call(this, {\n remove: classNames\n }, speed, easing, callback) : orig.apply(this, arguments);\n };\n }($.fn.removeClass),\n toggleClass: function (orig) {\n return function (classNames, force, speed, easing, callback) {\n if (typeof force === \"boolean\" || force === undefined) {\n if (!speed) {\n // Without speed parameter\n return orig.apply(this, arguments);\n } else {\n return $.effects.animateClass.call(this, force ? {\n add: classNames\n } : {\n remove: classNames\n }, speed, easing, callback);\n }\n } else {\n // Without force parameter\n return $.effects.animateClass.call(this, {\n toggle: classNames\n }, force, speed, easing);\n }\n };\n }($.fn.toggleClass),\n switchClass: function switchClass(remove, add, speed, easing, callback) {\n return $.effects.animateClass.call(this, {\n add: add,\n remove: remove\n }, speed, easing, callback);\n }\n });\n })();\n /******************************************************************************/\n\n /*********************************** EFFECTS **********************************/\n\n /******************************************************************************/\n\n\n (function () {\n if ($.expr && $.expr.filters && $.expr.filters.animated) {\n $.expr.filters.animated = function (orig) {\n return function (elem) {\n return !!$(elem).data(dataSpaceAnimated) || orig(elem);\n };\n }($.expr.filters.animated);\n }\n\n if ($.uiBackCompat !== false) {\n $.extend($.effects, {\n // Saves a set of properties in a data storage\n save: function save(element, set) {\n var i = 0,\n length = set.length;\n\n for (; i < length; i++) {\n if (set[i] !== null) {\n element.data(dataSpace + set[i], element[0].style[set[i]]);\n }\n }\n },\n // Restores a set of previously saved properties from a data storage\n restore: function restore(element, set) {\n var val,\n i = 0,\n length = set.length;\n\n for (; i < length; i++) {\n if (set[i] !== null) {\n val = element.data(dataSpace + set[i]);\n element.css(set[i], val);\n }\n }\n },\n setMode: function setMode(el, mode) {\n if (mode === \"toggle\") {\n mode = el.is(\":hidden\") ? \"show\" : \"hide\";\n }\n\n return mode;\n },\n // Wraps the element around a wrapper that copies position properties\n createWrapper: function createWrapper(element) {\n // If the element is already wrapped, return it\n if (element.parent().is(\".ui-effects-wrapper\")) {\n return element.parent();\n } // Wrap the element\n\n\n var props = {\n width: element.outerWidth(true),\n height: element.outerHeight(true),\n \"float\": element.css(\"float\")\n },\n wrapper = $(\"
\").addClass(\"ui-effects-wrapper\").css({\n fontSize: \"100%\",\n background: \"transparent\",\n border: \"none\",\n margin: 0,\n padding: 0\n }),\n // Store the size in case width/height are defined in % - Fixes #5245\n size = {\n width: element.width(),\n height: element.height()\n },\n active = document.activeElement; // Support: Firefox\n // Firefox incorrectly exposes anonymous content\n // https://bugzilla.mozilla.org/show_bug.cgi?id=561664\n\n try {\n active.id;\n } catch (e) {\n active = document.body;\n }\n\n element.wrap(wrapper); // Fixes #7595 - Elements lose focus when wrapped.\n\n if (element[0] === active || $.contains(element[0], active)) {\n $(active).trigger(\"focus\");\n } // Hotfix for jQuery 1.4 since some change in wrap() seems to actually\n // lose the reference to the wrapped element\n\n\n wrapper = element.parent(); // Transfer positioning properties to the wrapper\n\n if (element.css(\"position\") === \"static\") {\n wrapper.css({\n position: \"relative\"\n });\n element.css({\n position: \"relative\"\n });\n } else {\n $.extend(props, {\n position: element.css(\"position\"),\n zIndex: element.css(\"z-index\")\n });\n $.each([\"top\", \"left\", \"bottom\", \"right\"], function (i, pos) {\n props[pos] = element.css(pos);\n\n if (isNaN(parseInt(props[pos], 10))) {\n props[pos] = \"auto\";\n }\n });\n element.css({\n position: \"relative\",\n top: 0,\n left: 0,\n right: \"auto\",\n bottom: \"auto\"\n });\n }\n\n element.css(size);\n return wrapper.css(props).show();\n },\n removeWrapper: function removeWrapper(element) {\n var active = document.activeElement;\n\n if (element.parent().is(\".ui-effects-wrapper\")) {\n element.parent().replaceWith(element); // Fixes #7595 - Elements lose focus when wrapped.\n\n if (element[0] === active || $.contains(element[0], active)) {\n $(active).trigger(\"focus\");\n }\n }\n\n return element;\n }\n });\n }\n\n $.extend($.effects, {\n version: \"1.12.1\",\n define: function define(name, mode, effect) {\n if (!effect) {\n effect = mode;\n mode = \"effect\";\n }\n\n $.effects.effect[name] = effect;\n $.effects.effect[name].mode = mode;\n return effect;\n },\n scaledDimensions: function scaledDimensions(element, percent, direction) {\n if (percent === 0) {\n return {\n height: 0,\n width: 0,\n outerHeight: 0,\n outerWidth: 0\n };\n }\n\n var x = direction !== \"horizontal\" ? (percent || 100) / 100 : 1,\n y = direction !== \"vertical\" ? (percent || 100) / 100 : 1;\n return {\n height: element.height() * y,\n width: element.width() * x,\n outerHeight: element.outerHeight() * y,\n outerWidth: element.outerWidth() * x\n };\n },\n clipToBox: function clipToBox(animation) {\n return {\n width: animation.clip.right - animation.clip.left,\n height: animation.clip.bottom - animation.clip.top,\n left: animation.clip.left,\n top: animation.clip.top\n };\n },\n // Injects recently queued functions to be first in line (after \"inprogress\")\n unshift: function unshift(element, queueLength, count) {\n var queue = element.queue();\n\n if (queueLength > 1) {\n queue.splice.apply(queue, [1, 0].concat(queue.splice(queueLength, count)));\n }\n\n element.dequeue();\n },\n saveStyle: function saveStyle(element) {\n element.data(dataSpaceStyle, element[0].style.cssText);\n },\n restoreStyle: function restoreStyle(element) {\n element[0].style.cssText = element.data(dataSpaceStyle) || \"\";\n element.removeData(dataSpaceStyle);\n },\n mode: function mode(element, _mode) {\n var hidden = element.is(\":hidden\");\n\n if (_mode === \"toggle\") {\n _mode = hidden ? \"show\" : \"hide\";\n }\n\n if (hidden ? _mode === \"hide\" : _mode === \"show\") {\n _mode = \"none\";\n }\n\n return _mode;\n },\n // Translates a [top,left] array into a baseline value\n getBaseline: function getBaseline(origin, original) {\n var y, x;\n\n switch (origin[0]) {\n case \"top\":\n y = 0;\n break;\n\n case \"middle\":\n y = 0.5;\n break;\n\n case \"bottom\":\n y = 1;\n break;\n\n default:\n y = origin[0] / original.height;\n }\n\n switch (origin[1]) {\n case \"left\":\n x = 0;\n break;\n\n case \"center\":\n x = 0.5;\n break;\n\n case \"right\":\n x = 1;\n break;\n\n default:\n x = origin[1] / original.width;\n }\n\n return {\n x: x,\n y: y\n };\n },\n // Creates a placeholder element so that the original element can be made absolute\n createPlaceholder: function createPlaceholder(element) {\n var placeholder,\n cssPosition = element.css(\"position\"),\n position = element.position(); // Lock in margins first to account for form elements, which\n // will change margin if you explicitly set height\n // see: http://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380\n // Support: Safari\n\n element.css({\n marginTop: element.css(\"marginTop\"),\n marginBottom: element.css(\"marginBottom\"),\n marginLeft: element.css(\"marginLeft\"),\n marginRight: element.css(\"marginRight\")\n }).outerWidth(element.outerWidth()).outerHeight(element.outerHeight());\n\n if (/^(static|relative)/.test(cssPosition)) {\n cssPosition = \"absolute\";\n placeholder = $(\"<\" + element[0].nodeName + \">\").insertAfter(element).css({\n // Convert inline to inline block to account for inline elements\n // that turn to inline block based on content (like img)\n display: /^(inline|ruby)/.test(element.css(\"display\")) ? \"inline-block\" : \"block\",\n visibility: \"hidden\",\n // Margins need to be set to account for margin collapse\n marginTop: element.css(\"marginTop\"),\n marginBottom: element.css(\"marginBottom\"),\n marginLeft: element.css(\"marginLeft\"),\n marginRight: element.css(\"marginRight\"),\n \"float\": element.css(\"float\")\n }).outerWidth(element.outerWidth()).outerHeight(element.outerHeight()).addClass(\"ui-effects-placeholder\");\n element.data(dataSpace + \"placeholder\", placeholder);\n }\n\n element.css({\n position: cssPosition,\n left: position.left,\n top: position.top\n });\n return placeholder;\n },\n removePlaceholder: function removePlaceholder(element) {\n var dataKey = dataSpace + \"placeholder\",\n placeholder = element.data(dataKey);\n\n if (placeholder) {\n placeholder.remove();\n element.removeData(dataKey);\n }\n },\n // Removes a placeholder if it exists and restores\n // properties that were modified during placeholder creation\n cleanUp: function cleanUp(element) {\n $.effects.restoreStyle(element);\n $.effects.removePlaceholder(element);\n },\n setTransition: function setTransition(element, list, factor, value) {\n value = value || {};\n $.each(list, function (i, x) {\n var unit = element.cssUnit(x);\n\n if (unit[0] > 0) {\n value[x] = unit[0] * factor + unit[1];\n }\n });\n return value;\n }\n }); // Return an effect options object for the given parameters:\n\n function _normalizeArguments(effect, options, speed, callback) {\n // Allow passing all options as the first parameter\n if ($.isPlainObject(effect)) {\n options = effect;\n effect = effect.effect;\n } // Convert to an object\n\n\n effect = {\n effect: effect\n }; // Catch (effect, null, ...)\n\n if (options == null) {\n options = {};\n } // Catch (effect, callback)\n\n\n if ($.isFunction(options)) {\n callback = options;\n speed = null;\n options = {};\n } // Catch (effect, speed, ?)\n\n\n if (typeof options === \"number\" || $.fx.speeds[options]) {\n callback = speed;\n speed = options;\n options = {};\n } // Catch (effect, options, callback)\n\n\n if ($.isFunction(speed)) {\n callback = speed;\n speed = null;\n } // Add options to effect\n\n\n if (options) {\n $.extend(effect, options);\n }\n\n speed = speed || options.duration;\n effect.duration = $.fx.off ? 0 : typeof speed === \"number\" ? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default;\n effect.complete = callback || options.complete;\n return effect;\n }\n\n function standardAnimationOption(option) {\n // Valid standard speeds (nothing, number, named speed)\n if (!option || typeof option === \"number\" || $.fx.speeds[option]) {\n return true;\n } // Invalid strings - treat as \"normal\" speed\n\n\n if (typeof option === \"string\" && !$.effects.effect[option]) {\n return true;\n } // Complete callback\n\n\n if ($.isFunction(option)) {\n return true;\n } // Options hash (but not naming an effect)\n\n\n if (_typeof(option) === \"object\" && !option.effect) {\n return true;\n } // Didn't match any standard API\n\n\n return false;\n }\n\n $.fn.extend({\n effect: function effect()\n /* effect, options, speed, callback */\n {\n var args = _normalizeArguments.apply(this, arguments),\n effectMethod = $.effects.effect[args.effect],\n defaultMode = effectMethod.mode,\n queue = args.queue,\n queueName = queue || \"fx\",\n complete = args.complete,\n mode = args.mode,\n modes = [],\n prefilter = function prefilter(next) {\n var el = $(this),\n normalizedMode = $.effects.mode(el, mode) || defaultMode; // Sentinel for duck-punching the :animated psuedo-selector\n\n el.data(dataSpaceAnimated, true); // Save effect mode for later use,\n // we can't just call $.effects.mode again later,\n // as the .show() below destroys the initial state\n\n modes.push(normalizedMode); // See $.uiBackCompat inside of run() for removal of defaultMode in 1.13\n\n if (defaultMode && (normalizedMode === \"show\" || normalizedMode === defaultMode && normalizedMode === \"hide\")) {\n el.show();\n }\n\n if (!defaultMode || normalizedMode !== \"none\") {\n $.effects.saveStyle(el);\n }\n\n if ($.isFunction(next)) {\n next();\n }\n };\n\n if ($.fx.off || !effectMethod) {\n // Delegate to the original method (e.g., .show()) if possible\n if (mode) {\n return this[mode](args.duration, complete);\n } else {\n return this.each(function () {\n if (complete) {\n complete.call(this);\n }\n });\n }\n }\n\n function run(next) {\n var elem = $(this);\n\n function cleanup() {\n elem.removeData(dataSpaceAnimated);\n $.effects.cleanUp(elem);\n\n if (args.mode === \"hide\") {\n elem.hide();\n }\n\n done();\n }\n\n function done() {\n if ($.isFunction(complete)) {\n complete.call(elem[0]);\n }\n\n if ($.isFunction(next)) {\n next();\n }\n } // Override mode option on a per element basis,\n // as toggle can be either show or hide depending on element state\n\n\n args.mode = modes.shift();\n\n if ($.uiBackCompat !== false && !defaultMode) {\n if (elem.is(\":hidden\") ? mode === \"hide\" : mode === \"show\") {\n // Call the core method to track \"olddisplay\" properly\n elem[mode]();\n done();\n } else {\n effectMethod.call(elem[0], args, done);\n }\n } else {\n if (args.mode === \"none\") {\n // Call the core method to track \"olddisplay\" properly\n elem[mode]();\n done();\n } else {\n effectMethod.call(elem[0], args, cleanup);\n }\n }\n } // Run prefilter on all elements first to ensure that\n // any showing or hiding happens before placeholder creation,\n // which ensures that any layout changes are correctly captured.\n\n\n return queue === false ? this.each(prefilter).each(run) : this.queue(queueName, prefilter).queue(queueName, run);\n },\n show: function (orig) {\n return function (option) {\n if (standardAnimationOption(option)) {\n return orig.apply(this, arguments);\n } else {\n var args = _normalizeArguments.apply(this, arguments);\n\n args.mode = \"show\";\n return this.effect.call(this, args);\n }\n };\n }($.fn.show),\n hide: function (orig) {\n return function (option) {\n if (standardAnimationOption(option)) {\n return orig.apply(this, arguments);\n } else {\n var args = _normalizeArguments.apply(this, arguments);\n\n args.mode = \"hide\";\n return this.effect.call(this, args);\n }\n };\n }($.fn.hide),\n toggle: function (orig) {\n return function (option) {\n if (standardAnimationOption(option) || typeof option === \"boolean\") {\n return orig.apply(this, arguments);\n } else {\n var args = _normalizeArguments.apply(this, arguments);\n\n args.mode = \"toggle\";\n return this.effect.call(this, args);\n }\n };\n }($.fn.toggle),\n cssUnit: function cssUnit(key) {\n var style = this.css(key),\n val = [];\n $.each([\"em\", \"px\", \"%\", \"pt\"], function (i, unit) {\n if (style.indexOf(unit) > 0) {\n val = [parseFloat(style), unit];\n }\n });\n return val;\n },\n cssClip: function cssClip(clipObj) {\n if (clipObj) {\n return this.css(\"clip\", \"rect(\" + clipObj.top + \"px \" + clipObj.right + \"px \" + clipObj.bottom + \"px \" + clipObj.left + \"px)\");\n }\n\n return parseClip(this.css(\"clip\"), this);\n },\n transfer: function transfer(options, done) {\n var element = $(this),\n target = $(options.to),\n targetFixed = target.css(\"position\") === \"fixed\",\n body = $(\"body\"),\n fixTop = targetFixed ? body.scrollTop() : 0,\n fixLeft = targetFixed ? body.scrollLeft() : 0,\n endPosition = target.offset(),\n animation = {\n top: endPosition.top - fixTop,\n left: endPosition.left - fixLeft,\n height: target.innerHeight(),\n width: target.innerWidth()\n },\n startPosition = element.offset(),\n transfer = $(\"\").appendTo(\"body\").addClass(options.className).css({\n top: startPosition.top - fixTop,\n left: startPosition.left - fixLeft,\n height: element.innerHeight(),\n width: element.innerWidth(),\n position: targetFixed ? \"fixed\" : \"absolute\"\n }).animate(animation, options.duration, options.easing, function () {\n transfer.remove();\n\n if ($.isFunction(done)) {\n done();\n }\n });\n }\n });\n\n function parseClip(str, element) {\n var outerWidth = element.outerWidth(),\n outerHeight = element.outerHeight(),\n clipRegex = /^rect\\((-?\\d*\\.?\\d*px|-?\\d+%|auto),?\\s*(-?\\d*\\.?\\d*px|-?\\d+%|auto),?\\s*(-?\\d*\\.?\\d*px|-?\\d+%|auto),?\\s*(-?\\d*\\.?\\d*px|-?\\d+%|auto)\\)$/,\n values = clipRegex.exec(str) || [\"\", 0, outerWidth, outerHeight, 0];\n return {\n top: parseFloat(values[1]) || 0,\n right: values[2] === \"auto\" ? outerWidth : parseFloat(values[2]),\n bottom: values[3] === \"auto\" ? outerHeight : parseFloat(values[3]),\n left: parseFloat(values[4]) || 0\n };\n }\n\n $.fx.step.clip = function (fx) {\n if (!fx.clipInit) {\n fx.start = $(fx.elem).cssClip();\n\n if (typeof fx.end === \"string\") {\n fx.end = parseClip(fx.end, fx.elem);\n }\n\n fx.clipInit = true;\n }\n\n $(fx.elem).cssClip({\n top: fx.pos * (fx.end.top - fx.start.top) + fx.start.top,\n right: fx.pos * (fx.end.right - fx.start.right) + fx.start.right,\n bottom: fx.pos * (fx.end.bottom - fx.start.bottom) + fx.start.bottom,\n left: fx.pos * (fx.end.left - fx.start.left) + fx.start.left\n });\n };\n })();\n /******************************************************************************/\n\n /*********************************** EASING ***********************************/\n\n /******************************************************************************/\n\n\n (function () {\n // Based on easing equations from Robert Penner (http://www.robertpenner.com/easing)\n var baseEasings = {};\n $.each([\"Quad\", \"Cubic\", \"Quart\", \"Quint\", \"Expo\"], function (i, name) {\n baseEasings[name] = function (p) {\n return Math.pow(p, i + 2);\n };\n });\n $.extend(baseEasings, {\n Sine: function Sine(p) {\n return 1 - Math.cos(p * Math.PI / 2);\n },\n Circ: function Circ(p) {\n return 1 - Math.sqrt(1 - p * p);\n },\n Elastic: function Elastic(p) {\n return p === 0 || p === 1 ? p : -Math.pow(2, 8 * (p - 1)) * Math.sin(((p - 1) * 80 - 7.5) * Math.PI / 15);\n },\n Back: function Back(p) {\n return p * p * (3 * p - 2);\n },\n Bounce: function Bounce(p) {\n var pow2,\n bounce = 4;\n\n while (p < ((pow2 = Math.pow(2, --bounce)) - 1) / 11) {}\n\n return 1 / Math.pow(4, 3 - bounce) - 7.5625 * Math.pow((pow2 * 3 - 2) / 22 - p, 2);\n }\n });\n $.each(baseEasings, function (name, easeIn) {\n $.easing[\"easeIn\" + name] = easeIn;\n\n $.easing[\"easeOut\" + name] = function (p) {\n return 1 - easeIn(1 - p);\n };\n\n $.easing[\"easeInOut\" + name] = function (p) {\n return p < 0.5 ? easeIn(p * 2) / 2 : 1 - easeIn(p * -2 + 2) / 2;\n };\n });\n })();\n\n return $.effects;\n});","/*!\n * jQuery UI Touch Punch 0.2.3\n *\n * Copyright 2011–2014, Dave Furfero\n * Dual licensed under the MIT or GPL Version 2 licenses.\n *\n * Depends:\n * jquery.ui.widget.js\n * jquery.ui.mouse.js\n */\n(function ($) {\n // Detect touch support\n $.support.touch = 'ontouchend' in document; // Ignore browsers without touch support\n\n if (!$.support.touch) {\n return;\n }\n\n var mouseProto = $.ui.mouse.prototype,\n _mouseInit = mouseProto._mouseInit,\n _mouseDestroy = mouseProto._mouseDestroy,\n touchHandled;\n /**\n * Simulate a mouse event based on a corresponding touch event\n * @param {Object} event A touch event\n * @param {String} simulatedType The corresponding mouse event\n */\n\n function simulateMouseEvent(event, simulatedType) {\n // Ignore multi-touch events\n if (event.originalEvent.touches.length > 1) {\n return;\n }\n\n event.preventDefault();\n var touch = event.originalEvent.changedTouches[0],\n simulatedEvent = document.createEvent('MouseEvents'); // Initialize the simulated mouse event using the touch event's coordinates\n\n simulatedEvent.initMouseEvent(simulatedType, // type\n true, // bubbles \n true, // cancelable \n window, // view \n 1, // detail \n touch.screenX, // screenX \n touch.screenY, // screenY \n touch.clientX, // clientX \n touch.clientY, // clientY \n false, // ctrlKey \n false, // altKey \n false, // shiftKey \n false, // metaKey \n 0, // button \n null // relatedTarget \n ); // Dispatch the simulated event to the target element\n\n event.target.dispatchEvent(simulatedEvent);\n }\n /**\n * Handle the jQuery UI widget's touchstart events\n * @param {Object} event The widget element's touchstart event\n */\n\n\n mouseProto._touchStart = function (event) {\n var self = this; // Ignore the event if another widget is already being handled\n\n if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {\n return;\n } // Set the flag to prevent other widgets from inheriting the touch event\n\n\n touchHandled = true; // Track movement to determine if interaction was a click\n\n self._touchMoved = false; // Simulate the mouseover event\n\n simulateMouseEvent(event, 'mouseover'); // Simulate the mousemove event\n\n simulateMouseEvent(event, 'mousemove'); // Simulate the mousedown event\n\n simulateMouseEvent(event, 'mousedown');\n };\n /**\n * Handle the jQuery UI widget's touchmove events\n * @param {Object} event The document's touchmove event\n */\n\n\n mouseProto._touchMove = function (event) {\n // Ignore event if not handled\n if (!touchHandled) {\n return;\n } // Interaction was not a click\n\n\n this._touchMoved = true; // Simulate the mousemove event\n\n simulateMouseEvent(event, 'mousemove');\n };\n /**\n * Handle the jQuery UI widget's touchend events\n * @param {Object} event The document's touchend event\n */\n\n\n mouseProto._touchEnd = function (event) {\n // Ignore event if not handled\n if (!touchHandled) {\n return;\n } // Simulate the mouseup event\n\n\n simulateMouseEvent(event, 'mouseup'); // Simulate the mouseout event\n\n simulateMouseEvent(event, 'mouseout'); // If the touch interaction did not move, it should trigger a click\n\n if (!this._touchMoved) {\n // Simulate the click event\n simulateMouseEvent(event, 'click');\n } // Unset the flag to allow other widgets to inherit the touch event\n\n\n touchHandled = false;\n };\n /**\n * A duck punch of the $.ui.mouse _mouseInit method to support touch events.\n * This method extends the widget with bound touch event handlers that\n * translate touch events to mouse events and pass them to the widget's\n * original mouse event handling methods.\n */\n\n\n mouseProto._mouseInit = function () {\n var self = this; // Delegate the touch handlers to the widget's element\n\n self.element.bind({\n touchstart: $.proxy(self, '_touchStart'),\n touchmove: $.proxy(self, '_touchMove'),\n touchend: $.proxy(self, '_touchEnd')\n }); // Call the original $.ui.mouse init method\n\n _mouseInit.call(self);\n };\n /**\n * Remove the touch event handlers\n */\n\n\n mouseProto._mouseDestroy = function () {\n var self = this; // Delegate the touch handlers to the widget's element\n\n self.element.unbind({\n touchstart: $.proxy(self, '_touchStart'),\n touchmove: $.proxy(self, '_touchMove'),\n touchend: $.proxy(self, '_touchEnd')\n }); // Call the original $.ui.mouse destroy method\n\n _mouseDestroy.call(self);\n };\n})(jQuery);","document.addEventListener('DOMContentLoaded', () =>\n $(\n '.admin-user-contributor-transfers-table .admin-user-contributor-transfers-table-pay-link'\n ).on('confirm:complete', function (e, answer) {\n if (answer) {\n $(this).addClass('disabled');\n }\n })\n);\n","const registerCopyButtonClickEvent = () => {\n const link = document.getElementById('copy-to-clipboard');\n\n if (link === null) {\n return;\n }\n\n const eventHandler = (e) => {\n e.preventDefault();\n e.stopPropagation();\n\n document.getElementById('copy-text').select();\n document.execCommand('copy');\n };\n\n link.addEventListener('click', eventHandler, { passive: false });\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n registerCopyButtonClickEvent();\n});\n","const copyLinkElement = document.getElementById('copy-link');\n\nif (copyLinkElement) {\n copyLinkElement.onclick = () => {\n document.getElementById('copy-text').select();\n document.execCommand('copy');\n };\n}\n","/*\n * decaffeinate suggestions:\n * DS102: Remove unnecessary code created because of implicit returns\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md\n */\n\nimport '../shared/bootstrap-datepicker';\n\n$(() => {\n $('.form-datepicker').datepicker({\n format: 'yyyy-mm-dd',\n weekStart: 1,\n language: 'ja',\n todayHighlight: true,\n });\n\n $('.set-one-month').click((e) => {\n const $currentInputGroup = $(e.currentTarget).parent().parent();\n return $currentInputGroup\n .find('.from-date')\n .val($('#one-month-date').text());\n });\n\n return $('.set-one-week').click((e) => {\n const $currentInputGroup = $(e.currentTarget).parent().parent();\n return $currentInputGroup\n .find('.from-date')\n .val($('#one-week-date').text());\n });\n});\n","/*!\n * Datepicker for Bootstrap v1.7.1 (https://github.com/uxsolutions/bootstrap-datepicker)\n *\n * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n */\n\n(function(factory){\n if (typeof define === \"function\" && define.amd) {\n define([\"jquery\"], factory);\n } else if (typeof exports === 'object') {\n factory(require('jquery'));\n } else {\n factory(jQuery);\n }\n}(function($, undefined){\n function UTCDate(){\n return new Date(Date.UTC.apply(Date, arguments));\n }\n function UTCToday(){\n var today = new Date();\n return UTCDate(today.getFullYear(), today.getMonth(), today.getDate());\n }\n function isUTCEquals(date1, date2) {\n return (\n date1.getUTCFullYear() === date2.getUTCFullYear() &&\n date1.getUTCMonth() === date2.getUTCMonth() &&\n date1.getUTCDate() === date2.getUTCDate()\n );\n }\n function alias(method, deprecationMsg){\n return function(){\n if (deprecationMsg !== undefined) {\n $.fn.datepicker.deprecated(deprecationMsg);\n }\n\n return this[method].apply(this, arguments);\n };\n }\n function isValidDate(d) {\n return d && !isNaN(d.getTime());\n }\n\n var DateArray = (function(){\n var extras = {\n get: function(i){\n return this.slice(i)[0];\n },\n contains: function(d){\n // Array.indexOf is not cross-browser;\n // $.inArray doesn't work with Dates\n var val = d && d.valueOf();\n for (var i=0, l=this.length; i < l; i++)\n // Use date arithmetic to allow dates with different times to match\n if (0 <= this[i].valueOf() - val && this[i].valueOf() - val < 1000*60*60*24)\n return i;\n return -1;\n },\n remove: function(i){\n this.splice(i,1);\n },\n replace: function(new_array){\n if (!new_array)\n return;\n if (!$.isArray(new_array))\n new_array = [new_array];\n this.clear();\n this.push.apply(this, new_array);\n },\n clear: function(){\n this.length = 0;\n },\n copy: function(){\n var a = new DateArray();\n a.replace(this);\n return a;\n }\n };\n\n return function(){\n var a = [];\n a.push.apply(a, arguments);\n $.extend(a, extras);\n return a;\n };\n })();\n\n\n // Picker object\n\n var Datepicker = function(element, options){\n $.data(element, 'datepicker', this);\n this._process_options(options);\n\n this.dates = new DateArray();\n this.viewDate = this.o.defaultViewDate;\n this.focusDate = null;\n\n this.element = $(element);\n this.isInput = this.element.is('input');\n this.inputField = this.isInput ? this.element : this.element.find('input');\n this.component = this.element.hasClass('date') ? this.element.find('.add-on, .input-group-addon, .btn') : false;\n if (this.component && this.component.length === 0)\n this.component = false;\n this.isInline = !this.component && this.element.is('div');\n\n this.picker = $(DPGlobal.template);\n\n // Checking templates and inserting\n if (this._check_template(this.o.templates.leftArrow)) {\n this.picker.find('.prev').html(this.o.templates.leftArrow);\n }\n\n if (this._check_template(this.o.templates.rightArrow)) {\n this.picker.find('.next').html(this.o.templates.rightArrow);\n }\n\n this._buildEvents();\n this._attachEvents();\n\n if (this.isInline){\n this.picker.addClass('datepicker-inline').appendTo(this.element);\n }\n else {\n this.picker.addClass('datepicker-dropdown dropdown-menu');\n }\n\n if (this.o.rtl){\n this.picker.addClass('datepicker-rtl');\n }\n\n if (this.o.calendarWeeks) {\n this.picker.find('.datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear')\n .attr('colspan', function(i, val){\n return Number(val) + 1;\n });\n }\n\n this._process_options({\n startDate: this._o.startDate,\n endDate: this._o.endDate,\n daysOfWeekDisabled: this.o.daysOfWeekDisabled,\n daysOfWeekHighlighted: this.o.daysOfWeekHighlighted,\n datesDisabled: this.o.datesDisabled\n });\n\n this._allow_update = false;\n this.setViewMode(this.o.startView);\n this._allow_update = true;\n\n this.fillDow();\n this.fillMonths();\n\n this.update();\n\n if (this.isInline){\n this.show();\n }\n };\n\n Datepicker.prototype = {\n constructor: Datepicker,\n\n _resolveViewName: function(view){\n $.each(DPGlobal.viewModes, function(i, viewMode){\n if (view === i || $.inArray(view, viewMode.names) !== -1){\n view = i;\n return false;\n }\n });\n\n return view;\n },\n\n _resolveDaysOfWeek: function(daysOfWeek){\n if (!$.isArray(daysOfWeek))\n daysOfWeek = daysOfWeek.split(/[,\\s]*/);\n return $.map(daysOfWeek, Number);\n },\n\n _check_template: function(tmp){\n try {\n // If empty\n if (tmp === undefined || tmp === \"\") {\n return false;\n }\n // If no html, everything ok\n if ((tmp.match(/[<>]/g) || []).length <= 0) {\n return true;\n }\n // Checking if html is fine\n var jDom = $(tmp);\n return jDom.length > 0;\n }\n catch (ex) {\n return false;\n }\n },\n\n _process_options: function(opts){\n // Store raw options for reference\n this._o = $.extend({}, this._o, opts);\n // Processed options\n var o = this.o = $.extend({}, this._o);\n\n // Check if \"de-DE\" style date is available, if not language should\n // fallback to 2 letter code eg \"de\"\n var lang = o.language;\n if (!dates[lang]){\n lang = lang.split('-')[0];\n if (!dates[lang])\n lang = defaults.language;\n }\n o.language = lang;\n\n // Retrieve view index from any aliases\n o.startView = this._resolveViewName(o.startView);\n o.minViewMode = this._resolveViewName(o.minViewMode);\n o.maxViewMode = this._resolveViewName(o.maxViewMode);\n\n // Check view is between min and max\n o.startView = Math.max(this.o.minViewMode, Math.min(this.o.maxViewMode, o.startView));\n\n // true, false, or Number > 0\n if (o.multidate !== true){\n o.multidate = Number(o.multidate) || false;\n if (o.multidate !== false)\n o.multidate = Math.max(0, o.multidate);\n }\n o.multidateSeparator = String(o.multidateSeparator);\n\n o.weekStart %= 7;\n o.weekEnd = (o.weekStart + 6) % 7;\n\n var format = DPGlobal.parseFormat(o.format);\n if (o.startDate !== -Infinity){\n if (!!o.startDate){\n if (o.startDate instanceof Date)\n o.startDate = this._local_to_utc(this._zero_time(o.startDate));\n else\n o.startDate = DPGlobal.parseDate(o.startDate, format, o.language, o.assumeNearbyYear);\n }\n else {\n o.startDate = -Infinity;\n }\n }\n if (o.endDate !== Infinity){\n if (!!o.endDate){\n if (o.endDate instanceof Date)\n o.endDate = this._local_to_utc(this._zero_time(o.endDate));\n else\n o.endDate = DPGlobal.parseDate(o.endDate, format, o.language, o.assumeNearbyYear);\n }\n else {\n o.endDate = Infinity;\n }\n }\n\n o.daysOfWeekDisabled = this._resolveDaysOfWeek(o.daysOfWeekDisabled||[]);\n o.daysOfWeekHighlighted = this._resolveDaysOfWeek(o.daysOfWeekHighlighted||[]);\n\n o.datesDisabled = o.datesDisabled||[];\n if (!$.isArray(o.datesDisabled)) {\n o.datesDisabled = o.datesDisabled.split(',');\n }\n o.datesDisabled = $.map(o.datesDisabled, function(d){\n return DPGlobal.parseDate(d, format, o.language, o.assumeNearbyYear);\n });\n\n var plc = String(o.orientation).toLowerCase().split(/\\s+/g),\n _plc = o.orientation.toLowerCase();\n plc = $.grep(plc, function(word){\n return /^auto|left|right|top|bottom$/.test(word);\n });\n o.orientation = {x: 'auto', y: 'auto'};\n if (!_plc || _plc === 'auto')\n ; // no action\n else if (plc.length === 1){\n switch (plc[0]){\n case 'top':\n case 'bottom':\n o.orientation.y = plc[0];\n break;\n case 'left':\n case 'right':\n o.orientation.x = plc[0];\n break;\n }\n }\n else {\n _plc = $.grep(plc, function(word){\n return /^left|right$/.test(word);\n });\n o.orientation.x = _plc[0] || 'auto';\n\n _plc = $.grep(plc, function(word){\n return /^top|bottom$/.test(word);\n });\n o.orientation.y = _plc[0] || 'auto';\n }\n if (o.defaultViewDate instanceof Date || typeof o.defaultViewDate === 'string') {\n o.defaultViewDate = DPGlobal.parseDate(o.defaultViewDate, format, o.language, o.assumeNearbyYear);\n } else if (o.defaultViewDate) {\n var year = o.defaultViewDate.year || new Date().getFullYear();\n var month = o.defaultViewDate.month || 0;\n var day = o.defaultViewDate.day || 1;\n o.defaultViewDate = UTCDate(year, month, day);\n } else {\n o.defaultViewDate = UTCToday();\n }\n },\n _events: [],\n _secondaryEvents: [],\n _applyEvents: function(evs){\n for (var i=0, el, ch, ev; i < evs.length; i++){\n el = evs[i][0];\n if (evs[i].length === 2){\n ch = undefined;\n ev = evs[i][1];\n } else if (evs[i].length === 3){\n ch = evs[i][1];\n ev = evs[i][2];\n }\n el.on(ev, ch);\n }\n },\n _unapplyEvents: function(evs){\n for (var i=0, el, ev, ch; i < evs.length; i++){\n el = evs[i][0];\n if (evs[i].length === 2){\n ch = undefined;\n ev = evs[i][1];\n } else if (evs[i].length === 3){\n ch = evs[i][1];\n ev = evs[i][2];\n }\n el.off(ev, ch);\n }\n },\n _buildEvents: function(){\n var events = {\n keyup: $.proxy(function(e){\n if ($.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) === -1)\n this.update();\n }, this),\n keydown: $.proxy(this.keydown, this),\n paste: $.proxy(this.paste, this)\n };\n\n if (this.o.showOnFocus === true) {\n events.focus = $.proxy(this.show, this);\n }\n\n if (this.isInput) { // single input\n this._events = [\n [this.element, events]\n ];\n }\n // component: input + button\n else if (this.component && this.inputField.length) {\n this._events = [\n // For components that are not readonly, allow keyboard nav\n [this.inputField, events],\n [this.component, {\n click: $.proxy(this.show, this)\n }]\n ];\n }\n else {\n this._events = [\n [this.element, {\n click: $.proxy(this.show, this),\n keydown: $.proxy(this.keydown, this)\n }]\n ];\n }\n this._events.push(\n // Component: listen for blur on element descendants\n [this.element, '*', {\n blur: $.proxy(function(e){\n this._focused_from = e.target;\n }, this)\n }],\n // Input: listen for blur on element\n [this.element, {\n blur: $.proxy(function(e){\n this._focused_from = e.target;\n }, this)\n }]\n );\n\n if (this.o.immediateUpdates) {\n // Trigger input updates immediately on changed year/month\n this._events.push([this.element, {\n 'changeYear changeMonth': $.proxy(function(e){\n this.update(e.date);\n }, this)\n }]);\n }\n\n this._secondaryEvents = [\n [this.picker, {\n click: $.proxy(this.click, this)\n }],\n [this.picker, '.prev, .next', {\n click: $.proxy(this.navArrowsClick, this)\n }],\n [this.picker, '.day:not(.disabled)', {\n click: $.proxy(this.dayCellClick, this)\n }],\n [$(window), {\n resize: $.proxy(this.place, this)\n }],\n [$(document), {\n 'mousedown touchstart': $.proxy(function(e){\n // Clicked outside the datepicker, hide it\n if (!(\n this.element.is(e.target) ||\n this.element.find(e.target).length ||\n this.picker.is(e.target) ||\n this.picker.find(e.target).length ||\n this.isInline\n )){\n this.hide();\n }\n }, this)\n }]\n ];\n },\n _attachEvents: function(){\n this._detachEvents();\n this._applyEvents(this._events);\n },\n _detachEvents: function(){\n this._unapplyEvents(this._events);\n },\n _attachSecondaryEvents: function(){\n this._detachSecondaryEvents();\n this._applyEvents(this._secondaryEvents);\n },\n _detachSecondaryEvents: function(){\n this._unapplyEvents(this._secondaryEvents);\n },\n _trigger: function(event, altdate){\n var date = altdate || this.dates.get(-1),\n local_date = this._utc_to_local(date);\n\n this.element.trigger({\n type: event,\n date: local_date,\n viewMode: this.viewMode,\n dates: $.map(this.dates, this._utc_to_local),\n format: $.proxy(function(ix, format){\n if (arguments.length === 0){\n ix = this.dates.length - 1;\n format = this.o.format;\n } else if (typeof ix === 'string'){\n format = ix;\n ix = this.dates.length - 1;\n }\n format = format || this.o.format;\n var date = this.dates.get(ix);\n return DPGlobal.formatDate(date, format, this.o.language);\n }, this)\n });\n },\n\n show: function(){\n if (this.inputField.prop('disabled') || (this.inputField.prop('readonly') && this.o.enableOnReadonly === false))\n return;\n if (!this.isInline)\n this.picker.appendTo(this.o.container);\n this.place();\n this.picker.show();\n this._attachSecondaryEvents();\n this._trigger('show');\n if ((window.navigator.msMaxTouchPoints || 'ontouchstart' in document) && this.o.disableTouchKeyboard) {\n $(this.element).blur();\n }\n return this;\n },\n\n hide: function(){\n if (this.isInline || !this.picker.is(':visible'))\n return this;\n this.focusDate = null;\n this.picker.hide().detach();\n this._detachSecondaryEvents();\n this.setViewMode(this.o.startView);\n\n if (this.o.forceParse && this.inputField.val())\n this.setValue();\n this._trigger('hide');\n return this;\n },\n\n destroy: function(){\n this.hide();\n this._detachEvents();\n this._detachSecondaryEvents();\n this.picker.remove();\n delete this.element.data().datepicker;\n if (!this.isInput){\n delete this.element.data().date;\n }\n return this;\n },\n\n paste: function(e){\n var dateString;\n if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.types\n && $.inArray('text/plain', e.originalEvent.clipboardData.types) !== -1) {\n dateString = e.originalEvent.clipboardData.getData('text/plain');\n } else if (window.clipboardData) {\n dateString = window.clipboardData.getData('Text');\n } else {\n return;\n }\n this.setDate(dateString);\n this.update();\n e.preventDefault();\n },\n\n _utc_to_local: function(utc){\n if (!utc) {\n return utc;\n }\n\n var local = new Date(utc.getTime() + (utc.getTimezoneOffset() * 60000));\n\n if (local.getTimezoneOffset() !== utc.getTimezoneOffset()) {\n local = new Date(utc.getTime() + (local.getTimezoneOffset() * 60000));\n }\n\n return local;\n },\n _local_to_utc: function(local){\n return local && new Date(local.getTime() - (local.getTimezoneOffset()*60000));\n },\n _zero_time: function(local){\n return local && new Date(local.getFullYear(), local.getMonth(), local.getDate());\n },\n _zero_utc_time: function(utc){\n return utc && UTCDate(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate());\n },\n\n getDates: function(){\n return $.map(this.dates, this._utc_to_local);\n },\n\n getUTCDates: function(){\n return $.map(this.dates, function(d){\n return new Date(d);\n });\n },\n\n getDate: function(){\n return this._utc_to_local(this.getUTCDate());\n },\n\n getUTCDate: function(){\n var selected_date = this.dates.get(-1);\n if (selected_date !== undefined) {\n return new Date(selected_date);\n } else {\n return null;\n }\n },\n\n clearDates: function(){\n this.inputField.val('');\n this.update();\n this._trigger('changeDate');\n\n if (this.o.autoclose) {\n this.hide();\n }\n },\n\n setDates: function(){\n var args = $.isArray(arguments[0]) ? arguments[0] : arguments;\n this.update.apply(this, args);\n this._trigger('changeDate');\n this.setValue();\n return this;\n },\n\n setUTCDates: function(){\n var args = $.isArray(arguments[0]) ? arguments[0] : arguments;\n this.setDates.apply(this, $.map(args, this._utc_to_local));\n return this;\n },\n\n setDate: alias('setDates'),\n setUTCDate: alias('setUTCDates'),\n remove: alias('destroy', 'Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead'),\n\n setValue: function(){\n var formatted = this.getFormattedDate();\n this.inputField.val(formatted);\n return this;\n },\n\n getFormattedDate: function(format){\n if (format === undefined)\n format = this.o.format;\n\n var lang = this.o.language;\n return $.map(this.dates, function(d){\n return DPGlobal.formatDate(d, format, lang);\n }).join(this.o.multidateSeparator);\n },\n\n getStartDate: function(){\n return this.o.startDate;\n },\n\n setStartDate: function(startDate){\n this._process_options({startDate: startDate});\n this.update();\n this.updateNavArrows();\n return this;\n },\n\n getEndDate: function(){\n return this.o.endDate;\n },\n\n setEndDate: function(endDate){\n this._process_options({endDate: endDate});\n this.update();\n this.updateNavArrows();\n return this;\n },\n\n setDaysOfWeekDisabled: function(daysOfWeekDisabled){\n this._process_options({daysOfWeekDisabled: daysOfWeekDisabled});\n this.update();\n return this;\n },\n\n setDaysOfWeekHighlighted: function(daysOfWeekHighlighted){\n this._process_options({daysOfWeekHighlighted: daysOfWeekHighlighted});\n this.update();\n return this;\n },\n\n setDatesDisabled: function(datesDisabled){\n this._process_options({datesDisabled: datesDisabled});\n this.update();\n return this;\n },\n\n place: function(){\n if (this.isInline)\n return this;\n var calendarWidth = this.picker.outerWidth(),\n calendarHeight = this.picker.outerHeight(),\n visualPadding = 10,\n container = $(this.o.container),\n windowWidth = container.width(),\n scrollTop = this.o.container === 'body' ? $(document).scrollTop() : container.scrollTop(),\n appendOffset = container.offset();\n\n var parentsZindex = [0];\n this.element.parents().each(function(){\n var itemZIndex = $(this).css('z-index');\n if (itemZIndex !== 'auto' && Number(itemZIndex) !== 0) parentsZindex.push(Number(itemZIndex));\n });\n var zIndex = Math.max.apply(Math, parentsZindex) + this.o.zIndexOffset;\n var offset = this.component ? this.component.parent().offset() : this.element.offset();\n var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false);\n var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false);\n var left = offset.left - appendOffset.left;\n var top = offset.top - appendOffset.top;\n\n if (this.o.container !== 'body') {\n top += scrollTop;\n }\n\n this.picker.removeClass(\n 'datepicker-orient-top datepicker-orient-bottom '+\n 'datepicker-orient-right datepicker-orient-left'\n );\n\n if (this.o.orientation.x !== 'auto'){\n this.picker.addClass('datepicker-orient-' + this.o.orientation.x);\n if (this.o.orientation.x === 'right')\n left -= calendarWidth - width;\n }\n // auto x orientation is best-placement: if it crosses a window\n // edge, fudge it sideways\n else {\n if (offset.left < 0) {\n // component is outside the window on the left side. Move it into visible range\n this.picker.addClass('datepicker-orient-left');\n left -= offset.left - visualPadding;\n } else if (left + calendarWidth > windowWidth) {\n // the calendar passes the widow right edge. Align it to component right side\n this.picker.addClass('datepicker-orient-right');\n left += width - calendarWidth;\n } else {\n if (this.o.rtl) {\n // Default to right\n this.picker.addClass('datepicker-orient-right');\n } else {\n // Default to left\n this.picker.addClass('datepicker-orient-left');\n }\n }\n }\n\n // auto y orientation is best-situation: top or bottom, no fudging,\n // decision based on which shows more of the calendar\n var yorient = this.o.orientation.y,\n top_overflow;\n if (yorient === 'auto'){\n top_overflow = -scrollTop + top - calendarHeight;\n yorient = top_overflow < 0 ? 'bottom' : 'top';\n }\n\n this.picker.addClass('datepicker-orient-' + yorient);\n if (yorient === 'top')\n top -= calendarHeight + parseInt(this.picker.css('padding-top'));\n else\n top += height;\n\n if (this.o.rtl) {\n var right = windowWidth - (left + width);\n this.picker.css({\n top: top,\n right: right,\n zIndex: zIndex\n });\n } else {\n this.picker.css({\n top: top,\n left: left,\n zIndex: zIndex\n });\n }\n return this;\n },\n\n _allow_update: true,\n update: function(){\n if (!this._allow_update)\n return this;\n\n var oldDates = this.dates.copy(),\n dates = [],\n fromArgs = false;\n if (arguments.length){\n $.each(arguments, $.proxy(function(i, date){\n if (date instanceof Date)\n date = this._local_to_utc(date);\n dates.push(date);\n }, this));\n fromArgs = true;\n } else {\n dates = this.isInput\n ? this.element.val()\n : this.element.data('date') || this.inputField.val();\n if (dates && this.o.multidate)\n dates = dates.split(this.o.multidateSeparator);\n else\n dates = [dates];\n delete this.element.data().date;\n }\n\n dates = $.map(dates, $.proxy(function(date){\n return DPGlobal.parseDate(date, this.o.format, this.o.language, this.o.assumeNearbyYear);\n }, this));\n dates = $.grep(dates, $.proxy(function(date){\n return (\n !this.dateWithinRange(date) ||\n !date\n );\n }, this), true);\n this.dates.replace(dates);\n\n if (this.o.updateViewDate) {\n if (this.dates.length)\n this.viewDate = new Date(this.dates.get(-1));\n else if (this.viewDate < this.o.startDate)\n this.viewDate = new Date(this.o.startDate);\n else if (this.viewDate > this.o.endDate)\n this.viewDate = new Date(this.o.endDate);\n else\n this.viewDate = this.o.defaultViewDate;\n }\n\n if (fromArgs){\n // setting date by clicking\n this.setValue();\n this.element.change();\n }\n else if (this.dates.length){\n // setting date by typing\n if (String(oldDates) !== String(this.dates) && fromArgs) {\n this._trigger('changeDate');\n this.element.change();\n }\n }\n if (!this.dates.length && oldDates.length) {\n this._trigger('clearDate');\n this.element.change();\n }\n\n this.fill();\n return this;\n },\n\n fillDow: function(){\n if (this.o.showWeekDays) {\n var dowCnt = this.o.weekStart,\n html = '
';\n if (this.o.calendarWeeks){\n html += ' | ';\n }\n while (dowCnt < this.o.weekStart + 7){\n html += ''+dates[this.o.language].daysMin[(dowCnt++)%7]+' | ';\n }\n html += '
';\n this.picker.find('.datepicker-days thead').append(html);\n }\n },\n\n fillMonths: function(){\n var localDate = this._utc_to_local(this.viewDate);\n var html = '';\n var focused;\n for (var i = 0; i < 12; i++){\n focused = localDate && localDate.getMonth() === i ? ' focused' : '';\n html += '' + dates[this.o.language].monthsShort[i] + '';\n }\n this.picker.find('.datepicker-months td').html(html);\n },\n\n setRange: function(range){\n if (!range || !range.length)\n delete this.range;\n else\n this.range = $.map(range, function(d){\n return d.valueOf();\n });\n this.fill();\n },\n\n getClassNames: function(date){\n var cls = [],\n year = this.viewDate.getUTCFullYear(),\n month = this.viewDate.getUTCMonth(),\n today = UTCToday();\n if (date.getUTCFullYear() < year || (date.getUTCFullYear() === year && date.getUTCMonth() < month)){\n cls.push('old');\n } else if (date.getUTCFullYear() > year || (date.getUTCFullYear() === year && date.getUTCMonth() > month)){\n cls.push('new');\n }\n if (this.focusDate && date.valueOf() === this.focusDate.valueOf())\n cls.push('focused');\n // Compare internal UTC date with UTC today, not local today\n if (this.o.todayHighlight && isUTCEquals(date, today)) {\n cls.push('today');\n }\n if (this.dates.contains(date) !== -1)\n cls.push('active');\n if (!this.dateWithinRange(date)){\n cls.push('disabled');\n }\n if (this.dateIsDisabled(date)){\n cls.push('disabled', 'disabled-date');\n }\n if ($.inArray(date.getUTCDay(), this.o.daysOfWeekHighlighted) !== -1){\n cls.push('highlighted');\n }\n\n if (this.range){\n if (date > this.range[0] && date < this.range[this.range.length-1]){\n cls.push('range');\n }\n if ($.inArray(date.valueOf(), this.range) !== -1){\n cls.push('selected');\n }\n if (date.valueOf() === this.range[0]){\n cls.push('range-start');\n }\n if (date.valueOf() === this.range[this.range.length-1]){\n cls.push('range-end');\n }\n }\n return cls;\n },\n\n _fill_yearsView: function(selector, cssClass, factor, year, startYear, endYear, beforeFn){\n var html = '';\n var step = factor / 10;\n var view = this.picker.find(selector);\n var startVal = Math.floor(year / factor) * factor;\n var endVal = startVal + step * 9;\n var focusedVal = Math.floor(this.viewDate.getFullYear() / step) * step;\n var selected = $.map(this.dates, function(d){\n return Math.floor(d.getUTCFullYear() / step) * step;\n });\n\n var classes, tooltip, before;\n for (var currVal = startVal - step; currVal <= endVal + step; currVal += step) {\n classes = [cssClass];\n tooltip = null;\n\n if (currVal === startVal - step) {\n classes.push('old');\n } else if (currVal === endVal + step) {\n classes.push('new');\n }\n if ($.inArray(currVal, selected) !== -1) {\n classes.push('active');\n }\n if (currVal < startYear || currVal > endYear) {\n classes.push('disabled');\n }\n if (currVal === focusedVal) {\n classes.push('focused');\n }\n\n if (beforeFn !== $.noop) {\n before = beforeFn(new Date(currVal, 0, 1));\n if (before === undefined) {\n before = {};\n } else if (typeof before === 'boolean') {\n before = {enabled: before};\n } else if (typeof before === 'string') {\n before = {classes: before};\n }\n if (before.enabled === false) {\n classes.push('disabled');\n }\n if (before.classes) {\n classes = classes.concat(before.classes.split(/\\s+/));\n }\n if (before.tooltip) {\n tooltip = before.tooltip;\n }\n }\n\n html += '' + currVal + '';\n }\n\n view.find('.datepicker-switch').text(startVal + '-' + endVal);\n view.find('td').html(html);\n },\n\n fill: function(){\n var d = new Date(this.viewDate),\n year = d.getUTCFullYear(),\n month = d.getUTCMonth(),\n startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,\n startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,\n endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,\n endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,\n todaytxt = dates[this.o.language].today || dates['en'].today || '',\n cleartxt = dates[this.o.language].clear || dates['en'].clear || '',\n titleFormat = dates[this.o.language].titleFormat || dates['en'].titleFormat,\n tooltip,\n before;\n if (isNaN(year) || isNaN(month))\n return;\n this.picker.find('.datepicker-days .datepicker-switch')\n .text(DPGlobal.formatDate(d, titleFormat, this.o.language));\n this.picker.find('tfoot .today')\n .text(todaytxt)\n .css('display', this.o.todayBtn === true || this.o.todayBtn === 'linked' ? 'table-cell' : 'none');\n this.picker.find('tfoot .clear')\n .text(cleartxt)\n .css('display', this.o.clearBtn === true ? 'table-cell' : 'none');\n this.picker.find('thead .datepicker-title')\n .text(this.o.title)\n .css('display', typeof this.o.title === 'string' && this.o.title !== '' ? 'table-cell' : 'none');\n this.updateNavArrows();\n this.fillMonths();\n var prevMonth = UTCDate(year, month, 0),\n day = prevMonth.getUTCDate();\n prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7);\n var nextMonth = new Date(prevMonth);\n if (prevMonth.getUTCFullYear() < 100){\n nextMonth.setUTCFullYear(prevMonth.getUTCFullYear());\n }\n nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);\n nextMonth = nextMonth.valueOf();\n var html = [];\n var weekDay, clsName;\n while (prevMonth.valueOf() < nextMonth){\n weekDay = prevMonth.getUTCDay();\n if (weekDay === this.o.weekStart){\n html.push('');\n if (this.o.calendarWeeks){\n // ISO 8601: First week contains first thursday.\n // ISO also states week starts on Monday, but we can be more abstract here.\n var\n // Start of current week: based on weekstart/current date\n ws = new Date(+prevMonth + (this.o.weekStart - weekDay - 7) % 7 * 864e5),\n // Thursday of this week\n th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5),\n // First Thursday of year, year from thursday\n yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay()) % 7 * 864e5),\n // Calendar week: ms between thursdays, div ms per day, div 7 days\n calWeek = (th - yth) / 864e5 / 7 + 1;\n html.push(''+ calWeek +' | ');\n }\n }\n clsName = this.getClassNames(prevMonth);\n clsName.push('day');\n\n var content = prevMonth.getUTCDate();\n\n if (this.o.beforeShowDay !== $.noop){\n before = this.o.beforeShowDay(this._utc_to_local(prevMonth));\n if (before === undefined)\n before = {};\n else if (typeof before === 'boolean')\n before = {enabled: before};\n else if (typeof before === 'string')\n before = {classes: before};\n if (before.enabled === false)\n clsName.push('disabled');\n if (before.classes)\n clsName = clsName.concat(before.classes.split(/\\s+/));\n if (before.tooltip)\n tooltip = before.tooltip;\n if (before.content)\n content = before.content;\n }\n\n //Check if uniqueSort exists (supported by jquery >=1.12 and >=2.2)\n //Fallback to unique function for older jquery versions\n if ($.isFunction($.uniqueSort)) {\n clsName = $.uniqueSort(clsName);\n } else {\n clsName = $.unique(clsName);\n }\n\n html.push('' + content + ' | ');\n tooltip = null;\n if (weekDay === this.o.weekEnd){\n html.push('
');\n }\n prevMonth.setUTCDate(prevMonth.getUTCDate() + 1);\n }\n this.picker.find('.datepicker-days tbody').html(html.join(''));\n\n var monthsTitle = dates[this.o.language].monthsTitle || dates['en'].monthsTitle || 'Months';\n var months = this.picker.find('.datepicker-months')\n .find('.datepicker-switch')\n .text(this.o.maxViewMode < 2 ? monthsTitle : year)\n .end()\n .find('tbody span').removeClass('active');\n\n $.each(this.dates, function(i, d){\n if (d.getUTCFullYear() === year)\n months.eq(d.getUTCMonth()).addClass('active');\n });\n\n if (year < startYear || year > endYear){\n months.addClass('disabled');\n }\n if (year === startYear){\n months.slice(0, startMonth).addClass('disabled');\n }\n if (year === endYear){\n months.slice(endMonth+1).addClass('disabled');\n }\n\n if (this.o.beforeShowMonth !== $.noop){\n var that = this;\n $.each(months, function(i, month){\n var moDate = new Date(year, i, 1);\n var before = that.o.beforeShowMonth(moDate);\n if (before === undefined)\n before = {};\n else if (typeof before === 'boolean')\n before = {enabled: before};\n else if (typeof before === 'string')\n before = {classes: before};\n if (before.enabled === false && !$(month).hasClass('disabled'))\n $(month).addClass('disabled');\n if (before.classes)\n $(month).addClass(before.classes);\n if (before.tooltip)\n $(month).prop('title', before.tooltip);\n });\n }\n\n // Generating decade/years picker\n this._fill_yearsView(\n '.datepicker-years',\n 'year',\n 10,\n year,\n startYear,\n endYear,\n this.o.beforeShowYear\n );\n\n // Generating century/decades picker\n this._fill_yearsView(\n '.datepicker-decades',\n 'decade',\n 100,\n year,\n startYear,\n endYear,\n this.o.beforeShowDecade\n );\n\n // Generating millennium/centuries picker\n this._fill_yearsView(\n '.datepicker-centuries',\n 'century',\n 1000,\n year,\n startYear,\n endYear,\n this.o.beforeShowCentury\n );\n },\n\n updateNavArrows: function(){\n if (!this._allow_update)\n return;\n\n var d = new Date(this.viewDate),\n year = d.getUTCFullYear(),\n month = d.getUTCMonth(),\n startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,\n startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,\n endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,\n endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,\n prevIsDisabled,\n nextIsDisabled,\n factor = 1;\n switch (this.viewMode){\n case 0:\n prevIsDisabled = year <= startYear && month <= startMonth;\n nextIsDisabled = year >= endYear && month >= endMonth;\n break;\n case 4:\n factor *= 10;\n /* falls through */\n case 3:\n factor *= 10;\n /* falls through */\n case 2:\n factor *= 10;\n /* falls through */\n case 1:\n prevIsDisabled = Math.floor(year / factor) * factor <= startYear;\n nextIsDisabled = Math.floor(year / factor) * factor + factor >= endYear;\n break;\n }\n\n this.picker.find('.prev').toggleClass('disabled', prevIsDisabled);\n this.picker.find('.next').toggleClass('disabled', nextIsDisabled);\n },\n\n click: function(e){\n e.preventDefault();\n e.stopPropagation();\n\n var target, dir, day, year, month;\n target = $(e.target);\n\n // Clicked on the switch\n if (target.hasClass('datepicker-switch') && this.viewMode !== this.o.maxViewMode){\n this.setViewMode(this.viewMode + 1);\n }\n\n // Clicked on today button\n if (target.hasClass('today') && !target.hasClass('day')){\n this.setViewMode(0);\n this._setDate(UTCToday(), this.o.todayBtn === 'linked' ? null : 'view');\n }\n\n // Clicked on clear button\n if (target.hasClass('clear')){\n this.clearDates();\n }\n\n if (!target.hasClass('disabled')){\n // Clicked on a month, year, decade, century\n if (target.hasClass('month')\n || target.hasClass('year')\n || target.hasClass('decade')\n || target.hasClass('century')) {\n this.viewDate.setUTCDate(1);\n\n day = 1;\n if (this.viewMode === 1){\n month = target.parent().find('span').index(target);\n year = this.viewDate.getUTCFullYear();\n this.viewDate.setUTCMonth(month);\n } else {\n month = 0;\n year = Number(target.text());\n this.viewDate.setUTCFullYear(year);\n }\n\n this._trigger(DPGlobal.viewModes[this.viewMode - 1].e, this.viewDate);\n\n if (this.viewMode === this.o.minViewMode){\n this._setDate(UTCDate(year, month, day));\n } else {\n this.setViewMode(this.viewMode - 1);\n this.fill();\n }\n }\n }\n\n if (this.picker.is(':visible') && this._focused_from){\n this._focused_from.focus();\n }\n delete this._focused_from;\n },\n\n dayCellClick: function(e){\n var $target = $(e.currentTarget);\n var timestamp = $target.data('date');\n var date = new Date(timestamp);\n\n if (this.o.updateViewDate) {\n if (date.getUTCFullYear() !== this.viewDate.getUTCFullYear()) {\n this._trigger('changeYear', this.viewDate);\n }\n\n if (date.getUTCMonth() !== this.viewDate.getUTCMonth()) {\n this._trigger('changeMonth', this.viewDate);\n }\n }\n this._setDate(date);\n },\n\n // Clicked on prev or next\n navArrowsClick: function(e){\n var $target = $(e.currentTarget);\n var dir = $target.hasClass('prev') ? -1 : 1;\n if (this.viewMode !== 0){\n dir *= DPGlobal.viewModes[this.viewMode].navStep * 12;\n }\n this.viewDate = this.moveMonth(this.viewDate, dir);\n this._trigger(DPGlobal.viewModes[this.viewMode].e, this.viewDate);\n this.fill();\n },\n\n _toggle_multidate: function(date){\n var ix = this.dates.contains(date);\n if (!date){\n this.dates.clear();\n }\n\n if (ix !== -1){\n if (this.o.multidate === true || this.o.multidate > 1 || this.o.toggleActive){\n this.dates.remove(ix);\n }\n } else if (this.o.multidate === false) {\n this.dates.clear();\n this.dates.push(date);\n }\n else {\n this.dates.push(date);\n }\n\n if (typeof this.o.multidate === 'number')\n while (this.dates.length > this.o.multidate)\n this.dates.remove(0);\n },\n\n _setDate: function(date, which){\n if (!which || which === 'date')\n this._toggle_multidate(date && new Date(date));\n if ((!which && this.o.updateViewDate) || which === 'view')\n this.viewDate = date && new Date(date);\n\n this.fill();\n this.setValue();\n if (!which || which !== 'view') {\n this._trigger('changeDate');\n }\n this.inputField.trigger('change');\n if (this.o.autoclose && (!which || which === 'date')){\n this.hide();\n }\n },\n\n moveDay: function(date, dir){\n var newDate = new Date(date);\n newDate.setUTCDate(date.getUTCDate() + dir);\n\n return newDate;\n },\n\n moveWeek: function(date, dir){\n return this.moveDay(date, dir * 7);\n },\n\n moveMonth: function(date, dir){\n if (!isValidDate(date))\n return this.o.defaultViewDate;\n if (!dir)\n return date;\n var new_date = new Date(date.valueOf()),\n day = new_date.getUTCDate(),\n month = new_date.getUTCMonth(),\n mag = Math.abs(dir),\n new_month, test;\n dir = dir > 0 ? 1 : -1;\n if (mag === 1){\n test = dir === -1\n // If going back one month, make sure month is not current month\n // (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02)\n ? function(){\n return new_date.getUTCMonth() === month;\n }\n // If going forward one month, make sure month is as expected\n // (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02)\n : function(){\n return new_date.getUTCMonth() !== new_month;\n };\n new_month = month + dir;\n new_date.setUTCMonth(new_month);\n // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11\n new_month = (new_month + 12) % 12;\n }\n else {\n // For magnitudes >1, move one month at a time...\n for (var i=0; i < mag; i++)\n // ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...\n new_date = this.moveMonth(new_date, dir);\n // ...then reset the day, keeping it in the new month\n new_month = new_date.getUTCMonth();\n new_date.setUTCDate(day);\n test = function(){\n return new_month !== new_date.getUTCMonth();\n };\n }\n // Common date-resetting loop -- if date is beyond end of month, make it\n // end of month\n while (test()){\n new_date.setUTCDate(--day);\n new_date.setUTCMonth(new_month);\n }\n return new_date;\n },\n\n moveYear: function(date, dir){\n return this.moveMonth(date, dir*12);\n },\n\n moveAvailableDate: function(date, dir, fn){\n do {\n date = this[fn](date, dir);\n\n if (!this.dateWithinRange(date))\n return false;\n\n fn = 'moveDay';\n }\n while (this.dateIsDisabled(date));\n\n return date;\n },\n\n weekOfDateIsDisabled: function(date){\n return $.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1;\n },\n\n dateIsDisabled: function(date){\n return (\n this.weekOfDateIsDisabled(date) ||\n $.grep(this.o.datesDisabled, function(d){\n return isUTCEquals(date, d);\n }).length > 0\n );\n },\n\n dateWithinRange: function(date){\n return date >= this.o.startDate && date <= this.o.endDate;\n },\n\n keydown: function(e){\n if (!this.picker.is(':visible')){\n if (e.keyCode === 40 || e.keyCode === 27) { // allow down to re-show picker\n this.show();\n e.stopPropagation();\n }\n return;\n }\n var dateChanged = false,\n dir, newViewDate,\n focusDate = this.focusDate || this.viewDate;\n switch (e.keyCode){\n case 27: // escape\n if (this.focusDate){\n this.focusDate = null;\n this.viewDate = this.dates.get(-1) || this.viewDate;\n this.fill();\n }\n else\n this.hide();\n e.preventDefault();\n e.stopPropagation();\n break;\n case 37: // left\n case 38: // up\n case 39: // right\n case 40: // down\n if (!this.o.keyboardNavigation || this.o.daysOfWeekDisabled.length === 7)\n break;\n dir = e.keyCode === 37 || e.keyCode === 38 ? -1 : 1;\n if (this.viewMode === 0) {\n if (e.ctrlKey){\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear');\n\n if (newViewDate)\n this._trigger('changeYear', this.viewDate);\n } else if (e.shiftKey){\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth');\n\n if (newViewDate)\n this._trigger('changeMonth', this.viewDate);\n } else if (e.keyCode === 37 || e.keyCode === 39){\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveDay');\n } else if (!this.weekOfDateIsDisabled(focusDate)){\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveWeek');\n }\n } else if (this.viewMode === 1) {\n if (e.keyCode === 38 || e.keyCode === 40) {\n dir = dir * 4;\n }\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth');\n } else if (this.viewMode === 2) {\n if (e.keyCode === 38 || e.keyCode === 40) {\n dir = dir * 4;\n }\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear');\n }\n if (newViewDate){\n this.focusDate = this.viewDate = newViewDate;\n this.setValue();\n this.fill();\n e.preventDefault();\n }\n break;\n case 13: // enter\n if (!this.o.forceParse)\n break;\n focusDate = this.focusDate || this.dates.get(-1) || this.viewDate;\n if (this.o.keyboardNavigation) {\n this._toggle_multidate(focusDate);\n dateChanged = true;\n }\n this.focusDate = null;\n this.viewDate = this.dates.get(-1) || this.viewDate;\n this.setValue();\n this.fill();\n if (this.picker.is(':visible')){\n e.preventDefault();\n e.stopPropagation();\n if (this.o.autoclose)\n this.hide();\n }\n break;\n case 9: // tab\n this.focusDate = null;\n this.viewDate = this.dates.get(-1) || this.viewDate;\n this.fill();\n this.hide();\n break;\n }\n if (dateChanged){\n if (this.dates.length)\n this._trigger('changeDate');\n else\n this._trigger('clearDate');\n this.inputField.trigger('change');\n }\n },\n\n setViewMode: function(viewMode){\n this.viewMode = viewMode;\n this.picker\n .children('div')\n .hide()\n .filter('.datepicker-' + DPGlobal.viewModes[this.viewMode].clsName)\n .show();\n this.updateNavArrows();\n this._trigger('changeViewMode', new Date(this.viewDate));\n }\n };\n\n var DateRangePicker = function(element, options){\n $.data(element, 'datepicker', this);\n this.element = $(element);\n this.inputs = $.map(options.inputs, function(i){\n return i.jquery ? i[0] : i;\n });\n delete options.inputs;\n\n this.keepEmptyValues = options.keepEmptyValues;\n delete options.keepEmptyValues;\n\n datepickerPlugin.call($(this.inputs), options)\n .on('changeDate', $.proxy(this.dateUpdated, this));\n\n this.pickers = $.map(this.inputs, function(i){\n return $.data(i, 'datepicker');\n });\n this.updateDates();\n };\n DateRangePicker.prototype = {\n updateDates: function(){\n this.dates = $.map(this.pickers, function(i){\n return i.getUTCDate();\n });\n this.updateRanges();\n },\n updateRanges: function(){\n var range = $.map(this.dates, function(d){\n return d.valueOf();\n });\n $.each(this.pickers, function(i, p){\n p.setRange(range);\n });\n },\n dateUpdated: function(e){\n // `this.updating` is a workaround for preventing infinite recursion\n // between `changeDate` triggering and `setUTCDate` calling. Until\n // there is a better mechanism.\n if (this.updating)\n return;\n this.updating = true;\n\n var dp = $.data(e.target, 'datepicker');\n\n if (dp === undefined) {\n return;\n }\n\n var new_date = dp.getUTCDate(),\n keep_empty_values = this.keepEmptyValues,\n i = $.inArray(e.target, this.inputs),\n j = i - 1,\n k = i + 1,\n l = this.inputs.length;\n if (i === -1)\n return;\n\n $.each(this.pickers, function(i, p){\n if (!p.getUTCDate() && (p === dp || !keep_empty_values))\n p.setUTCDate(new_date);\n });\n\n if (new_date < this.dates[j]){\n // Date being moved earlier/left\n while (j >= 0 && new_date < this.dates[j]){\n this.pickers[j--].setUTCDate(new_date);\n }\n } else if (new_date > this.dates[k]){\n // Date being moved later/right\n while (k < l && new_date > this.dates[k]){\n this.pickers[k++].setUTCDate(new_date);\n }\n }\n this.updateDates();\n\n delete this.updating;\n },\n destroy: function(){\n $.map(this.pickers, function(p){ p.destroy(); });\n $(this.inputs).off('changeDate', this.dateUpdated);\n delete this.element.data().datepicker;\n },\n remove: alias('destroy', 'Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead')\n };\n\n function opts_from_el(el, prefix){\n // Derive options from element data-attrs\n var data = $(el).data(),\n out = {}, inkey,\n replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])');\n prefix = new RegExp('^' + prefix.toLowerCase());\n function re_lower(_,a){\n return a.toLowerCase();\n }\n for (var key in data)\n if (prefix.test(key)){\n inkey = key.replace(replace, re_lower);\n out[inkey] = data[key];\n }\n return out;\n }\n\n function opts_from_locale(lang){\n // Derive options from locale plugins\n var out = {};\n // Check if \"de-DE\" style date is available, if not language should\n // fallback to 2 letter code eg \"de\"\n if (!dates[lang]){\n lang = lang.split('-')[0];\n if (!dates[lang])\n return;\n }\n var d = dates[lang];\n $.each(locale_opts, function(i,k){\n if (k in d)\n out[k] = d[k];\n });\n return out;\n }\n\n var old = $.fn.datepicker;\n var datepickerPlugin = function(option){\n var args = Array.apply(null, arguments);\n args.shift();\n var internal_return;\n this.each(function(){\n var $this = $(this),\n data = $this.data('datepicker'),\n options = typeof option === 'object' && option;\n if (!data){\n var elopts = opts_from_el(this, 'date'),\n // Preliminary otions\n xopts = $.extend({}, defaults, elopts, options),\n locopts = opts_from_locale(xopts.language),\n // Options priority: js args, data-attrs, locales, defaults\n opts = $.extend({}, defaults, locopts, elopts, options);\n if ($this.hasClass('input-daterange') || opts.inputs){\n $.extend(opts, {\n inputs: opts.inputs || $this.find('input').toArray()\n });\n data = new DateRangePicker(this, opts);\n }\n else {\n data = new Datepicker(this, opts);\n }\n $this.data('datepicker', data);\n }\n if (typeof option === 'string' && typeof data[option] === 'function'){\n internal_return = data[option].apply(data, args);\n }\n });\n\n if (\n internal_return === undefined ||\n internal_return instanceof Datepicker ||\n internal_return instanceof DateRangePicker\n )\n return this;\n\n if (this.length > 1)\n throw new Error('Using only allowed for the collection of a single element (' + option + ' function)');\n else\n return internal_return;\n };\n $.fn.datepicker = datepickerPlugin;\n\n var defaults = $.fn.datepicker.defaults = {\n assumeNearbyYear: false,\n autoclose: false,\n beforeShowDay: $.noop,\n beforeShowMonth: $.noop,\n beforeShowYear: $.noop,\n beforeShowDecade: $.noop,\n beforeShowCentury: $.noop,\n calendarWeeks: false,\n clearBtn: false,\n toggleActive: false,\n daysOfWeekDisabled: [],\n daysOfWeekHighlighted: [],\n datesDisabled: [],\n endDate: Infinity,\n forceParse: true,\n format: 'mm/dd/yyyy',\n keepEmptyValues: false,\n keyboardNavigation: true,\n language: 'en',\n minViewMode: 0,\n maxViewMode: 4,\n multidate: false,\n multidateSeparator: ',',\n orientation: \"auto\",\n rtl: false,\n startDate: -Infinity,\n startView: 0,\n todayBtn: false,\n todayHighlight: false,\n updateViewDate: true,\n weekStart: 0,\n disableTouchKeyboard: false,\n enableOnReadonly: true,\n showOnFocus: true,\n zIndexOffset: 10,\n container: 'body',\n immediateUpdates: false,\n title: '',\n templates: {\n leftArrow: '«',\n rightArrow: '»'\n },\n showWeekDays: true\n };\n var locale_opts = $.fn.datepicker.locale_opts = [\n 'format',\n 'rtl',\n 'weekStart'\n ];\n $.fn.datepicker.Constructor = Datepicker;\n var dates = $.fn.datepicker.dates = {\n en: {\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n daysShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n daysMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n monthsShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n today: \"Today\",\n clear: \"Clear\",\n titleFormat: \"MM yyyy\"\n }\n };\n\n var DPGlobal = {\n viewModes: [\n {\n names: ['days', 'month'],\n clsName: 'days',\n e: 'changeMonth'\n },\n {\n names: ['months', 'year'],\n clsName: 'months',\n e: 'changeYear',\n navStep: 1\n },\n {\n names: ['years', 'decade'],\n clsName: 'years',\n e: 'changeDecade',\n navStep: 10\n },\n {\n names: ['decades', 'century'],\n clsName: 'decades',\n e: 'changeCentury',\n navStep: 100\n },\n {\n names: ['centuries', 'millennium'],\n clsName: 'centuries',\n e: 'changeMillennium',\n navStep: 1000\n }\n ],\n validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,\n nonpunctuation: /[^ -\\/:-@\\u5e74\\u6708\\u65e5\\[-`{-~\\t\\n\\r]+/g,\n parseFormat: function(format){\n if (typeof format.toValue === 'function' && typeof format.toDisplay === 'function')\n return format;\n // IE treats \\0 as a string end in inputs (truncating the value),\n // so it's a bad format delimiter, anyway\n var separators = format.replace(this.validParts, '\\0').split('\\0'),\n parts = format.match(this.validParts);\n if (!separators || !separators.length || !parts || parts.length === 0){\n throw new Error(\"Invalid date format.\");\n }\n return {separators: separators, parts: parts};\n },\n parseDate: function(date, format, language, assumeNearby){\n if (!date)\n return undefined;\n if (date instanceof Date)\n return date;\n if (typeof format === 'string')\n format = DPGlobal.parseFormat(format);\n if (format.toValue)\n return format.toValue(date, format, language);\n var fn_map = {\n d: 'moveDay',\n m: 'moveMonth',\n w: 'moveWeek',\n y: 'moveYear'\n },\n dateAliases = {\n yesterday: '-1d',\n today: '+0d',\n tomorrow: '+1d'\n },\n parts, part, dir, i, fn;\n if (date in dateAliases){\n date = dateAliases[date];\n }\n if (/^[\\-+]\\d+[dmwy]([\\s,]+[\\-+]\\d+[dmwy])*$/i.test(date)){\n parts = date.match(/([\\-+]\\d+)([dmwy])/gi);\n date = new Date();\n for (i=0; i < parts.length; i++){\n part = parts[i].match(/([\\-+]\\d+)([dmwy])/i);\n dir = Number(part[1]);\n fn = fn_map[part[2].toLowerCase()];\n date = Datepicker.prototype[fn](date, dir);\n }\n return Datepicker.prototype._zero_utc_time(date);\n }\n\n parts = date && date.match(this.nonpunctuation) || [];\n\n function applyNearbyYear(year, threshold){\n if (threshold === true)\n threshold = 10;\n\n // if year is 2 digits or less, than the user most likely is trying to get a recent century\n if (year < 100){\n year += 2000;\n // if the new year is more than threshold years in advance, use last century\n if (year > ((new Date()).getFullYear()+threshold)){\n year -= 100;\n }\n }\n\n return year;\n }\n\n var parsed = {},\n setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'],\n setters_map = {\n yyyy: function(d,v){\n return d.setUTCFullYear(assumeNearby ? applyNearbyYear(v, assumeNearby) : v);\n },\n m: function(d,v){\n if (isNaN(d))\n return d;\n v -= 1;\n while (v < 0) v += 12;\n v %= 12;\n d.setUTCMonth(v);\n while (d.getUTCMonth() !== v)\n d.setUTCDate(d.getUTCDate()-1);\n return d;\n },\n d: function(d,v){\n return d.setUTCDate(v);\n }\n },\n val, filtered;\n setters_map['yy'] = setters_map['yyyy'];\n setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];\n setters_map['dd'] = setters_map['d'];\n date = UTCToday();\n var fparts = format.parts.slice();\n // Remove noop parts\n if (parts.length !== fparts.length){\n fparts = $(fparts).filter(function(i,p){\n return $.inArray(p, setters_order) !== -1;\n }).toArray();\n }\n // Process remainder\n function match_part(){\n var m = this.slice(0, parts[i].length),\n p = parts[i].slice(0, m.length);\n return m.toLowerCase() === p.toLowerCase();\n }\n if (parts.length === fparts.length){\n var cnt;\n for (i=0, cnt = fparts.length; i < cnt; i++){\n val = parseInt(parts[i], 10);\n part = fparts[i];\n if (isNaN(val)){\n switch (part){\n case 'MM':\n filtered = $(dates[language].months).filter(match_part);\n val = $.inArray(filtered[0], dates[language].months) + 1;\n break;\n case 'M':\n filtered = $(dates[language].monthsShort).filter(match_part);\n val = $.inArray(filtered[0], dates[language].monthsShort) + 1;\n break;\n }\n }\n parsed[part] = val;\n }\n var _date, s;\n for (i=0; i < setters_order.length; i++){\n s = setters_order[i];\n if (s in parsed && !isNaN(parsed[s])){\n _date = new Date(date);\n setters_map[s](_date, parsed[s]);\n if (!isNaN(_date))\n date = _date;\n }\n }\n }\n return date;\n },\n formatDate: function(date, format, language){\n if (!date)\n return '';\n if (typeof format === 'string')\n format = DPGlobal.parseFormat(format);\n if (format.toDisplay)\n return format.toDisplay(date, format, language);\n var val = {\n d: date.getUTCDate(),\n D: dates[language].daysShort[date.getUTCDay()],\n DD: dates[language].days[date.getUTCDay()],\n m: date.getUTCMonth() + 1,\n M: dates[language].monthsShort[date.getUTCMonth()],\n MM: dates[language].months[date.getUTCMonth()],\n yy: date.getUTCFullYear().toString().substring(2),\n yyyy: date.getUTCFullYear()\n };\n val.dd = (val.d < 10 ? '0' : '') + val.d;\n val.mm = (val.m < 10 ? '0' : '') + val.m;\n date = [];\n var seps = $.extend([], format.separators);\n for (var i=0, cnt = format.parts.length; i <= cnt; i++){\n if (seps.length)\n date.push(seps.shift());\n date.push(val[format.parts[i]]);\n }\n return date.join('');\n },\n headTemplate: ''+\n ''+\n ' | '+\n '
'+\n ''+\n ''+defaults.templates.leftArrow+' | '+\n ' | '+\n ''+defaults.templates.rightArrow+' | '+\n '
'+\n '',\n contTemplate: ' |
',\n footTemplate: ''+\n ''+\n ' | '+\n '
'+\n ''+\n ' | '+\n '
'+\n ''\n };\n DPGlobal.template = ''+\n '
'+\n '
'+\n DPGlobal.headTemplate+\n ''+\n DPGlobal.footTemplate+\n '
'+\n '
'+\n '
'+\n '
'+\n DPGlobal.headTemplate+\n DPGlobal.contTemplate+\n DPGlobal.footTemplate+\n '
'+\n '
'+\n '
'+\n '
'+\n DPGlobal.headTemplate+\n DPGlobal.contTemplate+\n DPGlobal.footTemplate+\n '
'+\n '
'+\n '
'+\n '
'+\n DPGlobal.headTemplate+\n DPGlobal.contTemplate+\n DPGlobal.footTemplate+\n '
'+\n '
'+\n '
'+\n '
'+\n DPGlobal.headTemplate+\n DPGlobal.contTemplate+\n DPGlobal.footTemplate+\n '
'+\n '
'+\n '
';\n\n $.fn.datepicker.DPGlobal = DPGlobal;\n\n\n /* DATEPICKER NO CONFLICT\n * =================== */\n\n $.fn.datepicker.noConflict = function(){\n $.fn.datepicker = old;\n return this;\n };\n\n /* DATEPICKER VERSION\n * =================== */\n $.fn.datepicker.version = '1.7.1';\n\n $.fn.datepicker.deprecated = function(msg){\n var console = window.console;\n if (console && console.warn) {\n console.warn('DEPRECATED: ' + msg);\n }\n };\n\n\n /* DATEPICKER DATA-API\n * ================== */\n\n $(document).on(\n 'focus.datepicker.data-api click.datepicker.data-api',\n '[data-provide=\"datepicker\"]',\n function(e){\n var $this = $(this);\n if ($this.data('datepicker'))\n return;\n e.preventDefault();\n // component click requires us to explicitly show it\n datepickerPlugin.call($this, 'show');\n }\n );\n $(function(){\n datepickerPlugin.call($('[data-provide=\"datepicker-inline\"]'));\n });\n\n}));\n","var $ = require('../internals/export');\nvar fill = require('../internals/array-fill');\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// `Array.prototype.fill` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.fill\n$({ target: 'Array', proto: true }, {\n fill: fill\n});\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('fill');\n","'use strict';\nvar toObject = require('../internals/to-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\n\n// `Array.prototype.fill` method implementation\n// https://tc39.github.io/ecma262/#sec-array.prototype.fill\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var argumentsLength = arguments.length;\n var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);\n var end = argumentsLength > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n","/*\n * decaffeinate suggestions:\n * DS102: Remove unnecessary code created because of implicit returns\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md\n */\nimport datetimepicker from 'eonasdan-bootstrap-datetimepicker';\n\n$(() => {\n $('.form-datetimepicker').each((_i, el) => {\n const $el = $(el);\n const endOfTime = $el.data().dtpEndOfTime || false;\n const stepping = $el.data().stepping || 60;\n\n datetimepicker.apply($el, [\n {\n format: 'YYYY-MM-DD HH:mm',\n stepping,\n },\n ]);\n\n if (endOfTime) {\n $el.on('dp.change', (e) => {\n if (e.target.value.match(/00:00$/)) {\n const newDate = e.target.value.replace('00:00', '23:59');\n e.target.value = newDate;\n }\n });\n }\n });\n});\n","var map = {\n\t\"./af\": 371,\n\t\"./af.js\": 371,\n\t\"./ar\": 372,\n\t\"./ar-dz\": 373,\n\t\"./ar-dz.js\": 373,\n\t\"./ar-kw\": 374,\n\t\"./ar-kw.js\": 374,\n\t\"./ar-ly\": 375,\n\t\"./ar-ly.js\": 375,\n\t\"./ar-ma\": 376,\n\t\"./ar-ma.js\": 376,\n\t\"./ar-sa\": 377,\n\t\"./ar-sa.js\": 377,\n\t\"./ar-tn\": 378,\n\t\"./ar-tn.js\": 378,\n\t\"./ar.js\": 372,\n\t\"./az\": 379,\n\t\"./az.js\": 379,\n\t\"./be\": 380,\n\t\"./be.js\": 380,\n\t\"./bg\": 381,\n\t\"./bg.js\": 381,\n\t\"./bm\": 382,\n\t\"./bm.js\": 382,\n\t\"./bn\": 383,\n\t\"./bn.js\": 383,\n\t\"./bo\": 384,\n\t\"./bo.js\": 384,\n\t\"./br\": 385,\n\t\"./br.js\": 385,\n\t\"./bs\": 386,\n\t\"./bs.js\": 386,\n\t\"./ca\": 387,\n\t\"./ca.js\": 387,\n\t\"./cs\": 388,\n\t\"./cs.js\": 388,\n\t\"./cv\": 389,\n\t\"./cv.js\": 389,\n\t\"./cy\": 390,\n\t\"./cy.js\": 390,\n\t\"./da\": 391,\n\t\"./da.js\": 391,\n\t\"./de\": 392,\n\t\"./de-at\": 393,\n\t\"./de-at.js\": 393,\n\t\"./de-ch\": 394,\n\t\"./de-ch.js\": 394,\n\t\"./de.js\": 392,\n\t\"./dv\": 395,\n\t\"./dv.js\": 395,\n\t\"./el\": 396,\n\t\"./el.js\": 396,\n\t\"./en-au\": 397,\n\t\"./en-au.js\": 397,\n\t\"./en-ca\": 398,\n\t\"./en-ca.js\": 398,\n\t\"./en-gb\": 399,\n\t\"./en-gb.js\": 399,\n\t\"./en-ie\": 400,\n\t\"./en-ie.js\": 400,\n\t\"./en-il\": 401,\n\t\"./en-il.js\": 401,\n\t\"./en-nz\": 402,\n\t\"./en-nz.js\": 402,\n\t\"./eo\": 403,\n\t\"./eo.js\": 403,\n\t\"./es\": 404,\n\t\"./es-do\": 405,\n\t\"./es-do.js\": 405,\n\t\"./es-us\": 406,\n\t\"./es-us.js\": 406,\n\t\"./es.js\": 404,\n\t\"./et\": 407,\n\t\"./et.js\": 407,\n\t\"./eu\": 408,\n\t\"./eu.js\": 408,\n\t\"./fa\": 409,\n\t\"./fa.js\": 409,\n\t\"./fi\": 410,\n\t\"./fi.js\": 410,\n\t\"./fo\": 411,\n\t\"./fo.js\": 411,\n\t\"./fr\": 412,\n\t\"./fr-ca\": 413,\n\t\"./fr-ca.js\": 413,\n\t\"./fr-ch\": 414,\n\t\"./fr-ch.js\": 414,\n\t\"./fr.js\": 412,\n\t\"./fy\": 415,\n\t\"./fy.js\": 415,\n\t\"./gd\": 416,\n\t\"./gd.js\": 416,\n\t\"./gl\": 417,\n\t\"./gl.js\": 417,\n\t\"./gom-latn\": 418,\n\t\"./gom-latn.js\": 418,\n\t\"./gu\": 419,\n\t\"./gu.js\": 419,\n\t\"./he\": 420,\n\t\"./he.js\": 420,\n\t\"./hi\": 421,\n\t\"./hi.js\": 421,\n\t\"./hr\": 422,\n\t\"./hr.js\": 422,\n\t\"./hu\": 423,\n\t\"./hu.js\": 423,\n\t\"./hy-am\": 424,\n\t\"./hy-am.js\": 424,\n\t\"./id\": 425,\n\t\"./id.js\": 425,\n\t\"./is\": 426,\n\t\"./is.js\": 426,\n\t\"./it\": 427,\n\t\"./it.js\": 427,\n\t\"./ja\": 428,\n\t\"./ja.js\": 428,\n\t\"./jv\": 429,\n\t\"./jv.js\": 429,\n\t\"./ka\": 430,\n\t\"./ka.js\": 430,\n\t\"./kk\": 431,\n\t\"./kk.js\": 431,\n\t\"./km\": 432,\n\t\"./km.js\": 432,\n\t\"./kn\": 433,\n\t\"./kn.js\": 433,\n\t\"./ko\": 434,\n\t\"./ko.js\": 434,\n\t\"./ky\": 435,\n\t\"./ky.js\": 435,\n\t\"./lb\": 436,\n\t\"./lb.js\": 436,\n\t\"./lo\": 437,\n\t\"./lo.js\": 437,\n\t\"./lt\": 438,\n\t\"./lt.js\": 438,\n\t\"./lv\": 439,\n\t\"./lv.js\": 439,\n\t\"./me\": 440,\n\t\"./me.js\": 440,\n\t\"./mi\": 441,\n\t\"./mi.js\": 441,\n\t\"./mk\": 442,\n\t\"./mk.js\": 442,\n\t\"./ml\": 443,\n\t\"./ml.js\": 443,\n\t\"./mr\": 444,\n\t\"./mr.js\": 444,\n\t\"./ms\": 445,\n\t\"./ms-my\": 446,\n\t\"./ms-my.js\": 446,\n\t\"./ms.js\": 445,\n\t\"./mt\": 447,\n\t\"./mt.js\": 447,\n\t\"./my\": 448,\n\t\"./my.js\": 448,\n\t\"./nb\": 449,\n\t\"./nb.js\": 449,\n\t\"./ne\": 450,\n\t\"./ne.js\": 450,\n\t\"./nl\": 451,\n\t\"./nl-be\": 452,\n\t\"./nl-be.js\": 452,\n\t\"./nl.js\": 451,\n\t\"./nn\": 453,\n\t\"./nn.js\": 453,\n\t\"./pa-in\": 454,\n\t\"./pa-in.js\": 454,\n\t\"./pl\": 455,\n\t\"./pl.js\": 455,\n\t\"./pt\": 456,\n\t\"./pt-br\": 457,\n\t\"./pt-br.js\": 457,\n\t\"./pt.js\": 456,\n\t\"./ro\": 458,\n\t\"./ro.js\": 458,\n\t\"./ru\": 459,\n\t\"./ru.js\": 459,\n\t\"./sd\": 460,\n\t\"./sd.js\": 460,\n\t\"./se\": 461,\n\t\"./se.js\": 461,\n\t\"./si\": 462,\n\t\"./si.js\": 462,\n\t\"./sk\": 463,\n\t\"./sk.js\": 463,\n\t\"./sl\": 464,\n\t\"./sl.js\": 464,\n\t\"./sq\": 465,\n\t\"./sq.js\": 465,\n\t\"./sr\": 466,\n\t\"./sr-cyrl\": 467,\n\t\"./sr-cyrl.js\": 467,\n\t\"./sr.js\": 466,\n\t\"./ss\": 468,\n\t\"./ss.js\": 468,\n\t\"./sv\": 469,\n\t\"./sv.js\": 469,\n\t\"./sw\": 470,\n\t\"./sw.js\": 470,\n\t\"./ta\": 471,\n\t\"./ta.js\": 471,\n\t\"./te\": 472,\n\t\"./te.js\": 472,\n\t\"./tet\": 473,\n\t\"./tet.js\": 473,\n\t\"./tg\": 474,\n\t\"./tg.js\": 474,\n\t\"./th\": 475,\n\t\"./th.js\": 475,\n\t\"./tl-ph\": 476,\n\t\"./tl-ph.js\": 476,\n\t\"./tlh\": 477,\n\t\"./tlh.js\": 477,\n\t\"./tr\": 478,\n\t\"./tr.js\": 478,\n\t\"./tzl\": 479,\n\t\"./tzl.js\": 479,\n\t\"./tzm\": 480,\n\t\"./tzm-latn\": 481,\n\t\"./tzm-latn.js\": 481,\n\t\"./tzm.js\": 480,\n\t\"./ug-cn\": 482,\n\t\"./ug-cn.js\": 482,\n\t\"./uk\": 483,\n\t\"./uk.js\": 483,\n\t\"./ur\": 484,\n\t\"./ur.js\": 484,\n\t\"./uz\": 485,\n\t\"./uz-latn\": 486,\n\t\"./uz-latn.js\": 486,\n\t\"./uz.js\": 485,\n\t\"./vi\": 487,\n\t\"./vi.js\": 487,\n\t\"./x-pseudo\": 488,\n\t\"./x-pseudo.js\": 488,\n\t\"./yo\": 489,\n\t\"./yo.js\": 489,\n\t\"./zh-cn\": 490,\n\t\"./zh-cn.js\": 490,\n\t\"./zh-hk\": 491,\n\t\"./zh-hk.js\": 491,\n\t\"./zh-tw\": 492,\n\t\"./zh-tw.js\": 492\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 975;","const registerButtonClickEvent = () => {\n const button = document.getElementById('show_all_post_deal_histories');\n if (button === null) {\n return;\n }\n\n const handler = () => {\n button.classList.add('disabled');\n document\n .querySelector('.post-deal-histories-table tr')\n .classList.remove('hide');\n };\n button.addEventListener('click', handler);\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n registerButtonClickEvent();\n});\n","'use strict';\n\nvar invalidPrototcolRegex = /^(%20|\\s)*(javascript|data)/im;\nvar ctrlCharactersRegex = /[^\\x20-\\x7E]/gmi;\nvar urlSchemeRegex = /^([^:]+):/gm;\nvar relativeFirstCharacters = ['.', '/'];\n\nfunction isRelativeUrl(url) {\n return relativeFirstCharacters.indexOf(url[0]) > -1;\n}\n\nfunction sanitizeUrl(url) {\n if (!url) {\n return 'about:blank';\n }\n\n var urlScheme, urlSchemeParseResults;\n var sanitizedUrl = url.replace(ctrlCharactersRegex, '').trim();\n\n if (isRelativeUrl(sanitizedUrl)) {\n return sanitizedUrl;\n }\n\n urlSchemeParseResults = sanitizedUrl.match(urlSchemeRegex);\n\n if (!urlSchemeParseResults) {\n return 'about:blank';\n }\n\n urlScheme = urlSchemeParseResults[0];\n\n if (invalidPrototcolRegex.test(urlScheme)) {\n return 'about:blank';\n }\n\n return sanitizedUrl;\n}\n\nmodule.exports = {\n sanitizeUrl: sanitizeUrl\n};","// Includes only the \"core\" of graphlib\nmodule.exports = {\n Graph: require(\"./graph\"),\n version: require(\"./version\")\n};","var baseClone = require('./_baseClone');\n/** Used to compose bitmasks for cloning. */\n\n\nvar CLONE_SYMBOLS_FLAG = 4;\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n\nfunction clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = clone;","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;","var assocIndexOf = require('./_assocIndexOf');\n/** Used for built-in method references. */\n\n\nvar arrayProto = Array.prototype;\n/** Built-in value references. */\n\nvar splice = arrayProto.splice;\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n\n var lastIndex = data.length - 1;\n\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;","var assocIndexOf = require('./_assocIndexOf');\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n\n\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;","var assocIndexOf = require('./_assocIndexOf');\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n\n\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;","var assocIndexOf = require('./_assocIndexOf');\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n\n\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n\n return this;\n}\n\nmodule.exports = listCacheSet;","var ListCache = require('./_ListCache');\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n\n\nfunction stackClear() {\n this.__data__ = new ListCache();\n this.size = 0;\n}\n\nmodule.exports = stackClear;","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n/** Used as the size to enable large array optimizations. */\n\n\nvar LARGE_ARRAY_SIZE = 200;\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n\nfunction stackSet(key, value) {\n var data = this.__data__;\n\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n\n if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n\n data = this.__data__ = new MapCache(pairs);\n }\n\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n\n\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n/** Used to detect host constructors (Safari). */\n\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n/** Used for built-in method references. */\n\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n/** Used to resolve the decompiled source of functions. */\n\nvar funcToString = funcProto.toString;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/** Used to detect if a method is native. */\n\nvar reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&').replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$');\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;","var _Symbol = require('./_Symbol');\n/** Used for built-in method references. */\n\n\nvar objectProto = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n\nvar nativeObjectToString = objectProto.toString;\n/** Built-in value references. */\n\nvar symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n\n return result;\n}\n\nmodule.exports = getRawTag;","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n\nvar nativeObjectToString = objectProto.toString;\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;","var coreJsData = require('./_coreJsData');\n/** Used to detect methods masquerading as native. */\n\n\nvar maskSrcKey = function () {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? 'Symbol(src)_1.' + uid : '';\n}();\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n\n\nfunction isMasked(func) {\n return !!maskSrcKey && maskSrcKey in func;\n}\n\nmodule.exports = isMasked;","var root = require('./_root');\n/** Used to detect overreaching core-js shims. */\n\n\nvar coreJsData = root['__core-js_shared__'];\nmodule.exports = coreJsData;","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n\n\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map || ListCache)(),\n 'string': new Hash()\n };\n}\n\nmodule.exports = mapCacheClear;","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n\n\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n this.clear();\n\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n} // Add methods to `Hash`.\n\n\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\nmodule.exports = Hash;","var nativeCreate = require('./_nativeCreate');\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n\n\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;","var nativeCreate = require('./_nativeCreate');\n/** Used to stand-in for `undefined` hash values. */\n\n\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n/** Used for built-in method references. */\n\nvar objectProto = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n\nfunction hashGet(key) {\n var data = this.__data__;\n\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;","var nativeCreate = require('./_nativeCreate');\n/** Used for built-in method references. */\n\n\nvar objectProto = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;","var nativeCreate = require('./_nativeCreate');\n/** Used to stand-in for `undefined` hash values. */\n\n\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;","var getMapData = require('./_getMapData');\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n\n\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = _typeof(value);\n\n return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;\n}\n\nmodule.exports = isKeyable;","var getMapData = require('./_getMapData');\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n\n\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;","var getMapData = require('./_getMapData');\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n\n\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;","var getMapData = require('./_getMapData');\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n\n\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;","var copyObject = require('./_copyObject'),\n keys = require('./keys');\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n\n\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n\n return result;\n}\n\nmodule.exports = baseTimes;","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n/** `Object#toString` result references. */\n\n\nvar argsTag = '[object Arguments]';\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n/** `Object#toString` result references. */\n\n\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n/** Used to identify `toStringTag` values of typed arrays. */\n\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;","var overArg = require('./_overArg');\n/* Built-in method references for those with the same name as other `lodash` methods. */\n\n\nvar nativeKeys = overArg(Object.keys, Object);\nmodule.exports = nativeKeys;","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n\n\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n/** Used for built-in method references. */\n\n\nvar objectProto = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n\n return result;\n}\n\nmodule.exports = baseKeysIn;","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n\n return result;\n}\n\nmodule.exports = nativeKeysIn;","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n\n\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n\n\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n\n\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;","var getNative = require('./_getNative'),\n root = require('./_root');\n/* Built-in method references that are verified to be native. */\n\n\nvar DataView = getNative(root, 'DataView');\nmodule.exports = DataView;","var getNative = require('./_getNative'),\n root = require('./_root');\n/* Built-in method references that are verified to be native. */\n\n\nvar Promise = getNative(root, 'Promise');\nmodule.exports = Promise;","var getNative = require('./_getNative'),\n root = require('./_root');\n/* Built-in method references that are verified to be native. */\n\n\nvar WeakMap = getNative(root, 'WeakMap');\nmodule.exports = WeakMap;","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length); // Add properties assigned by `RegExp#exec`.\n\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n\n return result;\n}\n\nmodule.exports = initCloneArray;","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n/** `Object#toString` result references. */\n\n\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag:\n case float64Tag:\n case int8Tag:\n case int16Tag:\n case int32Tag:\n case uint8Tag:\n case uint8ClampedTag:\n case uint16Tag:\n case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor();\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor();\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n\n\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;","var _Symbol = require('./_Symbol');\n/** Used to convert symbols to primitives and strings. */\n\n\nvar symbolProto = _Symbol ? _Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;","var baseIsMap = require('./_baseIsMap'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n/* Node.js helper references. */\n\n\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\nmodule.exports = isMap;","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n/** `Object#toString` result references. */\n\n\nvar mapTag = '[object Map]';\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;","var baseIsSet = require('./_baseIsSet'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n/* Node.js helper references. */\n\n\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\nmodule.exports = isSet;","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n/** `Object#toString` result references. */\n\n\nvar setTag = '[object Set]';\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function (object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n\n return object;\n };\n}\n\nmodule.exports = createBaseFor;","var isArrayLike = require('./isArrayLike');\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n\n\nfunction createBaseEach(eachFunc, fromRight) {\n return function (collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while (fromRight ? index-- : ++index < length) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;","var baseEach = require('./_baseEach');\n/**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n\n\nfunction baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function (value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n}\n\nmodule.exports = baseFilter;","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n\n\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n\n return function (object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;","var Stack = require('./_Stack'),\n baseIsEqual = require('./_baseIsEqual');\n/** Used to compose bitmasks for value comparisons. */\n\n\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n\n object = Object(object);\n\n while (index--) {\n var data = matchData[index];\n\n if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {\n return false;\n }\n }\n\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack();\n\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n\n if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nmodule.exports = baseIsMatch;","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n/** Used to compose bitmasks for value comparisons. */\n\n\nvar COMPARE_PARTIAL_FLAG = 1;\n/** `Object#toString` result references. */\n\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n/** Used for built-in method references. */\n\nvar objectProto = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n\n objIsArr = true;\n objIsObj = false;\n }\n\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack());\n return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n stack || (stack = new Stack());\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n\n if (!isSameTag) {\n return false;\n }\n\n stack || (stack = new Stack());\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n\n return this;\n}\n\nmodule.exports = setCacheAdd;","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n\n return false;\n}\n\nmodule.exports = arraySome;","var _Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n/** Used to compose bitmasks for value comparisons. */\n\n\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n/** `Object#toString` result references. */\n\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n/** Used to convert symbols to primitives and strings. */\n\nvar symbolProto = _Symbol ? _Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {\n return false;\n }\n\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == other + '';\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n } // Assume cyclic values are equal.\n\n\n var stacked = stack.get(object);\n\n if (stacked) {\n return stacked == other;\n }\n\n bitmask |= COMPARE_UNORDERED_FLAG; // Recursively compare objects (susceptible to call stack limits).\n\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n\n }\n\n return false;\n}\n\nmodule.exports = equalByTag;","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n map.forEach(function (value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;","var getAllKeys = require('./_getAllKeys');\n/** Used to compose bitmasks for value comparisons. */\n\n\nvar COMPARE_PARTIAL_FLAG = 1;\n/** Used for built-in method references. */\n\nvar objectProto = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n\n var index = objLength;\n\n while (index--) {\n var key = objProps[index];\n\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n } // Assume cyclic values are equal.\n\n\n var stacked = stack.get(object);\n\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n var skipCtor = isPartial;\n\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);\n } // Recursively compare objects (susceptible to call stack limits).\n\n\n if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {\n result = false;\n break;\n }\n\n skipCtor || (skipCtor = key == 'constructor');\n }\n\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal.\n\n if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;","var isStrictComparable = require('./_isStrictComparable'),\n keys = require('./keys');\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n\n\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n result[length] = [key, value, isStrictComparable(value)];\n }\n\n return result;\n}\n\nmodule.exports = getMatchData;","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n/** Used to compose bitmasks for value comparisons. */\n\n\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n\n return function (object) {\n var objValue = get(object, path);\n return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;","var baseGet = require('./_baseGet');\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n\n\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;","var memoizeCapped = require('./_memoizeCapped');\n/** Used to match property names within property paths. */\n\n\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n/** Used to match backslashes in property paths. */\n\nvar reEscapeChar = /\\\\(\\\\)?/g;\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n\nvar stringToPath = memoizeCapped(function (string) {\n var result = [];\n\n if (string.charCodeAt(0) === 46\n /* . */\n ) {\n result.push('');\n }\n\n string.replace(rePropName, function (match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : number || match);\n });\n return result;\n});\nmodule.exports = stringToPath;","var memoize = require('./memoize');\n/** Used as the maximum memoize cache size. */\n\n\nvar MAX_MEMOIZE_SIZE = 500;\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n\nfunction memoizeCapped(func) {\n var result = memoize(func, function (key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n\n return key;\n });\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;","var MapCache = require('./_MapCache');\n/** Error message constants. */\n\n\nvar FUNC_ERROR_TEXT = 'Expected a function';\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || resolver != null && typeof resolver != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n\n var memoized = function memoized() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n\n memoized.cache = new (memoize.Cache || MapCache)();\n return memoized;\n} // Expose `MapCache`.\n\n\nmemoize.Cache = MapCache;\nmodule.exports = memoize;","var _Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n/** Used as references for various `Number` constants. */\n\n\nvar INFINITY = 1 / 0;\n/** Used to convert symbols to primitives and strings. */\n\nvar symbolProto = _Symbol ? _Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n\n var result = value + '';\n return result == '0' && 1 / value == -INFINITY ? '-0' : result;\n}\n\nmodule.exports = baseToString;","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\n\n\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;","var baseGet = require('./_baseGet');\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n\n\nfunction basePropertyDeep(path) {\n return function (object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n\nfunction baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nmodule.exports = baseHas;","var baseKeys = require('./_baseKeys'),\n getTag = require('./_getTag'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLike = require('./isArrayLike'),\n isBuffer = require('./isBuffer'),\n isPrototype = require('./_isPrototype'),\n isTypedArray = require('./isTypedArray');\n/** `Object#toString` result references. */\n\n\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n/** Used for built-in method references. */\n\nvar objectProto = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n\n if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n\n var tag = getTag(value);\n\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n\n return true;\n}\n\nmodule.exports = isEmpty;","/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n\n return accumulator;\n}\n\nmodule.exports = arrayReduce;","/**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function (value, index, collection) {\n accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nmodule.exports = baseReduce;","var baseKeys = require('./_baseKeys'),\n getTag = require('./_getTag'),\n isArrayLike = require('./isArrayLike'),\n isString = require('./isString'),\n stringSize = require('./_stringSize');\n/** `Object#toString` result references. */\n\n\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n/**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n\nfunction size(collection) {\n if (collection == null) {\n return 0;\n }\n\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n\n var tag = getTag(collection);\n\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n\n return baseKeys(collection).length;\n}\n\nmodule.exports = size;","var baseGetTag = require('./_baseGetTag'),\n isArray = require('./isArray'),\n isObjectLike = require('./isObjectLike');\n/** `Object#toString` result references. */\n\n\nvar stringTag = '[object String]';\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n\nfunction isString(value) {\n return typeof value == 'string' || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;\n}\n\nmodule.exports = isString;","var asciiSize = require('./_asciiSize'),\n hasUnicode = require('./_hasUnicode'),\n unicodeSize = require('./_unicodeSize');\n/**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n\n\nfunction stringSize(string) {\n return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);\n}\n\nmodule.exports = stringSize;","var baseProperty = require('./_baseProperty');\n/**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n\n\nvar asciiSize = baseProperty('length');\nmodule.exports = asciiSize;","/** Used to compose unicode character classes. */\nvar rsAstralRange = \"\\\\ud800-\\\\udfff\",\n rsComboMarksRange = \"\\\\u0300-\\\\u036f\",\n reComboHalfMarksRange = \"\\\\ufe20-\\\\ufe2f\",\n rsComboSymbolsRange = \"\\\\u20d0-\\\\u20ff\",\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = \"\\\\ufe0e\\\\ufe0f\";\n/** Used to compose unicode capture groups. */\n\nvar rsZWJ = \"\\\\u200d\";\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\nmodule.exports = hasUnicode;","/** Used to compose unicode character classes. */\nvar rsAstralRange = \"\\\\ud800-\\\\udfff\",\n rsComboMarksRange = \"\\\\u0300-\\\\u036f\",\n reComboHalfMarksRange = \"\\\\ufe20-\\\\ufe2f\",\n rsComboSymbolsRange = \"\\\\u20d0-\\\\u20ff\",\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = \"\\\\ufe0e\\\\ufe0f\";\n/** Used to compose unicode capture groups. */\n\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = \"\\\\ud83c[\\\\udffb-\\\\udfff]\",\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = \"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",\n rsSurrPair = \"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",\n rsZWJ = \"\\\\u200d\";\n/** Used to compose unicode regexes. */\n\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n/**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n\nfunction unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n\n while (reUnicode.test(string)) {\n ++result;\n }\n\n return result;\n}\n\nmodule.exports = unicodeSize;","var arrayEach = require('./_arrayEach'),\n baseCreate = require('./_baseCreate'),\n baseForOwn = require('./_baseForOwn'),\n baseIteratee = require('./_baseIteratee'),\n getPrototype = require('./_getPrototype'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n isTypedArray = require('./isTypedArray');\n/**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n\n\nfunction transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n iteratee = baseIteratee(iteratee, 4);\n\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n\n if (isArrLike) {\n accumulator = isArr ? new Ctor() : [];\n } else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n } else {\n accumulator = {};\n }\n }\n\n (isArrLike ? arrayEach : baseForOwn)(object, function (value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n}\n\nmodule.exports = transform;","var baseFlatten = require('./_baseFlatten'),\n baseRest = require('./_baseRest'),\n baseUniq = require('./_baseUniq'),\n isArrayLikeObject = require('./isArrayLikeObject');\n/**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n\n\nvar union = baseRest(function (arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n});\nmodule.exports = union;","var _Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n/** Built-in value references. */\n\n\nvar spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined;\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0:\n return func.call(thisArg);\n\n case 1:\n return func.call(thisArg, args[0]);\n\n case 2:\n return func.call(thisArg, args[0], args[1]);\n\n case 3:\n return func.call(thisArg, args[0], args[1], args[2]);\n }\n\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n\n\nvar baseSetToString = !defineProperty ? identity : function (func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\nmodule.exports = baseSetToString;","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n/* Built-in method references for those with the same name as other `lodash` methods. */\n\nvar nativeNow = Date.now;\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n return function () {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n lastCalled = stamp;\n\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n cacheHas = require('./_cacheHas'),\n createSet = require('./_createSet'),\n setToArray = require('./_setToArray');\n/** Used as the size to enable large array optimizations. */\n\n\nvar LARGE_ARRAY_SIZE = 200;\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n } else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n\n if (set) {\n return setToArray(set);\n }\n\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache();\n } else {\n seen = iteratee ? [] : result;\n }\n\n outer: while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n value = comparator || value !== 0 ? value : 0;\n\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n\n if (iteratee) {\n seen.push(computed);\n }\n\n result.push(value);\n } else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n\n result.push(value);\n }\n }\n\n return result;\n}\n\nmodule.exports = baseUniq;","var baseIndexOf = require('./_baseIndexOf');\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n\n\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;","var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n\n\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n\n return -1;\n}\n\nmodule.exports = strictIndexOf;","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n\n return false;\n}\n\nmodule.exports = arrayIncludesWith;","var Set = require('./_Set'),\n noop = require('./noop'),\n setToArray = require('./_setToArray');\n/** Used as references for various `Number` constants. */\n\n\nvar INFINITY = 1 / 0;\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n\nvar createSet = !(Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY) ? noop : function (values) {\n return new Set(values);\n};\nmodule.exports = createSet;","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {// No operation performed.\n}\n\nmodule.exports = noop;","var arrayMap = require('./_arrayMap');\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n\n\nfunction baseValues(object, props) {\n return arrayMap(props, function (key) {\n return object[key];\n });\n}\n\nmodule.exports = baseValues;","module.exports = '2.1.8';","var _ = require(\"./lodash\");\n\nvar Graph = require(\"./graph\");\n\nmodule.exports = {\n write: write,\n read: read\n};\n\nfunction write(g) {\n var json = {\n options: {\n directed: g.isDirected(),\n multigraph: g.isMultigraph(),\n compound: g.isCompound()\n },\n nodes: writeNodes(g),\n edges: writeEdges(g)\n };\n\n if (!_.isUndefined(g.graph())) {\n json.value = _.clone(g.graph());\n }\n\n return json;\n}\n\nfunction writeNodes(g) {\n return _.map(g.nodes(), function (v) {\n var nodeValue = g.node(v);\n var parent = g.parent(v);\n var node = {\n v: v\n };\n\n if (!_.isUndefined(nodeValue)) {\n node.value = nodeValue;\n }\n\n if (!_.isUndefined(parent)) {\n node.parent = parent;\n }\n\n return node;\n });\n}\n\nfunction writeEdges(g) {\n return _.map(g.edges(), function (e) {\n var edgeValue = g.edge(e);\n var edge = {\n v: e.v,\n w: e.w\n };\n\n if (!_.isUndefined(e.name)) {\n edge.name = e.name;\n }\n\n if (!_.isUndefined(edgeValue)) {\n edge.value = edgeValue;\n }\n\n return edge;\n });\n}\n\nfunction read(json) {\n var g = new Graph(json.options).setGraph(json.value);\n\n _.each(json.nodes, function (entry) {\n g.setNode(entry.v, entry.value);\n\n if (entry.parent) {\n g.setParent(entry.v, entry.parent);\n }\n });\n\n _.each(json.edges, function (entry) {\n g.setEdge({\n v: entry.v,\n w: entry.w,\n name: entry.name\n }, entry.value);\n });\n\n return g;\n}","module.exports = {\n components: require(\"./components\"),\n dijkstra: require(\"./dijkstra\"),\n dijkstraAll: require(\"./dijkstra-all\"),\n findCycles: require(\"./find-cycles\"),\n floydWarshall: require(\"./floyd-warshall\"),\n isAcyclic: require(\"./is-acyclic\"),\n postorder: require(\"./postorder\"),\n preorder: require(\"./preorder\"),\n prim: require(\"./prim\"),\n tarjan: require(\"./tarjan\"),\n topsort: require(\"./topsort\")\n};","var _ = require(\"../lodash\");\n\nmodule.exports = components;\n\nfunction components(g) {\n var visited = {};\n var cmpts = [];\n var cmpt;\n\n function dfs(v) {\n if (_.has(visited, v)) return;\n visited[v] = true;\n cmpt.push(v);\n\n _.each(g.successors(v), dfs);\n\n _.each(g.predecessors(v), dfs);\n }\n\n _.each(g.nodes(), function (v) {\n cmpt = [];\n dfs(v);\n\n if (cmpt.length) {\n cmpts.push(cmpt);\n }\n });\n\n return cmpts;\n}","var dijkstra = require(\"./dijkstra\");\n\nvar _ = require(\"../lodash\");\n\nmodule.exports = dijkstraAll;\n\nfunction dijkstraAll(g, weightFunc, edgeFunc) {\n return _.transform(g.nodes(), function (acc, v) {\n acc[v] = dijkstra(g, v, weightFunc, edgeFunc);\n }, {});\n}","var _ = require(\"../lodash\");\n\nvar tarjan = require(\"./tarjan\");\n\nmodule.exports = findCycles;\n\nfunction findCycles(g) {\n return _.filter(tarjan(g), function (cmpt) {\n return cmpt.length > 1 || cmpt.length === 1 && g.hasEdge(cmpt[0], cmpt[0]);\n });\n}","var _ = require(\"../lodash\");\n\nmodule.exports = floydWarshall;\n\nvar DEFAULT_WEIGHT_FUNC = _.constant(1);\n\nfunction floydWarshall(g, weightFn, edgeFn) {\n return runFloydWarshall(g, weightFn || DEFAULT_WEIGHT_FUNC, edgeFn || function (v) {\n return g.outEdges(v);\n });\n}\n\nfunction runFloydWarshall(g, weightFn, edgeFn) {\n var results = {};\n var nodes = g.nodes();\n nodes.forEach(function (v) {\n results[v] = {};\n results[v][v] = {\n distance: 0\n };\n nodes.forEach(function (w) {\n if (v !== w) {\n results[v][w] = {\n distance: Number.POSITIVE_INFINITY\n };\n }\n });\n edgeFn(v).forEach(function (edge) {\n var w = edge.v === v ? edge.w : edge.v;\n var d = weightFn(edge);\n results[v][w] = {\n distance: d,\n predecessor: v\n };\n });\n });\n nodes.forEach(function (k) {\n var rowK = results[k];\n nodes.forEach(function (i) {\n var rowI = results[i];\n nodes.forEach(function (j) {\n var ik = rowI[k];\n var kj = rowK[j];\n var ij = rowI[j];\n var altDistance = ik.distance + kj.distance;\n\n if (altDistance < ij.distance) {\n ij.distance = altDistance;\n ij.predecessor = kj.predecessor;\n }\n });\n });\n });\n return results;\n}","var topsort = require(\"./topsort\");\n\nmodule.exports = isAcyclic;\n\nfunction isAcyclic(g) {\n try {\n topsort(g);\n } catch (e) {\n if (e instanceof topsort.CycleException) {\n return false;\n }\n\n throw e;\n }\n\n return true;\n}","var dfs = require(\"./dfs\");\n\nmodule.exports = postorder;\n\nfunction postorder(g, vs) {\n return dfs(g, vs, \"post\");\n}","var dfs = require(\"./dfs\");\n\nmodule.exports = preorder;\n\nfunction preorder(g, vs) {\n return dfs(g, vs, \"pre\");\n}","var _ = require(\"../lodash\");\n\nvar Graph = require(\"../graph\");\n\nvar PriorityQueue = require(\"../data/priority-queue\");\n\nmodule.exports = prim;\n\nfunction prim(g, weightFunc) {\n var result = new Graph();\n var parents = {};\n var pq = new PriorityQueue();\n var v;\n\n function updateNeighbors(edge) {\n var w = edge.v === v ? edge.w : edge.v;\n var pri = pq.priority(w);\n\n if (pri !== undefined) {\n var edgeWeight = weightFunc(edge);\n\n if (edgeWeight < pri) {\n parents[w] = v;\n pq.decrease(w, edgeWeight);\n }\n }\n }\n\n if (g.nodeCount() === 0) {\n return result;\n }\n\n _.each(g.nodes(), function (v) {\n pq.add(v, Number.POSITIVE_INFINITY);\n result.setNode(v);\n }); // Start from an arbitrary node\n\n\n pq.decrease(g.nodes()[0], 0);\n var init = false;\n\n while (pq.size() > 0) {\n v = pq.removeMin();\n\n if (_.has(parents, v)) {\n result.setEdge(v, parents[v]);\n } else if (init) {\n throw new Error(\"Input graph is not connected: \" + g);\n } else {\n init = true;\n }\n\n g.nodeEdges(v).forEach(updateNeighbors);\n }\n\n return result;\n}","\"use strict\";\n\nvar _ = require(\"./lodash\");\n\nvar acyclic = require(\"./acyclic\");\n\nvar normalize = require(\"./normalize\");\n\nvar rank = require(\"./rank\");\n\nvar normalizeRanks = require(\"./util\").normalizeRanks;\n\nvar parentDummyChains = require(\"./parent-dummy-chains\");\n\nvar removeEmptyRanks = require(\"./util\").removeEmptyRanks;\n\nvar nestingGraph = require(\"./nesting-graph\");\n\nvar addBorderSegments = require(\"./add-border-segments\");\n\nvar coordinateSystem = require(\"./coordinate-system\");\n\nvar order = require(\"./order\");\n\nvar position = require(\"./position\");\n\nvar util = require(\"./util\");\n\nvar Graph = require(\"./graphlib\").Graph;\n\nmodule.exports = layout;\n\nfunction layout(g, opts) {\n var time = opts && opts.debugTiming ? util.time : util.notime;\n time(\"layout\", function () {\n var layoutGraph = time(\" buildLayoutGraph\", function () {\n return buildLayoutGraph(g);\n });\n time(\" runLayout\", function () {\n runLayout(layoutGraph, time);\n });\n time(\" updateInputGraph\", function () {\n updateInputGraph(g, layoutGraph);\n });\n });\n}\n\nfunction runLayout(g, time) {\n time(\" makeSpaceForEdgeLabels\", function () {\n makeSpaceForEdgeLabels(g);\n });\n time(\" removeSelfEdges\", function () {\n removeSelfEdges(g);\n });\n time(\" acyclic\", function () {\n acyclic.run(g);\n });\n time(\" nestingGraph.run\", function () {\n nestingGraph.run(g);\n });\n time(\" rank\", function () {\n rank(util.asNonCompoundGraph(g));\n });\n time(\" injectEdgeLabelProxies\", function () {\n injectEdgeLabelProxies(g);\n });\n time(\" removeEmptyRanks\", function () {\n removeEmptyRanks(g);\n });\n time(\" nestingGraph.cleanup\", function () {\n nestingGraph.cleanup(g);\n });\n time(\" normalizeRanks\", function () {\n normalizeRanks(g);\n });\n time(\" assignRankMinMax\", function () {\n assignRankMinMax(g);\n });\n time(\" removeEdgeLabelProxies\", function () {\n removeEdgeLabelProxies(g);\n });\n time(\" normalize.run\", function () {\n normalize.run(g);\n });\n time(\" parentDummyChains\", function () {\n parentDummyChains(g);\n });\n time(\" addBorderSegments\", function () {\n addBorderSegments(g);\n });\n time(\" order\", function () {\n order(g);\n });\n time(\" insertSelfEdges\", function () {\n insertSelfEdges(g);\n });\n time(\" adjustCoordinateSystem\", function () {\n coordinateSystem.adjust(g);\n });\n time(\" position\", function () {\n position(g);\n });\n time(\" positionSelfEdges\", function () {\n positionSelfEdges(g);\n });\n time(\" removeBorderNodes\", function () {\n removeBorderNodes(g);\n });\n time(\" normalize.undo\", function () {\n normalize.undo(g);\n });\n time(\" fixupEdgeLabelCoords\", function () {\n fixupEdgeLabelCoords(g);\n });\n time(\" undoCoordinateSystem\", function () {\n coordinateSystem.undo(g);\n });\n time(\" translateGraph\", function () {\n translateGraph(g);\n });\n time(\" assignNodeIntersects\", function () {\n assignNodeIntersects(g);\n });\n time(\" reversePoints\", function () {\n reversePointsForReversedEdges(g);\n });\n time(\" acyclic.undo\", function () {\n acyclic.undo(g);\n });\n}\n/*\n * Copies final layout information from the layout graph back to the input\n * graph. This process only copies whitelisted attributes from the layout graph\n * to the input graph, so it serves as a good place to determine what\n * attributes can influence layout.\n */\n\n\nfunction updateInputGraph(inputGraph, layoutGraph) {\n _.forEach(inputGraph.nodes(), function (v) {\n var inputLabel = inputGraph.node(v);\n var layoutLabel = layoutGraph.node(v);\n\n if (inputLabel) {\n inputLabel.x = layoutLabel.x;\n inputLabel.y = layoutLabel.y;\n\n if (layoutGraph.children(v).length) {\n inputLabel.width = layoutLabel.width;\n inputLabel.height = layoutLabel.height;\n }\n }\n });\n\n _.forEach(inputGraph.edges(), function (e) {\n var inputLabel = inputGraph.edge(e);\n var layoutLabel = layoutGraph.edge(e);\n inputLabel.points = layoutLabel.points;\n\n if (_.has(layoutLabel, \"x\")) {\n inputLabel.x = layoutLabel.x;\n inputLabel.y = layoutLabel.y;\n }\n });\n\n inputGraph.graph().width = layoutGraph.graph().width;\n inputGraph.graph().height = layoutGraph.graph().height;\n}\n\nvar graphNumAttrs = [\"nodesep\", \"edgesep\", \"ranksep\", \"marginx\", \"marginy\"];\nvar graphDefaults = {\n ranksep: 50,\n edgesep: 20,\n nodesep: 50,\n rankdir: \"tb\"\n};\nvar graphAttrs = [\"acyclicer\", \"ranker\", \"rankdir\", \"align\"];\nvar nodeNumAttrs = [\"width\", \"height\"];\nvar nodeDefaults = {\n width: 0,\n height: 0\n};\nvar edgeNumAttrs = [\"minlen\", \"weight\", \"width\", \"height\", \"labeloffset\"];\nvar edgeDefaults = {\n minlen: 1,\n weight: 1,\n width: 0,\n height: 0,\n labeloffset: 10,\n labelpos: \"r\"\n};\nvar edgeAttrs = [\"labelpos\"];\n/*\n * Constructs a new graph from the input graph, which can be used for layout.\n * This process copies only whitelisted attributes from the input graph to the\n * layout graph. Thus this function serves as a good place to determine what\n * attributes can influence layout.\n */\n\nfunction buildLayoutGraph(inputGraph) {\n var g = new Graph({\n multigraph: true,\n compound: true\n });\n var graph = canonicalize(inputGraph.graph());\n g.setGraph(_.merge({}, graphDefaults, selectNumberAttrs(graph, graphNumAttrs), _.pick(graph, graphAttrs)));\n\n _.forEach(inputGraph.nodes(), function (v) {\n var node = canonicalize(inputGraph.node(v));\n g.setNode(v, _.defaults(selectNumberAttrs(node, nodeNumAttrs), nodeDefaults));\n g.setParent(v, inputGraph.parent(v));\n });\n\n _.forEach(inputGraph.edges(), function (e) {\n var edge = canonicalize(inputGraph.edge(e));\n g.setEdge(e, _.merge({}, edgeDefaults, selectNumberAttrs(edge, edgeNumAttrs), _.pick(edge, edgeAttrs)));\n });\n\n return g;\n}\n/*\n * This idea comes from the Gansner paper: to account for edge labels in our\n * layout we split each rank in half by doubling minlen and halving ranksep.\n * Then we can place labels at these mid-points between nodes.\n *\n * We also add some minimal padding to the width to push the label for the edge\n * away from the edge itself a bit.\n */\n\n\nfunction makeSpaceForEdgeLabels(g) {\n var graph = g.graph();\n graph.ranksep /= 2;\n\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n edge.minlen *= 2;\n\n if (edge.labelpos.toLowerCase() !== \"c\") {\n if (graph.rankdir === \"TB\" || graph.rankdir === \"BT\") {\n edge.width += edge.labeloffset;\n } else {\n edge.height += edge.labeloffset;\n }\n }\n });\n}\n/*\n * Creates temporary dummy nodes that capture the rank in which each edge's\n * label is going to, if it has one of non-zero width and height. We do this\n * so that we can safely remove empty ranks while preserving balance for the\n * label's position.\n */\n\n\nfunction injectEdgeLabelProxies(g) {\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n\n if (edge.width && edge.height) {\n var v = g.node(e.v);\n var w = g.node(e.w);\n var label = {\n rank: (w.rank - v.rank) / 2 + v.rank,\n e: e\n };\n util.addDummyNode(g, \"edge-proxy\", label, \"_ep\");\n }\n });\n}\n\nfunction assignRankMinMax(g) {\n var maxRank = 0;\n\n _.forEach(g.nodes(), function (v) {\n var node = g.node(v);\n\n if (node.borderTop) {\n node.minRank = g.node(node.borderTop).rank;\n node.maxRank = g.node(node.borderBottom).rank;\n maxRank = _.max(maxRank, node.maxRank);\n }\n });\n\n g.graph().maxRank = maxRank;\n}\n\nfunction removeEdgeLabelProxies(g) {\n _.forEach(g.nodes(), function (v) {\n var node = g.node(v);\n\n if (node.dummy === \"edge-proxy\") {\n g.edge(node.e).labelRank = node.rank;\n g.removeNode(v);\n }\n });\n}\n\nfunction translateGraph(g) {\n var minX = Number.POSITIVE_INFINITY;\n var maxX = 0;\n var minY = Number.POSITIVE_INFINITY;\n var maxY = 0;\n var graphLabel = g.graph();\n var marginX = graphLabel.marginx || 0;\n var marginY = graphLabel.marginy || 0;\n\n function getExtremes(attrs) {\n var x = attrs.x;\n var y = attrs.y;\n var w = attrs.width;\n var h = attrs.height;\n minX = Math.min(minX, x - w / 2);\n maxX = Math.max(maxX, x + w / 2);\n minY = Math.min(minY, y - h / 2);\n maxY = Math.max(maxY, y + h / 2);\n }\n\n _.forEach(g.nodes(), function (v) {\n getExtremes(g.node(v));\n });\n\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n\n if (_.has(edge, \"x\")) {\n getExtremes(edge);\n }\n });\n\n minX -= marginX;\n minY -= marginY;\n\n _.forEach(g.nodes(), function (v) {\n var node = g.node(v);\n node.x -= minX;\n node.y -= minY;\n });\n\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n\n _.forEach(edge.points, function (p) {\n p.x -= minX;\n p.y -= minY;\n });\n\n if (_.has(edge, \"x\")) {\n edge.x -= minX;\n }\n\n if (_.has(edge, \"y\")) {\n edge.y -= minY;\n }\n });\n\n graphLabel.width = maxX - minX + marginX;\n graphLabel.height = maxY - minY + marginY;\n}\n\nfunction assignNodeIntersects(g) {\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n var nodeV = g.node(e.v);\n var nodeW = g.node(e.w);\n var p1, p2;\n\n if (!edge.points) {\n edge.points = [];\n p1 = nodeW;\n p2 = nodeV;\n } else {\n p1 = edge.points[0];\n p2 = edge.points[edge.points.length - 1];\n }\n\n edge.points.unshift(util.intersectRect(nodeV, p1));\n edge.points.push(util.intersectRect(nodeW, p2));\n });\n}\n\nfunction fixupEdgeLabelCoords(g) {\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n\n if (_.has(edge, \"x\")) {\n if (edge.labelpos === \"l\" || edge.labelpos === \"r\") {\n edge.width -= edge.labeloffset;\n }\n\n switch (edge.labelpos) {\n case \"l\":\n edge.x -= edge.width / 2 + edge.labeloffset;\n break;\n\n case \"r\":\n edge.x += edge.width / 2 + edge.labeloffset;\n break;\n }\n }\n });\n}\n\nfunction reversePointsForReversedEdges(g) {\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n\n if (edge.reversed) {\n edge.points.reverse();\n }\n });\n}\n\nfunction removeBorderNodes(g) {\n _.forEach(g.nodes(), function (v) {\n if (g.children(v).length) {\n var node = g.node(v);\n var t = g.node(node.borderTop);\n var b = g.node(node.borderBottom);\n var l = g.node(_.last(node.borderLeft));\n var r = g.node(_.last(node.borderRight));\n node.width = Math.abs(r.x - l.x);\n node.height = Math.abs(b.y - t.y);\n node.x = l.x + node.width / 2;\n node.y = t.y + node.height / 2;\n }\n });\n\n _.forEach(g.nodes(), function (v) {\n if (g.node(v).dummy === \"border\") {\n g.removeNode(v);\n }\n });\n}\n\nfunction removeSelfEdges(g) {\n _.forEach(g.edges(), function (e) {\n if (e.v === e.w) {\n var node = g.node(e.v);\n\n if (!node.selfEdges) {\n node.selfEdges = [];\n }\n\n node.selfEdges.push({\n e: e,\n label: g.edge(e)\n });\n g.removeEdge(e);\n }\n });\n}\n\nfunction insertSelfEdges(g) {\n var layers = util.buildLayerMatrix(g);\n\n _.forEach(layers, function (layer) {\n var orderShift = 0;\n\n _.forEach(layer, function (v, i) {\n var node = g.node(v);\n node.order = i + orderShift;\n\n _.forEach(node.selfEdges, function (selfEdge) {\n util.addDummyNode(g, \"selfedge\", {\n width: selfEdge.label.width,\n height: selfEdge.label.height,\n rank: node.rank,\n order: i + ++orderShift,\n e: selfEdge.e,\n label: selfEdge.label\n }, \"_se\");\n });\n\n delete node.selfEdges;\n });\n });\n}\n\nfunction positionSelfEdges(g) {\n _.forEach(g.nodes(), function (v) {\n var node = g.node(v);\n\n if (node.dummy === \"selfedge\") {\n var selfNode = g.node(node.e.v);\n var x = selfNode.x + selfNode.width / 2;\n var y = selfNode.y;\n var dx = node.x - x;\n var dy = selfNode.height / 2;\n g.setEdge(node.e, node.label);\n g.removeNode(v);\n node.label.points = [{\n x: x + 2 * dx / 3,\n y: y - dy\n }, {\n x: x + 5 * dx / 6,\n y: y - dy\n }, {\n x: x + dx,\n y: y\n }, {\n x: x + 5 * dx / 6,\n y: y + dy\n }, {\n x: x + 2 * dx / 3,\n y: y + dy\n }];\n node.label.x = node.x;\n node.label.y = node.y;\n }\n });\n}\n\nfunction selectNumberAttrs(obj, attrs) {\n return _.mapValues(_.pick(obj, attrs), Number);\n}\n\nfunction canonicalize(attrs) {\n var newAttrs = {};\n\n _.forEach(attrs, function (v, k) {\n newAttrs[k.toLowerCase()] = v;\n });\n\n return newAttrs;\n}","var baseClone = require('./_baseClone');\n/** Used to compose bitmasks for cloning. */\n\n\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = cloneDeep;","var createFind = require('./_createFind'),\n findIndex = require('./findIndex');\n/**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n\n\nvar find = createFind(findIndex);\nmodule.exports = find;","var baseIteratee = require('./_baseIteratee'),\n isArrayLike = require('./isArrayLike'),\n keys = require('./keys');\n/**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n\n\nfunction createFind(findIndexFunc) {\n return function (collection, predicate, fromIndex) {\n var iterable = Object(collection);\n\n if (!isArrayLike(collection)) {\n var iteratee = baseIteratee(predicate, 3);\n collection = keys(collection);\n\n predicate = function predicate(key) {\n return iteratee(iterable[key], key, iterable);\n };\n }\n\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n}\n\nmodule.exports = createFind;","var baseFindIndex = require('./_baseFindIndex'),\n baseIteratee = require('./_baseIteratee'),\n toInteger = require('./toInteger');\n/* Built-in method references for those with the same name as other `lodash` methods. */\n\n\nvar nativeMax = Math.max;\n/**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n\nfunction findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n\n if (!length) {\n return -1;\n }\n\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n\n return baseFindIndex(array, baseIteratee(predicate, 3), index);\n}\n\nmodule.exports = findIndex;","var toFinite = require('./toFinite');\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n\n\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n return result === result ? remainder ? result - remainder : result : 0;\n}\n\nmodule.exports = toInteger;","var isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n/** Used as references for various `Number` constants. */\n\n\nvar NAN = 0 / 0;\n/** Used to match leading and trailing whitespace. */\n\nvar reTrim = /^\\s+|\\s+$/g;\n/** Used to detect bad signed hexadecimal string values. */\n\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n/** Used to detect binary string values. */\n\nvar reIsBinary = /^0b[01]+$/i;\n/** Used to detect octal string values. */\n\nvar reIsOctal = /^0o[0-7]+$/i;\n/** Built-in method references without a dependency on `root`. */\n\nvar freeParseInt = parseInt;\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n\n if (isSymbol(value)) {\n return NAN;\n }\n\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? other + '' : other;\n }\n\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;\n}\n\nmodule.exports = toNumber;","var baseFor = require('./_baseFor'),\n castFunction = require('./_castFunction'),\n keysIn = require('./keysIn');\n/**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n\n\nfunction forIn(object, iteratee) {\n return object == null ? object : baseFor(object, castFunction(iteratee), keysIn);\n}\n\nmodule.exports = forIn;","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;","var baseAssignValue = require('./_baseAssignValue'),\n baseForOwn = require('./_baseForOwn'),\n baseIteratee = require('./_baseIteratee');\n/**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n\n\nfunction mapValues(object, iteratee) {\n var result = {};\n iteratee = baseIteratee(iteratee, 3);\n baseForOwn(object, function (value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n}\n\nmodule.exports = mapValues;","var baseExtremum = require('./_baseExtremum'),\n baseGt = require('./_baseGt'),\n identity = require('./identity');\n/**\n * Computes the maximum value of `array`. If `array` is empty or falsey,\n * `undefined` is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {*} Returns the maximum value.\n * @example\n *\n * _.max([4, 2, 8, 6]);\n * // => 8\n *\n * _.max([]);\n * // => undefined\n */\n\n\nfunction max(array) {\n return array && array.length ? baseExtremum(array, identity, baseGt) : undefined;\n}\n\nmodule.exports = max;","/**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\nfunction baseGt(value, other) {\n return value > other;\n}\n\nmodule.exports = baseGt;","var baseMerge = require('./_baseMerge'),\n createAssigner = require('./_createAssigner');\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n\n\nvar merge = createAssigner(function (object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\nmodule.exports = merge;","var Stack = require('./_Stack'),\n assignMergeValue = require('./_assignMergeValue'),\n baseFor = require('./_baseFor'),\n baseMergeDeep = require('./_baseMergeDeep'),\n isObject = require('./isObject'),\n keysIn = require('./keysIn'),\n safeGet = require('./_safeGet');\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n\n\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n\n baseFor(source, function (srcValue, key) {\n stack || (stack = new Stack());\n\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n } else {\n var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + '', object, source, stack) : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nmodule.exports = baseMerge;","var assignMergeValue = require('./_assignMergeValue'),\n cloneBuffer = require('./_cloneBuffer'),\n cloneTypedArray = require('./_cloneTypedArray'),\n copyArray = require('./_copyArray'),\n initCloneObject = require('./_initCloneObject'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLikeObject = require('./isArrayLikeObject'),\n isBuffer = require('./isBuffer'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n isPlainObject = require('./isPlainObject'),\n isTypedArray = require('./isTypedArray'),\n safeGet = require('./_safeGet'),\n toPlainObject = require('./toPlainObject');\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n\n\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n\n var newValue = customizer ? customizer(objValue, srcValue, key + '', object, source, stack) : undefined;\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n newValue = srcValue;\n\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n } else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n } else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n } else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n } else {\n newValue = [];\n }\n } else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n } else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n } else {\n isCommon = false;\n }\n }\n\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n\n assignMergeValue(object, key, newValue);\n}\n\nmodule.exports = baseMergeDeep;","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n\n\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;","var baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n\n\nfunction createAssigner(assigner) {\n return baseRest(function (object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n customizer = assigner.length > 3 && typeof customizer == 'function' ? (length--, customizer) : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n\n object = Object(object);\n\n while (++index < length) {\n var source = sources[index];\n\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n\n return object;\n });\n}\n\nmodule.exports = createAssigner;","var baseExtremum = require('./_baseExtremum'),\n baseLt = require('./_baseLt'),\n identity = require('./identity');\n/**\n * Computes the minimum value of `array`. If `array` is empty or falsey,\n * `undefined` is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {*} Returns the minimum value.\n * @example\n *\n * _.min([4, 2, 8, 6]);\n * // => 2\n *\n * _.min([]);\n * // => undefined\n */\n\n\nfunction min(array) {\n return array && array.length ? baseExtremum(array, identity, baseLt) : undefined;\n}\n\nmodule.exports = min;","var baseExtremum = require('./_baseExtremum'),\n baseIteratee = require('./_baseIteratee'),\n baseLt = require('./_baseLt');\n/**\n * This method is like `_.min` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * the value is ranked. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {*} Returns the minimum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * _.minBy(objects, function(o) { return o.n; });\n * // => { 'n': 1 }\n *\n * // The `_.property` iteratee shorthand.\n * _.minBy(objects, 'n');\n * // => { 'n': 1 }\n */\n\n\nfunction minBy(array, iteratee) {\n return array && array.length ? baseExtremum(array, baseIteratee(iteratee, 2), baseLt) : undefined;\n}\n\nmodule.exports = minBy;","var root = require('./_root');\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n\n\nvar now = function now() {\n return root.Date.now();\n};\n\nmodule.exports = now;","var basePickBy = require('./_basePickBy'),\n hasIn = require('./hasIn');\n/**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n\n\nfunction basePick(object, paths) {\n return basePickBy(object, paths, function (value, path) {\n return hasIn(object, path);\n });\n}\n\nmodule.exports = basePick;","var baseGet = require('./_baseGet'),\n baseSet = require('./_baseSet'),\n castPath = require('./_castPath');\n/**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n\n\nfunction basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n\n return result;\n}\n\nmodule.exports = basePickBy;","var assignValue = require('./_assignValue'),\n castPath = require('./_castPath'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject'),\n toKey = require('./_toKey');\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n\n\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n\n path = castPath(path, object);\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n\n if (newValue === undefined) {\n newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};\n }\n }\n\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n\n return object;\n}\n\nmodule.exports = baseSet;","var flatten = require('./flatten'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n/**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n\n\nfunction flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n}\n\nmodule.exports = flatRest;","var baseRange = require('./_baseRange'),\n isIterateeCall = require('./_isIterateeCall'),\n toFinite = require('./toFinite');\n/**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n\n\nfunction createRange(fromRight) {\n return function (start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n } // Ensure the sign of `-0` is preserved.\n\n\n start = toFinite(start);\n\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n\n step = step === undefined ? start < end ? 1 : -1 : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n}\n\nmodule.exports = createRange;","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeMax = Math.max;\n/**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n\nfunction baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n\n return result;\n}\n\nmodule.exports = baseRange;","var baseFlatten = require('./_baseFlatten'),\n baseOrderBy = require('./_baseOrderBy'),\n baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n/**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]\n */\n\n\nvar sortBy = baseRest(function (collection, iteratees) {\n if (collection == null) {\n return [];\n }\n\n var length = iteratees.length;\n\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n});\nmodule.exports = sortBy;","var arrayMap = require('./_arrayMap'),\n baseIteratee = require('./_baseIteratee'),\n baseMap = require('./_baseMap'),\n baseSortBy = require('./_baseSortBy'),\n baseUnary = require('./_baseUnary'),\n compareMultiple = require('./_compareMultiple'),\n identity = require('./identity');\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n\n\nfunction baseOrderBy(collection, iteratees, orders) {\n var index = -1;\n iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));\n var result = baseMap(collection, function (value, key, collection) {\n var criteria = arrayMap(iteratees, function (iteratee) {\n return iteratee(value);\n });\n return {\n 'criteria': criteria,\n 'index': ++index,\n 'value': value\n };\n });\n return baseSortBy(result, function (object, other) {\n return compareMultiple(object, other, orders);\n });\n}\n\nmodule.exports = baseOrderBy;","/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n var length = array.length;\n array.sort(comparer);\n\n while (length--) {\n array[length] = array[length].value;\n }\n\n return array;\n}\n\nmodule.exports = baseSortBy;","var compareAscending = require('./_compareAscending');\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n\n\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n } // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n\n\n return object.index - other.index;\n}\n\nmodule.exports = compareMultiple;","var isSymbol = require('./isSymbol');\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n\n\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {\n return 1;\n }\n\n if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {\n return -1;\n }\n }\n\n return 0;\n}\n\nmodule.exports = compareAscending;","var assignValue = require('./_assignValue'),\n baseZipObject = require('./_baseZipObject');\n/**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n\n\nfunction zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n}\n\nmodule.exports = zipObject;","/**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\nfunction baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n\n return result;\n}\n\nmodule.exports = baseZipObject;","\"use strict\";\n\nvar _ = require(\"./lodash\");\n\nvar greedyFAS = require(\"./greedy-fas\");\n\nmodule.exports = {\n run: run,\n undo: undo\n};\n\nfunction run(g) {\n var fas = g.graph().acyclicer === \"greedy\" ? greedyFAS(g, weightFn(g)) : dfsFAS(g);\n\n _.forEach(fas, function (e) {\n var label = g.edge(e);\n g.removeEdge(e);\n label.forwardName = e.name;\n label.reversed = true;\n g.setEdge(e.w, e.v, label, _.uniqueId(\"rev\"));\n });\n\n function weightFn(g) {\n return function (e) {\n return g.edge(e).weight;\n };\n }\n}\n\nfunction dfsFAS(g) {\n var fas = [];\n var stack = {};\n var visited = {};\n\n function dfs(v) {\n if (_.has(visited, v)) {\n return;\n }\n\n visited[v] = true;\n stack[v] = true;\n\n _.forEach(g.outEdges(v), function (e) {\n if (_.has(stack, e.w)) {\n fas.push(e);\n } else {\n dfs(e.w);\n }\n });\n\n delete stack[v];\n }\n\n _.forEach(g.nodes(), dfs);\n\n return fas;\n}\n\nfunction undo(g) {\n _.forEach(g.edges(), function (e) {\n var label = g.edge(e);\n\n if (label.reversed) {\n g.removeEdge(e);\n var forwardName = label.forwardName;\n delete label.reversed;\n delete label.forwardName;\n g.setEdge(e.w, e.v, label, forwardName);\n }\n });\n}","var _ = require(\"./lodash\");\n\nvar Graph = require(\"./graphlib\").Graph;\n\nvar List = require(\"./data/list\");\n/*\n * A greedy heuristic for finding a feedback arc set for a graph. A feedback\n * arc set is a set of edges that can be removed to make a graph acyclic.\n * The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, \"A fast and\n * effective heuristic for the feedback arc set problem.\" This implementation\n * adjusts that from the paper to allow for weighted edges.\n */\n\n\nmodule.exports = greedyFAS;\n\nvar DEFAULT_WEIGHT_FN = _.constant(1);\n\nfunction greedyFAS(g, weightFn) {\n if (g.nodeCount() <= 1) {\n return [];\n }\n\n var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN);\n var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx); // Expand multi-edges\n\n return _.flatten(_.map(results, function (e) {\n return g.outEdges(e.v, e.w);\n }), true);\n}\n\nfunction doGreedyFAS(g, buckets, zeroIdx) {\n var results = [];\n var sources = buckets[buckets.length - 1];\n var sinks = buckets[0];\n var entry;\n\n while (g.nodeCount()) {\n while (entry = sinks.dequeue()) {\n removeNode(g, buckets, zeroIdx, entry);\n }\n\n while (entry = sources.dequeue()) {\n removeNode(g, buckets, zeroIdx, entry);\n }\n\n if (g.nodeCount()) {\n for (var i = buckets.length - 2; i > 0; --i) {\n entry = buckets[i].dequeue();\n\n if (entry) {\n results = results.concat(removeNode(g, buckets, zeroIdx, entry, true));\n break;\n }\n }\n }\n }\n\n return results;\n}\n\nfunction removeNode(g, buckets, zeroIdx, entry, collectPredecessors) {\n var results = collectPredecessors ? [] : undefined;\n\n _.forEach(g.inEdges(entry.v), function (edge) {\n var weight = g.edge(edge);\n var uEntry = g.node(edge.v);\n\n if (collectPredecessors) {\n results.push({\n v: edge.v,\n w: edge.w\n });\n }\n\n uEntry.out -= weight;\n assignBucket(buckets, zeroIdx, uEntry);\n });\n\n _.forEach(g.outEdges(entry.v), function (edge) {\n var weight = g.edge(edge);\n var w = edge.w;\n var wEntry = g.node(w);\n wEntry[\"in\"] -= weight;\n assignBucket(buckets, zeroIdx, wEntry);\n });\n\n g.removeNode(entry.v);\n return results;\n}\n\nfunction buildState(g, weightFn) {\n var fasGraph = new Graph();\n var maxIn = 0;\n var maxOut = 0;\n\n _.forEach(g.nodes(), function (v) {\n fasGraph.setNode(v, {\n v: v,\n \"in\": 0,\n out: 0\n });\n }); // Aggregate weights on nodes, but also sum the weights across multi-edges\n // into a single edge for the fasGraph.\n\n\n _.forEach(g.edges(), function (e) {\n var prevWeight = fasGraph.edge(e.v, e.w) || 0;\n var weight = weightFn(e);\n var edgeWeight = prevWeight + weight;\n fasGraph.setEdge(e.v, e.w, edgeWeight);\n maxOut = Math.max(maxOut, fasGraph.node(e.v).out += weight);\n maxIn = Math.max(maxIn, fasGraph.node(e.w)[\"in\"] += weight);\n });\n\n var buckets = _.range(maxOut + maxIn + 3).map(function () {\n return new List();\n });\n\n var zeroIdx = maxIn + 1;\n\n _.forEach(fasGraph.nodes(), function (v) {\n assignBucket(buckets, zeroIdx, fasGraph.node(v));\n });\n\n return {\n graph: fasGraph,\n buckets: buckets,\n zeroIdx: zeroIdx\n };\n}\n\nfunction assignBucket(buckets, zeroIdx, entry) {\n if (!entry.out) {\n buckets[0].enqueue(entry);\n } else if (!entry[\"in\"]) {\n buckets[buckets.length - 1].enqueue(entry);\n } else {\n buckets[entry.out - entry[\"in\"] + zeroIdx].enqueue(entry);\n }\n}","/*\n * Simple doubly linked list implementation derived from Cormen, et al.,\n * \"Introduction to Algorithms\".\n */\nmodule.exports = List;\n\nfunction List() {\n var sentinel = {};\n sentinel._next = sentinel._prev = sentinel;\n this._sentinel = sentinel;\n}\n\nList.prototype.dequeue = function () {\n var sentinel = this._sentinel;\n var entry = sentinel._prev;\n\n if (entry !== sentinel) {\n unlink(entry);\n return entry;\n }\n};\n\nList.prototype.enqueue = function (entry) {\n var sentinel = this._sentinel;\n\n if (entry._prev && entry._next) {\n unlink(entry);\n }\n\n entry._next = sentinel._next;\n sentinel._next._prev = entry;\n sentinel._next = entry;\n entry._prev = sentinel;\n};\n\nList.prototype.toString = function () {\n var strs = [];\n var sentinel = this._sentinel;\n var curr = sentinel._prev;\n\n while (curr !== sentinel) {\n strs.push(JSON.stringify(curr, filterOutLinks));\n curr = curr._prev;\n }\n\n return \"[\" + strs.join(\", \") + \"]\";\n};\n\nfunction unlink(entry) {\n entry._prev._next = entry._next;\n entry._next._prev = entry._prev;\n delete entry._next;\n delete entry._prev;\n}\n\nfunction filterOutLinks(k, v) {\n if (k !== \"_next\" && k !== \"_prev\") {\n return v;\n }\n}","\"use strict\";\n\nvar _ = require(\"./lodash\");\n\nvar util = require(\"./util\");\n\nmodule.exports = {\n run: run,\n undo: undo\n};\n/*\n * Breaks any long edges in the graph into short segments that span 1 layer\n * each. This operation is undoable with the denormalize function.\n *\n * Pre-conditions:\n *\n * 1. The input graph is a DAG.\n * 2. Each node in the graph has a \"rank\" property.\n *\n * Post-condition:\n *\n * 1. All edges in the graph have a length of 1.\n * 2. Dummy nodes are added where edges have been split into segments.\n * 3. The graph is augmented with a \"dummyChains\" attribute which contains\n * the first dummy in each chain of dummy nodes produced.\n */\n\nfunction run(g) {\n g.graph().dummyChains = [];\n\n _.forEach(g.edges(), function (edge) {\n normalizeEdge(g, edge);\n });\n}\n\nfunction normalizeEdge(g, e) {\n var v = e.v;\n var vRank = g.node(v).rank;\n var w = e.w;\n var wRank = g.node(w).rank;\n var name = e.name;\n var edgeLabel = g.edge(e);\n var labelRank = edgeLabel.labelRank;\n if (wRank === vRank + 1) return;\n g.removeEdge(e);\n var dummy, attrs, i;\n\n for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) {\n edgeLabel.points = [];\n attrs = {\n width: 0,\n height: 0,\n edgeLabel: edgeLabel,\n edgeObj: e,\n rank: vRank\n };\n dummy = util.addDummyNode(g, \"edge\", attrs, \"_d\");\n\n if (vRank === labelRank) {\n attrs.width = edgeLabel.width;\n attrs.height = edgeLabel.height;\n attrs.dummy = \"edge-label\";\n attrs.labelpos = edgeLabel.labelpos;\n }\n\n g.setEdge(v, dummy, {\n weight: edgeLabel.weight\n }, name);\n\n if (i === 0) {\n g.graph().dummyChains.push(dummy);\n }\n\n v = dummy;\n }\n\n g.setEdge(v, w, {\n weight: edgeLabel.weight\n }, name);\n}\n\nfunction undo(g) {\n _.forEach(g.graph().dummyChains, function (v) {\n var node = g.node(v);\n var origLabel = node.edgeLabel;\n var w;\n g.setEdge(node.edgeObj, origLabel);\n\n while (node.dummy) {\n w = g.successors(v)[0];\n g.removeNode(v);\n origLabel.points.push({\n x: node.x,\n y: node.y\n });\n\n if (node.dummy === \"edge-label\") {\n origLabel.x = node.x;\n origLabel.y = node.y;\n origLabel.width = node.width;\n origLabel.height = node.height;\n }\n\n v = w;\n node = g.node(v);\n }\n });\n}","\"use strict\";\n\nvar rankUtil = require(\"./util\");\n\nvar longestPath = rankUtil.longestPath;\n\nvar feasibleTree = require(\"./feasible-tree\");\n\nvar networkSimplex = require(\"./network-simplex\");\n\nmodule.exports = rank;\n/*\n * Assigns a rank to each node in the input graph that respects the \"minlen\"\n * constraint specified on edges between nodes.\n *\n * This basic structure is derived from Gansner, et al., \"A Technique for\n * Drawing Directed Graphs.\"\n *\n * Pre-conditions:\n *\n * 1. Graph must be a connected DAG\n * 2. Graph nodes must be objects\n * 3. Graph edges must have \"weight\" and \"minlen\" attributes\n *\n * Post-conditions:\n *\n * 1. Graph nodes will have a \"rank\" attribute based on the results of the\n * algorithm. Ranks can start at any index (including negative), we'll\n * fix them up later.\n */\n\nfunction rank(g) {\n switch (g.graph().ranker) {\n case \"network-simplex\":\n networkSimplexRanker(g);\n break;\n\n case \"tight-tree\":\n tightTreeRanker(g);\n break;\n\n case \"longest-path\":\n longestPathRanker(g);\n break;\n\n default:\n networkSimplexRanker(g);\n }\n} // A fast and simple ranker, but results are far from optimal.\n\n\nvar longestPathRanker = longestPath;\n\nfunction tightTreeRanker(g) {\n longestPath(g);\n feasibleTree(g);\n}\n\nfunction networkSimplexRanker(g) {\n networkSimplex(g);\n}","\"use strict\";\n\nvar _ = require(\"../lodash\");\n\nvar feasibleTree = require(\"./feasible-tree\");\n\nvar slack = require(\"./util\").slack;\n\nvar initRank = require(\"./util\").longestPath;\n\nvar preorder = require(\"../graphlib\").alg.preorder;\n\nvar postorder = require(\"../graphlib\").alg.postorder;\n\nvar simplify = require(\"../util\").simplify;\n\nmodule.exports = networkSimplex; // Expose some internals for testing purposes\n\nnetworkSimplex.initLowLimValues = initLowLimValues;\nnetworkSimplex.initCutValues = initCutValues;\nnetworkSimplex.calcCutValue = calcCutValue;\nnetworkSimplex.leaveEdge = leaveEdge;\nnetworkSimplex.enterEdge = enterEdge;\nnetworkSimplex.exchangeEdges = exchangeEdges;\n/*\n * The network simplex algorithm assigns ranks to each node in the input graph\n * and iteratively improves the ranking to reduce the length of edges.\n *\n * Preconditions:\n *\n * 1. The input graph must be a DAG.\n * 2. All nodes in the graph must have an object value.\n * 3. All edges in the graph must have \"minlen\" and \"weight\" attributes.\n *\n * Postconditions:\n *\n * 1. All nodes in the graph will have an assigned \"rank\" attribute that has\n * been optimized by the network simplex algorithm. Ranks start at 0.\n *\n *\n * A rough sketch of the algorithm is as follows:\n *\n * 1. Assign initial ranks to each node. We use the longest path algorithm,\n * which assigns ranks to the lowest position possible. In general this\n * leads to very wide bottom ranks and unnecessarily long edges.\n * 2. Construct a feasible tight tree. A tight tree is one such that all\n * edges in the tree have no slack (difference between length of edge\n * and minlen for the edge). This by itself greatly improves the assigned\n * rankings by shorting edges.\n * 3. Iteratively find edges that have negative cut values. Generally a\n * negative cut value indicates that the edge could be removed and a new\n * tree edge could be added to produce a more compact graph.\n *\n * Much of the algorithms here are derived from Gansner, et al., \"A Technique\n * for Drawing Directed Graphs.\" The structure of the file roughly follows the\n * structure of the overall algorithm.\n */\n\nfunction networkSimplex(g) {\n g = simplify(g);\n initRank(g);\n var t = feasibleTree(g);\n initLowLimValues(t);\n initCutValues(t, g);\n var e, f;\n\n while (e = leaveEdge(t)) {\n f = enterEdge(t, g, e);\n exchangeEdges(t, g, e, f);\n }\n}\n/*\n * Initializes cut values for all edges in the tree.\n */\n\n\nfunction initCutValues(t, g) {\n var vs = postorder(t, t.nodes());\n vs = vs.slice(0, vs.length - 1);\n\n _.forEach(vs, function (v) {\n assignCutValue(t, g, v);\n });\n}\n\nfunction assignCutValue(t, g, child) {\n var childLab = t.node(child);\n var parent = childLab.parent;\n t.edge(child, parent).cutvalue = calcCutValue(t, g, child);\n}\n/*\n * Given the tight tree, its graph, and a child in the graph calculate and\n * return the cut value for the edge between the child and its parent.\n */\n\n\nfunction calcCutValue(t, g, child) {\n var childLab = t.node(child);\n var parent = childLab.parent; // True if the child is on the tail end of the edge in the directed graph\n\n var childIsTail = true; // The graph's view of the tree edge we're inspecting\n\n var graphEdge = g.edge(child, parent); // The accumulated cut value for the edge between this node and its parent\n\n var cutValue = 0;\n\n if (!graphEdge) {\n childIsTail = false;\n graphEdge = g.edge(parent, child);\n }\n\n cutValue = graphEdge.weight;\n\n _.forEach(g.nodeEdges(child), function (e) {\n var isOutEdge = e.v === child,\n other = isOutEdge ? e.w : e.v;\n\n if (other !== parent) {\n var pointsToHead = isOutEdge === childIsTail,\n otherWeight = g.edge(e).weight;\n cutValue += pointsToHead ? otherWeight : -otherWeight;\n\n if (isTreeEdge(t, child, other)) {\n var otherCutValue = t.edge(child, other).cutvalue;\n cutValue += pointsToHead ? -otherCutValue : otherCutValue;\n }\n }\n });\n\n return cutValue;\n}\n\nfunction initLowLimValues(tree, root) {\n if (arguments.length < 2) {\n root = tree.nodes()[0];\n }\n\n dfsAssignLowLim(tree, {}, 1, root);\n}\n\nfunction dfsAssignLowLim(tree, visited, nextLim, v, parent) {\n var low = nextLim;\n var label = tree.node(v);\n visited[v] = true;\n\n _.forEach(tree.neighbors(v), function (w) {\n if (!_.has(visited, w)) {\n nextLim = dfsAssignLowLim(tree, visited, nextLim, w, v);\n }\n });\n\n label.low = low;\n label.lim = nextLim++;\n\n if (parent) {\n label.parent = parent;\n } else {\n // TODO should be able to remove this when we incrementally update low lim\n delete label.parent;\n }\n\n return nextLim;\n}\n\nfunction leaveEdge(tree) {\n return _.find(tree.edges(), function (e) {\n return tree.edge(e).cutvalue < 0;\n });\n}\n\nfunction enterEdge(t, g, edge) {\n var v = edge.v;\n var w = edge.w; // For the rest of this function we assume that v is the tail and w is the\n // head, so if we don't have this edge in the graph we should flip it to\n // match the correct orientation.\n\n if (!g.hasEdge(v, w)) {\n v = edge.w;\n w = edge.v;\n }\n\n var vLabel = t.node(v);\n var wLabel = t.node(w);\n var tailLabel = vLabel;\n var flip = false; // If the root is in the tail of the edge then we need to flip the logic that\n // checks for the head and tail nodes in the candidates function below.\n\n if (vLabel.lim > wLabel.lim) {\n tailLabel = wLabel;\n flip = true;\n }\n\n var candidates = _.filter(g.edges(), function (edge) {\n return flip === isDescendant(t, t.node(edge.v), tailLabel) && flip !== isDescendant(t, t.node(edge.w), tailLabel);\n });\n\n return _.minBy(candidates, function (edge) {\n return slack(g, edge);\n });\n}\n\nfunction exchangeEdges(t, g, e, f) {\n var v = e.v;\n var w = e.w;\n t.removeEdge(v, w);\n t.setEdge(f.v, f.w, {});\n initLowLimValues(t);\n initCutValues(t, g);\n updateRanks(t, g);\n}\n\nfunction updateRanks(t, g) {\n var root = _.find(t.nodes(), function (v) {\n return !g.node(v).parent;\n });\n\n var vs = preorder(t, root);\n vs = vs.slice(1);\n\n _.forEach(vs, function (v) {\n var parent = t.node(v).parent,\n edge = g.edge(v, parent),\n flipped = false;\n\n if (!edge) {\n edge = g.edge(parent, v);\n flipped = true;\n }\n\n g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen);\n });\n}\n/*\n * Returns true if the edge is in the tree.\n */\n\n\nfunction isTreeEdge(tree, u, v) {\n return tree.hasEdge(u, v);\n}\n/*\n * Returns true if the specified node is descendant of the root node per the\n * assigned low and lim attributes in the tree.\n */\n\n\nfunction isDescendant(tree, vLabel, rootLabel) {\n return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim;\n}","var _ = require(\"./lodash\");\n\nmodule.exports = parentDummyChains;\n\nfunction parentDummyChains(g) {\n var postorderNums = postorder(g);\n\n _.forEach(g.graph().dummyChains, function (v) {\n var node = g.node(v);\n var edgeObj = node.edgeObj;\n var pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w);\n var path = pathData.path;\n var lca = pathData.lca;\n var pathIdx = 0;\n var pathV = path[pathIdx];\n var ascending = true;\n\n while (v !== edgeObj.w) {\n node = g.node(v);\n\n if (ascending) {\n while ((pathV = path[pathIdx]) !== lca && g.node(pathV).maxRank < node.rank) {\n pathIdx++;\n }\n\n if (pathV === lca) {\n ascending = false;\n }\n }\n\n if (!ascending) {\n while (pathIdx < path.length - 1 && g.node(pathV = path[pathIdx + 1]).minRank <= node.rank) {\n pathIdx++;\n }\n\n pathV = path[pathIdx];\n }\n\n g.setParent(v, pathV);\n v = g.successors(v)[0];\n }\n });\n} // Find a path from v to w through the lowest common ancestor (LCA). Return the\n// full path and the LCA.\n\n\nfunction findPath(g, postorderNums, v, w) {\n var vPath = [];\n var wPath = [];\n var low = Math.min(postorderNums[v].low, postorderNums[w].low);\n var lim = Math.max(postorderNums[v].lim, postorderNums[w].lim);\n var parent;\n var lca; // Traverse up from v to find the LCA\n\n parent = v;\n\n do {\n parent = g.parent(parent);\n vPath.push(parent);\n } while (parent && (postorderNums[parent].low > low || lim > postorderNums[parent].lim));\n\n lca = parent; // Traverse from w to LCA\n\n parent = w;\n\n while ((parent = g.parent(parent)) !== lca) {\n wPath.push(parent);\n }\n\n return {\n path: vPath.concat(wPath.reverse()),\n lca: lca\n };\n}\n\nfunction postorder(g) {\n var result = {};\n var lim = 0;\n\n function dfs(v) {\n var low = lim;\n\n _.forEach(g.children(v), dfs);\n\n result[v] = {\n low: low,\n lim: lim++\n };\n }\n\n _.forEach(g.children(), dfs);\n\n return result;\n}","var _ = require(\"./lodash\");\n\nvar util = require(\"./util\");\n\nmodule.exports = {\n run: run,\n cleanup: cleanup\n};\n/*\n * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs,\n * adds appropriate edges to ensure that all cluster nodes are placed between\n * these boundries, and ensures that the graph is connected.\n *\n * In addition we ensure, through the use of the minlen property, that nodes\n * and subgraph border nodes to not end up on the same rank.\n *\n * Preconditions:\n *\n * 1. Input graph is a DAG\n * 2. Nodes in the input graph has a minlen attribute\n *\n * Postconditions:\n *\n * 1. Input graph is connected.\n * 2. Dummy nodes are added for the tops and bottoms of subgraphs.\n * 3. The minlen attribute for nodes is adjusted to ensure nodes do not\n * get placed on the same rank as subgraph border nodes.\n *\n * The nesting graph idea comes from Sander, \"Layout of Compound Directed\n * Graphs.\"\n */\n\nfunction run(g) {\n var root = util.addDummyNode(g, \"root\", {}, \"_root\");\n var depths = treeDepths(g);\n var height = _.max(_.values(depths)) - 1; // Note: depths is an Object not an array\n\n var nodeSep = 2 * height + 1;\n g.graph().nestingRoot = root; // Multiply minlen by nodeSep to align nodes on non-border ranks.\n\n _.forEach(g.edges(), function (e) {\n g.edge(e).minlen *= nodeSep;\n }); // Calculate a weight that is sufficient to keep subgraphs vertically compact\n\n\n var weight = sumWeights(g) + 1; // Create border nodes and link them up\n\n _.forEach(g.children(), function (child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n }); // Save the multiplier for node layers for later removal of empty border\n // layers.\n\n\n g.graph().nodeRankFactor = nodeSep;\n}\n\nfunction dfs(g, root, nodeSep, weight, height, depths, v) {\n var children = g.children(v);\n\n if (!children.length) {\n if (v !== root) {\n g.setEdge(root, v, {\n weight: 0,\n minlen: nodeSep\n });\n }\n\n return;\n }\n\n var top = util.addBorderNode(g, \"_bt\");\n var bottom = util.addBorderNode(g, \"_bb\");\n var label = g.node(v);\n g.setParent(top, v);\n label.borderTop = top;\n g.setParent(bottom, v);\n label.borderBottom = bottom;\n\n _.forEach(children, function (child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n var childNode = g.node(child);\n var childTop = childNode.borderTop ? childNode.borderTop : child;\n var childBottom = childNode.borderBottom ? childNode.borderBottom : child;\n var thisWeight = childNode.borderTop ? weight : 2 * weight;\n var minlen = childTop !== childBottom ? 1 : height - depths[v] + 1;\n g.setEdge(top, childTop, {\n weight: thisWeight,\n minlen: minlen,\n nestingEdge: true\n });\n g.setEdge(childBottom, bottom, {\n weight: thisWeight,\n minlen: minlen,\n nestingEdge: true\n });\n });\n\n if (!g.parent(v)) {\n g.setEdge(root, top, {\n weight: 0,\n minlen: height + depths[v]\n });\n }\n}\n\nfunction treeDepths(g) {\n var depths = {};\n\n function dfs(v, depth) {\n var children = g.children(v);\n\n if (children && children.length) {\n _.forEach(children, function (child) {\n dfs(child, depth + 1);\n });\n }\n\n depths[v] = depth;\n }\n\n _.forEach(g.children(), function (v) {\n dfs(v, 1);\n });\n\n return depths;\n}\n\nfunction sumWeights(g) {\n return _.reduce(g.edges(), function (acc, e) {\n return acc + g.edge(e).weight;\n }, 0);\n}\n\nfunction cleanup(g) {\n var graphLabel = g.graph();\n g.removeNode(graphLabel.nestingRoot);\n delete graphLabel.nestingRoot;\n\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n\n if (edge.nestingEdge) {\n g.removeEdge(e);\n }\n });\n}","var _ = require(\"./lodash\");\n\nvar util = require(\"./util\");\n\nmodule.exports = addBorderSegments;\n\nfunction addBorderSegments(g) {\n function dfs(v) {\n var children = g.children(v);\n var node = g.node(v);\n\n if (children.length) {\n _.forEach(children, dfs);\n }\n\n if (_.has(node, \"minRank\")) {\n node.borderLeft = [];\n node.borderRight = [];\n\n for (var rank = node.minRank, maxRank = node.maxRank + 1; rank < maxRank; ++rank) {\n addBorderNode(g, \"borderLeft\", \"_bl\", v, node, rank);\n addBorderNode(g, \"borderRight\", \"_br\", v, node, rank);\n }\n }\n }\n\n _.forEach(g.children(), dfs);\n}\n\nfunction addBorderNode(g, prop, prefix, sg, sgNode, rank) {\n var label = {\n width: 0,\n height: 0,\n rank: rank,\n borderType: prop\n };\n var prev = sgNode[prop][rank - 1];\n var curr = util.addDummyNode(g, \"border\", label, prefix);\n sgNode[prop][rank] = curr;\n g.setParent(curr, sg);\n\n if (prev) {\n g.setEdge(prev, curr, {\n weight: 1\n });\n }\n}","\"use strict\";\n\nvar _ = require(\"./lodash\");\n\nmodule.exports = {\n adjust: adjust,\n undo: undo\n};\n\nfunction adjust(g) {\n var rankDir = g.graph().rankdir.toLowerCase();\n\n if (rankDir === \"lr\" || rankDir === \"rl\") {\n swapWidthHeight(g);\n }\n}\n\nfunction undo(g) {\n var rankDir = g.graph().rankdir.toLowerCase();\n\n if (rankDir === \"bt\" || rankDir === \"rl\") {\n reverseY(g);\n }\n\n if (rankDir === \"lr\" || rankDir === \"rl\") {\n swapXY(g);\n swapWidthHeight(g);\n }\n}\n\nfunction swapWidthHeight(g) {\n _.forEach(g.nodes(), function (v) {\n swapWidthHeightOne(g.node(v));\n });\n\n _.forEach(g.edges(), function (e) {\n swapWidthHeightOne(g.edge(e));\n });\n}\n\nfunction swapWidthHeightOne(attrs) {\n var w = attrs.width;\n attrs.width = attrs.height;\n attrs.height = w;\n}\n\nfunction reverseY(g) {\n _.forEach(g.nodes(), function (v) {\n reverseYOne(g.node(v));\n });\n\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n\n _.forEach(edge.points, reverseYOne);\n\n if (_.has(edge, \"y\")) {\n reverseYOne(edge);\n }\n });\n}\n\nfunction reverseYOne(attrs) {\n attrs.y = -attrs.y;\n}\n\nfunction swapXY(g) {\n _.forEach(g.nodes(), function (v) {\n swapXYOne(g.node(v));\n });\n\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n\n _.forEach(edge.points, swapXYOne);\n\n if (_.has(edge, \"x\")) {\n swapXYOne(edge);\n }\n });\n}\n\nfunction swapXYOne(attrs) {\n var x = attrs.x;\n attrs.x = attrs.y;\n attrs.y = x;\n}","\"use strict\";\n\nvar _ = require(\"../lodash\");\n\nvar initOrder = require(\"./init-order\");\n\nvar crossCount = require(\"./cross-count\");\n\nvar sortSubgraph = require(\"./sort-subgraph\");\n\nvar buildLayerGraph = require(\"./build-layer-graph\");\n\nvar addSubgraphConstraints = require(\"./add-subgraph-constraints\");\n\nvar Graph = require(\"../graphlib\").Graph;\n\nvar util = require(\"../util\");\n\nmodule.exports = order;\n/*\n * Applies heuristics to minimize edge crossings in the graph and sets the best\n * order solution as an order attribute on each node.\n *\n * Pre-conditions:\n *\n * 1. Graph must be DAG\n * 2. Graph nodes must be objects with a \"rank\" attribute\n * 3. Graph edges must have the \"weight\" attribute\n *\n * Post-conditions:\n *\n * 1. Graph nodes will have an \"order\" attribute based on the results of the\n * algorithm.\n */\n\nfunction order(g) {\n var maxRank = util.maxRank(g),\n downLayerGraphs = buildLayerGraphs(g, _.range(1, maxRank + 1), \"inEdges\"),\n upLayerGraphs = buildLayerGraphs(g, _.range(maxRank - 1, -1, -1), \"outEdges\");\n var layering = initOrder(g);\n assignOrder(g, layering);\n var bestCC = Number.POSITIVE_INFINITY,\n best;\n\n for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) {\n sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2);\n layering = util.buildLayerMatrix(g);\n var cc = crossCount(g, layering);\n\n if (cc < bestCC) {\n lastBest = 0;\n best = _.cloneDeep(layering);\n bestCC = cc;\n }\n }\n\n assignOrder(g, best);\n}\n\nfunction buildLayerGraphs(g, ranks, relationship) {\n return _.map(ranks, function (rank) {\n return buildLayerGraph(g, rank, relationship);\n });\n}\n\nfunction sweepLayerGraphs(layerGraphs, biasRight) {\n var cg = new Graph();\n\n _.forEach(layerGraphs, function (lg) {\n var root = lg.graph().root;\n var sorted = sortSubgraph(lg, root, cg, biasRight);\n\n _.forEach(sorted.vs, function (v, i) {\n lg.node(v).order = i;\n });\n\n addSubgraphConstraints(lg, cg, sorted.vs);\n });\n}\n\nfunction assignOrder(g, layering) {\n _.forEach(layering, function (layer) {\n _.forEach(layer, function (v, i) {\n g.node(v).order = i;\n });\n });\n}","\"use strict\";\n\nvar _ = require(\"../lodash\");\n\nmodule.exports = initOrder;\n/*\n * Assigns an initial order value for each node by performing a DFS search\n * starting from nodes in the first rank. Nodes are assigned an order in their\n * rank as they are first visited.\n *\n * This approach comes from Gansner, et al., \"A Technique for Drawing Directed\n * Graphs.\"\n *\n * Returns a layering matrix with an array per layer and each layer sorted by\n * the order of its nodes.\n */\n\nfunction initOrder(g) {\n var visited = {};\n\n var simpleNodes = _.filter(g.nodes(), function (v) {\n return !g.children(v).length;\n });\n\n var maxRank = _.max(_.map(simpleNodes, function (v) {\n return g.node(v).rank;\n }));\n\n var layers = _.map(_.range(maxRank + 1), function () {\n return [];\n });\n\n function dfs(v) {\n if (_.has(visited, v)) return;\n visited[v] = true;\n var node = g.node(v);\n layers[node.rank].push(v);\n\n _.forEach(g.successors(v), dfs);\n }\n\n var orderedVs = _.sortBy(simpleNodes, function (v) {\n return g.node(v).rank;\n });\n\n _.forEach(orderedVs, dfs);\n\n return layers;\n}","\"use strict\";\n\nvar _ = require(\"../lodash\");\n\nmodule.exports = crossCount;\n/*\n * A function that takes a layering (an array of layers, each with an array of\n * ordererd nodes) and a graph and returns a weighted crossing count.\n *\n * Pre-conditions:\n *\n * 1. Input graph must be simple (not a multigraph), directed, and include\n * only simple edges.\n * 2. Edges in the input graph must have assigned weights.\n *\n * Post-conditions:\n *\n * 1. The graph and layering matrix are left unchanged.\n *\n * This algorithm is derived from Barth, et al., \"Bilayer Cross Counting.\"\n */\n\nfunction crossCount(g, layering) {\n var cc = 0;\n\n for (var i = 1; i < layering.length; ++i) {\n cc += twoLayerCrossCount(g, layering[i - 1], layering[i]);\n }\n\n return cc;\n}\n\nfunction twoLayerCrossCount(g, northLayer, southLayer) {\n // Sort all of the edges between the north and south layers by their position\n // in the north layer and then the south. Map these edges to the position of\n // their head in the south layer.\n var southPos = _.zipObject(southLayer, _.map(southLayer, function (v, i) {\n return i;\n }));\n\n var southEntries = _.flatten(_.map(northLayer, function (v) {\n return _.sortBy(_.map(g.outEdges(v), function (e) {\n return {\n pos: southPos[e.w],\n weight: g.edge(e).weight\n };\n }), \"pos\");\n }), true); // Build the accumulator tree\n\n\n var firstIndex = 1;\n\n while (firstIndex < southLayer.length) {\n firstIndex <<= 1;\n }\n\n var treeSize = 2 * firstIndex - 1;\n firstIndex -= 1;\n\n var tree = _.map(new Array(treeSize), function () {\n return 0;\n }); // Calculate the weighted crossings\n\n\n var cc = 0;\n\n _.forEach(southEntries.forEach(function (entry) {\n var index = entry.pos + firstIndex;\n tree[index] += entry.weight;\n var weightSum = 0;\n\n while (index > 0) {\n if (index % 2) {\n weightSum += tree[index + 1];\n }\n\n index = index - 1 >> 1;\n tree[index] += entry.weight;\n }\n\n cc += entry.weight * weightSum;\n }));\n\n return cc;\n}","var _ = require(\"../lodash\");\n\nvar barycenter = require(\"./barycenter\");\n\nvar resolveConflicts = require(\"./resolve-conflicts\");\n\nvar sort = require(\"./sort\");\n\nmodule.exports = sortSubgraph;\n\nfunction sortSubgraph(g, v, cg, biasRight) {\n var movable = g.children(v);\n var node = g.node(v);\n var bl = node ? node.borderLeft : undefined;\n var br = node ? node.borderRight : undefined;\n var subgraphs = {};\n\n if (bl) {\n movable = _.filter(movable, function (w) {\n return w !== bl && w !== br;\n });\n }\n\n var barycenters = barycenter(g, movable);\n\n _.forEach(barycenters, function (entry) {\n if (g.children(entry.v).length) {\n var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight);\n subgraphs[entry.v] = subgraphResult;\n\n if (_.has(subgraphResult, \"barycenter\")) {\n mergeBarycenters(entry, subgraphResult);\n }\n }\n });\n\n var entries = resolveConflicts(barycenters, cg);\n expandSubgraphs(entries, subgraphs);\n var result = sort(entries, biasRight);\n\n if (bl) {\n result.vs = _.flatten([bl, result.vs, br], true);\n\n if (g.predecessors(bl).length) {\n var blPred = g.node(g.predecessors(bl)[0]),\n brPred = g.node(g.predecessors(br)[0]);\n\n if (!_.has(result, \"barycenter\")) {\n result.barycenter = 0;\n result.weight = 0;\n }\n\n result.barycenter = (result.barycenter * result.weight + blPred.order + brPred.order) / (result.weight + 2);\n result.weight += 2;\n }\n }\n\n return result;\n}\n\nfunction expandSubgraphs(entries, subgraphs) {\n _.forEach(entries, function (entry) {\n entry.vs = _.flatten(entry.vs.map(function (v) {\n if (subgraphs[v]) {\n return subgraphs[v].vs;\n }\n\n return v;\n }), true);\n });\n}\n\nfunction mergeBarycenters(target, other) {\n if (!_.isUndefined(target.barycenter)) {\n target.barycenter = (target.barycenter * target.weight + other.barycenter * other.weight) / (target.weight + other.weight);\n target.weight += other.weight;\n } else {\n target.barycenter = other.barycenter;\n target.weight = other.weight;\n }\n}","var _ = require(\"../lodash\");\n\nmodule.exports = barycenter;\n\nfunction barycenter(g, movable) {\n return _.map(movable, function (v) {\n var inV = g.inEdges(v);\n\n if (!inV.length) {\n return {\n v: v\n };\n } else {\n var result = _.reduce(inV, function (acc, e) {\n var edge = g.edge(e),\n nodeU = g.node(e.v);\n return {\n sum: acc.sum + edge.weight * nodeU.order,\n weight: acc.weight + edge.weight\n };\n }, {\n sum: 0,\n weight: 0\n });\n\n return {\n v: v,\n barycenter: result.sum / result.weight,\n weight: result.weight\n };\n }\n });\n}","\"use strict\";\n\nvar _ = require(\"../lodash\");\n\nmodule.exports = resolveConflicts;\n/*\n * Given a list of entries of the form {v, barycenter, weight} and a\n * constraint graph this function will resolve any conflicts between the\n * constraint graph and the barycenters for the entries. If the barycenters for\n * an entry would violate a constraint in the constraint graph then we coalesce\n * the nodes in the conflict into a new node that respects the contraint and\n * aggregates barycenter and weight information.\n *\n * This implementation is based on the description in Forster, \"A Fast and\n * Simple Hueristic for Constrained Two-Level Crossing Reduction,\" thought it\n * differs in some specific details.\n *\n * Pre-conditions:\n *\n * 1. Each entry has the form {v, barycenter, weight}, or if the node has\n * no barycenter, then {v}.\n *\n * Returns:\n *\n * A new list of entries of the form {vs, i, barycenter, weight}. The list\n * `vs` may either be a singleton or it may be an aggregation of nodes\n * ordered such that they do not violate constraints from the constraint\n * graph. The property `i` is the lowest original index of any of the\n * elements in `vs`.\n */\n\nfunction resolveConflicts(entries, cg) {\n var mappedEntries = {};\n\n _.forEach(entries, function (entry, i) {\n var tmp = mappedEntries[entry.v] = {\n indegree: 0,\n \"in\": [],\n out: [],\n vs: [entry.v],\n i: i\n };\n\n if (!_.isUndefined(entry.barycenter)) {\n tmp.barycenter = entry.barycenter;\n tmp.weight = entry.weight;\n }\n });\n\n _.forEach(cg.edges(), function (e) {\n var entryV = mappedEntries[e.v];\n var entryW = mappedEntries[e.w];\n\n if (!_.isUndefined(entryV) && !_.isUndefined(entryW)) {\n entryW.indegree++;\n entryV.out.push(mappedEntries[e.w]);\n }\n });\n\n var sourceSet = _.filter(mappedEntries, function (entry) {\n return !entry.indegree;\n });\n\n return doResolveConflicts(sourceSet);\n}\n\nfunction doResolveConflicts(sourceSet) {\n var entries = [];\n\n function handleIn(vEntry) {\n return function (uEntry) {\n if (uEntry.merged) {\n return;\n }\n\n if (_.isUndefined(uEntry.barycenter) || _.isUndefined(vEntry.barycenter) || uEntry.barycenter >= vEntry.barycenter) {\n mergeEntries(vEntry, uEntry);\n }\n };\n }\n\n function handleOut(vEntry) {\n return function (wEntry) {\n wEntry[\"in\"].push(vEntry);\n\n if (--wEntry.indegree === 0) {\n sourceSet.push(wEntry);\n }\n };\n }\n\n while (sourceSet.length) {\n var entry = sourceSet.pop();\n entries.push(entry);\n\n _.forEach(entry[\"in\"].reverse(), handleIn(entry));\n\n _.forEach(entry.out, handleOut(entry));\n }\n\n return _.map(_.filter(entries, function (entry) {\n return !entry.merged;\n }), function (entry) {\n return _.pick(entry, [\"vs\", \"i\", \"barycenter\", \"weight\"]);\n });\n}\n\nfunction mergeEntries(target, source) {\n var sum = 0;\n var weight = 0;\n\n if (target.weight) {\n sum += target.barycenter * target.weight;\n weight += target.weight;\n }\n\n if (source.weight) {\n sum += source.barycenter * source.weight;\n weight += source.weight;\n }\n\n target.vs = source.vs.concat(target.vs);\n target.barycenter = sum / weight;\n target.weight = weight;\n target.i = Math.min(source.i, target.i);\n source.merged = true;\n}","var _ = require(\"../lodash\");\n\nvar util = require(\"../util\");\n\nmodule.exports = sort;\n\nfunction sort(entries, biasRight) {\n var parts = util.partition(entries, function (entry) {\n return _.has(entry, \"barycenter\");\n });\n\n var sortable = parts.lhs,\n unsortable = _.sortBy(parts.rhs, function (entry) {\n return -entry.i;\n }),\n vs = [],\n sum = 0,\n weight = 0,\n vsIndex = 0;\n\n sortable.sort(compareWithBias(!!biasRight));\n vsIndex = consumeUnsortable(vs, unsortable, vsIndex);\n\n _.forEach(sortable, function (entry) {\n vsIndex += entry.vs.length;\n vs.push(entry.vs);\n sum += entry.barycenter * entry.weight;\n weight += entry.weight;\n vsIndex = consumeUnsortable(vs, unsortable, vsIndex);\n });\n\n var result = {\n vs: _.flatten(vs, true)\n };\n\n if (weight) {\n result.barycenter = sum / weight;\n result.weight = weight;\n }\n\n return result;\n}\n\nfunction consumeUnsortable(vs, unsortable, index) {\n var last;\n\n while (unsortable.length && (last = _.last(unsortable)).i <= index) {\n unsortable.pop();\n vs.push(last.vs);\n index++;\n }\n\n return index;\n}\n\nfunction compareWithBias(bias) {\n return function (entryV, entryW) {\n if (entryV.barycenter < entryW.barycenter) {\n return -1;\n } else if (entryV.barycenter > entryW.barycenter) {\n return 1;\n }\n\n return !bias ? entryV.i - entryW.i : entryW.i - entryV.i;\n };\n}","var _ = require(\"../lodash\");\n\nvar Graph = require(\"../graphlib\").Graph;\n\nmodule.exports = buildLayerGraph;\n/*\n * Constructs a graph that can be used to sort a layer of nodes. The graph will\n * contain all base and subgraph nodes from the request layer in their original\n * hierarchy and any edges that are incident on these nodes and are of the type\n * requested by the \"relationship\" parameter.\n *\n * Nodes from the requested rank that do not have parents are assigned a root\n * node in the output graph, which is set in the root graph attribute. This\n * makes it easy to walk the hierarchy of movable nodes during ordering.\n *\n * Pre-conditions:\n *\n * 1. Input graph is a DAG\n * 2. Base nodes in the input graph have a rank attribute\n * 3. Subgraph nodes in the input graph has minRank and maxRank attributes\n * 4. Edges have an assigned weight\n *\n * Post-conditions:\n *\n * 1. Output graph has all nodes in the movable rank with preserved\n * hierarchy.\n * 2. Root nodes in the movable layer are made children of the node\n * indicated by the root attribute of the graph.\n * 3. Non-movable nodes incident on movable nodes, selected by the\n * relationship parameter, are included in the graph (without hierarchy).\n * 4. Edges incident on movable nodes, selected by the relationship\n * parameter, are added to the output graph.\n * 5. The weights for copied edges are aggregated as need, since the output\n * graph is not a multi-graph.\n */\n\nfunction buildLayerGraph(g, rank, relationship) {\n var root = createRootNode(g),\n result = new Graph({\n compound: true\n }).setGraph({\n root: root\n }).setDefaultNodeLabel(function (v) {\n return g.node(v);\n });\n\n _.forEach(g.nodes(), function (v) {\n var node = g.node(v),\n parent = g.parent(v);\n\n if (node.rank === rank || node.minRank <= rank && rank <= node.maxRank) {\n result.setNode(v);\n result.setParent(v, parent || root); // This assumes we have only short edges!\n\n _.forEach(g[relationship](v), function (e) {\n var u = e.v === v ? e.w : e.v,\n edge = result.edge(u, v),\n weight = !_.isUndefined(edge) ? edge.weight : 0;\n result.setEdge(u, v, {\n weight: g.edge(e).weight + weight\n });\n });\n\n if (_.has(node, \"minRank\")) {\n result.setNode(v, {\n borderLeft: node.borderLeft[rank],\n borderRight: node.borderRight[rank]\n });\n }\n }\n });\n\n return result;\n}\n\nfunction createRootNode(g) {\n var v;\n\n while (g.hasNode(v = _.uniqueId(\"_root\"))) {\n ;\n }\n\n return v;\n}","var _ = require(\"../lodash\");\n\nmodule.exports = addSubgraphConstraints;\n\nfunction addSubgraphConstraints(g, cg, vs) {\n var prev = {},\n rootPrev;\n\n _.forEach(vs, function (v) {\n var child = g.parent(v),\n parent,\n prevChild;\n\n while (child) {\n parent = g.parent(child);\n\n if (parent) {\n prevChild = prev[parent];\n prev[parent] = child;\n } else {\n prevChild = rootPrev;\n rootPrev = child;\n }\n\n if (prevChild && prevChild !== child) {\n cg.setEdge(prevChild, child);\n return;\n }\n\n child = parent;\n }\n });\n /*\n function dfs(v) {\n var children = v ? g.children(v) : g.children();\n if (children.length) {\n var min = Number.POSITIVE_INFINITY,\n subgraphs = [];\n _.each(children, function(child) {\n var childMin = dfs(child);\n if (g.children(child).length) {\n subgraphs.push({ v: child, order: childMin });\n }\n min = Math.min(min, childMin);\n });\n _.reduce(_.sortBy(subgraphs, \"order\"), function(prev, curr) {\n cg.setEdge(prev.v, curr.v);\n return curr;\n });\n return min;\n }\n return g.node(v).order;\n }\n dfs(undefined);\n */\n\n}","\"use strict\";\n\nvar _ = require(\"../lodash\");\n\nvar util = require(\"../util\");\n\nvar positionX = require(\"./bk\").positionX;\n\nmodule.exports = position;\n\nfunction position(g) {\n g = util.asNonCompoundGraph(g);\n positionY(g);\n\n _.forEach(positionX(g), function (x, v) {\n g.node(v).x = x;\n });\n}\n\nfunction positionY(g) {\n var layering = util.buildLayerMatrix(g);\n var rankSep = g.graph().ranksep;\n var prevY = 0;\n\n _.forEach(layering, function (layer) {\n var maxHeight = _.max(_.map(layer, function (v) {\n return g.node(v).height;\n }));\n\n _.forEach(layer, function (v) {\n g.node(v).y = prevY + maxHeight / 2;\n });\n\n prevY += maxHeight + rankSep;\n });\n}","\"use strict\";\n\nvar _ = require(\"../lodash\");\n\nvar Graph = require(\"../graphlib\").Graph;\n\nvar util = require(\"../util\");\n/*\n * This module provides coordinate assignment based on Brandes and Köpf, \"Fast\n * and Simple Horizontal Coordinate Assignment.\"\n */\n\n\nmodule.exports = {\n positionX: positionX,\n findType1Conflicts: findType1Conflicts,\n findType2Conflicts: findType2Conflicts,\n addConflict: addConflict,\n hasConflict: hasConflict,\n verticalAlignment: verticalAlignment,\n horizontalCompaction: horizontalCompaction,\n alignCoordinates: alignCoordinates,\n findSmallestWidthAlignment: findSmallestWidthAlignment,\n balance: balance\n};\n/*\n * Marks all edges in the graph with a type-1 conflict with the \"type1Conflict\"\n * property. A type-1 conflict is one where a non-inner segment crosses an\n * inner segment. An inner segment is an edge with both incident nodes marked\n * with the \"dummy\" property.\n *\n * This algorithm scans layer by layer, starting with the second, for type-1\n * conflicts between the current layer and the previous layer. For each layer\n * it scans the nodes from left to right until it reaches one that is incident\n * on an inner segment. It then scans predecessors to determine if they have\n * edges that cross that inner segment. At the end a final scan is done for all\n * nodes on the current rank to see if they cross the last visited inner\n * segment.\n *\n * This algorithm (safely) assumes that a dummy node will only be incident on a\n * single node in the layers being scanned.\n */\n\nfunction findType1Conflicts(g, layering) {\n var conflicts = {};\n\n function visitLayer(prevLayer, layer) {\n var // last visited node in the previous layer that is incident on an inner\n // segment.\n k0 = 0,\n // Tracks the last node in this layer scanned for crossings with a type-1\n // segment.\n scanPos = 0,\n prevLayerLength = prevLayer.length,\n lastNode = _.last(layer);\n\n _.forEach(layer, function (v, i) {\n var w = findOtherInnerSegmentNode(g, v),\n k1 = w ? g.node(w).order : prevLayerLength;\n\n if (w || v === lastNode) {\n _.forEach(layer.slice(scanPos, i + 1), function (scanNode) {\n _.forEach(g.predecessors(scanNode), function (u) {\n var uLabel = g.node(u),\n uPos = uLabel.order;\n\n if ((uPos < k0 || k1 < uPos) && !(uLabel.dummy && g.node(scanNode).dummy)) {\n addConflict(conflicts, u, scanNode);\n }\n });\n });\n\n scanPos = i + 1;\n k0 = k1;\n }\n });\n\n return layer;\n }\n\n _.reduce(layering, visitLayer);\n\n return conflicts;\n}\n\nfunction findType2Conflicts(g, layering) {\n var conflicts = {};\n\n function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) {\n var v;\n\n _.forEach(_.range(southPos, southEnd), function (i) {\n v = south[i];\n\n if (g.node(v).dummy) {\n _.forEach(g.predecessors(v), function (u) {\n var uNode = g.node(u);\n\n if (uNode.dummy && (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) {\n addConflict(conflicts, u, v);\n }\n });\n }\n });\n }\n\n function visitLayer(north, south) {\n var prevNorthPos = -1,\n nextNorthPos,\n southPos = 0;\n\n _.forEach(south, function (v, southLookahead) {\n if (g.node(v).dummy === \"border\") {\n var predecessors = g.predecessors(v);\n\n if (predecessors.length) {\n nextNorthPos = g.node(predecessors[0]).order;\n scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos);\n southPos = southLookahead;\n prevNorthPos = nextNorthPos;\n }\n }\n\n scan(south, southPos, south.length, nextNorthPos, north.length);\n });\n\n return south;\n }\n\n _.reduce(layering, visitLayer);\n\n return conflicts;\n}\n\nfunction findOtherInnerSegmentNode(g, v) {\n if (g.node(v).dummy) {\n return _.find(g.predecessors(v), function (u) {\n return g.node(u).dummy;\n });\n }\n}\n\nfunction addConflict(conflicts, v, w) {\n if (v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n\n var conflictsV = conflicts[v];\n\n if (!conflictsV) {\n conflicts[v] = conflictsV = {};\n }\n\n conflictsV[w] = true;\n}\n\nfunction hasConflict(conflicts, v, w) {\n if (v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n\n return _.has(conflicts[v], w);\n}\n/*\n * Try to align nodes into vertical \"blocks\" where possible. This algorithm\n * attempts to align a node with one of its median neighbors. If the edge\n * connecting a neighbor is a type-1 conflict then we ignore that possibility.\n * If a previous node has already formed a block with a node after the node\n * we're trying to form a block with, we also ignore that possibility - our\n * blocks would be split in that scenario.\n */\n\n\nfunction verticalAlignment(g, layering, conflicts, neighborFn) {\n var root = {},\n align = {},\n pos = {}; // We cache the position here based on the layering because the graph and\n // layering may be out of sync. The layering matrix is manipulated to\n // generate different extreme alignments.\n\n _.forEach(layering, function (layer) {\n _.forEach(layer, function (v, order) {\n root[v] = v;\n align[v] = v;\n pos[v] = order;\n });\n });\n\n _.forEach(layering, function (layer) {\n var prevIdx = -1;\n\n _.forEach(layer, function (v) {\n var ws = neighborFn(v);\n\n if (ws.length) {\n ws = _.sortBy(ws, function (w) {\n return pos[w];\n });\n var mp = (ws.length - 1) / 2;\n\n for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) {\n var w = ws[i];\n\n if (align[v] === v && prevIdx < pos[w] && !hasConflict(conflicts, v, w)) {\n align[w] = v;\n align[v] = root[v] = root[w];\n prevIdx = pos[w];\n }\n }\n }\n });\n });\n\n return {\n root: root,\n align: align\n };\n}\n\nfunction horizontalCompaction(g, layering, root, align, reverseSep) {\n // This portion of the algorithm differs from BK due to a number of problems.\n // Instead of their algorithm we construct a new block graph and do two\n // sweeps. The first sweep places blocks with the smallest possible\n // coordinates. The second sweep removes unused space by moving blocks to the\n // greatest coordinates without violating separation.\n var xs = {},\n blockG = buildBlockGraph(g, layering, root, reverseSep),\n borderType = reverseSep ? \"borderLeft\" : \"borderRight\";\n\n function iterate(setXsFunc, nextNodesFunc) {\n var stack = blockG.nodes();\n var elem = stack.pop();\n var visited = {};\n\n while (elem) {\n if (visited[elem]) {\n setXsFunc(elem);\n } else {\n visited[elem] = true;\n stack.push(elem);\n stack = stack.concat(nextNodesFunc(elem));\n }\n\n elem = stack.pop();\n }\n } // First pass, assign smallest coordinates\n\n\n function pass1(elem) {\n xs[elem] = blockG.inEdges(elem).reduce(function (acc, e) {\n return Math.max(acc, xs[e.v] + blockG.edge(e));\n }, 0);\n } // Second pass, assign greatest coordinates\n\n\n function pass2(elem) {\n var min = blockG.outEdges(elem).reduce(function (acc, e) {\n return Math.min(acc, xs[e.w] - blockG.edge(e));\n }, Number.POSITIVE_INFINITY);\n var node = g.node(elem);\n\n if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) {\n xs[elem] = Math.max(xs[elem], min);\n }\n }\n\n iterate(pass1, blockG.predecessors.bind(blockG));\n iterate(pass2, blockG.successors.bind(blockG)); // Assign x coordinates to all nodes\n\n _.forEach(align, function (v) {\n xs[v] = xs[root[v]];\n });\n\n return xs;\n}\n\nfunction buildBlockGraph(g, layering, root, reverseSep) {\n var blockGraph = new Graph(),\n graphLabel = g.graph(),\n sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep);\n\n _.forEach(layering, function (layer) {\n var u;\n\n _.forEach(layer, function (v) {\n var vRoot = root[v];\n blockGraph.setNode(vRoot);\n\n if (u) {\n var uRoot = root[u],\n prevMax = blockGraph.edge(uRoot, vRoot);\n blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0));\n }\n\n u = v;\n });\n });\n\n return blockGraph;\n}\n/*\n * Returns the alignment that has the smallest width of the given alignments.\n */\n\n\nfunction findSmallestWidthAlignment(g, xss) {\n return _.minBy(_.values(xss), function (xs) {\n var max = Number.NEGATIVE_INFINITY;\n var min = Number.POSITIVE_INFINITY;\n\n _.forIn(xs, function (x, v) {\n var halfWidth = width(g, v) / 2;\n max = Math.max(x + halfWidth, max);\n min = Math.min(x - halfWidth, min);\n });\n\n return max - min;\n });\n}\n/*\n * Align the coordinates of each of the layout alignments such that\n * left-biased alignments have their minimum coordinate at the same point as\n * the minimum coordinate of the smallest width alignment and right-biased\n * alignments have their maximum coordinate at the same point as the maximum\n * coordinate of the smallest width alignment.\n */\n\n\nfunction alignCoordinates(xss, alignTo) {\n var alignToVals = _.values(alignTo),\n alignToMin = _.min(alignToVals),\n alignToMax = _.max(alignToVals);\n\n _.forEach([\"u\", \"d\"], function (vert) {\n _.forEach([\"l\", \"r\"], function (horiz) {\n var alignment = vert + horiz,\n xs = xss[alignment],\n delta;\n if (xs === alignTo) return;\n\n var xsVals = _.values(xs);\n\n delta = horiz === \"l\" ? alignToMin - _.min(xsVals) : alignToMax - _.max(xsVals);\n\n if (delta) {\n xss[alignment] = _.mapValues(xs, function (x) {\n return x + delta;\n });\n }\n });\n });\n}\n\nfunction balance(xss, align) {\n return _.mapValues(xss.ul, function (ignore, v) {\n if (align) {\n return xss[align.toLowerCase()][v];\n } else {\n var xs = _.sortBy(_.map(xss, v));\n\n return (xs[1] + xs[2]) / 2;\n }\n });\n}\n\nfunction positionX(g) {\n var layering = util.buildLayerMatrix(g);\n\n var conflicts = _.merge(findType1Conflicts(g, layering), findType2Conflicts(g, layering));\n\n var xss = {};\n var adjustedLayering;\n\n _.forEach([\"u\", \"d\"], function (vert) {\n adjustedLayering = vert === \"u\" ? layering : _.values(layering).reverse();\n\n _.forEach([\"l\", \"r\"], function (horiz) {\n if (horiz === \"r\") {\n adjustedLayering = _.map(adjustedLayering, function (inner) {\n return _.values(inner).reverse();\n });\n }\n\n var neighborFn = (vert === \"u\" ? g.predecessors : g.successors).bind(g);\n var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn);\n var xs = horizontalCompaction(g, adjustedLayering, align.root, align.align, horiz === \"r\");\n\n if (horiz === \"r\") {\n xs = _.mapValues(xs, function (x) {\n return -x;\n });\n }\n\n xss[vert + horiz] = xs;\n });\n });\n\n var smallestWidth = findSmallestWidthAlignment(g, xss);\n alignCoordinates(xss, smallestWidth);\n return balance(xss, g.graph().align);\n}\n\nfunction sep(nodeSep, edgeSep, reverseSep) {\n return function (g, v, w) {\n var vLabel = g.node(v);\n var wLabel = g.node(w);\n var sum = 0;\n var delta;\n sum += vLabel.width / 2;\n\n if (_.has(vLabel, \"labelpos\")) {\n switch (vLabel.labelpos.toLowerCase()) {\n case \"l\":\n delta = -vLabel.width / 2;\n break;\n\n case \"r\":\n delta = vLabel.width / 2;\n break;\n }\n }\n\n if (delta) {\n sum += reverseSep ? delta : -delta;\n }\n\n delta = 0;\n sum += (vLabel.dummy ? edgeSep : nodeSep) / 2;\n sum += (wLabel.dummy ? edgeSep : nodeSep) / 2;\n sum += wLabel.width / 2;\n\n if (_.has(wLabel, \"labelpos\")) {\n switch (wLabel.labelpos.toLowerCase()) {\n case \"l\":\n delta = wLabel.width / 2;\n break;\n\n case \"r\":\n delta = -wLabel.width / 2;\n break;\n }\n }\n\n if (delta) {\n sum += reverseSep ? delta : -delta;\n }\n\n delta = 0;\n return sum;\n };\n}\n\nfunction width(g, v) {\n return g.node(v).width;\n}","var _ = require(\"./lodash\");\n\nvar util = require(\"./util\");\n\nvar Graph = require(\"./graphlib\").Graph;\n\nmodule.exports = {\n debugOrdering: debugOrdering\n};\n/* istanbul ignore next */\n\nfunction debugOrdering(g) {\n var layerMatrix = util.buildLayerMatrix(g);\n var h = new Graph({\n compound: true,\n multigraph: true\n }).setGraph({});\n\n _.forEach(g.nodes(), function (v) {\n h.setNode(v, {\n label: v\n });\n h.setParent(v, \"layer\" + g.node(v).rank);\n });\n\n _.forEach(g.edges(), function (e) {\n h.setEdge(e.v, e.w, {}, e.name);\n });\n\n _.forEach(layerMatrix, function (layer, i) {\n var layerV = \"layer\" + i;\n h.setNode(layerV, {\n rank: \"same\"\n });\n\n _.reduce(layer, function (u, v) {\n h.setEdge(u, v, {\n style: \"invis\"\n });\n return v;\n });\n });\n\n return h;\n}","module.exports = \"0.8.5\";","/**\n * @license\n * Copyright (c) 2012-2013 Chris Pettitt\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nmodule.exports = {\n graphlib: require(\"./lib/graphlib\"),\n dagre: require(\"./lib/dagre\"),\n intersect: require(\"./lib/intersect\"),\n render: require(\"./lib/render\"),\n util: require(\"./lib/util\"),\n version: require(\"./lib/version\")\n};","/* global window */\nvar graphlib;\n\nif (typeof require === \"function\") {\n try {\n graphlib = require(\"graphlib\");\n } catch (e) {// continue regardless of error\n }\n}\n\nif (!graphlib) {\n graphlib = window.graphlib;\n}\n\nmodule.exports = graphlib;","module.exports = {\n node: require(\"./intersect-node\"),\n circle: require(\"./intersect-circle\"),\n ellipse: require(\"./intersect-ellipse\"),\n polygon: require(\"./intersect-polygon\"),\n rect: require(\"./intersect-rect\")\n};","module.exports = intersectLine;\n/*\n * Returns the point at which two lines, p and q, intersect or returns\n * undefined if they do not intersect.\n */\n\nfunction intersectLine(p1, p2, q1, q2) {\n // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,\n // p7 and p473.\n var a1, a2, b1, b2, c1, c2;\n var r1, r2, r3, r4;\n var denom, offset, num;\n var x, y; // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x +\n // b1 y + c1 = 0.\n\n a1 = p2.y - p1.y;\n b1 = p1.x - p2.x;\n c1 = p2.x * p1.y - p1.x * p2.y; // Compute r3 and r4.\n\n r3 = a1 * q1.x + b1 * q1.y + c1;\n r4 = a1 * q2.x + b1 * q2.y + c1; // Check signs of r3 and r4. If both point 3 and point 4 lie on\n // same side of line 1, the line segments do not intersect.\n\n if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) {\n return;\n } // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0\n\n\n a2 = q2.y - q1.y;\n b2 = q1.x - q2.x;\n c2 = q2.x * q1.y - q1.x * q2.y; // Compute r1 and r2\n\n r1 = a2 * p1.x + b2 * p1.y + c2;\n r2 = a2 * p2.x + b2 * p2.y + c2; // Check signs of r1 and r2. If both point 1 and point 2 lie\n // on same side of second line segment, the line segments do\n // not intersect.\n\n if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) {\n return;\n } // Line segments intersect: compute intersection point.\n\n\n denom = a1 * b2 - a2 * b1;\n\n if (denom === 0) {\n return;\n }\n\n offset = Math.abs(denom / 2); // The denom/2 is to get rounding instead of truncating. It\n // is added or subtracted to the numerator, depending upon the\n // sign of the numerator.\n\n num = b1 * c2 - b2 * c1;\n x = num < 0 ? (num - offset) / denom : (num + offset) / denom;\n num = a2 * c1 - a1 * c2;\n y = num < 0 ? (num - offset) / denom : (num + offset) / denom;\n return {\n x: x,\n y: y\n };\n}\n\nfunction sameSign(r1, r2) {\n return r1 * r2 > 0;\n}","var _ = require(\"./lodash\");\n\nvar d3 = require(\"./d3\");\n\nvar layout = require(\"./dagre\").layout;\n\nmodule.exports = render; // This design is based on http://bost.ocks.org/mike/chart/.\n\nfunction render() {\n var createNodes = require(\"./create-nodes\");\n\n var createClusters = require(\"./create-clusters\");\n\n var createEdgeLabels = require(\"./create-edge-labels\");\n\n var createEdgePaths = require(\"./create-edge-paths\");\n\n var positionNodes = require(\"./position-nodes\");\n\n var positionEdgeLabels = require(\"./position-edge-labels\");\n\n var positionClusters = require(\"./position-clusters\");\n\n var shapes = require(\"./shapes\");\n\n var arrows = require(\"./arrows\");\n\n var fn = function fn(svg, g) {\n preProcessGraph(g);\n var outputGroup = createOrSelectGroup(svg, \"output\");\n var clustersGroup = createOrSelectGroup(outputGroup, \"clusters\");\n var edgePathsGroup = createOrSelectGroup(outputGroup, \"edgePaths\");\n var edgeLabels = createEdgeLabels(createOrSelectGroup(outputGroup, \"edgeLabels\"), g);\n var nodes = createNodes(createOrSelectGroup(outputGroup, \"nodes\"), g, shapes);\n layout(g);\n positionNodes(nodes, g);\n positionEdgeLabels(edgeLabels, g);\n createEdgePaths(edgePathsGroup, g, arrows);\n var clusters = createClusters(clustersGroup, g);\n positionClusters(clusters, g);\n postProcessGraph(g);\n };\n\n fn.createNodes = function (value) {\n if (!arguments.length) return createNodes;\n createNodes = value;\n return fn;\n };\n\n fn.createClusters = function (value) {\n if (!arguments.length) return createClusters;\n createClusters = value;\n return fn;\n };\n\n fn.createEdgeLabels = function (value) {\n if (!arguments.length) return createEdgeLabels;\n createEdgeLabels = value;\n return fn;\n };\n\n fn.createEdgePaths = function (value) {\n if (!arguments.length) return createEdgePaths;\n createEdgePaths = value;\n return fn;\n };\n\n fn.shapes = function (value) {\n if (!arguments.length) return shapes;\n shapes = value;\n return fn;\n };\n\n fn.arrows = function (value) {\n if (!arguments.length) return arrows;\n arrows = value;\n return fn;\n };\n\n return fn;\n}\n\nvar NODE_DEFAULT_ATTRS = {\n paddingLeft: 10,\n paddingRight: 10,\n paddingTop: 10,\n paddingBottom: 10,\n rx: 0,\n ry: 0,\n shape: \"rect\"\n};\nvar EDGE_DEFAULT_ATTRS = {\n arrowhead: \"normal\",\n curve: d3.curveLinear\n};\n\nfunction preProcessGraph(g) {\n g.nodes().forEach(function (v) {\n var node = g.node(v);\n\n if (!_.has(node, \"label\") && !g.children(v).length) {\n node.label = v;\n }\n\n if (_.has(node, \"paddingX\")) {\n _.defaults(node, {\n paddingLeft: node.paddingX,\n paddingRight: node.paddingX\n });\n }\n\n if (_.has(node, \"paddingY\")) {\n _.defaults(node, {\n paddingTop: node.paddingY,\n paddingBottom: node.paddingY\n });\n }\n\n if (_.has(node, \"padding\")) {\n _.defaults(node, {\n paddingLeft: node.padding,\n paddingRight: node.padding,\n paddingTop: node.padding,\n paddingBottom: node.padding\n });\n }\n\n _.defaults(node, NODE_DEFAULT_ATTRS);\n\n _.each([\"paddingLeft\", \"paddingRight\", \"paddingTop\", \"paddingBottom\"], function (k) {\n node[k] = Number(node[k]);\n }); // Save dimensions for restore during post-processing\n\n\n if (_.has(node, \"width\")) {\n node._prevWidth = node.width;\n }\n\n if (_.has(node, \"height\")) {\n node._prevHeight = node.height;\n }\n });\n g.edges().forEach(function (e) {\n var edge = g.edge(e);\n\n if (!_.has(edge, \"label\")) {\n edge.label = \"\";\n }\n\n _.defaults(edge, EDGE_DEFAULT_ATTRS);\n });\n}\n\nfunction postProcessGraph(g) {\n _.each(g.nodes(), function (v) {\n var node = g.node(v); // Restore original dimensions\n\n if (_.has(node, \"_prevWidth\")) {\n node.width = node._prevWidth;\n } else {\n delete node.width;\n }\n\n if (_.has(node, \"_prevHeight\")) {\n node.height = node._prevHeight;\n } else {\n delete node.height;\n }\n\n delete node._prevWidth;\n delete node._prevHeight;\n });\n}\n\nfunction createOrSelectGroup(root, name) {\n var selection = root.select(\"g.\" + name);\n\n if (selection.empty()) {\n selection = root.append(\"g\").attr(\"class\", name);\n }\n\n return selection;\n}","\"use strict\";\n\nvar _ = require(\"./lodash\");\n\nvar addLabel = require(\"./label/add-label\");\n\nvar util = require(\"./util\");\n\nvar d3 = require(\"./d3\");\n\nmodule.exports = createNodes;\n\nfunction createNodes(selection, g, shapes) {\n var simpleNodes = g.nodes().filter(function (v) {\n return !util.isSubgraph(g, v);\n });\n var svgNodes = selection.selectAll(\"g.node\").data(simpleNodes, function (v) {\n return v;\n }).classed(\"update\", true);\n svgNodes.exit().remove();\n svgNodes.enter().append(\"g\").attr(\"class\", \"node\").style(\"opacity\", 0);\n svgNodes = selection.selectAll(\"g.node\");\n svgNodes.each(function (v) {\n var node = g.node(v);\n var thisGroup = d3.select(this);\n util.applyClass(thisGroup, node[\"class\"], (thisGroup.classed(\"update\") ? \"update \" : \"\") + \"node\");\n thisGroup.select(\"g.label\").remove();\n var labelGroup = thisGroup.append(\"g\").attr(\"class\", \"label\");\n var labelDom = addLabel(labelGroup, node);\n var shape = shapes[node.shape];\n\n var bbox = _.pick(labelDom.node().getBBox(), \"width\", \"height\");\n\n node.elem = this;\n\n if (node.id) {\n thisGroup.attr(\"id\", node.id);\n }\n\n if (node.labelId) {\n labelGroup.attr(\"id\", node.labelId);\n }\n\n if (_.has(node, \"width\")) {\n bbox.width = node.width;\n }\n\n if (_.has(node, \"height\")) {\n bbox.height = node.height;\n }\n\n bbox.width += node.paddingLeft + node.paddingRight;\n bbox.height += node.paddingTop + node.paddingBottom;\n labelGroup.attr(\"transform\", \"translate(\" + (node.paddingLeft - node.paddingRight) / 2 + \",\" + (node.paddingTop - node.paddingBottom) / 2 + \")\");\n var root = d3.select(this);\n root.select(\".label-container\").remove();\n var shapeSvg = shape(root, bbox, node).classed(\"label-container\", true);\n util.applyStyle(shapeSvg, node.style);\n var shapeBBox = shapeSvg.node().getBBox();\n node.width = shapeBBox.width;\n node.height = shapeBBox.height;\n });\n var exitSelection;\n\n if (svgNodes.exit) {\n exitSelection = svgNodes.exit();\n } else {\n exitSelection = svgNodes.selectAll(null); // empty selection\n }\n\n util.applyTransition(exitSelection, g).style(\"opacity\", 0).remove();\n return svgNodes;\n}","var util = require(\"../util\");\n\nmodule.exports = addTextLabel;\n/*\n * Attaches a text label to the specified root. Handles escape sequences.\n */\n\nfunction addTextLabel(root, node) {\n var domNode = root.append(\"text\");\n var lines = processEscapeSequences(node.label).split(\"\\n\");\n\n for (var i = 0; i < lines.length; i++) {\n domNode.append(\"tspan\").attr(\"xml:space\", \"preserve\").attr(\"dy\", \"1em\").attr(\"x\", \"1\").text(lines[i]);\n }\n\n util.applyStyle(domNode, node.labelStyle);\n return domNode;\n}\n\nfunction processEscapeSequences(text) {\n var newText = \"\";\n var escaped = false;\n var ch;\n\n for (var i = 0; i < text.length; ++i) {\n ch = text[i];\n\n if (escaped) {\n switch (ch) {\n case \"n\":\n newText += \"\\n\";\n break;\n\n default:\n newText += ch;\n }\n\n escaped = false;\n } else if (ch === \"\\\\\") {\n escaped = true;\n } else {\n newText += ch;\n }\n }\n\n return newText;\n}","var util = require(\"../util\");\n\nmodule.exports = addSVGLabel;\n\nfunction addSVGLabel(root, node) {\n var domNode = root;\n domNode.node().appendChild(node.label);\n util.applyStyle(domNode, node.labelStyle);\n return domNode;\n}","var util = require(\"./util\");\n\nvar d3 = require(\"./d3\");\n\nvar addLabel = require(\"./label/add-label\");\n\nmodule.exports = createClusters;\n\nfunction createClusters(selection, g) {\n var clusters = g.nodes().filter(function (v) {\n return util.isSubgraph(g, v);\n });\n var svgClusters = selection.selectAll(\"g.cluster\").data(clusters, function (v) {\n return v;\n });\n svgClusters.selectAll(\"*\").remove();\n svgClusters.enter().append(\"g\").attr(\"class\", \"cluster\").attr(\"id\", function (v) {\n var node = g.node(v);\n return node.id;\n }).style(\"opacity\", 0);\n svgClusters = selection.selectAll(\"g.cluster\");\n util.applyTransition(svgClusters, g).style(\"opacity\", 1);\n svgClusters.each(function (v) {\n var node = g.node(v);\n var thisGroup = d3.select(this);\n d3.select(this).append(\"rect\");\n var labelGroup = thisGroup.append(\"g\").attr(\"class\", \"label\");\n addLabel(labelGroup, node, node.clusterLabelPos);\n });\n svgClusters.selectAll(\"rect\").each(function (c) {\n var node = g.node(c);\n var domCluster = d3.select(this);\n util.applyStyle(domCluster, node.style);\n });\n var exitSelection;\n\n if (svgClusters.exit) {\n exitSelection = svgClusters.exit();\n } else {\n exitSelection = svgClusters.selectAll(null); // empty selection\n }\n\n util.applyTransition(exitSelection, g).style(\"opacity\", 0).remove();\n return svgClusters;\n}","\"use strict\";\n\nvar _ = require(\"./lodash\");\n\nvar addLabel = require(\"./label/add-label\");\n\nvar util = require(\"./util\");\n\nvar d3 = require(\"./d3\");\n\nmodule.exports = createEdgeLabels;\n\nfunction createEdgeLabels(selection, g) {\n var svgEdgeLabels = selection.selectAll(\"g.edgeLabel\").data(g.edges(), function (e) {\n return util.edgeToId(e);\n }).classed(\"update\", true);\n svgEdgeLabels.exit().remove();\n svgEdgeLabels.enter().append(\"g\").classed(\"edgeLabel\", true).style(\"opacity\", 0);\n svgEdgeLabels = selection.selectAll(\"g.edgeLabel\");\n svgEdgeLabels.each(function (e) {\n var root = d3.select(this);\n root.select(\".label\").remove();\n var edge = g.edge(e);\n var label = addLabel(root, g.edge(e), 0, 0).classed(\"label\", true);\n var bbox = label.node().getBBox();\n\n if (edge.labelId) {\n label.attr(\"id\", edge.labelId);\n }\n\n if (!_.has(edge, \"width\")) {\n edge.width = bbox.width;\n }\n\n if (!_.has(edge, \"height\")) {\n edge.height = bbox.height;\n }\n });\n var exitSelection;\n\n if (svgEdgeLabels.exit) {\n exitSelection = svgEdgeLabels.exit();\n } else {\n exitSelection = svgEdgeLabels.selectAll(null); // empty selection\n }\n\n util.applyTransition(exitSelection, g).style(\"opacity\", 0).remove();\n return svgEdgeLabels;\n}","\"use strict\";\n\nvar _ = require(\"./lodash\");\n\nvar intersectNode = require(\"./intersect/intersect-node\");\n\nvar util = require(\"./util\");\n\nvar d3 = require(\"./d3\");\n\nmodule.exports = createEdgePaths;\n\nfunction createEdgePaths(selection, g, arrows) {\n var previousPaths = selection.selectAll(\"g.edgePath\").data(g.edges(), function (e) {\n return util.edgeToId(e);\n }).classed(\"update\", true);\n var newPaths = enter(previousPaths, g);\n exit(previousPaths, g);\n var svgPaths = previousPaths.merge !== undefined ? previousPaths.merge(newPaths) : previousPaths;\n util.applyTransition(svgPaths, g).style(\"opacity\", 1); // Save DOM element in the path group, and set ID and class\n\n svgPaths.each(function (e) {\n var domEdge = d3.select(this);\n var edge = g.edge(e);\n edge.elem = this;\n\n if (edge.id) {\n domEdge.attr(\"id\", edge.id);\n }\n\n util.applyClass(domEdge, edge[\"class\"], (domEdge.classed(\"update\") ? \"update \" : \"\") + \"edgePath\");\n });\n svgPaths.selectAll(\"path.path\").each(function (e) {\n var edge = g.edge(e);\n edge.arrowheadId = _.uniqueId(\"arrowhead\");\n var domEdge = d3.select(this).attr(\"marker-end\", function () {\n return \"url(\" + makeFragmentRef(location.href, edge.arrowheadId) + \")\";\n }).style(\"fill\", \"none\");\n util.applyTransition(domEdge, g).attr(\"d\", function (e) {\n return calcPoints(g, e);\n });\n util.applyStyle(domEdge, edge.style);\n });\n svgPaths.selectAll(\"defs *\").remove();\n svgPaths.selectAll(\"defs\").each(function (e) {\n var edge = g.edge(e);\n var arrowhead = arrows[edge.arrowhead];\n arrowhead(d3.select(this), edge.arrowheadId, edge, \"arrowhead\");\n });\n return svgPaths;\n}\n\nfunction makeFragmentRef(url, fragmentId) {\n var baseUrl = url.split(\"#\")[0];\n return baseUrl + \"#\" + fragmentId;\n}\n\nfunction calcPoints(g, e) {\n var edge = g.edge(e);\n var tail = g.node(e.v);\n var head = g.node(e.w);\n var points = edge.points.slice(1, edge.points.length - 1);\n points.unshift(intersectNode(tail, points[0]));\n points.push(intersectNode(head, points[points.length - 1]));\n return createLine(edge, points);\n}\n\nfunction createLine(edge, points) {\n var line = (d3.line || d3.svg.line)().x(function (d) {\n return d.x;\n }).y(function (d) {\n return d.y;\n });\n (line.curve || line.interpolate)(edge.curve);\n return line(points);\n}\n\nfunction getCoords(elem) {\n var bbox = elem.getBBox();\n var matrix = elem.ownerSVGElement.getScreenCTM().inverse().multiply(elem.getScreenCTM()).translate(bbox.width / 2, bbox.height / 2);\n return {\n x: matrix.e,\n y: matrix.f\n };\n}\n\nfunction enter(svgPaths, g) {\n var svgPathsEnter = svgPaths.enter().append(\"g\").attr(\"class\", \"edgePath\").style(\"opacity\", 0);\n svgPathsEnter.append(\"path\").attr(\"class\", \"path\").attr(\"d\", function (e) {\n var edge = g.edge(e);\n var sourceElem = g.node(e.v).elem;\n\n var points = _.range(edge.points.length).map(function () {\n return getCoords(sourceElem);\n });\n\n return createLine(edge, points);\n });\n svgPathsEnter.append(\"defs\");\n return svgPathsEnter;\n}\n\nfunction exit(svgPaths, g) {\n var svgPathExit = svgPaths.exit();\n util.applyTransition(svgPathExit, g).style(\"opacity\", 0).remove();\n}","\"use strict\";\n\nvar util = require(\"./util\");\n\nvar d3 = require(\"./d3\");\n\nmodule.exports = positionNodes;\n\nfunction positionNodes(selection, g) {\n var created = selection.filter(function () {\n return !d3.select(this).classed(\"update\");\n });\n\n function translate(v) {\n var node = g.node(v);\n return \"translate(\" + node.x + \",\" + node.y + \")\";\n }\n\n created.attr(\"transform\", translate);\n util.applyTransition(selection, g).style(\"opacity\", 1).attr(\"transform\", translate);\n}","\"use strict\";\n\nvar util = require(\"./util\");\n\nvar d3 = require(\"./d3\");\n\nvar _ = require(\"./lodash\");\n\nmodule.exports = positionEdgeLabels;\n\nfunction positionEdgeLabels(selection, g) {\n var created = selection.filter(function () {\n return !d3.select(this).classed(\"update\");\n });\n\n function translate(e) {\n var edge = g.edge(e);\n return _.has(edge, \"x\") ? \"translate(\" + edge.x + \",\" + edge.y + \")\" : \"\";\n }\n\n created.attr(\"transform\", translate);\n util.applyTransition(selection, g).style(\"opacity\", 1).attr(\"transform\", translate);\n}","\"use strict\";\n\nvar util = require(\"./util\");\n\nvar d3 = require(\"./d3\");\n\nmodule.exports = positionClusters;\n\nfunction positionClusters(selection, g) {\n var created = selection.filter(function () {\n return !d3.select(this).classed(\"update\");\n });\n\n function translate(v) {\n var node = g.node(v);\n return \"translate(\" + node.x + \",\" + node.y + \")\";\n }\n\n created.attr(\"transform\", translate);\n util.applyTransition(selection, g).style(\"opacity\", 1).attr(\"transform\", translate);\n util.applyTransition(created.selectAll(\"rect\"), g).attr(\"width\", function (v) {\n return g.node(v).width;\n }).attr(\"height\", function (v) {\n return g.node(v).height;\n }).attr(\"x\", function (v) {\n var node = g.node(v);\n return -node.width / 2;\n }).attr(\"y\", function (v) {\n var node = g.node(v);\n return -node.height / 2;\n });\n}","\"use strict\";\n\nvar intersectRect = require(\"./intersect/intersect-rect\");\n\nvar intersectEllipse = require(\"./intersect/intersect-ellipse\");\n\nvar intersectCircle = require(\"./intersect/intersect-circle\");\n\nvar intersectPolygon = require(\"./intersect/intersect-polygon\");\n\nmodule.exports = {\n rect: rect,\n ellipse: ellipse,\n circle: circle,\n diamond: diamond\n};\n\nfunction rect(parent, bbox, node) {\n var shapeSvg = parent.insert(\"rect\", \":first-child\").attr(\"rx\", node.rx).attr(\"ry\", node.ry).attr(\"x\", -bbox.width / 2).attr(\"y\", -bbox.height / 2).attr(\"width\", bbox.width).attr(\"height\", bbox.height);\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return shapeSvg;\n}\n\nfunction ellipse(parent, bbox, node) {\n var rx = bbox.width / 2;\n var ry = bbox.height / 2;\n var shapeSvg = parent.insert(\"ellipse\", \":first-child\").attr(\"x\", -bbox.width / 2).attr(\"y\", -bbox.height / 2).attr(\"rx\", rx).attr(\"ry\", ry);\n\n node.intersect = function (point) {\n return intersectEllipse(node, rx, ry, point);\n };\n\n return shapeSvg;\n}\n\nfunction circle(parent, bbox, node) {\n var r = Math.max(bbox.width, bbox.height) / 2;\n var shapeSvg = parent.insert(\"circle\", \":first-child\").attr(\"x\", -bbox.width / 2).attr(\"y\", -bbox.height / 2).attr(\"r\", r);\n\n node.intersect = function (point) {\n return intersectCircle(node, r, point);\n };\n\n return shapeSvg;\n} // Circumscribe an ellipse for the bounding box with a diamond shape. I derived\n// the function to calculate the diamond shape from:\n// http://mathforum.org/kb/message.jspa?messageID=3750236\n\n\nfunction diamond(parent, bbox, node) {\n var w = bbox.width * Math.SQRT2 / 2;\n var h = bbox.height * Math.SQRT2 / 2;\n var points = [{\n x: 0,\n y: -h\n }, {\n x: -w,\n y: 0\n }, {\n x: 0,\n y: h\n }, {\n x: w,\n y: 0\n }];\n var shapeSvg = parent.insert(\"polygon\", \":first-child\").attr(\"points\", points.map(function (p) {\n return p.x + \",\" + p.y;\n }).join(\" \"));\n\n node.intersect = function (p) {\n return intersectPolygon(node, points, p);\n };\n\n return shapeSvg;\n}","var util = require(\"./util\");\n\nmodule.exports = {\n \"default\": normal,\n \"normal\": normal,\n \"vee\": vee,\n \"undirected\": undirected\n};\n\nfunction normal(parent, id, edge, type) {\n var marker = parent.append(\"marker\").attr(\"id\", id).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 9).attr(\"refY\", 5).attr(\"markerUnits\", \"strokeWidth\").attr(\"markerWidth\", 8).attr(\"markerHeight\", 6).attr(\"orient\", \"auto\");\n var path = marker.append(\"path\").attr(\"d\", \"M 0 0 L 10 5 L 0 10 z\").style(\"stroke-width\", 1).style(\"stroke-dasharray\", \"1,0\");\n util.applyStyle(path, edge[type + \"Style\"]);\n\n if (edge[type + \"Class\"]) {\n path.attr(\"class\", edge[type + \"Class\"]);\n }\n}\n\nfunction vee(parent, id, edge, type) {\n var marker = parent.append(\"marker\").attr(\"id\", id).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 9).attr(\"refY\", 5).attr(\"markerUnits\", \"strokeWidth\").attr(\"markerWidth\", 8).attr(\"markerHeight\", 6).attr(\"orient\", \"auto\");\n var path = marker.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\");\n util.applyStyle(path, edge[type + \"Style\"]);\n\n if (edge[type + \"Class\"]) {\n path.attr(\"class\", edge[type + \"Class\"]);\n }\n}\n\nfunction undirected(parent, id, edge, type) {\n var marker = parent.append(\"marker\").attr(\"id\", id).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 9).attr(\"refY\", 5).attr(\"markerUnits\", \"strokeWidth\").attr(\"markerWidth\", 8).attr(\"markerHeight\", 6).attr(\"orient\", \"auto\");\n var path = marker.append(\"path\").attr(\"d\", \"M 0 5 L 10 5\").style(\"stroke-width\", 1).style(\"stroke-dasharray\", \"1,0\");\n util.applyStyle(path, edge[type + \"Style\"]);\n\n if (edge[type + \"Class\"]) {\n path.attr(\"class\", edge[type + \"Class\"]);\n }\n}","module.exports = \"0.6.4\";","/**\n * @see https://github.com/vuejs/vue/commit/a855dd0564a657a73b7249469490d39817f27cf7#diff-c0a2623ea5896a83e3b630f236b47b52\n * @see https://stackoverflow.com/a/13091266/4936667\n */\nvar decoder;\nexport default function decode(html) {\n decoder = decoder || document.createElement('div'); // Escape HTML before decoding for HTML Entities\n\n html = escape(html).replace(/%26/g, '&').replace(/%23/g, '#').replace(/%3B/g, ';'); // decoding\n\n decoder.innerHTML = html;\n return unescape(decoder.textContent);\n}","\"use strict\";\n/* EXPORT */\n\nfunction __export(m) {\n for (var p in m) {\n if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }\n}\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\n__export(require(\"./methods\"));","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar rgba_1 = require(\"./rgba\"); // Alias\n\n\nexports.hex = rgba_1.default;\n\nvar rgba_2 = require(\"./rgba\"); // Alias\n\n\nexports.rgb = rgba_2.default;\n\nvar rgba_3 = require(\"./rgba\");\n\nexports.rgba = rgba_3.default;\n\nvar hsla_1 = require(\"./hsla\"); // Alias\n\n\nexports.hsl = hsla_1.default;\n\nvar hsla_2 = require(\"./hsla\");\n\nexports.hsla = hsla_2.default;\n\nvar channel_1 = require(\"./channel\");\n\nexports.channel = channel_1.default;\n\nvar red_1 = require(\"./red\");\n\nexports.red = red_1.default;\n\nvar green_1 = require(\"./green\");\n\nexports.green = green_1.default;\n\nvar blue_1 = require(\"./blue\");\n\nexports.blue = blue_1.default;\n\nvar hue_1 = require(\"./hue\");\n\nexports.hue = hue_1.default;\n\nvar saturation_1 = require(\"./saturation\");\n\nexports.saturation = saturation_1.default;\n\nvar lightness_1 = require(\"./lightness\");\n\nexports.lightness = lightness_1.default;\n\nvar alpha_1 = require(\"./alpha\");\n\nexports.alpha = alpha_1.default;\n\nvar alpha_2 = require(\"./alpha\"); // Alias\n\n\nexports.opacity = alpha_2.default;\n\nvar luminance_1 = require(\"./luminance\");\n\nexports.luminance = luminance_1.default;\n\nvar is_dark_1 = require(\"./is_dark\");\n\nexports.isDark = is_dark_1.default;\n\nvar is_light_1 = require(\"./is_light\");\n\nexports.isLight = is_light_1.default;\n\nvar is_valid_1 = require(\"./is_valid\");\n\nexports.isValid = is_valid_1.default;\n\nvar saturate_1 = require(\"./saturate\");\n\nexports.saturate = saturate_1.default;\n\nvar desaturate_1 = require(\"./desaturate\");\n\nexports.desaturate = desaturate_1.default;\n\nvar lighten_1 = require(\"./lighten\");\n\nexports.lighten = lighten_1.default;\n\nvar darken_1 = require(\"./darken\");\n\nexports.darken = darken_1.default;\n\nvar opacify_1 = require(\"./opacify\");\n\nexports.opacify = opacify_1.default;\n\nvar opacify_2 = require(\"./opacify\"); // Alias\n\n\nexports.fadeIn = opacify_2.default;\n\nvar transparentize_1 = require(\"./transparentize\");\n\nexports.transparentize = transparentize_1.default;\n\nvar transparentize_2 = require(\"./transparentize\"); // Alias\n\n\nexports.fadeOut = transparentize_2.default;\n\nvar complement_1 = require(\"./complement\");\n\nexports.complement = complement_1.default;\n\nvar grayscale_1 = require(\"./grayscale\");\n\nexports.grayscale = grayscale_1.default;\n\nvar adjust_1 = require(\"./adjust\");\n\nexports.adjust = adjust_1.default;\n\nvar change_1 = require(\"./change\");\n\nexports.change = change_1.default;\n\nvar invert_1 = require(\"./invert\");\n\nexports.invert = invert_1.default;\n\nvar mix_1 = require(\"./mix\");\n\nexports.mix = mix_1.default;\n\nvar scale_1 = require(\"./scale\");\n\nexports.scale = scale_1.default;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/* CHANNEL */\n\nvar Channel = {\n /* CLAMP */\n min: {\n r: 0,\n g: 0,\n b: 0,\n s: 0,\n l: 0,\n a: 0\n },\n max: {\n r: 255,\n g: 255,\n b: 255,\n h: 360,\n s: 100,\n l: 100,\n a: 1\n },\n clamp: {\n r: function r(_r) {\n return _r >= 255 ? 255 : _r < 0 ? 0 : _r;\n },\n g: function g(_g) {\n return _g >= 255 ? 255 : _g < 0 ? 0 : _g;\n },\n b: function b(_b) {\n return _b >= 255 ? 255 : _b < 0 ? 0 : _b;\n },\n h: function h(_h) {\n return _h % 360;\n },\n s: function s(_s) {\n return _s >= 100 ? 100 : _s < 0 ? 0 : _s;\n },\n l: function l(_l) {\n return _l >= 100 ? 100 : _l < 0 ? 0 : _l;\n },\n a: function a(_a2) {\n return _a2 >= 1 ? 1 : _a2 < 0 ? 0 : _a2;\n }\n },\n\n /* CONVERSION */\n //SOURCE: https://planetcalc.com/7779\n toLinear: function toLinear(c) {\n var n = c / 255;\n return c > .03928 ? Math.pow((n + .055) / 1.055, 2.4) : n / 12.92;\n },\n //SOURCE: https://gist.github.com/mjackson/5311256\n hue2rgb: function hue2rgb(p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n },\n hsl2rgb: function hsl2rgb(_a, channel) {\n var h = _a.h,\n s = _a.s,\n l = _a.l;\n if (s === 100) return l * 2.55; // Achromatic\n\n h /= 360;\n s /= 100;\n l /= 100;\n var q = l < .5 ? l * (1 + s) : l + s - l * s,\n p = 2 * l - q;\n\n switch (channel) {\n case 'r':\n return Channel.hue2rgb(p, q, h + 1 / 3) * 255;\n\n case 'g':\n return Channel.hue2rgb(p, q, h) * 255;\n\n case 'b':\n return Channel.hue2rgb(p, q, h - 1 / 3) * 255;\n }\n },\n rgb2hsl: function rgb2hsl(_a, channel) {\n var r = _a.r,\n g = _a.g,\n b = _a.b;\n r /= 255;\n g /= 255;\n b /= 255;\n var max = Math.max(r, g, b),\n min = Math.min(r, g, b),\n l = (max + min) / 2;\n if (channel === 'l') return l * 100;\n if (max === min) return 0; // Achromatic\n\n var d = max - min,\n s = l > .5 ? d / (2 - max - min) : d / (max + min);\n if (channel === 's') return s * 100;\n\n switch (max) {\n case r:\n return ((g - b) / d + (g < b ? 6 : 0)) * 60;\n\n case g:\n return ((b - r) / d + 2) * 60;\n\n case b:\n return ((r - g) / d + 4) * 60;\n\n default:\n return -1;\n //TSC: TypeScript is stupid and complains if there isn't this useless default statement\n }\n }\n};\n/* EXPORT */\n\nexports.default = Channel;","\"use strict\";\n/* LANG */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar Lang = {\n round: function round(number) {\n return Math.round(number * 10000000000) / 10000000000;\n }\n};\n/* EXPORT */\n\nexports.default = Lang;","\"use strict\";\n/* UNIT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar Unit = {\n frac2hex: function frac2hex(frac) {\n var hex = Math.round(frac * 255).toString(16);\n return hex.length > 1 ? hex : \"0\" + hex;\n },\n dec2hex: function dec2hex(dec) {\n var hex = Math.round(dec).toString(16);\n return hex.length > 1 ? hex : \"0\" + hex;\n }\n};\n/* EXPORT */\n\nexports.default = Unit;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar utils_1 = require(\"../utils\");\n\nvar types_1 = require(\"../types\");\n\nvar type_1 = require(\"./type\");\n/* CHANNELS */\n\n\nvar Channels =\n/** @class */\nfunction () {\n /* CONSTRUCTOR */\n function Channels(data, color) {\n this.color = color;\n this.changed = false;\n this.data = data; //TSC\n\n this.type = new type_1.default();\n }\n /* API */\n\n\n Channels.prototype.set = function (data, color) {\n this.color = color;\n this.changed = false;\n this.data = data; //TSC\n\n this.type.type = types_1.TYPE.ALL;\n return this;\n };\n /* HELPERS */\n\n\n Channels.prototype._ensureHSL = function () {\n if (this.data.h === undefined) this.data.h = utils_1.default.channel.rgb2hsl(this.data, 'h');\n if (this.data.s === undefined) this.data.s = utils_1.default.channel.rgb2hsl(this.data, 's');\n if (this.data.l === undefined) this.data.l = utils_1.default.channel.rgb2hsl(this.data, 'l');\n };\n\n Channels.prototype._ensureRGB = function () {\n if (this.data.r === undefined) this.data.r = utils_1.default.channel.hsl2rgb(this.data, 'r');\n if (this.data.g === undefined) this.data.g = utils_1.default.channel.hsl2rgb(this.data, 'g');\n if (this.data.b === undefined) this.data.b = utils_1.default.channel.hsl2rgb(this.data, 'b');\n };\n\n Object.defineProperty(Channels.prototype, \"r\", {\n /* GETTERS */\n get: function get() {\n if (!this.type.is(types_1.TYPE.HSL) && this.data.r !== undefined) return this.data.r;\n\n this._ensureHSL();\n\n return utils_1.default.channel.hsl2rgb(this.data, 'r');\n },\n\n /* SETTERS */\n set: function set(r) {\n this.type.set(types_1.TYPE.RGB);\n this.changed = true;\n this.data.r = r;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Channels.prototype, \"g\", {\n get: function get() {\n if (!this.type.is(types_1.TYPE.HSL) && this.data.g !== undefined) return this.data.g;\n\n this._ensureHSL();\n\n return utils_1.default.channel.hsl2rgb(this.data, 'g');\n },\n set: function set(g) {\n this.type.set(types_1.TYPE.RGB);\n this.changed = true;\n this.data.g = g;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Channels.prototype, \"b\", {\n get: function get() {\n if (!this.type.is(types_1.TYPE.HSL) && this.data.b !== undefined) return this.data.b;\n\n this._ensureHSL();\n\n return utils_1.default.channel.hsl2rgb(this.data, 'b');\n },\n set: function set(b) {\n this.type.set(types_1.TYPE.RGB);\n this.changed = true;\n this.data.b = b;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Channels.prototype, \"h\", {\n get: function get() {\n if (!this.type.is(types_1.TYPE.RGB) && this.data.h !== undefined) return this.data.h;\n\n this._ensureRGB();\n\n return utils_1.default.channel.rgb2hsl(this.data, 'h');\n },\n set: function set(h) {\n this.type.set(types_1.TYPE.HSL);\n this.changed = true;\n this.data.h = h;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Channels.prototype, \"s\", {\n get: function get() {\n if (!this.type.is(types_1.TYPE.RGB) && this.data.s !== undefined) return this.data.s;\n\n this._ensureRGB();\n\n return utils_1.default.channel.rgb2hsl(this.data, 's');\n },\n set: function set(s) {\n this.type.set(types_1.TYPE.HSL);\n this.changed = true;\n this.data.s = s;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Channels.prototype, \"l\", {\n get: function get() {\n if (!this.type.is(types_1.TYPE.RGB) && this.data.l !== undefined) return this.data.l;\n\n this._ensureRGB();\n\n return utils_1.default.channel.rgb2hsl(this.data, 'l');\n },\n set: function set(l) {\n this.type.set(types_1.TYPE.HSL);\n this.changed = true;\n this.data.l = l;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Channels.prototype, \"a\", {\n get: function get() {\n return this.data.a;\n },\n set: function set(a) {\n this.changed = true;\n this.data.a = a;\n },\n enumerable: true,\n configurable: true\n });\n return Channels;\n}();\n/* EXPORT */\n\n\nexports.default = Channels;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar types_1 = require(\"../types\");\n/* TYPE */\n\n\nvar Type =\n/** @class */\nfunction () {\n function Type() {\n this.type = types_1.TYPE.ALL;\n }\n\n Type.prototype.get = function () {\n return this.type;\n };\n\n Type.prototype.set = function (type) {\n if (this.type && this.type !== type) throw new Error('Cannot change both RGB and HSL channels at the same time');\n this.type = type;\n };\n\n Type.prototype.reset = function () {\n this.type = types_1.TYPE.ALL;\n };\n\n Type.prototype.is = function (type) {\n return this.type === type;\n };\n\n return Type;\n}();\n/* EXPORT */\n\n\nexports.default = Type;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar utils_1 = require(\"./utils\");\n/* CONSTS */\n\n\nvar DEC2HEX = {};\nexports.DEC2HEX = DEC2HEX;\n\nfor (var i = 0; i <= 255; i++) {\n DEC2HEX[i] = utils_1.default.unit.dec2hex(i);\n} // Populating dynamically, striking a balance between code size and performance","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar hex_1 = require(\"./hex\");\n/* KEYWORD */\n\n\nvar Keyword = {\n /* VARIABLES */\n colors: {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyanaqua: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkgrey: '#a9a9a9',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkslategrey: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dimgrey: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n grey: '#808080',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgray: '#d3d3d3',\n lightgreen: '#90ee90',\n lightgrey: '#d3d3d3',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightslategrey: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370db',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#db7093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n slategrey: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n transparent: '#00000000',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32'\n },\n\n /* API */\n parse: function parse(color) {\n color = color.toLowerCase();\n var hex = Keyword.colors[color];\n if (!hex) return;\n return hex_1.default.parse(hex);\n },\n stringify: function stringify(channels) {\n var hex = hex_1.default.stringify(channels);\n\n for (var name_1 in Keyword.colors) {\n if (Keyword.colors[name_1] === hex) return name_1;\n }\n }\n};\n/* EXPORT */\n\nexports.default = Keyword;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar utils_1 = require(\"../utils\");\n\nvar reusable_1 = require(\"../channels/reusable\");\n/* RGB */\n\n\nvar RGB = {\n /* VARIABLES */\n re: /^rgba?\\(\\s*?(-?(?:\\d+(?:\\.\\d+)?|(?:\\.\\d+))(?:e\\d+)?(%?))\\s*?(?:,|\\s)\\s*?(-?(?:\\d+(?:\\.\\d+)?|(?:\\.\\d+))(?:e\\d+)?(%?))\\s*?(?:,|\\s)\\s*?(-?(?:\\d+(?:\\.\\d+)?|(?:\\.\\d+))(?:e\\d+)?(%?))(?:\\s*?(?:,|\\/)\\s*?\\+?(-?(?:\\d+(?:\\.\\d+)?|(?:\\.\\d+))(?:e\\d+)?(%?)))?\\s*?\\)$/i,\n\n /* API */\n parse: function parse(color) {\n var charCode = color.charCodeAt(0);\n if (charCode !== 114 && charCode !== 82) return; // 'r'/'R'\n\n var match = color.match(RGB.re);\n if (!match) return;\n var r = match[1],\n isRedPercentage = match[2],\n g = match[3],\n isGreenPercentage = match[4],\n b = match[5],\n isBluePercentage = match[6],\n a = match[7],\n isAlphaPercentage = match[8];\n return reusable_1.default.set({\n r: utils_1.default.channel.clamp.r(isRedPercentage ? parseFloat(r) * 2.55 : parseFloat(r)),\n g: utils_1.default.channel.clamp.g(isGreenPercentage ? parseFloat(g) * 2.55 : parseFloat(g)),\n b: utils_1.default.channel.clamp.b(isBluePercentage ? parseFloat(b) * 2.55 : parseFloat(b)),\n a: a ? utils_1.default.channel.clamp.a(isAlphaPercentage ? parseFloat(a) / 100 : parseFloat(a)) : 1\n }, color);\n },\n stringify: function stringify(channels) {\n if (channels.a < 1) {\n // RGBA\n return \"rgba(\" + utils_1.default.lang.round(channels.r) + \", \" + utils_1.default.lang.round(channels.g) + \", \" + utils_1.default.lang.round(channels.b) + \", \" + utils_1.default.lang.round(channels.a) + \")\";\n } else {\n // RGB\n return \"rgb(\" + utils_1.default.lang.round(channels.r) + \", \" + utils_1.default.lang.round(channels.g) + \", \" + utils_1.default.lang.round(channels.b) + \")\";\n }\n }\n};\n/* EXPORT */\n\nexports.default = RGB;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar utils_1 = require(\"../utils\");\n\nvar reusable_1 = require(\"../channels/reusable\");\n/* HSL */\n\n\nvar HSL = {\n /* VARIABLES */\n re: /^hsla?\\(\\s*?(-?(?:\\d+(?:\\.\\d+)?|(?:\\.\\d+))(?:e-?\\d+)?(?:deg|grad|rad|turn)?)\\s*?(?:,|\\s)\\s*?(-?(?:\\d+(?:\\.\\d+)?|(?:\\.\\d+))(?:e-?\\d+)?%)\\s*?(?:,|\\s)\\s*?(-?(?:\\d+(?:\\.\\d+)?|(?:\\.\\d+))(?:e-?\\d+)?%)(?:\\s*?(?:,|\\/)\\s*?\\+?(-?(?:\\d+(?:\\.\\d+)?|(?:\\.\\d+))(?:e-?\\d+)?(%)?))?\\s*?\\)$/i,\n hueRe: /^(.+?)(deg|grad|rad|turn)$/i,\n\n /* HELPERS */\n _hue2deg: function _hue2deg(hue) {\n var match = hue.match(HSL.hueRe);\n\n if (match) {\n var number = match[1],\n unit = match[2];\n\n switch (unit) {\n case 'grad':\n return utils_1.default.channel.clamp.h(parseFloat(number) * .9);\n\n case 'rad':\n return utils_1.default.channel.clamp.h(parseFloat(number) * 180 / Math.PI);\n\n case 'turn':\n return utils_1.default.channel.clamp.h(parseFloat(number) * 360);\n }\n }\n\n return utils_1.default.channel.clamp.h(parseFloat(hue));\n },\n\n /* API */\n parse: function parse(color) {\n var charCode = color.charCodeAt(0);\n if (charCode !== 104 && charCode !== 72) return; // 'h'/'H'\n\n var match = color.match(HSL.re);\n if (!match) return;\n var h = match[1],\n s = match[2],\n l = match[3],\n a = match[4],\n isAlphaPercentage = match[5];\n return reusable_1.default.set({\n h: HSL._hue2deg(h),\n s: utils_1.default.channel.clamp.s(parseFloat(s)),\n l: utils_1.default.channel.clamp.l(parseFloat(l)),\n a: a ? utils_1.default.channel.clamp.a(isAlphaPercentage ? parseFloat(a) / 100 : parseFloat(a)) : 1\n }, color);\n },\n stringify: function stringify(channels) {\n if (channels.a < 1) {\n // HSLA\n return \"hsla(\" + utils_1.default.lang.round(channels.h) + \", \" + utils_1.default.lang.round(channels.s) + \"%, \" + utils_1.default.lang.round(channels.l) + \"%, \" + channels.a + \")\";\n } else {\n // HSL\n return \"hsl(\" + utils_1.default.lang.round(channels.h) + \", \" + utils_1.default.lang.round(channels.s) + \"%, \" + utils_1.default.lang.round(channels.l) + \"%)\";\n }\n }\n};\n/* EXPORT */\n\nexports.default = HSL;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar channel_1 = require(\"./channel\");\n/* RED */\n\n\nfunction red(color) {\n return channel_1.default(color, 'r');\n}\n/* EXPORT */\n\n\nexports.default = red;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar channel_1 = require(\"./channel\");\n/* GREEN */\n\n\nfunction green(color) {\n return channel_1.default(color, 'g');\n}\n/* EXPORT */\n\n\nexports.default = green;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar channel_1 = require(\"./channel\");\n/* BLUE */\n\n\nfunction blue(color) {\n return channel_1.default(color, 'b');\n}\n/* EXPORT */\n\n\nexports.default = blue;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar channel_1 = require(\"./channel\");\n/* HUE */\n\n\nfunction hue(color) {\n return channel_1.default(color, 'h');\n}\n/* EXPORT */\n\n\nexports.default = hue;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar channel_1 = require(\"./channel\");\n/* SATURATION */\n\n\nfunction saturation(color) {\n return channel_1.default(color, 's');\n}\n/* EXPORT */\n\n\nexports.default = saturation;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar channel_1 = require(\"./channel\");\n/* LIGHTNESS */\n\n\nfunction lightness(color) {\n return channel_1.default(color, 'l');\n}\n/* EXPORT */\n\n\nexports.default = lightness;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar is_light_1 = require(\"./is_light\");\n/* IS DARK */\n\n\nfunction isDark(color) {\n return !is_light_1.default(color);\n}\n/* EXPORT */\n\n\nexports.default = isDark;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar color_1 = require(\"../color\");\n/* IS VALID */\n\n\nfunction isValid(color) {\n try {\n color_1.default.parse(color);\n return true;\n } catch (_a) {\n return false;\n }\n}\n/* EXPORT */\n\n\nexports.default = isValid;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar adjust_channel_1 = require(\"./adjust_channel\");\n/* SATURATE */\n\n\nfunction saturate(color, amount) {\n return adjust_channel_1.default(color, 's', amount);\n}\n/* EXPORT */\n\n\nexports.default = saturate;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar adjust_channel_1 = require(\"./adjust_channel\");\n/* DESATURATE */\n\n\nfunction desaturate(color, amount) {\n return adjust_channel_1.default(color, 's', -amount);\n}\n/* EXPORT */\n\n\nexports.default = desaturate;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar adjust_channel_1 = require(\"./adjust_channel\");\n/* LIGHTEN */\n\n\nfunction lighten(color, amount) {\n return adjust_channel_1.default(color, 'l', amount);\n}\n/* EXPORT */\n\n\nexports.default = lighten;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar adjust_channel_1 = require(\"./adjust_channel\");\n/* DARKEN */\n\n\nfunction darken(color, amount) {\n return adjust_channel_1.default(color, 'l', -amount);\n}\n/* EXPORT */\n\n\nexports.default = darken;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar adjust_channel_1 = require(\"./adjust_channel\");\n/* COMPLEMENT */\n\n\nfunction complement(color) {\n return adjust_channel_1.default(color, 'h', 180);\n}\n/* EXPORT */\n\n\nexports.default = complement;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar change_1 = require(\"./change\");\n/* GRAYSCALE */\n\n\nfunction grayscale(color) {\n return change_1.default(color, {\n s: 0\n });\n}\n/* EXPORT */\n\n\nexports.default = grayscale;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar color_1 = require(\"../color\");\n\nvar mix_1 = require(\"./mix\");\n/* INVERT */\n\n\nfunction invert(color, weight) {\n if (weight === void 0) {\n weight = 100;\n }\n\n var inverse = color_1.default.parse(color);\n inverse.r = 255 - inverse.r;\n inverse.g = 255 - inverse.g;\n inverse.b = 255 - inverse.b;\n return mix_1.default(inverse, color, weight);\n}\n/* EXPORT */\n\n\nexports.default = invert;","\"use strict\";\n/* IMPORT */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar utils_1 = require(\"../utils\");\n\nvar color_1 = require(\"../color\");\n\nvar adjust_1 = require(\"./adjust\");\n/* SCALE */\n\n\nfunction scale(color, channels) {\n var ch = color_1.default.parse(color),\n adjustments = {},\n delta = function delta(amount, weight, max) {\n return weight > 0 ? (max - amount) * weight / 100 : amount * weight / 100;\n };\n\n for (var c in channels) {\n adjustments[c] = delta(ch[c], channels[c], utils_1.default.channel.max[c]);\n }\n\n return adjust_1.default(color, adjustments);\n}\n/* EXPORT */\n\n\nexports.default = scale;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n!function (e, t) {\n \"object\" == (typeof exports === \"undefined\" ? \"undefined\" : _typeof(exports)) && \"undefined\" != typeof module ? module.exports = t() : \"function\" == typeof define && define.amd ? define(t) : e.moment = t();\n}(this, function () {\n \"use strict\";\n\n var e, i;\n\n function c() {\n return e.apply(null, arguments);\n }\n\n function o(e) {\n return e instanceof Array || \"[object Array]\" === Object.prototype.toString.call(e);\n }\n\n function u(e) {\n return null != e && \"[object Object]\" === Object.prototype.toString.call(e);\n }\n\n function l(e) {\n return void 0 === e;\n }\n\n function d(e) {\n return \"number\" == typeof e || \"[object Number]\" === Object.prototype.toString.call(e);\n }\n\n function h(e) {\n return e instanceof Date || \"[object Date]\" === Object.prototype.toString.call(e);\n }\n\n function f(e, t) {\n var n,\n s = [];\n\n for (n = 0; n < e.length; ++n) {\n s.push(t(e[n], n));\n }\n\n return s;\n }\n\n function m(e, t) {\n return Object.prototype.hasOwnProperty.call(e, t);\n }\n\n function _(e, t) {\n for (var n in t) {\n m(t, n) && (e[n] = t[n]);\n }\n\n return m(t, \"toString\") && (e.toString = t.toString), m(t, \"valueOf\") && (e.valueOf = t.valueOf), e;\n }\n\n function y(e, t, n, s) {\n return Ot(e, t, n, s, !0).utc();\n }\n\n function g(e) {\n return null == e._pf && (e._pf = {\n empty: !1,\n unusedTokens: [],\n unusedInput: [],\n overflow: -2,\n charsLeftOver: 0,\n nullInput: !1,\n invalidMonth: null,\n invalidFormat: !1,\n userInvalidated: !1,\n iso: !1,\n parsedDateParts: [],\n meridiem: null,\n rfc2822: !1,\n weekdayMismatch: !1\n }), e._pf;\n }\n\n function p(e) {\n if (null == e._isValid) {\n var t = g(e),\n n = i.call(t.parsedDateParts, function (e) {\n return null != e;\n }),\n s = !isNaN(e._d.getTime()) && t.overflow < 0 && !t.empty && !t.invalidMonth && !t.invalidWeekday && !t.weekdayMismatch && !t.nullInput && !t.invalidFormat && !t.userInvalidated && (!t.meridiem || t.meridiem && n);\n if (e._strict && (s = s && 0 === t.charsLeftOver && 0 === t.unusedTokens.length && void 0 === t.bigHour), null != Object.isFrozen && Object.isFrozen(e)) return s;\n e._isValid = s;\n }\n\n return e._isValid;\n }\n\n function v(e) {\n var t = y(NaN);\n return null != e ? _(g(t), e) : g(t).userInvalidated = !0, t;\n }\n\n i = Array.prototype.some ? Array.prototype.some : function (e) {\n for (var t = Object(this), n = t.length >>> 0, s = 0; s < n; s++) {\n if (s in t && e.call(this, t[s], s, t)) return !0;\n }\n\n return !1;\n };\n var r = c.momentProperties = [];\n\n function w(e, t) {\n var n, s, i;\n if (l(t._isAMomentObject) || (e._isAMomentObject = t._isAMomentObject), l(t._i) || (e._i = t._i), l(t._f) || (e._f = t._f), l(t._l) || (e._l = t._l), l(t._strict) || (e._strict = t._strict), l(t._tzm) || (e._tzm = t._tzm), l(t._isUTC) || (e._isUTC = t._isUTC), l(t._offset) || (e._offset = t._offset), l(t._pf) || (e._pf = g(t)), l(t._locale) || (e._locale = t._locale), 0 < r.length) for (n = 0; n < r.length; n++) {\n l(i = t[s = r[n]]) || (e[s] = i);\n }\n return e;\n }\n\n var t = !1;\n\n function M(e) {\n w(this, e), this._d = new Date(null != e._d ? e._d.getTime() : NaN), this.isValid() || (this._d = new Date(NaN)), !1 === t && (t = !0, c.updateOffset(this), t = !1);\n }\n\n function S(e) {\n return e instanceof M || null != e && null != e._isAMomentObject;\n }\n\n function D(e) {\n return e < 0 ? Math.ceil(e) || 0 : Math.floor(e);\n }\n\n function k(e) {\n var t = +e,\n n = 0;\n return 0 !== t && isFinite(t) && (n = D(t)), n;\n }\n\n function a(e, t, n) {\n var s,\n i = Math.min(e.length, t.length),\n r = Math.abs(e.length - t.length),\n a = 0;\n\n for (s = 0; s < i; s++) {\n (n && e[s] !== t[s] || !n && k(e[s]) !== k(t[s])) && a++;\n }\n\n return a + r;\n }\n\n function Y(e) {\n !1 === c.suppressDeprecationWarnings && \"undefined\" != typeof console && console.warn && console.warn(\"Deprecation warning: \" + e);\n }\n\n function n(i, r) {\n var a = !0;\n return _(function () {\n if (null != c.deprecationHandler && c.deprecationHandler(null, i), a) {\n for (var e, t = [], n = 0; n < arguments.length; n++) {\n if (e = \"\", \"object\" == _typeof(arguments[n])) {\n for (var s in e += \"\\n[\" + n + \"] \", arguments[0]) {\n e += s + \": \" + arguments[0][s] + \", \";\n }\n\n e = e.slice(0, -2);\n } else e = arguments[n];\n\n t.push(e);\n }\n\n Y(i + \"\\nArguments: \" + Array.prototype.slice.call(t).join(\"\") + \"\\n\" + new Error().stack), a = !1;\n }\n\n return r.apply(this, arguments);\n }, r);\n }\n\n var s,\n O = {};\n\n function T(e, t) {\n null != c.deprecationHandler && c.deprecationHandler(e, t), O[e] || (Y(t), O[e] = !0);\n }\n\n function x(e) {\n return e instanceof Function || \"[object Function]\" === Object.prototype.toString.call(e);\n }\n\n function b(e, t) {\n var n,\n s = _({}, e);\n\n for (n in t) {\n m(t, n) && (u(e[n]) && u(t[n]) ? (s[n] = {}, _(s[n], e[n]), _(s[n], t[n])) : null != t[n] ? s[n] = t[n] : delete s[n]);\n }\n\n for (n in e) {\n m(e, n) && !m(t, n) && u(e[n]) && (s[n] = _({}, s[n]));\n }\n\n return s;\n }\n\n function P(e) {\n null != e && this.set(e);\n }\n\n c.suppressDeprecationWarnings = !1, c.deprecationHandler = null, s = Object.keys ? Object.keys : function (e) {\n var t,\n n = [];\n\n for (t in e) {\n m(e, t) && n.push(t);\n }\n\n return n;\n };\n var W = {};\n\n function H(e, t) {\n var n = e.toLowerCase();\n W[n] = W[n + \"s\"] = W[t] = e;\n }\n\n function R(e) {\n return \"string\" == typeof e ? W[e] || W[e.toLowerCase()] : void 0;\n }\n\n function C(e) {\n var t,\n n,\n s = {};\n\n for (n in e) {\n m(e, n) && (t = R(n)) && (s[t] = e[n]);\n }\n\n return s;\n }\n\n var F = {};\n\n function L(e, t) {\n F[e] = t;\n }\n\n function U(e, t, n) {\n var s = \"\" + Math.abs(e),\n i = t - s.length;\n return (0 <= e ? n ? \"+\" : \"\" : \"-\") + Math.pow(10, Math.max(0, i)).toString().substr(1) + s;\n }\n\n var N = /(\\[[^\\[]*\\])|(\\\\)?([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?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,\n G = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,\n V = {},\n E = {};\n\n function I(e, t, n, s) {\n var i = s;\n \"string\" == typeof s && (i = function i() {\n return this[s]();\n }), e && (E[e] = i), t && (E[t[0]] = function () {\n return U(i.apply(this, arguments), t[1], t[2]);\n }), n && (E[n] = function () {\n return this.localeData().ordinal(i.apply(this, arguments), e);\n });\n }\n\n function A(e, t) {\n return e.isValid() ? (t = j(t, e.localeData()), V[t] = V[t] || function (s) {\n var e,\n i,\n t,\n r = s.match(N);\n\n for (e = 0, i = r.length; e < i; e++) {\n E[r[e]] ? r[e] = E[r[e]] : r[e] = (t = r[e]).match(/\\[[\\s\\S]/) ? t.replace(/^\\[|\\]$/g, \"\") : t.replace(/\\\\/g, \"\");\n }\n\n return function (e) {\n var t,\n n = \"\";\n\n for (t = 0; t < i; t++) {\n n += x(r[t]) ? r[t].call(e, s) : r[t];\n }\n\n return n;\n };\n }(t), V[t](e)) : e.localeData().invalidDate();\n }\n\n function j(e, t) {\n var n = 5;\n\n function s(e) {\n return t.longDateFormat(e) || e;\n }\n\n for (G.lastIndex = 0; 0 <= n && G.test(e);) {\n e = e.replace(G, s), G.lastIndex = 0, n -= 1;\n }\n\n return e;\n }\n\n var Z = /\\d/,\n z = /\\d\\d/,\n $ = /\\d{3}/,\n q = /\\d{4}/,\n J = /[+-]?\\d{6}/,\n B = /\\d\\d?/,\n Q = /\\d\\d\\d\\d?/,\n X = /\\d\\d\\d\\d\\d\\d?/,\n K = /\\d{1,3}/,\n ee = /\\d{1,4}/,\n te = /[+-]?\\d{1,6}/,\n ne = /\\d+/,\n se = /[+-]?\\d+/,\n ie = /Z|[+-]\\d\\d:?\\d\\d/gi,\n re = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi,\n ae = /[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i,\n oe = {};\n\n function ue(e, n, s) {\n oe[e] = x(n) ? n : function (e, t) {\n return e && s ? s : n;\n };\n }\n\n function le(e, t) {\n return m(oe, e) ? oe[e](t._strict, t._locale) : new RegExp(de(e.replace(\"\\\\\", \"\").replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (e, t, n, s, i) {\n return t || n || s || i;\n })));\n }\n\n function de(e) {\n return e.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\");\n }\n\n var he = {};\n\n function ce(e, n) {\n var t,\n s = n;\n\n for (\"string\" == typeof e && (e = [e]), d(n) && (s = function s(e, t) {\n t[n] = k(e);\n }), t = 0; t < e.length; t++) {\n he[e[t]] = s;\n }\n }\n\n function fe(e, i) {\n ce(e, function (e, t, n, s) {\n n._w = n._w || {}, i(e, n._w, n, s);\n });\n }\n\n var me = 0,\n _e = 1,\n ye = 2,\n ge = 3,\n pe = 4,\n ve = 5,\n we = 6,\n Me = 7,\n Se = 8;\n\n function De(e) {\n return ke(e) ? 366 : 365;\n }\n\n function ke(e) {\n return e % 4 == 0 && e % 100 != 0 || e % 400 == 0;\n }\n\n I(\"Y\", 0, 0, function () {\n var e = this.year();\n return e <= 9999 ? \"\" + e : \"+\" + e;\n }), I(0, [\"YY\", 2], 0, function () {\n return this.year() % 100;\n }), I(0, [\"YYYY\", 4], 0, \"year\"), I(0, [\"YYYYY\", 5], 0, \"year\"), I(0, [\"YYYYYY\", 6, !0], 0, \"year\"), H(\"year\", \"y\"), L(\"year\", 1), ue(\"Y\", se), ue(\"YY\", B, z), ue(\"YYYY\", ee, q), ue(\"YYYYY\", te, J), ue(\"YYYYYY\", te, J), ce([\"YYYYY\", \"YYYYYY\"], me), ce(\"YYYY\", function (e, t) {\n t[me] = 2 === e.length ? c.parseTwoDigitYear(e) : k(e);\n }), ce(\"YY\", function (e, t) {\n t[me] = c.parseTwoDigitYear(e);\n }), ce(\"Y\", function (e, t) {\n t[me] = parseInt(e, 10);\n }), c.parseTwoDigitYear = function (e) {\n return k(e) + (68 < k(e) ? 1900 : 2e3);\n };\n var Ye,\n Oe = Te(\"FullYear\", !0);\n\n function Te(t, n) {\n return function (e) {\n return null != e ? (be(this, t, e), c.updateOffset(this, n), this) : xe(this, t);\n };\n }\n\n function xe(e, t) {\n return e.isValid() ? e._d[\"get\" + (e._isUTC ? \"UTC\" : \"\") + t]() : NaN;\n }\n\n function be(e, t, n) {\n e.isValid() && !isNaN(n) && (\"FullYear\" === t && ke(e.year()) && 1 === e.month() && 29 === e.date() ? e._d[\"set\" + (e._isUTC ? \"UTC\" : \"\") + t](n, e.month(), Pe(n, e.month())) : e._d[\"set\" + (e._isUTC ? \"UTC\" : \"\") + t](n));\n }\n\n function Pe(e, t) {\n if (isNaN(e) || isNaN(t)) return NaN;\n var n,\n s = (t % (n = 12) + n) % n;\n return e += (t - s) / 12, 1 === s ? ke(e) ? 29 : 28 : 31 - s % 7 % 2;\n }\n\n Ye = Array.prototype.indexOf ? Array.prototype.indexOf : function (e) {\n var t;\n\n for (t = 0; t < this.length; ++t) {\n if (this[t] === e) return t;\n }\n\n return -1;\n }, I(\"M\", [\"MM\", 2], \"Mo\", function () {\n return this.month() + 1;\n }), I(\"MMM\", 0, 0, function (e) {\n return this.localeData().monthsShort(this, e);\n }), I(\"MMMM\", 0, 0, function (e) {\n return this.localeData().months(this, e);\n }), H(\"month\", \"M\"), L(\"month\", 8), ue(\"M\", B), ue(\"MM\", B, z), ue(\"MMM\", function (e, t) {\n return t.monthsShortRegex(e);\n }), ue(\"MMMM\", function (e, t) {\n return t.monthsRegex(e);\n }), ce([\"M\", \"MM\"], function (e, t) {\n t[_e] = k(e) - 1;\n }), ce([\"MMM\", \"MMMM\"], function (e, t, n, s) {\n var i = n._locale.monthsParse(e, s, n._strict);\n\n null != i ? t[_e] = i : g(n).invalidMonth = e;\n });\n var We = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/,\n He = \"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\");\n var Re = \"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec\".split(\"_\");\n\n function Ce(e, t) {\n var n;\n if (!e.isValid()) return e;\n if (\"string\" == typeof t) if (/^\\d+$/.test(t)) t = k(t);else if (!d(t = e.localeData().monthsParse(t))) return e;\n return n = Math.min(e.date(), Pe(e.year(), t)), e._d[\"set\" + (e._isUTC ? \"UTC\" : \"\") + \"Month\"](t, n), e;\n }\n\n function Fe(e) {\n return null != e ? (Ce(this, e), c.updateOffset(this, !0), this) : xe(this, \"Month\");\n }\n\n var Le = ae;\n var Ue = ae;\n\n function Ne() {\n function e(e, t) {\n return t.length - e.length;\n }\n\n var t,\n n,\n s = [],\n i = [],\n r = [];\n\n for (t = 0; t < 12; t++) {\n n = y([2e3, t]), s.push(this.monthsShort(n, \"\")), i.push(this.months(n, \"\")), r.push(this.months(n, \"\")), r.push(this.monthsShort(n, \"\"));\n }\n\n for (s.sort(e), i.sort(e), r.sort(e), t = 0; t < 12; t++) {\n s[t] = de(s[t]), i[t] = de(i[t]);\n }\n\n for (t = 0; t < 24; t++) {\n r[t] = de(r[t]);\n }\n\n this._monthsRegex = new RegExp(\"^(\" + r.join(\"|\") + \")\", \"i\"), this._monthsShortRegex = this._monthsRegex, this._monthsStrictRegex = new RegExp(\"^(\" + i.join(\"|\") + \")\", \"i\"), this._monthsShortStrictRegex = new RegExp(\"^(\" + s.join(\"|\") + \")\", \"i\");\n }\n\n function Ge(e) {\n var t = new Date(Date.UTC.apply(null, arguments));\n return e < 100 && 0 <= e && isFinite(t.getUTCFullYear()) && t.setUTCFullYear(e), t;\n }\n\n function Ve(e, t, n) {\n var s = 7 + t - n;\n return -((7 + Ge(e, 0, s).getUTCDay() - t) % 7) + s - 1;\n }\n\n function Ee(e, t, n, s, i) {\n var r,\n a,\n o = 1 + 7 * (t - 1) + (7 + n - s) % 7 + Ve(e, s, i);\n return o <= 0 ? a = De(r = e - 1) + o : o > De(e) ? (r = e + 1, a = o - De(e)) : (r = e, a = o), {\n year: r,\n dayOfYear: a\n };\n }\n\n function Ie(e, t, n) {\n var s,\n i,\n r = Ve(e.year(), t, n),\n a = Math.floor((e.dayOfYear() - r - 1) / 7) + 1;\n return a < 1 ? s = a + Ae(i = e.year() - 1, t, n) : a > Ae(e.year(), t, n) ? (s = a - Ae(e.year(), t, n), i = e.year() + 1) : (i = e.year(), s = a), {\n week: s,\n year: i\n };\n }\n\n function Ae(e, t, n) {\n var s = Ve(e, t, n),\n i = Ve(e + 1, t, n);\n return (De(e) - s + i) / 7;\n }\n\n I(\"w\", [\"ww\", 2], \"wo\", \"week\"), I(\"W\", [\"WW\", 2], \"Wo\", \"isoWeek\"), H(\"week\", \"w\"), H(\"isoWeek\", \"W\"), L(\"week\", 5), L(\"isoWeek\", 5), ue(\"w\", B), ue(\"ww\", B, z), ue(\"W\", B), ue(\"WW\", B, z), fe([\"w\", \"ww\", \"W\", \"WW\"], function (e, t, n, s) {\n t[s.substr(0, 1)] = k(e);\n });\n I(\"d\", 0, \"do\", \"day\"), I(\"dd\", 0, 0, function (e) {\n return this.localeData().weekdaysMin(this, e);\n }), I(\"ddd\", 0, 0, function (e) {\n return this.localeData().weekdaysShort(this, e);\n }), I(\"dddd\", 0, 0, function (e) {\n return this.localeData().weekdays(this, e);\n }), I(\"e\", 0, 0, \"weekday\"), I(\"E\", 0, 0, \"isoWeekday\"), H(\"day\", \"d\"), H(\"weekday\", \"e\"), H(\"isoWeekday\", \"E\"), L(\"day\", 11), L(\"weekday\", 11), L(\"isoWeekday\", 11), ue(\"d\", B), ue(\"e\", B), ue(\"E\", B), ue(\"dd\", function (e, t) {\n return t.weekdaysMinRegex(e);\n }), ue(\"ddd\", function (e, t) {\n return t.weekdaysShortRegex(e);\n }), ue(\"dddd\", function (e, t) {\n return t.weekdaysRegex(e);\n }), fe([\"dd\", \"ddd\", \"dddd\"], function (e, t, n, s) {\n var i = n._locale.weekdaysParse(e, s, n._strict);\n\n null != i ? t.d = i : g(n).invalidWeekday = e;\n }), fe([\"d\", \"e\", \"E\"], function (e, t, n, s) {\n t[s] = k(e);\n });\n var je = \"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\");\n var Ze = \"Sun_Mon_Tue_Wed_Thu_Fri_Sat\".split(\"_\");\n var ze = \"Su_Mo_Tu_We_Th_Fr_Sa\".split(\"_\");\n var $e = ae;\n var qe = ae;\n var Je = ae;\n\n function Be() {\n function e(e, t) {\n return t.length - e.length;\n }\n\n var t,\n n,\n s,\n i,\n r,\n a = [],\n o = [],\n u = [],\n l = [];\n\n for (t = 0; t < 7; t++) {\n n = y([2e3, 1]).day(t), s = this.weekdaysMin(n, \"\"), i = this.weekdaysShort(n, \"\"), r = this.weekdays(n, \"\"), a.push(s), o.push(i), u.push(r), l.push(s), l.push(i), l.push(r);\n }\n\n for (a.sort(e), o.sort(e), u.sort(e), l.sort(e), t = 0; t < 7; t++) {\n o[t] = de(o[t]), u[t] = de(u[t]), l[t] = de(l[t]);\n }\n\n this._weekdaysRegex = new RegExp(\"^(\" + l.join(\"|\") + \")\", \"i\"), this._weekdaysShortRegex = this._weekdaysRegex, this._weekdaysMinRegex = this._weekdaysRegex, this._weekdaysStrictRegex = new RegExp(\"^(\" + u.join(\"|\") + \")\", \"i\"), this._weekdaysShortStrictRegex = new RegExp(\"^(\" + o.join(\"|\") + \")\", \"i\"), this._weekdaysMinStrictRegex = new RegExp(\"^(\" + a.join(\"|\") + \")\", \"i\");\n }\n\n function Qe() {\n return this.hours() % 12 || 12;\n }\n\n function Xe(e, t) {\n I(e, 0, 0, function () {\n return this.localeData().meridiem(this.hours(), this.minutes(), t);\n });\n }\n\n function Ke(e, t) {\n return t._meridiemParse;\n }\n\n I(\"H\", [\"HH\", 2], 0, \"hour\"), I(\"h\", [\"hh\", 2], 0, Qe), I(\"k\", [\"kk\", 2], 0, function () {\n return this.hours() || 24;\n }), I(\"hmm\", 0, 0, function () {\n return \"\" + Qe.apply(this) + U(this.minutes(), 2);\n }), I(\"hmmss\", 0, 0, function () {\n return \"\" + Qe.apply(this) + U(this.minutes(), 2) + U(this.seconds(), 2);\n }), I(\"Hmm\", 0, 0, function () {\n return \"\" + this.hours() + U(this.minutes(), 2);\n }), I(\"Hmmss\", 0, 0, function () {\n return \"\" + this.hours() + U(this.minutes(), 2) + U(this.seconds(), 2);\n }), Xe(\"a\", !0), Xe(\"A\", !1), H(\"hour\", \"h\"), L(\"hour\", 13), ue(\"a\", Ke), ue(\"A\", Ke), ue(\"H\", B), ue(\"h\", B), ue(\"k\", B), ue(\"HH\", B, z), ue(\"hh\", B, z), ue(\"kk\", B, z), ue(\"hmm\", Q), ue(\"hmmss\", X), ue(\"Hmm\", Q), ue(\"Hmmss\", X), ce([\"H\", \"HH\"], ge), ce([\"k\", \"kk\"], function (e, t, n) {\n var s = k(e);\n t[ge] = 24 === s ? 0 : s;\n }), ce([\"a\", \"A\"], function (e, t, n) {\n n._isPm = n._locale.isPM(e), n._meridiem = e;\n }), ce([\"h\", \"hh\"], function (e, t, n) {\n t[ge] = k(e), g(n).bigHour = !0;\n }), ce(\"hmm\", function (e, t, n) {\n var s = e.length - 2;\n t[ge] = k(e.substr(0, s)), t[pe] = k(e.substr(s)), g(n).bigHour = !0;\n }), ce(\"hmmss\", function (e, t, n) {\n var s = e.length - 4,\n i = e.length - 2;\n t[ge] = k(e.substr(0, s)), t[pe] = k(e.substr(s, 2)), t[ve] = k(e.substr(i)), g(n).bigHour = !0;\n }), ce(\"Hmm\", function (e, t, n) {\n var s = e.length - 2;\n t[ge] = k(e.substr(0, s)), t[pe] = k(e.substr(s));\n }), ce(\"Hmmss\", function (e, t, n) {\n var s = e.length - 4,\n i = e.length - 2;\n t[ge] = k(e.substr(0, s)), t[pe] = k(e.substr(s, 2)), t[ve] = k(e.substr(i));\n });\n var et,\n tt = Te(\"Hours\", !0),\n nt = {\n calendar: {\n sameDay: \"[Today at] LT\",\n nextDay: \"[Tomorrow at] LT\",\n nextWeek: \"dddd [at] LT\",\n lastDay: \"[Yesterday at] LT\",\n lastWeek: \"[Last] dddd [at] LT\",\n sameElse: \"L\"\n },\n longDateFormat: {\n LTS: \"h:mm:ss A\",\n LT: \"h:mm A\",\n L: \"MM/DD/YYYY\",\n LL: \"MMMM D, YYYY\",\n LLL: \"MMMM D, YYYY h:mm A\",\n LLLL: \"dddd, MMMM D, YYYY h:mm A\"\n },\n invalidDate: \"Invalid date\",\n ordinal: \"%d\",\n dayOfMonthOrdinalParse: /\\d{1,2}/,\n relativeTime: {\n future: \"in %s\",\n past: \"%s ago\",\n s: \"a few seconds\",\n ss: \"%d seconds\",\n m: \"a minute\",\n mm: \"%d minutes\",\n h: \"an hour\",\n hh: \"%d hours\",\n d: \"a day\",\n dd: \"%d days\",\n M: \"a month\",\n MM: \"%d months\",\n y: \"a year\",\n yy: \"%d years\"\n },\n months: He,\n monthsShort: Re,\n week: {\n dow: 0,\n doy: 6\n },\n weekdays: je,\n weekdaysMin: ze,\n weekdaysShort: Ze,\n meridiemParse: /[ap]\\.?m?\\.?/i\n },\n st = {},\n it = {};\n\n function rt(e) {\n return e ? e.toLowerCase().replace(\"_\", \"-\") : e;\n }\n\n function at(e) {\n var t = null;\n if (!st[e] && \"undefined\" != typeof module && module && module.exports) try {\n t = et._abbr, require(\"./locale/\" + e), ot(t);\n } catch (e) {}\n return st[e];\n }\n\n function ot(e, t) {\n var n;\n return e && ((n = l(t) ? lt(e) : ut(e, t)) ? et = n : \"undefined\" != typeof console && console.warn && console.warn(\"Locale \" + e + \" not found. Did you forget to load it?\")), et._abbr;\n }\n\n function ut(e, t) {\n if (null !== t) {\n var n,\n s = nt;\n if (t.abbr = e, null != st[e]) T(\"defineLocaleOverride\", \"use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info.\"), s = st[e]._config;else if (null != t.parentLocale) if (null != st[t.parentLocale]) s = st[t.parentLocale]._config;else {\n if (null == (n = at(t.parentLocale))) return it[t.parentLocale] || (it[t.parentLocale] = []), it[t.parentLocale].push({\n name: e,\n config: t\n }), null;\n s = n._config;\n }\n return st[e] = new P(b(s, t)), it[e] && it[e].forEach(function (e) {\n ut(e.name, e.config);\n }), ot(e), st[e];\n }\n\n return delete st[e], null;\n }\n\n function lt(e) {\n var t;\n if (e && e._locale && e._locale._abbr && (e = e._locale._abbr), !e) return et;\n\n if (!o(e)) {\n if (t = at(e)) return t;\n e = [e];\n }\n\n return function (e) {\n for (var t, n, s, i, r = 0; r < e.length;) {\n for (t = (i = rt(e[r]).split(\"-\")).length, n = (n = rt(e[r + 1])) ? n.split(\"-\") : null; 0 < t;) {\n if (s = at(i.slice(0, t).join(\"-\"))) return s;\n if (n && n.length >= t && a(i, n, !0) >= t - 1) break;\n t--;\n }\n\n r++;\n }\n\n return et;\n }(e);\n }\n\n function dt(e) {\n var t,\n n = e._a;\n return n && -2 === g(e).overflow && (t = n[_e] < 0 || 11 < n[_e] ? _e : n[ye] < 1 || n[ye] > Pe(n[me], n[_e]) ? ye : n[ge] < 0 || 24 < n[ge] || 24 === n[ge] && (0 !== n[pe] || 0 !== n[ve] || 0 !== n[we]) ? ge : n[pe] < 0 || 59 < n[pe] ? pe : n[ve] < 0 || 59 < n[ve] ? ve : n[we] < 0 || 999 < n[we] ? we : -1, g(e)._overflowDayOfYear && (t < me || ye < t) && (t = ye), g(e)._overflowWeeks && -1 === t && (t = Me), g(e)._overflowWeekday && -1 === t && (t = Se), g(e).overflow = t), e;\n }\n\n function ht(e, t, n) {\n return null != e ? e : null != t ? t : n;\n }\n\n function ct(e) {\n var t,\n n,\n s,\n i,\n r,\n a = [];\n\n if (!e._d) {\n var o, u;\n\n for (o = e, u = new Date(c.now()), s = o._useUTC ? [u.getUTCFullYear(), u.getUTCMonth(), u.getUTCDate()] : [u.getFullYear(), u.getMonth(), u.getDate()], e._w && null == e._a[ye] && null == e._a[_e] && function (e) {\n var t, n, s, i, r, a, o, u;\n if (null != (t = e._w).GG || null != t.W || null != t.E) r = 1, a = 4, n = ht(t.GG, e._a[me], Ie(Tt(), 1, 4).year), s = ht(t.W, 1), ((i = ht(t.E, 1)) < 1 || 7 < i) && (u = !0);else {\n r = e._locale._week.dow, a = e._locale._week.doy;\n var l = Ie(Tt(), r, a);\n n = ht(t.gg, e._a[me], l.year), s = ht(t.w, l.week), null != t.d ? ((i = t.d) < 0 || 6 < i) && (u = !0) : null != t.e ? (i = t.e + r, (t.e < 0 || 6 < t.e) && (u = !0)) : i = r;\n }\n s < 1 || s > Ae(n, r, a) ? g(e)._overflowWeeks = !0 : null != u ? g(e)._overflowWeekday = !0 : (o = Ee(n, s, i, r, a), e._a[me] = o.year, e._dayOfYear = o.dayOfYear);\n }(e), null != e._dayOfYear && (r = ht(e._a[me], s[me]), (e._dayOfYear > De(r) || 0 === e._dayOfYear) && (g(e)._overflowDayOfYear = !0), n = Ge(r, 0, e._dayOfYear), e._a[_e] = n.getUTCMonth(), e._a[ye] = n.getUTCDate()), t = 0; t < 3 && null == e._a[t]; ++t) {\n e._a[t] = a[t] = s[t];\n }\n\n for (; t < 7; t++) {\n e._a[t] = a[t] = null == e._a[t] ? 2 === t ? 1 : 0 : e._a[t];\n }\n\n 24 === e._a[ge] && 0 === e._a[pe] && 0 === e._a[ve] && 0 === e._a[we] && (e._nextDay = !0, e._a[ge] = 0), e._d = (e._useUTC ? Ge : function (e, t, n, s, i, r, a) {\n var o = new Date(e, t, n, s, i, r, a);\n return e < 100 && 0 <= e && isFinite(o.getFullYear()) && o.setFullYear(e), o;\n }).apply(null, a), i = e._useUTC ? e._d.getUTCDay() : e._d.getDay(), null != e._tzm && e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), e._nextDay && (e._a[ge] = 24), e._w && void 0 !== e._w.d && e._w.d !== i && (g(e).weekdayMismatch = !0);\n }\n }\n\n var ft = /^\\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 mt = /^\\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 _t = /Z|[+-]\\d\\d(?::?\\d\\d)?/,\n yt = [[\"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}/]],\n gt = [[\"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/]],\n pt = /^\\/?Date\\((\\-?\\d+)/i;\n\n function vt(e) {\n var t,\n n,\n s,\n i,\n r,\n a,\n o = e._i,\n u = ft.exec(o) || mt.exec(o);\n\n if (u) {\n for (g(e).iso = !0, t = 0, n = yt.length; t < n; t++) {\n if (yt[t][1].exec(u[1])) {\n i = yt[t][0], s = !1 !== yt[t][2];\n break;\n }\n }\n\n if (null == i) return void (e._isValid = !1);\n\n if (u[3]) {\n for (t = 0, n = gt.length; t < n; t++) {\n if (gt[t][1].exec(u[3])) {\n r = (u[2] || \" \") + gt[t][0];\n break;\n }\n }\n\n if (null == r) return void (e._isValid = !1);\n }\n\n if (!s && null != r) return void (e._isValid = !1);\n\n if (u[4]) {\n if (!_t.exec(u[4])) return void (e._isValid = !1);\n a = \"Z\";\n }\n\n e._f = i + (r || \"\") + (a || \"\"), kt(e);\n } else e._isValid = !1;\n }\n\n var wt = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/;\n\n function Mt(e, t, n, s, i, r) {\n var a = [function (e) {\n var t = parseInt(e, 10);\n {\n if (t <= 49) return 2e3 + t;\n if (t <= 999) return 1900 + t;\n }\n return t;\n }(e), Re.indexOf(t), parseInt(n, 10), parseInt(s, 10), parseInt(i, 10)];\n return r && a.push(parseInt(r, 10)), a;\n }\n\n var St = {\n UT: 0,\n GMT: 0,\n EDT: -240,\n EST: -300,\n CDT: -300,\n CST: -360,\n MDT: -360,\n MST: -420,\n PDT: -420,\n PST: -480\n };\n\n function Dt(e) {\n var t,\n n,\n s,\n i = wt.exec(e._i.replace(/\\([^)]*\\)|[\\n\\t]/g, \" \").replace(/(\\s\\s+)/g, \" \").trim());\n\n if (i) {\n var r = Mt(i[4], i[3], i[2], i[5], i[6], i[7]);\n if (t = i[1], n = r, s = e, t && Ze.indexOf(t) !== new Date(n[0], n[1], n[2]).getDay() && (g(s).weekdayMismatch = !0, !(s._isValid = !1))) return;\n e._a = r, e._tzm = function (e, t, n) {\n if (e) return St[e];\n if (t) return 0;\n var s = parseInt(n, 10),\n i = s % 100;\n return (s - i) / 100 * 60 + i;\n }(i[8], i[9], i[10]), e._d = Ge.apply(null, e._a), e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), g(e).rfc2822 = !0;\n } else e._isValid = !1;\n }\n\n function kt(e) {\n if (e._f !== c.ISO_8601) {\n if (e._f !== c.RFC_2822) {\n e._a = [], g(e).empty = !0;\n var t,\n n,\n s,\n i,\n r,\n a,\n o,\n u,\n l = \"\" + e._i,\n d = l.length,\n h = 0;\n\n for (s = j(e._f, e._locale).match(N) || [], t = 0; t < s.length; t++) {\n i = s[t], (n = (l.match(le(i, e)) || [])[0]) && (0 < (r = l.substr(0, l.indexOf(n))).length && g(e).unusedInput.push(r), l = l.slice(l.indexOf(n) + n.length), h += n.length), E[i] ? (n ? g(e).empty = !1 : g(e).unusedTokens.push(i), a = i, u = e, null != (o = n) && m(he, a) && he[a](o, u._a, u, a)) : e._strict && !n && g(e).unusedTokens.push(i);\n }\n\n g(e).charsLeftOver = d - h, 0 < l.length && g(e).unusedInput.push(l), e._a[ge] <= 12 && !0 === g(e).bigHour && 0 < e._a[ge] && (g(e).bigHour = void 0), g(e).parsedDateParts = e._a.slice(0), g(e).meridiem = e._meridiem, e._a[ge] = function (e, t, n) {\n var s;\n if (null == n) return t;\n return null != e.meridiemHour ? e.meridiemHour(t, n) : (null != e.isPM && ((s = e.isPM(n)) && t < 12 && (t += 12), s || 12 !== t || (t = 0)), t);\n }(e._locale, e._a[ge], e._meridiem), ct(e), dt(e);\n } else Dt(e);\n } else vt(e);\n }\n\n function Yt(e) {\n var t,\n n,\n s,\n i,\n r = e._i,\n a = e._f;\n return e._locale = e._locale || lt(e._l), null === r || void 0 === a && \"\" === r ? v({\n nullInput: !0\n }) : (\"string\" == typeof r && (e._i = r = e._locale.preparse(r)), S(r) ? new M(dt(r)) : (h(r) ? e._d = r : o(a) ? function (e) {\n var t, n, s, i, r;\n if (0 === e._f.length) return g(e).invalidFormat = !0, e._d = new Date(NaN);\n\n for (i = 0; i < e._f.length; i++) {\n r = 0, t = w({}, e), null != e._useUTC && (t._useUTC = e._useUTC), t._f = e._f[i], kt(t), p(t) && (r += g(t).charsLeftOver, r += 10 * g(t).unusedTokens.length, g(t).score = r, (null == s || r < s) && (s = r, n = t));\n }\n\n _(e, n || t);\n }(e) : a ? kt(e) : l(n = (t = e)._i) ? t._d = new Date(c.now()) : h(n) ? t._d = new Date(n.valueOf()) : \"string\" == typeof n ? (s = t, null === (i = pt.exec(s._i)) ? (vt(s), !1 === s._isValid && (delete s._isValid, Dt(s), !1 === s._isValid && (delete s._isValid, c.createFromInputFallback(s)))) : s._d = new Date(+i[1])) : o(n) ? (t._a = f(n.slice(0), function (e) {\n return parseInt(e, 10);\n }), ct(t)) : u(n) ? function (e) {\n if (!e._d) {\n var t = C(e._i);\n e._a = f([t.year, t.month, t.day || t.date, t.hour, t.minute, t.second, t.millisecond], function (e) {\n return e && parseInt(e, 10);\n }), ct(e);\n }\n }(t) : d(n) ? t._d = new Date(n) : c.createFromInputFallback(t), p(e) || (e._d = null), e));\n }\n\n function Ot(e, t, n, s, i) {\n var r,\n a = {};\n return !0 !== n && !1 !== n || (s = n, n = void 0), (u(e) && function (e) {\n if (Object.getOwnPropertyNames) return 0 === Object.getOwnPropertyNames(e).length;\n var t;\n\n for (t in e) {\n if (e.hasOwnProperty(t)) return !1;\n }\n\n return !0;\n }(e) || o(e) && 0 === e.length) && (e = void 0), a._isAMomentObject = !0, a._useUTC = a._isUTC = i, a._l = n, a._i = e, a._f = t, a._strict = s, (r = new M(dt(Yt(a))))._nextDay && (r.add(1, \"d\"), r._nextDay = void 0), r;\n }\n\n function Tt(e, t, n, s) {\n return Ot(e, t, n, s, !1);\n }\n\n c.createFromInputFallback = n(\"value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.\", function (e) {\n e._d = new Date(e._i + (e._useUTC ? \" UTC\" : \"\"));\n }), c.ISO_8601 = function () {}, c.RFC_2822 = function () {};\n var xt = n(\"moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/\", function () {\n var e = Tt.apply(null, arguments);\n return this.isValid() && e.isValid() ? e < this ? this : e : v();\n }),\n bt = n(\"moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/\", function () {\n var e = Tt.apply(null, arguments);\n return this.isValid() && e.isValid() ? this < e ? this : e : v();\n });\n\n function Pt(e, t) {\n var n, s;\n if (1 === t.length && o(t[0]) && (t = t[0]), !t.length) return Tt();\n\n for (n = t[0], s = 1; s < t.length; ++s) {\n t[s].isValid() && !t[s][e](n) || (n = t[s]);\n }\n\n return n;\n }\n\n var Wt = [\"year\", \"quarter\", \"month\", \"week\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n function Ht(e) {\n var t = C(e),\n n = t.year || 0,\n s = t.quarter || 0,\n i = t.month || 0,\n r = t.week || 0,\n a = t.day || 0,\n o = t.hour || 0,\n u = t.minute || 0,\n l = t.second || 0,\n d = t.millisecond || 0;\n this._isValid = function (e) {\n for (var t in e) {\n if (-1 === Ye.call(Wt, t) || null != e[t] && isNaN(e[t])) return !1;\n }\n\n for (var n = !1, s = 0; s < Wt.length; ++s) {\n if (e[Wt[s]]) {\n if (n) return !1;\n parseFloat(e[Wt[s]]) !== k(e[Wt[s]]) && (n = !0);\n }\n }\n\n return !0;\n }(t), this._milliseconds = +d + 1e3 * l + 6e4 * u + 1e3 * o * 60 * 60, this._days = +a + 7 * r, this._months = +i + 3 * s + 12 * n, this._data = {}, this._locale = lt(), this._bubble();\n }\n\n function Rt(e) {\n return e instanceof Ht;\n }\n\n function Ct(e) {\n return e < 0 ? -1 * Math.round(-1 * e) : Math.round(e);\n }\n\n function Ft(e, n) {\n I(e, 0, 0, function () {\n var e = this.utcOffset(),\n t = \"+\";\n return e < 0 && (e = -e, t = \"-\"), t + U(~~(e / 60), 2) + n + U(~~e % 60, 2);\n });\n }\n\n Ft(\"Z\", \":\"), Ft(\"ZZ\", \"\"), ue(\"Z\", re), ue(\"ZZ\", re), ce([\"Z\", \"ZZ\"], function (e, t, n) {\n n._useUTC = !0, n._tzm = Ut(re, e);\n });\n var Lt = /([\\+\\-]|\\d\\d)/gi;\n\n function Ut(e, t) {\n var n = (t || \"\").match(e);\n if (null === n) return null;\n var s = ((n[n.length - 1] || []) + \"\").match(Lt) || [\"-\", 0, 0],\n i = 60 * s[1] + k(s[2]);\n return 0 === i ? 0 : \"+\" === s[0] ? i : -i;\n }\n\n function Nt(e, t) {\n var n, s;\n return t._isUTC ? (n = t.clone(), s = (S(e) || h(e) ? e.valueOf() : Tt(e).valueOf()) - n.valueOf(), n._d.setTime(n._d.valueOf() + s), c.updateOffset(n, !1), n) : Tt(e).local();\n }\n\n function Gt(e) {\n return 15 * -Math.round(e._d.getTimezoneOffset() / 15);\n }\n\n function Vt() {\n return !!this.isValid() && this._isUTC && 0 === this._offset;\n }\n\n c.updateOffset = function () {};\n\n var Et = /^(\\-|\\+)?(?:(\\d*)[. ])?(\\d+)\\:(\\d+)(?:\\:(\\d+)(\\.\\d*)?)?$/,\n It = /^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;\n\n function At(e, t) {\n var n,\n s,\n i,\n r = e,\n a = null;\n return Rt(e) ? r = {\n ms: e._milliseconds,\n d: e._days,\n M: e._months\n } : d(e) ? (r = {}, t ? r[t] = e : r.milliseconds = e) : (a = Et.exec(e)) ? (n = \"-\" === a[1] ? -1 : 1, r = {\n y: 0,\n d: k(a[ye]) * n,\n h: k(a[ge]) * n,\n m: k(a[pe]) * n,\n s: k(a[ve]) * n,\n ms: k(Ct(1e3 * a[we])) * n\n }) : (a = It.exec(e)) ? (n = \"-\" === a[1] ? -1 : (a[1], 1), r = {\n y: jt(a[2], n),\n M: jt(a[3], n),\n w: jt(a[4], n),\n d: jt(a[5], n),\n h: jt(a[6], n),\n m: jt(a[7], n),\n s: jt(a[8], n)\n }) : null == r ? r = {} : \"object\" == _typeof(r) && (\"from\" in r || \"to\" in r) && (i = function (e, t) {\n var n;\n if (!e.isValid() || !t.isValid()) return {\n milliseconds: 0,\n months: 0\n };\n t = Nt(t, e), e.isBefore(t) ? n = Zt(e, t) : ((n = Zt(t, e)).milliseconds = -n.milliseconds, n.months = -n.months);\n return n;\n }(Tt(r.from), Tt(r.to)), (r = {}).ms = i.milliseconds, r.M = i.months), s = new Ht(r), Rt(e) && m(e, \"_locale\") && (s._locale = e._locale), s;\n }\n\n function jt(e, t) {\n var n = e && parseFloat(e.replace(\",\", \".\"));\n return (isNaN(n) ? 0 : n) * t;\n }\n\n function Zt(e, t) {\n var n = {\n milliseconds: 0,\n months: 0\n };\n return n.months = t.month() - e.month() + 12 * (t.year() - e.year()), e.clone().add(n.months, \"M\").isAfter(t) && --n.months, n.milliseconds = +t - +e.clone().add(n.months, \"M\"), n;\n }\n\n function zt(s, i) {\n return function (e, t) {\n var n;\n return null === t || isNaN(+t) || (T(i, \"moment().\" + i + \"(period, number) is deprecated. Please use moment().\" + i + \"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"), n = e, e = t, t = n), $t(this, At(e = \"string\" == typeof e ? +e : e, t), s), this;\n };\n }\n\n function $t(e, t, n, s) {\n var i = t._milliseconds,\n r = Ct(t._days),\n a = Ct(t._months);\n e.isValid() && (s = null == s || s, a && Ce(e, xe(e, \"Month\") + a * n), r && be(e, \"Date\", xe(e, \"Date\") + r * n), i && e._d.setTime(e._d.valueOf() + i * n), s && c.updateOffset(e, r || a));\n }\n\n At.fn = Ht.prototype, At.invalid = function () {\n return At(NaN);\n };\n var qt = zt(1, \"add\"),\n Jt = zt(-1, \"subtract\");\n\n function Bt(e, t) {\n var n = 12 * (t.year() - e.year()) + (t.month() - e.month()),\n s = e.clone().add(n, \"months\");\n return -(n + (t - s < 0 ? (t - s) / (s - e.clone().add(n - 1, \"months\")) : (t - s) / (e.clone().add(n + 1, \"months\") - s))) || 0;\n }\n\n function Qt(e) {\n var t;\n return void 0 === e ? this._locale._abbr : (null != (t = lt(e)) && (this._locale = t), this);\n }\n\n c.defaultFormat = \"YYYY-MM-DDTHH:mm:ssZ\", c.defaultFormatUtc = \"YYYY-MM-DDTHH:mm:ss[Z]\";\n var Xt = n(\"moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.\", function (e) {\n return void 0 === e ? this.localeData() : this.locale(e);\n });\n\n function Kt() {\n return this._locale;\n }\n\n function en(e, t) {\n I(0, [e, e.length], 0, t);\n }\n\n function tn(e, t, n, s, i) {\n var r;\n return null == e ? Ie(this, s, i).year : ((r = Ae(e, s, i)) < t && (t = r), function (e, t, n, s, i) {\n var r = Ee(e, t, n, s, i),\n a = Ge(r.year, 0, r.dayOfYear);\n return this.year(a.getUTCFullYear()), this.month(a.getUTCMonth()), this.date(a.getUTCDate()), this;\n }.call(this, e, t, n, s, i));\n }\n\n I(0, [\"gg\", 2], 0, function () {\n return this.weekYear() % 100;\n }), I(0, [\"GG\", 2], 0, function () {\n return this.isoWeekYear() % 100;\n }), en(\"gggg\", \"weekYear\"), en(\"ggggg\", \"weekYear\"), en(\"GGGG\", \"isoWeekYear\"), en(\"GGGGG\", \"isoWeekYear\"), H(\"weekYear\", \"gg\"), H(\"isoWeekYear\", \"GG\"), L(\"weekYear\", 1), L(\"isoWeekYear\", 1), ue(\"G\", se), ue(\"g\", se), ue(\"GG\", B, z), ue(\"gg\", B, z), ue(\"GGGG\", ee, q), ue(\"gggg\", ee, q), ue(\"GGGGG\", te, J), ue(\"ggggg\", te, J), fe([\"gggg\", \"ggggg\", \"GGGG\", \"GGGGG\"], function (e, t, n, s) {\n t[s.substr(0, 2)] = k(e);\n }), fe([\"gg\", \"GG\"], function (e, t, n, s) {\n t[s] = c.parseTwoDigitYear(e);\n }), I(\"Q\", 0, \"Qo\", \"quarter\"), H(\"quarter\", \"Q\"), L(\"quarter\", 7), ue(\"Q\", Z), ce(\"Q\", function (e, t) {\n t[_e] = 3 * (k(e) - 1);\n }), I(\"D\", [\"DD\", 2], \"Do\", \"date\"), H(\"date\", \"D\"), L(\"date\", 9), ue(\"D\", B), ue(\"DD\", B, z), ue(\"Do\", function (e, t) {\n return e ? t._dayOfMonthOrdinalParse || t._ordinalParse : t._dayOfMonthOrdinalParseLenient;\n }), ce([\"D\", \"DD\"], ye), ce(\"Do\", function (e, t) {\n t[ye] = k(e.match(B)[0]);\n });\n var nn = Te(\"Date\", !0);\n I(\"DDD\", [\"DDDD\", 3], \"DDDo\", \"dayOfYear\"), H(\"dayOfYear\", \"DDD\"), L(\"dayOfYear\", 4), ue(\"DDD\", K), ue(\"DDDD\", $), ce([\"DDD\", \"DDDD\"], function (e, t, n) {\n n._dayOfYear = k(e);\n }), I(\"m\", [\"mm\", 2], 0, \"minute\"), H(\"minute\", \"m\"), L(\"minute\", 14), ue(\"m\", B), ue(\"mm\", B, z), ce([\"m\", \"mm\"], pe);\n var sn = Te(\"Minutes\", !1);\n I(\"s\", [\"ss\", 2], 0, \"second\"), H(\"second\", \"s\"), L(\"second\", 15), ue(\"s\", B), ue(\"ss\", B, z), ce([\"s\", \"ss\"], ve);\n var rn,\n an = Te(\"Seconds\", !1);\n\n for (I(\"S\", 0, 0, function () {\n return ~~(this.millisecond() / 100);\n }), I(0, [\"SS\", 2], 0, function () {\n return ~~(this.millisecond() / 10);\n }), I(0, [\"SSS\", 3], 0, \"millisecond\"), I(0, [\"SSSS\", 4], 0, function () {\n return 10 * this.millisecond();\n }), I(0, [\"SSSSS\", 5], 0, function () {\n return 100 * this.millisecond();\n }), I(0, [\"SSSSSS\", 6], 0, function () {\n return 1e3 * this.millisecond();\n }), I(0, [\"SSSSSSS\", 7], 0, function () {\n return 1e4 * this.millisecond();\n }), I(0, [\"SSSSSSSS\", 8], 0, function () {\n return 1e5 * this.millisecond();\n }), I(0, [\"SSSSSSSSS\", 9], 0, function () {\n return 1e6 * this.millisecond();\n }), H(\"millisecond\", \"ms\"), L(\"millisecond\", 16), ue(\"S\", K, Z), ue(\"SS\", K, z), ue(\"SSS\", K, $), rn = \"SSSS\"; rn.length <= 9; rn += \"S\") {\n ue(rn, ne);\n }\n\n function on(e, t) {\n t[we] = k(1e3 * (\"0.\" + e));\n }\n\n for (rn = \"S\"; rn.length <= 9; rn += \"S\") {\n ce(rn, on);\n }\n\n var un = Te(\"Milliseconds\", !1);\n I(\"z\", 0, 0, \"zoneAbbr\"), I(\"zz\", 0, 0, \"zoneName\");\n var ln = M.prototype;\n\n function dn(e) {\n return e;\n }\n\n ln.add = qt, ln.calendar = function (e, t) {\n var n = e || Tt(),\n s = Nt(n, this).startOf(\"day\"),\n i = c.calendarFormat(this, s) || \"sameElse\",\n r = t && (x(t[i]) ? t[i].call(this, n) : t[i]);\n return this.format(r || this.localeData().calendar(i, this, Tt(n)));\n }, ln.clone = function () {\n return new M(this);\n }, ln.diff = function (e, t, n) {\n var s, i, r;\n if (!this.isValid()) return NaN;\n if (!(s = Nt(e, this)).isValid()) return NaN;\n\n switch (i = 6e4 * (s.utcOffset() - this.utcOffset()), t = R(t)) {\n case \"year\":\n r = Bt(this, s) / 12;\n break;\n\n case \"month\":\n r = Bt(this, s);\n break;\n\n case \"quarter\":\n r = Bt(this, s) / 3;\n break;\n\n case \"second\":\n r = (this - s) / 1e3;\n break;\n\n case \"minute\":\n r = (this - s) / 6e4;\n break;\n\n case \"hour\":\n r = (this - s) / 36e5;\n break;\n\n case \"day\":\n r = (this - s - i) / 864e5;\n break;\n\n case \"week\":\n r = (this - s - i) / 6048e5;\n break;\n\n default:\n r = this - s;\n }\n\n return n ? r : D(r);\n }, ln.endOf = function (e) {\n return void 0 === (e = R(e)) || \"millisecond\" === e ? this : (\"date\" === e && (e = \"day\"), this.startOf(e).add(1, \"isoWeek\" === e ? \"week\" : e).subtract(1, \"ms\"));\n }, ln.format = function (e) {\n e || (e = this.isUtc() ? c.defaultFormatUtc : c.defaultFormat);\n var t = A(this, e);\n return this.localeData().postformat(t);\n }, ln.from = function (e, t) {\n return this.isValid() && (S(e) && e.isValid() || Tt(e).isValid()) ? At({\n to: this,\n from: e\n }).locale(this.locale()).humanize(!t) : this.localeData().invalidDate();\n }, ln.fromNow = function (e) {\n return this.from(Tt(), e);\n }, ln.to = function (e, t) {\n return this.isValid() && (S(e) && e.isValid() || Tt(e).isValid()) ? At({\n from: this,\n to: e\n }).locale(this.locale()).humanize(!t) : this.localeData().invalidDate();\n }, ln.toNow = function (e) {\n return this.to(Tt(), e);\n }, ln.get = function (e) {\n return x(this[e = R(e)]) ? this[e]() : this;\n }, ln.invalidAt = function () {\n return g(this).overflow;\n }, ln.isAfter = function (e, t) {\n var n = S(e) ? e : Tt(e);\n return !(!this.isValid() || !n.isValid()) && (\"millisecond\" === (t = R(l(t) ? \"millisecond\" : t)) ? this.valueOf() > n.valueOf() : n.valueOf() < this.clone().startOf(t).valueOf());\n }, ln.isBefore = function (e, t) {\n var n = S(e) ? e : Tt(e);\n return !(!this.isValid() || !n.isValid()) && (\"millisecond\" === (t = R(l(t) ? \"millisecond\" : t)) ? this.valueOf() < n.valueOf() : this.clone().endOf(t).valueOf() < n.valueOf());\n }, ln.isBetween = function (e, t, n, s) {\n return (\"(\" === (s = s || \"()\")[0] ? this.isAfter(e, n) : !this.isBefore(e, n)) && (\")\" === s[1] ? this.isBefore(t, n) : !this.isAfter(t, n));\n }, ln.isSame = function (e, t) {\n var n,\n s = S(e) ? e : Tt(e);\n return !(!this.isValid() || !s.isValid()) && (\"millisecond\" === (t = R(t || \"millisecond\")) ? this.valueOf() === s.valueOf() : (n = s.valueOf(), this.clone().startOf(t).valueOf() <= n && n <= this.clone().endOf(t).valueOf()));\n }, ln.isSameOrAfter = function (e, t) {\n return this.isSame(e, t) || this.isAfter(e, t);\n }, ln.isSameOrBefore = function (e, t) {\n return this.isSame(e, t) || this.isBefore(e, t);\n }, ln.isValid = function () {\n return p(this);\n }, ln.lang = Xt, ln.locale = Qt, ln.localeData = Kt, ln.max = bt, ln.min = xt, ln.parsingFlags = function () {\n return _({}, g(this));\n }, ln.set = function (e, t) {\n if (\"object\" == _typeof(e)) for (var n = function (e) {\n var t = [];\n\n for (var n in e) {\n t.push({\n unit: n,\n priority: F[n]\n });\n }\n\n return t.sort(function (e, t) {\n return e.priority - t.priority;\n }), t;\n }(e = C(e)), s = 0; s < n.length; s++) {\n this[n[s].unit](e[n[s].unit]);\n } else if (x(this[e = R(e)])) return this[e](t);\n return this;\n }, ln.startOf = function (e) {\n switch (e = R(e)) {\n case \"year\":\n this.month(0);\n\n case \"quarter\":\n case \"month\":\n this.date(1);\n\n case \"week\":\n case \"isoWeek\":\n case \"day\":\n case \"date\":\n this.hours(0);\n\n case \"hour\":\n this.minutes(0);\n\n case \"minute\":\n this.seconds(0);\n\n case \"second\":\n this.milliseconds(0);\n }\n\n return \"week\" === e && this.weekday(0), \"isoWeek\" === e && this.isoWeekday(1), \"quarter\" === e && this.month(3 * Math.floor(this.month() / 3)), this;\n }, ln.subtract = Jt, ln.toArray = function () {\n var e = this;\n return [e.year(), e.month(), e.date(), e.hour(), e.minute(), e.second(), e.millisecond()];\n }, ln.toObject = function () {\n var e = this;\n return {\n years: e.year(),\n months: e.month(),\n date: e.date(),\n hours: e.hours(),\n minutes: e.minutes(),\n seconds: e.seconds(),\n milliseconds: e.milliseconds()\n };\n }, ln.toDate = function () {\n return new Date(this.valueOf());\n }, ln.toISOString = function (e) {\n if (!this.isValid()) return null;\n var t = !0 !== e,\n n = t ? this.clone().utc() : this;\n return n.year() < 0 || 9999 < n.year() ? A(n, t ? \"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]\" : \"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ\") : x(Date.prototype.toISOString) ? t ? this.toDate().toISOString() : new Date(this.valueOf() + 60 * this.utcOffset() * 1e3).toISOString().replace(\"Z\", A(n, \"Z\")) : A(n, t ? \"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]\" : \"YYYY-MM-DD[T]HH:mm:ss.SSSZ\");\n }, ln.inspect = function () {\n if (!this.isValid()) return \"moment.invalid(/* \" + this._i + \" */)\";\n var e = \"moment\",\n t = \"\";\n this.isLocal() || (e = 0 === this.utcOffset() ? \"moment.utc\" : \"moment.parseZone\", t = \"Z\");\n var n = \"[\" + e + '(\"]',\n s = 0 <= this.year() && this.year() <= 9999 ? \"YYYY\" : \"YYYYYY\",\n i = t + '[\")]';\n return this.format(n + s + \"-MM-DD[T]HH:mm:ss.SSS\" + i);\n }, ln.toJSON = function () {\n return this.isValid() ? this.toISOString() : null;\n }, ln.toString = function () {\n return this.clone().locale(\"en\").format(\"ddd MMM DD YYYY HH:mm:ss [GMT]ZZ\");\n }, ln.unix = function () {\n return Math.floor(this.valueOf() / 1e3);\n }, ln.valueOf = function () {\n return this._d.valueOf() - 6e4 * (this._offset || 0);\n }, ln.creationData = function () {\n return {\n input: this._i,\n format: this._f,\n locale: this._locale,\n isUTC: this._isUTC,\n strict: this._strict\n };\n }, ln.year = Oe, ln.isLeapYear = function () {\n return ke(this.year());\n }, ln.weekYear = function (e) {\n return tn.call(this, e, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy);\n }, ln.isoWeekYear = function (e) {\n return tn.call(this, e, this.isoWeek(), this.isoWeekday(), 1, 4);\n }, ln.quarter = ln.quarters = function (e) {\n return null == e ? Math.ceil((this.month() + 1) / 3) : this.month(3 * (e - 1) + this.month() % 3);\n }, ln.month = Fe, ln.daysInMonth = function () {\n return Pe(this.year(), this.month());\n }, ln.week = ln.weeks = function (e) {\n var t = this.localeData().week(this);\n return null == e ? t : this.add(7 * (e - t), \"d\");\n }, ln.isoWeek = ln.isoWeeks = function (e) {\n var t = Ie(this, 1, 4).week;\n return null == e ? t : this.add(7 * (e - t), \"d\");\n }, ln.weeksInYear = function () {\n var e = this.localeData()._week;\n\n return Ae(this.year(), e.dow, e.doy);\n }, ln.isoWeeksInYear = function () {\n return Ae(this.year(), 1, 4);\n }, ln.date = nn, ln.day = ln.days = function (e) {\n if (!this.isValid()) return null != e ? this : NaN;\n var t,\n n,\n s = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n return null != e ? (t = e, n = this.localeData(), e = \"string\" != typeof t ? t : isNaN(t) ? \"number\" == typeof (t = n.weekdaysParse(t)) ? t : null : parseInt(t, 10), this.add(e - s, \"d\")) : s;\n }, ln.weekday = function (e) {\n if (!this.isValid()) return null != e ? this : NaN;\n var t = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return null == e ? t : this.add(e - t, \"d\");\n }, ln.isoWeekday = function (e) {\n if (!this.isValid()) return null != e ? this : NaN;\n\n if (null != e) {\n var t = (n = e, s = this.localeData(), \"string\" == typeof n ? s.weekdaysParse(n) % 7 || 7 : isNaN(n) ? null : n);\n return this.day(this.day() % 7 ? t : t - 7);\n }\n\n return this.day() || 7;\n var n, s;\n }, ln.dayOfYear = function (e) {\n var t = Math.round((this.clone().startOf(\"day\") - this.clone().startOf(\"year\")) / 864e5) + 1;\n return null == e ? t : this.add(e - t, \"d\");\n }, ln.hour = ln.hours = tt, ln.minute = ln.minutes = sn, ln.second = ln.seconds = an, ln.millisecond = ln.milliseconds = un, ln.utcOffset = function (e, t, n) {\n var s,\n i = this._offset || 0;\n if (!this.isValid()) return null != e ? this : NaN;\n\n if (null != e) {\n if (\"string\" == typeof e) {\n if (null === (e = Ut(re, e))) return this;\n } else Math.abs(e) < 16 && !n && (e *= 60);\n\n return !this._isUTC && t && (s = Gt(this)), this._offset = e, this._isUTC = !0, null != s && this.add(s, \"m\"), i !== e && (!t || this._changeInProgress ? $t(this, At(e - i, \"m\"), 1, !1) : this._changeInProgress || (this._changeInProgress = !0, c.updateOffset(this, !0), this._changeInProgress = null)), this;\n }\n\n return this._isUTC ? i : Gt(this);\n }, ln.utc = function (e) {\n return this.utcOffset(0, e);\n }, ln.local = function (e) {\n return this._isUTC && (this.utcOffset(0, e), this._isUTC = !1, e && this.subtract(Gt(this), \"m\")), this;\n }, ln.parseZone = function () {\n if (null != this._tzm) this.utcOffset(this._tzm, !1, !0);else if (\"string\" == typeof this._i) {\n var e = Ut(ie, this._i);\n null != e ? this.utcOffset(e) : this.utcOffset(0, !0);\n }\n return this;\n }, ln.hasAlignedHourOffset = function (e) {\n return !!this.isValid() && (e = e ? Tt(e).utcOffset() : 0, (this.utcOffset() - e) % 60 == 0);\n }, ln.isDST = function () {\n return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();\n }, ln.isLocal = function () {\n return !!this.isValid() && !this._isUTC;\n }, ln.isUtcOffset = function () {\n return !!this.isValid() && this._isUTC;\n }, ln.isUtc = Vt, ln.isUTC = Vt, ln.zoneAbbr = function () {\n return this._isUTC ? \"UTC\" : \"\";\n }, ln.zoneName = function () {\n return this._isUTC ? \"Coordinated Universal Time\" : \"\";\n }, ln.dates = n(\"dates accessor is deprecated. Use date instead.\", nn), ln.months = n(\"months accessor is deprecated. Use month instead\", Fe), ln.years = n(\"years accessor is deprecated. Use year instead\", Oe), ln.zone = n(\"moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/\", function (e, t) {\n return null != e ? (\"string\" != typeof e && (e = -e), this.utcOffset(e, t), this) : -this.utcOffset();\n }), ln.isDSTShifted = n(\"isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information\", function () {\n if (!l(this._isDSTShifted)) return this._isDSTShifted;\n var e = {};\n\n if (w(e, this), (e = Yt(e))._a) {\n var t = e._isUTC ? y(e._a) : Tt(e._a);\n this._isDSTShifted = this.isValid() && 0 < a(e._a, t.toArray());\n } else this._isDSTShifted = !1;\n\n return this._isDSTShifted;\n });\n var hn = P.prototype;\n\n function cn(e, t, n, s) {\n var i = lt(),\n r = y().set(s, t);\n return i[n](r, e);\n }\n\n function fn(e, t, n) {\n if (d(e) && (t = e, e = void 0), e = e || \"\", null != t) return cn(e, t, n, \"month\");\n var s,\n i = [];\n\n for (s = 0; s < 12; s++) {\n i[s] = cn(e, s, n, \"month\");\n }\n\n return i;\n }\n\n function mn(e, t, n, s) {\n \"boolean\" == typeof e ? d(t) && (n = t, t = void 0) : (t = e, e = !1, d(n = t) && (n = t, t = void 0)), t = t || \"\";\n var i,\n r = lt(),\n a = e ? r._week.dow : 0;\n if (null != n) return cn(t, (n + a) % 7, s, \"day\");\n var o = [];\n\n for (i = 0; i < 7; i++) {\n o[i] = cn(t, (i + a) % 7, s, \"day\");\n }\n\n return o;\n }\n\n hn.calendar = function (e, t, n) {\n var s = this._calendar[e] || this._calendar.sameElse;\n return x(s) ? s.call(t, n) : s;\n }, hn.longDateFormat = function (e) {\n var t = this._longDateFormat[e],\n n = this._longDateFormat[e.toUpperCase()];\n\n return t || !n ? t : (this._longDateFormat[e] = n.replace(/MMMM|MM|DD|dddd/g, function (e) {\n return e.slice(1);\n }), this._longDateFormat[e]);\n }, hn.invalidDate = function () {\n return this._invalidDate;\n }, hn.ordinal = function (e) {\n return this._ordinal.replace(\"%d\", e);\n }, hn.preparse = dn, hn.postformat = dn, hn.relativeTime = function (e, t, n, s) {\n var i = this._relativeTime[n];\n return x(i) ? i(e, t, n, s) : i.replace(/%d/i, e);\n }, hn.pastFuture = function (e, t) {\n var n = this._relativeTime[0 < e ? \"future\" : \"past\"];\n return x(n) ? n(t) : n.replace(/%s/i, t);\n }, hn.set = function (e) {\n var t, n;\n\n for (n in e) {\n x(t = e[n]) ? this[n] = t : this[\"_\" + n] = t;\n }\n\n this._config = e, this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + \"|\" + /\\d{1,2}/.source);\n }, hn.months = function (e, t) {\n return e ? o(this._months) ? this._months[e.month()] : this._months[(this._months.isFormat || We).test(t) ? \"format\" : \"standalone\"][e.month()] : o(this._months) ? this._months : this._months.standalone;\n }, hn.monthsShort = function (e, t) {\n return e ? o(this._monthsShort) ? this._monthsShort[e.month()] : this._monthsShort[We.test(t) ? \"format\" : \"standalone\"][e.month()] : o(this._monthsShort) ? this._monthsShort : this._monthsShort.standalone;\n }, hn.monthsParse = function (e, t, n) {\n var s, i, r;\n if (this._monthsParseExact) return function (e, t, n) {\n var s,\n i,\n r,\n a = e.toLocaleLowerCase();\n if (!this._monthsParse) for (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = [], s = 0; s < 12; ++s) {\n r = y([2e3, s]), this._shortMonthsParse[s] = this.monthsShort(r, \"\").toLocaleLowerCase(), this._longMonthsParse[s] = this.months(r, \"\").toLocaleLowerCase();\n }\n return n ? \"MMM\" === t ? -1 !== (i = Ye.call(this._shortMonthsParse, a)) ? i : null : -1 !== (i = Ye.call(this._longMonthsParse, a)) ? i : null : \"MMM\" === t ? -1 !== (i = Ye.call(this._shortMonthsParse, a)) ? i : -1 !== (i = Ye.call(this._longMonthsParse, a)) ? i : null : -1 !== (i = Ye.call(this._longMonthsParse, a)) ? i : -1 !== (i = Ye.call(this._shortMonthsParse, a)) ? i : null;\n }.call(this, e, t, n);\n\n for (this._monthsParse || (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = []), s = 0; s < 12; s++) {\n if (i = y([2e3, s]), n && !this._longMonthsParse[s] && (this._longMonthsParse[s] = new RegExp(\"^\" + this.months(i, \"\").replace(\".\", \"\") + \"$\", \"i\"), this._shortMonthsParse[s] = new RegExp(\"^\" + this.monthsShort(i, \"\").replace(\".\", \"\") + \"$\", \"i\")), n || this._monthsParse[s] || (r = \"^\" + this.months(i, \"\") + \"|^\" + this.monthsShort(i, \"\"), this._monthsParse[s] = new RegExp(r.replace(\".\", \"\"), \"i\")), n && \"MMMM\" === t && this._longMonthsParse[s].test(e)) return s;\n if (n && \"MMM\" === t && this._shortMonthsParse[s].test(e)) return s;\n if (!n && this._monthsParse[s].test(e)) return s;\n }\n }, hn.monthsRegex = function (e) {\n return this._monthsParseExact ? (m(this, \"_monthsRegex\") || Ne.call(this), e ? this._monthsStrictRegex : this._monthsRegex) : (m(this, \"_monthsRegex\") || (this._monthsRegex = Ue), this._monthsStrictRegex && e ? this._monthsStrictRegex : this._monthsRegex);\n }, hn.monthsShortRegex = function (e) {\n return this._monthsParseExact ? (m(this, \"_monthsRegex\") || Ne.call(this), e ? this._monthsShortStrictRegex : this._monthsShortRegex) : (m(this, \"_monthsShortRegex\") || (this._monthsShortRegex = Le), this._monthsShortStrictRegex && e ? this._monthsShortStrictRegex : this._monthsShortRegex);\n }, hn.week = function (e) {\n return Ie(e, this._week.dow, this._week.doy).week;\n }, hn.firstDayOfYear = function () {\n return this._week.doy;\n }, hn.firstDayOfWeek = function () {\n return this._week.dow;\n }, hn.weekdays = function (e, t) {\n return e ? o(this._weekdays) ? this._weekdays[e.day()] : this._weekdays[this._weekdays.isFormat.test(t) ? \"format\" : \"standalone\"][e.day()] : o(this._weekdays) ? this._weekdays : this._weekdays.standalone;\n }, hn.weekdaysMin = function (e) {\n return e ? this._weekdaysMin[e.day()] : this._weekdaysMin;\n }, hn.weekdaysShort = function (e) {\n return e ? this._weekdaysShort[e.day()] : this._weekdaysShort;\n }, hn.weekdaysParse = function (e, t, n) {\n var s, i, r;\n if (this._weekdaysParseExact) return function (e, t, n) {\n var s,\n i,\n r,\n a = e.toLocaleLowerCase();\n if (!this._weekdaysParse) for (this._weekdaysParse = [], this._shortWeekdaysParse = [], this._minWeekdaysParse = [], s = 0; s < 7; ++s) {\n r = y([2e3, 1]).day(s), this._minWeekdaysParse[s] = this.weekdaysMin(r, \"\").toLocaleLowerCase(), this._shortWeekdaysParse[s] = this.weekdaysShort(r, \"\").toLocaleLowerCase(), this._weekdaysParse[s] = this.weekdays(r, \"\").toLocaleLowerCase();\n }\n return n ? \"dddd\" === t ? -1 !== (i = Ye.call(this._weekdaysParse, a)) ? i : null : \"ddd\" === t ? -1 !== (i = Ye.call(this._shortWeekdaysParse, a)) ? i : null : -1 !== (i = Ye.call(this._minWeekdaysParse, a)) ? i : null : \"dddd\" === t ? -1 !== (i = Ye.call(this._weekdaysParse, a)) ? i : -1 !== (i = Ye.call(this._shortWeekdaysParse, a)) ? i : -1 !== (i = Ye.call(this._minWeekdaysParse, a)) ? i : null : \"ddd\" === t ? -1 !== (i = Ye.call(this._shortWeekdaysParse, a)) ? i : -1 !== (i = Ye.call(this._weekdaysParse, a)) ? i : -1 !== (i = Ye.call(this._minWeekdaysParse, a)) ? i : null : -1 !== (i = Ye.call(this._minWeekdaysParse, a)) ? i : -1 !== (i = Ye.call(this._weekdaysParse, a)) ? i : -1 !== (i = Ye.call(this._shortWeekdaysParse, a)) ? i : null;\n }.call(this, e, t, n);\n\n for (this._weekdaysParse || (this._weekdaysParse = [], this._minWeekdaysParse = [], this._shortWeekdaysParse = [], this._fullWeekdaysParse = []), s = 0; s < 7; s++) {\n if (i = y([2e3, 1]).day(s), n && !this._fullWeekdaysParse[s] && (this._fullWeekdaysParse[s] = new RegExp(\"^\" + this.weekdays(i, \"\").replace(\".\", \".?\") + \"$\", \"i\"), this._shortWeekdaysParse[s] = new RegExp(\"^\" + this.weekdaysShort(i, \"\").replace(\".\", \".?\") + \"$\", \"i\"), this._minWeekdaysParse[s] = new RegExp(\"^\" + this.weekdaysMin(i, \"\").replace(\".\", \".?\") + \"$\", \"i\")), this._weekdaysParse[s] || (r = \"^\" + this.weekdays(i, \"\") + \"|^\" + this.weekdaysShort(i, \"\") + \"|^\" + this.weekdaysMin(i, \"\"), this._weekdaysParse[s] = new RegExp(r.replace(\".\", \"\"), \"i\")), n && \"dddd\" === t && this._fullWeekdaysParse[s].test(e)) return s;\n if (n && \"ddd\" === t && this._shortWeekdaysParse[s].test(e)) return s;\n if (n && \"dd\" === t && this._minWeekdaysParse[s].test(e)) return s;\n if (!n && this._weekdaysParse[s].test(e)) return s;\n }\n }, hn.weekdaysRegex = function (e) {\n return this._weekdaysParseExact ? (m(this, \"_weekdaysRegex\") || Be.call(this), e ? this._weekdaysStrictRegex : this._weekdaysRegex) : (m(this, \"_weekdaysRegex\") || (this._weekdaysRegex = $e), this._weekdaysStrictRegex && e ? this._weekdaysStrictRegex : this._weekdaysRegex);\n }, hn.weekdaysShortRegex = function (e) {\n return this._weekdaysParseExact ? (m(this, \"_weekdaysRegex\") || Be.call(this), e ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex) : (m(this, \"_weekdaysShortRegex\") || (this._weekdaysShortRegex = qe), this._weekdaysShortStrictRegex && e ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex);\n }, hn.weekdaysMinRegex = function (e) {\n return this._weekdaysParseExact ? (m(this, \"_weekdaysRegex\") || Be.call(this), e ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex) : (m(this, \"_weekdaysMinRegex\") || (this._weekdaysMinRegex = Je), this._weekdaysMinStrictRegex && e ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex);\n }, hn.isPM = function (e) {\n return \"p\" === (e + \"\").toLowerCase().charAt(0);\n }, hn.meridiem = function (e, t, n) {\n return 11 < e ? n ? \"pm\" : \"PM\" : n ? \"am\" : \"AM\";\n }, ot(\"en\", {\n dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal: function ordinal(e) {\n var t = e % 10;\n return e + (1 === k(e % 100 / 10) ? \"th\" : 1 === t ? \"st\" : 2 === t ? \"nd\" : 3 === t ? \"rd\" : \"th\");\n }\n }), c.lang = n(\"moment.lang is deprecated. Use moment.locale instead.\", ot), c.langData = n(\"moment.langData is deprecated. Use moment.localeData instead.\", lt);\n var _n = Math.abs;\n\n function yn(e, t, n, s) {\n var i = At(t, n);\n return e._milliseconds += s * i._milliseconds, e._days += s * i._days, e._months += s * i._months, e._bubble();\n }\n\n function gn(e) {\n return e < 0 ? Math.floor(e) : Math.ceil(e);\n }\n\n function pn(e) {\n return 4800 * e / 146097;\n }\n\n function vn(e) {\n return 146097 * e / 4800;\n }\n\n function wn(e) {\n return function () {\n return this.as(e);\n };\n }\n\n var Mn = wn(\"ms\"),\n Sn = wn(\"s\"),\n Dn = wn(\"m\"),\n kn = wn(\"h\"),\n Yn = wn(\"d\"),\n On = wn(\"w\"),\n Tn = wn(\"M\"),\n xn = wn(\"y\");\n\n function bn(e) {\n return function () {\n return this.isValid() ? this._data[e] : NaN;\n };\n }\n\n var Pn = bn(\"milliseconds\"),\n Wn = bn(\"seconds\"),\n Hn = bn(\"minutes\"),\n Rn = bn(\"hours\"),\n Cn = bn(\"days\"),\n Fn = bn(\"months\"),\n Ln = bn(\"years\");\n var Un = Math.round,\n Nn = {\n ss: 44,\n s: 45,\n m: 45,\n h: 22,\n d: 26,\n M: 11\n };\n var Gn = Math.abs;\n\n function Vn(e) {\n return (0 < e) - (e < 0) || +e;\n }\n\n function En() {\n if (!this.isValid()) return this.localeData().invalidDate();\n var e,\n t,\n n = Gn(this._milliseconds) / 1e3,\n s = Gn(this._days),\n i = Gn(this._months);\n t = D((e = D(n / 60)) / 60), n %= 60, e %= 60;\n var r = D(i / 12),\n a = i %= 12,\n o = s,\n u = t,\n l = e,\n d = n ? n.toFixed(3).replace(/\\.?0+$/, \"\") : \"\",\n h = this.asSeconds();\n if (!h) return \"P0D\";\n\n var c = h < 0 ? \"-\" : \"\",\n f = Vn(this._months) !== Vn(h) ? \"-\" : \"\",\n m = Vn(this._days) !== Vn(h) ? \"-\" : \"\",\n _ = Vn(this._milliseconds) !== Vn(h) ? \"-\" : \"\";\n\n return c + \"P\" + (r ? f + r + \"Y\" : \"\") + (a ? f + a + \"M\" : \"\") + (o ? m + o + \"D\" : \"\") + (u || l || d ? \"T\" : \"\") + (u ? _ + u + \"H\" : \"\") + (l ? _ + l + \"M\" : \"\") + (d ? _ + d + \"S\" : \"\");\n }\n\n var In = Ht.prototype;\n return In.isValid = function () {\n return this._isValid;\n }, In.abs = function () {\n var e = this._data;\n return this._milliseconds = _n(this._milliseconds), this._days = _n(this._days), this._months = _n(this._months), e.milliseconds = _n(e.milliseconds), e.seconds = _n(e.seconds), e.minutes = _n(e.minutes), e.hours = _n(e.hours), e.months = _n(e.months), e.years = _n(e.years), this;\n }, In.add = function (e, t) {\n return yn(this, e, t, 1);\n }, In.subtract = function (e, t) {\n return yn(this, e, t, -1);\n }, In.as = function (e) {\n if (!this.isValid()) return NaN;\n var t,\n n,\n s = this._milliseconds;\n if (\"month\" === (e = R(e)) || \"year\" === e) return t = this._days + s / 864e5, n = this._months + pn(t), \"month\" === e ? n : n / 12;\n\n switch (t = this._days + Math.round(vn(this._months)), e) {\n case \"week\":\n return t / 7 + s / 6048e5;\n\n case \"day\":\n return t + s / 864e5;\n\n case \"hour\":\n return 24 * t + s / 36e5;\n\n case \"minute\":\n return 1440 * t + s / 6e4;\n\n case \"second\":\n return 86400 * t + s / 1e3;\n\n case \"millisecond\":\n return Math.floor(864e5 * t) + s;\n\n default:\n throw new Error(\"Unknown unit \" + e);\n }\n }, In.asMilliseconds = Mn, In.asSeconds = Sn, In.asMinutes = Dn, In.asHours = kn, In.asDays = Yn, In.asWeeks = On, In.asMonths = Tn, In.asYears = xn, In.valueOf = function () {\n return this.isValid() ? this._milliseconds + 864e5 * this._days + this._months % 12 * 2592e6 + 31536e6 * k(this._months / 12) : NaN;\n }, In._bubble = function () {\n var e,\n t,\n n,\n s,\n i,\n r = this._milliseconds,\n a = this._days,\n o = this._months,\n u = this._data;\n return 0 <= r && 0 <= a && 0 <= o || r <= 0 && a <= 0 && o <= 0 || (r += 864e5 * gn(vn(o) + a), o = a = 0), u.milliseconds = r % 1e3, e = D(r / 1e3), u.seconds = e % 60, t = D(e / 60), u.minutes = t % 60, n = D(t / 60), u.hours = n % 24, o += i = D(pn(a += D(n / 24))), a -= gn(vn(i)), s = D(o / 12), o %= 12, u.days = a, u.months = o, u.years = s, this;\n }, In.clone = function () {\n return At(this);\n }, In.get = function (e) {\n return e = R(e), this.isValid() ? this[e + \"s\"]() : NaN;\n }, In.milliseconds = Pn, In.seconds = Wn, In.minutes = Hn, In.hours = Rn, In.days = Cn, In.weeks = function () {\n return D(this.days() / 7);\n }, In.months = Fn, In.years = Ln, In.humanize = function (e) {\n if (!this.isValid()) return this.localeData().invalidDate();\n var t,\n n,\n s,\n i,\n r,\n a,\n o,\n u,\n l,\n d,\n h,\n c = this.localeData(),\n f = (n = !e, s = c, i = At(t = this).abs(), r = Un(i.as(\"s\")), a = Un(i.as(\"m\")), o = Un(i.as(\"h\")), u = Un(i.as(\"d\")), l = Un(i.as(\"M\")), d = Un(i.as(\"y\")), (h = r <= Nn.ss && [\"s\", r] || r < Nn.s && [\"ss\", r] || a <= 1 && [\"m\"] || a < Nn.m && [\"mm\", a] || o <= 1 && [\"h\"] || o < Nn.h && [\"hh\", o] || u <= 1 && [\"d\"] || u < Nn.d && [\"dd\", u] || l <= 1 && [\"M\"] || l < Nn.M && [\"MM\", l] || d <= 1 && [\"y\"] || [\"yy\", d])[2] = n, h[3] = 0 < +t, h[4] = s, function (e, t, n, s, i) {\n return i.relativeTime(t || 1, !!n, e, s);\n }.apply(null, h));\n return e && (f = c.pastFuture(+this, f)), c.postformat(f);\n }, In.toISOString = En, In.toString = En, In.toJSON = En, In.locale = Qt, In.localeData = Kt, In.toIsoString = n(\"toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)\", En), In.lang = Xt, I(\"X\", 0, 0, \"unix\"), I(\"x\", 0, 0, \"valueOf\"), ue(\"x\", se), ue(\"X\", /[+-]?\\d+(\\.\\d{1,3})?/), ce(\"X\", function (e, t, n) {\n n._d = new Date(1e3 * parseFloat(e, 10));\n }), ce(\"x\", function (e, t, n) {\n n._d = new Date(k(e));\n }), c.version = \"2.22.1\", e = Tt, c.fn = ln, c.min = function () {\n return Pt(\"isBefore\", [].slice.call(arguments, 0));\n }, c.max = function () {\n return Pt(\"isAfter\", [].slice.call(arguments, 0));\n }, c.now = function () {\n return Date.now ? Date.now() : +new Date();\n }, c.utc = y, c.unix = function (e) {\n return Tt(1e3 * e);\n }, c.months = function (e, t) {\n return fn(e, t, \"months\");\n }, c.isDate = h, c.locale = ot, c.invalid = v, c.duration = At, c.isMoment = S, c.weekdays = function (e, t, n) {\n return mn(e, t, n, \"weekdays\");\n }, c.parseZone = function () {\n return Tt.apply(null, arguments).parseZone();\n }, c.localeData = lt, c.isDuration = Rt, c.monthsShort = function (e, t) {\n return fn(e, t, \"monthsShort\");\n }, c.weekdaysMin = function (e, t, n) {\n return mn(e, t, n, \"weekdaysMin\");\n }, c.defineLocale = ut, c.updateLocale = function (e, t) {\n if (null != t) {\n var n,\n s,\n i = nt;\n null != (s = at(e)) && (i = s._config), (n = new P(t = b(i, t))).parentLocale = st[e], st[e] = n, ot(e);\n } else null != st[e] && (null != st[e].parentLocale ? st[e] = st[e].parentLocale : null != st[e] && delete st[e]);\n\n return st[e];\n }, c.locales = function () {\n return s(st);\n }, c.weekdaysShort = function (e, t, n) {\n return mn(e, t, n, \"weekdaysShort\");\n }, c.normalizeUnits = R, c.relativeTimeRounding = function (e) {\n return void 0 === e ? Un : \"function\" == typeof e && (Un = e, !0);\n }, c.relativeTimeThreshold = function (e, t) {\n return void 0 !== Nn[e] && (void 0 === t ? Nn[e] : (Nn[e] = t, \"s\" === e && (Nn.ss = t - 1), !0));\n }, c.calendarFormat = function (e, t) {\n var n = e.diff(t, \"days\", !0);\n return n < -6 ? \"sameElse\" : n < -1 ? \"lastWeek\" : n < 0 ? \"lastDay\" : n < 1 ? \"sameDay\" : n < 2 ? \"nextDay\" : n < 7 ? \"nextWeek\" : \"sameElse\";\n }, c.prototype = ln, c.HTML5_FMT = {\n DATETIME_LOCAL: \"YYYY-MM-DDTHH:mm\",\n DATETIME_LOCAL_SECONDS: \"YYYY-MM-DDTHH:mm:ss\",\n DATETIME_LOCAL_MS: \"YYYY-MM-DDTHH:mm:ss.SSS\",\n DATE: \"YYYY-MM-DD\",\n TIME: \"HH:mm\",\n TIME_SECONDS: \"HH:mm:ss\",\n TIME_MS: \"HH:mm:ss.SSS\",\n WEEK: \"YYYY-[W]WW\",\n MONTH: \"YYYY-MM\"\n }, c;\n});","var map = {\n\t\"./locale\": 517,\n\t\"./locale.js\": 517\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 1192;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/*\n * __ ___\n * _____/ /___ __/ (_)____\n * / ___/ __/ / / / / / ___/\n * (__ ) /_/ /_/ / / (__ )\n * /____/\\__/\\__, /_/_/____/\n * /____/\n *\n * light - weight css preprocessor @licence MIT\n */\n(function (factory) {\n /* eslint-disable */\n (typeof exports === \"undefined\" ? \"undefined\" : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module['exports'] = factory(null) : typeof define === 'function' && define['amd'] ? define(factory(null)) : window['stylis'] = factory(null);\n})(\n/** @param {*=} options */\nfunction factory(options) {\n /* eslint-disable */\n 'use strict';\n /**\n * Notes\n *\n * The [''] pattern is used to support closure compiler\n * the jsdoc signatures are also used to the same effect\n *\n * ----\n *\n * int + int + int === n4 [faster]\n *\n * vs\n *\n * int === n1 && int === n2 && int === n3\n *\n * ----\n *\n * switch (int) { case ints...} [faster]\n *\n * vs\n *\n * if (int == 1 && int === 2 ...)\n *\n * ----\n *\n * The (first*n1 + second*n2 + third*n3) format used in the property parser\n * is a simple way to hash the sequence of characters\n * taking into account the index they occur in\n * since any number of 3 character sequences could produce duplicates.\n *\n * On the other hand sequences that are directly tied to the index of the character\n * resolve a far more accurate measure, it's also faster\n * to evaluate one condition in a switch statement\n * than three in an if statement regardless of the added math.\n *\n * This allows the vendor prefixer to be both small and fast.\n */\n\n var nullptn = /^\\0+/g;\n /* matches leading null characters */\n\n var formatptn = /[\\0\\r\\f]/g;\n /* matches new line, null and formfeed characters */\n\n var colonptn = /: */g;\n /* splits animation rules */\n\n var cursorptn = /zoo|gra/;\n /* assert cursor varient */\n\n var transformptn = /([,: ])(transform)/g;\n /* vendor prefix transform, older webkit */\n\n var animationptn = /,+\\s*(?![^(]*[)])/g;\n /* splits multiple shorthand notation animations */\n\n var propertiesptn = / +\\s*(?![^(]*[)])/g;\n /* animation properties */\n\n var elementptn = / *[\\0] */g;\n /* selector elements */\n\n var selectorptn = /,\\r+?/g;\n /* splits selectors */\n\n var andptn = /([\\t\\r\\n ])*\\f?&/g;\n /* match & */\n\n var escapeptn = /:global\\(((?:[^\\(\\)\\[\\]]*|\\[.*\\]|\\([^\\(\\)]*\\))*)\\)/g;\n /* matches :global(.*) */\n\n var invalidptn = /\\W+/g;\n /* removes invalid characters from keyframes */\n\n var keyframeptn = /@(k\\w+)\\s*(\\S*)\\s*/;\n /* matches @keyframes $1 */\n\n var plcholdrptn = /::(place)/g;\n /* match ::placeholder varient */\n\n var readonlyptn = /:(read-only)/g;\n /* match :read-only varient */\n\n var beforeptn = /\\s+(?=[{\\];=:>])/g;\n /* matches \\s before ] ; = : */\n\n var afterptn = /([[}=:>])\\s+/g;\n /* matches \\s after characters [ } = : */\n\n var tailptn = /(\\{[^{]+?);(?=\\})/g;\n /* matches tail semi-colons ;} */\n\n var whiteptn = /\\s{2,}/g;\n /* matches repeating whitespace */\n\n var pseudoptn = /([^\\(])(:+) */g;\n /* pseudo element */\n\n var writingptn = /[svh]\\w+-[tblr]{2}/;\n /* match writing mode property values */\n\n var gradientptn = /([\\w-]+t\\()/g;\n /* match *gradient property */\n\n var supportsptn = /\\(\\s*(.*)\\s*\\)/g;\n /* match supports (groups) */\n\n var propertyptn = /([\\s\\S]*?);/g;\n /* match properties leading semicolon */\n\n var selfptn = /-self|flex-/g;\n /* match flex- and -self in align-self: flex-*; */\n\n var pseudofmt = /[^]*?(:[rp][el]a[\\w-]+)[^]*/;\n /* extrats :readonly or :placholder from selector */\n\n var trimptn = /[ \\t]+$/;\n /* match tail whitspace */\n\n var dimensionptn = /stretch|:\\s*\\w+\\-(?:conte|avail)/;\n /* match max/min/fit-content, fill-available */\n\n var imgsrcptn = /([^-])(image-set\\()/;\n /* vendors */\n\n var webkit = '-webkit-';\n var moz = '-moz-';\n var ms = '-ms-';\n /* character codes */\n\n var SEMICOLON = 59;\n /* ; */\n\n var CLOSEBRACES = 125;\n /* } */\n\n var OPENBRACES = 123;\n /* { */\n\n var OPENPARENTHESES = 40;\n /* ( */\n\n var CLOSEPARENTHESES = 41;\n /* ) */\n\n var OPENBRACKET = 91;\n /* [ */\n\n var CLOSEBRACKET = 93;\n /* ] */\n\n var NEWLINE = 10;\n /* \\n */\n\n var CARRIAGE = 13;\n /* \\r */\n\n var TAB = 9;\n /* \\t */\n\n var AT = 64;\n /* @ */\n\n var SPACE = 32;\n /* */\n\n var AND = 38;\n /* & */\n\n var DASH = 45;\n /* - */\n\n var UNDERSCORE = 95;\n /* _ */\n\n var STAR = 42;\n /* * */\n\n var COMMA = 44;\n /* , */\n\n var COLON = 58;\n /* : */\n\n var SINGLEQUOTE = 39;\n /* ' */\n\n var DOUBLEQUOTE = 34;\n /* \" */\n\n var FOWARDSLASH = 47;\n /* / */\n\n var GREATERTHAN = 62;\n /* > */\n\n var PLUS = 43;\n /* + */\n\n var TILDE = 126;\n /* ~ */\n\n var NULL = 0;\n /* \\0 */\n\n var FORMFEED = 12;\n /* \\f */\n\n var VERTICALTAB = 11;\n /* \\v */\n\n /* special identifiers */\n\n var KEYFRAME = 107;\n /* k */\n\n var MEDIA = 109;\n /* m */\n\n var SUPPORTS = 115;\n /* s */\n\n var PLACEHOLDER = 112;\n /* p */\n\n var READONLY = 111;\n /* o */\n\n var IMPORT = 105;\n /* i */\n\n var CHARSET = 99;\n /* c */\n\n var DOCUMENT = 100;\n /* d */\n\n var PAGE = 112;\n /* p */\n\n var column = 1;\n /* current column */\n\n var line = 1;\n /* current line numebr */\n\n var pattern = 0;\n /* :pattern */\n\n var cascade = 1;\n /* #id h1 h2 vs h1#id h2#id */\n\n var prefix = 1;\n /* vendor prefix */\n\n var escape = 1;\n /* escape :global() pattern */\n\n var compress = 0;\n /* compress output */\n\n var semicolon = 0;\n /* no/semicolon option */\n\n var preserve = 0;\n /* preserve empty selectors */\n\n /* empty reference */\n\n var array = [];\n /* plugins */\n\n var plugins = [];\n var plugged = 0;\n var should = null;\n /* plugin context */\n\n var POSTS = -2;\n var PREPS = -1;\n var UNKWN = 0;\n var PROPS = 1;\n var BLCKS = 2;\n var ATRUL = 3;\n /* plugin newline context */\n\n var unkwn = 0;\n /* keyframe animation */\n\n var keyed = 1;\n var key = '';\n /* selector namespace */\n\n var nscopealt = '';\n var nscope = '';\n /**\n * Compile\n *\n * @param {Array} parent\n * @param {Array} current\n * @param {string} body\n * @param {number} id\n * @param {number} depth\n * @return {string}\n */\n\n function compile(parent, current, body, id, depth) {\n var bracket = 0;\n /* brackets [] */\n\n var comment = 0;\n /* comments /* // or /* */\n\n var parentheses = 0;\n /* functions () */\n\n var quote = 0;\n /* quotes '', \"\" */\n\n var first = 0;\n /* first character code */\n\n var second = 0;\n /* second character code */\n\n var code = 0;\n /* current character code */\n\n var tail = 0;\n /* previous character code */\n\n var trail = 0;\n /* character before previous code */\n\n var peak = 0;\n /* previous non-whitespace code */\n\n var counter = 0;\n /* count sequence termination */\n\n var context = 0;\n /* track current context */\n\n var atrule = 0;\n /* track @at-rule context */\n\n var pseudo = 0;\n /* track pseudo token index */\n\n var caret = 0;\n /* current character index */\n\n var format = 0;\n /* control character formating context */\n\n var insert = 0;\n /* auto semicolon insertion */\n\n var invert = 0;\n /* inverted selector pattern */\n\n var length = 0;\n /* generic length address */\n\n var eof = body.length;\n /* end of file(length) */\n\n var eol = eof - 1;\n /* end of file(characters) */\n\n var char = '';\n /* current character */\n\n var chars = '';\n /* current buffer of characters */\n\n var child = '';\n /* next buffer of characters */\n\n var out = '';\n /* compiled body */\n\n var children = '';\n /* compiled children */\n\n var flat = '';\n /* compiled leafs */\n\n var selector;\n /* generic selector address */\n\n var result;\n /* generic address */\n // ...build body\n\n while (caret < eof) {\n code = body.charCodeAt(caret); // eof varient\n\n if (caret === eol) {\n // last character + noop context, add synthetic padding for noop context to terminate\n if (comment + quote + parentheses + bracket !== 0) {\n if (comment !== 0) {\n code = comment === FOWARDSLASH ? NEWLINE : FOWARDSLASH;\n }\n\n quote = parentheses = bracket = 0;\n eof++;\n eol++;\n }\n }\n\n if (comment + quote + parentheses + bracket === 0) {\n // eof varient\n if (caret === eol) {\n if (format > 0) {\n chars = chars.replace(formatptn, '');\n }\n\n if (chars.trim().length > 0) {\n switch (code) {\n case SPACE:\n case TAB:\n case SEMICOLON:\n case CARRIAGE:\n case NEWLINE:\n {\n break;\n }\n\n default:\n {\n chars += body.charAt(caret);\n }\n }\n\n code = SEMICOLON;\n }\n } // auto semicolon insertion\n\n\n if (insert === 1) {\n switch (code) {\n // false flags\n case OPENBRACES:\n case CLOSEBRACES:\n case SEMICOLON:\n case DOUBLEQUOTE:\n case SINGLEQUOTE:\n case OPENPARENTHESES:\n case CLOSEPARENTHESES:\n case COMMA:\n {\n insert = 0;\n }\n // ignore\n\n case TAB:\n case CARRIAGE:\n case NEWLINE:\n case SPACE:\n {\n break;\n }\n // valid\n\n default:\n {\n insert = 0;\n length = caret;\n first = code;\n caret--;\n code = SEMICOLON;\n\n while (length < eof) {\n switch (body.charCodeAt(length++)) {\n case NEWLINE:\n case CARRIAGE:\n case SEMICOLON:\n {\n ++caret;\n code = first;\n length = eof;\n break;\n }\n\n case COLON:\n {\n if (format > 0) {\n ++caret;\n code = first;\n }\n }\n\n case OPENBRACES:\n {\n length = eof;\n }\n }\n }\n }\n }\n } // token varient\n\n\n switch (code) {\n case OPENBRACES:\n {\n chars = chars.trim();\n first = chars.charCodeAt(0);\n counter = 1;\n length = ++caret;\n\n while (caret < eof) {\n switch (code = body.charCodeAt(caret)) {\n case OPENBRACES:\n {\n counter++;\n break;\n }\n\n case CLOSEBRACES:\n {\n counter--;\n break;\n }\n\n case FOWARDSLASH:\n {\n switch (second = body.charCodeAt(caret + 1)) {\n // /*, //\n case STAR:\n case FOWARDSLASH:\n {\n caret = delimited(second, caret, eol, body);\n }\n }\n\n break;\n }\n // given \"[\" === 91 & \"]\" === 93 hence forth 91 + 1 + 1 === 93\n\n case OPENBRACKET:\n {\n code++;\n }\n // given \"(\" === 40 & \")\" === 41 hence forth 40 + 1 === 41\n\n case OPENPARENTHESES:\n {\n code++;\n }\n // quote tail delimiter is identical to the head delimiter hence noop,\n // fallthrough clauses have been shifted to the correct tail delimiter\n\n case DOUBLEQUOTE:\n case SINGLEQUOTE:\n {\n while (caret++ < eol) {\n if (body.charCodeAt(caret) === code) {\n break;\n }\n }\n }\n }\n\n if (counter === 0) {\n break;\n }\n\n caret++;\n }\n\n child = body.substring(length, caret);\n\n if (first === NULL) {\n first = (chars = chars.replace(nullptn, '').trim()).charCodeAt(0);\n }\n\n switch (first) {\n // @at-rule\n case AT:\n {\n if (format > 0) {\n chars = chars.replace(formatptn, '');\n }\n\n second = chars.charCodeAt(1);\n\n switch (second) {\n case DOCUMENT:\n case MEDIA:\n case SUPPORTS:\n case DASH:\n {\n selector = current;\n break;\n }\n\n default:\n {\n selector = array;\n }\n }\n\n child = compile(current, selector, child, second, depth + 1);\n length = child.length; // preserve empty @at-rule\n\n if (preserve > 0 && length === 0) {\n length = chars.length;\n } // execute plugins, @at-rule context\n\n\n if (plugged > 0) {\n selector = select(array, chars, invert);\n result = proxy(ATRUL, child, selector, current, line, column, length, second, depth, id);\n chars = selector.join('');\n\n if (result !== void 0) {\n if ((length = (child = result.trim()).length) === 0) {\n second = 0;\n child = '';\n }\n }\n }\n\n if (length > 0) {\n switch (second) {\n case SUPPORTS:\n {\n chars = chars.replace(supportsptn, supports);\n }\n\n case DOCUMENT:\n case MEDIA:\n case DASH:\n {\n child = chars + '{' + child + '}';\n break;\n }\n\n case KEYFRAME:\n {\n chars = chars.replace(keyframeptn, '$1 $2' + (keyed > 0 ? key : ''));\n child = chars + '{' + child + '}';\n\n if (prefix === 1 || prefix === 2 && vendor('@' + child, 3)) {\n child = '@' + webkit + child + '@' + child;\n } else {\n child = '@' + child;\n }\n\n break;\n }\n\n default:\n {\n child = chars + child;\n\n if (id === PAGE) {\n child = (out += child, '');\n }\n }\n }\n } else {\n child = '';\n }\n\n break;\n }\n // selector\n\n default:\n {\n child = compile(current, select(current, chars, invert), child, id, depth + 1);\n }\n }\n\n children += child; // reset\n\n context = 0;\n insert = 0;\n pseudo = 0;\n format = 0;\n invert = 0;\n atrule = 0;\n chars = '';\n child = '';\n code = body.charCodeAt(++caret);\n break;\n }\n\n case CLOSEBRACES:\n case SEMICOLON:\n {\n chars = (format > 0 ? chars.replace(formatptn, '') : chars).trim();\n\n if ((length = chars.length) > 1) {\n // monkey-patch missing colon\n if (pseudo === 0) {\n first = chars.charCodeAt(0); // first character is a letter or dash, buffer has a space character\n\n if (first === DASH || first > 96 && first < 123) {\n length = (chars = chars.replace(' ', ':')).length;\n }\n } // execute plugins, property context\n\n\n if (plugged > 0) {\n if ((result = proxy(PROPS, chars, current, parent, line, column, out.length, id, depth, id)) !== void 0) {\n if ((length = (chars = result.trim()).length) === 0) {\n chars = '\\0\\0';\n }\n }\n }\n\n first = chars.charCodeAt(0);\n second = chars.charCodeAt(1);\n\n switch (first) {\n case NULL:\n {\n break;\n }\n\n case AT:\n {\n if (second === IMPORT || second === CHARSET) {\n flat += chars + body.charAt(caret);\n break;\n }\n }\n\n default:\n {\n if (chars.charCodeAt(length - 1) === COLON) {\n break;\n }\n\n out += property(chars, first, second, chars.charCodeAt(2));\n }\n }\n } // reset\n\n\n context = 0;\n insert = 0;\n pseudo = 0;\n format = 0;\n invert = 0;\n chars = '';\n code = body.charCodeAt(++caret);\n break;\n }\n }\n } // parse characters\n\n\n switch (code) {\n case CARRIAGE:\n case NEWLINE:\n {\n // auto insert semicolon\n if (comment + quote + parentheses + bracket + semicolon === 0) {\n // valid non-whitespace characters that\n // may precede a newline\n switch (peak) {\n case CLOSEPARENTHESES:\n case SINGLEQUOTE:\n case DOUBLEQUOTE:\n case AT:\n case TILDE:\n case GREATERTHAN:\n case STAR:\n case PLUS:\n case FOWARDSLASH:\n case DASH:\n case COLON:\n case COMMA:\n case SEMICOLON:\n case OPENBRACES:\n case CLOSEBRACES:\n {\n break;\n }\n\n default:\n {\n // current buffer has a colon\n if (pseudo > 0) {\n insert = 1;\n }\n }\n }\n } // terminate line comment\n\n\n if (comment === FOWARDSLASH) {\n comment = 0;\n } else if (cascade + context === 0 && id !== KEYFRAME && chars.length > 0) {\n format = 1;\n chars += '\\0';\n } // execute plugins, newline context\n\n\n if (plugged * unkwn > 0) {\n proxy(UNKWN, chars, current, parent, line, column, out.length, id, depth, id);\n } // next line, reset column position\n\n\n column = 1;\n line++;\n break;\n }\n\n case SEMICOLON:\n case CLOSEBRACES:\n {\n if (comment + quote + parentheses + bracket === 0) {\n column++;\n break;\n }\n }\n\n default:\n {\n // increment column position\n column++; // current character\n\n char = body.charAt(caret); // remove comments, escape functions, strings, attributes and prepare selectors\n\n switch (code) {\n case TAB:\n case SPACE:\n {\n if (quote + bracket + comment === 0) {\n switch (tail) {\n case COMMA:\n case COLON:\n case TAB:\n case SPACE:\n {\n char = '';\n break;\n }\n\n default:\n {\n if (code !== SPACE) {\n char = ' ';\n }\n }\n }\n }\n\n break;\n }\n // escape breaking control characters\n\n case NULL:\n {\n char = '\\\\0';\n break;\n }\n\n case FORMFEED:\n {\n char = '\\\\f';\n break;\n }\n\n case VERTICALTAB:\n {\n char = '\\\\v';\n break;\n }\n // &\n\n case AND:\n {\n // inverted selector pattern i.e html &\n if (quote + comment + bracket === 0 && cascade > 0) {\n invert = 1;\n format = 1;\n char = '\\f' + char;\n }\n\n break;\n }\n // ::paceholder, l\n // :read-ony, l\n\n case 108:\n {\n if (quote + comment + bracket + pattern === 0 && pseudo > 0) {\n switch (caret - pseudo) {\n // ::placeholder\n case 2:\n {\n if (tail === PLACEHOLDER && body.charCodeAt(caret - 3) === COLON) {\n pattern = tail;\n }\n }\n // :read-only\n\n case 8:\n {\n if (trail === READONLY) {\n pattern = trail;\n }\n }\n }\n }\n\n break;\n }\n // :\n\n case COLON:\n {\n if (quote + comment + bracket === 0) {\n pseudo = caret;\n }\n\n break;\n }\n // selectors\n\n case COMMA:\n {\n if (comment + parentheses + quote + bracket === 0) {\n format = 1;\n char += '\\r';\n }\n\n break;\n }\n // quotes\n\n case DOUBLEQUOTE:\n case SINGLEQUOTE:\n {\n if (comment === 0) {\n quote = quote === code ? 0 : quote === 0 ? code : quote;\n }\n\n break;\n }\n // attributes\n\n case OPENBRACKET:\n {\n if (quote + comment + parentheses === 0) {\n bracket++;\n }\n\n break;\n }\n\n case CLOSEBRACKET:\n {\n if (quote + comment + parentheses === 0) {\n bracket--;\n }\n\n break;\n }\n // functions\n\n case CLOSEPARENTHESES:\n {\n if (quote + comment + bracket === 0) {\n parentheses--;\n }\n\n break;\n }\n\n case OPENPARENTHESES:\n {\n if (quote + comment + bracket === 0) {\n if (context === 0) {\n switch (tail * 2 + trail * 3) {\n // :matches\n case 533:\n {\n break;\n }\n // :global, :not, :nth-child etc...\n\n default:\n {\n counter = 0;\n context = 1;\n }\n }\n }\n\n parentheses++;\n }\n\n break;\n }\n\n case AT:\n {\n if (comment + parentheses + quote + bracket + pseudo + atrule === 0) {\n atrule = 1;\n }\n\n break;\n }\n // block/line comments\n\n case STAR:\n case FOWARDSLASH:\n {\n if (quote + bracket + parentheses > 0) {\n break;\n }\n\n switch (comment) {\n // initialize line/block comment context\n case 0:\n {\n switch (code * 2 + body.charCodeAt(caret + 1) * 3) {\n // //\n case 235:\n {\n comment = FOWARDSLASH;\n break;\n }\n // /*\n\n case 220:\n {\n length = caret;\n comment = STAR;\n break;\n }\n }\n\n break;\n }\n // end block comment context\n\n case STAR:\n {\n if (code === FOWARDSLASH && tail === STAR && length + 2 !== caret) {\n // /* ... */, !\n if (body.charCodeAt(length + 2) === 33) {\n out += body.substring(length, caret + 1);\n }\n\n char = '';\n comment = 0;\n }\n }\n }\n }\n } // ignore comment blocks\n\n\n if (comment === 0) {\n // aggressive isolation mode, divide each individual selector\n // including selectors in :not function but excluding selectors in :global function\n if (cascade + quote + bracket + atrule === 0 && id !== KEYFRAME && code !== SEMICOLON) {\n switch (code) {\n case COMMA:\n case TILDE:\n case GREATERTHAN:\n case PLUS:\n case CLOSEPARENTHESES:\n case OPENPARENTHESES:\n {\n if (context === 0) {\n // outside of an isolated context i.e nth-child(<...>)\n switch (tail) {\n case TAB:\n case SPACE:\n case NEWLINE:\n case CARRIAGE:\n {\n char = char + '\\0';\n break;\n }\n\n default:\n {\n char = '\\0' + char + (code === COMMA ? '' : '\\0');\n }\n }\n\n format = 1;\n } else {\n // within an isolated context, sleep untill it's terminated\n switch (code) {\n case OPENPARENTHESES:\n {\n // :globa(\n if (pseudo + 7 === caret && tail === 108) {\n pseudo = 0;\n }\n\n context = ++counter;\n break;\n }\n\n case CLOSEPARENTHESES:\n {\n if ((context = --counter) === 0) {\n format = 1;\n char += '\\0';\n }\n\n break;\n }\n }\n }\n\n break;\n }\n\n case TAB:\n case SPACE:\n {\n switch (tail) {\n case NULL:\n case OPENBRACES:\n case CLOSEBRACES:\n case SEMICOLON:\n case COMMA:\n case FORMFEED:\n case TAB:\n case SPACE:\n case NEWLINE:\n case CARRIAGE:\n {\n break;\n }\n\n default:\n {\n // ignore in isolated contexts\n if (context === 0) {\n format = 1;\n char += '\\0';\n }\n }\n }\n }\n }\n } // concat buffer of characters\n\n\n chars += char; // previous non-whitespace character code\n\n if (code !== SPACE && code !== TAB) {\n peak = code;\n }\n }\n }\n } // tail character codes\n\n\n trail = tail;\n tail = code; // visit every character\n\n caret++;\n }\n\n length = out.length; // preserve empty selector\n\n if (preserve > 0) {\n if (length === 0 && children.length === 0 && current[0].length === 0 === false) {\n if (id !== MEDIA || current.length === 1 && (cascade > 0 ? nscopealt : nscope) === current[0]) {\n length = current.join(',').length + 2;\n }\n }\n }\n\n if (length > 0) {\n // cascade isolation mode?\n selector = cascade === 0 && id !== KEYFRAME ? isolate(current) : current; // execute plugins, block context\n\n if (plugged > 0) {\n result = proxy(BLCKS, out, selector, parent, line, column, length, id, depth, id);\n\n if (result !== void 0 && (out = result).length === 0) {\n return flat + out + children;\n }\n }\n\n out = selector.join(',') + '{' + out + '}';\n\n if (prefix * pattern !== 0) {\n if (prefix === 2 && !vendor(out, 2)) pattern = 0;\n\n switch (pattern) {\n // ::read-only\n case READONLY:\n {\n out = out.replace(readonlyptn, ':' + moz + '$1') + out;\n break;\n }\n // ::placeholder\n\n case PLACEHOLDER:\n {\n out = out.replace(plcholdrptn, '::' + webkit + 'input-$1') + out.replace(plcholdrptn, '::' + moz + '$1') + out.replace(plcholdrptn, ':' + ms + 'input-$1') + out;\n break;\n }\n }\n\n pattern = 0;\n }\n }\n\n return flat + out + children;\n }\n /**\n * Select\n *\n * @param {Array} parent\n * @param {string} current\n * @param {number} invert\n * @return {Array}\n */\n\n\n function select(parent, current, invert) {\n var selectors = current.trim().split(selectorptn);\n var out = selectors;\n var length = selectors.length;\n var l = parent.length;\n\n switch (l) {\n // 0-1 parent selectors\n case 0:\n case 1:\n {\n for (var i = 0, selector = l === 0 ? '' : parent[0] + ' '; i < length; ++i) {\n out[i] = scope(selector, out[i], invert, l).trim();\n }\n\n break;\n }\n // >2 parent selectors, nested\n\n default:\n {\n for (var i = 0, j = 0, out = []; i < length; ++i) {\n for (var k = 0; k < l; ++k) {\n out[j++] = scope(parent[k] + ' ', selectors[i], invert, l).trim();\n }\n }\n }\n }\n\n return out;\n }\n /**\n * Scope\n *\n * @param {string} parent\n * @param {string} current\n * @param {number} invert\n * @param {number} level\n * @return {string}\n */\n\n\n function scope(parent, current, invert, level) {\n var selector = current;\n var code = selector.charCodeAt(0); // trim leading whitespace\n\n if (code < 33) {\n code = (selector = selector.trim()).charCodeAt(0);\n }\n\n switch (code) {\n // &\n case AND:\n {\n switch (cascade + level) {\n case 0:\n case 1:\n {\n if (parent.trim().length === 0) {\n break;\n }\n }\n\n default:\n {\n return selector.replace(andptn, '$1' + parent.trim());\n }\n }\n\n break;\n }\n // :\n\n case COLON:\n {\n switch (selector.charCodeAt(1)) {\n // g in :global\n case 103:\n {\n if (escape > 0 && cascade > 0) {\n return selector.replace(escapeptn, '$1').replace(andptn, '$1' + nscope);\n }\n\n break;\n }\n\n default:\n {\n // :hover\n return parent.trim() + selector.replace(andptn, '$1' + parent.trim());\n }\n }\n }\n\n default:\n {\n // html &\n if (invert * cascade > 0 && selector.indexOf('\\f') > 0) {\n return selector.replace(andptn, (parent.charCodeAt(0) === COLON ? '' : '$1') + parent.trim());\n }\n }\n }\n\n return parent + selector;\n }\n /**\n * Property\n *\n * @param {string} input\n * @param {number} first\n * @param {number} second\n * @param {number} third\n * @return {string}\n */\n\n\n function property(input, first, second, third) {\n var index = 0;\n var out = input + ';';\n var hash = first * 2 + second * 3 + third * 4;\n var cache; // animation: a, n, i characters\n\n if (hash === 944) {\n return animation(out);\n } else if (prefix === 0 || prefix === 2 && !vendor(out, 1)) {\n return out;\n } // vendor prefix\n\n\n switch (hash) {\n // text-decoration/text-size-adjust/text-shadow/text-align/text-transform: t, e, x\n case 1015:\n {\n // text-shadow/text-align/text-transform, a\n return out.charCodeAt(10) === 97 ? webkit + out + out : out;\n }\n // filter/fill f, i, l\n\n case 951:\n {\n // filter, t\n return out.charCodeAt(3) === 116 ? webkit + out + out : out;\n }\n // color/column, c, o, l\n\n case 963:\n {\n // column, n\n return out.charCodeAt(5) === 110 ? webkit + out + out : out;\n }\n // box-decoration-break, b, o, x\n\n case 1009:\n {\n if (out.charCodeAt(4) !== 100) {\n break;\n }\n }\n // mask, m, a, s\n // clip-path, c, l, i\n\n case 969:\n case 942:\n {\n return webkit + out + out;\n }\n // appearance: a, p, p\n\n case 978:\n {\n return webkit + out + moz + out + out;\n }\n // hyphens: h, y, p\n // user-select: u, s, e\n\n case 1019:\n case 983:\n {\n return webkit + out + moz + out + ms + out + out;\n }\n // background/backface-visibility, b, a, c\n\n case 883:\n {\n // backface-visibility, -\n if (out.charCodeAt(8) === DASH) {\n return webkit + out + out;\n } // image-set(...)\n\n\n if (out.indexOf('image-set(', 11) > 0) {\n return out.replace(imgsrcptn, '$1' + webkit + '$2') + out;\n }\n\n return out;\n }\n // flex: f, l, e\n\n case 932:\n {\n if (out.charCodeAt(4) === DASH) {\n switch (out.charCodeAt(5)) {\n // flex-grow, g\n case 103:\n {\n return webkit + 'box-' + out.replace('-grow', '') + webkit + out + ms + out.replace('grow', 'positive') + out;\n }\n // flex-shrink, s\n\n case 115:\n {\n return webkit + out + ms + out.replace('shrink', 'negative') + out;\n }\n // flex-basis, b\n\n case 98:\n {\n return webkit + out + ms + out.replace('basis', 'preferred-size') + out;\n }\n }\n }\n\n return webkit + out + ms + out + out;\n }\n // order: o, r, d\n\n case 964:\n {\n return webkit + out + ms + 'flex' + '-' + out + out;\n }\n // justify-items/justify-content, j, u, s\n\n case 1023:\n {\n // justify-content, c\n if (out.charCodeAt(8) !== 99) {\n break;\n }\n\n cache = out.substring(out.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');\n return webkit + 'box-pack' + cache + webkit + out + ms + 'flex-pack' + cache + out;\n }\n // cursor, c, u, r\n\n case 1005:\n {\n return cursorptn.test(out) ? out.replace(colonptn, ':' + webkit) + out.replace(colonptn, ':' + moz) + out : out;\n }\n // writing-mode, w, r, i\n\n case 1000:\n {\n cache = out.substring(13).trim();\n index = cache.indexOf('-') + 1;\n\n switch (cache.charCodeAt(0) + cache.charCodeAt(index)) {\n // vertical-lr\n case 226:\n {\n cache = out.replace(writingptn, 'tb');\n break;\n }\n // vertical-rl\n\n case 232:\n {\n cache = out.replace(writingptn, 'tb-rl');\n break;\n }\n // horizontal-tb\n\n case 220:\n {\n cache = out.replace(writingptn, 'lr');\n break;\n }\n\n default:\n {\n return out;\n }\n }\n\n return webkit + out + ms + cache + out;\n }\n // position: sticky\n\n case 1017:\n {\n if (out.indexOf('sticky', 9) === -1) {\n return out;\n }\n }\n // display(flex/inline-flex/inline-box): d, i, s\n\n case 975:\n {\n index = (out = input).length - 10;\n cache = (out.charCodeAt(index) === 33 ? out.substring(0, index) : out).substring(input.indexOf(':', 7) + 1).trim();\n\n switch (hash = cache.charCodeAt(0) + (cache.charCodeAt(7) | 0)) {\n // inline-\n case 203:\n {\n // inline-box\n if (cache.charCodeAt(8) < 111) {\n break;\n }\n }\n // inline-box/sticky\n\n case 115:\n {\n out = out.replace(cache, webkit + cache) + ';' + out;\n break;\n }\n // inline-flex\n // flex\n\n case 207:\n case 102:\n {\n out = out.replace(cache, webkit + (hash > 102 ? 'inline-' : '') + 'box') + ';' + out.replace(cache, webkit + cache) + ';' + out.replace(cache, ms + cache + 'box') + ';' + out;\n }\n }\n\n return out + ';';\n }\n // align-items, align-center, align-self: a, l, i, -\n\n case 938:\n {\n if (out.charCodeAt(5) === DASH) {\n switch (out.charCodeAt(6)) {\n // align-items, i\n case 105:\n {\n cache = out.replace('-items', '');\n return webkit + out + webkit + 'box-' + cache + ms + 'flex-' + cache + out;\n }\n // align-self, s\n\n case 115:\n {\n return webkit + out + ms + 'flex-item-' + out.replace(selfptn, '') + out;\n }\n // align-content\n\n default:\n {\n return webkit + out + ms + 'flex-line-pack' + out.replace('align-content', '').replace(selfptn, '') + out;\n }\n }\n }\n\n break;\n }\n // min/max\n\n case 973:\n case 989:\n {\n // min-/max- height/width/block-size/inline-size\n if (out.charCodeAt(3) !== DASH || out.charCodeAt(4) === 122) {\n break;\n }\n }\n // height/width: min-content / width: max-content\n\n case 931:\n case 953:\n {\n if (dimensionptn.test(input) === true) {\n // stretch\n if ((cache = input.substring(input.indexOf(':') + 1)).charCodeAt(0) === 115) return property(input.replace('stretch', 'fill-available'), first, second, third).replace(':fill-available', ':stretch');else return out.replace(cache, webkit + cache) + out.replace(cache, moz + cache.replace('fill-', '')) + out;\n }\n\n break;\n }\n // transform, transition: t, r, a\n\n case 962:\n {\n out = webkit + out + (out.charCodeAt(5) === 102 ? ms + out : '') + out; // transitions\n\n if (second + third === 211 && out.charCodeAt(13) === 105 && out.indexOf('transform', 10) > 0) {\n return out.substring(0, out.indexOf(';', 27) + 1).replace(transformptn, '$1' + webkit + '$2') + out;\n }\n\n break;\n }\n }\n\n return out;\n }\n /**\n * Vendor\n *\n * @param {string} content\n * @param {number} context\n * @return {boolean}\n */\n\n\n function vendor(content, context) {\n var index = content.indexOf(context === 1 ? ':' : '{');\n var key = content.substring(0, context !== 3 ? index : 10);\n var value = content.substring(index + 1, content.length - 1);\n return should(context !== 2 ? key : key.replace(pseudofmt, '$1'), value, context);\n }\n /**\n * Supports\n *\n * @param {string} match\n * @param {string} group\n * @return {string}\n */\n\n\n function supports(match, group) {\n var out = property(group, group.charCodeAt(0), group.charCodeAt(1), group.charCodeAt(2));\n return out !== group + ';' ? out.replace(propertyptn, ' or ($1)').substring(4) : '(' + group + ')';\n }\n /**\n * Animation\n *\n * @param {string} input\n * @return {string}\n */\n\n\n function animation(input) {\n var length = input.length;\n var index = input.indexOf(':', 9) + 1;\n var declare = input.substring(0, index).trim();\n var out = input.substring(index, length - 1).trim();\n\n switch (input.charCodeAt(9) * keyed) {\n case 0:\n {\n break;\n }\n // animation-*, -\n\n case DASH:\n {\n // animation-name, n\n if (input.charCodeAt(10) !== 110) {\n break;\n }\n }\n // animation/animation-name\n\n default:\n {\n // split in case of multiple animations\n var list = out.split((out = '', animationptn));\n\n for (var i = 0, index = 0, length = list.length; i < length; index = 0, ++i) {\n var value = list[i];\n var items = value.split(propertiesptn);\n\n while (value = items[index]) {\n var peak = value.charCodeAt(0);\n\n if (keyed === 1 && ( // letters\n peak > AT && peak < 90 || peak > 96 && peak < 123 || peak === UNDERSCORE || // dash but not in sequence i.e --\n peak === DASH && value.charCodeAt(1) !== DASH)) {\n // not a number/function\n switch (isNaN(parseFloat(value)) + (value.indexOf('(') !== -1)) {\n case 1:\n {\n switch (value) {\n // not a valid reserved keyword\n case 'infinite':\n case 'alternate':\n case 'backwards':\n case 'running':\n case 'normal':\n case 'forwards':\n case 'both':\n case 'none':\n case 'linear':\n case 'ease':\n case 'ease-in':\n case 'ease-out':\n case 'ease-in-out':\n case 'paused':\n case 'reverse':\n case 'alternate-reverse':\n case 'inherit':\n case 'initial':\n case 'unset':\n case 'step-start':\n case 'step-end':\n {\n break;\n }\n\n default:\n {\n value += key;\n }\n }\n }\n }\n }\n\n items[index++] = value;\n }\n\n out += (i === 0 ? '' : ',') + items.join(' ');\n }\n }\n }\n\n out = declare + out + ';';\n if (prefix === 1 || prefix === 2 && vendor(out, 1)) return webkit + out + out;\n return out;\n }\n /**\n * Isolate\n *\n * @param {Array} current\n */\n\n\n function isolate(current) {\n for (var i = 0, length = current.length, selector = Array(length), padding, element; i < length; ++i) {\n // split individual elements in a selector i.e h1 h2 === [h1, h2]\n var elements = current[i].split(elementptn);\n var out = '';\n\n for (var j = 0, size = 0, tail = 0, code = 0, l = elements.length; j < l; ++j) {\n // empty element\n if ((size = (element = elements[j]).length) === 0 && l > 1) {\n continue;\n }\n\n tail = out.charCodeAt(out.length - 1);\n code = element.charCodeAt(0);\n padding = '';\n\n if (j !== 0) {\n // determine if we need padding\n switch (tail) {\n case STAR:\n case TILDE:\n case GREATERTHAN:\n case PLUS:\n case SPACE:\n case OPENPARENTHESES:\n {\n break;\n }\n\n default:\n {\n padding = ' ';\n }\n }\n }\n\n switch (code) {\n case AND:\n {\n element = padding + nscopealt;\n }\n\n case TILDE:\n case GREATERTHAN:\n case PLUS:\n case SPACE:\n case CLOSEPARENTHESES:\n case OPENPARENTHESES:\n {\n break;\n }\n\n case OPENBRACKET:\n {\n element = padding + element + nscopealt;\n break;\n }\n\n case COLON:\n {\n switch (element.charCodeAt(1) * 2 + element.charCodeAt(2) * 3) {\n // :global\n case 530:\n {\n if (escape > 0) {\n element = padding + element.substring(8, size - 1);\n break;\n }\n }\n // :hover, :nth-child(), ...\n\n default:\n {\n if (j < 1 || elements[j - 1].length < 1) {\n element = padding + nscopealt + element;\n }\n }\n }\n\n break;\n }\n\n case COMMA:\n {\n padding = '';\n }\n\n default:\n {\n if (size > 1 && element.indexOf(':') > 0) {\n element = padding + element.replace(pseudoptn, '$1' + nscopealt + '$2');\n } else {\n element = padding + element + nscopealt;\n }\n }\n }\n\n out += element;\n }\n\n selector[i] = out.replace(formatptn, '').trim();\n }\n\n return selector;\n }\n /**\n * Proxy\n *\n * @param {number} context\n * @param {string} content\n * @param {Array} selectors\n * @param {Array} parents\n * @param {number} line\n * @param {number} column\n * @param {number} length\n * @param {number} id\n * @param {number} depth\n * @param {number} at\n * @return {(string|void|*)}\n */\n\n\n function proxy(context, content, selectors, parents, line, column, length, id, depth, at) {\n for (var i = 0, out = content, next; i < plugged; ++i) {\n switch (next = plugins[i].call(stylis, context, out, selectors, parents, line, column, length, id, depth, at)) {\n case void 0:\n case false:\n case true:\n case null:\n {\n break;\n }\n\n default:\n {\n out = next;\n }\n }\n }\n\n if (out !== content) {\n return out;\n }\n }\n /**\n * @param {number} code\n * @param {number} index\n * @param {number} length\n * @param {string} body\n * @return {number}\n */\n\n\n function delimited(code, index, length, body) {\n for (var i = index + 1; i < length; ++i) {\n switch (body.charCodeAt(i)) {\n // /*\n case FOWARDSLASH:\n {\n if (code === STAR) {\n if (body.charCodeAt(i - 1) === STAR && index + 2 !== i) {\n return i + 1;\n }\n }\n\n break;\n }\n // //\n\n case NEWLINE:\n {\n if (code === FOWARDSLASH) {\n return i + 1;\n }\n }\n }\n }\n\n return i;\n }\n /**\n * @param {number} type\n * @param {number} index\n * @param {number} length\n * @param {number} find\n * @param {string} body\n * @return {number}\n */\n\n\n function match(type, index, length, body) {\n for (var i = index + 1; i < length; ++i) {\n switch (body.charCodeAt(i)) {\n case type:\n {\n return i;\n }\n }\n }\n\n return i;\n }\n /**\n * Minify\n *\n * @param {(string|*)} output\n * @return {string}\n */\n\n\n function minify(output) {\n return output.replace(formatptn, '').replace(beforeptn, '').replace(afterptn, '$1').replace(tailptn, '$1').replace(whiteptn, ' ');\n }\n /**\n * Use\n *\n * @param {(Array|function(...?)|number|void)?} plugin\n */\n\n\n function use(plugin) {\n switch (plugin) {\n case void 0:\n case null:\n {\n plugged = plugins.length = 0;\n break;\n }\n\n default:\n {\n if (typeof plugin === 'function') {\n plugins[plugged++] = plugin;\n } else if (_typeof(plugin) === 'object') {\n for (var i = 0, length = plugin.length; i < length; ++i) {\n use(plugin[i]);\n }\n } else {\n unkwn = !!plugin | 0;\n }\n }\n }\n\n return use;\n }\n /**\n * Set\n *\n * @param {*} options\n */\n\n\n function set(options) {\n for (var name in options) {\n var value = options[name];\n\n switch (name) {\n case 'keyframe':\n keyed = value | 0;\n break;\n\n case 'global':\n escape = value | 0;\n break;\n\n case 'cascade':\n cascade = value | 0;\n break;\n\n case 'compress':\n compress = value | 0;\n break;\n\n case 'semicolon':\n semicolon = value | 0;\n break;\n\n case 'preserve':\n preserve = value | 0;\n break;\n\n case 'prefix':\n should = null;\n\n if (!value) {\n prefix = 0;\n } else if (typeof value !== 'function') {\n prefix = 1;\n } else {\n prefix = 2;\n should = value;\n }\n\n }\n }\n\n return set;\n }\n /**\n * Stylis\n *\n * @param {string} selector\n * @param {string} input\n * @return {*}\n */\n\n\n function stylis(selector, input) {\n if (this !== void 0 && this.constructor === stylis) {\n return factory(selector);\n } // setup\n\n\n var ns = selector;\n var code = ns.charCodeAt(0); // trim leading whitespace\n\n if (code < 33) {\n code = (ns = ns.trim()).charCodeAt(0);\n } // keyframe/animation namespace\n\n\n if (keyed > 0) {\n key = ns.replace(invalidptn, code === OPENBRACKET ? '' : '-');\n } // reset, used to assert if a plugin is moneky-patching the return value\n\n\n code = 1; // cascade/isolate\n\n if (cascade === 1) {\n nscope = ns;\n } else {\n nscopealt = ns;\n }\n\n var selectors = [nscope];\n var result; // execute plugins, pre-process context\n\n if (plugged > 0) {\n result = proxy(PREPS, input, selectors, selectors, line, column, 0, 0, 0, 0);\n\n if (result !== void 0 && typeof result === 'string') {\n input = result;\n }\n } // build\n\n\n var output = compile(array, selectors, input, 0, 0); // execute plugins, post-process context\n\n if (plugged > 0) {\n result = proxy(POSTS, output, selectors, selectors, line, column, output.length, 0, 0, 0); // bypass minification\n\n if (result !== void 0 && typeof (output = result) !== 'string') {\n code = 0;\n }\n } // reset\n\n\n key = '';\n nscope = '';\n nscopealt = '';\n pattern = 0;\n line = 1;\n column = 1;\n return compress * code === 0 ? output : minify(output);\n }\n\n stylis['use'] = use;\n stylis['set'] = set;\n\n if (options !== void 0) {\n set(options);\n }\n\n return stylis;\n});","/*\n * decaffeinate suggestions:\n * DS102: Remove unnecessary code created because of implicit returns\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md\n */\n$(() => {\n $.fn.select2.defaults.set('placeholder', '');\n $('.form-select2').select2({\n theme: 'bootstrap',\n width: '100%',\n allowClear: true,\n });\n});\n","const registerSubmitClickEvent = () => {\n const submit = document.querySelector(\n 'input[type=submit].prevent-double-submit'\n );\n if (submit === null) {\n return;\n }\n\n const handler = () => {\n submit.classList.add('disabled');\n };\n submit.addEventListener('click', handler);\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n registerSubmitClickEvent();\n});\n","/*\n * decaffeinate suggestions:\n * DS102: Remove unnecessary code created because of implicit returns\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md\n */\n$(() => {\n $('.delay-icon-tooltip').tooltip();\n return $('[data-toggle=\"tooltip\"]').tooltip();\n});\n","const registerPulldownMenuChangeEvent = () => {\n const updateWillEdit = async (postId, adminUserId) => {\n const response = await fetch(`/posts/${postId}/will_edit`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n admin_user_id: adminUserId,\n }),\n });\n const data = await response.text();\n\n return { response, data };\n };\n\n const eventHandler = (e) => {\n const element = e.target;\n e.preventDefault();\n e.stopPropagation();\n const postId = element.parentElement.id;\n const adminUserId = element.value;\n updateWillEdit(postId, adminUserId).then(({ response, data }) => {\n if (response.ok) {\n const linkText = document.getElementById(postId);\n linkText.parentElement.classList.add('done-background');\n linkText.parentElement.innerHTML = data;\n } else if ([409, 400].includes(response.status)) {\n const linkText = document.getElementById(postId);\n linkText.parentElement.classList.add('fail-background');\n linkText.parentElement.innerHTML = data;\n } else {\n throw new Error('Unexpected response.');\n }\n });\n };\n\n // select2のプルダウンメニューはjQueryのchangeイベントしか発行しない\n // - https://github.com/select2/select2/issues/1908\n // - https://github.com/select2/select2/issues/4686\n // 従って$el.changeを使っているが、select2を取り除いた際に$el.changeは消してquerySelectorAllとaddEventListenerで置き換えたい(jQuery依存排除のため)\n const $selector = $('.will-edit-link > select');\n $selector.change(eventHandler);\n};\n\nconst registerWillEditClickEvent = () => {\n const willEditLink = document.getElementById('will-edit-link');\n if (willEditLink === null) {\n return;\n }\n\n const updateWillEdit = async () => {\n const response = await fetch(willEditLink.getAttribute('href'), {\n method: 'POST',\n });\n const data = await response.text();\n\n return { response, data };\n };\n\n const eventHandler = (e) => {\n e.preventDefault();\n e.stopPropagation();\n updateWillEdit().then(({ response, data }) => {\n if (response.ok || [409, 400].includes(response.status)) {\n // responseがokでもエラーでも同じ処理を行う\n willEditLink.parentElement.innerHTML = data;\n } else {\n throw new Error('Unexpected response.');\n }\n });\n };\n\n willEditLink.addEventListener('click', eventHandler, { passive: false });\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n registerPulldownMenuChangeEvent();\n registerWillEditClickEvent();\n});\n","const linkElements = document.querySelectorAll('.no-reply-necessary');\nconst handler = (e) => {\n e.preventDefault();\n e.stopPropagation();\n\n const element = e.currentTarget;\n const confirmText = element.dataset.confirm;\n // eslint-disable-next-line no-alert, no-restricted-globals\n if (confirmText && !confirm(confirmText)) {\n return;\n }\n\n const updateFeedback = async () => {\n const response = await fetch(element.getAttribute('href'), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n return response;\n };\n\n updateFeedback().then((response) => {\n if (response.ok) {\n document.getElementById(element.dataset.id).remove();\n } else {\n throw new Error('Unexpected response.');\n }\n });\n};\n\nlinkElements.forEach((element) => {\n element.addEventListener('click', handler);\n});\n","const escapeHtml = (str) => {\n let escapedStr = str.replace(/&/g, '&');\n escapedStr = escapedStr.replace(/>/g, '>');\n escapedStr = escapedStr.replace(/ {\n const nativeFormatPostsSupplierScriptElement = document.getElementById(\n 'native_format_posts_supplier_script'\n );\n\n if (nativeFormatPostsSupplierScriptElement) {\n const escapedScript = escapeHtml(\n nativeFormatPostsSupplierScriptElement.value\n );\n nativeFormatPostsSupplierScriptElement.value = escapedScript;\n }\n });\n}\n","import MarkJS from 'mark.js';\n\n// highlight given keyword using markjs\nconst highlightKeyword = function (selector, keyword) {\n const markJS = new MarkJS(selector);\n markJS.mark(keyword, {\n className: 'highlighted',\n });\n};\n\nexport default function (hiddenInputId, selector) {\n let splitKeyword;\n const hiddenField = document.getElementById(hiddenInputId);\n if (hiddenField === null) {\n return;\n }\n\n try {\n splitKeyword = JSON.parse(hiddenField.value);\n } catch (error) {\n splitKeyword = [hiddenField.value];\n }\n\n if (!Array.isArray(splitKeyword)) {\n return;\n }\n\n splitKeyword.forEach((keyword) => {\n highlightKeyword(selector, keyword);\n });\n}\n","import highlightHelper from './shared/highlight_helper';\n\nhighlightHelper(\n 'search_condition_post_copy_split_text_json',\n '.post-copies-table td .post_copy_title_text'\n);\n","const registerFormAmountChangeEvent = () => {\n const postCopyOutsourceFormAmount = document.getElementById(\n 'post_copy_outsource_form_amount'\n );\n if (postCopyOutsourceFormAmount === null) {\n return;\n }\n\n const selectors = [\n '#post_copy_outsource_unit_cost',\n '#post_copy_outsource_unit_size',\n '#post_copy_outsource_adjustment',\n ];\n\n const handleChangeEvent = () => {\n const [unitCost, unitSize, adjustment] = selectors.map((id) =>\n parseInt(document.querySelector(id).value, 10)\n );\n\n postCopyOutsourceFormAmount.innerText = unitCost * unitSize + adjustment;\n };\n\n document.querySelectorAll(selectors.join(',')).forEach((element) => {\n element.addEventListener('change', handleChangeEvent);\n });\n};\n\nregisterFormAmountChangeEvent();\n","/*\n * decaffeinate suggestions:\n * DS102: Remove unnecessary code created because of implicit returns\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md\n */\nimport mermaid from 'mermaid';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n mermaid.initialize({ startOnLoad: true });\n});\n","import highlightHelper from './shared/highlight_helper';\n\nhighlightHelper(\n 'search_condition_post_tag_name',\n '#post_tags_table .post-tag-name'\n);\n","const registerSelectChangeEvent = () => {\n const handler = () => {\n const url = new URL('/posts/waiting_for_confirmation', document.baseURI);\n const params = url.searchParams;\n\n const [postType, postCategoryId, trainingStatus, assignee] = [\n document.getElementById('waiting-for-confirmation-post_type').value,\n document.getElementById('waiting-for-confirmation-post_category_id')\n .value,\n document.getElementById('waiting-for-confirmation-training_status').value,\n document.getElementById('waiting-for-confirmation-assignee').value,\n ];\n\n params.set('post_type', postType);\n params.set('post_category_id', postCategoryId);\n params.set('training_status', trainingStatus);\n params.set('assignee', assignee);\n\n window.location = url.toString();\n };\n\n document\n .querySelectorAll('.waiting-for-confirmation select')\n .forEach((element) => {\n element.addEventListener('change', handler);\n });\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n registerSelectChangeEvent();\n});\n","function _typeof2(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\n/**!\n * Sortable 1.10.2\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}\n\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nvar version = \"1.10.2\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\n\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\nvar captureMode = {\n capture: false,\n passive: false\n};\n\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction matches(\n/**HTMLElement*/\nel,\n/**String*/\nselector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n\n return false;\n}\n\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\n\nfunction closest(\n/**HTMLElement*/\nel,\n/**String*/\nselector,\n/**HTMLElement*/\nctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n\n return null;\n}\n\nvar R_SPACE = /\\s+/g;\n\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\n\nfunction css(el, prop, val) {\n var style = el && el.style;\n\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\n\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n\n } while (!selfOnly && (el = el.parentNode));\n }\n\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n\n return matrixFn && new matrixFn(appliedTransforms);\n}\n\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n\n return list;\n }\n\n return [];\n}\n\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n/**\r\n * Returns the \"bounding client rect\" of given element\r\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\r\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\r\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\r\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\r\n * @param {[HTMLElement]} container The parent the element will be placed in\r\n * @return {Object} The boundingClientRect of el, with specified adjustments\r\n */\n\n\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n\n if (el !== window && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container\n\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n\n } while (container = container.parentNode);\n }\n }\n\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n/**\r\n * Checks if a side of an element is scrolled past a side of its parents\r\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\r\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\r\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\r\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\r\n */\n\n\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n /* jshint boss:true */\n\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n\n return false;\n}\n/**\r\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\r\n * and non-draggable elements\r\n * @param {HTMLElement} el The parent element\r\n * @param {Number} childNum The index of the child\r\n * @param {Object} options Parent Sortable's options\r\n * @return {HTMLElement} The child at index childNum, or null if not found\r\n */\n\n\nfunction getChild(el, childNum, options) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && children[i] !== Sortable.dragged && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n\n currentChild++;\n }\n\n i++;\n }\n\n return null;\n}\n/**\r\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\r\n * @param {HTMLElement} el Parent element\r\n * @param {selector} selector Any other elements that should be ignored\r\n * @return {HTMLElement} The last child, ignoring ghostEl\r\n */\n\n\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n\n return last || null;\n}\n/**\r\n * Returns the index of an element within its parent for a selected set of\r\n * elements\r\n * @param {HTMLElement} el\r\n * @param {selector} selector\r\n * @return {number}\r\n */\n\n\nfunction index(el, selector) {\n var index = 0;\n\n if (!el || !el.parentNode) {\n return -1;\n }\n /* jshint boss:true */\n\n\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n\n return index;\n}\n/**\r\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\r\n * The value is returned in real pixels.\r\n * @param {HTMLElement} el\r\n * @return {Array} Offsets in the format of [left, top]\r\n */\n\n\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n\n return [offsetLeft, offsetTop];\n}\n/**\r\n * Returns the index of the object within the given array\r\n * @param {Array} arr Array that may or may not hold the object\r\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\r\n * @return {Number} The index of the object in the array, or -1\r\n */\n\n\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n\n return -1;\n}\n\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n\n } while (elem = elem.parentNode);\n\n return getWindowScrollingElement();\n}\n\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst;\n}\n\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\n\nvar _throttleTimeout;\n\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\n\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\n\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\n\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\n\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\n\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\n\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n\n var fromRect = _objectSpread({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation\n\n\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n\n target.toRect = toRect;\n\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n } // if fromRect != toRect: animate\n\n\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n\n if (!time) {\n time = _this.options.animation;\n }\n\n _this.animate(target, animatingRect, toRect, time);\n }\n\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\n\nfunction repaint(target) {\n return target.offsetWidth;\n}\n\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n\n this.eventCanceled = false;\n\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable\n\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread({\n sortable: sortable\n }, evt));\n } // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n\n\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized; // Add default options from plugin\n\n _extends(defaults, initialized.defaults);\n });\n\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n\n var allEventProperties = _objectSpread({}, extraEventProperties, PluginManager.getEventProperties(name, sortable));\n\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, [\"evt\"]);\n\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\n\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\n\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\nghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n_silent = false,\n savedInputChecked = [];\n/** @const */\n\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\nsupportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return; // false when <= IE11\n\n if (IE11OrLess) {\n return false;\n }\n\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n}(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n},\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n},\n\n/**\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\n * @param {Number} x X position\n * @param {Number} y Y position\n * @return {HTMLElement} Element of the first found nearest Sortable\n */\n_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n if (lastChild(sortable)) return;\n var rect = getRect(sortable),\n threshold = sortable[expando].options.emptyInsertThreshold,\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n\n if (threshold && insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n},\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n\n var group = {};\n var originalGroup = options.group;\n\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n},\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n},\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position\n\n\nif (documentExists) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\n\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n\n if (nearest) {\n // Create imitation event\n var event = {};\n\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n\n nearest[expando]._onDragOver(event);\n }\n }\n};\n\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n/**\n * @class Sortable\n * @param {HTMLElement} el\n * @param {Object} [options]\n */\n\n\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n\n this.el = el; // root element\n\n this.options = options = _extends({}, options); // Export instance\n\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults); // Set default options\n\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n\n _prepareGroup(options); // Bind all private methods\n\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n } // Setup drag mode\n\n\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n } // Bind events\n\n\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n\n sortables.push(this.el); // Restore sorting\n\n options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager\n\n _extends(this, AnimationStateManager());\n}\n\nSortable.prototype =\n/** @lends Sortable.prototype */\n{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart(\n /** Event|TouchEvent */\n evt) {\n if (!evt.cancelable) return;\n\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n\n _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n\n\n if (dragEl) {\n return;\n }\n\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n } // cancel dnd if original target is content editable\n\n\n if (originalTarget.isContentEditable) {\n return;\n }\n\n target = closest(target, options.draggable, el, false);\n\n if (target && target.animated) {\n return;\n }\n\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n } // Get the index of the dragged element within its parent\n\n\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable); // Check filter\n\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n } // Prepare `dragstart`\n\n\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart(\n /** Event */\n evt,\n /** Touch */\n touch,\n /** HTMLElement */\n target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n _this._onDrop();\n\n return;\n } // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n\n\n _this._disableDelayedDragEvents();\n\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n } // Bind the events: dragstart/dragend\n\n\n _this._triggerDragStart(evt, touch); // Drag start event\n\n\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n }); // Chosen item\n\n\n toggleClass(dragEl, options.chosenClass, true);\n }; // Disable \"draggable\"\n\n\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)\n\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n\n pluginEvent('delayStart', this, {\n evt: evt\n }); // Delay is impossible for native DnD in Edge or IE\n\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n } // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n\n\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(\n /** TouchEvent|PointerEvent **/\n e) {\n var touch = e.touches ? e.touches[0] : e;\n\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart(\n /** Event */\n evt,\n /** Touch */\n touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n awaitingDragStarted = false;\n\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n\n var options = this.options; // Apply effect\n\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost(); // Drag start event\n\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n\n _hideGhostForTarget();\n\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n\n target = parent; // store last element\n }\n /* jshint boss:true */\n while (parent = parent.parentNode);\n }\n\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove(\n /**TouchEvent*/\n evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging\n\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n\n this._onDragStart(evt, true);\n }\n\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options; // Position absolutely\n\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl); // Set transform-origin\n\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart(\n /**Event*/\n evt,\n /**boolean*/\n fallback) {\n var _this = this;\n\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n }\n\n pluginEvent('setupClone', this);\n\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n\n this._hideClone();\n\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n } // #1143: IFrame support workaround\n\n\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n\n _this._hideClone();\n\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events\n\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n\n on(document, 'drop', _this); // #1276 fix:\n\n css(dragEl, 'transform', 'translateZ(0)');\n }\n\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver(\n /**Event*/\n evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n\n if (_silent) return;\n\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n } // Capture animation state\n\n\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n\n _this.captureAnimationState();\n\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n } // Return invocation when dragEl is inserted (or completed)\n\n\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n } // Animation\n\n\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n } // Null lastTarget if it is not inside a previously swapped element\n\n\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n } // no bubbling and not fallback\n\n\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted\n\n\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n } // Call when dragEl has been inserted\n\n\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n\n ignoreNextClick = false;\n\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = !rootEl.contains(dragEl)) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n\n if (revert) {\n parentEl = rootEl; // actualization\n\n capture();\n\n this._hideClone();\n\n dragOverEvent('revert');\n\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n\n return completed(true);\n }\n\n var elLastChild = lastChild(el, options.draggable);\n\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n } // assign target only if condition is true\n\n\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n\n if (target) {\n targetRect = getRect(target);\n }\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n el.appendChild(dragEl);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n } // If dragEl is already beside target: Do not insert\n\n\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n } // Undo chrome's scroll adjustment (has no effect on other browsers)\n\n\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n\n parentEl = dragEl.parentNode; // actualization\n // must be done before animation\n\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n\n changed();\n return completed(true);\n }\n }\n\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop(\n /**Event*/\n evt) {\n var el = this.el,\n options = this.options; // Get the index of the dragged element within its parent\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode; // Get again after plugin event\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n if (Sortable.eventCanceled) {\n this._nulling();\n\n return;\n }\n\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n\n _cancelNextTick(this.cloneId);\n\n _cancelNextTick(this._dragStartId); // Unbind events\n\n\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n\n this._offMoveEvents();\n\n this._offUpEvents();\n\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n\n css(dragEl, 'transform', '');\n\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n\n _disableDraggable(dragEl);\n\n dragEl.style['will-change'] = ''; // Remove classes\n // ghostClass is added in dragStarted\n\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n\n toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event\n\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n }); // Remove event\n\n\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n }); // drag from one list and drop into another\n\n\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n }); // Save sorting\n\n\n this.save();\n }\n }\n }\n\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent(\n /**Event*/\n evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n\n break;\n\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n\n _globalDragOver(evt);\n }\n\n break;\n\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n\n /**\n * Serializes the item into an array of string.\n * @returns {String[]}\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n\n for (; i < n; i++) {\n el = children[i];\n\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n\n return order;\n },\n\n /**\n * Sorts the elements according to the array.\n * @param {String[]} order order of the items\n */\n sort: function sort(order) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n },\n\n /**\n * Save the current sorting\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n\n /**\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\n * @param {HTMLElement} el\n * @param {String} [selector] default: `options.draggable`\n * @returns {HTMLElement|null}\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n\n /**\n * Set/get option\n * @param {string} name\n * @param {*} [value]\n * @returns {*}\n */\n option: function option(name, value) {\n var options = this.options;\n\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n\n /**\n * Destroy\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n } // Remove draggable attributes\n\n\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n\n this._onDrop();\n\n this._disableDelayedDragEvents();\n\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n\n return;\n }\n\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return; // show clone at dragEl or original position\n\n if (rootEl.contains(dragEl) && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\n\nfunction _globalDragOver(\n/**Event*/\nevt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n\n evt.cancelable && evt.preventDefault();\n}\n\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal; // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n\n return retVal;\n}\n\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\n\nfunction _unsilent() {\n _silent = false;\n}\n\nfunction _ghostIsLast(evt, vertical, sortable) {\n var rect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var spacer = 10;\n return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;\n}\n\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n\n invert = invert || invertSwap;\n\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n\n return 0;\n}\n/**\n * Gets the direction dragEl must be swapped relative to target in order to make it\n * seem that dragEl has been \"inserted\" into that element's position\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\n * @return {Number} Direction dragEl must be swapped\n */\n\n\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n/**\n * Generate id\n * @param {HTMLElement} el\n * @returns {String}\n * @private\n */\n\n\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n\n while (i--) {\n sum += str.charCodeAt(i);\n }\n\n return sum.toString(36);\n}\n\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\n\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\n\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n} // Fixed #973:\n\n\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n} // Export utils\n\n\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n/**\n * Get the Sortable instance of an element\n * @param {HTMLElement} element The element\n * @return {Sortable|undefined} The instance of Sortable\n */\n\nSortable.get = function (element) {\n return element[expando];\n};\n/**\n * Mount a plugin to Sortable\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\n */\n\n\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n\n if (plugin.utils) Sortable.utils = _objectSpread({}, Sortable.utils, plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n/**\n * Create sortable instance\n * @param {HTMLElement} el\n * @param {Object} [options]\n */\n\n\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n}; // Export\n\n\nSortable.version = version;\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\n\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n }; // Bind all private methods\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent; // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt; // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n\n if (fallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change\n\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour\n\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\n\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\n\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\n\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn; // New scroll root, set scrollEl\n\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n\n var layersOut = 0;\n var currentParent = scrollEl;\n\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n\n }\n\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\n\nfunction Revert() {}\n\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n\n this.sortable.animateAll();\n\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\n\nfunction Remove() {}\n\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\n\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\n\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\nmultiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\nfolding = false,\n // Folding any other time\ndragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\n\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n\n dataTransfer.setData('Text', data);\n }\n };\n }\n\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n\n sortable._hideClone();\n\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n }); // Sort multi-drag elements\n\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n sortable.captureAnimationState();\n\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n } // Remove all auxiliary multidrag items from el, if sorting enabled\n\n\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n\n initialFolding = false; // If leaving sort:false root, or already folding - Fold to new location\n\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute); // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n } // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n\n\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n\n activeSortable._showClone(sortable); // Unfold animation for clones if showing from hidden\n\n\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children; // Multi-drag selection\n\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvt: evt\n }); // Modifier activated, select from last to dragEl\n\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvt: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvt: evt\n });\n }\n } // Multi-drag drop\n\n\n if (dragStarted && this.isMultiDrag) {\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect; // Prepare unfold animation\n\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n } // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n\n\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n\n multiDragIndex++;\n }); // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n\n if (update) {\n dispatchSortableEvent('update');\n }\n }\n } // Must be done after capturing individual rects (scroll bar)\n\n\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n\n multiDragSortable = toSortable;\n } // Remove clones if necessary\n\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return; // Only deselect if selection is in this sortable\n\n if (multiDragSortable !== this.sortable) return; // Only deselect if target is not item in this sortable\n\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return; // Only deselect if left click\n\n if (evt && evt.button !== 0) return;\n\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvt: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n\n multiDragSortable = sortable;\n }\n\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n }); // multiDragElements will already be sorted if folding\n\n var newIndex;\n\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n\n return key;\n }\n }\n });\n}\n\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\n\n\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\n\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };","const formElements = document.querySelectorAll('.feature-post-by-date');\n\nformElements.forEach((element) => {\n element.addEventListener(\n 'submit',\n (e) => {\n e.preventDefault();\n\n const form = e.currentTarget;\n const date = form.querySelector('.feature-post-by-date-feature-at').value;\n const time = form.querySelector('.feature-post-by-date-append-time')\n .textContent;\n\n form.querySelector(\n '.feature-post-by-date-feature-at'\n ).value = `${date} ${time}`;\n\n form.submit();\n },\n { once: true }\n );\n});\n","import Sortable from 'sortablejs'; // TODO: replace with react-dnd and remove this.\n\nconst registerSortable = () => {\n if (document.getElementById('sortable') === null) {\n return;\n }\n\n Sortable.create(document.querySelector('#sortable tbody'), {\n draggable: '.item',\n animation: 150,\n dragClass: 'dragging-item',\n onChoose(e) {\n e.item\n .querySelectorAll('td')\n .forEach((el) => el.classList.remove('highlight-short'));\n },\n onEnd(e) {\n e.item\n .querySelectorAll('td')\n .forEach((el) => el.classList.add('highlight-short'));\n document.querySelector('.update-order').classList.remove('btn-success');\n document.querySelector('.update-order').removeAttribute('disabled');\n },\n });\n};\n\nconst registerButtonEvent = () => {\n const buttonElement = document.querySelector('.update-order');\n if (buttonElement === null) {\n return;\n }\n\n buttonElement.addEventListener('click', () => {\n buttonElement.setAttribute('disabled', true);\n const items = document.querySelectorAll('#sortable tr.item');\n const itemOrder = [].map.call(items, (obj) =>\n obj.getAttribute('data-item-id')\n );\n const requestPost = async () => {\n const response = await fetch(`${window.location.pathname}/reorder`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ posts: itemOrder }),\n });\n return response;\n };\n requestPost()\n .then((response) => {\n if (response.ok) {\n document.querySelector('.update-order').classList.add('btn-success');\n return;\n }\n\n throw new Error();\n })\n .catch(() => {\n document.querySelector('.update-order').classList.add('btn-danger');\n document.querySelector('.update-order').removeAttribute('disabled');\n });\n });\n};\n\nregisterSortable();\nregisterButtonEvent();\n","import autosize from 'autosize';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n autosize(document.querySelectorAll('.form-autosize'));\n});\n","// Calendar\n\nconst cal = document.getElementById('date-pager-calendar');\n\nif (cal !== null) {\n cal.addEventListener('change', (e) => {\n const originalUrl = window.location.href.split('?');\n const urlParams = originalUrl.length > 1 ? originalUrl[1].split('&') : [];\n let dateFound = false;\n for (let i = 0; i < urlParams.length; i += 1) {\n if (urlParams[i].split('=')[0] === 'date') {\n urlParams[i] = `date=${e.target.value}`;\n dateFound = true;\n }\n }\n if (dateFound === false) {\n urlParams.push(`date=${e.target.value}`);\n }\n window.location.href = `${originalUrl[0]}?${urlParams.join('&')}`;\n });\n}\n","import Sortable from 'sortablejs'; // TODO: replace with react-dnd and remove this.\n\nconst SORTABLE = '.sortable tbody';\nconst UPDATE_BTN = '.update-featured-order';\n\n/**\n * Activate sortablejs.\n * Also see: admin/posts/update_order.js\n * @private\n * @param {NodeList} elements\n */\nconst activateSortable = (elements) => {\n elements.forEach((el) => {\n Sortable.create(el, {\n draggable: '.item',\n animation: 150,\n dragClass: 'dragging-item',\n onChoose(e) {\n e.item\n .querySelectorAll('td')\n .forEach((cellElement) =>\n cellElement.classList.remove('highlight-short')\n );\n },\n onEnd(e) {\n e.item\n .querySelectorAll('td')\n .forEach((cellElement) =>\n cellElement.classList.add('highlight-short')\n );\n },\n });\n });\n};\n\n/**\n * Bind button clicked event.\n * @private\n * @param {NodeList} elements\n */\nconst bindEvents = (elements) => {\n /**\n * Re-render updated view\n * And setup again\n * @private\n * @param {Object} resp\n */\n const rerenderView = (resp) => {\n const areaElement = document.getElementById(resp.id);\n areaElement.innerHTML = resp.el;\n\n activateSortable(areaElement.querySelectorAll(SORTABLE));\n bindEvents(areaElement.querySelectorAll(UPDATE_BTN));\n };\n\n /**\n * Send request to update order.\n * @private\n * @param {Object} params\n * @return {Promise}\n */\n const request = async (params) => {\n const response = await fetch('/featured_posts/reorder', {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(params),\n });\n const data = await response.json();\n return { response, data };\n };\n\n elements.forEach((el) => {\n el.addEventListener('click', (e) => {\n const buttonElement = e.currentTarget;\n const tableElement = buttonElement.parentElement.nextElementSibling.nextElementSibling.querySelector(\n SORTABLE\n );\n\n buttonElement.classList.add('disabled');\n\n const ids = [...tableElement.querySelectorAll('.item')]\n .map((element) => element.dataset.itemId)\n .join(',');\n\n const params = {\n reorder: {\n ids,\n },\n };\n\n request(params)\n .then(({ response, data }) => {\n if (response.ok) {\n rerenderView(data);\n return;\n }\n throw new Error();\n })\n .catch((error) => {\n console.error(error); // eslint-disable-line no-console\n });\n });\n });\n};\n\nconst setup = () => {\n const sortableElements = document.querySelectorAll(SORTABLE);\n\n if (!sortableElements.length) {\n return;\n }\n\n activateSortable(sortableElements);\n\n const buttonElements = document.querySelectorAll(UPDATE_BTN);\n bindEvents(buttonElements);\n};\n\nsetup();\n","import jQuery from 'jquery';\n\nimport 'jquery-ujs';\nimport 'jquery-ui/ui/widgets/sortable';\nimport 'jquery-ui/ui/effects/effect-highlight';\nimport 'jquery-ui-touch-punch';\nimport 'bootstrap';\nimport 'select2';\nimport 'select2/dist/js/i18n/ja';\nimport 'select2/dist/css/select2.css';\nimport 'select2-bootstrap-theme/dist/select2-bootstrap.css';\n\nimport '../shared/raven_admin';\nimport '../shared/locari_twttr';\n\nimport '../admin';\n\nwindow.jQuery = jQuery;\nwindow.$ = jQuery;\n"],"sourceRoot":""}